/* =================================================================
   1. VARIÁVEIS & RESET (DESIGN SYSTEM)
   ================================================================= */
:root {
    /* Paleta de Cores de Alta Conversão */
    --primary: #ea1d2c;       /* Vermelho iFood (Ação Principal/Marca) */
    --primary-dark: #b6000e;  /* Vermelho Escuro (Interação) */
    --secondary: #fff;        /* Branco Puro */
    --success: #00a03e;       /* Verde (Preço/Confirmação) */
    --warning: #fcb813;       /* Amarelo (Estrelas/Atenção) */
    --text-dark: #1a1a1a;     /* Texto Principal (Leitura fácil) */
    --text-gray: #717171;     /* Texto Secundário */
    --bg-light: #f2f2f2;      /* Fundo da Página */
    --border: #f2f2f2;        /* Bordas Sutis */
    
    /* Espaçamento e Formas */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 24px;
    --shadow-soft: 0 2px 8px rgba(0,0,0,0.08);
    --shadow-float: 0 8px 24px rgba(0,0,0,0.15);
    
    /* Header/Nav Heights */
    --header-height: 160px;
    --nav-height: 60px;
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: #fff;
    color: var(--text-dark);
    padding-top: 40px; /* Espaço Ticker */
    padding-bottom: 80px; /* Espaço Menu Inferior */
    -webkit-font-smoothing: antialiased;
}

/* Utilitário para travar rolagem quando modal abre */
body.modal-open { overflow: hidden; height: 100vh; position: fixed; width: 100%; }

button { cursor: pointer; border: none; background: none; font-family: inherit; }
a { text-decoration: none; color: inherit; }
ul { list-style: none; }

/* =================================================================
   2. HEADER E NAVEGAÇÃO
   ================================================================= */

/* Fita Promocional (Ticker) */
.promo-ticker {
    background: #1a1a1a; color: #fff; height: 40px; 
    position: fixed; top: 0; width: 100%; z-index: 900;
    display: flex; align-items: center; overflow: hidden;
}
.ticker-content {
    display: flex; animation: scrollText 25s linear infinite; white-space: nowrap;
}
.ticker-item { padding: 0 30px; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; }
@keyframes scrollText { 0% { transform: translateX(0); } 100% { transform: translateX(-100%); } }

/* Header Principal */
.header { position: relative; background: #fff; padding-bottom: 10px; }
.header-banner { height: 140px; width: 100%; overflow: hidden; }
.header-banner img { width: 100%; height: 100%; object-fit: cover; }

.header-info { text-align: center; margin-top: -40px; padding: 0 16px; position: relative; z-index: 2; }
.logo {
    width: 80px; height: 80px; margin: 0 auto; 
    border-radius: 50%; background: #fff; padding: 3px;
    box-shadow: var(--shadow-soft);
}
.logo-icon img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }

