/* Cardápio digital — tema base. As 3 cores do config.json (primaria, fundo, texto)
   entram como --primary, --bg e --text; todo o resto é derivado delas. */

:root {
  --bg: #fbf8f3;
  --text: #1c1917;
  --primary: #e2552b;
  --on-primary: #ffffff;
  --ok: #1f9d55;
  --danger: #d6402e;
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 12px 32px -14px rgb(0 0 0 / 0.35);
  --font-body: "Inter", system-ui, sans-serif;
  --font-title: var(--font-body);
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);

  --surface: color-mix(in oklab, var(--text) 5%, var(--bg));
  --surface-2: color-mix(in oklab, var(--text) 10%, var(--bg));
  --line: color-mix(in oklab, var(--text) 12%, var(--bg));
  --muted: color-mix(in oklab, var(--text) 62%, var(--bg));
  --primary-soft: color-mix(in oklab, var(--primary) 14%, var(--bg));
  --primary-ink: color-mix(in oklab, var(--primary) 78%, var(--text));
  color-scheme: light;
}

:root[data-tema="escuro"] {
  --bg: #121010;
  --text: #f4eee6;
  --primary: #ff6a2b;
  --on-primary: #111111;
  --shadow: 0 14px 36px -12px rgb(0 0 0 / 0.7);
  --surface: color-mix(in oklab, var(--text) 7%, var(--bg));
  --surface-2: color-mix(in oklab, var(--text) 13%, var(--bg));
  --primary-ink: color-mix(in oklab, var(--primary) 85%, var(--text));
  color-scheme: dark;
}

:root[data-tema="pastel"] {
  --bg: #fff6f7;
  --text: #3e2a33;
  --primary: #d9668a;
  --on-primary: #ffffff;
  --radius: 24px;
  --radius-sm: 16px;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 16px/1.45 var(--font-body);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
}

body.travado { position: fixed; width: 100%; overflow: hidden; }

h1, h2, h3, p { margin: 0; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; padding: 0; }
button:disabled { cursor: default; }
img { display: block; max-width: 100%; }
a { color: inherit; }
svg { flex-shrink: 0; }

:focus-visible {
  outline: 3px solid color-mix(in oklab, var(--primary) 70%, transparent);
  outline-offset: 2px;
  border-radius: 8px;
}

.sr-only {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

#app { max-width: 560px; margin: 0 auto; min-height: 100vh; min-height: 100dvh; }

@media (min-width: 600px) {
  body { background: color-mix(in oklab, var(--text) 7%, var(--bg)); }
  #app { background: var(--bg); box-shadow: 0 0 80px rgb(0 0 0 / 0.18); }
}

/* ---------- Carregando ---------- */

.carregando { padding: 0 16px; }
.sk { background: linear-gradient(90deg, var(--surface) 0%, var(--surface-2) 50%, var(--surface) 100%); background-size: 200% 100%; animation: brilho 1.3s infinite linear; border-radius: 14px; }
.sk-capa { height: 200px; margin: 0 -16px; border-radius: 0; }
.sk-logo { width: 84px; height: 84px; border-radius: 50%; margin-top: -42px; border: 4px solid var(--bg); }
.sk-linha { height: 22px; margin-top: 14px; width: 60%; }
.sk-linha.curta { width: 35%; height: 16px; }
.sk-item { height: 96px; margin-top: 18px; }
@keyframes brilho { to { background-position: -200% 0; } }

/* ---------- Faixa de demonstração / aviso ---------- */

.faixa-demo {
  background: var(--text); color: var(--bg);
  text-align: center; font-size: 12px; padding: 7px 12px; letter-spacing: 0.02em;
}

.aviso-fechado {
  display: flex; gap: 10px; align-items: center;
  margin: 14px 16px 0; padding: 12px 14px;
  background: var(--surface); border-radius: var(--radius-sm);
  font-size: 14px; color: var(--muted);
}

/* ---------- Hero ---------- */

.hero { position: relative; }
.hero-capa { height: 220px; overflow: hidden; position: relative; background: var(--surface-2); }
.hero-capa img { width: 100%; height: 100%; object-fit: cover; }
.hero-capa::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgb(0 0 0 / 0.25) 0%, transparent 40%, color-mix(in oklab, var(--bg) 85%, transparent) 88%, var(--bg) 100%);
}
.hero.sem-capa .hero-capa {
  height: 140px;
  background:
    radial-gradient(120% 140% at 0% 0%, color-mix(in oklab, var(--primary) 55%, var(--bg)) 0%, transparent 60%),
    radial-gradient(100% 120% at 100% 0%, color-mix(in oklab, var(--primary) 30%, var(--bg)) 0%, transparent 70%),
    var(--surface);
}

.hero-acoes { position: absolute; top: 12px; right: 12px; display: flex; gap: 8px; z-index: 2; }
.btn-vidro {
  width: 42px; height: 42px; border-radius: 50%;
  display: grid; place-items: center;
  background: rgb(0 0 0 / 0.38); color: #fff;
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}

.hero-conteudo { position: relative; padding: 0 16px; margin-top: -58px; }
.hero-logo {
  width: 88px; height: 88px; border-radius: 50%;
  border: 4px solid var(--bg); background: var(--surface);
  overflow: hidden; display: grid; place-items: center;
  box-shadow: var(--shadow);
  font: 700 30px/1 var(--font-title); color: var(--primary);
}
.hero-logo img { width: 100%; height: 100%; object-fit: cover; }
.hero-nome {
  font: 700 clamp(30px, 8.5vw, 40px)/1.02 var(--font-title);
  letter-spacing: -0.01em; margin-top: 12px;
}
.hero-slogan { color: var(--muted); margin-top: 6px; font-size: 15px; }
.hero-pills { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }

