/* ==========================================================================
   O Bacano — base partilhada (landing, menu, comentarios)
   Tokens, header, gaveta mobile, botoes, footer e revelacao ao scroll.
   ========================================================================== */

/* --- Tokens ------------------------------------------------------------- */
:root {
  /* carvao quente: a base solida e artesanal */
  --bg: #14100d;
  --bg-deep: #0d0a08;
  --surface: #1d1815;
  --surface-2: #29221e;
  --line: #372e28;
  --ink: #fbf3e8;
  --ink-2: #d9cab9;
  --muted: #a3907f;

  /* as cores do apetite: ambar e tomate */
  --gold: #f5b524;
  --gold-deep: #e39a0b;
  --ember: #e2552a;
  --ember-soft: #f2875c;
  --green: #86b46f;

  /* creme das seccoes claras */
  --cream: #fff3e1;
  --cream-2: #ffe8c6;
  --cocoa: #2b1a10;
  --cocoa-2: #6b4a35;
  --tomato: #b9411b;

  --f-display: "Anton", "Impact", "Arial Narrow", sans-serif;
  --f-accent: "Fraunces", Georgia, serif;
  --f-body: "Figtree", system-ui, -apple-system, "Segoe UI", sans-serif;

  --radius-sm: 10px;
  --radius: 18px;
  --radius-lg: 26px;

  --shadow-1: 0 1px 2px rgb(0 0 0 / .28), 0 8px 24px -12px rgb(0 0 0 / .5);
  --shadow-2: 0 24px 60px -18px rgb(0 0 0 / .65);
  --shadow-cream: 0 2px 4px rgb(90 50 20 / .05), 0 22px 44px -22px rgb(110 60 20 / .35);

  --header-h: 64px;
  --gutter: 16px;
  --maxw: 1240px;

  /* molas: arranque rapido, assentar calmo */
  --ease-out: cubic-bezier(.22, 1, .36, 1);
  --ease-spring: cubic-bezier(.34, 1.4, .5, 1);
  --t-fast: .18s;
  --t: .32s;
}

@media (min-width: 600px) { :root { --gutter: 24px; } }

/* --- Tema creme ---------------------------------------------------------
   O sistema de design do menu (papel de ementa). Vale para o menu e para a
   landing; os comentarios ainda usam o carvao. */
.tema-creme {
  --bg: #fbf4ea;
  --bg-deep: #f3e9dc;
  --surface: #fffcf7;
  --surface-2: #f5ece0;
  --line: #e6d9c8;
  --ink: #24170f;
  --ink-2: #4d3a2d;
  --muted: #7f6b5b;
  --ember: #c4471d;
  --ember-soft: #a83d18;
  --gold: #b07a06;
  --green: #4e7a3b;
  --shadow-1: 0 1px 2px rgb(60 40 20 / .07), 0 10px 24px -14px rgb(60 40 20 / .3);
  --shadow-2: 0 26px 60px -20px rgb(60 40 20 / .34);
}
.tema-creme .header::before { opacity: 0; }
.tema-creme .footer { background: #0d0a08; --ink: #fbf3e8; --ink-2: #d9cab9; --gold: #f5b524; --line: #372e28; color: var(--ink); }

@media (min-width: 900px) { :root { --header-h: 78px; --gutter: 40px; } }

/* --- Base --------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--header-h);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--f-body);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  /* clip em vez de hidden: corta o que transborde na horizontal sem
     transformar o body numa caixa de scroll, que baralha o sticky */
  overflow-x: clip;
}

body.is-locked { overflow: hidden; }

img { max-width: 100%; display: block; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
a { color: inherit; text-decoration: none; }

:where(a, button, input, textarea, [tabindex]):focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
  border-radius: 6px;
}

.container {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.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;
}

.skip-link {
  position: fixed; top: 8px; left: 8px; z-index: 200;
  padding: 10px 16px; border-radius: var(--radius-sm);
  background: var(--gold); color: var(--cocoa); font-weight: 700;
  transform: translateY(-160%);
  transition: transform var(--t) var(--ease-out);
}
.skip-link:focus-visible { transform: none; }

