/* --- VARIÁVEIS DE SISTEMA E BLOQUEIO DE INVERSÃO --- */
:root {
    color-scheme: light;
    --font-sans: system-ui, -apple-system, sans-serif;
    --color-background-primary: #ffffff;
    --color-background-secondary: #f4f6f8;
    --color-background-tertiary: #e9ecef;
    --color-text-primary: #333333;
    --color-text-secondary: #666666;
    --brand-blue: #003366;
    --brand-green: #25D366;
    --color-border-tertiary: #e9ecef;
    --color-border-secondary: #cccccc;
}

* { box-sizing: border-box; margin: 0; padding: 0; font-family: var(--font-sans); }
body { background: var(--color-background-tertiary); color: var(--color-text-primary); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }

.app-container { width: 100%; max-width: 1400px; margin: 0 auto; background: var(--color-background-primary); min-height: 100vh; position: relative; padding-bottom: 80px; box-shadow: 0 0 20px rgba(0,0,0,0.1); }

/* --- CABEÇALHO --- */
.header { 
    position: relative;
    background: #ffffff !important; 
    padding: 24px 20px; 
    text-align: center; 
    border-bottom: 1px solid var(--color-border-tertiary); 
    box-shadow: 0 4px 15px rgba(0,0,0,0.03); 
}
.brand-logo { 
    width: 100%; 
    max-width: 260px; 
    height: auto; 
    margin: 0 auto 16px; 
    display: block; 
    filter: drop-shadow(0px 2px 8px rgba(0,0,0,0.06)); 
}
.header h1 { display: none !important; }

/* --- BARRA DE PESQUISA --- */
.search-wrap { position: relative; max-width: 600px; margin: 0 auto; }
.search-wrap i { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); font-size: 18px; color: var(--brand-blue); transition: 0.3s; }
#searchBar { width: 100%; padding: 14px 14px 14px 44px; border-radius: 12px; border: 2px solid var(--color-background-tertiary); font-size: 15px; background: var(--color-background-secondary); color: var(--color-text-primary); transition: all 0.3s ease; font-weight: 500; }
#searchBar:focus { background: #ffffff; border-color: var(--brand-blue); outline: none; box-shadow: 0 0 0 4px rgba(0, 51, 102, 0.1); }
#searchBar::placeholder { color: #999999; font-weight: 400; }

/* --- NAVEGAÇÃO POR CATEGORIAS --- */
.cats { display: flex; gap: 10px; padding: 16px 20px; overflow-x: auto; scrollbar-width: none; border-bottom: 1px solid var(--color-border-tertiary); }
.cats::-webkit-scrollbar { display: none; }
.cat-btn { padding: 8px 16px; border-radius: 20px; border: 1px solid var(--color-border-secondary); background: var(--color-background-primary); color: var(--color-text-secondary); font-size: 14px; font-weight: 500; cursor: pointer; white-space: nowrap; flex-shrink: 0; }
.cat-btn.active { background: var(--brand-blue); color: white; border-color: var(--brand-blue); }

/* --- LISTAGEM DE PRODUTOS E CARDS --- */
.section-title { font-size: 12px; font-weight: 700; color: var(--color-text-secondary); padding: 20px 20px 10px; letter-spacing: 1px; text-transform: uppercase; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 15px; padding: 0 20px 20px; }

.card { background: var(--color-background-primary); border-radius: 12px; border: 1px solid var(--color-border-tertiary); padding: 12px; text-align: center; display: flex; flex-direction: column; height: 100%; }
.card-img-wrap { width: 100%; height: 140px; background: #ffffff !important; border-radius: 8px; margin-bottom: 12px; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.card-img { max-width: 90%; max-height: 90%; object-fit: contain; transition: transform 0.2s ease; }
.card h3 { font-size: 14px; font-weight: 600; color: var(--color-text-primary); margin-bottom: 6px; line-height: 1.3; }

.pack-selector { background: var(--color-background-secondary); border-radius: 6px; padding: 4px; margin-bottom: 10px; margin-top: auto; }
.pack-selector select { width: 100%; padding: 6px; font-size: 13px; font-weight: 600; border: 1px solid var(--color-border-secondary); border-radius: 4px; background: white; cursor: pointer; }
.pack-selector select:focus { outline: none; border-color: var(--brand-blue); }

.price { color: #1a7a3c; font-weight: 600; font-size: 16px; margin-bottom: 12px; margin-top: auto; }

.controls { display: flex; justify-content: center; align-items: center; gap: 12px; }
.controls button { width: 32px; height: 32px; border-radius: 50%; border: 1px solid var(--color-border-secondary); background: var(--color-background-secondary); color: var(--color-text-primary); font-size: 20px; cursor: pointer; }
.qty { font-size: 16px; font-weight: 600; min-width: 24px; color: var(--color-text-primary); }
.qty.has-qty { color: var(--brand-blue); }

/* --- BARRA FIXA INFERIOR DO CARRINHO --- */
.cart-bar { position: fixed; bottom: 0; left: 50%; transform: translateX(-50%); max-width: 1400px; width: 100%; background: var(--brand-green); padding: 16px 20px; display: flex; justify-content: space-between; align-items: center; box-shadow: 0 -4px 15px rgba(0,0,0,0.1); border-radius: 16px 16px 0 0; z-index: 50; }
.cart-bar.hidden { display: none; }
.cart-info { color: white; }
.cart-items { font-size: 13px; opacity: 0.9; font-weight: 500; }
.cart-total { font-size: 18px; font-weight: 700; }
.cart-btn { background: white; color: var(--brand-green); border: none; padding: 12px 20px; border-radius: 8px; font-weight: 700; font-size: 15px; cursor: pointer; display: flex; align-items: center; gap: 6px; }

/* --- MODAL DE FINALIZAÇÃO --- */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.6); display: flex; align-items: flex-end; justify-content: center; z-index: 100; backdrop-filter: blur(2px); }
.modal-overlay.hidden { display: none; }
.modal { background: var(--color-background-primary); border-radius: 20px 20px 0 0; padding: 24px 24px 32px; width: 100%; max-width: 480px; }
.modal h2 { font-size: 18px; font-weight: 700; margin-bottom: 20px; text-align: center; }
.resumo-box { background: var(--color-background-secondary); border-radius: 8px; padding: 12px; font-size: 14px; max-height: 150px; overflow-y: auto; margin-bottom: 10px; border: 1px solid var(--color-border-secondary); }
.modal label { display: block; font-size: 14px; font-weight: 600; margin-bottom: 8px; margin-top: 20px; }
.modal input { width: 100%; padding: 12px 14px; border-radius: 8px; border: 1px solid var(--color-border-secondary); font-size: 15px; }

