:root {
    --primary-bg: #100732;
    --card-bg: rgba(0, 0, 0, 0.4);
    --surface-bg: rgba(0, 0, 0, 0.4);
    --surface-strong: rgba(255, 255, 255, 0.08);
    --surface-muted: rgba(0, 0, 0, 0.3);
    --surface-hover: rgba(255, 255, 255, 0.14);
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --accent: #10b981;
    --accent-hover: #059669;
    --element-border: rgba(255, 255, 255, 0.1);
    --shadow: rgba(0, 0, 0, 0.3);
    --overlay-bg: rgba(0, 0, 0, 0.6);
    --card-radius: 20px;
    --transition-speed: 0.3s;
}

[data-theme="light"] {
    --primary-bg: #f4f6fb;
    --card-bg: rgba(255, 255, 255, 0.92);
    --surface-bg: rgba(255, 255, 255, 0.92);
    --surface-strong: rgba(255, 255, 255, 0.96);
    --surface-muted: rgba(15, 23, 42, 0.06);
    --surface-hover: rgba(15, 23, 42, 0.06);
    --text-main: #0f172a;
    --text-muted: #475569;
    --element-border: rgba(15, 23, 42, 0.12);
    --shadow: rgba(15, 23, 42, 0.14);
    --overlay-bg: rgba(15, 23, 42, 0.45);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--primary-bg);
    color: var(--text-main);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: background-color var(--transition-speed) ease, color var(--transition-speed) ease;
}

.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
}

/* Header Styles */
.header {
    padding: 5rem 0 4rem 0;
    /* Um pouco mais alto para a foto aparecer bem */
    text-align: center;
    margin-bottom: 2rem;
    position: relative;
    /* Necessário para o pseudo-elemento absoluto */
}

/* Os pseudo-elementos abaixo hospedam as duas imagens de fundo injetadas. 
   O CSS lida com a transição de opacidade (crossfade) super suave entre elas! */
.header::before, .header::after {
    content: "";
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background-size: cover;
    background-position: center;
    z-index: -1;
    /* Transição mágica e lenta de 2 segundos de esfumaçamento */
    transition: opacity 2s ease-in-out;
    /* A máscara faz com que a opacidade dessa imagem desapareça totalmente aos 98% da altura */
    -webkit-mask-image: linear-gradient(to bottom, black 0%, black 85%, transparent 98%);
    mask-image: linear-gradient(to bottom, black 0%, black 85%, transparent 98%);
}

.header::before {
    background-image: var(--header-bg-image-1);
    opacity: 0.35; /* Imagem 1 começa visível */
}

.header::after {
    background-image: var(--header-bg-image-2);
    opacity: 0; /* Imagem 2 começa escondida */
}

/* Quando o JS injeta essa classe, a Imagem 1 esconde e a Imagem 2 aparece */
.header.show-second-bg::before {
    opacity: 0;
}
.header.show-second-bg::after {
    opacity: 0.35;
}

.header .container {
    position: relative;
    z-index: 1;
    /* Garante que os textos do título e logo fiquem ACIMA da imagem com opacidade */
}

.logo {
    font-size: 3rem;
    font-weight: 800;
    letter-spacing: -1px;
    margin-bottom: 0.5rem;
}

.logo span {
    color: var(--accent);
}

.subtitle {
    font-size: 1.1rem;
    color: var(--text-muted);
}

.brand-slogan {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 2rem;
}

/* Botão de Compartilhar e Alternar Tema */
.header-actions {
    position: absolute;
    top: 20px;
    right: 20px;
    display: flex;
    gap: 0.75rem;
    z-index: 20;
}

.btn-share,
.theme-toggle {
    width: 45px;
    height: 45px;
    background: var(--surface-strong);
    border: 1px solid var(--element-border);
    color: var(--text-main);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    backdrop-filter: blur(5px);
}

.btn-share:hover,
.theme-toggle:hover {
    background: var(--surface-hover);
    border-color: var(--accent);
    color: var(--accent);
    transform: rotate(15deg) scale(1.1);
}

.btn-share:active,
.theme-toggle:active {
    transform: scale(0.9);
}

.theme-toggle {
    font-size: 1.1rem;
}