/* titulos de seccao partilhados */
.kicker {
  margin: 0;
  font-family: var(--f-accent); font-style: italic; font-weight: 500;
  font-size: clamp(1.05rem, 2.6vw, 1.3rem);
  color: var(--gold);
}
.display {
  margin: 0;
  font-family: var(--f-display); font-weight: 400;
  text-transform: uppercase;
  line-height: .98; letter-spacing: .005em;
  text-wrap: balance;
}

/* --- Botoes ------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  min-height: 46px; padding: 12px 22px; border-radius: 999px;
  font-size: .95rem; font-weight: 700; letter-spacing: .01em;
  background: var(--gold); color: var(--cocoa);
  transition: transform var(--t-fast) var(--ease-spring),
              filter var(--t-fast) var(--ease-out),
              background var(--t-fast) var(--ease-out);
}
.btn svg { flex: 0 0 auto; transition: transform var(--t) var(--ease-spring); }
@media (hover: hover) {
  .btn:hover { filter: brightness(1.06); }
  .btn:hover svg.btn__arrow { transform: translateX(3px); }
}
.btn:active { transform: scale(.96); transition-duration: .08s; }
.btn--ember { background: var(--ember); color: #fff; }
.btn--tomato { background: var(--tomato); color: #fff; }
.btn--ghost {
  background: transparent; color: var(--ink);
  box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--ink) 40%, transparent);
}
@media (hover: hover) { .btn--ghost:hover { background: color-mix(in srgb, var(--ink) 8%, transparent); filter: none; } }

/* --- Header (fixo, transparente sobre o topo) --------------------------- */
.header {
  position: fixed; inset: 0 0 auto 0; z-index: 90;
  height: var(--header-h);
  display: flex; align-items: center;
  background: transparent;
  border-bottom: 1px solid transparent;
  transition: background var(--t) var(--ease-out),
              border-color var(--t) var(--ease-out),
              backdrop-filter var(--t) var(--ease-out);
}
/* um veu suave so no topo, para o texto ler sobre qualquer imagem */
.header::before {
  content: ""; position: absolute; inset: 0 0 -30px 0; z-index: -1;
  background: linear-gradient(to bottom, rgb(10 7 5 / .55), transparent);
  pointer-events: none;
  transition: opacity var(--t) var(--ease-out);
}
.header.is-stuck {
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom-color: color-mix(in srgb, var(--line) 80%, transparent);
}
.header.is-stuck::before { opacity: 0; }

.header__inner {
  width: 100%; max-width: var(--maxw); margin-inline: auto;
  padding-inline: var(--gutter);
  display: flex; align-items: center; gap: 20px;
}

/* Medidas tiradas da referencia (um desenho com 2400 de largura): --hu e
   uma unidade dessa grelha, por isso o header e uma escala exata dela. */
.header { --hu: .46px; }
@media (min-width: 900px) { .header { --hu: clamp(.42px, calc(100vw / 2400), 1px); } }

.header__inner { max-width: none; gap: 0; }
@media (min-width: 900px) {
  .header__inner { padding-inline: calc(117 * var(--hu)) calc(74 * var(--hu)); }
}

.brand { display: flex; flex-direction: column; align-items: center; line-height: 1; margin-right: auto; }
@media (min-width: 900px) { .brand { margin-right: 0; } }
.brand__mark {
  display: flex; align-items: center;
  font-family: var(--f-display); font-weight: 400; font-size: calc(70 * var(--hu));
  letter-spacing: .02em; text-transform: uppercase; color: var(--ink); line-height: 1;
}
.brand__slice { width: .9em; height: .9em; margin-left: .04em; color: var(--gold); }
.brand__tag {
  margin-top: calc(9 * var(--hu));
  font-family: var(--f-body); font-weight: 700; font-size: calc(15.5 * var(--hu));
  letter-spacing: .18em; text-transform: uppercase; color: var(--gold);
}