.pill {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 7px 12px; border-radius: 999px;
  background: var(--surface); font-size: 13px; font-weight: 600;
}
.pill svg { width: 15px; height: 15px; }
.pill-status i { width: 8px; height: 8px; border-radius: 50%; background: var(--danger); }
.pill-status.on i { background: var(--ok); animation: pulsar 2s infinite; }
.pill-mesa { background: var(--primary-soft); color: var(--primary-ink); }
.pill-v2 { background: var(--primary); color: var(--on-primary); }
@keyframes pulsar {
  0% { box-shadow: 0 0 0 0 color-mix(in oklab, var(--ok) 60%, transparent); }
  70%, 100% { box-shadow: 0 0 0 7px transparent; }
}

/* ---------- Navegação de categorias ---------- */

#sentinela-cats { height: 1px; margin-top: 18px; }
.cats {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in oklab, var(--bg) 88%, transparent);
  backdrop-filter: blur(14px) saturate(1.4); -webkit-backdrop-filter: blur(14px) saturate(1.4);
  transition: box-shadow 0.2s;
}
.cats.fixa { box-shadow: 0 1px 0 var(--line), 0 8px 20px -14px rgb(0 0 0 / 0.4); }
.cats-trilho {
  display: flex; gap: 8px; overflow-x: auto; padding: 10px 16px;
  scrollbar-width: none; scroll-behavior: smooth;
}
.cats-trilho::-webkit-scrollbar { display: none; }
.cat {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 15px; border-radius: 999px;
  background: var(--surface); color: var(--muted);
  font-size: 14px; font-weight: 600; white-space: nowrap; text-decoration: none;
  transition: background 0.2s, color 0.2s;
}
.cat svg { width: 15px; height: 15px; color: var(--primary); }
.cat.ativa { background: var(--text); color: var(--bg); }

/* ---------- Seções e itens ---------- */

.secao { padding: 22px 16px 6px; scroll-margin-top: 58px; }
.secao-topo h2 { font: 700 26px/1.1 var(--font-title); letter-spacing: -0.01em; }
.secao-topo p { color: var(--muted); font-size: 14px; margin-top: 4px; }

.carrossel {
  display: flex; gap: 12px; overflow-x: auto;
  scroll-snap-type: x mandatory; scrollbar-width: none;
  margin: 14px -16px 0; padding: 2px 16px 14px;
}
.carrossel::-webkit-scrollbar { display: none; }
.card-destaque {
  position: relative; flex: 0 0 172px; scroll-snap-align: start;
  background: var(--surface); border-radius: var(--radius); overflow: hidden;
}
.cd-foto { aspect-ratio: 1; overflow: hidden; background: var(--surface-2); }
.cd-foto img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s var(--ease); }
.card-destaque:active .cd-foto img { transform: scale(1.04); }
.cd-ph {
  width: 100%; height: 100%; display: grid; place-items: center;
  font: 700 42px/1 var(--font-title); color: var(--on-primary);
  background: linear-gradient(135deg, var(--primary), color-mix(in oklab, var(--primary) 55%, var(--text)));
}
.cd-corpo { padding: 10px 52px 14px 12px; }
.cd-corpo h3 { font-size: 15px; font-weight: 600; line-height: 1.25; }
.cd-corpo .item-meta { margin-top: 6px; }
.card-destaque .preco small { display: block; }
.card-destaque .btn-add { position: absolute; right: 10px; bottom: 12px; }
.card-destaque .selo-esgotado { position: absolute; left: 10px; top: 10px; }

.lista { margin-top: 4px; }
.item {
  position: relative;
  display: grid; grid-template-columns: 1fr auto; gap: 14px; align-items: start;
  padding: 16px 0; border-bottom: 1px solid var(--line);
}
.lista .item:last-child { border-bottom: 0; }
.item-abrir { text-align: left; font-weight: inherit; line-height: inherit; }
.item-abrir::after { content: ""; position: absolute; inset: 0; z-index: 1; }
.card-destaque .item-abrir::after { border-radius: var(--radius); }
.item-nome { font-size: 16px; font-weight: 650; line-height: 1.3; }
.item-desc {
  color: var(--muted); font-size: 14px; margin-top: 4px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.item-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin-top: 8px; }
.preco { font-weight: 700; font-size: 15px; font-variant-numeric: tabular-nums; }
.preco small { font-size: 12px; font-weight: 500; color: var(--muted); }
.preco-antigo { color: var(--muted); font-size: 13px; }
.item-serve { font-size: 12px; color: var(--muted); }
.tag {
  font-size: 11px; font-weight: 700; letter-spacing: 0.03em; text-transform: uppercase;
  padding: 3px 8px; border-radius: 6px;
  background: var(--primary-soft); color: var(--primary-ink);
}

.item-midia { position: relative; width: 112px; height: 112px; }
.item-midia img { width: 100%; height: 100%; object-fit: cover; border-radius: 14px; background: var(--surface-2); }
.item.sem-foto .item-midia { width: auto; height: auto; align-self: center; }
.item:not(.sem-foto) .btn-add { position: absolute; right: -6px; bottom: -6px; }

.btn-add {
  position: relative; z-index: 2;
  width: 40px; height: 40px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--primary); color: var(--on-primary);
  border: 3px solid var(--bg);
  box-shadow: 0 6px 16px -6px color-mix(in oklab, var(--primary) 80%, transparent);
  transition: transform 0.15s var(--ease);
}
.card-destaque .btn-add { border-color: var(--surface); }
.btn-add:active { transform: scale(0.9); }
.btn-add.pop { animation: pop 0.35s var(--ease); }
.btn-add-qtd {
  position: absolute; top: -8px; left: -8px;
  min-width: 21px; height: 21px; padding: 0 5px; border-radius: 11px;
  display: grid; place-items: center;
  background: var(--text); color: var(--bg); font-size: 12px; font-weight: 700;
}
@keyframes pop { 40% { transform: scale(1.25); } 100% { transform: scale(1); } }

