/* public/style.css */
:root {
    --primary-color: #121212;
    --secondary-color: #f4f4f5;
    --accent-color: #007aff;
    --text-color: #333;
    --border-color: #e5e5e5;
    --error-bg-color: #fffbe6;
    --error-border-color: #fde047;
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-family);
    background-color: var(--secondary-color);
    color: var(--text-color);
}

.checkout-container {
    display: grid;
    grid-template-columns: 1fr;
    gap: 50px;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
}

@media (min-width: 992px) {
    .checkout-container {
        grid-template-columns: 1.5fr 1fr;
    display: flex;
    flex-direction: column;
    gap: 30px;
    }
}

/* --- Coluna Esquerda: Formulários --- */
.form-section {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.checkout-header h1 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-color);
}

.checkout-step {
    background-color: #fff;
    border: 1px solid var(--border-color);
    border-radius: 12px;
}

.step-header {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
}

.step-number {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-color: var(--primary-color);
    color: #fff;
    font-weight: 600;
}

.step-header h2 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--primary-color);
}

.step-content {
    padding: 25px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Estilos de Formulário */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group-inline { display: flex; gap: 20px; }
.form-group-half { flex: 1; }
.form-group-two-thirds { flex: 2; }
.form-group-one-third { flex: 1; }

.form-group label {
    font-weight: 600;
    font-size: 0.9rem;
}

.form-group input {
    padding: 12px 15px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-group input:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.1);
}

/* Seção de Frete */
.shipping-placeholder {
    color: #666;
    font-size: 0.95rem;
}

#shipping-options-container label {
    display: flex;
    justify-content: space-between;
    padding: 15px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    transition: border-color 0.2s, background-color 0.2s;
}

#shipping-options-container label:has(input:checked) {
    border-color: var(--accent-color);
    background-color: #f0f7ff;
}

/* Seção de Pagamento */
.payment-error {
    background-color: var(--error-bg-color);
    border: 1px solid var(--error-border-color);
    border-radius: 8px;
    padding: 20px;
}
.payment-error strong { color: #92400e; }
.payment-error p { color: #a16207; font-size: 0.9rem; margin-top: 5px; }

/* --- Coluna Direita: Resumo --- */
.summary-section {
    background-color: #fff;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 30px;
    height: fit-content;
    position: sticky;
    top: 40px;
}

/* Para telas maiores onde há layout em colunas */
@media (min-width: 1024px) {
    .checkout-container {
        display: grid;
        grid-template-columns: 1fr 400px;
        gap: 40px;
        align-items: start;
    }
    
    .summary-section {
        grid-column: 2;
        grid-row: 1 / span 2;
    }
    
    .upsell-section {
        grid-column: 1;
    }
}

.summary-section h2 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 20px;
}

#cart-items {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 25px;
}

.cart-item {
    display: flex;
    align-items: center;
    gap: 15px;
    position: relative; /* ▼▼▼ ALTERAÇÃO CIRÚRGICA ▼▼▼ */
}

.cart-item-image {
    width: 64px;
    height: 64px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.cart-item-details { flex-grow: 1; }
.cart-item-name { font-weight: 600; }
.cart-item-price { color: #555; font-size: 0.9rem; }

.summary-details {
    padding: 20px 0;
    border-top: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.summary-line, .summary-total {
    display: flex;
    justify-content: space-between;
    font-size: 1rem;
}

.summary-total {
    font-size: 1.2rem;
    font-weight: 700;
    margin-top: 10px;
}

.checkout-btn {
    width: 100%;
    padding: 15px;
    background-color: var(--accent-color);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    margin-top: 20px;
    transition: background-color 0.2s;
}

.validate-btn {
    width: 100%;
    padding: 15px;
    background-color: var(--accent-color);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    margin-top: 20px;
    transition: background-color 0.2s;
}

.checkout-btn:hover:not(:disabled) {
    background-color: #0056b3;
}

.checkout-btn:disabled {
    background-color: #b0b0b0;
    cursor: not-allowed;
}

/* Aplica o estilo ao container da variante esgotada */
.variant-option.variant-out-of-stock {
    opacity: 0.5 !important;
    cursor: not-allowed !important;
}

.variant-option.variant-out-of-stock label {
    color: #888 !important;
    text-decoration: line-through !important;
    cursor: not-allowed !important;
}

.variant-option.variant-out-of-stock input[type="radio"] {
    cursor: not-allowed !important;
}

.variant-option.variant-out-of-stock {
    pointer-events: none !important;
}

.cart-item-variant-section {
    font-size: 0.85rem;
    color: #666;
    padding: 8px 0;
    margin: 8px 0;
    border-top: 1px solid #eaeaea;
    border-bottom: 1px solid #eaeaea;
    display: flex;
    justify-content: space-between;
}

.variant-label {
    font-weight: 600;
}

/* ▼▼▼ ALTERAÇÃO CIRÚRGICA: ESTILOS PARA O SELETOR DE QUANTIDADE ▼▼▼ */
.quantity-selector {
    position: absolute;
    bottom: -15px; /* Posiciona abaixo dos detalhes do item */
    right: 0;
    display: flex;
    align-items: center;
    border: 1px solid #ddd;
    border-radius: 6px;
    background-color: #fff;
}

.qty-btn {
    background-color: #f8f9fa;
    border: none;
    color: #333;
    font-size: 1.2rem;
    font-weight: 600;
    cursor: pointer;
    width: 35px;
    height: 35px;
    transition: background-color 0.2s;
}

.qty-btn:hover {
    background-color: #f1f3f5;
}

.qty-btn:first-child {
    border-right: 1px solid #ddd;
    border-top-left-radius: 5px;
    border-bottom-left-radius: 5px;
}

.qty-btn:last-child {
    border-left: 1px solid #ddd;
    border-top-right-radius: 5px;
    border-bottom-right-radius: 5px;
}

.qty-display {
    font-size: 1rem;
    font-weight: 600;
    color: #333;
    width: 40px;
    text-align: center;
}

.upsell-section {
    /* Também mantém sua própria aparência de "bolha" */
    background-color: #fff;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    height: fit-content;
    position: sticky;
}

/* ▲▲▲ FIM DA CORREÇÃO ▲▲▲ */


/* O resto dos seus estilos para .summary-section h2, #cart-items, etc., permanecem os mesmos */

.summary-section h2 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 20px;
}

/* ... e assim por diante ... */

.upsell-section label {
    font-weight: 600;
    font-size: 0.9rem;
    display: block;
    margin-bottom: 10px;
}
#upsell-search-input {
    width: 100%;
    padding: 10px 12px; /* Padding menor para um visual mais compacto */
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 0.9rem;
    font-family: inherit;
}

#upsell-results-container {
    margin-top: 10px;
    max-height: 200px; /* Limita a altura para não ocupar muito espaço */
    overflow-y: auto; /* Adiciona scroll se os resultados forem muitos */
}

.upsell-result-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px;
    cursor: pointer;
    border-radius: 6px;
    transition: background-color 0.2s;
}

.upsell-result-item:hover {
    background-color: #f0f7ff;
}

.upsell-result-item img {
    width: 40px;
    height: 40px;
    object-fit: cover;
    border-radius: 4px;
}

.upsell-result-item-details {
    font-size: 0.85rem;
}

.upsell-result-item-name {
    font-weight: 600;
}

.upsell-result-item-price {
    color: #555;
}

.summary-column {
    /* Este container agrupa os dois blocos e os torna "pegajosos" */
    position: sticky;
    top: 40px;
    height: fit-content; /* Garante que a altura se ajuste ao conteúdo */
    
    /* Faz o container ser um "agrupador" sem aparência própria */
    display: flex;
    flex-direction: column;
    gap: 20px; /* Define o espaço ENTRE as duas "bolhas" */
}

/* 2. A "Bolha" do Resumo do Pedido */
.summary-section {
    /* Mantém a aparência original de "bolha" */
    background-color: #fff;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 30px;
    position: sticky;
    top: 20px;
    align-self: start;
}

.error-message {
    color: #e53935; /* Vermelho de erro */
    font-size: 0.8rem;
    display: block; /* Para que ocupe sua própria linha */
    height: 1rem; /* Garante um espaço consistente mesmo quando vazio */
    margin-top: 4px;
}

#toast-container {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.toast {
  min-width: 250px;
  text-align: center;
  padding: 12px 20px;
  border-radius: 8px;
  color: #fff;
  font-weight: bold;
  box-shadow: 0 4px 10px rgba(0,0,0,0.2);
  animation: fadeIn 0.3s, fadeOut 0.3s 3s forwards;
}

