:root {
    --bg-color: #FDFBF7;
    --text-color: #1A2C42;
    --accent-color: #8B4513;
    --card-bg: #ffffff;
    --nav-bg: rgba(253, 251, 247, 0.98);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: 'Lato', sans-serif;
    padding-bottom: 60px;
    background-image: url("data:image/svg+xml,%3Csvg width='6' height='6' viewBox='0 0 6 6' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='%231a2c42' fill-opacity='0.03' fill-rule='evenodd'%3E%3Cpath d='M5 0h1L0 6V5zM6 5v1H5z'/%3E%3C/g%3E%3C/svg%3E");
    overflow-x: hidden;
}

/* --- CAPA (HERO) --- */
.hero {
    position: relative;
    width: 100%;
    height: 55vh;
    /* Mobile: 55% da altura */
    min-height: 380px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    /* Centraliza verticalmente */
    text-align: center;
    /* Mobile: conteúdo embaixo */
    padding-bottom: 30px;
    overflow: hidden;
}

.hero-video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 0;
}

.hero::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 70%;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8) 0%, transparent 100%);
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
    padding: 0 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.hero-logo {
    max-width: 80%;
    width: 280px;
    height: auto;
    margin-bottom: 15px;
    filter: drop-shadow(0 3px 5px rgba(0, 0, 0, 0.5));
    transition: all 0.3s ease;
}

.welcome-msg p {
    font-family: 'Playfair Display', serif;
    font-size: 1.1rem;
    color: #fff;
    font-style: italic;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.7);
    margin-bottom: 15px;
}

.info-badge {
    display: inline-block;
    background: rgba(26, 44, 66, 0.9);
    color: #d4af37;
    padding: 8px 20px;
    border-radius: 50px;
    font-size: 0.8rem;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    margin-top: 0;
    margin-bottom: 0;
    z-index: 10;
    border: 1px solid #d4af37;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

/* --- NAVEGAÇÃO --- */
.nav-sticky-wrapper {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--nav-bg);
    /* Garante o fundo */
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: 0 4px 20px -10px rgba(0, 0, 0, 0.1);
    padding: 10px 0;
    /* Necessário para posicionar a sombra */
    position: relative;
    position: sticky;
    /* Mantém o sticky */
}

/* O "Fade" ou Sombra na direita */
.nav-sticky-wrapper::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 40px;
    /* Largura do degradê */

    /* Cria um degradê do transparente para a cor do fundo do menu */
    background: linear-gradient(to right, rgba(253, 251, 247, 0) 0%, var(--nav-bg) 90%);

    /* Permite clicar "através" da sombra (importante!) */
    pointer-events: none;
    z-index: 101;
}

/* Opcional: Uma seta pulsante sutil que some ao rolar (requer JS complexo) 
   OU apenas uma animação inicial para dar a dica */
@keyframes hint-scroll {
    0% {
        transform: translateX(0);
    }

    50% {
        transform: translateX(-20px);
    }

    100% {
        transform: translateX(0);
    }
}

/* Aplica uma animação leve no carregamento para mostrar que mexe */
.nav-container {
    display: flex;
    overflow-x: auto;
    padding: 5px 15px;
    gap: 12px;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;

    /* Animação rápida que balança o menu 1 vez ao carregar */
    animation: hint-scroll 1s ease-in-out 1.5s 1;
}

.nav-container::-webkit-scrollbar {
    display: none;
}

.cat-btn {
    white-space: nowrap;
    background: transparent;
    border: 2px solid var(--text-color);
    color: var(--text-color);
    padding: 10px 20px;
    border-radius: 30px;
    font-family: 'Playfair Display', serif;
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.cat-btn.active {
    background: var(--text-color);
    color: #fff;
    box-shadow: 0 4px 15px rgba(26, 44, 66, 0.3);
}

/* --- MENU ITENS --- */
.menu-container {
    max-width: 1000px;
    /* Aumentei a largura máxima para desktop */
    margin: 0 auto;
    padding: 30px 15px;
}

.category-section {
    margin-bottom: 50px;
    scroll-margin-top: 100px;
}

.category-title {
    font-family: 'Playfair Display', serif;
    font-size: 1.8rem;
    text-align: center;
    margin-bottom: 30px;
    color: var(--accent-color);
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    grid-column: 1 / -1;
    /* Garante que o título ocupe a linha inteira no Grid */
}

.category-title::before,
.category-title::after {
    content: "";
    height: 2px;
    background: var(--accent-color);
    flex-grow: 1;
    margin: 0 20px;
    opacity: 0.2;
    border-radius: 2px;
}

.menu-item {
    background: var(--card-bg);
    padding: 22px;
    margin-bottom: 18px;
    border-radius: 12px;
    box-shadow: 0 5px 15px -5px rgba(0, 0, 0, 0.07);
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(0, 0, 0, 0.03);
    height: 100%;
    /* Para alinhar alturas no grid */
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.menu-item::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 5px;
    background: var(--accent-color);
    opacity: 0.7;
    border-radius: 12px 0 0 12px;
}

.item-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 10px;
}

