/* MenuAR — protótipo. Direção visual: ver docs/design/DESIGN_DIRECTION.md.
   As cores vêm do restaurante (menu.json → restaurant.theme); sem tema, vale o padrão "Brasa & Creme". */

@font-face {
  font-family: "Big Shoulders";
  src: url("fonts/big-shoulders-display-latin-wght.woff2") format("woff2");
  font-weight: 100 900; font-display: swap;
}

:root {
  --accent: var(--brand, #C2410C); /* brasa; --brand vem do restaurante */
  --accent-ink: #FFFFFF;
  --accent-soft: color-mix(in oklab, var(--accent) 12%, transparent);
  --mustard: #F5A524;
  --bg: #FBF6EF;                /* creme */
  --surface: #FFFFFF;
  --surface-2: #F4ECE1;
  --ink: #1E1714;               /* espresso */
  --ink-2: #5E524A;
  --line: #E8DDD0;
  --off: #9F1239;
  --off-bg: #FFE4E6;
  --stage-1: #4A3328;
  --stage-2: #1C1411;
  --stage-ink: #F6EFE7;
  --shadow: 0 1px 2px rgba(30, 23, 20, .06), 0 6px 20px rgba(30, 23, 20, .07);
  --radius: 18px;
  --tap: 48px;
  --display: "Big Shoulders", "Arial Narrow", var(--font);
  --font: ui-rounded, "SF Pro Rounded", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --accent: color-mix(in oklab, var(--brand, #C2410C) 58%, #FFB38A); /* mais claro para manter contraste ≥ 4,5 */
    --accent-ink: #1E1714;
    --bg: #14100E;
    --surface: #1E1815;
    --surface-2: #2A221E;
    --ink: #F6EFE7;
    --ink-2: #BFB2A6;
    --line: #3A302A;
    --off: #FDA4AF;
    --off-bg: #3B1219;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 72px; }
/* Com o prato ou as dicas abertos, o cardápio atrás não rola */
html:has(dialog[open]) { overflow: hidden; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.45 var(--font);
  -webkit-font-smoothing: antialiased;
}

:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 8px; }
/* Títulos que recebem foco por script (ao abrir o prato ou escolher categoria): sem anel ao tocar/clicar */
[tabindex="-1"]:focus:not(:focus-visible) { outline: none; }
#dish-name:focus { outline: none; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
svg { width: 20px; height: 20px; flex: none; }
h1, h2, h3 { letter-spacing: -0.015em; }

/* ---------- Botões ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 52px; padding: 0 22px;
  border: 1px solid transparent; border-radius: 999px;
  font: inherit; font-weight: 700; font-size: 16px; cursor: pointer;
  transition: transform .12s ease, filter .12s ease;
}
.btn:active { transform: scale(.97); }
.btn-primary { background: var(--accent); color: var(--accent-ink); box-shadow: 0 6px 18px color-mix(in oklab, var(--accent) 35%, transparent); }
.btn-primary:hover { filter: brightness(1.05); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .75; cursor: progress; transform: none; }
.btn.is-loading svg { animation: pulse 1.1s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .35; } }

.icon-btn {
  display: grid; place-items: center;
  width: var(--tap); height: var(--tap);
  border: 0; border-radius: 50%; padding: 0;
  background: transparent; color: inherit; cursor: pointer;
}

/* ---------- Aviso de navegador dentro de app ---------- */
.banner {
  display: flex; gap: 10px; align-items: center;
  padding: 10px 8px 10px 16px;
  background: var(--mustard); color: #1E1714;
  font-size: 14px;
}
.banner p { margin: 0; flex: 1; }
.banner .ico { width: 24px; height: 24px; }

/* ---------- Topo + vitrine ----------
   O palco escuro do topo é o elemento marcante da página. O resto fica quieto, como um quadro de cardápio. */
.hero {
  position: relative; overflow: hidden;
  background: radial-gradient(120% 80% at 50% 60%, var(--stage-1), var(--stage-2) 75%);
  color: var(--stage-ink);
  border-radius: 0 0 28px 28px;
  padding-top: env(safe-area-inset-top);
}
.top { display: flex; align-items: center; gap: 12px; padding: 16px 16px 4px; position: relative; z-index: 2; }
.logo {
  width: 44px; height: 44px; border-radius: 50%; flex: none;
  display: grid; place-items: center;
  background: var(--stage-ink); color: var(--stage-2);
  font: 800 22px/1 var(--display);
}
.top-text { flex: 1; min-width: 0; }
.top h1 { margin: 0; font: 800 26px/1 var(--display); letter-spacing: .01em; }
.tagline { margin: 3px 0 0; font-size: 13px; color: color-mix(in oklab, var(--stage-ink) 78%, transparent); }
.table-chip {
  flex: none; padding: 6px 12px; border-radius: 999px;
  border: 1px solid color-mix(in oklab, var(--stage-ink) 35%, transparent);
  font-size: 13px; font-weight: 700;
}

.showcase { position: relative; padding-bottom: 14px; }
.showcase-track {
  display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none;
  overscroll-behavior-x: contain;
}
.showcase-track::-webkit-scrollbar { display: none; }
.slide {
  position: relative; flex: 0 0 100%; scroll-snap-align: center;
  display: grid; grid-template-rows: 1fr auto;
  height: min(60dvh, 470px); min-height: 380px;
  padding: 0 16px;
}
/* Nome do prato gigante, atrás da foto: a tipografia faz o papel de letreiro */
.slide-word {
  position: absolute; inset: 2% 8px auto; margin: 0;
  font: 900 clamp(88px, 30vw, 190px)/.78 var(--display);
  letter-spacing: -.01em; text-transform: uppercase;
  color: color-mix(in oklab, var(--stage-ink) 11%, transparent);
  overflow-wrap: anywhere; pointer-events: none; user-select: none;
}
.slide-plate {
  position: relative; display: grid; place-items: center; min-height: 0;
  padding: 0; border: 0; background: none; color: inherit; cursor: pointer;
}
.slide-plate:focus-visible { outline-color: var(--stage-ink); }
.btn-stage:focus-visible { outline-color: var(--stage-ink); }
/* No palco escuro, o anel de foco usa a cor clara do palco (a cor de destaque pode sumir no fundo) */
.hero :focus-visible, .stage :focus-visible { outline-color: var(--stage-ink); }
.slide-plate::after { /* sombra no balcão */
  content: ""; position: absolute; left: 22%; right: 22%; bottom: 9%; height: 9%;
  background: radial-gradient(closest-side, rgba(0,0,0,.45), transparent);
}
.slide-plate img {
  position: relative; z-index: 1;
  width: min(78%, 330px); height: 100%; max-height: 300px; object-fit: contain;
  filter: drop-shadow(0 18px 22px rgba(0,0,0,.4));
}
.slide.is-first .slide-plate img { animation: plate-in .9s cubic-bezier(.2,.8,.2,1) both .1s; }
@keyframes plate-in { from { opacity: 0; transform: translateY(18px) scale(.9) rotate(-8deg); } }
.slide-info { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; padding-bottom: 6px; }
.slide-info h2 { margin: 0; font: 800 36px/.95 var(--display); }
.slide-info .price { display: block; margin-top: 6px; font-size: 17px; color: color-mix(in oklab, var(--stage-ink) 85%, transparent); }
.btn-stage {
  flex: none; min-height: 48px; padding: 0 18px;
  background: var(--stage-ink); color: var(--stage-2);
}
.slide.is-off .slide-plate img { filter: grayscale(1) opacity(.6); }
.slide.is-off .price { text-decoration: line-through; }
.tag-stage { margin-top: 8px; }
@media (hover: hover) {
  .slide-plate img { transition: transform .35s cubic-bezier(.2,.8,.2,1); }
  .slide-plate:hover img { transform: translateY(-4px) scale(1.02); }
  .btn-stage:hover { filter: brightness(.95); }
}

.dots { display: flex; justify-content: center; }
.dots button { /* ponto pequeno, área de toque de 44 px */
  width: 44px; height: 44px; padding: 0; border: 0; background: none; cursor: pointer;
  display: grid; place-items: center; border-radius: 50%;
}
.dots button::before {
  content: ""; width: 8px; height: 8px; border-radius: 4px;
  background: color-mix(in oklab, var(--stage-ink) 50%, transparent);
  transition: width .2s, background .2s;
}
.dots button[aria-current="true"]::before { width: 20px; background: var(--stage-ink); }

/* ---------- Categorias ---------- */
.tabs {
  position: sticky; top: 0; z-index: 5;
  display: flex; gap: 22px; overflow-x: auto; scrollbar-width: none;
  padding: 4px 16px 0;
  background: var(--bg);
  border-bottom: 1px solid transparent;
  transition: border-color .2s;
}
.tabs.is-stuck { border-bottom-color: var(--line); }
.tabs::-webkit-scrollbar { display: none; }
.tabs a {
  position: relative; flex: none; display: inline-flex; align-items: center;
  min-height: 52px; padding: 0 2px;
  color: var(--ink-2); text-decoration: none;
  font: 700 23px/1 var(--display); letter-spacing: .01em;
}
.tabs a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 6px; height: 3px; border-radius: 2px;
  background: var(--accent); transform: scaleX(0); transition: transform .2s;
}
.tabs a[aria-current="true"] { color: var(--ink); }
.tabs a[aria-current="true"]::after { transform: scaleX(1); }

/* ---------- Conteúdo ---------- */
main { max-width: 760px; margin: 0 auto; padding: 0 0 24px; }
/* Estados da página: carregando (esqueleto), erro e cardápio vazio */
.skeleton { padding: 28px 16px 0; }
.sk { display: block; border-radius: 8px; background: var(--surface-2); animation: sk-pulse 1.4s ease-in-out infinite; }
.sk-title { width: 45%; height: 38px; margin-bottom: 12px; }
.sk-row { display: grid; grid-template-columns: 1fr 92px; gap: 16px; align-items: center; padding: 16px 0; border-bottom: 1px solid var(--line); }
.sk-lines { display: grid; gap: 10px; }
.sk-line { height: 16px; }
.sk-line.short { width: 70%; height: 12px; }
.sk-thumb { width: 92px; height: 92px; border-radius: 22px; }
@keyframes sk-pulse { 50% { opacity: .55; } }

.state {
  display: grid; justify-items: center; gap: 8px; text-align: center;
  margin: 32px 16px; padding: 28px 20px; border-radius: var(--radius);
  background: var(--surface); box-shadow: var(--shadow); color: var(--ink);
}
.state > svg { width: 40px; height: 40px; color: var(--accent); }
.state-error > svg { color: var(--off); }
.state h2 { margin: 4px 0 0; font: 800 30px/1.05 var(--display); }
.state p { margin: 0 0 8px; color: var(--ink-2); max-width: 32ch; }

.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 0 16px; margin: 28px 0 4px; }
.section-head h2 { margin: 0; font: 800 42px/1 var(--display); letter-spacing: 0; }
.section-head .count { color: var(--ink-2); font-size: 14px; }

/* Lista em formato de quadro de cardápio: nome ····· preço */
.list { list-style: none; margin: 0; padding: 0 16px; }
.item {
  position: relative;
  display: grid; grid-template-columns: 1fr 92px; gap: 16px; align-items: center;
  min-height: 72px; padding: 16px 0; margin: 0;
  border-bottom: 1px solid var(--line);
}
.item:last-child { border-bottom: 0; }
.item.no-photo { grid-template-columns: 1fr; }
.item-text { min-width: 0; }
.item-line { display: flex; align-items: baseline; gap: 6px; }
.item-line h3 { margin: 0; min-width: 0; font-size: 17px; font-weight: 800; line-height: 1.25; }
/* O botão fica no título, mas a área de toque cobre a linha inteira (foto incluída) */
.item-open {
  padding: 0; border: 0; background: none; color: inherit; cursor: pointer;
  font: inherit; text-align: left; overflow-wrap: anywhere;
}
.item-open::after { content: ""; position: absolute; inset: 0; border-radius: 14px; }
.item-open:focus-visible { outline: none; }
.item-open:focus-visible::after { outline: 3px solid var(--accent); outline-offset: 2px; }
.item:active .item-line h3 { color: var(--accent); }
.thumb img { transition: transform .3s cubic-bezier(.2,.8,.2,1); }
@media (hover: hover) {
  .item:hover .item-line h3 { color: var(--accent); }
  .item:hover .thumb img { transform: scale(1.06) rotate(-2deg); }
}
.leader { flex: 1; min-width: 12px; border-bottom: 2px dotted color-mix(in oklab, var(--ink-2) 45%, transparent); transform: translateY(-4px); }
.item-line .price { font-size: 17px; }
.item .desc {
  margin: 4px 0 0; color: var(--ink-2); font-size: 14px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.item .meta { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 8px; }
.item .meta:empty { display: none; }
.thumb {
  position: relative; width: 92px; height: 92px; border-radius: 22px; overflow: hidden;
  background: radial-gradient(110% 90% at 50% 40%, var(--stage-1), var(--stage-2));
  display: grid; place-items: center;
}
.thumb img { width: 86%; height: 86%; object-fit: contain; filter: drop-shadow(0 8px 10px rgba(0,0,0,.4)); }
.item.is-off .thumb img { filter: grayscale(1) opacity(.6); }
.item.is-off h3, .item.is-off .price { color: var(--ink-2); }
.item.is-off .price { text-decoration: line-through; }

.price { font-weight: 800; font-variant-numeric: tabular-nums; }
.tag {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 9px; border-radius: 999px; font-size: 12px; font-weight: 800;
}
.tag-3d { background: var(--accent-soft); color: var(--accent); }
.tag-3d svg { width: 14px; height: 14px; }
.tag-off { background: var(--off-bg); color: var(--off); }

/* Avisos dentro do prato (erro, conexão lenta, sem AR) */
.callout {
  display: flex; gap: 10px; align-items: flex-start;
  margin: 0; padding: 10px 12px; border-radius: 12px;
  font-size: 14px; line-height: 1.4;
}
.callout svg { width: 18px; height: 18px; margin-top: 1px; }
.callout-err { background: var(--off-bg); color: var(--off); font-weight: 700; }
.callout-slow { background: color-mix(in oklab, var(--mustard) 18%, var(--surface)); color: var(--ink); }
.callout-info { background: var(--surface-2); color: var(--ink); }
.callout-info svg { color: var(--accent); }

/* ---------- Folha do prato ---------- */
.sheet {
  width: 100%; max-width: 560px; max-height: 96dvh;
  margin: auto auto 0; padding: 0; border: 0;
  border-radius: 24px 24px 0 0; overflow: hidden;
  background: var(--surface); color: var(--ink);
  display: flex; flex-direction: column;
}
.sheet:not([open]) { display: none; }
.grabber { /* alça decorativa: sinaliza a janela de baixo para cima */
  position: absolute; top: 8px; left: 50%; z-index: 3; transform: translateX(-50%);
  width: 40px; height: 4px; border-radius: 2px;
  background: color-mix(in oklab, var(--stage-ink) 45%, transparent);
}
.sheet::backdrop, .tips::backdrop { background: rgba(20, 15, 12, .6); backdrop-filter: blur(2px); }
.sheet[open] { animation: sheet-in .28s cubic-bezier(.2, .8, .2, 1); }
@keyframes sheet-in { from { transform: translateY(40px); opacity: 0; } }

.stage {
  position: relative; flex: none;
  height: min(48dvh, 420px);
  background: radial-gradient(110% 85% at 50% 35%, var(--stage-1), var(--stage-2));
  color: var(--stage-ink);
}
.stage-photo {
  position: absolute; inset: 8% 10% 14%; width: 80%; height: 78%;
  object-fit: contain; filter: drop-shadow(0 20px 24px rgba(0,0,0,.5));
  transition: opacity .3s ease;
}
.sheet.is-off .stage-photo { filter: grayscale(1) opacity(.65) drop-shadow(0 20px 24px rgba(0,0,0,.5)); }
/* Troca suave da foto pelo 3D quando o modelo termina de carregar */
.stage.is-3d .stage-photo { opacity: 0; pointer-events: none; }
.stage-empty {
  position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 8px;
  color: color-mix(in oklab, var(--stage-ink) 70%, transparent); font-size: 14px;
}
.stage-empty svg { width: 40px; height: 40px; }
.stage model-viewer {
  position: absolute; inset: 0; width: 100%; height: 100%;
  background: transparent;
  --poster-color: transparent;
  --progress-bar-color: transparent;
  opacity: 0; transition: opacity .35s ease;
}
.stage.is-3d model-viewer { opacity: 1; }
.stage-cta {
  position: absolute; left: 50%; bottom: 18px; transform: translateX(-50%);
  display: inline-flex; align-items: center; gap: 8px;
  min-height: 44px; padding: 0 18px; border-radius: 999px;
  background: rgba(255,255,255,.16); color: #fff;
  border: 1px solid rgba(255,255,255,.28);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  font: inherit; font-weight: 700; cursor: pointer;
  transition: background .15s ease;
}
.stage-cta:hover { background: rgba(255,255,255,.24); }
.stage-cta:active { transform: translateX(-50%) scale(.97); }
.stage-hint {
  position: absolute; left: 0; right: 0; bottom: 14px; margin: 0; text-align: center;
  font-size: 13px; color: color-mix(in oklab, var(--stage-ink) 75%, transparent);
  pointer-events: none;
}
.progress {
  position: absolute; left: 24px; right: 24px; bottom: 22px;
  height: 6px; border-radius: 3px; background: rgba(255,255,255,.18); overflow: hidden;
}
.progress > i { display: block; height: 100%; width: 4%; background: var(--mustard); border-radius: 3px; transition: width .2s; }
.sheet-close {
  position: absolute; top: 12px; right: 12px; z-index: 2;
  background: rgba(0,0,0,.35); color: #fff;
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}

.sheet-body { padding: 18px 20px 8px; overflow-y: auto; overscroll-behavior: contain; }
.title-row { display: flex; gap: 10px; align-items: flex-start; justify-content: space-between; }
.title-row h2 { margin: 0; font: 800 36px/1 var(--display); }
.title-row .tag { margin-top: 4px; flex: none; }
.sheet-body .desc { margin: 8px 0 0; color: var(--ink-2); }
.size {
  display: inline-flex; align-items: center; gap: 8px;
  margin: 12px 0 0; padding: 6px 12px 6px 10px; border-radius: 999px;
  background: var(--surface-2); font-size: 14px; font-weight: 700;
}
.size svg { width: 18px; height: 18px; color: var(--accent); }
.status:not(:empty) { margin-top: 12px; }
#no-ar-hint { margin-top: 12px; }
.note { margin: 10px 0 0; color: var(--off); font-size: 14px; font-weight: 700; }
.disclaimer { margin: 12px 0 0; color: var(--ink-2); font-size: 13px; }
.sheet.is-off .bar-price strong { text-decoration: line-through; color: var(--ink-2); }

.sheet-bar {
  flex: none; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom)) 20px;
  border-top: 1px solid var(--line); background: var(--surface);
}
.bar-price { display: grid; line-height: 1.15; }
.bar-label { font-size: 12px; color: var(--ink-2); }
.bar-price strong { font-size: 22px; font-weight: 800; font-variant-numeric: tabular-nums; }
.sheet-bar .btn { flex: 0 1 auto; }