.toast.success { background-color: #28a745; } /* verde */
.toast.error   { background-color: #dc3545; } /* vermelho */

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeOut {
  from { opacity: 1; transform: translateY(0); }
  to   { opacity: 0; transform: translateY(20px); }
}

.checkout-btn.card-btn {
    background-color: #3498db; /* Um azul para diferenciar */
    border-color: #2980b9;
}

.checkout-btn.card-btn:hover:not(:disabled) {
    background-color: #2980b9;
}

/* Divisor "OU" entre os botões */
.payment-divider {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 20px 0;
    color: #aaa;
}

.payment-divider::before,
.payment-divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid #e0e0e0;
}

.payment-divider span {
    padding: 0 15px;
    font-size: 14px;
    font-weight: 600;
}

.validation-status-container {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    font-size: 14px;
    color: #6b7280; /* Cor do texto secundário */
    height: 20px; /* Altura fixa para evitar pulos no layout */
    transition: all 0.3s ease;
}

.spinner {
    width: 16px;
    height: 16px;
    border: 2px solid #e5e7eb; /* Cor da borda do spinner */
    border-top-color: #3b82f6; /* Cor do seu accent-color */
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.hidden-field {
    display: none !important; /* !important para garantir que ele comece escondido */
}

/* --- Estilos da Seção de Cupom --- */

/* Container principal da seção de cupom */
.coupon-section {
    padding-bottom: 20px; /* Adiciona espaço antes da linha divisória */
    margin-bottom: 20px;  /* Adiciona espaço abaixo */
    border-bottom: 1px solid var(--border-color); /* Linha para separar do resumo financeiro */
}

/* Agrupa o input e o botão */
.coupon-input-group {
    display: flex;
    gap: 10px; /* Espaço entre o input e o botão */
}

/* Estilo do campo de texto do cupom */
#coupon-input {
    flex-grow: 1; /* Faz o input ocupar o espaço disponível */
    padding: 12px 15px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.2s, box-shadow 0.2s;
}

#coupon-input:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.1);
}

/* Estilo do botão "Aplicar" */
#apply-coupon-btn {
    padding: 0 20px;
    border: none;
    background-color: var(--primary-color); /* Cor primária para destaque */
    color: #fff;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s;
}

#apply-coupon-btn:hover {
    background-color: #333; /* Escurece um pouco no hover */
}

/* Mensagem de status (sucesso ou erro) */
#coupon-status-message {
    margin-top: 10px;
    font-size: 0.85rem;
    font-weight: 600;
    height: 16px; /* Altura fixa para não "pular" o layout */
}

#coupon-status-message.success {
    color: #28a745; /* Verde para sucesso */
}

#coupon-status-message.error {
    color: #dc3545; /* Vermelho para erro */
}

/* Linha de desconto no resumo */
#coupon-discount-line {
    color: #28a745; /* Cor verde para destacar o desconto positivo */
    font-weight: 600;
}

/* Estilos para Etapas Bloqueadas */
.checkout-step.step-locked {
    opacity: 0.5;
    pointer-events: none; /* Impede qualquer clique ou interação */
}

.checkout-step.step-locked .step-content {
    max-height: 0;
    padding: 0 25px; /* Mantém o padding lateral para não "pular" */
    overflow: hidden;
    transition: max-height 0.5s ease-out, padding 0.5s ease-out;
}

/* Estilos para Etapas Ativas (quando a classe .step-locked é removida) */
.checkout-step .step-content {
    /* Transição suave ao abrir */
    transition: max-height 0.5s ease-in, padding 0.5s ease-in;
}

#validate-document-btn {
    width: auto; /* Faz o botão se ajustar ao texto */
    padding: 10px 25px; /* Um pouco menos de padding vertical */
    font-size: 1rem; /* Fonte um pouco menor que o botão principal */
    align-self: flex-start; /* Alinha o botão à esquerda */
}

#validate-document-btn:disabled {
    background-color: #b0b0b0;
    cursor: not-allowed;
}

.shipping-address-summary {
    font-size: 0.9rem;
    color: #555;
    background-color: #f7f7f7;
    padding: 10px 15px;
    border-radius: 6px;
    margin: 0 20px 15px 20px; /* Ajuste as margens conforme seu layout */
    border: 1px solid #eee;
}

.cart-item-see-details {
    font-size: 0.8rem;
    color: var(--accent-color);
    text-decoration: underline;
    cursor: pointer;
    margin-top: 5px;
    display: inline-block;
}

/* Overlay (fundo escuro) */
.popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: none; /* Começa escondido */
    justify-content: center;
    align-items: center;
    z-index: 2000;
    padding: 20px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.popup-overlay.visible {
    display: flex;
    opacity: 1;
}

/* Conteúdo do Popup */
.popup-content {
    background-color: #fff;
    border-radius: 12px;
    width: 100%;
    max-width: 900px; /* Popup largo */
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    padding: 30px;
    transform: scale(0.95);
    transition: transform 0.3s ease;
}

/* Conteúdo do Popup */
.popup-content-product-details {
    background-color: #fff;
    border-radius: 12px;
    width: 100%;
    max-width: 900px; /* Popup largo */
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    padding: 30px;
    transform: scale(0.95);
    transition: transform 0.3s ease;
}

.popup-overlay.visible .popup-content {
    transform: scale(1);
}

.popup-close-btn {
    position: absolute;
    top: 10px;
    right: 15px;
    background: none;
    border: none;
    font-size: 2.5rem;
    color: #888;
    cursor: pointer;
    line-height: 1;
}

.popup-body {
    display: grid;
    grid-template-columns: 1fr;
    gap: 30px;
}

@media (min-width: 768px) {
    .popup-body {
        grid-template-columns: 1fr 1fr; /* Duas colunas */
    }
}

/* Galeria de Imagens do Popup */
.popup-gallery {
    display: flex;
    flex-direction: column;
    gap: 15px;
}
.popup-main-image-container {
    width: 100%;
    aspect-ratio: 1 / 1;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
}
#popup-main-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.popup-thumbnail-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(50px, 1fr));
    gap: 8px;
}
.popup-thumbnail {
    width: 100%;
    aspect-ratio: 1 / 1;
    border: 2px solid transparent;
    border-radius: 6px;
    cursor: pointer;
    overflow: hidden;
}
.popup-thumbnail img {
    width: 100%; height: 100%; object-fit: cover;
}
.popup-thumbnail.active {
    border-color: var(--accent-color);
}

/* Detalhes do Produto no Popup */
.popup-details-section h2 {
    font-size: 1.8rem;
    margin-bottom: 10px;
}
.popup-price-section {
    display: flex;
    align-items: baseline;
    gap: 15px;
    margin-bottom: 20px;
    font-size: 1.5rem;
    font-weight: 700;
}
#popup-product-price { color: var(--accent-color); }
#popup-product-stock { font-size: 0.9rem; padding: 4px 8px; border-radius: 6px; }
#popup-product-stock.in-stock { background-color: #eaf6ec; color: #28a745; }
#popup-product-stock.out-of-stock { background-color: #fbeae9; color: #dc3545; }

#popup-product-description {
    font-size: 0.95rem;
    line-height: 1.6;
    color: #555;
    margin-bottom: 20px;
}
#popup-product-description h4 { margin-bottom: 5px; }

#popup-variants-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
}
.popup-variant-group strong {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
}
.popup-variant-options {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.popup-variant-options span {
    padding: 6px 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 0.9rem;
}
.popup-variant-options span.selected {
    border-color: var(--accent-color);
    background-color: #f0f7ff;
    font-weight: 600;
}

.upsell-section label {
    font-weight: 600;
    font-size: 1rem;
    margin-bottom: 8px;
    display: block;
}

#upsell-search-input {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 0.9rem;
}

/* Container para os resultados da busca */
#upsell-results-container {
    margin-top: 12px;
    max-height: 450px; /* Limita a altura para não esticar demais a página */
    overflow-y: auto; /* Adiciona scroll se os resultados excederem a altura */
    padding-right: 5px; /* Espaço para a barra de rolagem */
}

/* Estilo de cada item de resultado */
.upsell-result-item {
    display: flex;
    align-items: flex-start; /* Alinha ao topo para acomodar as variantes */
    padding: 12px;
    background-color: #fff;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin-bottom: 10px;
    gap: 12px;
    position: relative; /* Para o botão de adicionar */
}

.upsell-result-image {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 6px;
    flex-shrink: 0;
}