.item-name {
    font-weight: 800;
    font-size: 1.1rem;
    color: var(--text-color);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    width: 70%;
    line-height: 1.2;
}

.item-price {
    font-weight: 800;
    color: var(--text-color);
    font-size: 1.1rem;
    text-align: right;
    white-space: nowrap;
}

.item-desc {
    font-size: 0.95rem;
    color: #555;
    line-height: 1.5;
    font-style: italic;
    font-family: 'Playfair Display', serif;
}

/* --- FAB WHATSAPP --- */
.fab {
    position: fixed;
    bottom: 25px;
    right: 25px;
    background: linear-gradient(45deg, #25D366, #128C7E);
    color: white;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 8px 20px rgba(37, 211, 102, 0.4);
    text-decoration: none;
    z-index: 1000;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.fab:hover {
    transform: scale(1.1) rotate(10deg);
}

.fab svg {
    width: 32px;
    height: 32px;
}

/* Rodapé */
footer {
    text-align: center;
    padding: 40px 20px 80px;
    font-size: 0.9rem;
    color: var(--text-color);
    opacity: 0.7;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    margin-top: 40px;
    background: rgba(0, 0, 0, 0.02);
}

/* Cantos decorativos */

@media (hover: hover) and (pointer: fine) {

    /* 1. Efeito nos Cartões do Menu (Pizzas/Vinhos) */
    .menu-item {
        transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
        cursor: default;
        /* Indica que é apenas leitura */
    }

    .menu-item:hover {
        /* O cartão sobe levemente, como se flutuasse */
        transform: translateY(-5px);

        /* A sombra fica mais difusa embaixo, criando profundidade */
        box-shadow: 0 15px 30px -10px rgba(0, 0, 0, 0.1);

        /* A borda fica sutilmente da cor da marca */
        border-color: rgba(139, 69, 19, 0.3);
    }

    /* Aumenta a barrinha lateral colorida ao passar o mouse */
    .menu-item:hover::before {
        width: 6px;
        opacity: 1;
    }

    /* 2. Efeito nos Botões de Navegação */
    .cat-btn {
        transition: all 0.2s ease;
    }

    .cat-btn:hover {
        background-color: rgba(139, 69, 19, 0.08);
        /* Fundo marrom bem clarinho */
        border-color: var(--accent-color);
        transform: translateY(-2px);
        /* Pequeno pulo */
        color: var(--accent-color);
    }

    /* Mantém o botão ativo sólido, sem mudar muito */
    .cat-btn.active:hover {
        background-color: var(--text-color);
        color: #fff;
        transform: none;
        border-color: var(--text-color);
    }

    /* 3. Efeito na Logo da Capa */
    .hero-logo {
        transition: transform 0.5s ease;
    }

    .hero-logo:hover {
        transform: scale(1.02);
        /* Zoom muito sutil na logo */
    }
}

/* --- REGRAS ESPECÍFICAS PARA DESKTOP/TABLET (Largura > 768px) --- */
@media (min-width: 768px) and (max-width: 1199px) {
    .hero {
        /* No iPad, a capa não pode ser muito alta senão esconde o menu */
        height: 50vh;
        min-height: 400px;
    }

    .hero-logo {
        width: 300px;
        /* Tamanho médio */
        margin-bottom: 20px;
    }

    .welcome-msg p {
        font-size: 1.2rem;
        padding: 0 40px;
        /* Margem lateral para não bater na borda */
    }

    /* Menu em 2 Colunas com espaçamento otimizado para toque */
    .menu-container {
        max-width: 90%;
        margin: 0 auto;
        padding: 30px 0;
    }

    .category-section {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        /* 2 colunas */
        gap: 20px;
        /* Espaço entre os cartões */
        align-items: start;
    }

    /* O título da categoria ocupa a largura total */
    .category-title {
        grid-column: 1 / -1;
        font-size: 2rem;
        margin-bottom: 25px;
        margin-top: 10px;
    }

    .nav-container {
        justify-content: flex-start;
        /* Alinha à esquerda para permitir rolagem */
        overflow-x: auto;
        /* Garante que a barra de rolagem funcione */
        padding-bottom: 15px;
        -webkit-overflow-scrolling: touch;
        /* Rolagem suave no iPad */
    }

    .cat-btn {
        font-size: 1rem;
        padding: 10px 20px;
    }
}

/* 2. DESKTOP, NOTEBOOKS E FULL HD (De 1200px até 2500px) */
/* Foco: Mouse e aproveitamento de largura */
@media (min-width: 1200px) {

    html {
        font-size: 16px;
        /* Tamanho padrão */
    }

    .hero {
        height: 80vh;
    }

    .hero-logo {
        width: 400px;
    }

    .menu-container {
        max-width: 1200px;
        width: 100%;
        margin: 0 auto;
        padding: 50px 40px;
    }

    /* 3 Colunas para telas largas ficarem elegantes */
    .category-section {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 30px;
        align-items: start;
    }

    .category-title {
        grid-column: 1 / -1;
        font-size: 2.2rem;
        margin-bottom: 40px;
    }

    .nav-container {
        justify-content: flex-start;
        overflow-x: auto;
        padding: 10px 40px;
        gap: 15px;
    }
}

@media (min-width: 1550px) {
    .nav-container {
        justify-content: center;
        /* Volta a centralizar */
        padding-left: 0;
        /* Remove o padding lateral de segurança */
        padding-right: 0;
    }
}

/* 3. TELAS ULTRA WIDE E 4K REAIS (Acima de 2501px) */
/* Foco: Não deixar tudo minúsculo na TV */
@media (min-width: 2501px) {

    html {
        font-size: 24px;
        /* Aumenta tudo proporcionalmente */
    }

    .menu-container {
        max-width: 2800px;
        width: 80%;
    }

    .category-section {
        grid-template-columns: repeat(3, 1fr);
        gap: 50px;
    }

    .hero-logo {
        width: 600px;
    }

    /* Botão WhatsApp Gigante */
    .fab {
        width: 100px;
        height: 100px;
        bottom: 60px;
        right: 60px;
    }

    .fab svg {
        width: 50px;
        height: 50px;
    }
}

/* --- ESTILOS DO CARRINHO E DELIVERY --- */

/* Botão de Adicionar no Item */


/* Barra Fixa Inferior (Footer do Carrinho) */
.cart-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background-color: #1A2C42;
    color: white;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 999;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.2);
    transform: translateY(100%);
    /* Escondido inicialmente */
    transition: transform 0.3s ease;
}