.pay-opts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.pay-opt { padding: 12px; border-radius: 8px; border: 1px solid var(--color-border-secondary); background: var(--color-background-secondary); font-size: 14px; font-weight: 500; cursor: pointer; text-align: center; display: flex; align-items: center; justify-content: center; gap: 6px; }
.pay-opt.sel { border: 2px solid var(--brand-blue); background: rgba(0, 51, 102, 0.05); color: var(--brand-blue); }

.loc-btn { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 12px; border-radius: 8px; border: 1px solid var(--brand-blue); background: transparent; color: var(--brand-blue); font-size: 14px; font-weight: 600; cursor: pointer; width: 100%; margin-bottom: 10px; transition: 0.2s; }
.loc-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.loc-status { font-size: 13px; margin-bottom: 10px; font-weight: 500; }

.modal-actions { display: flex; gap: 12px; margin-top: 24px; }
.btn-cancel { flex: 1; padding: 14px; border-radius: 8px; border: none; background: var(--color-background-tertiary); font-size: 15px; font-weight: 600; cursor: pointer; }
.btn-send { flex: 2; padding: 14px; border-radius: 8px; border: none; background: var(--brand-green); color: white; font-size: 15px; font-weight: 700; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 8px; }

.empty { text-align: center; padding: 60px 20px; color: var(--color-text-secondary); font-size: 15px; font-weight: 500; }

/* --- MENU SANDUÍCHE E SIDEBAR LATERAL --- */
.menu-toggle { position: absolute; top: 24px; left: 20px; background: none; border: none; font-size: 30px; color: var(--brand-blue); cursor: pointer; z-index: 10; display: flex; align-items: center; justify-content: center; padding: 4px; border-radius: 8px; transition: 0.2s; }
.menu-toggle:active { background: var(--color-background-secondary); }

.sidebar-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.6); z-index: 200; backdrop-filter: blur(2px); transition: opacity 0.3s ease; opacity: 1; }
.sidebar-overlay.hidden { opacity: 0; pointer-events: none; }

.sidebar { position: absolute; top: 0; left: 0; bottom: 0; width: 290px; background: var(--color-background-primary); transform: translateX(0); transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1); box-shadow: 2px 0 20px rgba(0,0,0,0.15); display: flex; flex-direction: column; }
.sidebar-overlay.hidden .sidebar { transform: translateX(-100%); }

.sidebar-header { padding: 20px; border-bottom: 1px solid var(--color-border-tertiary); display: flex; justify-content: space-between; align-items: center; }
.sidebar-header h2 { font-size: 18px; font-weight: 700; color: var(--color-text-primary); }
.close-sidebar { background: none; border: none; font-size: 24px; color: var(--color-text-secondary); cursor: pointer; padding: 4px; border-radius: 6px; }
.close-sidebar:active { background: var(--color-background-secondary); }

.sidebar-content { padding: 20px; display: flex; flex-direction: column; gap: 16px; overflow-y: auto; }

.sidebar-item { display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: 10px; text-decoration: none; color: var(--color-text-primary); font-weight: 600; font-size: 15px; cursor: pointer; border: 1px solid var(--color-border-tertiary); background: var(--color-background-primary); }
.sidebar-item i { font-size: 22px; color: var(--color-text-secondary); }

.sidebar-item.btn-zap { border-color: #25D366; background: rgba(37, 211, 102, 0.05); color: #128C7E; }
.sidebar-item.btn-zap i { color: #25D366; }

.sidebar-info-box { background: var(--color-background-secondary); padding: 16px; border-radius: 10px; display: flex; gap: 12px; align-items: flex-start; font-size: 13px; line-height: 1.5; color: var(--color-text-secondary); border: 1px solid var(--color-border-tertiary); }
.sidebar-info-box i { font-size: 22px; color: var(--brand-blue); flex-shrink: 0; }
.sidebar-info-box strong { color: var(--color-text-primary); display: block; margin-bottom: 6px; font-size: 14px; }
