/* ===== Cardapio online e acompanhamento do pedido ===== */
:root {
  --cor: #d9480f;
  --cor-escura: #b33a0b;
  --fundo: #faf6f1;
  --card: #ffffff;
  --texto: #221c17;
  --suave: #75695f;
  --borda: #ebe2d8;
  --ok: #2b8a3e;
  --alerta: #e8590c;
  --erro: #c92a2a;
  --raio: 14px;
  --sombra: 0 2px 10px rgba(60, 40, 20, .08);
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Ubuntu, sans-serif;
  background: var(--fundo); color: var(--texto); font-size: 15px; line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit; }
img { max-width: 100%; display: block; }
a { color: var(--cor); }
.oculto { display: none !important; }
.container { max-width: 760px; margin: 0 auto; padding: 0 16px; }

/* ---------- Topo ---------- */
.topo { background: var(--cor); color: #fff; padding: 22px 0 18px; }
.topo .container { display: flex; align-items: center; gap: 14px; }
.topo img.logo { width: 58px; height: 58px; border-radius: 50%; object-fit: cover; background: #fff; border: 3px solid rgba(255,255,255,.6); }
.topo h1 { margin: 0; font-size: 1.45rem; letter-spacing: -.01em; }
.topo p { margin: 2px 0 0; opacity: .92; font-size: .9rem; }
.selo { display: inline-flex; align-items: center; gap: 6px; font-size: .78rem; font-weight: 600; padding: 3px 10px; border-radius: 99px; background: rgba(255,255,255,.18); margin-top: 6px; }
.selo::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #69db7c; }
.selo.fechada::before { background: #ffa8a8; }
.aviso-fechada { background: #fff3bf; color: #5c4400; padding: 12px 16px; text-align: center; font-weight: 600; font-size: .92rem; }

/* ---------- Categorias ---------- */
.nav-cat { position: sticky; top: 0; z-index: 20; background: var(--fundo); border-bottom: 1px solid var(--borda); }
.nav-cat .container { display: flex; gap: 8px; overflow-x: auto; padding: 10px 16px; scrollbar-width: none; }
.nav-cat .container::-webkit-scrollbar { display: none; }
.chip { white-space: nowrap; border: 1px solid var(--borda); background: var(--card); padding: 7px 14px; border-radius: 99px; cursor: pointer; font-size: .88rem; font-weight: 500; }
.chip.ativo { background: var(--texto); color: #fff; border-color: var(--texto); }

.categoria { padding-top: 18px; scroll-margin-top: 60px; }
.categoria h2 { font-size: 1.15rem; margin: 6px 0 10px; }
.produto { display: flex; gap: 12px; background: var(--card); border-radius: var(--raio); padding: 12px; margin-bottom: 10px; box-shadow: var(--sombra); cursor: pointer; border: 1px solid transparent; transition: border-color .15s; }
.produto:hover { border-color: var(--borda); }
.produto .info { flex: 1; min-width: 0; }
.produto h3 { margin: 0 0 3px; font-size: 1rem; }
.produto .desc { margin: 0; color: var(--suave); font-size: .86rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.produto .preco { margin-top: 6px; font-weight: 700; }
.produto img, .produto .sem-foto { width: 92px; height: 92px; border-radius: 10px; object-fit: cover; flex-shrink: 0; background: #f1e9df; }
.produto .sem-foto { display: grid; place-items: center; font-size: 2rem; }
.produto.esgotado { opacity: .55; cursor: not-allowed; }
.tag-esgotado { display: inline-block; background: #f1f3f5; color: var(--suave); font-size: .74rem; font-weight: 600; padding: 2px 8px; border-radius: 6px; margin-left: 6px; }

/* ---------- Barra do carrinho ---------- */
.barra-carrinho { position: fixed; left: 0; right: 0; bottom: 0; padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); z-index: 30; pointer-events: none; }
.barra-carrinho button { pointer-events: auto; width: 100%; max-width: 728px; margin: 0 auto; display: flex; justify-content: space-between; align-items: center; background: var(--cor); color: #fff; border: 0; border-radius: 12px; padding: 15px 18px; font-weight: 700; box-shadow: 0 6px 20px rgba(0,0,0,.18); cursor: pointer; }
.barra-carrinho .qtd { background: rgba(255,255,255,.22); border-radius: 8px; padding: 1px 8px; margin-right: 8px; }
.espaco-barra { height: 90px; }

/* ---------- Folhas (modais de baixo) ---------- */
.fundo-modal { position: fixed; inset: 0; background: rgba(20, 12, 5, .5); z-index: 50; display: flex; align-items: flex-end; justify-content: center; }
.folha { background: var(--card); width: 100%; max-width: 640px; max-height: 92vh; border-radius: 18px 18px 0 0; display: flex; flex-direction: column; animation: sobe .22s ease-out; }
@media (min-width: 700px) { .fundo-modal { align-items: center; } .folha { border-radius: 18px; } }
@keyframes sobe { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
.folha-topo { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; border-bottom: 1px solid var(--borda); }
.folha-topo h3 { margin: 0; font-size: 1.08rem; }
.fechar { border: 0; background: #f1ebe4; width: 34px; height: 34px; border-radius: 50%; cursor: pointer; font-size: 1.1rem; line-height: 1; }
.folha-corpo { padding: 16px; overflow-y: auto; flex: 1; }
.folha-rodape { padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); border-top: 1px solid var(--borda); display: flex; gap: 10px; align-items: center; }
.folha img.foto { width: 100%; max-height: 240px; object-fit: cover; border-radius: 12px; margin-bottom: 12px; }

/* ---------- Formularios ---------- */
label.campo { display: block; margin-bottom: 12px; }
label.campo > span { display: block; font-size: .82rem; font-weight: 600; color: var(--suave); margin-bottom: 4px; }
input[type=text], input[type=tel], input[type=email], input[type=number], textarea, select {
  width: 100%; padding: 11px 12px; border: 1px solid var(--borda); border-radius: 10px; background: #fff; outline: none; }
input:focus, textarea:focus, select:focus { border-color: var(--cor); box-shadow: 0 0 0 3px color-mix(in srgb, var(--cor) 18%, transparent); }
textarea { resize: vertical; min-height: 64px; }
.linha { display: flex; gap: 10px; }
.linha > * { flex: 1; }
.linha > .estreito { flex: 0 0 110px; }
.secao-titulo { font-size: .95rem; font-weight: 700; margin: 18px 0 10px; }
.secao-titulo:first-child { margin-top: 0; }

.btn { border: 0; border-radius: 10px; padding: 13px 16px; font-weight: 700; cursor: pointer; background: var(--cor); color: #fff; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn.sec { background: #f1ebe4; color: var(--texto); }
.btn.bloco { width: 100%; display: flex; justify-content: space-between; }
.btn.pequeno { padding: 8px 12px; font-size: .86rem; }

.opcao { display: flex; align-items: center; gap: 10px; padding: 12px; border: 1px solid var(--borda); border-radius: 10px; margin-bottom: 8px; cursor: pointer; }
.opcao input { width: 18px; height: 18px; accent-color: var(--cor); }
.opcao .opcao-texto { flex: 1; }
.opcao .opcao-texto small { display: block; color: var(--suave); }
.opcao:has(input:checked) { border-color: var(--cor); background: color-mix(in srgb, var(--cor) 6%, #fff); }

.segmentado { display: flex; background: #f1ebe4; border-radius: 10px; padding: 4px; margin-bottom: 14px; }
.segmentado button { flex: 1; border: 0; background: transparent; padding: 9px; border-radius: 8px; font-weight: 600; cursor: pointer; }
.segmentado button.ativo { background: #fff; box-shadow: var(--sombra); }

.qtd-ctrl { display: inline-flex; align-items: center; border: 1px solid var(--borda); border-radius: 10px; overflow: hidden; }
.qtd-ctrl button { border: 0; background: #fff; width: 38px; height: 40px; font-size: 1.2rem; cursor: pointer; color: var(--cor); }
.qtd-ctrl span { min-width: 30px; text-align: center; font-weight: 700; }

/* ---------- Carrinho ---------- */
.item-carrinho { display: flex; gap: 10px; padding: 12px 0; border-bottom: 1px solid var(--borda); }
.item-carrinho .info { flex: 1; min-width: 0; }
.item-carrinho .info small { display: block; color: var(--suave); }
.item-carrinho .valor { font-weight: 700; white-space: nowrap; }
.totais { margin-top: 12px; }
.totais div { display: flex; justify-content: space-between; padding: 3px 0; color: var(--suave); }
.totais div.total { color: var(--texto); font-weight: 800; font-size: 1.1rem; padding-top: 8px; }

#mapa-endereco { height: 220px; border-radius: 12px; margin-bottom: 12px; border: 1px solid var(--borda); }
.dica { font-size: .8rem; color: var(--suave); margin: -4px 0 12px; }
.erro-msg { background: #fff5f5; color: var(--erro); border: 1px solid #ffc9c9; padding: 10px 12px; border-radius: 10px; margin-bottom: 12px; font-size: .9rem; }
.btn-local { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; margin-bottom: 12px; }

/* ---------- Acompanhamento ---------- */
.cartao { background: var(--card); border-radius: var(--raio); padding: 16px; box-shadow: var(--sombra); margin: 14px 0; }
.cartao h2 { margin: 0 0 4px; font-size: 1.2rem; }
.status-grande { font-size: 1.3rem; font-weight: 800; margin: 4px 0 2px; }
.linha-tempo { display: flex; justify-content: space-between; margin: 18px 0 6px; position: relative; }
.linha-tempo::before { content: ""; position: absolute; left: 6%; right: 6%; top: 13px; height: 3px; background: var(--borda); }
.etapa { position: relative; text-align: center; flex: 1; font-size: .72rem; color: var(--suave); }
.etapa .bola { width: 28px; height: 28px; border-radius: 50%; background: #fff; border: 3px solid var(--borda); margin: 0 auto 6px; display: grid; place-items: center; font-size: .8rem; position: relative; }
.etapa.feita .bola { background: var(--cor); border-color: var(--cor); color: #fff; }
.etapa.atual .bola { box-shadow: 0 0 0 5px color-mix(in srgb, var(--cor) 25%, transparent); }
.etapa.feita { color: var(--texto); font-weight: 600; }
#mapa-rastreio { height: 320px; border-radius: 12px; border: 1px solid var(--borda); }
.pix-qr { width: 220px; height: 220px; margin: 10px auto; image-rendering: pixelated; }
.copia-cola { display: flex; gap: 8px; }
.copia-cola input { font-size: .8rem; }
.contador { text-align: center; color: var(--suave); font-size: .86rem; }
.btn-whats { display: flex; align-items: center; justify-content: center; gap: 8px; background: #25d366; color: #fff; text-decoration: none; padding: 12px; border-radius: 10px; font-weight: 700; }
.badge { display: inline-block; padding: 2px 9px; border-radius: 99px; font-size: .76rem; font-weight: 700; }
.badge.ok { background: #d3f9d8; color: #1b5e20; }
.badge.pendente { background: #fff3bf; color: #5c4400; }
.badge.erro { background: #ffe3e3; color: var(--erro); }
.entregador-info { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.entregador-info .icone { font-size: 1.6rem; }
.pulso { width: 10px; height: 10px; background: var(--ok); border-radius: 50%; display: inline-block; animation: pulso 1.6s infinite; }
@keyframes pulso { 0% { box-shadow: 0 0 0 0 rgba(43,138,62,.6); } 100% { box-shadow: 0 0 0 10px rgba(43,138,62,0); } }
.carregando { text-align: center; padding: 60px 0; color: var(--suave); }
.toast { position: fixed; left: 50%; bottom: 100px; transform: translateX(-50%); background: var(--texto); color: #fff; padding: 10px 16px; border-radius: 10px; z-index: 90; font-size: .9rem; box-shadow: var(--sombra); }
.marcador-moto { font-size: 28px; line-height: 1; filter: drop-shadow(0 2px 2px rgba(0,0,0,.35)); }

/* ---------- Adicionais com quantidade ---------- */
.opcao-qtd { cursor: default; }
.opcao-qtd .opcao-texto { cursor: pointer; }
.opcao.marcada { border-color: var(--cor); background: color-mix(in srgb, var(--cor) 6%, #fff); }
.qtd-ctrl.mini button { width: 34px; height: 34px; font-size: 1.1rem; }
.qtd-ctrl.mini button:disabled { color: #ccc; cursor: default; }
.qtd-ctrl.mini span { min-width: 24px; }
.opcao.marcada .qtd-ctrl.mini span { color: var(--cor); }