.upsell-result-item-details {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.upsell-result-item-name {
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 4px;
}

.upsell-result-item-price {
    font-size: 0.9rem;
    color: var(--text-color-secondary);
    margin-bottom: 8px;
}

/* Botão para adicionar o produto ao carrinho */
.add-upsell-btn {
    background-color: var(--accent-color);
    color: white;
    border: none;
    border-radius: 50%; /* Círculo */
    width: 32px;
    height: 32px;
    font-size: 1.2rem;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.2s;
    flex-shrink: 0;
    align-self: center; /* Centraliza o botão verticalmente */
    line-height: 32px; /* Alinha o "+" verticalmente */
    padding: 0;
}

.add-upsell-btn:hover {
    background-color: #0056b3; /* Cor mais escura no hover */
}

/* Estilos para as pílulas de variantes no upsell (classes com sufixo -upsell) */
.variant-selector-upsell {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 4px;
}

.variant-option-upsell input[type="radio"] {
    display: none;
}

.variant-option-upsell label {
    display: inline-block;
    padding: 3px 10px;
    font-size: 0.75rem;
    border: 1px solid #ccc;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.variant-option-upsell input[type="radio"]:checked + label {
    background-color: var(--accent-color);
    color: white;
    border-color: var(--accent-color);
}

.variant-option-upsell.variant-out-of-stock {
    opacity: 0.5;
    pointer-events: none;
}

.variant-option-upsell.variant-out-of-stock label {
    text-decoration: line-through;
}

.more-variants-btn-upsell {
    background: none;
    border: none;
    color: var(--accent-color);
    font-size: 0.75rem;
    cursor: pointer;
    padding: 3px 6px;
}

.variant-option-upsell.variant-hidden {
    display: none;
}

.shipping-info-mixed {
    font-size: 0.9rem;
    color: #555;
    background-color: #f0f8ff; /* Um azul bem claro */
    border: 1px solid #bde0ff;
    border-radius: 6px;
    padding: 10px;
    margin-bottom: 15px;
    text-align: center;
}

    /* ============================================= */
    /* ===== CSS FINAL COM ESTILO INTERNO CORRETO ==== */
    /* ============================================= */

    body {
        padding: 0; 
        display: flex;
        flex-direction: column;
        min-height: 100vh;
        background-color: #f4f4f5;
    }

    /* --- Cabeçalho (Headline) --- */
    .main-header {
        background-color: #ffffff;
        padding: 15px 4%;
        border-bottom: 1px solid #e5e5e5;
        box-shadow: 0 2px 8px rgba(0,0,0,0.05);
        width: 100%;
        display: grid;
        grid-template-columns: auto 1fr auto; 
        grid-template-rows: auto auto;
        align-items: center;
        gap: 5px 20px; 
        position: relative;
        z-index: 10;
    }

    .logo {
        grid-column: 1 / 2;
        grid-row: 1 / 2;
        font-size: 1.8rem;
        font-weight: 800;
        color: #121212;
    }

    /* --- Container da Busca --- */
.search-container {
    display: flex; /* Garante que a busca e o ícone fiquem alinhados */
    align-items: center;
    gap: 15px;
    position: relative; /* Adicione isso */
}

.search-input-wrapper {
    flex-grow: 1; /* A busca ocupa o espaço restante */
    position: relative; /* Adicione isso */
}

    .search-icon {
        position: absolute;
        top: 50%;
        transform: translateY(-50%);
        right: 20px;
        width: 20px;
        height: 20px;
        color: #888;
        pointer-events: none;
    }

.cart-trigger {
    position: relative;
    cursor: pointer;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 5px;
    transition: transform 0.2s;
}

.cart-trigger:hover {
    transform: scale(1.1);
    color: var(--accent-color);
}

.cart-count {
    position: absolute;
    top: -5px;
    right: -8px;
    background-color: #e53935;
    color: white;
    font-size: 0.75rem;
    font-weight: 700;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #fff;
}

/* Overlay Escuro */
.cart-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease;

}

.cart-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Sidebar do Carrinho */
.cart-sidebar {
    position: fixed;
    top: 0;
    right: -400px; /* Escondido à direita */
    width: 100%;
    max-width: 400px;
    height: 100%;
    background-color: #fff;
    box-shadow: -5px 0 15px rgba(0, 0, 0, 0.1);
    z-index: 2000;
    display: flex;
    flex-direction: column;
    transition: right 0.4s cubic-bezier(0.19, 1, 0.22, 1);
z-index: 2147483647 !important; /* Valor máximo permitido */
}

.cart-sidebar.active {
    right: 0;
z-index: 2147483647 !important; /* Valor máximo permitido */
}

/* Cabeçalho do Carrinho */
.cart-header {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #f9fafb;
}

.cart-header h2 {
    margin: 0;
    font-size: 1.2rem;
    color: var(--primary-color);
}

#close-cart-btn {
    background: none;
    border: none;
    font-size: 2rem;
    cursor: pointer;
    color: #888;
    line-height: 1;
}

