:root {
  /* amarelo do trailer, roxo do açaí, amarelo escuro do pastel */
  --bg: #fff8e6;
  --card: #ffffff;
  --card2: #f7f0fa;
  --line: #eadff0;
  --text: #2a1238;
  --muted: #7b6a86;
  --yellow: #ffc800;
  --yellow-ink: #2a1238;
  --purple: #6a1b9a;
  --purple2: #8e3bbf;
  --pastel: #e39b00;
  --green: #1fa855;
  --red: #e0352b;
  --blue: #1e7fd6;
  --orange: #f07c00;
  --radius: 16px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 16px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  padding-bottom: 96px;
}
a { color: var(--purple); }
h1, h2, h3 { margin: 0; line-height: 1.2; }
button, input, select, textarea { font: inherit; color: inherit; }
.wrap { max-width: 720px; margin: 0 auto; padding: 0 16px; }

/* cabeçalho */
.top { background: linear-gradient(135deg, var(--purple) 0%, var(--purple2) 60%, #b04fd6 100%); color: #fff; padding: 16px 0 14px; border-bottom: 5px solid var(--yellow); }
.top .muted, .top small { color: #ead7f5 !important; }
.top a { color: var(--yellow); }
.brand { display: flex; align-items: center; gap: 12px; }
.logo { width: 48px; height: 48px; flex: none; }
.brand h1 { font-size: 22px; letter-spacing: .5px; }
.brand h1 span { color: var(--yellow); }
.brand h1 { color: #fff; }
.brand small { color: var(--muted); display: block; font-size: 13px; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 99px; font-size: 13px; font-weight: 700; background: rgba(255,255,255,.18); color: #fff; }
.pill.on { background: #dcf8e6; color: #0f7a3a; }
.pill.off { background: #ffe1de; color: #b3261e; }
.pill::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.pill.plain::before { display: none; }

/* abas de categoria */
.tabs { position: sticky; top: 0; z-index: 5; background: var(--bg); border-bottom: 1px solid var(--line); box-shadow: 0 2px 8px rgba(106, 27, 154, .06); }
.tabs .wrap { display: flex; gap: 8px; overflow-x: auto; padding-top: 10px; padding-bottom: 10px; scrollbar-width: none; }
.tabs .wrap::-webkit-scrollbar { display: none; }
.tab { flex: none; padding: 8px 14px; border-radius: 99px; background: var(--card); border: 1px solid var(--line); white-space: nowrap; font-size: 14px; cursor: pointer; color: var(--purple); font-weight: 600; }
.tab.active { background: var(--purple); color: #fff; border-color: var(--purple); font-weight: 700; }

/* cardápio */
.cat { padding-top: 20px; scroll-margin-top: 64px; }
.cat h2 { font-size: 20px; margin-bottom: 2px; color: var(--purple); display: flex; align-items: center; gap: 8px; }
.cat h2 img { width: 34px; height: 34px; }
.cat > p { color: var(--muted); margin: 0 0 10px; font-size: 14px; }
.prod { display: flex; align-items: center; gap: 12px; padding: 12px; background: var(--card); border-radius: var(--radius); margin-top: 10px; cursor: pointer; border: 1px solid var(--line); width: 100%; text-align: left; color: var(--text); box-shadow: 0 2px 6px rgba(106, 27, 154, .05); }
.prod .thumb { width: 64px; height: 64px; border-radius: 12px; flex: none; object-fit: cover; background: var(--card2); }
.prod > div:nth-child(2) { flex: 1; min-width: 0; }
.prod.out { opacity: .55; }
.prod.out .price { color: var(--red); font-size: 13px; }
.old { text-decoration: line-through; color: var(--muted); font-weight: 400; font-size: 12px; display: block; text-align: right; }
.prod:active { border-color: var(--purple2); }
.prod h3 { font-size: 16px; }
.prod p { margin: 4px 0 0; color: var(--muted); font-size: 14px; }
.price { color: var(--purple); font-weight: 800; white-space: nowrap; }
.price small { color: var(--muted); font-weight: 400; display: block; font-size: 11px; text-align: right; }

/* botões e formulários */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: 12px; padding: 12px 16px; font-weight: 700; cursor: pointer; background: var(--card2); color: var(--text); text-decoration: none; min-height: 46px; }
.btn.primary { background: var(--yellow); color: var(--yellow-ink); box-shadow: 0 3px 0 #d9a800; }
.btn.purple { background: var(--purple); color: #fff; }
.btn.green { background: var(--green); color: #fff; }
.btn.red { background: transparent; color: var(--red); border: 1px solid var(--red); }
.btn.blue { background: var(--blue); color: #fff; }
.btn.ghost { background: transparent; border: 1px solid var(--line); }
.btn.block { width: 100%; }
.btn.sm { padding: 8px 12px; min-height: 38px; font-size: 14px; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
label { display: block; font-size: 14px; color: var(--muted); margin: 12px 0 4px; }
input, select, textarea { width: 100%; background: #fff; border: 1px solid #d9c8e3; border-radius: 10px; padding: 12px; outline: none; color: var(--text); }
input:focus, select:focus, textarea:focus { border-color: var(--purple2); box-shadow: 0 0 0 3px rgba(142, 59, 191, .15); }
textarea { min-height: 70px; resize: vertical; }
.row { display: flex; gap: 10px; }
.row > * { flex: 1; min-width: 0; }
.row > .w30 { flex: 0 0 30%; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.center { text-align: center; }
.mt { margin-top: 16px; }
.hidden { display: none !important; }
.card { background: var(--card); border-radius: var(--radius); padding: 16px; margin-top: 12px; border: 1px solid var(--line); }
.sep { border: 0; border-top: 1px dashed var(--line); margin: 12px 0; }

/* opções (radio/checkbox) */
.group { margin-top: 16px; }
.group-h { display: flex; justify-content: space-between; align-items: baseline; padding: 8px 0; }
.group-h b { font-size: 15px; }
.req { font-size: 11px; padding: 2px 8px; border-radius: 99px; background: var(--card2); color: var(--muted); }
.req.need { background: var(--purple); color: #fff; }
.opt { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 10px; background: var(--card2); margin-top: 6px; cursor: pointer; color: var(--text); font-size: 15px; }
.opt input { width: 20px; height: 20px; flex: none; accent-color: var(--purple); }
.opt span { flex: 1; }
.opt em { font-style: normal; color: var(--purple); font-size: 14px; font-weight: 700; }
.qty { display: inline-flex; align-items: center; gap: 4px; background: var(--card2); border-radius: 12px; }
.qty button { width: 42px; height: 42px; border: 0; background: none; font-size: 22px; cursor: pointer; color: var(--purple); }
.qty span { min-width: 24px; text-align: center; font-weight: 700; }

/* folha inferior */
.sheet-bg { position: fixed; inset: 0; background: rgba(42, 18, 56, .55); z-index: 20; display: flex; align-items: flex-end; justify-content: center; }
.sheet { background: var(--bg); width: 100%; max-width: 720px; max-height: 92vh; overflow-y: auto; border-radius: 18px 18px 0 0; padding: 20px 16px 16px; }
.sheet-foot { position: sticky; bottom: -16px; background: var(--bg); padding: 12px 0 16px; margin-top: 12px; display: flex; gap: 10px; align-items: center; }
.x { float: right; background: var(--card2); border: 0; width: 36px; height: 36px; border-radius: 50%; font-size: 20px; cursor: pointer; color: var(--text); }

/* barra do carrinho */
.cartbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 10; padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); background: linear-gradient(transparent, var(--bg) 30%); }
.cartbar .btn { width: 100%; max-width: 688px; margin: 0 auto; display: flex; justify-content: space-between; }

/* carrinho */
.line { display: flex; gap: 10px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.line:last-child { border-bottom: 0; }
.line .info { flex: 1; min-width: 0; }
.line .info p { margin: 2px 0 0; font-size: 13px; color: var(--muted); }
.tot { display: flex; justify-content: space-between; padding: 4px 0; }
.tot.big { font-size: 20px; font-weight: 800; padding-top: 8px; }
.tot.big span:last-child { color: var(--purple); }
.seg { display: flex; gap: 8px; }
.seg label { flex: 1; margin: 0; }
.seg input { display: none; }
.seg span { display: block; text-align: center; padding: 12px 8px; border-radius: 10px; background: #fff; border: 1px solid #d9c8e3; color: var(--text); font-weight: 600; cursor: pointer; }
.seg input:checked + span { background: var(--purple); color: #fff; border-color: var(--purple); }

/* acompanhamento */
.steps { list-style: none; padding: 0; margin: 16px 0 0; }
.steps li { position: relative; padding: 0 0 22px 34px; color: var(--muted); }
.steps li::before { content: ""; position: absolute; left: 6px; top: 2px; width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--line); background: var(--bg); }
.steps li::after { content: ""; position: absolute; left: 13px; top: 20px; bottom: 0; width: 2px; background: var(--line); }
.steps li:last-child::after { display: none; }
.steps li.done { color: var(--text); }
.steps li.done::before { background: var(--green); border-color: var(--green); }
.steps li.now { color: var(--purple); font-weight: 800; }
.steps li.now::before { background: var(--yellow); border-color: var(--purple); box-shadow: 0 0 0 4px rgba(142, 59, 191, .2); }
.steps small { display: block; font-weight: 400; color: var(--muted); }

/* status */
.st { display: inline-block; padding: 3px 10px; border-radius: 99px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.st-aguardando { background: var(--yellow); color: var(--yellow-ink); }
.st-preparo { background: #ffe9b8; color: #7a4a00; }
.st-producao { background: var(--pastel); color: #fff; }
.st-pronto { background: var(--blue); color: #fff; }
.st-em_rota { background: var(--purple2); color: #fff; }
.st-entregue { background: var(--green); color: #fff; }
.st-cancelado { background: #ffe1de; color: var(--red); }

/* aviso */
#toast { position: fixed; left: 50%; top: 16px; transform: translate(-50%, -20px); background: var(--text); color: #fff; padding: 12px 18px; border-radius: 12px; font-weight: 600; opacity: 0; pointer-events: none; transition: .2s; z-index: 50; max-width: calc(100% - 32px); text-align: center; }
#toast.show { opacity: 1; transform: translate(-50%, 0); }
#toast.err { background: var(--red); color: #fff; }
#toast.ok { background: var(--green); color: #fff; }

/* câmera */
.scanner { position: relative; background: #000; border-radius: var(--radius); overflow: hidden; aspect-ratio: 1; max-height: 60vh; margin: 12px auto 0; }
.scanner video { width: 100%; height: 100%; object-fit: cover; display: block; }
.scanner::after { content: ""; position: absolute; inset: 18%; border: 3px solid var(--yellow); border-radius: 16px; box-shadow: 0 0 0 999px rgba(0, 0, 0, .35); }

/* retaguarda */
.nav { display: flex; gap: 6px; overflow-x: auto; padding: 10px 0; scrollbar-width: none; }
.nav button { flex: none; }
.order { background: var(--card); border-radius: var(--radius); padding: 14px; margin-top: 12px; border: 1px solid var(--line); border-left: 6px solid var(--line); }
.order.s-aguardando { border-left-color: var(--yellow); }
.order.s-preparo { border-left-color: #ffd36b; }
.order.s-producao { border-left-color: var(--pastel); }
.order.s-pronto { border-left-color: var(--blue); }
.order.s-em_rota { border-left-color: var(--purple2); }
.order.s-entregue { border-left-color: var(--green); opacity: .75; }
.order.s-cancelado { opacity: .5; }
.order-h { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.order-h b { font-size: 18px; }
.order ul { margin: 8px 0; padding-left: 18px; }
.order li { margin: 2px 0; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.actions .btn { flex: 1 1 auto; }
.tbl { width: 100%; border-collapse: collapse; }
.tbl td { padding: 6px 4px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl input { padding: 8px; }
.switch { display: inline-flex; align-items: center; gap: 8px; color: var(--text); margin: 0; cursor: pointer; }
.switch input { width: 22px; height: 22px; accent-color: var(--purple); }
.gbox { border: 1px solid var(--line); border-radius: 12px; padding: 12px; margin-top: 12px; }
.optrow { display: flex; gap: 6px; margin-top: 6px; align-items: center; }
.optrow input[type=text] { flex: 1; }
.optrow input.p { flex: 0 0 90px; }
.optrow input[type=checkbox] { width: 22px; height: 22px; flex: none; accent-color: var(--purple); }
.iconbtn { background: var(--card2); border: 0; border-radius: 8px; width: 38px; height: 38px; flex: none; cursor: pointer; color: var(--red); font-size: 18px; }
.prodrow { display: flex; justify-content: space-between; gap: 8px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.prodrow.off { opacity: .5; }
.badge { font-size: 11px; background: var(--card2); color: var(--muted); padding: 2px 6px; border-radius: 6px; }

/* cupom para impressão pelo navegador */
#receipt-print { display: none; }
@media print {
  body { background: #fff; color: #000; padding: 0; }
  body > *:not(#receipt-print) { display: none !important; }
  #receipt-print { display: block; width: 58mm; font: 12px/1.3 monospace; color: #000; }
  #receipt-print pre { white-space: pre-wrap; margin: 0; font: inherit; }
  @page { size: 58mm auto; margin: 2mm; }
}

/* faixas e avisos */
.promo { background: linear-gradient(90deg, var(--yellow), #ffdf5c); color: var(--yellow-ink); border-radius: var(--radius); padding: 12px 14px; margin-top: 14px; border: 0; }
.promo b { display: block; }
.promo + .promo { margin-top: 8px; }
.closed-cat { background: #ffe1de; color: #8a1c14; border-radius: 12px; padding: 10px 12px; margin: 6px 0 0; font-weight: 600; font-size: 14px; }
.eta { display: inline-block; margin-top: 8px; background: var(--yellow); color: var(--yellow-ink); font-weight: 800; padding: 4px 10px; border-radius: 99px; font-size: 13px; }
.gift { color: var(--green); font-weight: 700; }
.versao { text-align: center; margin: 16px 0 0; font-size: 12px; }
.versao a { color: var(--muted); text-decoration: underline; }
.novidades h3 { margin: 18px 0 4px; }
.novidades ul { margin: 4px 0 0; padding-left: 20px; }
.novidades li { margin: 4px 0; }
footer.credits { text-align: center; color: var(--muted); font-size: 12px; padding: 24px 16px 8px; }
footer.credits a { color: var(--purple); font-weight: 700; text-decoration: none; }
.kpi { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.kpi div { background: var(--card2); border-radius: 12px; padding: 10px 12px; }
.kpi b { display: block; font-size: 20px; color: var(--purple); }
.kpi span { font-size: 12px; color: var(--muted); }
details.drv { border-top: 1px solid var(--line); padding: 8px 0; }
details.drv summary { cursor: pointer; display: flex; justify-content: space-between; gap: 8px; font-weight: 700; }
.availrow { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.availrow.off b { text-decoration: line-through; color: var(--muted); }

/* endereços salvos no checkout */
.addrs { display: grid; gap: 6px; }
.addrs:empty { display: none; }
.addr { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; background: var(--card2); cursor: pointer; margin: 0; }
.addr input { width: auto; flex: 0 0 auto; margin: 0; min-height: 0; accent-color: var(--purple); }
.addr span { flex: 1; text-align: left; }
.addr small { display: block; color: var(--muted); font-size: 13px; }
.addr:has(input:checked) { outline: 2px solid var(--purple); }

/* topo do cardápio: capa, destaques, nota do Google */
.capa { height: 170px; border-radius: 16px; margin-top: 12px; background: #eadff0 center/cover no-repeat; }
@media (min-width: 700px) { .capa { height: 240px; } }
.dest h2 { margin: 16px 0 8px; }
.dest-row { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 6px; -webkit-overflow-scrolling: touch; scroll-snap-type: x mandatory; }
.dest-card { flex: 0 0 140px; scroll-snap-align: start; text-align: left; background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 8px; color: var(--text); }
.dest-card img { width: 100%; height: 92px; object-fit: cover; border-radius: 10px; background: #f6f0fa; }
.dest-card b { display: block; font-size: 14px; margin: 6px 0 2px; line-height: 1.2; }
.dest-card span { font-size: 13px; color: var(--purple); font-weight: 700; }
.top-extras { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 10px; }
.top-extras:empty { display: none; }
.gstars { color: #fff; font-size: 13px; text-decoration: none; background: rgba(255,255,255,.14); border-radius: 999px; padding: 5px 10px; }
.gstars .st { color: var(--yellow); letter-spacing: 1px; }

/* Ajustes: cupom com prévia */
.cupom-cfg { display: grid; gap: 16px; }
@media (min-width: 900px) { .cupom-cfg { grid-template-columns: 1fr 330px; align-items: start; } .cupom-cfg > div:last-child { position: sticky; top: 70px; } }
.cupom-cfg textarea { width: 100%; }
.cupom-prev { background: #fff; color: #111; border: 1px solid #ddd; border-radius: 6px; padding: 10px 8px; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 11px; max-width: 330px; box-shadow: 0 2px 10px rgba(0,0,0,.08); overflow: hidden; }
.cupom-prev pre { margin: 0; white-space: pre; font-family: inherit; }
.cupom-cfg .switch { display: flex; }