.item.esgotado .item-texto, .item.esgotado img, .card-destaque.esgotado img { opacity: 0.45; filter: grayscale(1); }
.selo-esgotado {
  display: inline-block; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em;
  background: var(--surface-2); color: var(--muted); padding: 4px 8px; border-radius: 6px;
}
.item:not(.sem-foto) .selo-esgotado { position: absolute; left: 50%; bottom: 8px; transform: translateX(-50%); background: var(--bg); }

/* ---------- Rodapé ---------- */

.rodape {
  padding: 36px 16px calc(120px + env(safe-area-inset-bottom));
  text-align: center; color: var(--muted); font-size: 14px;
  display: grid; gap: 6px; justify-items: center;
}
.rodape strong { color: var(--text); font: 700 18px var(--font-title); }
.rodape-links { display: flex; gap: 18px; margin-top: 6px; }
.rodape-links a { display: inline-flex; gap: 6px; align-items: center; text-decoration: none; font-weight: 600; color: var(--text); }
.rodape-links svg { width: 17px; height: 17px; }
.rodape-nota { font-size: 12px; margin-top: 8px; }
.rodape-credito { font-size: 12px; margin-top: 10px; opacity: 0.8; }

/* ---------- Barra do carrinho ---------- */

.cartbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  padding: 14px 16px calc(12px + env(safe-area-inset-bottom));
  transform: translateY(130%); transition: transform 0.35s var(--ease);
  pointer-events: none;
}
.cartbar::before {
  content: ""; position: absolute; inset: -20px 0 0;
  background: linear-gradient(transparent, color-mix(in oklab, var(--bg) 92%, transparent) 45%);
  z-index: -1;
}
.cartbar.visivel { transform: none; pointer-events: auto; }
.cartbar.pulo .cartbar-btn { animation: pulo 0.4s var(--ease); }
.cartbar-btn {
  max-width: 528px; margin: 0 auto; width: 100%; height: 60px;
  display: flex; align-items: center; gap: 12px; padding: 0 16px 0 10px;
  border-radius: var(--radius); background: var(--primary); color: var(--on-primary);
  font-weight: 700; font-size: 16px;
  box-shadow: 0 14px 30px -10px color-mix(in oklab, var(--primary) 70%, black);
}
.cartbar-qtd {
  min-width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center;
  background: color-mix(in oklab, var(--on-primary) 18%, transparent);
  font-variant-numeric: tabular-nums;
}
.cartbar-rotulo { flex: 1; text-align: left; }
.cartbar-total { font-variant-numeric: tabular-nums; }
@keyframes pulo { 40% { transform: translateY(-6px) scale(1.02); } }

/* ---------- Camadas: folhas e telas ---------- */

#camadas { position: relative; z-index: 50; }
.camada { position: fixed; inset: 0; display: flex; justify-content: center; align-items: flex-end; }
.camada[aria-hidden="true"] { pointer-events: none; }
.fundo-escuro {
  position: absolute; inset: 0; background: rgb(0 0 0 / 0.55);
  opacity: 0; transition: opacity 0.28s;
}
.camada.aberta .fundo-escuro { opacity: 1; }

.folha {
  position: relative; width: 100%; max-width: 560px; max-height: 92dvh; max-height: 92vh;
  display: flex; flex-direction: column;
  background: var(--bg); border-radius: 26px 26px 0 0;
  transform: translateY(100%); transition: transform 0.34s var(--ease);
  outline: none; box-shadow: 0 -10px 40px -10px rgb(0 0 0 / 0.4);
}
@supports (max-height: 92dvh) { .folha { max-height: 92dvh; } }
.camada.aberta .folha { transform: none; }

.folha-topo {
  position: relative; display: grid; grid-template-columns: 40px 1fr 40px; align-items: center;
  padding: 18px 14px 6px; touch-action: none; flex-shrink: 0;
}
.folha-topo h2 { grid-column: 2; text-align: center; font-size: 18px; font-weight: 700; }
.folha-topo .btn-icone { grid-column: 3; }
.folha-alca {
  position: absolute; top: 8px; left: 50%; transform: translateX(-50%);
  width: 42px; height: 5px; border-radius: 3px; background: var(--line);
}
.folha-corpo { flex: 1; overflow-y: auto; padding: 8px 20px 20px; overscroll-behavior: contain; }
.folha-sub { color: var(--muted); font-size: 14px; text-align: center; margin-bottom: 18px; }
.folha-rodape {
  display: flex; gap: 12px; flex-shrink: 0;
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line); background: var(--bg);
}

.btn-icone {
  width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center;
  background: var(--surface); color: var(--text);
}

.btn-primario, .btn-secundario {
  flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 54px; padding: 0 18px; border-radius: 15px;
  font-weight: 700; font-size: 16px; transition: transform 0.12s, opacity 0.2s;
}
.btn-primario { background: var(--primary); color: var(--on-primary); }
.btn-secundario { background: var(--surface-2); color: var(--text); }
.btn-primario:active, .btn-secundario:active { transform: scale(0.98); }
.btn-primario:disabled { opacity: 0.5; }
.btn-grande { height: 56px; }
.btn-texto { display: inline-flex; align-items: center; gap: 6px; padding: 10px 0; font-weight: 600; font-size: 15px; color: var(--primary-ink); }
.btn-texto svg { width: 17px; height: 17px; }
.btn-texto.perigo { color: var(--danger); }