/* Lista de Itens */
.cart-items-container {
    flex-grow: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.empty-cart-msg {
    text-align: center;
    color: #666;
    margin-top: 50px;
}

/* Item Individual no Carrinho */
.global-cart-item {
    display: flex;
    gap: 15px;
    border-bottom: 1px solid #eee;
    padding-bottom: 15px;
}

.global-cart-item img {
    width: 70px;
    height: 70px;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid #eee;
}

.global-item-details {
    flex-grow: 1;
}

.global-item-name {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 5px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.global-item-variant {
    font-size: 0.8rem;
    color: #777;
    margin-bottom: 5px;
}

.global-item-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.global-item-price {
    font-weight: 700;
    color: var(--accent-color);
}

.global-qty-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    background-color: #f4f4f5;
    border-radius: 4px;
    padding: 2px;
}

.global-qty-btn {
    background: none;
    border: none;
    width: 24px;
    height: 24px;
    cursor: pointer;
    font-weight: bold;
    color: #333;
}

.global-remove-btn {
    background: none;
    border: none;
    color: #e53935;
    font-size: 0.75rem;
    cursor: pointer;
    text-decoration: underline;
    margin-top: 5px;
    display: block;
}

/* Rodapé do Carrinho */
.cart-footer {
    padding: 20px;
    border-top: 1px solid var(--border-color);
    background-color: #fff;
    z-index: 1500 !important;
}

.cart-subtotal {
    display: flex;
    justify-content: space-between;
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 15px;
    z-index: 1600 !important;
}

.cart-checkout-btn {
    width: 100%;
    padding: 15px;
    background-color: var(--accent-color);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: background-color 0.2s;
}

.cart-checkout-btn:hover {
    background-color: #0056b3;
}
    .search-input { 
        width: 100%; 
        padding: 12px 50px 12px 25px; 
        font-size: 1.1rem;
        border-radius: 50px; 
        border: 1px solid var(--border-color); 
        transition: all 0.3s;
    }
    .search-input:focus {
        outline: none;
        border-color: var(--accent-color);
        box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.15);
    }

    .search-icon {
        position: absolute;
        top: 50%;
        transform: translateY(-50%);
        right: 20px;
        width: 20px;
        height: 20px;
        color: #888;
        pointer-events: none;
    }

    #loading-message { 
        font-size: 0.9rem;
        color: #666; 
        padding: 10px 0;
        text-align: center;
    }

    /* --- Botão "Entrar" com Ícone --- */
    .header-login {
        grid-column: 3 / 4;
        grid-row: 1 / 2;
        display: flex;
        align-items: center;
        gap: 8px;
        text-decoration: none;
        color: #333;
        font-weight: 600;
        font-size: 0.9rem;
        white-space: nowrap;
        transition: color 0.2s;
    }
    .header-login:hover { color: var(--accent-color); }
    .login-icon { width: 24px; height: 24px; }

    /* --- Menu de Navegação (Compacto) --- */
    .main-nav {
        grid-column: 1 / -1;
        grid-row: 2 / 3;
        display: flex;
        justify-content: center;
        gap: 25px;
    }

    .nav-link {
        text-decoration: none;
        color: #555;
        font-weight: 500;
        font-size: 0.9rem;
        padding-bottom: 3px;
        position: relative;
        transition: color 0.3s;
    }
    .nav-link::after { content: ''; position: absolute; bottom: 0; left: 0; width: 0; height: 2px; background-color: var(--accent-color); transition: width 0.3s ease; }
    .nav-link:hover { color: #121212; }
    .nav-link:hover::after { width: 100%; }
    
    .mobile-nav-toggle { display: none; }

    /* --- Conteúdo Principal e Rodapé --- */
    main { flex-grow: 1; width: 100%; padding: 40px 20px; }
    .main-footer { background-color: #121212; color: #a0a0a0; padding: 40px 5%; margin-top: auto; }
    .footer-container { max-width: 1200px; margin: 0 auto; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 20px; }
    .footer-social a { color: #a0a0a0; text-decoration: none; margin-left: 20px; transition: color 0.3s; }
    .footer-social a:hover { color: #ffffff; }

    /* --- CSS DO DROPDOWN --- */
    #results-container {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background-color: #fff;
        border: 1px solid #ddd;
        border-radius: 12px;
        box-shadow: 0 8px 16px rgba(0,0,0,0.1);
        max-height: 70vh;
        overflow-y: auto;
        z-index: 5;
        padding: 8px;
        text-align: left;
        display: none;
    }

.search-active {
    display: block !important;
}

    /* ▼▼▼ PONTO-CHAVE: TODO O SEU CSS ORIGINAL DOS ITENS FOI RESTAURADO AQUI ▼▼▼ */
    .result-item { 
        display: flex; 
        align-items: center; 
        background-color: #fff; 
        border: 1px solid var(--border-color); 
        border-radius: 8px; 
        padding: 15px; 
        margin-bottom: 15px; 
        cursor: pointer; 
        transition: transform 0.2s, box-shadow 0.2s; 
    }
    .result-item:last-child {
        margin-bottom: 8px;
    }
    .result-item:hover { 
        transform: translateY(-3px); 
        box-shadow: 0 4px 12px rgba(0,0,0,0.08); 
    }
    .result-item img { 
        width: 80px; 
        height: 80px; 
        border-radius: 6px; 
        margin-right: 20px; 
        object-fit: cover; 
    }
    .result-item-details h3 { 
        margin: 0; 
        font-size: 1.1rem; 
    }
    .result-item-details p { 
        margin: 5px 0 0; 
        color: #555; 
    }

    /* Estilos para o container das variantes */
    .variant-selector {
        margin-top: 12px;
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
        align-items: center;
    }

    /* Esconde o radio button original */
    .variant-selector input[type="radio"] {
        opacity: 0;
        position: fixed;
        width: 0;
    }

    /* Estiliza o label para parecer uma "pílula" ou "tag" */
    .variant-selector label {
        display: inline-block;
        padding: 4px 12px;
        border-radius: 16px;
        cursor: pointer;
        border: 1px solid #ccc;
        background-color: #f8f9fa;
        color: #495057;
        font-size: 0.85rem;
        transition: all 0.2s;
        user-select: none;
    }

    /* Estilo da pílula quando o radio button está selecionado (A BOLHA AZUL) */
    .variant-selector input[type="radio"]:checked + label {
        border-color: var(--accent-color);
        background-color: var(--accent-color);
        color: #fff;
        font-weight: 600;
    }

    /* Estilo para o item de resultado quando está esgotado */
    .result-item.out-of-stock {
        opacity: 0.6;
        cursor: not-allowed;
        background-color: #f8f9fa;
    }
    .out-of-stock .result-item-price {
        color: #dc3545;
        font-weight: bold;
    }
    .variant-selector .variant-option.variant-hidden {
        display: none;
    }
    .variant-option.variant-out-of-stock {
        opacity: 0.5 !important;
        cursor: not-allowed !important;
    }
    .variant-option.variant-out-of-stock label {
        color: #888 !important;
        text-decoration: line-through !important;
        cursor: not-allowed !important;
    }
    .variant-option.variant-out-of-stock input[type="radio"] {
        cursor: not-allowed !important;
    }
    .variant-option.variant-out-of-stock {
        pointer-events: none !important;
    }
    /* ▲▲▲ FIM DO CSS RESTAURADO ▲▲▲ */
    
    /* --- Responsividade --- */
    @media (max-width: 820px) {
        .main-header { grid-template-columns: 1fr auto; grid-template-rows: auto auto auto; }
        .logo { grid-column: 1 / 2; grid-row: 1 / 2; }
        .mobile-nav-toggle { display: block; grid-column: 2 / 3; grid-row: 1 / 2; background: none; border: 1px solid #ccc; padding: 8px 12px; border-radius: 5px; cursor: pointer; }
        .search-container { grid-column: 1 / -1; grid-row: 2 / 3; }
        .header-login { display: none; }
        .main-nav { grid-column: 1 / -1; grid-row: 3 / 4; justify-content: space-around; }
    }

@keyframes fadeIn {
    from { opacity: 0.6; }
    to { opacity: 1; }
}

/* --- ESTILOS DAS SEÇÕES DE CONTEÚDO --- */
.categories-section,
.featured-products-section {
    max-width: 1200px;
    width: 100%;
    margin: 60px auto; /* Espaçamento entre as seções */
    text-align: center;
}

.categories-section h2,
.featured-products-section h2 {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 30px;
}

/* --- ESTILOS DAS BOLHAS DE CATEGORIA --- */
.categories-grid {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 30px;
}

.category-bubble {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--text-color);
    transition: transform 0.2s ease;
}

.category-bubble:hover {
    transform: translateY(-5px);
}

.category-bubble img {
    width: 100px;
    height: 100px;
    border-radius: 50%; /* A "bolha" */
    object-fit: cover;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    border: 3px solid #fff;
}

.category-bubble span {
    font-weight: 600;
    font-size: 0.9rem;
}

/* --- ESTILOS DO CARROSSEL DE PRODUTOS --- */
product-carousel-container {
    width: 100%;
    overflow: hidden; /* Desktop continua usando só a animação */
    position: relative; /* Para posicionar o hint/mobile */
}

/* Mobile: permite scroll suave com setas e swipe */
@media (max-width: 768px) {
    .product-carousel-container {
        overflow-x: auto;
        overflow-y: hidden;
        scroll-behavior: smooth;
    }

    .product-carousel-container::-webkit-scrollbar {
        display: none;
    }
}

/* Hint de “arraste” no mobile */
@media (max-width: 768px) {
    .featured-products-section .product-carousel-container::after {
        content: 'Arraste para ver mais';
        position: absolute;
        bottom: 8px;
        right: 12px;
        font-size: 0.75rem;
        background: rgba(0, 0, 0, 0.6);
        color: #fff;
        padding: 4px 10px;
        border-radius: 999px;
        pointer-events: none;
        opacity: 0.9;
    }

    /* Some depois da primeira interação (classe adicionada via JS) */
    .featured-products-section.carousel-interacted .product-carousel-container::after {
        display: none;
    }
}

@media (max-width: 768px) {
    .product-card {
        flex: 0 0 190px;   /* Antes era ~240px, fica um pouco mais compacto */
        margin: 0 8px;
    }

    .product-card-image {
        height: 150px;     /* Leve redução para encaixar melhor na tela menor */
    }

    .product-card-name {
        font-size: 0.9rem;
    }

    .product-card-price {
        font-size: 1rem;
    }
}

@media (max-width: 768px) {
    .featured-products-section {
        margin-top: 4px;
        margin-bottom: 4px;
    }

    .product-carousel-container {
        padding: 4px 0;
    }

    /* Cartão um tiquinho menor, sem perder identidade */
    .product-card {
        flex: 0 0 175px;   /* antes 190px */
    }

    .product-card-image {
        height: 140px;     /* antes 150px */
    }
}

.product-carousel-wrapper {
    display: flex;
    /* A mágica do carrossel infinito */
    animation: scroll-products 40s linear infinite;
}

@media (max-width: 768px) {
    .product-carousel-wrapper {
     animation: scroll-products 40s linear infinite;
    }
}

.product-carousel-wrapper:hover {
    animation-play-state: paused; /* Pausa a animação ao passar o mouse */
}

.product-card {
    flex: 0 0 240px; /* Largura fixa para cada card */
    margin: 0 15px;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    background-color: #fff;
    overflow: hidden;
    text-align: left;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    cursor: pointer;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 15px rgba(0,0,0,0.08);
}

.product-card-image {
    width: 100%;
    height: 180px;
    object-fit: cover;
}

.product-card-details {
    padding: 15px;
}

.product-card-name {
    font-size: 1rem;
    font-weight: 600;
    /* Limita o nome a 2 linhas para não quebrar o layout */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;  
    overflow: hidden;
    height: 2.5em; /* Ajuste conforme o tamanho da fonte */
}

.product-card-price {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--accent-color);
    margin-top: 10px;
}

/* Animação do carrossel */
@keyframes scroll-products {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); } /* Move metade da largura total */
}

.variant-pill {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    border: 1px solid #ccc;
    background-color: #f8f9fa;
    color: #495057;
    font-size: 0.75rem;
    user-select: none;
}

/* Estilo para a pílula ativa (a que corresponde à imagem/preço) */
.variant-pill.active {

    /* ▼▼▼ SUBSTITUA-A POR ISTO ▼▼▼ */
    background-color: #6b7280;
    color: #fff;
    font-weight: 600;
}

.variant-pill-more {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 12px;
    background-color: #e9ecef;
    color: #495057;
    font-size: 0.75rem;
    font-weight: 600;
}

/* ▼▼▼ ADICIONE ESTE BLOCO DE ESTILOS (pode ser no final do arquivo) ▼▼▼ */

/* --- Estilos do Sistema de Avaliação (Estrelas) --- */
.star-rating {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 1rem;
}

.star-rating .stars-outer {
    position: relative;
    display: inline-block;
    color: #ccc; /* Cor das estrelas vazias */
}

.star-rating .stars-inner {
    position: absolute;
    top: 0;
    left: 0;
    white-space: nowrap;
    overflow: hidden;
    width: 0; /* Será definido pelo JS */
    color: #f8ce0b; /* Cor das estrelas preenchidas */
}

.star-rating .stars-outer::before,
.star-rating .stars-inner::before {
    content: "★★★★★";
}

.star-rating .rating-summary {
    font-size: 0.85rem;
    color: #666;
    margin-left: 5px;
}