/* ---------- Dicas de AR ---------- */
.tips {
  width: calc(100% - 32px); max-width: 420px; margin: auto;
  padding: 24px 20px 20px; border: 0; border-radius: 24px;
  background: var(--surface); color: var(--ink);
}
.tips[open] { animation: pop-in .22s ease; }
@keyframes pop-in { from { transform: scale(.96); opacity: 0; } }
.tips h2 { margin: 0 0 16px; font: 800 30px/1.05 var(--display); }
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.steps li { display: flex; gap: 14px; align-items: center; }
.steps div { display: grid; }
.steps span:not(.step-ico) { color: var(--ink-2); font-size: 14px; }
.step-ico {
  display: grid; place-items: center; flex: none;
  width: 44px; height: 44px; border-radius: 14px;
  background: var(--accent-soft); color: var(--accent);
}
.step-ico svg { width: 24px; height: 24px; }
.privacy { margin: 16px 0 0; font-size: 13px; color: var(--ink-2); }
.tips-actions { display: grid; gap: 8px; margin-top: 18px; }

/* ---------- Rodapé ---------- */
.foot { max-width: 760px; margin: 0 auto; padding: 24px 16px 40px; text-align: center; color: var(--ink-2); font-size: 12px; }
.foot p { margin: 4px 0; }
.powered { font-size: 13px; }
.powered strong { color: var(--ink); }

@media (min-width: 760px) {
  .sheet { margin: auto; border-radius: 24px; max-height: 90dvh; }
  .hero, .tabs { max-width: 760px; margin-left: auto; margin-right: auto; }
  .slide-word { font-size: 170px; }
}

@media (min-width: 760px) {
  .grabber { display: none; }
  .tabs a:hover { color: var(--ink); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