.cart-footer.show {
    transform: translateY(0);
}

/* Aparece quando tem item */

.cart-footer button {
    background-color: #25D366;
    border: none;
    padding: 8px 20px;
    border-radius: 20px;
    color: white;
    font-weight: bold;
    cursor: pointer;
}

/* Modal (Fundo Escuro) */
.cart-modal-container {
    display: none;
    /* Escondido por padrão */
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    z-index: 2000;
    justify-content: center;
    align-items: flex-end;
    /* Mobile: sobe de baixo */
}

/* No Desktop, centraliza */
@media (min-width: 768px) {
    .cart-modal-container {
        align-items: center;
    }

    .cart-modal {
        width: 500px !important;
        border-radius: 10px !important;
    }
}

/* Janela do Carrinho */
.cart-modal {
    background-color: #fff;
    width: 100%;

    /* Limita a altura para não sair da tela */
    max-height: 90vh;

    border-radius: 15px 15px 0 0;
    padding: 20px;

    /* FLEXBOX: Organiza os blocos verticalmente */
    display: flex;
    flex-direction: column;

    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        transform: translateY(100%);
    }

    to {
        transform: translateY(0);
    }
}

.cart-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
}

.cart-header button {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
}

.cart-items {
    /* 1. FLEX: Ocupa todo o espaço que sobrar */
    flex: 1;

    /* 2. SEGURANÇA: Garante que NUNCA fique menor que 120px */
    /* Isso impede que a lista suma ou mostre só 1 item */
    min-height: 120px;

    /* 3. SCROLL: Se passar do tamanho, rola só aqui dentro */
    overflow-y: auto;

    margin-bottom: 15px;
    border-bottom: 1px solid #eee;
    padding-right: 5px;

    /* Rolagem suave iOS */
    -webkit-overflow-scrolling: touch;
}