/* ---------- Folha do item ---------- */

.folha-item .folha-fechar { position: absolute; top: 12px; right: 12px; z-index: 3; }
.folha-item.com-foto .folha-fechar { background: rgb(0 0 0 / 0.45); color: #fff; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.fi-foto {
  flex-shrink: 0; height: min(34vh, 300px); overflow: hidden;
  border-radius: 26px 26px 0 0; touch-action: none; background: var(--surface-2);
}
.fi-foto img { width: 100%; height: 100%; object-fit: cover; }
.folha-item.com-foto .folha-corpo { padding-top: 18px; }
.folha-item:not(.com-foto) .fi-nome { padding-right: 44px; }
.fi-nome { font: 700 27px/1.1 var(--font-title); letter-spacing: -0.01em; }
.fi-desc { color: var(--muted); margin-top: 8px; font-size: 15px; }
.fi-meta { margin: 12px 0 20px; }
.fi-meta .preco { font-size: 18px; }

.grupo { border: 0; padding: 0; margin: 0 0 20px; min-width: 0; }
.grupo legend {
  display: flex; flex-wrap: wrap; align-items: center; gap: 2px 10px; width: 100%;
  padding: 12px 14px; margin-bottom: 4px; border-radius: var(--radius-sm); background: var(--surface);
}
.grupo-nome { font-weight: 700; font-size: 15px; }
.grupo-regra { font-size: 12px; color: var(--muted); }
.selo-obrig {
  margin-left: auto; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em;
  background: var(--text); color: var(--bg); padding: 4px 8px; border-radius: 6px;
}
.grupo.ok .selo-obrig { background: var(--ok); color: #fff; font-size: 0; }
.grupo.ok .selo-obrig::after { content: "✓ Ok"; font-size: 11px; }
.grupo.tremer { animation: tremer 0.4s; }
.grupo.tremer legend { box-shadow: inset 0 0 0 2px var(--danger); }
@keyframes tremer { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }

.escolha {
  position: relative; display: grid; grid-template-columns: 24px 1fr auto; gap: 12px; align-items: center;
  min-height: 54px; padding: 10px 6px; border-bottom: 1px solid var(--line); cursor: pointer;
}
.escolha:last-child { border-bottom: 0; }
.escolha input { position: absolute; opacity: 0; pointer-events: none; }
.escolha-marca {
  width: 24px; height: 24px; border-radius: 7px; border: 2px solid var(--line);
  display: grid; place-items: center; transition: background 0.15s, border-color 0.15s;
}
.escolha.unica .escolha-marca { border-radius: 50%; }
.escolha-marca svg { width: 15px; height: 15px; stroke-width: 3; color: var(--on-primary); transform: scale(0); transition: transform 0.15s var(--ease); }
.escolha input:checked + .escolha-marca { background: var(--primary); border-color: var(--primary); }
.escolha input:checked + .escolha-marca svg { transform: scale(1); }
.escolha input:focus-visible + .escolha-marca { outline: 3px solid color-mix(in oklab, var(--primary) 60%, transparent); outline-offset: 2px; }
.escolha-nome { font-size: 15px; }
.escolha-preco { font-size: 14px; color: var(--muted); font-variant-numeric: tabular-nums; }
.escolha:has(input:disabled:not(:checked)) { opacity: 0.45; cursor: default; }

.obs { display: block; margin-top: 4px; }
.obs-rotulo { display: block; font-weight: 700; font-size: 15px; margin-bottom: 8px; }
.obs-rotulo small, .campo small { font-weight: 500; color: var(--muted); font-size: 13px; }
textarea, .campo input {
  width: 100%; padding: 12px 14px; border-radius: var(--radius-sm);
  border: 1.5px solid var(--line); background: var(--surface); color: var(--text);
  font: 16px/1.4 var(--font-body); resize: none; outline: none; transition: border-color 0.15s;
}
textarea:focus, .campo input:focus { border-color: var(--primary); }
.obs-cont { display: block; text-align: right; font-size: 12px; color: var(--muted); margin-top: 4px; }

.stepper {
  display: flex; align-items: center; flex-shrink: 0;
  background: var(--surface); border-radius: 15px; height: 56px;
}
.stepper button { width: 46px; height: 100%; display: grid; place-items: center; }
.stepper output { min-width: 26px; text-align: center; font-weight: 700; font-size: 17px; font-variant-numeric: tabular-nums; }
.stepper-mini { height: 36px; border-radius: 11px; }
.stepper-mini button { width: 34px; }
.stepper-mini svg { width: 16px; height: 16px; }
.stepper-mini output { font-size: 15px; min-width: 20px; }

.fi-add { justify-content: space-between; }
.fi-add.incompleto { opacity: 0.6; }
.fi-add strong { font-variant-numeric: tabular-nums; }

/* ---------- Carrinho ---------- */

.linha-mesa {
  width: 100%; display: flex; align-items: center; gap: 10px;
  padding: 13px 14px; border-radius: var(--radius-sm);
  background: var(--primary-soft); font-size: 15px; text-align: left;
}
.linha-mesa em { margin-left: auto; font-style: normal; font-size: 13px; font-weight: 700; color: var(--primary-ink); }
.linhas { list-style: none; margin: 6px 0 0; padding: 0; }
.linha { display: grid; grid-template-columns: 1fr auto; gap: 12px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.linha-nome { font-size: 16px; font-weight: 650; text-align: left; line-height: 1.3; }
.linha-extra { font-size: 13px; color: var(--muted); margin-top: 3px; }
.linha-extra span { font-weight: 600; }
.linha-obs { font-size: 13px; color: var(--primary-ink); font-style: italic; margin-top: 4px; }
.linha-lado { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.linha-total { font-variant-numeric: tabular-nums; font-size: 15px; }
.carrinho-acoes { display: flex; justify-content: space-between; margin: 4px 0 10px; }

.totais { background: var(--surface); border-radius: 16px; padding: 14px 16px; display: grid; gap: 6px; }
.totais > div { display: flex; justify-content: space-between; font-variant-numeric: tabular-nums; }
.totais-taxa { color: var(--muted); font-size: 14px; }
.totais-final { border-top: 1px dashed var(--line); padding-top: 8px; margin-top: 2px; }

.historico { margin-top: 26px; }
.historico h3 { font-size: 12px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); margin-bottom: 10px; }
.historico ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.historico button {
  width: 100%; display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center;
  padding: 12px 14px; border-radius: var(--radius-sm); background: var(--surface); text-align: left;
}
.h-num { font-weight: 800; letter-spacing: 0.04em; }
.h-info { font-size: 13px; color: var(--muted); }
.h-status { font-size: 12px; font-weight: 700; color: var(--ok); }

.vazio { text-align: center; padding: 36px 20px 20px; color: var(--muted); display: grid; gap: 6px; justify-items: center; }
.vazio strong { color: var(--text); font-size: 17px; }
.vazio-icone { width: 72px; height: 72px; border-radius: 50%; background: var(--surface); display: grid; place-items: center; margin-bottom: 8px; color: var(--text); }
.vazio-icone svg { width: 30px; height: 30px; }

/* ---------- Mesa ---------- */

.grade-mesas { display: grid; grid-template-columns: repeat(auto-fill, minmax(62px, 1fr)); gap: 10px; padding-bottom: 8px; }
.grade-mesas button {
  aspect-ratio: 1; border-radius: 16px; background: var(--surface);
  font: 700 21px/1 var(--font-title); font-variant-numeric: tabular-nums;
}
.grade-mesas button.ativa { background: var(--primary); color: var(--on-primary); }
.mesa-livre { display: flex; gap: 10px; }
.mesa-livre input {
  flex: 1; min-width: 0; height: 56px; border-radius: 15px; text-align: center;
  border: 1.5px solid var(--line); background: var(--surface); color: var(--text); font: 700 22px var(--font-body);
}

/* ---------- Confirmação (centralizada) ---------- */

.camada-centro { align-items: center; }
.folha-confirmar {
  width: calc(100% - 32px); max-width: 400px; border-radius: 24px; padding: 26px 20px 20px;
  transform: scale(0.94); opacity: 0; transition: transform 0.25s var(--ease), opacity 0.2s;
}
.camada.aberta .folha-confirmar { transform: none; opacity: 1; }
.folha-confirmar h2 { font-size: 20px; }
.folha-confirmar p { color: var(--muted); margin-top: 8px; }
.confirmar-botoes { display: flex; gap: 10px; margin-top: 22px; }

/* ---------- Telas cheias ---------- */

.camada-tela { align-items: stretch; }
.camada-tela::before {
  content: ""; position: absolute; inset: 0; background: rgb(0 0 0 / 0.55);
  opacity: 0; transition: opacity 0.25s;
}
.camada-tela.aberta::before { opacity: 1; }
.tela {
  position: relative; width: 100%; max-width: 560px; height: 100%; overflow-y: auto;
  background: var(--bg); outline: none; overscroll-behavior: contain;
  transform: translateY(28px); opacity: 0; transition: transform 0.32s var(--ease), opacity 0.25s;
}
.camada.aberta .tela { transform: none; opacity: 1; }

.tg-topo {
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  padding: calc(10px + env(safe-area-inset-top)) 12px 10px;
}
.tg-voltar { display: inline-flex; align-items: center; gap: 2px; font-weight: 600; font-size: 15px; justify-self: start; padding: 8px 4px; }
.tg-loja { font-size: 14px; font-weight: 700; opacity: 0.6; }
.tg-zoom { justify-self: end; width: 42px; height: 42px; border-radius: 50%; background: #fff; font-weight: 800; box-shadow: 0 2px 8px rgb(0 0 0 / 0.08); }

/* Tela do garçom: sempre papel claro de alto contraste, independente do tema */
.tela-garcom { background: #efece6; color: #111; color-scheme: light; }
.tg-papel {
  margin: 4px 14px 0; background: #fff; border-radius: 22px; padding: 20px 18px;
  border-top: 8px solid var(--primary); box-shadow: 0 16px 40px -20px rgb(0 0 0 / 0.35);
}
.tg-cabecalho {
  display: grid; grid-template-columns: auto 1fr; gap: 16px; align-items: center;
  padding-bottom: 16px; border-bottom: 2px dashed #d9d4cb;
}
.tg-mesa { background: #111; color: #fff; border-radius: 18px; padding: 10px 20px 12px; text-align: center; min-width: 104px; }
.tg-mesa small, .tg-pedido small { display: block; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.14em; }
.tg-mesa small { opacity: 0.7; }
.tg-mesa strong { display: block; font: 800 60px/1 var(--font-title); font-variant-numeric: tabular-nums; }
.tg-pedido small { color: #777; }
.tg-pedido strong { display: block; font-size: 32px; font-weight: 800; letter-spacing: 0.06em; line-height: 1.15; }
.tg-pedido span { font-size: 14px; color: #555; }
.tg-itens { list-style: none; margin: 6px 0 0; padding: 0; }
.tg-itens > li { display: grid; grid-template-columns: 54px 1fr; gap: 6px; padding: 14px 0; border-bottom: 1px solid #ece8e1; }
.tg-qtd { font-size: 27px; font-weight: 800; line-height: 1.1; font-variant-numeric: tabular-nums; }
.tg-itens strong { font-size: 22px; line-height: 1.2; }
.tg-extras { list-style: none; margin: 4px 0 0; padding: 0; font-size: 17px; color: #222; }
.tg-extras span { color: #777; font-weight: 600; }
.tg-obs { margin-top: 8px; background: #fff1a8; padding: 8px 10px; border-radius: 8px; font-size: 17px; }
.tg-obs b { text-transform: uppercase; }
.tg-total { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; padding-top: 14px; }
.tg-total span { font-size: 18px; font-weight: 600; }
.tg-total strong { font-size: 30px; font-weight: 800; font-variant-numeric: tabular-nums; }
.tg-total small { width: 100%; text-align: right; font-size: 14px; color: #666; margin-top: 2px; }
.tg-dica { display: flex; justify-content: center; align-items: center; gap: 8px; color: #555; font-size: 15px; margin: 16px; }
.tg-rodape {
  position: sticky; bottom: 0; padding: 18px 14px calc(14px + env(safe-area-inset-bottom));
  background: linear-gradient(transparent, #efece6 35%);
}
.btn-garcom {
  width: 100%; height: 60px; border-radius: 18px; background: #111; color: #fff;
  display: flex; align-items: center; justify-content: center; gap: 10px; font-size: 17px; font-weight: 700;
}
.btn-garcom svg { color: #4ade80; stroke-width: 3; }
.tela-garcom.maior .tg-itens strong { font-size: 28px; }
.tela-garcom.maior .tg-qtd { font-size: 33px; }
.tela-garcom.maior .tg-extras, .tela-garcom.maior .tg-obs { font-size: 21px; }
.tela-garcom.maior .tg-mesa strong { font-size: 76px; }

.tela-sucesso {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 12px; padding: 32px 24px; text-align: center;
}
.sucesso-check {
  width: 104px; height: 104px; border-radius: 50%; background: var(--ok); color: #fff;
  display: grid; place-items: center; margin-bottom: 8px;
  animation: pop 0.5s 0.1s var(--ease) both;
}
.sucesso-check svg { width: 52px; height: 52px; stroke-width: 3; stroke-dasharray: 30; stroke-dashoffset: 30; animation: tracar 0.45s 0.35s forwards; }
@keyframes tracar { to { stroke-dashoffset: 0; } }
.tela-sucesso h2 { font: 700 32px/1.1 var(--font-title); }
.tela-sucesso p { color: var(--muted); max-width: 340px; font-size: 16px; }
.tela-sucesso .btn-primario { flex: none; width: min(100%, 320px); margin-top: 20px; }

.tela-acompanhar .tg-voltar { color: var(--text); }
.acomp-corpo { padding: 20px 22px 40px; }
.acomp-num { color: var(--muted); }
.acomp-num strong { color: var(--text); letter-spacing: 0.05em; }
.acomp-corpo h2 { font: 700 34px/1.1 var(--font-title); margin-top: 6px; }
.acomp-sub { color: var(--muted); margin-top: 6px; }
.passos { list-style: none; padding: 0; margin: 30px 0 0; }
.passos li { position: relative; display: grid; grid-template-columns: 36px 1fr auto; gap: 14px; align-items: center; padding: 12px 0; color: var(--muted); font-weight: 600; }
.passos li:not(:last-child)::after {
  content: ""; position: absolute; left: 17px; top: 46px; height: calc(100% - 34px); width: 2px; background: var(--line);
}
.passos li.feito:not(:last-child)::after { background: var(--ok); }
.passo-bola {
  width: 36px; height: 36px; border-radius: 50%; border: 2px solid var(--line); background: var(--bg);
  display: grid; place-items: center; color: #fff;
}
.passo-bola svg { width: 18px; height: 18px; stroke-width: 3; }
.passos li.feito, .passos li.atual { color: var(--text); }
.passos li.feito .passo-bola { background: var(--ok); border-color: var(--ok); }
.passos li.atual .passo-bola { background: var(--primary); border-color: var(--primary); color: var(--on-primary); animation: anel 1.6s infinite; }
.passos small { font-weight: 500; font-variant-numeric: tabular-nums; }
@keyframes anel {
  0% { box-shadow: 0 0 0 0 color-mix(in oklab, var(--primary) 55%, transparent); }
  80%, 100% { box-shadow: 0 0 0 12px transparent; }
}
.acomp-demo { margin-top: 34px; padding: 14px 16px; border-radius: var(--radius-sm); background: var(--surface); color: var(--muted); font-size: 14px; }
.acomp-demo a { color: var(--primary-ink); font-weight: 700; }

/* ---------- Busca ---------- */

.busca-topo {
  position: sticky; top: 0; z-index: 3; display: flex; gap: 8px; align-items: center;
  padding: calc(10px + env(safe-area-inset-top)) 12px 10px; background: var(--bg); border-bottom: 1px solid var(--line);
}
.busca-topo input {
  flex: 1; min-width: 0; height: 46px; border-radius: 13px; border: 0; outline: none;
  background: var(--surface); color: var(--text); padding: 0 14px; font: 16px var(--font-body);
}
.busca-resultados { padding: 0 16px 40px; }
.busca-dica { color: var(--muted); text-align: center; padding: 32px 0; }

/* ---------- Encomenda ---------- */

.campo { display: block; border: 0; padding: 0; margin: 0 0 20px; min-width: 0; }
.campo > span, .campo legend { display: block; font-weight: 700; font-size: 15px; margin-bottom: 8px; padding: 0; }
.campo input { height: 52px; }
.campo small { display: block; margin-top: 6px; }
.campo > span small { display: inline; margin: 0 0 0 4px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip input { position: absolute; opacity: 0; pointer-events: none; }
.chip span {
  display: inline-block; padding: 10px 14px; border-radius: 12px; border: 1.5px solid var(--line);
  background: var(--surface); font-size: 14px; font-weight: 600; cursor: pointer; font-variant-numeric: tabular-nums;
}
.chip input:checked + span { background: var(--primary); color: var(--on-primary); border-color: var(--primary); }
.chip input:focus-visible + span { outline: 3px solid color-mix(in oklab, var(--primary) 60%, transparent); outline-offset: 2px; }
.enc-resumo { text-align: right; color: var(--muted); }
.btn-whats { background: #128c4a; color: #fff; }

/* ---------- Informações ---------- */

.folha-info .folha-corpo > .pill { margin: 0 auto; display: flex; width: fit-content; }
.info-bloco { margin-top: 22px; }
.info-bloco h3 {
  display: flex; gap: 8px; align-items: center; margin-bottom: 8px;
  font-size: 12px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted);
}
.info-bloco h3 svg { width: 16px; height: 16px; }
.horarios { width: 100%; border-collapse: collapse; font-size: 15px; }
.horarios tr { border-bottom: 1px solid var(--line); }
.horarios th { text-align: left; font-weight: 500; padding: 9px 0; text-transform: capitalize; }
.horarios td { text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; }
.horarios tr.hoje th, .horarios tr.hoje td { color: var(--text); font-weight: 700; }
.info-links { display: grid; }
.info-links a { display: flex; gap: 12px; align-items: center; padding: 13px 0; border-bottom: 1px solid var(--line); text-decoration: none; }
.pix { width: 100%; display: flex; align-items: center; gap: 10px; padding: 13px 14px; border-radius: var(--radius-sm); background: var(--surface); font-weight: 600; }
.pix code { flex: 1; text-align: left; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }

/* ---------- Erro ---------- */

.erro-config { padding: 64px 24px; text-align: center; display: grid; gap: 12px; justify-items: center; }
.erro-icone { width: 76px; height: 76px; border-radius: 50%; background: var(--surface); display: grid; place-items: center; }
.erro-icone svg { width: 34px; height: 34px; }
.erro-config p { color: var(--muted); }
.erro-lista { text-align: left; background: #fff1ee; color: #8a1c10; border-radius: 12px; padding: 14px 16px; font-size: 13px; width: 100%; }
.erro-lista ul { margin: 6px 0 0; padding-left: 18px; }
.erro-config .btn-primario { flex: none; width: 220px; margin-top: 8px; }

/* ---------- Toast ---------- */

.toast {
  position: fixed; left: 50%; bottom: calc(96px + env(safe-area-inset-bottom)); z-index: 100;
  transform: translate(-50%, 16px); opacity: 0; pointer-events: none;
  max-width: calc(100% - 32px); width: max-content;
  padding: 12px 18px; border-radius: 14px; background: var(--text); color: var(--bg);
  font-size: 14px; font-weight: 600; box-shadow: var(--shadow);
  transition: opacity 0.2s, transform 0.25s var(--ease);
}
.toast.visivel { opacity: 1; transform: translate(-50%, 0); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}

/* ---------- V2: abas, comanda da mesa ---------- */

.pill-alerta { background: color-mix(in oklab, var(--danger) 18%, var(--bg)); color: var(--danger); }
.pill-mesa svg { width: 15px; height: 15px; }
div.linha-mesa { cursor: default; }

.abas {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 31;
  display: grid; grid-template-columns: 1fr 1fr;
  padding: 6px max(10px, calc(50% - 270px)) calc(6px + env(safe-area-inset-bottom));
  background: color-mix(in oklab, var(--bg) 94%, transparent);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid var(--line);
}
.aba {
  position: relative; display: grid; justify-items: center; gap: 2px;
  padding: 6px 0; border-radius: 12px; color: var(--muted); font-size: 12px; font-weight: 700;
}
.aba svg { width: 22px; height: 22px; }
.aba.ativa { color: var(--primary-ink); }
.aba.ativa::before {
  content: ""; position: absolute; top: -6px; left: 30%; right: 30%; height: 3px;
  border-radius: 0 0 3px 3px; background: var(--primary);
}
.aba-badge {
  position: absolute; top: 2px; left: calc(50% + 8px); min-width: 19px; height: 19px; padding: 0 5px;
  border-radius: 10px; background: var(--primary); color: var(--on-primary);
  font-size: 11px; line-height: 19px; text-align: center;
}
body.com-abas .cartbar { bottom: calc(62px + env(safe-area-inset-bottom)); padding-bottom: 10px; }
body.com-abas .toast { bottom: calc(150px + env(safe-area-inset-bottom)); }
body.com-abas .rodape { padding-bottom: calc(180px + env(safe-area-inset-bottom)); }
body.aba-mesa .cats, body.aba-mesa #menu, body.aba-mesa .rodape,
body.aba-mesa .aviso-fechado, body.aba-mesa #sentinela-cats { display: none; }

.minha-mesa {
  max-width: 560px; margin: 0 auto;
  padding: 18px 16px calc(170px + env(safe-area-inset-bottom));
}
.mm-cabeca {
  display: grid; grid-template-columns: auto 1fr; align-items: baseline; column-gap: 10px;
  padding: 18px; border-radius: var(--radius); background: var(--primary); color: var(--on-primary);
  margin-bottom: 16px;
}
.mm-cabeca span { font-size: 13px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.1em; opacity: 0.8; }
.mm-cabeca strong { font: 700 44px/1 var(--font-title); }
.mm-cabeca p { grid-column: 1 / -1; font-size: 13px; font-weight: 600; opacity: 0.85; margin-top: 6px; }
.mm-entrar { width: 100%; margin-bottom: 16px; }

.mm-pessoa {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px; margin-bottom: 12px;
}
.mm-pessoa.eu { border-color: color-mix(in oklab, var(--primary) 55%, var(--line)); }
.mm-pessoa header { display: flex; align-items: center; gap: 10px; }
.mm-avatar {
  width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; flex: none;
  background: var(--primary-soft); color: var(--primary-ink); font-weight: 800;
}
.mm-pessoa h3 { flex: 1; font-size: 16px; }
.mm-pessoa h3 em {
  font-style: normal; font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.06em;
  background: var(--primary); color: var(--on-primary); padding: 2px 6px; border-radius: 6px; margin-left: 6px; vertical-align: 2px;
}
.mm-pessoa header strong { font-variant-numeric: tabular-nums; font-size: 16px; }
.mm-nada { color: var(--muted); font-size: 14px; margin-top: 10px; }
.mm-pedidos { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 10px; }
.mm-pedido { border-top: 1px dashed var(--line); padding-top: 10px; }
.mm-pedido.cancelado { opacity: 0.55; }
.mm-pedido.cancelado .mm-itens { text-decoration: line-through; }
.mm-pedido-topo { width: 100%; display: flex; align-items: center; gap: 8px; text-align: left; }
.mm-num { flex: 1; font-size: 12px; font-weight: 700; color: var(--muted); letter-spacing: 0.03em; }
.mm-status { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.05em; padding: 4px 8px; border-radius: 7px; background: var(--surface-2); }
.st-novo { background: var(--primary-soft); color: var(--primary-ink); }
.st-preparo { background: color-mix(in oklab, #f5b83d 22%, var(--bg)); color: color-mix(in oklab, #c88a0a 80%, var(--text)); }
.st-pronto, .st-entregue { background: color-mix(in oklab, var(--ok) 18%, var(--bg)); color: var(--ok); }
.st-cancelado { color: var(--danger); }
.mm-itens { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 8px; }
.mm-itens > li { display: grid; grid-template-columns: 30px 1fr auto; gap: 6px; font-size: 14px; }
.mm-qtd { font-weight: 800; color: var(--muted); }
.mm-itens strong { display: block; }
.mm-itens small { display: block; color: var(--muted); font-size: 12.5px; }
.mm-itens .mm-obs { color: var(--primary-ink); }
.mm-valor { font-variant-numeric: tabular-nums; font-weight: 600; }
.mm-totais { margin-top: 18px; }
.mm-nota { text-align: center; color: var(--muted); font-size: 13px; margin-top: 14px; }
.mm-vazio { text-align: center; display: grid; gap: 10px; justify-items: center; padding: 30px 8px; }
.mm-vazio h2 { font: 700 22px/1.2 var(--font-title); }
.mm-vazio p { color: var(--muted); max-width: 360px; }
.mm-vazio .btn-primario { width: min(100%, 320px); flex: none; margin-top: 8px; }

.folha-nome .folha-sub strong { color: var(--text); }
.nome-rotulo { font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); margin: 18px 0 8px; }
.nome-lista { display: flex; flex-wrap: wrap; gap: 8px; }
.nome-chip { padding: 10px 16px; border-radius: 999px; background: var(--surface-2); font-weight: 700; }
.nome-chip:active { background: var(--primary); color: var(--on-primary); }
.nome-form { display: grid; gap: 12px; margin-top: 12px; }
.nome-form .btn-primario { flex: none; }
.acomp-mesa { margin-top: 26px; width: 100%; flex: none; }

/* ---------- V2: código da mesa ---------- */
.st-aguardando { background: color-mix(in oklab, #f5b83d 22%, var(--bg)); color: color-mix(in oklab, #c88a0a 80%, var(--text)); }
.mm-aviso {
  display: flex; gap: 10px; align-items: flex-start; margin-bottom: 14px; padding: 12px 14px;
  border-radius: var(--radius-sm); font-size: 14px;
  background: color-mix(in oklab, #f5b83d 16%, var(--bg)); border: 1px solid color-mix(in oklab, #f5b83d 40%, var(--line));
}
.mm-aviso svg { width: 20px; height: 20px; flex: none; margin-top: 1px; }
.mm-codigo {
  display: grid; gap: 14px; margin-bottom: 14px; padding: 16px; border-radius: var(--radius);
  background: var(--surface); border: 1.5px dashed color-mix(in oklab, var(--primary) 55%, var(--line));
}
.mm-codigo span { font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); }
.mm-codigo strong { display: block; font: 700 40px/1.1 var(--font-title); letter-spacing: 0.18em; color: var(--primary-ink); margin: 2px 0 4px; }
.mm-codigo p { font-size: 13px; color: var(--muted); }
.mm-codigo-botoes { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.mm-codigo-botoes > * { height: 46px; font-size: 14px; text-decoration: none; }
.mm-codigo-botoes svg { width: 18px; height: 18px; }
.nome-form .campo { display: grid; gap: 6px; }
.nome-form .campo > span { font-size: 14px; font-weight: 700; }
.input-codigo { font: 700 28px/1 var(--font-body) !important; letter-spacing: 0.5em; text-align: center; }
.nome-erro { min-height: 20px; color: var(--danger); font-size: 14px; font-weight: 600; text-align: center; }
.folha-codigo { text-align: center; }
.fc-rotulo { font-weight: 700; color: var(--muted); }
.fc-codigo { display: block; font: 700 56px/1 var(--font-title); letter-spacing: 0.2em; color: var(--primary-ink); margin: 8px 0 6px; }
.folha-codigo .confirmar-botoes a { text-decoration: none; }
.folha-codigo .confirmar-botoes svg { width: 18px; height: 18px; }