/* --- Estilos da Seção de Avaliações na Página do Produto --- */
.product-reviews-section {
    grid-column: 1 / -1;
    margin-top: 50px;
    padding-top: 50px;
    border-top: 1px solid var(--border-color);
}

.product-reviews-section h2 {
    font-size: 1.5rem;
    margin-bottom: 30px;
}

.reviews-summary {
    display: flex;
    align-items: center;
    gap: 20px;
    background-color: #f8f9fa;
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 40px;
}

.reviews-summary .average-rating-display {
    font-size: 2.5rem;
    font-weight: 700;
}

.reviews-list {
    display: flex;
    flex-direction: column;
    gap: 25px;
    margin-bottom: 40px;
}

.review-item {
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 20px;
}

.review-item:last-child {
    border-bottom: none;
}

.review-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.review-header .customer-name {
    font-weight: 600;
}

.review-header .review-date {
    font-size: 0.8rem;
    color: #888;
}

.review-comment {
    line-height: 1.6;
    color: #555;
}

/* --- Estilos do Formulário de Avaliação --- */
#review-form-container {
    background-color: #f8f9fa;
    padding: 30px;
    border-radius: 12px;
}

#review-form-container h3 {
    margin-top: 0;
    margin-bottom: 20px;
}

#review-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.form-row {
    display: flex;
    gap: 15px;
}

.form-row .form-group {
    flex: 1;
}

#review-form .form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 5px;
    font-size: 0.9rem;
}

#review-form input[type="text"],
#review-form input[type="email"],
#review-form textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ccc;
    border-radius: 8px;
    font-size: 1rem;
}

#review-form textarea {
    min-height: 100px;
    resize: vertical;
}

.star-input-group {
    display: flex;
    flex-direction: row-reverse; /* Inverte a ordem para o truque do CSS funcionar */
    justify-content: flex-end;
    gap: 5px;
}

.star-input-group input[type="radio"] {
    display: none; /* Esconde os radios originais */
}

.star-input-group label {
    font-size: 2rem;
    color: #ccc;
    cursor: pointer;
    transition: color 0.2s;
}

/* Magia do CSS: Pinta as estrelas à esquerda da que está com hover */
.star-input-group:not(:hover) input[type="radio"]:checked ~ label,
.star-input-group:hover label:hover ~ label,
.star-input-group label:hover {
    color: #f8ce0b;
}

#submit-review-btn {
    align-self: flex-start;
    padding: 12px 25px;
    font-size: 1rem;
    font-weight: 700;
    color: #fff;
    background-color: var(--accent-color);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.2s;
}

#submit-review-btn:hover {
    background-color: #0056b3;
}

#review-form-message {
    margin-top: 15px;
    font-weight: 600;
    padding: 10px;
    border-radius: 8px;
    display: none; /* Começa escondido */
}
#review-form-message.success {
    background-color: #eaf6ec;
    color: #28a745;
}
#review-form-message.error {
    background-color: #fbeae9;
    color: #dc3545;
}

/* ▲▲▲ FIM DO BLOCO DE ESTILOS ▲▲▲ */

/* --- Estilos da Tag de Promoção --- */
.product-card-image-wrapper {
    position: relative; /* Necessário para posicionar a tag */
    width: 100%;
    height: 180px; /* Mesma altura da imagem do card */
}

.product-card-image-wrapper .product-card-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.price-container {
    margin-top: 10px;
    display: flex;
    flex-wrap: wrap;       /* permite quebrar de linha */
    align-items: baseline; /* alinha textos pela base */
    gap: 4px;              /* espaçamento entre itens */
}

.product-card .price-container .product-card-price.original {
    width: 100%;  /* quebra a linha abaixo */
    order: 0;
}

.product-card .price-container .product-card-price.sale {
    order: 1;
}

.product-card .price-container .discount-percentage-tag {
    order: 2;
}

/* 2. Estilo para o preço original (riscado) */
.product-card-price.original {
    font-size: 0.9rem;
    color: #6c757d;
    text-decoration: line-through;
    line-height: 1;
}

/* 3. O container da linha de venda organiza os itens em LINHA (lado a lado) */
.sale-price-line {
    display: flex;
    align-items: baseline; /* Alinha o preço e a tag pela base do texto */
    gap: 8px;              /* Espaço entre o preço de venda e a tag */
}

/* 4. Estilo para o preço de venda (com desconto) */
.product-card-price.sale {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--accent-color);
}

/* 5. Estilo para a tag de porcentagem de desconto */
.discount-percentage-tag {
    background-color: #e0f2fe;
    color: var(--accent-color);
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 700;
    white-space: nowrap;
}

/* 6. Estilo para o preço quando NÃO há promoção (para manter a consistência) */
.price-container .product-card-price:not(.original):not(.sale) {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--accent-color);
}

/* 5. Ajuste fino no espaçamento do nome do produto para reduzir o espaço geral */
.product-card-name {
    margin-bottom: 8px; /* Adiciona um espaço controlado abaixo do nome */
}

/* 6. Estilo para a Tag de Promoção (Bônus) */
.product-card {
    position: relative; /* Necessário para posicionar a tag */
}

.promotion-tag {
    position: absolute;
    top: 10px;
    left: 10px;
    background-color: #111827; /* Um vermelho para chamar atenção */
    color: #fff;
    padding: 3px 8px;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 4px;
    z-index: 2;
}

body.product-page-active {
    background-color: #f4f4f5;
}

/* 2. O wrapper serve para dar o espaçamento vertical */
.product-page-wrapper {
    width: 100%;
    /* 
       padding-top: 0px;     -> Adiciona 40px de espaço ACIMA da caixa branca.
       padding-bottom: 20px;  -> Adiciona 60px de espaço ABAIXO da caixa branca.
       Isso cria o "respiro" vertical que você precisa.
    */
}

/* 3. O container principal é a caixa branca centralizada */
.product-page-container {
    background-color: #ffffff;
    border-radius: 12px;
    border: 1px solid #e5e5e5;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    padding: 40px;
    max-width: 1375px;
    margin: 0 auto; /* Centraliza a caixa */
    display: grid;
    grid-template-columns: 1fr;
    gap: 30px;
}

@media (min-width: 992px) {
    .product-page-container {
        grid-template-columns: 1fr 1.1fr;
        gap: 60px;
    }
}

/* 4. Ajustes finos (sem alteração) */
.product-description, .product-reviews-section {
    margin-top: 30px;
    padding-top: 30px;
    border-top: 1px solid #e5e5e5;
    grid-column: 1 / -1;
}

/* --- Estilos do Preço Promocional na Página do Produto --- */
.product-info .price-wrapper {
    margin-bottom: 25px;
}

.product-info .price-wrapper .original-price {
    font-size: 1.2rem;
    color: #6b7280;
    text-decoration: line-through;
    font-weight: 400;
    display: block;
}

.product-info .price-wrapper .sale-price {
    font-size: 2.0rem;
    font-weight: 400;
    color: #007aff;
    line-height: 1.1;
}

/* --- Estilos do Seletor de Quantidade --- */
.quantity-control {
    margin-bottom: 30px;
}

.quantity-control h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 10px;
}

.quantity-selector {
    display: flex;
    align-items: center;
    border: 1px solid #ccc;
    border-radius: 8px;
    width: fit-content;
}

.quantity-selector .qty-btn {
    background-color: #f8f9fa;
    border: none;
    color: #333;
    font-size: 1.5rem;
    font-weight: 600;
    cursor: pointer;
    width: 45px;
    height: 45px;
    transition: background-color 0.2s;
}

.quantity-selector .qty-btn:hover {
    background-color: #e9ecef;
}

.quantity-selector .qty-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.quantity-selector .qty-display {
    font-size: 1.2rem;
    font-weight: 700;
    color: #333;
    width: 50px;
    text-align: center;
    border-left: 1px solid #ccc;
    border-right: 1px solid #ccc;
    height: 45px;
    line-height: 45px;
}

/* --- Estilos do Seletor de Quantidade na PÁGINA DE PRODUTO --- */
.pdp-quantity-selector { /* USANDO UMA NOVA CLASSE: pdp = Product Display Page */
    display: flex;
    align-items: center;
    border: 1px solid #ccc;
    border-radius: 8px;
    width: fit-content;
}
/* O resto dos estilos para .qty-btn e .qty-display podem ser os mesmos */
.pdp-promotion-tag {
    background-color: #00050a;
    color: #FFF;
    padding: 4px 10px;
    font-size: 0.8rem;
    font-weight: 700;
    border-radius: 6px;
    text-transform: uppercase;
    display: inline-block; /* Para que não ocupe a linha inteira */
    margin-bottom: 15px; /* Espaçamento abaixo da tag */
}

/* ▼▼▼ ADICIONE ESTE BLOCO NO FINAL DO ARQUIVO ▼▼▼ */

