/* Vitrine — tokens e primitivas compartilhadas (ver DESIGN.md).
   Conceito: a comida é a luz da tela. Neutros frios e silenciosos, um único sinal quente,
   vidro apenas onde algo flutua sobre imagem. */
@font-face { font-family: "Figtree"; src: url("../fonts/figtree.woff2") format("woff2"); font-weight: 300 900; font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Figtree"; src: url("../fonts/figtree-ext.woff2") format("woff2"); font-weight: 300 900; font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }

:root {
  --bg: #eceef1; --bg-2: #e3e6ea; --surface: #ffffff; --surface-2: #f3f4f6; --surface-3: #e5e7eb;
  --ink: #0c0e11; --ink-2: #474d56; --ink-3: #5b626c; --on-ink: #ffffff;
  --line: rgba(12,14,17,.08); --line-2: rgba(12,14,17,.15);
  --signal: #d43a10; --signal-soft: #fde6dd;
  --ok: #1f7a46; --ok-soft: #dff3e6; --warn: #8a5a00; --warn-soft: #f8ecd2; --danger: #b42318; --danger-soft: #fbe4e1;
  --night: #08090b;
  --glass-bg: rgba(255,255,255,.62); --glass-border: rgba(255,255,255,.75); --glass-hi: rgba(255,255,255,.9);
  --glass-shadow: 0 10px 34px rgba(12,14,17,.12), 0 1px 2px rgba(12,14,17,.06);
  --shadow-1: 0 1px 2px rgba(12,14,17,.05), 0 6px 18px rgba(12,14,17,.06);
  --shadow-2: 0 24px 60px rgba(12,14,17,.22);
  --font: "Figtree", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --display: var(--font);
  --r-sm: 12px; --r-md: 18px; --r-lg: 26px; --r-xl: 34px; --r-pill: 999px;
  --ease-sheet: cubic-bezier(.32,.72,0,1); --ease-out: cubic-bezier(.23,1,.32,1); --ease-spring: cubic-bezier(.34,1.4,.64,1);
  --gutter: 16px; --safe-b: env(safe-area-inset-bottom, 0px); --safe-t: env(safe-area-inset-top, 0px);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --bg: #08090b; --bg-2: #0f1114; --surface: #15171b; --surface-2: #1c1f24; --surface-3: #262a31;
  --ink: #f3f4f6; --ink-2: #b0b6bf; --ink-3: #8f96a0; --on-ink: #0c0e11;
  --line: rgba(255,255,255,.08); --line-2: rgba(255,255,255,.15);
  --signal: #ff6a3d; --signal-soft: rgba(255,106,61,.16);
  --ok: #4fd08a; --ok-soft: rgba(79,208,138,.14); --warn: #f2b84b; --warn-soft: rgba(242,184,75,.14); --danger: #ff7a6e; --danger-soft: rgba(255,122,110,.14);
  --glass-bg: rgba(26,28,33,.58); --glass-border: rgba(255,255,255,.10); --glass-hi: rgba(255,255,255,.12);
  --glass-shadow: 0 14px 40px rgba(0,0,0,.45);
  --shadow-1: 0 1px 2px rgba(0,0,0,.4), 0 8px 22px rgba(0,0,0,.28); --shadow-2: 0 28px 70px rgba(0,0,0,.6);
  color-scheme: dark; } }
:root[data-theme="dark"] {
  --bg: #08090b; --bg-2: #0f1114; --surface: #15171b; --surface-2: #1c1f24; --surface-3: #262a31;
  --ink: #f3f4f6; --ink-2: #b0b6bf; --ink-3: #8f96a0; --on-ink: #0c0e11;
  --line: rgba(255,255,255,.08); --line-2: rgba(255,255,255,.15);
  --signal: #ff6a3d; --signal-soft: rgba(255,106,61,.16);
  --ok: #4fd08a; --ok-soft: rgba(79,208,138,.14); --warn: #f2b84b; --warn-soft: rgba(242,184,75,.14); --danger: #ff7a6e; --danger-soft: rgba(255,122,110,.14);
  --glass-bg: rgba(26,28,33,.58); --glass-border: rgba(255,255,255,.10); --glass-hi: rgba(255,255,255,.12);
  --glass-shadow: 0 14px 40px rgba(0,0,0,.45);
  --shadow-1: 0 1px 2px rgba(0,0,0,.4), 0 8px 22px rgba(0,0,0,.28); --shadow-2: 0 28px 70px rgba(0,0,0,.6);
  color-scheme: dark;
}
@media (min-width: 768px) { :root { --gutter: 28px; } }
@media (min-width: 1200px) { :root { --gutter: 40px; } }

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; background: var(--bg); }
body { margin: 0; font-family: var(--font); font-size: 15px; line-height: 1.5; color: var(--ink); background: var(--bg);
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; -webkit-tap-highlight-color: transparent; font-feature-settings: "ss01" 0;
  transition: background-color .35s ease, color .35s ease; }