.header-info h1 { font-size: 20px; font-weight: 700; margin: 8px 0 4px; }
.infos-delivery { font-size: 13px; color: var(--text-gray); display: flex; flex-direction: column; align-items: center; gap: 4px; }
.aberto { 
    color: #059669; background: #d1fae5; padding: 4px 10px; 
    border-radius: 20px; font-size: 11px; font-weight: 700; 
    display: flex; align-items: center; gap: 6px; margin-top: 4px;
}
.btn-pisca { width: 8px; height: 8px; background: #059669; border-radius: 50%; animation: pulse 1.5s infinite; }
@keyframes pulse { 0% { transform: scale(1); opacity: 1; } 50% { transform: scale(1.2); opacity: 0.7; } 100% { transform: scale(1); opacity: 1; } }

/* Barra de Categorias (Sticky) */
.categories-bar {
    position: sticky; top: 40px; background: rgba(255,255,255,0.95);
    backdrop-filter: blur(5px); z-index: 800; padding: 12px 0;
    border-bottom: 1px solid var(--border);
}
.categories-scroll {
    display: flex; gap: 10px; padding: 0 16px; 
    overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch;
}
.category-item {
    padding: 8px 16px; border-radius: 20px; 
    border: 1px solid #e5e5e5; background: #fff; 
    color: var(--text-gray); font-size: 13px; font-weight: 600; 
    white-space: nowrap; transition: all 0.2s;
}
.category-item.active { background: var(--primary); color: #fff; border-color: var(--primary); }

/* Busca */
.search-container { padding: 10px 16px; background: #fff; }
.search-input {
    width: 100%; padding: 12px 16px 12px 40px; 
    border: 1px solid #e5e5e5; border-radius: var(--radius-sm);
    background: #f7f7f7 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%23999' viewBox='0 0 16 16'%3E%3Cpath d='M11.742 10.344a6.5 6.5 0 1 0-1.397 1.398h-.001c.03.04.062.078.098.115l3.85 3.85a1 1 0 0 0 1.415-1.414l-3.85-3.85a1.007 1.007 0 0 0-.115-.1zM12 6.5a5.5 5.5 0 1 1-11 0 5.5 5.5 0 0 1 11 0z'/%3E%3C/svg%3E") no-repeat 12px center;
    font-size: 15px; outline: none;
}
.search-input:focus { background-color: #fff; border-color: #ccc; }

/* =================================================================
   3. PRODUTOS (LISTA E GRID)
   ================================================================= */
.container { padding: 0 16px; }
.section { padding: 24px 0; border-bottom: 1px solid var(--border); }
.section-title { font-size: 18px; font-weight: 700; margin-bottom: 16px; color: var(--text-dark); }

/* Lista Horizontal (Destaques) */
.products-scroll {
    display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px;
}

/* Card Vertical (Destaques) */
.product-card {
    background: #fff; border: 1px solid var(--border);
    border-radius: var(--radius-md); overflow: hidden;
    position: relative; transition: transform 0.2s;
    display: flex; flex-direction: column;
}
.product-card:active { transform: scale(0.98); }
.product-card img { width: 100%; height: 120px; object-fit: cover; }
.product-card .product-info { padding: 10px; display: flex; flex-direction: column; flex: 1; }

/* Card Horizontal (Lista Geral) */
.products-list { display: flex; flex-direction: column; gap: 16px; }
.product-card-list {
    display: flex; gap: 12px; background: #fff;
    border: 1px solid var(--border); border-radius: var(--radius-md);
    padding: 12px; position: relative; overflow: hidden;
    cursor: pointer; transition: background 0.2s;
}
.product-card-list:active { background: #fafafa; }
.product-card-list img {
    width: 100px; height: 100px; object-fit: cover; 
    border-radius: var(--radius-sm); flex-shrink: 0;
}
.product-card-list .product-info { flex: 1; display: flex; flex-direction: column; justify-content: space-between; }

/* Tipografia dos Produtos */
.product-info h3 { font-size: 15px; font-weight: 600; margin-bottom: 4px; line-height: 1.3; color: var(--text-dark); margin-top: 18px; /* Espaço para badge */ }
.product-info p { font-size: 12px; color: var(--text-gray); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin-bottom: 8px; }

/* Badges */
.badge-laranja, .badge-vermelho, .badge-azul, .badge-preto {
    position: absolute; top: 0; left: 0;
    padding: 4px 8px; font-size: 10px; font-weight: 800; color: #fff;
    border-bottom-right-radius: 10px; z-index: 2; text-transform: uppercase;
}
.badge-laranja { background: #f59e0b; }
.badge-vermelho { background: var(--primary); }
.badge-azul { background: #3b82f6; }
.badge-preto { background: #1a1a1a; }

/* Preços e Urgência */
.micro-urgencia {
    font-size: 10px; color: #c2410c; background: #fff7ed;
    padding: 2px 6px; border-radius: 4px; width: fit-content;
    font-weight: 600; margin-bottom: 6px;
}
.product-price { display: flex; align-items: center; gap: 8px; margin-top: auto; }
.original-price { font-size: 12px; color: #999; text-decoration: line-through; }
.discount-price { font-size: 15px; font-weight: 700; color: var(--success); }
.discount-badge { font-size: 10px; background: var(--success); color: #fff; padding: 2px 4px; border-radius: 4px; font-weight: 700; }

/* =================================================================
   4. MODAIS "APP SHEET" (CORE DA EXPERIÊNCIA)
   ================================================================= */
.modal { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; z-index: 2000; isolation: isolate; }
.modal.active { display: block; }
.modal-overlay {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.6); backdrop-filter: blur(3px); z-index: 1;
    animation: fadeIn 0.3s forwards;
}

.app-modal-sheet {
    position: absolute; bottom: 0; left: 0; width: 100%;
    max-height: 92vh; height: auto;
    background: #fff; border-radius: 20px 20px 0 0;
    display: flex; flex-direction: column;
    box-shadow: 0 -10px 40px rgba(0,0,0,0.2); z-index: 2;
    transform: translateY(100%);
    animation: slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
.app-modal-sheet.full-height { height: 100%; max-height: 100%; border-radius: 0; }

/* Header/Hero do Modal */
.btn-close-float {
    position: absolute; top: 16px; left: 16px;
    width: 36px; height: 36px; border-radius: 50%;
    background: #fff; border: 1px solid #eee;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1); z-index: 10;
    color: var(--text-dark); font-size: 16px;
}

.app-scroll-content { overflow-y: auto; flex: 1; -webkit-overflow-scrolling: touch; background: #fff; }
.app-hero-container { position: relative; width: 100%; height: 240px; }
.app-hero-image { width: 100%; height: 100%; object-fit: cover; }
.app-hero-gradient { position: absolute; bottom: 0; width: 100%; height: 80px; background: linear-gradient(to top, rgba(255,255,255,1), transparent); }

/* Conteúdo do Modal de Produto */
.app-body { padding: 0 0 20px; }
.app-header-content { padding: 10px 20px 20px; }
.app-title { font-size: 22px; font-weight: 700; line-height: 1.2; margin-bottom: 8px; }
.app-desc { font-size: 15px; color: var(--text-gray); line-height: 1.5; margin-bottom: 12px; }
.app-price-display { font-size: 24px; font-weight: 700; color: var(--success); display: flex; align-items: center; gap: 10px; }
.app-old-price { font-size: 16px; color: #999; text-decoration: line-through; font-weight: 400; }

.app-divider { height: 8px; background: #f5f5f5; border-top: 1px solid #eee; border-bottom: 1px solid #eee; }
.app-section-title { padding: 16px 20px; font-size: 14px; font-weight: 700; color: var(--text-dark); background: #fff; border-bottom: 1px solid #eee; text-transform: uppercase; letter-spacing: 0.5px; }

/* Lista de Adicionais */
.app-option-row {
    display: flex; justify-content: space-between; align-items: center;
    padding: 16px 20px; border-bottom: 1px solid #eee;
    cursor: pointer; transition: background 0.2s;
}
.app-option-row:active { background: #f9f9f9; }
.app-option-info h4 { font-size: 15px; font-weight: 500; margin-bottom: 2px; }
.app-option-price { font-size: 14px; color: var(--text-gray); }

.btn-toggle-option {
    width: 24px; height: 24px; border: 2px solid #ccc; border-radius: 50%;
    display: flex; align-items: center; justify-content: center; color: transparent;
    transition: all 0.2s;
}
.btn-toggle-option.selected {
    border-color: var(--success); background: var(--success); color: #fff; font-size: 14px;
}
.app-qty-btn { font-size: 14px; color: var(--primary); }

/* Sub-Modal Header (Voltar) */
.sub-modal-header {
    padding: 16px 20px; border-bottom: 1px solid #eee;
    font-weight: 600; color: var(--primary); display: flex; align-items: center; gap: 8px;
    cursor: pointer; background: #f9f9f9;
}

/* Área de Observação */
.app-obs-container { padding: 20px; }
.form-label { display: block; font-weight: 600; margin-bottom: 8px; color: var(--text-dark); }
.app-textarea {
    width: 100%; border: 1px solid #ddd; border-radius: var(--radius-sm);
    padding: 12px; font-size: 15px; min-height: 80px; font-family: inherit;
    background: #fcfcfc;
}
.app-textarea:focus { outline: none; border-color: var(--text-gray); background: #fff; }

/* Sticky Footer (Produto) */
.app-sticky-footer {
    padding: 16px 20px; background: #fff; border-top: 1px solid #eee;
    display: flex; gap: 16px; align-items: center;
    padding-bottom: max(16px, env(safe-area-inset-bottom));
}
.app-qty-selector {
    display: flex; align-items: center; border: 1px solid #ddd;
    border-radius: var(--radius-sm); height: 48px; width: 110px;
}
.app-qty-btn { flex: 1; height: 100%; display: flex; align-items: center; justify-content: center; font-size: 18px; color: var(--primary); }
.app-qty-display { font-weight: 600; font-size: 16px; width: 30px; text-align: center; }

.btn-cta-large {
    flex: 1; height: 48px; background: var(--primary);
    color: #fff; border-radius: var(--radius-sm);
    font-size: 16px; font-weight: 600;
    display: flex; justify-content: space-between; align-items: center;
    padding: 0 20px; box-shadow: var(--shadow-soft);
}
.btn-cta-large:active { transform: scale(0.98); background: var(--primary-dark); }
.btn-cta-large.full-width { justify-content: center; }

/* =================================================================
   5. SACOLA E CHECKOUT
   ================================================================= */
.modal-header-simple {
    padding: 16px 20px; border-bottom: 1px solid #eee;
    display: flex; justify-content: space-between; align-items: center;
}
.modal-header-simple h3 { font-size: 18px; font-weight: 700; }
.modal-header-simple button { font-size: 20px; color: var(--text-gray); }

/* Lista da Sacola */
.sacola-lista { padding: 20px; }
.sacola-item {
    background: #fff; padding: 16px; border-radius: var(--radius-sm);
    margin-bottom: 12px; box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    display: flex; gap: 12px; align-items: flex-start; position: relative;
}
.sacola-qtd { font-weight: 700; color: var(--primary); margin-top: 2px; }
.sacola-info { flex: 1; }
.sacola-info h4 { font-size: 15px; margin-bottom: 4px; }
.sacola-extras { font-size: 13px; color: var(--text-gray); margin-bottom: 4px; }
.sacola-price { font-weight: 700; font-size: 15px; margin-top: 6px; }
.resumo-valores { display: flex; justify-content: space-between; font-size: 18px; margin-bottom: 12px; color: var(--text-dark); }

/* Checkout Steps */
.checkout-header { padding: 16px; text-align: center; border-bottom: 1px solid #eee; position: relative; }
.checkout-header button { position: absolute; left: 16px; top: 16px; font-size: 18px; color: var(--text-dark); }
.checkout-progress { display: flex; height: 4px; width: 100%; background: #eee; }
.step-bar { flex: 1; background: #eee; transition: background 0.3s ease; }
.step-bar.active { background: var(--success); }

.checkout-body { padding: 24px 20px; }
.checkout-step { display: none; animation: fadeIn 0.3s; }
.checkout-step.active { display: block; }

.step-title { font-size: 18px; font-weight: 700; margin-bottom: 16px; color: var(--text-dark); }
.app-input {
    width: 100%; padding: 14px; border: 1px solid #ddd;
    border-radius: var(--radius-sm); font-size: 16px;
    background: #fbfbfb; margin-bottom: 12px;
}
.app-input:focus { border-color: var(--text-dark); background: #fff; outline: none; }

/* Opções de Pagamento */
.payment-options { display: flex; flex-direction: column; gap: 12px; }
.payment-option {
    border: 1px solid #ddd; border-radius: var(--radius-sm);
    padding: 16px; display: flex; align-items: center; gap: 16px;
    cursor: pointer; transition: all 0.2s;
}
.payment-option.selected { border-color: var(--success); background: #f0fdf4; }
.payment-option i { font-size: 24px; color: var(--text-gray); }
.payment-option.selected i { color: var(--success); }
.pay-info strong { display: block; font-size: 15px; margin-bottom: 2px; }
.pay-info span { font-size: 12px; color: var(--text-gray); }

.radio-check {
    width: 20px; height: 20px; border: 2px solid #ccc;
    border-radius: 50%; margin-left: auto; position: relative;
}
.radio-check.active { border-color: var(--success); background: var(--success); }
.radio-check.active::after {
    content: ''; position: absolute; top: 5px; left: 5px;
    width: 6px; height: 6px; background: #fff; border-radius: 50%;
}

.checkout-summary-box { background: #f9f9f9; padding: 16px; border-radius: var(--radius-sm); border: 1px dashed #ccc; margin-bottom: 24px; font-size: 14px; }

/* Tela Final (PIX) */
.success-animation { font-size: 60px; color: var(--success); margin: 20px 0; }
.timer-box {
    background: #fef2f2; color: #b91c1c; padding: 12px 20px;
    border-radius: var(--radius-sm); display: inline-block;
    margin: 20px 0; font-size: 18px; border: 1px solid #fecaca;
}
.pix-area { background: #f3f4f6; padding: 20px; border-radius: var(--radius-md); text-align: left; }
.pix-label { font-size: 14px; font-weight: 600; margin-bottom: 8px; }
.pix-input-box { display: flex; gap: 10px; }
.pix-input-box input {
    flex: 1; padding: 10px; border: 1px solid #ddd; border-radius: 6px;
    background: #fff; font-family: monospace; color: #555;
}
.pix-input-box button {
    background: var(--success); color: #fff; border-radius: 6px;
    padding: 0 16px; font-weight: 600; font-size: 14px;
}

/* =================================================================
   6. MENU FLUTUANTE E BOTÃO SACOLA
   ================================================================= */
.bottom-nav {
    position: fixed; bottom: 0; left: 0; width: 100%;
    background: #fff; border-top: 1px solid #eee;
    height: 60px; display: flex; justify-content: space-around;
    align-items: center; z-index: 1000;
    padding-bottom: env(safe-area-inset-bottom);
}
.nav-item {
    display: flex; flex-direction: column; align-items: center;
    font-size: 10px; color: #999; gap: 4px; width: 100%;
}
.nav-item.active { color: var(--primary); }
.nav-item i { font-size: 20px; }

/* Botão Flutuante (Acima do Menu) */
.bottom-bar {
    position: fixed; bottom: 80px; left: 50%; transform: translateX(-50%);
    width: 92%; max-width: 500px; z-index: 990; cursor: pointer;
    animation: slideUpFloat 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.bag-button {
    background: var(--primary); color: #fff; padding: 14px 20px;
    border-radius: var(--radius-sm); display: flex; 
    justify-content: space-between; align-items: center;
    font-weight: 600; box-shadow: 0 8px 20px rgba(234, 29, 44, 0.3);
}
.bag-icon-wrapper { display: flex; align-items: center; gap: 10px; }
.bag-count { 
    background: rgba(0,0,0,0.2); width: 24px; height: 24px; 
    border-radius: 50%; display: flex; align-items: center; 
    justify-content: center; font-size: 12px;
}

/* =================================================================
   7. ANIMAÇÕES GERAIS
   ================================================================= */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { transform: translateY(100%); } to { transform: translateY(0); } }
@keyframes slideUpFloat { from { transform: translate(-50%, 100px); } to { transform: translate(-50%, 0); } }

/* =================================================================
   8. RESPONSIVIDADE (DESKTOP)
   ================================================================= */
@media (min-width: 768px) {
    .container { max-width: 1024px; margin: 0 auto; }
    .products-scroll { grid-template-columns: repeat(3, 1fr); }
    .products-list { display: grid; grid-template-columns: repeat(2, 1fr); }
    
    /* Modal Centralizado no Desktop */
    .app-modal-sheet {
        width: 450px; left: 50%; bottom: auto; top: 50%;
        transform: translate(-50%, -50%) !important;
        border-radius: 16px; max-height: 85vh;
        animation: fadeIn 0.2s forwards;
    }
    .app-modal-sheet.full-height { top: 50%; height: 85vh; border-radius: 16px; }
    
    .btn-close-float { top: 15px; left: auto; right: 15px; }
    .bottom-bar { bottom: 20px; width: 400px; right: 20px; left: auto; transform: none; }
    .bottom-nav { display: none; }
    body { padding-bottom: 20px; }
}

/* ... (MANTENHA TODO O CSS ANTERIOR, E ADICIONE/SUBSTITUA ISSO ABAIXO) ... */

/* Ajustes Específicos para o Checkout de Endereço */
.address-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 10px;
}

.input-with-action {
    position: relative;
}
.input-with-action input {
    padding-right: 40px; /* Espaço para icone se quiser */
}

/* Pagamento Bloqueado em PIX */
.payment-method-locked {
    border: 1px solid var(--success);
    background: #f0fdf4;
    padding: 16px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 15px;
    margin-top: 10px;
}
.payment-method-locked i.fa-pix {
    font-size: 24px;
    color: #32bcad;
}

.checkout-summary-box {
    background: #fafafa;
    border: 1px dashed #ccc;
    padding: 15px;
    border-radius: 8px;
    margin-top: 15px;
}