/* --- Estilo para o Aviso de Frete Grátis no Card --- */
.free-shipping-info {
    display: flex;
    align-items: center;
    gap: 6px; /* Espaço entre o ícone e o texto */
    margin-top: 12px; /* Espaço acima do aviso */
    padding-top: 12px; /* Espaço interno acima da linha */
    border-top: 1px solid #f0f0f0; /* Linha divisória sutil */
    font-size: 0.8rem;
    color: #6b7280; /* Cinza para o texto "com cupom" */
}

.free-shipping-info svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0; /* Impede que o ícone seja esmagado */
    stroke-width: 2;
    color: #111827; /* Cor preta/escura para o caminhão */
}

.free-shipping-info .highlight {
    font-weight: 600;
    color: #16a34a; /* Verde para o "Frete grátis" */
}
/* ▲▲▲ FIM DO BLOCO ▲▲▲ */
/* 1. Container para Avaliação e Preço */
.search-item-meta {
    display: flex;
    flex-direction: column; /* Itens um abaixo do outro */
    gap: 4px; /* Pequeno espaço entre as linhas */
    margin-top: 8px; /* Espaço acima do bloco */
}

/* 2. Estilo para a linha da avaliação (estrelas) */
.search-item-rating {
    display: flex;
    align-items: center;
    gap: 5px;
}

.search-item-rating .stars-outer {
    position: relative;
    display: inline-block;
    color: #ccc;
    font-size: 0.9rem; /* Estrelas um pouco menores */
}

.search-item-rating .stars-inner {
    position: absolute;
    top: 0;
    left: 0;
    white-space: nowrap;
    overflow: hidden;
    width: 0;
    color: #f8ce0b;
}

.search-item-rating .stars-outer::before,
.search-item-rating .stars-inner::before {
    content: "★★★★★";
}

.search-item-rating .rating-count {
    font-size: 0.75rem;
    color: #6b7280;
}

/* 3. Estilos para o Preço Promocional na Busca */
.search-item-price-container {
    display: flex;
    align-items: baseline; /* Alinha os preços pela base */
    gap: 8px;
}

.search-item-price.original {
    font-size: 0.85rem;
    color: #888;
    text-decoration: line-through;
}

.search-item-price.sale {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--accent-color);
}

/* ▼▼▼ ADICIONE ESTE BLOCO NO FINAL DO ARQUIVO ▼▼▼ */

/* --- Estilo para a Tag de Porcentagem de Desconto --- */
.discount-percentage-tag {
    background-color: #e0f2fe;
    color: #007aff;
    padding: 2px 6px;        /* um pouco menor */
    border-radius: 6px;
    font-size: 0.75rem;      /* ligeiramente menor */
    font-weight: 700;
    margin-left: 6px;        /* encosta mais no preço */
    white-space: nowrap;     /* texto não quebra */
    display: inline-flex;    /* garante alinhamento com o preço */
    align-items: center;     /* centraliza verticalmente em relação ao preço */
    line-height: 1;          /* reduz altura “visual” da tag */
    flex-shrink: 0;          /* evita que a tag seja amassada e empurre quebra de linha estranha */
}

/* 1. O contêiner principal. */
.slideshow-container {
    width: 100%;
    position: relative;
    margin-bottom: 40px;
}

/* 2. O wrapper dos slides agora ocupa a largura total, SEM max-width. */
.slides-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    width: 100%;
    padding-top: 25%; /* Mantém a proporção geral */
    overflow: hidden; /* ESSENCIAL: Esconde o que "vaza" dos slides laterais */
}

/* MOBILE: banner mais quadrado e recorte lateral correto */
@media (max-width: 768px) {

    /* Define altura real ao invés de padding-top */
    .slides-wrapper {
        padding-top: 0 !important;   /* remove proporcional original */
        height: 40vh !important;     /* bem mais quadrado */
        max-height: 300px;           /* evita ficar gigante demais */
        position: relative;
    }

    /* Mantém imagem cobrindo e cortando as laterais */
    .slide-container img {
        width: 100%;
        height: 100%;
        object-fit: cover !important;
        object-position: center center;
    }
}

/* Telas grandes: tudo cresce um pouco */
@media (min-width: 1600px) {
    .slide-container {
        max-width: 1400px;
    }

    .categories-section,
    .featured-products-section {
        max-width: 1400px;
    }
}

/* Telas MUITO grandes: cresce mais um pouco */
@media (min-width: 2000px) {
    .slide-container {
        max-width: 1700px;
    }

    .categories-section,
    .featured-products-section {
        max-width: 1700px;
    }
}

/* MOBILE: banner mais alto, quadrado e sem gradiente */
@media (max-width: 768px) {
    .slides-wrapper {
        /* Em vez de altura fixa em vh, usamos proporção da largura */
        padding-top: 100%; /* mais alto que 25%, mas ainda com cara de mobile */
    }

    /* Some o efeito de gradiente nas laterais no mobile */
    .slides-wrapper::before,
    .slides-wrapper::after {
        display: none;
    }
}

/* --- Setas do banner (desktop) --- */
.banner-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 38px;
    height: 38px;
    border-radius: 999px;
    border: none;
    background-color: rgba(0, 0, 0, 0.35); /* escuro, mas não “sujando” o gradiente */
    color: #ffffff;
    display: none; /* controlado pelo hover no desktop */
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.5rem;
    z-index: 5; /* acima do gradiente (z-index: 3) e dos slides, junto dos dots */
    opacity: 0;  /* começa invisível */
    transition: opacity 0.2s ease, transform 0.2s ease, background-color 0.2s ease;
}

.banner-arrow-left {
    left: 12px;
}

.banner-arrow-right {
    right: 12px;
}

/* Desktop: aparecem só quando o usuário interage (hover) */
@media (min-width: 769px) {
    .slideshow-container:hover .banner-arrow {
        display: flex;
        opacity: 0.35; /* visível, mas não gritante em cima do gradiente */
    }

    .banner-arrow:hover {
        background-color: rgba(0, 0, 0, 0.55);
        transform: translateY(-50%) scale(1.05);
        opacity: 1;
    }
}

/* Mobile: sem setas, apenas swipe */
@media (max-width: 768px) {
    .banner-arrow {
        display: none !important;
    }
}

/* 3. Os 3 contêineres de slide. */
.slide-container {
    position: absolute;
    
    /* ▼▼▼ ESTE É O VALOR PRINCIPAL A SER ALTERADO ▼▼▼ */
    width: 100%; /* ANTES: 70% */
    
    /* O max-width agora é aplicado AQUI, no slide individual. */
    /* ▼▼▼ AJUSTE ESTE VALOR PROPORCIONALMENTE (OPCIONAL, MAS RECOMENDADO) ▼▼▼ */
    max-width: 1150px; /* ANTES: 840px (80% de 1200px) */
    
    height: 100%;
    top: 0;
    transition: transform 0.6s cubic-bezier(0.25, 0.8, 0.25, 1), opacity 0.6s ease;
}

/* 4. Posicionamento dos vizinhos. */
.slide-container.prev {
    /* ▼▼▼ ALTERE ESTE VALOR ▼▼▼ */
    transform: translateX(-75%) scale(0.8); /* ANTES: -45% */
    opacity: 0.5;
    z-index: 1;
}

.slide-container.next {
    /* ▼▼▼ E ESTE VALOR ▼▼▼ */
    transform: translateX(75%) scale(0.8); /* ANTES: 45% */
    opacity: 0.5;
    z-index: 1;
}

/* 5. O contêiner ativo. */
.slide-container.active {
    transform: translateX(0) scale(1);
    opacity: 1;
    z-index: 2;
}

/* 6. A imagem preenche seu contêiner. */
.slide-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

/* 7. O GRADIENTE NO LUGAR CERTO: no wrapper. */
.slides-wrapper::before,
.slides-wrapper::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    width: 15%;
    z-index: 3;
    pointer-events: none;
}

.slides-wrapper::before {
    left: 0;
    background: linear-gradient(to right, rgba(244, 244, 245, 1), rgba(244, 244, 245, 0));
}

.slides-wrapper::after {
    right: 0;
    background: linear-gradient(to left, rgba(244, 244, 245, 1), rgba(244, 244, 245, 0));
}

/* 8. As bolinhas de navegação. */
.dots-container {
    position: absolute;
    bottom: 15px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    z-index: 4;
}

.dot {
    cursor: pointer;
    height: 10px;
    width: 10px;
    background-color: rgba(255, 255, 255, 0.5);
    border-radius: 50%;
    display: inline-block;
    transition: background-color 0.3s ease, transform 0.3s ease;
}

.dot.active,
.dot:hover {
    background-color: #ffffff;
    transform: scale(1.2);
}