.nav { display: none; align-items: center; gap: calc(62 * var(--hu)); margin-inline: auto; }
@media (min-width: 900px) { .nav { display: flex; } }

.nav__link {
  position: relative; padding: calc(10 * var(--hu)) 0;
  font-family: var(--f-body); font-size: calc(26 * var(--hu)); font-weight: 500; color: var(--ink-2);
  transition: color var(--t-fast) var(--ease-out);
}
.nav__link:hover, .nav__link[aria-current="page"] { color: var(--ink); }
.nav__link[aria-current="page"]::after {
  content: ""; position: absolute; left: 50%; bottom: calc(-4 * var(--hu));
  width: calc(42 * var(--hu)); height: calc(3 * var(--hu)); margin-left: calc(-21 * var(--hu));
  border-radius: 2px; background: var(--gold);
}

.header__actions { display: none; align-items: center; gap: calc(52 * var(--hu)); }
@media (min-width: 900px) { .header__actions { display: flex; } }
.header__icon { position: relative; display: grid; place-items: center; color: var(--ink); transition: color var(--t-fast) var(--ease-out); }
.header__icon:hover { color: var(--gold); }
.header__icon .ico { width: calc(42 * var(--hu)); height: calc(42 * var(--hu)); }
.header__dot {
  position: absolute; top: calc(-6 * var(--hu)); right: calc(-8 * var(--hu));
  width: calc(17 * var(--hu)); height: calc(17 * var(--hu)); border-radius: 50%;
  background: var(--ember); box-shadow: 0 0 0 calc(3 * var(--hu)) color-mix(in srgb, var(--ember) 25%, transparent);
}
.header__cta { min-height: 42px; padding: 10px 18px; font-size: .9rem; }

/* Hamburger */
.burger {
  /* flex e nao grid: a grelha espalhava as 3 linhas pelos 44px e o X saia torto */
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  width: 44px; height: 44px; margin-right: -10px;
  border-radius: 12px;
}
@media (min-width: 900px) { .burger { display: none; } }
.burger span {
  display: block; width: 22px; height: 2px; border-radius: 2px;
  background: var(--ink);
  transition: transform var(--t) var(--ease-spring), opacity var(--t-fast) var(--ease-out);
}
.burger span + span { margin-top: 5px; }
.burger[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.burger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.burger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Gaveta mobile */
.drawer {
  position: fixed; inset: 0; z-index: 85;
  display: flex; flex-direction: column; justify-content: center;
  padding: calc(var(--header-h) + 24px) var(--gutter) 40px;
  background:
    radial-gradient(90% 60% at 100% 100%, color-mix(in srgb, var(--ember) 30%, transparent), transparent 70%),
    var(--bg-deep);
  visibility: hidden; opacity: 0;
  transition: opacity var(--t) var(--ease-out), visibility var(--t);
}
.drawer.is-open { visibility: visible; opacity: 1; }
.drawer__link {
  display: block; padding: 12px 0;
  font-family: var(--f-display); text-transform: uppercase;
  font-size: clamp(2.2rem, 11vw, 3rem); line-height: 1.05;
  border-bottom: 1px solid var(--line);
  opacity: 0; transform: translateY(14px);
  transition: opacity .4s var(--ease-out), transform .45s var(--ease-out), color var(--t-fast);
}
.drawer__link[aria-current="page"] { color: var(--gold); }
.drawer.is-open .drawer__link { opacity: 1; transform: none; }
.drawer.is-open .drawer__link:nth-child(1) { transition-delay: .05s; }
.drawer.is-open .drawer__link:nth-child(2) { transition-delay: .1s; }
.drawer.is-open .drawer__link:nth-child(3) { transition-delay: .15s; }
.drawer__foot { margin-top: 32px; display: flex; gap: 12px; }
.drawer__foot .btn { flex: 1; }

/* --- Componentes do menu, partilhados com a landing -------------------- */
.chip {
  flex: 0 0 auto; scroll-snap-align: center;
  display: inline-flex; align-items: center; gap: 7px;
  padding: 9px 16px; border-radius: 999px;
  font-size: .9rem; font-weight: 500; white-space: nowrap;
  color: var(--ink-2);
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--line);
  transition: color var(--t-fast) var(--ease-out),
              background var(--t-fast) var(--ease-out),
              box-shadow var(--t-fast) var(--ease-out),
              transform var(--t-fast) var(--ease-spring);
}
.chip:hover { color: var(--ink); background: var(--surface-2); }
.chip:active { transform: scale(.95); }
.chip[aria-pressed="true"] {
  color: #fff; background: var(--ember);
  box-shadow: inset 0 0 0 1px var(--ember), 0 6px 18px -8px color-mix(in srgb, var(--ember) 80%, transparent);
}
.chip__count {
  font-size: .74rem; font-variant-numeric: tabular-nums;
  padding: 1px 6px; border-radius: 999px;
  background: color-mix(in srgb, var(--ink) 10%, transparent);
}
.chip[aria-pressed="true"] .chip__count { background: rgb(255 255 255 / .22); }
/* categoria que esta a passar no ecra, quando nada esta filtrado */
.chip.is-near[aria-pressed="false"] {
  color: var(--ink);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--ember) 55%, var(--line));
}