@media (max-width: 768px) {
    .header-actions {
        top: 15px;
        right: 15px;
    }

    .btn-share,
    .theme-toggle {
        width: 40px;
        height: 40px;
    }
}

/* Menu Grid */
.menu-section {
    flex: 1;
    margin-bottom: 4rem;
}

.section-title {
    font-size: 2rem;
    margin-bottom: 2rem;
    position: relative;
    display: inline-block;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 0;
    width: 50%;
    height: 3px;
    background-color: var(--accent);
    border-radius: 2px;
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 2rem;
}

/* Estado Vazio (Busca) */
.empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-muted);
}
.empty-state p {
    font-size: 1.2rem;
    color: var(--text-main);
    margin-bottom: 0.5rem;
}
.empty-state small {
    font-size: 0.95rem;
}

/* Card Styles - Glassmorphism */
.card {
    background: var(--card-bg);
    border-radius: var(--card-radius);
    overflow: hidden;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--element-border);
    box-shadow: 0 10px 30px var(--shadow);
    transition: transform var(--transition-speed) ease, box-shadow var(--transition-speed) ease;
    display: flex;
    flex-direction: column;
}

.card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
    border-color: rgba(16, 185, 129, 0.3);
}

.card-image-wrapper {
    width: 100%;
    height: 220px;
    overflow: hidden;
    position: relative;
}

.card-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.card:hover .card-image {
    transform: scale(1.08);
}

.card-content {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.card-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.card-description {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
    flex: 1;
    /* Pushes footer to bottom */
}

.card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
}

.price {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--text-main);
}

/* Premium Button */
.btn-order {
    background: var(--accent);
    color: white;
    border: none;
    padding: 0.75rem 1.25rem;
    border-radius: 50px;
    font-weight: 600;
    font-family: inherit;
    font-size: 0.95rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all var(--transition-speed) ease;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
}

.btn-order:hover {
    background: var(--accent-hover);
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.5);
}

.btn-order:active {
    transform: scale(0.98);
}

/* Footer */
.footer {
    text-align: center;
    padding: 2rem 0;
    color: var(--text-muted);
    border-top: 1px solid var(--element-border);
    margin-top: auto;
}

/* Responsive */
@media (max-width: 768px) {
    .header {
        padding: 2.5rem 0;
    }

    .logo {
        font-size: 2.5rem;
    }

    .brand-logo {
        max-width: 120px;
        height: 120px;
        margin-bottom: 0.5rem;
    }

    .grid {
        grid-template-columns: repeat(2, 1fr);
        /* 2 Protudos Lado a Lado */
        gap: 0.8rem;
        /* Espaçamento menor entre os cards */
    }

    .card-image-wrapper {
        height: 120px;
        /* Imagens um pouco menores para não alongar muito a tela */
    }

    .card-content {
        padding: 0.8rem;
        /* Margens internas mais justas */
    }

    .card-title {
        font-size: 1rem;
        /* Título um pouco menor */
        line-height: 1.2;
        margin-bottom: 0.3rem;
    }

    .card-description {
        font-size: 0.8rem;
        /* Descrição menor para não tomar tanto espaço vertical */
        margin-bottom: 0.8rem;
    }

    .card-footer {
        flex-direction: column;
        /* Coloca o botão Embaixo do preço no celular para evitar furos */
        align-items: flex-start;
        gap: 0.6rem;
    }

    .price {
        font-size: 1.1rem;
    }

    .btn-order {
        width: 100%;
        /* Botão largo acompanhando as 2 coluninhas */
        justify-content: center;
        padding: 0.5rem;
        font-size: 0.85rem;
    }

    .container {
        width: 96%;
        /* Ganhar o máximo de espaço na largura da tela */
    }

    .btn-category {
        padding: 0.5rem 1.2rem;
        font-size: 0.95rem;
    }
}

/* Category Menu */
.menu-header {
    margin-bottom: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.search-container {
    margin-bottom: 0.5rem;
}

#search-input {
    width: 100%;
    padding: 0.8rem 1.2rem;
    border-radius: 50px;
    background: var(--surface-muted);
    border: 1px solid var(--element-border);
    color: var(--text-main);
    font-family: inherit;
    font-size: 1rem;
    outline: none;
    transition: border-color var(--transition-speed);
}

#search-input:focus {
    border-color: var(--accent);
}