/* --- ESTILOS DAS SEÇÕES DE CONTEÚDO --- */
.categories-section {
    max-width: 1250px;
    width: 100%;
    margin-left: auto;
    margin-right: auto;
    margin-bottom: 20px;
    position: relative; /* necessário para posicionar as setas */
}
.featured-products-section {
    max-width: 1300px;
    width: 100%;
    
    /* Garanta que a margem automática para centralização horizontal esteja aqui, separada */
    margin-left: auto;
    margin-right: auto;

    text-align: left;
    margin-top: 10;
    margin-bottom: 10;
    position: relative;
}

/* --- Controles manuais do carrossel --- */
.carousel-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 38px;
    height: 38px;
    border-radius: 999px;
    border: none;
    background-color: rgba(17, 24, 39, 0.85); /* preto translúcido */
    color: #ffffff;
    display: none; /* desktop-only por padrão */
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.4rem;
    z-index: 5;
    transition: background-color 0.2s, transform 0.1s;
}

.carousel-arrow-left {
    left: 4px;
}

.carousel-arrow-right {
    right: 4px;
}

.carousel-arrow:hover {
    background-color: rgba(17, 24, 39, 1);
    transform: translateY(-50%) scale(1.05);
}

/* Desktop: mostra as setas */
@media (min-width: 769px) {
    .carousel-arrow {
        display: flex;
    }
}

/* Mobile: foco em swipe, sem setas */
@media (max-width: 768px) {
    .carousel-arrow {
        display: none;
    }
}

/* --- ESTILOS DAS BOLHAS DE CATEGORIA --- */
.categories-grid {
    display: flex;
    justify-content: flex-start;
    flex-wrap: nowrap;              /* NÃO deixa quebrar para segunda linha */
    gap: 20px;
    overflow-x: auto;               /* habilita swipe/scroll horizontal */
    overflow-y: hidden;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
}

.categories-grid.categories-no-overflow {
    justify-content: center;
}

/* Esconde a barra de rolagem visualmente */
.categories-grid::-webkit-scrollbar {
    display: none;
}
.categories-grid {
    scrollbar-width: none; /* Firefox */
}

/* --- Setas da barra de categorias --- */
.categories-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 32px;
    height: 32px;
    border-radius: 999px;
    border: none;
    background-color: rgba(17, 24, 39, 0.85);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.2rem;
    z-index: 5;
    transition: background-color 0.2s, transform 0.1s, opacity 0.2s;
    opacity: 0.9;
}

.categories-arrow-left {
    left: 4px;
}

.categories-arrow-right {
    right: 4px;
}

.categories-arrow:hover {
    background-color: rgba(17, 24, 39, 1);
    transform: translateY(-50%) scale(1.05);
}

/* Mobile: setas um pouco menores, mas visíveis */
@media (max-width: 768px) {
    .categories-arrow {
        width: 28px;
        height: 28px;
        font-size: 1rem;
        opacity: 0.7;
    }

    .categories-grid {
        padding: 6px 36px; /* ajusta padding para as setas menores */
    }
}

/* --- ESTILOS DO CARROSSEL DE PRODUTOS --- */
.product-carousel-container {
    width: 100%;
    overflow: hidden;
    /* ▼▼▼ 4. REMOVA O PADDING LATERAL DO CARROSSEL (SE HOUVER) ▼▼▼ */
    /* Se você tiver padding aqui, remova-o para que os cards encostem nas bordas */
}

.product-card {
    flex: 0 0 240px;
    /* ▼▼▼ 5. AJUSTE A MARGEM DOS CARDS PARA COMPRIMIR ▼▼▼ */
    margin: 0 10px; /* ANTES: 0 15px. */
}

/* --- MOBILE: VERSÃO MAIS COMPACTA E LEVEMENTE MAIS VERTICAL --- */
@media (max-width: 768px) {
    /* Seção mais enxuta no fluxo geral */
    .featured-products-section {
        margin-top: 8px;
        margin-bottom: 8px;
    }

    .featured-products-section h2 {
        font-size: 1.25rem;
        margin-bottom: 12px;
    }

    .featured-products-section .product-carousel-container {
        padding: 4px 0;
    }

    /* Card menor no geral (largura) */
    .featured-products-section .product-card {
        flex: 0 0 180px;     
        margin: 0 6px;
        border-radius: 10px;
        box-shadow: 0 3px 6px rgba(0,0,0,0.05);
    }

    .featured-products-section .product-card-image-wrapper,
    .featured-products-section .product-card-image {
        height: 165px;
    }

    .featured-products-section .product-card-details {
        padding: 8px 10px 10px;
    }

    .featured-products-section .product-card-name {
        font-size: 0.9rem;
        margin-bottom: 4px;
        height: auto;
    }

    .featured-products-section .price-container {
        gap: 2px;
    }

    .featured-products-section .product-card-price.original {
        font-size: 0.75rem;
    }

    .featured-products-section .product-card-price.sale,
    .featured-products-section .price-container .product-card-price:not(.original):not(.sale) {
        font-size: 0.98rem;
    }

    .featured-products-section .discount-percentage-tag {
        font-size: 0.7rem;
        padding: 2px 6px;
        margin-left: 4px;
    }

    .featured-products-section .promotion-tag {
        font-size: 0.7rem;
        padding: 2px 6px;
        top: 8px;
        left: 8px;
    }

    .featured-products-section .free-shipping-info {
        margin-top: 6px;
        padding-top: 6px;
        font-size: 0.72rem;
    }

    .featured-products-section .free-shipping-info svg {
        width: 14px;
        height: 14px;
    }
}

/* 9. Adiciona o padding lateral de volta para as outras seções. */
.categories-section h2,
.featured-products-section h2 {
    text-align: left;
    width: 100%; /* Garante que o h2 ocupe todo o espaço para se alinhar */
}

/* 2. Adiciona o emoji DEPOIS do texto, como deveria ser. */
.featured-products-section h2::after {
    content: ""; /* Emoji com um espaço ANTES dele */
    font-size: 1.5rem;
    vertical-align: middle;
    margin-left: 8px; /* Espaço entre o texto e o emoji */
}

/* --- Estilos dos Botões de Ação na Página do Produto --- */
.product-actions-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 30px;
}