img, video, svg { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
a { color: inherit; }
h1, h2, h3, h4 { margin: 0; font-weight: 650; letter-spacing: -0.025em; line-height: 1.1; text-wrap: balance; }
p { margin: 0; }
.num, .price { font-variant-numeric: tabular-nums; }
.muted { color: var(--ink-2); }
.faint { color: var(--ink-3); }
.eyebrow { font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); }
.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; }
.icon { width: 20px; height: 20px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.icon-sm { width: 16px; height: 16px; }
.icon-lg { width: 26px; height: 26px; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; border-radius: 8px; }

/* Botões: pílula sólida (principal), pílula de superfície, fantasma. A principal inverte no modo noturno. */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 0 22px;
  border-radius: var(--r-pill); font-weight: 600; font-size: 15px; letter-spacing: -0.01em; white-space: nowrap; text-decoration: none;
  transition: transform .16s var(--ease-out), background-color .2s, box-shadow .2s, opacity .2s; user-select: none; -webkit-user-select: none; }
.btn:active:not(:disabled) { transform: scale(.965); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .4; cursor: not-allowed; }
.btn-primary { background: var(--ink); color: var(--on-ink); }
@media (hover: hover) { .btn-primary:hover:not(:disabled) { opacity: .88; } }
.btn-secondary { background: var(--surface); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line-2); }
@media (hover: hover) { .btn-secondary:hover:not(:disabled) { background: var(--surface-2); } }
.btn-ghost { color: var(--ink-2); padding: 0 12px; }
@media (hover: hover) { .btn-ghost:hover { color: var(--ink); background: var(--surface-2); } }
.btn-danger { background: var(--surface); color: var(--danger); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--danger) 35%, transparent); }
.btn-light { background: #fff; color: #0c0e11; }
@media (hover: hover) { .btn-light:hover:not(:disabled) { background: #f1f2f4; } }
.btn-block { width: 100%; }
.btn-lg { min-height: 54px; font-size: 16px; padding: 0 26px; }
.btn-sm { min-height: 36px; padding: 0 14px; font-size: 14px; }
.icon-btn { display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: var(--r-pill); transition: transform .16s var(--ease-out), background-color .2s; }
.icon-btn:active { transform: scale(.92); }

/* Campos */
.field { display: grid; gap: 6px; }
.field > span, .field-label { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.input, .field input, .field select, .field textarea { width: 100%; min-height: 50px; padding: 12px 16px; border-radius: var(--r-sm);
  border: 1px solid var(--line-2); background: var(--surface); font-size: 16px; transition: border-color .2s, box-shadow .2s, background-color .2s; }
.field textarea { min-height: 88px; resize: vertical; }
.input:focus, .field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 4px color-mix(in srgb, var(--ink) 9%, transparent); }
.field.invalid input, .field.invalid textarea, .field.invalid select { border-color: var(--danger); }
.field-error { font-size: 13px; color: var(--danger); }
.hint { font-size: 13px; color: var(--ink-3); }

.alert { padding: 12px 14px; border-radius: var(--r-sm); font-size: 14px; }
.alert-danger { background: var(--danger-soft); color: var(--danger); }
.alert-warn { background: var(--warn-soft); color: var(--warn); }
.alert-ok { background: var(--ok-soft); color: var(--ok); }
.alert-info { background: var(--surface-2); color: var(--ink-2); }

/* ── Vidro ──
   .glass        superfície flutuante sobre a interface (barra, cabeçalho, mini-pedido). Segue o tema.
   .glass-media  controle sobre foto ou vídeo: fino, claro, com brilho na borda superior (referências).
   .glass-ghost  só o contorno luminoso, para chips sobre imagem. */
.glass { background: var(--glass-bg); border: 1px solid var(--glass-border);
  box-shadow: inset 0 1px 0 var(--glass-hi), var(--glass-shadow);
  -webkit-backdrop-filter: blur(24px) saturate(1.8); backdrop-filter: blur(24px) saturate(1.8); }
.glass-media { position: relative; color: #fff; background: linear-gradient(180deg, rgba(255,255,255,.22), rgba(255,255,255,.08));
  border: 1px solid rgba(255,255,255,.28); box-shadow: inset 0 1px 0 rgba(255,255,255,.42), inset 0 -1px 0 rgba(0,0,0,.08), 0 8px 24px rgba(0,0,0,.18);
  -webkit-backdrop-filter: blur(20px) saturate(1.7); backdrop-filter: blur(20px) saturate(1.7); }
.glass-ghost { color: #fff; background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.42);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.glass-dark { color: #fff; background: rgba(16,17,20,.5); border: 1px solid rgba(255,255,255,.12); box-shadow: inset 0 1px 0 rgba(255,255,255,.08), 0 14px 40px rgba(0,0,0,.4);
  -webkit-backdrop-filter: blur(26px) saturate(1.6); backdrop-filter: blur(26px) saturate(1.6); }
.glass-light { background: rgba(255,255,255,.72); border: 1px solid rgba(255,255,255,.8); box-shadow: inset 0 1px 0 #fff, var(--glass-shadow);
  -webkit-backdrop-filter: blur(24px) saturate(1.8); backdrop-filter: blur(24px) saturate(1.8); color: #0c0e11; }
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .glass { background: var(--surface); } .glass-media, .glass-ghost, .glass-dark { background: rgba(16,17,20,.78); } .glass-light { background: #fff; }
}

/* Desfoque progressivo: quatro camadas mascaradas, a imagem se dissolve na cor do prato (como nas referências). */
.pblur { position: absolute; inset: auto 0 0 0; height: var(--pb-h, 58%); pointer-events: none; z-index: 0; }
.pblur > i { position: absolute; inset: 0; }
.pblur > i:nth-child(1) { -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px); -webkit-mask: linear-gradient(transparent 0%, #000 20%, #000 40%, transparent 55%); mask: linear-gradient(transparent 0%, #000 20%, #000 40%, transparent 55%); }
.pblur > i:nth-child(2) { -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); -webkit-mask: linear-gradient(transparent 25%, #000 45%, #000 65%, transparent 80%); mask: linear-gradient(transparent 25%, #000 45%, #000 65%, transparent 80%); }
.pblur > i:nth-child(3) { -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); -webkit-mask: linear-gradient(transparent 50%, #000 72%); mask: linear-gradient(transparent 50%, #000 72%); }
.pblur > i:nth-child(4) { background: linear-gradient(transparent 30%, color-mix(in srgb, var(--tint, #222) 42%, rgba(6,7,9,.92)) 100%); }

.toast-region { position: fixed; left: 50%; top: calc(12px + var(--safe-t)); transform: translateX(-50%); z-index: 120; display: grid; gap: 8px; width: min(440px, calc(100% - 24px)); pointer-events: none; }
.toast { display: flex; align-items: center; gap: 12px; padding: 12px 12px 12px 16px; border-radius: var(--r-md); font-size: 14px; font-weight: 600; pointer-events: auto; animation: toast-in .45s var(--ease-spring); color: var(--ink); }
.toast span { flex: 1; }
.toast .toast-act { font-weight: 700; padding: 6px 12px; border-radius: var(--r-pill); background: var(--ink); color: var(--on-ink); font-size: 13px; }
.toast.error { color: var(--danger); }
.toast.out { transition: opacity .25s, transform .25s; opacity: 0; transform: translateY(-6px) scale(.98); }
@keyframes toast-in { from { opacity: 0; transform: translateY(-14px) scale(.96); } }

.spinner { width: 20px; height: 20px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin .7s linear infinite; opacity: .7; }
@keyframes spin { to { transform: rotate(360deg); } }
.skeleton { background: linear-gradient(90deg, var(--surface-2), var(--surface-3), var(--surface-2)); background-size: 200% 100%; animation: shimmer 1.4s infinite; border-radius: var(--r-sm); }
@keyframes shimmer { to { background-position: -200% 0; } }

/* Interruptor de tema (sol/lua) */
.theme-btn { position: relative; overflow: hidden; }
.theme-btn .icon { transition: transform .5s var(--ease-spring), opacity .3s; }
.theme-btn .i-moon { position: absolute; inset: 0; margin: auto; }
.theme-btn .i-sun { opacity: 1; }
.theme-btn .i-moon { opacity: 0; transform: rotate(-90deg) scale(.5); }
.is-dark .theme-btn .i-sun { opacity: 0; transform: rotate(90deg) scale(.5); }
.is-dark .theme-btn .i-moon { opacity: 1; transform: none; }

/* Transições de página (View Transitions API, quando disponível) */
::view-transition-old(root) { animation: vt-out .22s ease both; }
::view-transition-new(root) { animation: vt-in .38s var(--ease-out) both; }
@keyframes vt-out { to { opacity: 0; transform: scale(.985); } }
@keyframes vt-in { from { opacity: 0; transform: translateY(10px); } }

/* Entrada em cascata (curta, a partir de um estado legível) */
.rv { animation: rv .6s var(--ease-out) both; animation-delay: calc(var(--i, 0) * 45ms); }
@keyframes rv { from { opacity: .001; transform: translateY(14px); filter: blur(4px); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
  ::view-transition-old(root), ::view-transition-new(root) { animation: none !important; }
}