.category-menu {
    display: flex;
    gap: 1rem;
    overflow-x: auto;
    padding-bottom: 0.5rem;
    scrollbar-width: none;
    /* Firefox */
    -webkit-overflow-scrolling: touch;
    /* Scroll suave e natural nos iPhones (iOS) */
    scroll-behavior: smooth;
}

.category-menu::-webkit-scrollbar {
    display: none;
    /* Chrome, Safari */
}

.btn-category {
    background: transparent;
    color: var(--text-muted);
    border: 1px solid var(--element-border);
    padding: 0.6rem 1.5rem;
    border-radius: 50px;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
    /* Garante que os botões MANTENHAM seu tamanho original e ativem o scroll! */
    transition: all var(--transition-speed) ease;
}

.btn-category:hover {
    color: var(--text-main);
    border-color: rgba(255, 255, 255, 0.5);
}

.btn-category.active {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
}

/* Logo Styles & Animations */
@keyframes float {
    0% {
        transform: translateY(0px);
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    }

    50% {
        transform: translateY(-8px);
        box-shadow: 0 12px 20px rgba(0, 0, 0, 0.4);
    }

    100% {
        transform: translateY(0px);
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    }
}

.brand-logo {
    max-width: 150px;
    height: 150px;
    object-fit: cover;
    border-radius: 50%;
    /* Faz a imagem ficar perfeitamente redonda */
    margin: 0 auto 1rem auto;
    display: block;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    /* Uma sombra leve para dar muito destaque */
    border: 3px solid rgba(255, 255, 255, 0.1);
    /* Efeito de borda fina elegante */
    animation: float 4s ease-in-out infinite;
    /* Animação flutuante premium e super leve */
}

/* Promoção de Hoje */
.promo-section .promo-card {
    display:flex;
    gap:1rem;
    align-items:center;
    background: var(--surface-bg);
    padding:1rem;
    border-radius:14px;
    border:1px solid var(--element-border);
    box-shadow: 0 10px 30px var(--shadow);
}

.promo-section .promo-image {
    box-shadow: 0 8px 20px rgba(0,0,0,0.4);
}

.promo-section h2 { margin:0; font-size:1.2rem; }
.promo-section .promo-content { display:flex; flex-direction:column; }
.promo-section .small-muted { margin-top:0.25rem; color:var(--text-muted); }

/* Hero CTA (grande e chamativo) */
/* Product badge */

/* Product badge */
.card { position: relative; }
.badge {
    position: absolute;
    top: 12px;
    left: 12px;
    background: var(--accent);
    color: white;
    padding: 0.35rem 0.6rem;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight:700;
    box-shadow: 0 6px 18px rgba(16,185,129,0.12);
}

/* --- Botão Voltar ao Topo --- */
.back-to-top {
    position: fixed;
    bottom: 110px; /* Acima do botão do carrinho */
    right: 30px;
    background: var(--card-bg);
    color: var(--text-main);
    border: 1px solid var(--element-border);
    width: 45px;
    height: 45px;
    border-radius: 50%;
    font-size: 1.2rem;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    z-index: 99;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all var(--transition-speed) ease;
    backdrop-filter: blur(5px);
}
.back-to-top.visible { opacity: 1; visibility: visible; transform: translateY(0); }
.back-to-top:hover { background: rgba(255, 255, 255, 0.1); border-color: var(--accent); color: var(--accent); }

/* --- Carrinho de Compras --- */
.cart-fab {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--accent);
    color: white;
    border: none;
    width: 90%;
    max-width: 450px;
    height: 55px;
    border-radius: 12px;
    font-size: 1.05rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.4);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.2rem;
    transition: transform 0.2s ease;
}

.cart-fab:hover { transform: translateX(-50%) scale(1.02); }

.cart-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: var(--overlay-bg);
    backdrop-filter: blur(5px);
    z-index: 1000;
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.cart-overlay.active { display: block; opacity: 1; }

.cart-modal {
    position: fixed;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    background: var(--primary-bg);
    border: 1px solid var(--element-border);
    border-radius: var(--card-radius);
    width: 90%;
    max-width: 450px;
    max-height: 80vh;
    z-index: 1001;
    display: none;
    flex-direction: column;
    opacity: 0;
    transition: all 0.3s ease;
    box-shadow: 0 20px 50px rgba(0,0,0,0.5);
}