.add-to-cart-btn {
    width: 100%;
    padding: 18px;
    font-size: 1.2rem;
    font-weight: 700;
    color: #fff;
    background-color: #000000; /* Verde para diferenciar do botão "Comprar Agora" */
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.add-to-cart-btn:hover {
    background-color: #000000; /* Verde mais escuro no hover */
}

.buy-button {
    width: 100%;
    padding: 18px;
    font-size: 1.2rem;
    font-weight: 700;
    color: #fff;
    background-color: #007aff; /* Azul original */
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.buy-button:hover {
    background-color: #025ec2;
}

/* Estados de loading para os botões */
.add-to-cart-btn:disabled,
.buy-button:disabled {
    background-color: #000000;
    cursor: not-allowed;
}

/* --- RESPONSIVIDADE MOBILE PARA PÁGINA DE PRODUTO --- */
@media (max-width: 768px) {
    /* Remove todo o padding e margin do container principal */
    .product-page-wrapper {
        padding: 0;
        margin: 0;
    }
    
    .product-page-container {
        border-radius: 0;
        border: none;
        box-shadow: none;
        padding: 0;
        margin: 0;
        width: 100%;
        max-width: 100%;
        gap: 0;
        padding: 0 10px !important; /* 10px nas laterais, 0 em cima/baixo */
    }
    
    /* Garante que o header também fique colado */
    .main-header {
        padding: 12px 4%;
        margin: 0;
    }
    
    /* Ajusta o main para não ter espaçamento */
    main {
        padding: 0;
        margin: 0;
    }
    
    /* Remove qualquer padding interno das seções */
    .product-gallery,
    .product-info {
        padding: 15px;
    }
    
    /* Garante que as imagens ocupem 100% da largura */
    .product-gallery img {
        width: 100%;
        border-radius: 0;
    }
    
    /* Remove margens do título e preço */
    .product-info h1 {
        margin-top: 0;
        font-size: 1.5rem;
    }
    
    /* Ajusta os botões para ocupar largura total */
    .product-actions-container {
        padding: 0 15px 20px 15px;
        margin-top: 20px;
    }
    
    .add-to-cart-btn,
    .buy-button {
        border-radius: 0;
    }
}

/* Para telas muito pequenas (iPhone SE etc) */
@media (max-width: 375px) {
    .product-info {
        padding: 12px;
    }
    
    .product-actions-container {
        padding: 0 12px 15px 12px;
    }
    
    .product-info h1 {
        font-size: 1.3rem;
    }
}

/* --- ADAPTAÇÃO PARA TELAS EXTRA WIDE --- */
@media (min-width: 1200px) {
    .product-page-container {
        max-width: 1200px;
        margin: 0 auto;
    }
}

@media (min-width: 1400px) {
    .product-page-container {
        max-width: 1400px;
    }
}

@media (min-width: 1600px) {
    .product-page-container {
        max-width: 1600px;
        grid-template-columns: 1fr 1fr;
        gap: 80px;
    }
}

@media (min-width: 1800px) {
    .product-page-container {
        max-width: 1800px;
    }
}

@media (min-width: 2000px) {
    .product-page-container {
        max-width: 2000px;
        gap: 100px;
    }
}

@media (min-width: 2200px) {
    .product-page-container {
        max-width: 2200px;
    }
}

/* Para telas MUITO largas, remove o max-width */
@media (min-width: 2400px) {
    .product-page-container {
        max-width: 2400px;
    }
}

/* Para telas MUITO largas, remove o max-width */
@media (min-width: 2600px) {
    .product-page-container {
        max-width: 2600px;
    }
}

/* Para telas MUITO largas, remove o max-width */
@media (min-width: 2800px) {
    .product-page-container {
        max-width: 2800px;
    }
}

/* Para telas MUITO largas, remove o max-width */
@media (min-width: 3000px) {
    .product-page-container {
        max-width: 3000px;
    }
}

@media (max-width: 600px) {
    .cart-sidebar {
        width: 85% !important;  /* Você pode ajustar entre 70% – 90% */
    }
}

@media (max-width: 768px) {
    .product-actions-container { 
        display: none !important;
    }
}

/* --- FOOTER STICKY MOBILE PARA AÇÕES DO PRODUTO --- */
/* No CSS inline ou no style.css, adicione: */
@media (max-width: 768px) {
    .mobile-cart-btn {
        position: relative;
        display: flex;
        align-items: center;
        justify-content: center;
        background: none;
        border: none;
        padding: 10px;
        color: var(--primary-color);
        cursor: pointer;
        font-weight: bold;
    }
    
    .mobile-cart-plus {
        position: absolute;
        top: 2px;
        right: 2px;
        background: var(--accent-color);
        color: white;
        font-size: 0.8rem;
        font-weight: 900;
        width: 16px;
        height: 16px;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        line-height: 1;
        z-index: 2;
    }
    
    .mobile-cart-count {
        position: absolute;
        top: 2px;
        right: 2px;
        background: #e53935; /* Vermelho para diferenciar do "+" */
        color: white;
        font-size: 0.7rem;
        font-weight: 700;
        width: 16px;
        height: 16px;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        z-index: 1;
    }

.mobile-product-actions.cart-open {
    display: none !important;
}
    
    /* Esconde o contador quando for 0 */
    .mobile-cart-count:empty {
        display: none;
    }
}

.mobile-product-actions.cart-open {
}

/* --- Setas da faixa de categorias --- */
.categories-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 32px;
    height: 32px;
    border-radius: 999px;
    border: none;
    background-color: rgba(17, 24, 39, 0.85);
    color: #ffffff;
    display: none; /* padrão: escondido, JS/CSS decide quando aparece */
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.2rem;
    z-index: 5;
    transition: background-color 0.2s, transform 0.1s, opacity 0.2s;
    opacity: 0.9;
}

.categories-arrow-left {
    left: 4px;
}

.categories-arrow-right {
    right: 4px;
}

.categories-arrow:hover {
    background-color: rgba(17, 24, 39, 1);
    transform: translateY(-50%) scale(1.05);
}

/* MOBILE: seta sempre visível (ilustrativa + funcional) */
@media (max-width: 768px) {
    .categories-arrow {
        width: 28px;
        height: 28px;
        font-size: 1rem;
        opacity: 0.7;
        display: flex;  /* sempre aparece no mobile */
    }

    .categories-grid {
        padding: 6px 36px; /* espaço para não colidir com as setas */
    }
}

/* DESKTOP: seta só aparece se JS marcar overflow */
@media (min-width: 769px) {
    .categories-arrow.is-visible-desktop {
        display: flex;
    }

    .categories-grid {
        padding: 8px 40px; /* espaço lateral para as setas no desktop */
    }
}

/* --- Popup do Boleto (compatível com o sistema global de popups) --- */

/* === POPUP GENÉRICO (USADO EM PRODUTO, PIX, BOLETO, ETC.) === */
.popup-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.65);
    display: none;              /* começa oculto */
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.popup-overlay.visible {
    display: flex;              /* quando a classe visible entra, aparece */
}

.popup-content {
    background: #0b1020;
    border-radius: 16px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.7);
    padding: 24px;
    max-width: 520px;
    width: 90%;
    color: #fff;
    position: relative;
}

#boleto-popup-overlay .popup-content {
    max-width: 450px;       /* menor que o popup de produto */
    padding: 25px 22px;
}

#boleto-popup-overlay h2 {
    font-size: 1.4rem;
    margin-bottom: 10px;
}

#boleto-linha-digitavel {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 0.95rem;
}

#boleto-copy-line {
    margin-top: 10px;
    width: 100%;
    padding: 10px 14px;
    border-radius: 8px;
    border: none;
    background-color: var(--primary-color);
    color: #fff;
    font-weight: 600;
    cursor: pointer;
}

#boleto-open-pdf {
    display: inline-flex;
    margin-top: 15px;
    color: var(--accent-color);
    font-weight: 600;
    text-decoration: none;
}

/* === POPUP ESPECÍFICO DO BOLETO === */
#boleto-popup-overlay .popup-content {
    max-width: 540px;
}

#boleto-popup-overlay h2 {
    font-size: 1.4rem;
    margin-bottom: 12px;
}

#boleto-popup-overlay .boleto-line-input-row {
    display: flex;
    gap: 8px;
    margin-bottom: 10px;
}

#boleto-popup-overlay #boleto-linha-digitavel {
    flex: 1;
    padding: 8px 10px;
    border-radius: 8px;
    border: 1px solid #323c4f;
    background: #070b16;
    color: #fff;
    font-family: monospace;
    font-size: 0.9rem;
}

#boleto-popup-overlay #boleto-copy-line {
    padding: 8px 12px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    font-size: 0.85rem;
}

#boleto-popup-overlay .boleto-due {
    font-size: 0.9rem;
    margin-bottom: 8px;
}

#boleto-popup-overlay #boleto-open-pdf {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
    padding: 8px 12px;
    border-radius: 8px;
    border: 1px solid #3b82f6;
    text-decoration: none;
    font-size: 0.9rem;
}

/* linha superior – override visual do popup do boleto */
/* Popup do boleto com a mesma cara do checkout */
#boleto-popup-overlay .popup-content {
    background-color: #ffffff;
    color: var(--text-color);
    border-radius: 12px;
    box-shadow: 0 20px 40px rgba(15, 23, 42, 0.16);
    max-width: 520px;
    width: 100%;
    padding: 24px 22px;
}

/* Linha da linha digitável: input grande + botão normal ao lado */
#boleto-popup-overlay .boleto-line-input-row {
    display: flex;
    gap: 8px;
    align-items: center;
}

/* Input da linha digitável bem visível */
#boleto-popup-overlay #boleto-linha-digitavel {
    flex: 1;
    padding: 10px 12px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background: #ffffff;          /* tira o bloco preto */
    color: #111827;               /* texto escuro, legível */
    font-family: monospace;
    font-size: 0.9rem;
    letter-spacing: 0.08em;
}

/* Botão de copiar ao lado, sem ocupar 100% da largura */
#boleto-popup-overlay #boleto-copy-line {
    width: auto;                  /* override do width:100% global */
    margin-top: 0;                /* alinha na mesma linha do input */
    padding: 8px 14px;
    border-radius: 8px;
    border: none;
    background-color: var(--primary-color);
    color: #fff;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
}

/* Link de abrir boleto em PDF como botão sólido escuro */
#boleto-popup-overlay #boleto-open-pdf {
    border-color: var(--primary-color);
    background-color: #111827;
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}
/* linha inferior */

/* linha superior – preview interno do PDF do boleto */
/* Pré-visualização do boleto no popup */
#boleto-popup-overlay .boleto-preview-container {
    margin-top: 12px;
    margin-bottom: 10px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    overflow: hidden;
    background: #f9fafb;
    height: 260px;  /* cerca de 1/3 do popup */
}

#boleto-popup-overlay #boleto-pdf-preview {
    width: 100%;
    height: 100%;
    border: 0;
}
/* linha inferior */

#boleto-download-pdf {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
    margin-left: 8px;        /* fica ao lado do Abrir PDF */
    padding: 8px 12px;
    border-radius: 8px;
    border: 1px solid var(--primary-color);
    background-color: #111827;
    color: #fff;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
}

/* Dropdown de Login */
.login-dropdown {
    position: absolute;
    top: 60px; /* altura do header */
    right: 10px; /* encostado no botão Entrar */
    width: 350px;
    background: white;
    display: none;
    box-shadow: 0 4px 25px rgba(0,0,0,0.12);
    border-radius: 8px;
    z-index: 999999;
}

.login-dropdown-content {
    padding: 20px;
    position: relative;
}

.login-dropdown-close {
    position: absolute;
    right: 10px;
    top: 8px;
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
}