/* --- VARIÁVEIS --- */
:root {
    --primary: #3E2723;
    --accent: #F39C12;
    --bg: #FAFAFA;
    --white: #FFFFFF;
    --text: #333333;
    --whatsapp: #25D366;
    --shadow: 0 4px 20px rgba(0,0,0,0.08);
}

/* --- RESET --- */
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
body { font-family: 'Inter', sans-serif; background: var(--bg); color: var(--text); padding-bottom: 140px; }
img { max-width: 100%; height: auto; display: block; }
a { text-decoration: none; }
input, button { font-family: inherit; }

.container { max-width: 1100px; margin: 0 auto; padding: 0 20px; }
.section-padding { padding: 60px 0; }

/* --- HEADER & ALERT --- */
.alert-bar { background: #FFF3E0; color: #E65100; text-align: center; padding: 10px; font-size: 0.9rem; font-weight: 600; border-bottom: 1px solid #FFE0B2; }
header { background: var(--white); padding: 15px 0; position: sticky; top: 0; z-index: 100; box-shadow: 0 2px 10px rgba(0,0,0,0.05); }
.nav-flex { display: flex; justify-content: space-between; align-items: center; }

.logo { height: 80px; width: auto; } 
.logo-text { font-family: 'Fredoka', sans-serif; font-size: 28px; color: var(--primary); display: none; font-weight: bold; }

.header-actions { display: flex; align-items: center; gap: 20px; }

.cart-trigger { 
    position: relative; cursor: pointer; color: var(--primary); 
    transition: transform 0.2s; display: flex; align-items: center;
}
.cart-trigger:hover { transform: scale(1.1); }
.badge { 
    position: absolute; top: -8px; right: -8px; 
    background: var(--accent); color: white; border-radius: 50%; 
    width: 20px; height: 20px; display: flex; align-items: center; justify-content: center; 
    font-size: 0.75rem; font-weight: bold; box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.btn-header { 
    background: rgba(37, 211, 102, 0.1); color: var(--whatsapp); 
    padding: 10px 20px; border-radius: 30px; font-weight: 600; font-size: 0.9rem;
    display: flex; align-items: center; gap: 8px; transition: 0.3s;
}
.btn-header:hover { background: rgba(37, 211, 102, 0.2); }

/* --- HERO --- */
.hero { background: var(--white); padding: 40px 0 60px; overflow: hidden; border-bottom: 1px solid #EEE; }
.hero-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 50px; align-items: center; }
.hero h1 { font-family: 'Fredoka', sans-serif; font-size: 3rem; color: var(--primary); line-height: 1.1; margin-bottom: 20px; }
.hero p { font-size: 1.15rem; color: #555; margin-bottom: 30px; line-height: 1.6; }
.hero-img img { border-radius: 12px; box-shadow: 0 15px 40px rgba(0,0,0,0.12); }

.btn-cta { 
    background: var(--primary); color: white; padding: 16px 32px; border-radius: 50px; 
    font-weight: 700; font-size: 1.1rem; border: none; cursor: pointer;
    box-shadow: 0 8px 20px rgba(62, 39, 35, 0.25); transition: 0.2s;
}
.btn-cta:hover { background: #5D4037; transform: translateY(-2px); }

/* --- VANTAGENS --- */
.features { background: var(--primary); color: white; }
.features-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 30px; text-align: center; }
.feature-card h3 { color: var(--accent); margin-bottom: 10px; font-family: 'Fredoka', sans-serif; font-size: 1.3rem; }
.feature-card p { opacity: 0.9; font-size: 0.95rem; line-height: 1.5; }

/* --- DEGUSTAÇÃO --- */
.tasting-section { background: #EFEBE9; text-align: center; border-top: 1px solid #D7CCC8; border-bottom: 1px solid #D7CCC8; }
.tasting-content h3 { font-family: 'Fredoka', sans-serif; color: var(--primary); font-size: 1.8rem; margin-bottom: 15px; }
.tasting-content p { max-width: 700px; margin: 0 auto 25px; color: #5D4037; font-size: 1.05rem; line-height: 1.6; }
.btn-tasting { 
    display: inline-block; background: transparent; color: var(--primary); 
    border: 2px solid var(--primary); padding: 12px 30px; border-radius: 50px; 
    font-weight: 700; font-size: 1rem; transition: 0.3s; text-transform: uppercase; letter-spacing: 0.5px; cursor: pointer;
}
.btn-tasting:hover { background: var(--primary); color: white; transform: translateY(-2px); box-shadow: 0 5px 15px rgba(62, 39, 35, 0.15); }

/* --- CATÁLOGO --- */
.catalog-header { text-align: center; margin-bottom: 50px; }
.catalog-header h2 { font-family: 'Fredoka', sans-serif; font-size: 2.5rem; color: var(--primary); margin-bottom: 10px; }
.price-badge-lg { display: inline-block; background: #E8F5E9; color: #2E7D32; padding: 8px 25px; border-radius: 30px; font-weight: 800; font-size: 1.2rem; }

.products-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 30px; }
.product-card { 
    background: var(--white); border-radius: 16px; overflow: hidden; 
    box-shadow: var(--shadow); border: 1px solid transparent; transition: 0.3s;
    display: flex; flex-direction: column;
}
.product-card:hover { border-color: var(--accent); transform: translateY(-5px); }
.p-img { height: 240px; background: #f9f9f9; position: relative; }
.p-img img { width: 100%; height: 100%; object-fit: cover; object-position: bottom; }
.p-info { padding: 20px; flex-grow: 1; display: flex; flex-direction: column; }
.p-title { font-weight: 700; color: var(--primary); margin-bottom: 15px; font-size: 1.15rem; }
.qty-box { background: #F5F5F5; border-radius: 8px; padding: 5px; display: flex; justify-content: space-between; align-items: center; margin-top: auto; }
.btn-qty { width: 44px; height: 44px; border: none; background: white; border-radius: 6px; font-weight: bold; cursor: pointer; color: var(--primary); font-size: 1.4rem; display: flex; align-items: center; justify-content: center; box-shadow: 0 2px 4px rgba(0,0,0,0.05); transition: transform 0.1s; }
.btn-qty:active { transform: scale(0.9); background-color: #EEE; }
.btn-qty.add { background: var(--primary); color: white; }
.qty-val { font-weight: bold; width: 40px; text-align: center; border: none; background: transparent; font-size: 1.1rem; }

/* --- LOGÍSTICA & FAQ --- */
.logistics { background: #ECEFF1; }
.routes-container { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 20px; margin-top: 30px; max-width: 900px; margin-left: auto; margin-right: auto; }
.route-badge { background: white; padding: 20px; border-radius: 12px; text-align: center; box-shadow: 0 4px 10px rgba(0,0,0,0.05); border-bottom: 4px solid var(--accent); display: flex; flex-direction: column; justify-content: center; height: 100%; transition: 0.3s; }
.route-badge:hover { transform: translateY(-5px); box-shadow: 0 8px 20px rgba(0,0,0,0.1); }
.route-badge strong { display: block; color: var(--primary); margin-bottom: 5px; font-size: 0.9rem; text-transform: uppercase; }

.faq-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 30px; margin-top: 50px; }
.faq-item { background: white; padding: 25px; border-radius: 12px; box-shadow: 0 2px 10px rgba(0,0,0,0.03); }
.faq-item h4 { color: var(--primary); margin-bottom: 10px; font-size: 1.1rem; }
.faq-item p { color: #666; font-size: 0.95rem; line-height: 1.5; }

/* --- FOOTER --- */
footer { background: #2D1B18; color: white; padding: 60px 0; font-size: 0.95rem; text-align: center; }
.footer-logo { font-family: 'Fredoka', sans-serif; font-size: 1.8rem; color: var(--accent); margin-bottom: 20px; display: block;}
.footer-info p { margin-bottom: 10px; opacity: 0.8; }
.copy { margin-top: 40px; padding-top: 20px; border-top: 1px solid rgba(255,255,255,0.1); font-size: 0.85rem; opacity: 0.5; }

/* --- APP CART BAR --- */
.app-cart {
    position: fixed; bottom: 0; left: 0; width: 100%;
    background: rgba(255, 255, 255, 0.95); 
    backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 -10px 30px rgba(0,0,0,0.08); border-top: 1px solid rgba(0,0,0,0.05);
    border-radius: 16px 16px 0 0; padding: 0; z-index: 1000;
    transform: translateY(120%); transition: 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    overflow: hidden; /* Para a barra de progresso não vazar */
}
/* Animação de Pulso para a barra do carrinho */
@keyframes cartPulse {
    0% { transform: scale(1); box-shadow: 0 -10px 30px rgba(0,0,0,0.08); }
    50% { transform: scale(1.02); box-shadow: 0 -10px 40px rgba(243, 156, 18, 0.3); }
    100% { transform: scale(1); box-shadow: 0 -10px 30px rgba(0,0,0,0.08); }
}
.app-cart.pulse { animation: cartPulse 0.3s ease-in-out; }
.app-cart::before {
    content: ''; position: absolute; top: 10px; left: 50%; transform: translateX(-50%);
    width: 40px; height: 4px; background: #E0E0E0; border-radius: 10px; z-index: 2;
}
.app-cart.active { transform: translateY(0); }
.progress-track { background: #F0F0F0; height: 4px; width: 100%; position: absolute; top: 0; left: 0; z-index: 1; }
.progress-fill { background: var(--accent); height: 100%; width: 0%; transition: 0.5s; }
.cart-row { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 20px 20px 30px; }
.cart-data { cursor: pointer; transition: opacity 0.2s; }
.cart-data:active { opacity: 0.6; }
.cart-status { font-size: 0.85rem; font-weight: bold; margin-bottom: 2px; display: block; }
.cart-price { font-size: 1.4rem; font-weight: 800; color: var(--primary); line-height: 1; letter-spacing: -0.5px; }
.btn-finish { 
    flex: 1; max-width: 400px; padding: 16px 20px; border-radius: 8px; border: none; 
    font-weight: 600; font-size: 1rem; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 0; 
    transition: background 0.2s; text-transform: none; letter-spacing: 0;
}
.btn-finish:active { transform: scale(0.96); }
.btn-finish.locked { background: #E0E0E0; color: #999; cursor: not-allowed; box-shadow: none; }
.btn-finish.active { 
    background: #EA1D2C; /* Cor estilo iFood (Vermelho/Laranja forte) ou use var(--primary) */
    background: var(--primary); /* Mantendo a identidade da marca, mas sólido */
    color: white; box-shadow: none;
}

/* --- MODAL FORMULÁRIO (Novo com Grid) --- */
.modal-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(62, 39, 35, 0.7); z-index: 2000; display: none;
    align-items: center; justify-content: center; backdrop-filter: blur(4px);
}
.modal-box {
    background: white; width: 100%; max-width: 480px; padding: 30px;
    border-radius: 24px; position: relative; animation: slideIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    max-height: 85vh; overflow-y: auto; box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}
@keyframes slideIn { from {transform: translateY(50px); opacity:0} to {transform: translateY(0); opacity:1} }
@keyframes slideUpMobile { from {transform: translateY(100%);} to {transform: translateY(0);} }

.modal-header h3 { color: var(--primary); font-family: 'Fredoka', sans-serif; margin-bottom: 5px; font-size: 1.4rem; }
.modal-header p { color: #666; font-size: 0.9rem; margin-bottom: 20px; }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
.input-group { margin-bottom: 15px; }
.input-group.full { grid-column: span 2; }
.input-group label { display: block; font-size: 0.8rem; font-weight: 700; margin-bottom: 5px; color: #555; text-transform: uppercase; }
.input-field { 
    width: 100%; padding: 14px; border: 2px solid transparent; border-radius: 12px; 
    font-size: 1rem; outline: none; transition: 0.2s; background: #F3F4F6; color: #333;
}
.input-field:focus { border-color: var(--accent); background: #FFF; box-shadow: 0 4px 12px rgba(0,0,0,0.05); }
.input-field.input-error { border-color: #D32F2F; background: #FFEBEE; }
.input-error-msg { color: #D32F2F; font-size: 0.75rem; margin-top: 4px; display: none; }
.input-field:read-only { background: #F9F9F9; color: #777; border-color: #EEE; cursor: not-allowed; }

/* --- CLASSES UTILITÁRIAS (LIMPEZA DE CÓDIGO) --- */
.btn-close-modal {
    position: absolute; top: 15px; right: 15px; background: none; border: none; 
    font-size: 1.8rem; cursor: pointer; color: #999; transition: 0.2s;
}
.btn-close-modal:hover { color: var(--primary); }

.btn-modal {
    width: 100%; padding: 18px; border-radius: 8px; border: none; 
    font-weight: 600; font-size: 1rem; cursor: pointer; transition: transform 0.1s, opacity 0.2s;
    display: flex; align-items: center; justify-content: center; gap: 8px;
}
.btn-modal:active { transform: scale(0.98); }
.btn-modal.primary { background: var(--primary); color: white; } /* Cor sólida */
.btn-modal.whatsapp { background: #25D366; color: white; } /* Cor sólida */
.btn-modal.secondary { background: #EEE; color: #555; }
.btn-modal:hover { opacity: 0.95; }

/* Estilos dinâmicos do Carrinho (JS) */
.cart-item { display: flex; justify-content: space-between; align-items: center; padding: 12px 0; border-bottom: 1px solid #f0f0f0; }
.cart-item-left { display: flex; align-items: center; gap: 10px; }
.cart-item-img { width: 56px; height: 56px; object-fit: cover; border-radius: 10px; background: #f0f0f0; }
.cart-item-info { display: flex; flex-direction: column; }
.cart-item-title { font-weight: bold; font-size: 0.9rem; }
.cart-item-price { font-size: 0.8rem; color: #666; }
.cart-list-container { max-height: 300px; overflow-y: auto; margin-bottom: 20px; }

/* --- RESPONSIVO --- */
@media(max-width: 768px) {
    .hero-grid { grid-template-columns: 1fr; text-align: center; gap: 30px; }
    .hero-img { order: -1; margin-bottom: 10px; }
    .hero-img img { max-width: 80%; margin: 0 auto; }
    .p-img { height: 180px; } /* Reduz altura da imagem no mobile para ver mais produtos */
    .features-grid, .faq-grid { grid-template-columns: 1fr; }
    .factory-section { flex-direction: column; text-align: center; }
    .cart-row { flex-direction: row; align-items: center; text-align: left; gap: 15px; padding: 20px; }
    /* .cart-status, .progress-track { display: none; }  <-- REMOVIDO para mostrar a barra */
    .app-cart { border-radius: 16px 16px 0 0; }
    .btn-finish { max-width: 100%; }
    .logo { height: 60px; }
    
    /* Modal estilo Bottom Sheet no Mobile */
    .modal-box {
        position: absolute; bottom: 0; left: 0; width: 100%; max-width: 100%;
        border-radius: 24px 24px 0 0; padding: 25px;
        animation: slideUpMobile 0.3s cubic-bezier(0.16, 1, 0.3, 1);
        max-height: 90vh;
    }
    .modal-overlay { align-items: flex-end; } /* Alinha no fundo */

    /* Ajuste Header Mobile */
    .btn-header-text { display: none; }
    .btn-header { padding: 10px; border-radius: 50%; }
}