.cart-modal.active {
    display: flex; opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

/* Modal de Extras Específico */
.extra-option {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.8rem;
    background: var(--surface-muted);
    border-radius: 8px;
    border: 1px solid var(--element-border);
    cursor: pointer;
}
.extra-option:hover {
    background: var(--surface-hover);
    border-color: rgba(16, 185, 129, 0.3);
}

.cart-header { padding: 1.5rem; border-bottom: 1px solid rgba(255,255,255,0.05); display: flex; justify-content: space-between; align-items: center; }
.btn-close { background: transparent; border: none; color: var(--text-muted); font-size: 2rem; cursor: pointer; line-height: 1; }
.btn-close:hover { color: var(--text-main); }

.cart-items { padding: 1.5rem; overflow-y: auto; flex: 1; display: flex; flex-direction: column; gap: 1rem; }
.cart-item { display: flex; justify-content: space-between; align-items: center; background: var(--card-bg); padding: 1rem; border-radius: 12px; border: 1px solid var(--element-border); }
.cart-item-info h4 { margin-bottom: 0.2rem; font-size: 1rem; }
.cart-item-info p { color: var(--accent); font-weight: 600; font-size: 0.9rem; }

.cart-controls { display: flex; align-items: center; gap: 0.8rem; }
.cart-controls button {
    background: var(--surface-hover); border: none; color: var(--text-main);
    width: 28px; height: 28px; border-radius: 6px; cursor: pointer; font-weight: bold; transition: 0.2s;
}
.cart-controls button:hover { background: rgba(255,255,255,0.2); }

.cart-controls .btn-remove { background: rgba(239, 68, 68, 0.15); margin-left: 0.4rem; }
.cart-controls .btn-remove:hover { background: rgba(239, 68, 68, 0.8); }

.cart-footer { padding: 1.5rem; border-top: 1px solid rgba(255,255,255,0.05); }
.cart-total { display: flex; justify-content: space-between; align-items: center; font-size: 1.2rem; font-weight: 800; margin-bottom: 1rem; }

.btn-checkout {
    width: 100%;
    background: var(--accent);
    color: white;
    border: none;
    padding: 1rem;
    border-radius: 50px;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all var(--transition-speed);
}
.btn-checkout:hover { background: var(--accent-hover); transform: scale(1.02); }

.cart-select {
    width: 100%;
    background: var(--surface-muted);
    border: 1px solid var(--element-border);
    color: var(--text-main);
    border-radius: 8px;
    padding: 0.8rem;
    font-family: inherit;
    font-size: 0.95rem;
    outline: none;
    transition: border-color var(--transition-speed);
    cursor: pointer;
}
.cart-select:focus { border-color: var(--accent); }
.cart-select option { background: var(--primary-bg); color: var(--text-main); }

.cart-observations {
    padding: 0 1.5rem 1rem 1.5rem;
}

.cart-input {
    width: 100%;
    background: var(--surface-muted);
    border: 1px solid var(--element-border);
    color: var(--text-main);
    border-radius: 8px;
    padding: 0.8rem;
    font-family: inherit;
    font-size: 0.95rem;
    resize: none;
    outline: none;
    transition: border-color var(--transition-speed);
}

.cart-input:focus { border-color: var(--accent); }

/* --- Estilos para Produtos Esgotados --- */
.card.sold-out {
    filter: grayscale(90%);
    opacity: 0.7;
}

/* Mantém o efeito de levantar, mas sem a borda colorida */
.card.sold-out:hover {
    border-color: rgba(255, 255, 255, 0.1);
}

/* Desativa o zoom na imagem para itens esgotados */
.card.sold-out:hover .card-image {
    transform: scale(1);
}

/* Estiliza o botão desabilitado e remove seus efeitos de hover */
.btn-order:disabled,
.btn-order:disabled:hover {
    background: #64748b; /* Um cinza neutro */
    color: #cbd5e1;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

/* Toast Notification */
.toast {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--accent);
    color: white;
    padding: 0.8rem 1.5rem;
    border-radius: 999px;
    font-weight: 600;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 10000;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.95rem;
}

.toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
    visibility: visible;
}

/* Spinner animado */
.spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
    margin-right: 8px;
    vertical-align: middle;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}