/* --- Card --------------------------------------------------------------- */
.card {
  position: relative;
  display: flex; flex-direction: column;
  width: 100%; text-align: left;
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: inset 0 0 0 1px var(--line), var(--shadow-1);
  overflow: hidden;
  transition: transform var(--t) var(--ease-spring),
              box-shadow var(--t) var(--ease-out);
}
.card[hidden] { display: none; }
@media (hover: hover) {
  .card:hover {
    transform: translateY(-4px);
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--ember) 40%, var(--line)), var(--shadow-2);
  }
  .card:hover .card__art { transform: scale(calc(var(--s, 1) * 1.07)) rotate(var(--r, 0deg)); }
  .card:hover .card__photo { transform: scale(1.05); }
}
.card:active { transform: scale(.982); transition-duration: var(--t-fast); }

/* Sem fotografia, cada prato recebe o seu tom e angulo — a grelha ganha
   textura em vez de repetir o mesmo azulejo. --h, --a e --s vem do HTML. */
.card__media {
  position: relative; aspect-ratio: 5 / 4; overflow: hidden;
  background:
    radial-gradient(120% 120% at var(--px, 30%) 10%, hsl(var(--h) 52% 33% / .9), transparent 72%),
    linear-gradient(var(--a, 160deg), hsl(var(--h) 40% 25%), hsl(calc(var(--h) - 14) 34% 15%));
}
@media (min-width: 700px) { .card__media { aspect-ratio: 4 / 3; } }
:root .card__media {
  background:
    radial-gradient(120% 120% at var(--px, 30%) 10%, hsl(var(--h) 72% 82% / .9), transparent 70%),
    linear-gradient(var(--a, 160deg), hsl(var(--h) 60% 88%), hsl(calc(var(--h) - 14) 48% 78%));
}
.card__photo {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover;
  transition: transform .5s var(--ease-out);
}
/* marca de categoria enquanto nao ha fotografia */
.card__art {
  position: absolute; inset: 0; display: grid; place-items: center;
  color: hsl(var(--h) 52% 78%);
  transform: scale(var(--s, 1)) rotate(var(--r, 0deg));
  transition: transform .5s var(--ease-out);
}
.card__art svg { width: 42%; height: auto; opacity: .5; }
:root .card__art,
:root .sheet__art { color: hsl(var(--h) 58% 26%); }

