/* =====================================================================
   Base de site — base.css (os mesmos estilos do site do Rancho; o visual muda em tema-doce.css)
   Cores, fontes, botões e utilidades usadas no site todo.
   Para mudar a identidade visual, comece pelas variáveis do :root.
   ===================================================================== */

:root {
  color-scheme: dark;

  /* Madeira escura, preto quente e dourado envelhecido */
  --bg: #0b0806;
  --bg-2: #100c09;
  --wood: #17110c;
  --wood-2: #1f1710;
  --wood-3: #2b2016;
  --text: #f3eadb;
  --text-2: #cbbba1;
  --muted: #9a8a72;
  --gold: #cda65f;
  --gold-hi: #ead09a;
  --gold-lo: #9a763a;
  --ember: #d9772f;
  --line: rgba(205, 166, 95, .15);
  --line-2: rgba(205, 166, 95, .32);
  --gold-grad: linear-gradient(135deg, #f1dcaa 0%, #cda65f 46%, #a37d3d 100%);

  --font-display: 'Cinzel', 'Trajan Pro', 'Times New Roman', serif;
  --font-serif: 'Cormorant Garamond', Garamond, Georgia, serif;
  --font-sans: 'Jost', 'Segoe UI', system-ui, -apple-system, sans-serif;

  --ease: cubic-bezier(.22, .7, .2, 1);
  --ease-out: cubic-bezier(.16, 1, .3, 1);

  --container: 1200px;
  --gutter: clamp(16px, 5vw, 40px);
  --section-y: clamp(84px, 12vw, 150px);
  --header-h: 64px;     /* altura do cabeçalho no topo da página */
  --header-h-s: 64px;   /* altura depois de rolar */
  --radius: 3px;

  /* Texturas geradas no próprio navegador (não pesam nada para baixar) */
  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  --wood-grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='900' height='320'%3E%3Cfilter id='w'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.006 0.24' numOctaves='3' seed='11' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.62 0 0 0 0 0.42 0 0 0 0 0.24 0 0 0 0.16 -0.05'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23w)'/%3E%3C/svg%3E");
}

@media (min-width: 900px) {
  :root { --header-h: 84px; --header-h-s: 68px; }
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: var(--header-h-s);
  scrollbar-gutter: stable;
  background: var(--bg);
}
html.is-locked { overflow: hidden; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font: 400 1rem/1.7 var(--font-sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}

/* Grão de filme bem leve por cima de tudo: dá o ar "analógico" das fotos de restaurante */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 70;
  pointer-events: none;
  background-image: var(--grain);
  opacity: .05;
}

img, svg, video, iframe { display: block; max-width: 100%; }
img { height: auto; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; -webkit-tap-highlight-color: transparent; }
ul, ol { list-style: none; margin: 0; padding: 0; }
h1, h2, h3, h4, p, figure, dl, dd, blockquote { margin: 0; }
h1, h2, h3, h4 { font-weight: inherit; }
table { border-collapse: collapse; }
::selection { background: rgba(205, 166, 95, .35); color: #fff; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; border-radius: 2px; }

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

.skip {
  position: fixed;
  top: 12px; left: 12px;
  z-index: 100;
  padding: 10px 16px;
  background: var(--gold);
  color: #1b130b;
  font-weight: 600;
  border-radius: var(--radius);
  transform: translateY(-160%);
  transition: transform .3s var(--ease);
}
.skip:focus { transform: none; }

.container {
  width: min(100% - 2 * var(--gutter), var(--container));
  margin-inline: auto;
}

.section {
  position: relative;
  padding-block: var(--section-y);
}

.icon {
  flex: none;
  width: 20px;
  height: 20px;
}

/* ---------- Tipografia ---------- */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  font: 500 .72rem/1.2 var(--font-sans);
  letter-spacing: .34em;
  text-transform: uppercase;
  color: var(--gold);
}
.eyebrow::before {
  content: '';
  width: 34px;
  height: 1px;
  background: currentColor;
  opacity: .7;
}