/* Item dentro do carrinho */
.cart-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #eee;
}

.cart-item-info h3 {
    font-size: 0.9rem;
    margin-bottom: 5px;
}

.cart-item-actions button {
    width: 25px;
    height: 25px;
    border: 1px solid #ccc;
    background: none;
    border-radius: 50%;
}

.checkout-form {
    overflow-y: auto;
    flex-shrink: 1;
    /* Permite encolher se necessário */
    padding-right: 5px;
}

.checkout-form label {
    display: block;
    margin-top: 10px;
    font-size: 0.9rem;
    font-weight: bold;
}

.checkout-form input,
.checkout-form textarea,
.checkout-form select {
    width: 100%;
    padding: 10px;
    margin-top: 5px;
    border: 1px solid #ccc;
    border-radius: 5px;
}

.checkout-btn {
    width: 100%;
    background-color: #25D366;
    color: white;
    padding: 15px;
    border: none;
    border-radius: 8px;
    font-weight: bold;
    font-size: 1.1rem;
    margin-top: 20px;
    cursor: pointer;
}

.secondary-btn {
    width: 100%;
    background-color: transparent;
    border: 2px solid #eee;
    /* Borda sutil */
    color: #666;
    padding: 12px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 1rem;
    margin-top: 10px;
    /* Espaço do botão de cima */
    cursor: pointer;
    transition: all 0.2s ease;
}

.secondary-btn:hover {
    background-color: #f5f5f5;
    color: #333;
    border-color: #ccc;
}

.item-footer {
    display: flex;
    justify-content: space-between;
    /* Preço na esquerda, Botão na direita */
    align-items: center;
    margin-top: auto;
    padding-top: 15px;
    border-top: 1px solid #f9f9f9;
}

.item-price {
    font-family: 'Playfair Display', serif;
    font-size: 1.3rem;
    /* Um pouco maior para leitura fácil */
    font-weight: bold;
    color: #333;
}

/* O NOVO BOTÃO "ADICIONAR" */
.btn-outline {
    background-color: transparent;
    border: 1px solid var(--accent-color);
    /* Borda fina da cor da marca */
    color: var(--accent-color);
    padding: 6px 16px;
    /* Tamanho compacto */
    border-radius: 6px;
    /* Cantos levemente arredondados (não redondos) */
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    /* LETRAS MAIÚSCULAS para elegância */
    letter-spacing: 0.5px;
    /* Espaçamento entre letras */
    cursor: pointer;
    transition: all 0.3s ease;
}

/* Efeito ao passar o mouse: Preenche o botão */
.btn-outline:hover {
    background-color: var(--accent-color);
    color: white;
    transform: translateY(-2px);
    /* Sobe levemente */
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.btn-outline:active {
    transform: scale(0.98);
}

/* --- VALIDAÇÃO DE FORMULÁRIO ELEGANTE --- */

/* Classe que será adicionada via JS quando faltar dados */
.input-error {
    border: 1px solid #ff4444 !important;
    /* Borda vermelha */
    background-color: #fff8f8 !important;
    /* Fundo levemente avermelhado */
    transition: all 0.3s ease;
}

/* Animação de "Tremer" para chamar atenção (Shake) */
@keyframes shake {
    0% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(-5px);
    }

    50% {
        transform: translateX(5px);
    }

    75% {
        transform: translateX(-5px);
    }

    100% {
        transform: translateX(0);
    }
}

.input-error {
    animation: shake 0.3s ease-in-out;
}

/* Container da mensagem de erro acima do botão */
.error-feedback {
    color: #d32f2f;
    font-size: 0.9rem;
    text-align: center;
    margin-top: 10px;
    margin-bottom: 5px;
    font-weight: 600;
    min-height: 20px;
    /* Reserva espaço para não pular layout */
    display: none;
    /* Escondido por padrão */
}