.card__body {
  display: flex; flex-direction: column; gap: 5px;
  padding: 13px 14px 15px; flex: 1;
}
.card__name {
  margin: 0; font-size: .96rem; font-weight: 600; line-height: 1.28;
  letter-spacing: -.01em; text-wrap: balance;
}
.card__desc {
  margin: 0; font-size: .82rem; line-height: 1.45; color: var(--muted);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
}
.card__tags { margin-top: 4px; }
.card__foot {
  margin-top: auto; padding-top: 10px;
  display: flex; align-items: center; justify-content: space-between; gap: 7px;
}
.card__price { font-family: var(--f-display); font-size: 1.12rem; letter-spacing: .01em; color: var(--gold); font-variant-numeric: tabular-nums; }
.card__more {
  margin-left: auto; font-size: .78rem; font-weight: 500; color: var(--ember);
  display: inline-flex; align-items: center; gap: 4px;
}

/* etiquetas */
.badge {
  position: absolute; top: 10px; left: 10px; z-index: 3;
  padding: 4px 9px; border-radius: 999px;
  font-size: .64rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase;
  background: var(--gold); color: #1a1208;
}
.badge--house { background: var(--ember); color: #fff; }
/* no tema claro o dourado escurece — o texto passa a branco */
:root .badge { color: #fff; }

.tags { display: flex; flex-wrap: wrap; gap: 5px; }
.tag {
  font-size: .68rem; letter-spacing: .04em; text-transform: uppercase; font-weight: 600;
  padding: 3px 8px; border-radius: 6px;
  color: var(--muted); box-shadow: inset 0 0 0 1px var(--line);
}
.tag--vegetariano { color: var(--green); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--green) 40%, transparent); }
.tag--doce { color: var(--gold); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--gold) 40%, transparent); }
.tag--picante { color: var(--ember-soft); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--ember) 40%, transparent); }

/* --- Footer ------------------------------------------------------------- */
.footer {
  position: relative; overflow: hidden;
  background: var(--bg-deep);
  padding: 64px 0 30px;
}
.footer__word {
  font-family: var(--f-display); text-transform: uppercase;
  font-size: clamp(4.2rem, 19vw, 15rem); line-height: .82;
  letter-spacing: .01em; margin: 0 0 44px;
  color: transparent;
  -webkit-text-stroke: 1.5px color-mix(in srgb, var(--gold) 55%, transparent);
  white-space: nowrap;
}
.footer__grid { display: grid; gap: 34px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .footer__grid { grid-template-columns: 1fr 1fr; } }
@media (min-width: 980px) { .footer__grid { grid-template-columns: 1.5fr 1fr 1fr 1fr; gap: 40px; } }
.footer__lead { margin: 0; color: var(--ink-2); font-size: .98rem; max-width: 34ch; }
.footer__h {
  font-family: var(--f-accent); font-style: italic; font-size: 1.05rem;
  color: var(--gold); margin: 0 0 12px;
}
.footer__links { display: flex; flex-direction: column; gap: 9px; }
.footer__links a, .footer__links span { font-size: .95rem; color: var(--ink-2); }
.footer__links a { transition: color var(--t-fast) var(--ease-out); }
.footer__links a:hover { color: var(--gold); }
.footer__bottom {
  margin-top: 46px; padding-top: 18px; border-top: 1px solid var(--line);
  display: flex; flex-wrap: wrap; gap: 8px 18px; justify-content: space-between;
  font-size: .8rem; color: var(--muted);
}

/* --- Revelacao ao scroll ------------------------------------------------ */
.reveal { opacity: 0; transform: translateY(18px); }
.reveal.is-in {
  opacity: 1; transform: none;
  transition: opacity .55s var(--ease-out), transform .6s var(--ease-out);
  transition-delay: var(--d, 0ms);
}
.no-js .reveal { opacity: 1; transform: none; }

/* --- Menos movimento ---------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
  .reveal { opacity: 1; transform: none; }
}

@media print {
  .header, .drawer, .footer__word { display: none !important; }
  body { background: #fff; color: #000; }
}

/* --- Esgotado (vem do painel) ------------------------------------------- */
.card.is-off .card__media { filter: grayscale(.85); opacity: .7; }
.card.is-off .card__price { text-decoration: line-through; color: var(--muted); }
:root .badge--off, .badge--off { background: var(--ink); color: var(--bg); }
