/* =========================================
   VARIÁVEIS DE CORES E FONTES
   ========================================= */
:root {
    --bg-color: #f5f5f5;
    --card-bg: #ffffff;
    --text-main: #111111;
    --text-muted: #666666;
    --primary-color: #000000;
    --action-color: #10B981; 
    --border-color: #eee;
    --border-radius: 12px;
}

body.dark-mode {
    --bg-color: #121212;
    --card-bg: #1e1e1e;
    --text-main: #f1f1f1;
    --text-muted: #a1a1aa;
    --primary-color: #10B981; 
    --border-color: #333;
}

* {
    margin: 0; padding: 0; box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

body {
    background-color: var(--bg-color); color: var(--text-main);
    padding-top: 60px; 
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* HEADER */
.header {
    position: fixed; top: 0; left: 0; width: 100%; height: 60px;
    background-color: #000; color: white; 
    display: flex; justify-content: space-between; align-items: center;
    padding: 0 15px; z-index: 100;
}
.logo h1 { font-size: 1.2rem; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; }

.cart-icon { position: relative; width: 28px; height: 28px; cursor: pointer; }
.cart-icon svg { width: 100%; height: 100%; }
.cart-badge {
    position: absolute; top: -5px; right: -8px;
    background-color: var(--action-color); color: white;
    font-size: 0.7rem; font-weight: bold; width: 18px; height: 18px;
    border-radius: 50%; display: flex; justify-content: center; align-items: center;
}

/* CATEGORIAS */
.categories {
    position: sticky; top: 60px; background-color: var(--bg-color);
    padding: 10px 15px; display: flex; gap: 10px; overflow-x: auto;
    white-space: nowrap; z-index: 90;
    -ms-overflow-style: none; scrollbar-width: none;
    transition: background-color 0.3s ease;
}
.categories::-webkit-scrollbar { display: none; }
.cat-btn {
    background-color: var(--card-bg); border: 1px solid var(--border-color); padding: 8px 16px;
    border-radius: 20px; font-size: 0.9rem; color: var(--text-muted);
    cursor: pointer; transition: 0.2s;
}
.cat-btn.active { background-color: var(--primary-color); color: #fff; border-color: var(--primary-color); }
body.dark-mode .cat-btn.active { color: #111; font-weight: bold; }

/* GRID E CARDS PREMIUM */
.product-grid {
    display: grid; grid-template-columns: repeat(2, 1fr);
    gap: 12px; padding: 10px 15px 30px 15px;
}
.product-card {
    border: none; border-radius: var(--border-radius);
    box-shadow: 0 4px 12px rgba(0,0,0,0.08); overflow: hidden;
    background: var(--card-bg); display: flex; flex-direction: column;
    transition: background-color 0.3s ease;
}
body.dark-mode .product-card { box-shadow: 0 4px 12px rgba(0,0,0,0.3); }

/* FOTOS RESPONSIVAS E ENQUADRADAS (MOBILE E PC) */
.product-image img { 
    width: 100%; 
    height: 165px; 
    object-fit: contain; 
    object-position: center; /* Crava qualquer foto (comprida ou larga) no centro exato */
    box-sizing: border-box; /* A MÁGICA: Impede que o padding "estoure" a caixa e corte a foto */
    background-color: var(--card-bg); 
    transition: filter 0.3s ease, transform 0.3s ease;
    padding: 12px; 
}

/* Suaviza as imagens no modo escuro */
body.dark-mode .product-image img { 
    filter: brightness(0.85); 
}

/* No Computador ou Tablet, a foto volta a ficar grande */
@media (min-width: 768px) {
    .product-image img { 
        height: 220px; 
        padding: 15px;
    }
}

.product-info { padding: 15px; display: flex; flex-direction: column; flex-grow: 1; }
.product-title {
    font-size: 1.1rem; font-weight: 700; color: var(--text-main); margin-bottom: 8px;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.product-price { font-size: 1.25rem; font-weight: 800; color: var(--action-color); margin-bottom: 15px; transition: color 0.3s; }

.btn-escolher {
    margin-top: auto; background-color: var(--primary-color); color: #fff;
    border: none; padding: 12px; border-radius: 8px;
    font-weight: bold; font-size: 1rem; cursor: pointer; transition: background 0.2s; width: 100%;
}
body.dark-mode .btn-escolher { color: #111; }
.btn-escolher:active { transform: scale(0.98); }

/* BARRA DE PESQUISA */
.search-container {
    padding: 15px 15px 0 15px;
    background-color: var(--bg-color); transition: background-color 0.3s ease;
}
.search-input {
    width: 100%; padding: 14px 20px; border-radius: 30px;
    border: 1px solid var(--border-color); background: var(--card-bg); color: var(--text-main);
    font-size: 1rem; outline: none; box-shadow: inset 0 2px 4px rgba(0,0,0,0.02);
    transition: border-color 0.2s, box-shadow 0.2s, background-color 0.3s, color 0.3s;
}
.search-input:focus { border-color: var(--action-color); box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1); }

/* MODAIS */
.modal-overlay, .lead-modal-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.7); display: flex; justify-content: center; align-items: flex-end;
    z-index: 2000; opacity: 0; visibility: hidden; transition: all 0.3s ease; backdrop-filter: blur(3px);
}
.modal-overlay.active, .lead-modal-overlay.active { opacity: 1; visibility: visible; }
.lead-modal-overlay { align-items: center; }

.modal-content {
    background: var(--card-bg); width: 100%; max-width: 500px; border-radius: 20px 20px 0 0;
    padding: 20px; transform: translateY(100%); transition: transform 0.3s ease;
    max-height: 85vh; display: flex; flex-direction: column; color: var(--text-main);
}
.modal-overlay.active .modal-content { transform: translateY(0); }
.modal-header {
    display: flex; justify-content: space-between; align-items: center;
    border-bottom: 1px solid var(--border-color); padding-bottom: 15px; margin-bottom: 15px;
}
.modal-header h3 { font-size: 1.2rem; color: var(--text-main); }
.close-modal { background: var(--border-color); color: var(--text-main); border: none; width: 32px; height: 32px; border-radius: 50%; font-weight: bold; cursor: pointer; }
.modal-product-info { display: flex; align-items: center; gap: 15px; margin-bottom: 20px; }
.modal-product-info img { width: 60px; height: 60px; object-fit: cover; border-radius: 8px; background: #fff;}
.modal-flavors-list { overflow-y: auto; flex-grow: 1; margin-bottom: 20px; }
.btn-confirmar { background: var(--action-color); color: white; border: none; padding: 16px; border-radius: 8px; font-weight: bold; font-size: 1.1rem; width: 100%; cursor: pointer; }
.btn-confirmar:disabled { background: #555; color: #888; cursor: not-allowed; }

.flavor-option {
    display: flex; justify-content: space-between; align-items: center;
    padding: 15px; border: 1px solid var(--border-color); border-radius: 8px; margin-bottom: 10px;
}
.flavor-name { font-weight: 500; color: var(--text-main); font-size: 1.05rem; }
.qty-control { display: flex; align-items: center; gap: 15px; }
.qty-btn {
    background: var(--border-color); color: var(--text-main); border: none; width: 32px; height: 32px; border-radius: 50%;
    font-weight: bold; font-size: 1.2rem; cursor: pointer; display: flex; justify-content: center; align-items: center; transition: background 0.2s;
}
.qty-btn:active { filter: brightness(0.8); }
.qty-count { font-weight: bold; font-size: 1.1rem; min-width: 20px; text-align: center; }

/* CARRINHO SIDEBAR */
.cart-sidebar {
    position: fixed; top: 0; right: -100%; width: 85%; max-width: 350px; height: 100vh;
    background-color: var(--card-bg); z-index: 2100; transition: right 0.3s ease;
    display: flex; flex-direction: column; box-shadow: -5px 0 15px rgba(0,0,0,0.5); color: var(--text-main);
}
.cart-sidebar.open { right: 0; }
.cart-header { padding: 20px; border-bottom: 1px solid var(--border-color); display: flex; justify-content: space-between; align-items: center; }
.close-cart { background: none; border: none; font-size: 1.2rem; font-weight: bold; cursor: pointer; color: var(--text-main); }
.cart-items { flex-grow: 1; overflow-y: auto; padding: 20px; }
.cart-footer { padding: 20px; border-top: 1px solid var(--border-color); background-color: var(--bg-color); }
.cart-total { display: flex; justify-content: space-between; font-size: 1.2rem; margin-bottom: 15px; font-weight: bold;}
.checkout-btn {
    width: 100%; background-color: var(--primary-color); color: #fff;
    border: none; padding: 15px; border-radius: var(--border-radius);
    font-size: 1rem; font-weight: bold; cursor: pointer;
}
body.dark-mode .checkout-btn { color: #111; }

.overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100vh;
    background-color: rgba(0,0,0,0.5); z-index: 2050; display: none;
}
.overlay.active { display: block; }

.toast {
    visibility: hidden; min-width: 280px; background-color: var(--action-color);
    color: #fff; text-align: center; border-radius: 8px; padding: 16px;
    position: fixed; z-index: 3000; left: 50%; bottom: 20px; transform: translateX(-50%);
    font-weight: bold; font-size: 0.95rem; box-shadow: 0 5px 15px rgba(0,0,0,0.4);
    opacity: 0; transition: opacity 0.3s ease, bottom 0.3s ease;
}
.toast.show { visibility: visible; opacity: 1; bottom: 80px; }

.floating-help-btn {
    position: fixed; left: 15px; bottom: 80px; background: #25D366; color: white;
    padding: 10px 15px; border-radius: 30px; font-weight: bold; font-size: 0.9rem; text-decoration: none;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2); z-index: 900; transition: transform 0.2s;
    display: flex; align-items: center; gap: 5px;
}
.floating-help-btn:active { transform: scale(0.95); }

/* ADAPTAÇÃO PARA TABLETS E COMPUTADORES (COM EFEITO GLOW FASE 1) */
@media (min-width: 768px) {
    body { max-width: 100%; margin: 0; box-shadow: none; }
    .header { max-width: 100%; left: 0; transform: none; padding: 0 5%; }
    .categories { justify-content: center; max-width: 1200px; margin: 0 auto; padding: 20px; }
    .product-grid { grid-template-columns: repeat(3, 1fr); max-width: 1200px; margin: 0 auto; padding: 20px; gap: 20px; }
    .floating-help-btn { bottom: 25px; } 
}
@media (min-width: 1024px) {
    .product-grid { grid-template-columns: repeat(4, 1fr); gap: 25px; }
    .header { padding: 0 calc(50vw - 600px); }
    
    /* Prepara o card para a animação */
    .product-card { transition: transform 0.3s ease, box-shadow 0.3s ease, border 0.3s ease; border: 1px solid transparent; }
    
    /* Efeito de Brilho Premium ao passar o mouse (Claro e Escuro) */
    .product-card:hover { 
        transform: translateY(-5px); 
        box-shadow: 0 10px 25px rgba(16, 185, 129, 0.2); 
        border: 1px solid rgba(16, 185, 129, 0.5); 
    }
    body.dark-mode .product-card:hover { 
        box-shadow: 0 10px 30px rgba(16, 185, 129, 0.35); 
        border: 1px solid rgba(16, 185, 129, 0.8); 
    }
}

/* BARRA FLUTUANTE */
.bottom-cart-bar {
    position: fixed; bottom: 0; left: 0; width: 100%; background-color: var(--action-color);
    color: white; padding: 15px 20px; display: flex; justify-content: space-between; align-items: center;
    z-index: 1000; cursor: pointer; transform: translateY(100%); transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 -4px 15px rgba(0,0,0,0.2);
}
.bottom-cart-bar.visible { transform: translateY(0); }
.bottom-cart-info { display: flex; align-items: center; gap: 10px; }
.bottom-badge {
    background-color: white; color: var(--action-color); font-weight: bold; width: 24px; height: 24px;
    display: flex; justify-content: center; align-items: center; border-radius: 50%; font-size: 0.9rem;
}

.product-old-price { font-size: 0.9rem; color: #a1a1aa; margin-bottom: -5px; font-weight: 500; }

.skeleton {
    animation: shimmer 1.5s infinite linear;
    background: linear-gradient(to right, #e2e8f0 4%, #cbd5e1 25%, #e2e8f0 36%);
    background-size: 1000px 100%;
}
body.dark-mode .skeleton { background: linear-gradient(to right, #333 4%, #444 25%, #333 36%); }
@keyframes shimmer { 0% { background-position: -1000px 0; } 100% { background-position: 1000px 0; } }

/* Age Gate (+18) */
.age-gate-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100vh;
    background: rgba(0,0,0,0.9); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
    z-index: 9999; display: flex; justify-content: center; align-items: center;
    opacity: 1; transition: opacity 0.4s ease;
}
.age-gate-box {
    background: var(--card-bg); padding: 30px 20px; border-radius: 16px;
    text-align: center; max-width: 90%; width: 340px; box-shadow: 0 10px 30px rgba(0,0,0,0.5); color: var(--text-main);
}
.age-gate-box h2 { font-size: 1.4rem; margin-bottom: 10px; font-family: 'Bangers', sans-serif; letter-spacing: 1px;}
.age-gate-box p { color: var(--text-muted); margin-bottom: 25px; font-size: 0.95rem; line-height: 1.5; }
.age-buttons { display: flex; flex-direction: column; gap: 10px; }
.btn-age-yes { background: var(--primary-color); color: #fff; padding: 14px; border: none; border-radius: 8px; font-weight: bold; font-size: 1.1rem; cursor: pointer; transition: 0.2s; }
body.dark-mode .btn-age-yes { color: #111; }
.btn-age-no { background: var(--border-color); color: var(--text-main); padding: 14px; border: none; border-radius: 8px; font-weight: bold; font-size: 1rem; cursor: pointer; }

.cart-upsell { background: rgba(16, 185, 129, 0.1); border: 1px dashed var(--action-color); border-radius: 8px; padding: 12px; margin-bottom: 15px; }
.cart-upsell p { color: var(--action-color); font-weight: bold; font-size: 0.85rem; margin-bottom: 8px; }
.upsell-item { display: flex; justify-content: space-between; align-items: center; font-size: 0.9rem; font-weight: 500;}

/* Botões Injetados */
.wishlist-btn.favorited { color: #ef4444; background: #fff; animation: popHeart 0.3s ease; }
@keyframes popHeart { 0% { transform: scale(1); } 50% { transform: scale(1.3); } 100% { transform: scale(1); } }

/* LOGIN HEADER */
.header-login-btn {
    background: none; border: none; font-size: 0.85rem; font-weight: bold;
    cursor: pointer; display: flex; align-items: center; gap: 5px;
    color: #fff; 
    transition: color 0.3s ease;
}
body.dark-mode .header-login-btn { color: #10B981; }

.auth-tabs { display: flex; background: var(--bg-color); border-radius: 8px; margin-bottom: 15px; overflow: hidden; border: 1px solid var(--border-color); }
.auth-tab { flex: 1; padding: 10px; background: transparent; border: none; font-weight: bold; color: var(--text-muted); cursor: pointer; transition: 0.2s; font-size: 0.95rem;}
.auth-tab.active { background: var(--action-color); color: #fff; }

/* MENU E APP NAV */
body { padding-bottom: 80px; }
.app-bottom-nav {
    position: fixed; bottom: 0; left: 0; right: 0; background: var(--card-bg, #fff);
    display: flex; justify-content: space-around; padding: 10px 5px 15px 5px;
    box-shadow: 0 -4px 15px rgba(0,0,0,0.05); z-index: 1000; border-top: 1px solid var(--border-color);
}
body.dark-mode .app-bottom-nav { box-shadow: 0 -4px 15px rgba(0,0,0,0.5); }
.app-bottom-nav button {
    background: none; border: none; font-size: 0.75rem; color: var(--text-muted);
    display: flex; flex-direction: column; align-items: center; gap: 4px; cursor: pointer; position: relative;
}
.app-bottom-nav button.active { color: var(--action-color, #10B981); font-weight: bold; }
.app-bottom-nav button i { font-size: 1.2rem; font-style: normal; }
.cart-badge-nav {
    background: #ef4444; color: #fff; font-size: 0.65rem; padding: 2px 6px;
    border-radius: 10px; position: absolute; top: -5px; right: 5px; font-weight: bold;
}

.brand-filters {
    display: none; justify-content: center; gap: 8px; margin-bottom: 20px; flex-wrap: wrap; padding: 0 15px;
}
.brand-btn {
    background: var(--bg-color); border: 1px solid var(--border-color); padding: 6px 15px;
    border-radius: 20px; font-size: 0.85rem; font-weight: bold; cursor: pointer; color: var(--text-main); transition: 0.2s;
}
.brand-btn.active { background: var(--action-color); color: #fff; border-color: var(--action-color); }

.faq-container { max-width: 800px; margin: 40px auto; padding: 0 15px; }
.faq-container details {
    background: var(--card-bg); padding: 15px; border-radius: 8px; margin-bottom: 10px; 
    border: 1px solid var(--border-color); cursor: pointer; transition: 0.3s;
}
.faq-container details summary { font-weight: bold; color: var(--text-main); outline: none; list-style: none; display: flex; justify-content: space-between;}
.faq-container details summary::-webkit-details-marker { display: none; }
.faq-container details summary::after { content: "▼"; font-size: 0.8rem; }
.faq-container details[open] summary::after { content: "▲"; color: var(--action-color); }
.faq-container details p { margin-top: 10px; font-size: 0.9rem; color: var(--text-muted); line-height: 1.5; }

/* CAIXA DA BUSCA DINÂMICA */
.search-dropdown {
    position: absolute; top: 100%; left: 0; right: 0;
    background: var(--card-bg);
    border-radius: 8px; box-shadow: 0 10px 30px rgba(0,0,0,0.15);
    margin-top: 5px; z-index: 1000; max-height: 300px; overflow-y: auto;
    display: none; border: 1px solid var(--border-color);
}
.search-item {
    display: flex; align-items: center; gap: 12px; padding: 12px;
    border-bottom: 1px solid var(--border-color); cursor: pointer; transition: 0.2s;
}
.search-item:hover { background: rgba(16, 185, 129, 0.08); }
.search-item img { width: 45px; height: 45px; border-radius: 6px; object-fit: cover; }
.search-item-info { flex-grow: 1; }
.search-item-title { font-size: 0.85rem; font-weight: bold; color: var(--text-main); }
.search-item-price { font-size: 0.8rem; color: var(--action-color); font-weight: 800; margin-top: 2px;}
.search-btn-add { 
    background: var(--action-color); color: #fff; border: none; width: 32px; height: 32px; 
    border-radius: 50%; font-weight: bold; font-size: 1.2rem; cursor: pointer; display: flex; align-items: center; justify-content: center;
}