.title {
  margin-top: 18px;
  font: 500 clamp(2.3rem, 5.6vw, 4.3rem)/1.04 var(--font-serif);
  letter-spacing: -.005em;
  color: var(--text);
  text-wrap: balance;
}
.title em {
  font-style: italic;
  background: var(--gold-grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  padding-right: .08em;
}

.lead {
  font-size: clamp(1.02rem, 1.3vw, 1.14rem);
  font-weight: 300;
  color: var(--text-2);
  max-width: 58ch;
  text-wrap: pretty;
}

.section-head {
  display: grid;
  justify-items: center;
  text-align: center;
  margin-bottom: clamp(44px, 6vw, 76px);
}
.section-head .eyebrow::after {
  content: '';
  width: 34px;
  height: 1px;
  background: currentColor;
  opacity: .7;
}
.section-head .lead { margin-top: 20px; }

/* Preço: "R$" pequeno + valor com números alinhados */
.price {
  font: 600 1.24rem/1.2 var(--font-serif);
  font-variant-numeric: lining-nums tabular-nums;
  color: var(--gold-hi);
  white-space: nowrap;
}
.price .cur {
  font: 500 .66rem/1 var(--font-sans);
  letter-spacing: .08em;
  color: var(--gold);
  margin-right: 5px;
  vertical-align: .32em;
}

/* Selos ☀ Dia / ☾ Noite (iguais aos do cardápio impresso) */
.period {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font: 500 .68rem/1 var(--font-sans);
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--gold-hi);
}
.period .icon { width: 15px; height: 15px; color: var(--gold); }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 24px;
  padding: 3px 10px;
  border-radius: 99px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, .035);
  font: 500 .64rem/1.2 var(--font-sans);
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--text-2);
}
.chip .icon { width: 12px; height: 12px; }
.chip-gold { border-color: transparent; background: var(--gold-grad); color: #1b130b; }
.chip-line { background: transparent; border-color: var(--line-2); color: var(--muted); }

/* Divisor com estrela */
.ornament {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--gold);
}
.ornament::before, .ornament::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--line-2));
}
.ornament::after { transform: scaleX(-1); }
.ornament .icon { width: 12px; height: 12px; }

/* Cantoneiras douradas, como moldura de quadro */
.corners { position: relative; }
.corners::after {
  content: '';
  position: absolute;
  inset: -9px;
  pointer-events: none;
  --c: var(--gold);
  --s: 20px;
  background:
    linear-gradient(var(--c) 0 0) top left / var(--s) 1px,
    linear-gradient(var(--c) 0 0) top left / 1px var(--s),
    linear-gradient(var(--c) 0 0) top right / var(--s) 1px,
    linear-gradient(var(--c) 0 0) top right / 1px var(--s),
    linear-gradient(var(--c) 0 0) bottom left / var(--s) 1px,
    linear-gradient(var(--c) 0 0) bottom left / 1px var(--s),
    linear-gradient(var(--c) 0 0) bottom right / var(--s) 1px,
    linear-gradient(var(--c) 0 0) bottom right / 1px var(--s);
  background-repeat: no-repeat;
  opacity: .75;
  transition: inset .6s var(--ease), opacity .6s var(--ease);
}

/* ---------- Botões ---------- */
.btn {
  --b: var(--line-2);
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 52px;
  padding: 0 28px;
  border: 1px solid var(--b);
  border-radius: var(--radius);
  font: 500 .74rem/1 var(--font-sans);
  letter-spacing: .22em;
  text-transform: uppercase;
  white-space: nowrap;
  transition: transform .4s var(--ease), border-color .4s, background-color .4s, color .4s, box-shadow .4s;
}
.btn .icon { width: 18px; height: 18px; transition: transform .4s var(--ease); }
.btn:hover .btn-arrow { transform: translateX(5px); }
.btn:active { transform: scale(.97); }

.btn-gold {
  border-color: transparent;
  background: var(--gold-grad);
  color: #1b130b;
  font-weight: 600;
  box-shadow: 0 14px 34px -16px rgba(205, 166, 95, .7), inset 0 1px 0 rgba(255, 255, 255, .45);
}
/* brilho que atravessa o botão no hover */
.btn-gold::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, .55) 50%, transparent 70%);
  transform: translateX(-120%);
  transition: transform .9s var(--ease);
}
.btn-gold:hover {
  transform: translateY(-2px);
  box-shadow: 0 20px 40px -16px rgba(205, 166, 95, .85), inset 0 1px 0 rgba(255, 255, 255, .45);
}
.btn-gold:hover::after { transform: translateX(120%); }
.btn-gold:active { transform: translateY(0) scale(.97); }

.btn-ghost {
  color: var(--text);
  background: rgba(11, 8, 6, .28);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}
.btn-ghost:hover {
  --b: var(--gold);
  color: var(--gold-hi);
  background: rgba(205, 166, 95, .08);
  transform: translateY(-2px);
}

.btn-sm { min-height: 42px; padding: 0 18px; font-size: .66rem; }
.btn-block { width: 100%; }

.round-btn {
  width: 46px;
  height: 46px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid var(--line-2);
  color: var(--text);
  transition: border-color .3s, color .3s, background-color .3s, transform .3s var(--ease), opacity .3s;
}
.round-btn .icon { width: 18px; height: 18px; }
.round-btn:hover:not(:disabled) { border-color: var(--gold); color: var(--gold-hi); background: rgba(205, 166, 95, .08); }
.round-btn:active:not(:disabled) { transform: scale(.92); }
.round-btn:disabled { opacity: .3; cursor: default; }

.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line-2);
  font: 500 .74rem/1 var(--font-sans);
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--gold-hi);
  transition: border-color .3s, gap .4s var(--ease);
}
.link-arrow .icon { width: 16px; height: 16px; transition: transform .4s var(--ease); }
.link-arrow:hover { border-color: var(--gold); }
.link-arrow:hover .icon { transform: translateX(5px); }

.link-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font: 500 .72rem/1 var(--font-sans);
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--gold-hi);
  padding: 10px 0;
}
.link-btn .icon { width: 14px; height: 14px; }
.link-btn:hover { color: var(--text); }

/* ---------- Animações de entrada (ao rolar) ---------- */
.js [data-reveal] {
  opacity: 0;
  transform: translate3d(0, 34px, 0);
  transition: opacity 1s var(--ease-out), transform 1.15s var(--ease-out);
  transition-delay: calc(var(--d, 0) * 1ms);
}
.js [data-reveal='fade'] { transform: none; }
.js [data-reveal='img'] {
  opacity: 1;
  transform: none;
  clip-path: inset(10% 8% 10% 8%);
  transition: clip-path 1.5s var(--ease-out);
}
.js [data-reveal='img'] img {
  transform: scale(1.14);
  transition: transform 1.8s var(--ease-out);
}
.js [data-reveal].is-in { opacity: 1; transform: none; clip-path: inset(0 0 0 0); }
.js [data-reveal='img'].is-in img { transform: none; }

/* ---------- Avisos (toasts) ---------- */
.toasts {
  position: fixed;
  left: 50%;
  bottom: calc(22px + env(safe-area-inset-bottom));
  z-index: 90;
  display: grid;
  gap: 10px;
  width: min(100% - 32px, 440px);
  transform: translateX(-50%);
  pointer-events: none;
}
.toast {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 15px 18px;
  border: 1px solid var(--line-2);
  border-radius: 6px;
  background: rgba(23, 17, 12, .97);
  box-shadow: 0 24px 50px -20px #000;
  color: var(--text-2);
  font-size: .92rem;
  line-height: 1.5;
  pointer-events: auto;
  cursor: pointer;
  animation: toastIn .5s var(--ease-out) both;
}
.toast .icon { width: 20px; height: 20px; color: var(--gold); margin-top: 1px; }
.toast strong { color: var(--text); font-weight: 500; }
.toast.is-out { animation: toastOut .3s var(--ease) forwards; }
@keyframes toastIn { from { opacity: 0; transform: translateY(16px) scale(.98); } }
@keyframes toastOut { to { opacity: 0; transform: translateY(10px); } }

/* ---------- Aviso quando o site não consegue abrir (ver index.html) ---------- */
.falha {
  position: fixed;
  left: 50%;
  bottom: calc(24px + env(safe-area-inset-bottom));
  z-index: 95;
  width: min(100% - 32px, 420px);
  padding: 22px;
  transform: translateX(-50%);
  border: 1px solid var(--line-2);
  border-radius: 8px;
  background: #17110c;
  color: var(--text-2);
  text-align: center;
  font: 400 .95rem/1.5 var(--font-sans);
  box-shadow: 0 24px 60px -20px #000;
}
.falha[hidden] { display: none; }
.falha-titulo { color: var(--text); font-weight: 500; margin-bottom: 6px; }
.falha button {
  margin-top: 16px;
  min-height: 46px;
  padding: 0 26px;
  border-radius: var(--radius);
  background: var(--gold-grad);
  color: #1b130b;
  font: 600 .74rem/1 var(--font-sans);
  letter-spacing: .2em;
  text-transform: uppercase;
}

/* ---------- Menos movimento (acessibilidade) ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    transition-delay: 0s !important;
  }
  .js [data-reveal], .js [data-reveal='img'] { opacity: 1; transform: none; clip-path: none; }
}
