:root {
  --bg: #14100c;
  --card: #1d1712;
  --border: #3b2e20;
  --text: #efe6d2;
  --muted: #bfb59f;
  --primary: #c9a227;
  --primary-soft: color-mix(in srgb, var(--primary) 72%, black);
  --ember: #a84c22;
  --radius: 20px;
  --radius-sm: 14px;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.35), 0 1px 2px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 10px 28px rgba(0, 0, 0, 0.45), 0 2px 8px rgba(0, 0, 0, 0.3);
  --font-display: "Fraunces", Georgia, "Times New Roman", serif;
  --font-body: "Work Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  /* Altura real da navegação fixa (secao-nav + cat-nav), medida em JS — o secao-nav pode quebrar
     em 1 ou 2 linhas dependendo de quantas seções a casa tem, então essa altura varia por casa e
     por tela. O valor aqui é só o "chute" inicial até a primeira medição (ver syncNavOffset). */
  --nav-h: 118px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
}
html { scroll-behavior: smooth; }

.hidden { display: none !important; }
.muted { color: var(--muted); }

/* ---------- Estados (carregando / não encontrado) ---------- */

.state-screen {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2rem;
  gap: 0.6rem;
}
.state-icon { font-size: 2.4rem; }
.state-screen h1 { font-family: var(--font-display); font-weight: 500; font-size: 1.3rem; margin: 0; }

.spinner {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Hero: carrossel/capa + identidade da casa, tudo sobreposto na foto ---------- */
/* Padrão de menu "estampa" (referência enviada pela Karina): conteúdo centralizado, ancorado
   embaixo do quadro, sobre gradiente escuro que garante leitura do texto por cima da foto. */

.hero {
  position: relative;
  min-height: 460px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  text-align: center;
  padding: 2.2rem 1.4rem 2.1rem;
  overflow: hidden;
}
@media (min-width: 640px) {
  .hero { min-height: 600px; padding: 3.5rem 2rem 2.9rem; }
}
/* Telas largas (notebook/desktop): a capa ocupava uma faixa muito "achatada" (~3:1) e o
   object-fit: cover cortava e ampliava demais a foto. Aumentamos a altura proporcionalmente à
   largura para a foto aparecer mais inteira. */
@media (min-width: 1024px) {
  .hero { min-height: clamp(600px, 52vw, 820px); }
}

.hero-media { position: absolute; inset: 0; }
.cover-fallback {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 20% 30%, color-mix(in srgb, var(--primary) 18%, transparent) 0, transparent 45%),
    radial-gradient(circle at 80% 75%, color-mix(in srgb, var(--primary) 14%, transparent) 0, transparent 40%),
    var(--bg);
}
.cover-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  /* Enquadra um pouco acima do centro: fachadas/letreiros ficam no terço superior da foto. */
  object-position: center 30%;
  display: block;
  animation: coverZoom 20s ease-out forwards;
}
@keyframes coverZoom {
  from { transform: scale(1.03); }
  to { transform: scale(1); }
}
.hero-gradient {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(20, 16, 12, 0.25) 0%, rgba(20, 16, 12, 0.5) 55%, var(--bg) 97%);
  pointer-events: none;
}

/* Carrossel de fotos da casa — passa sozinho (ver setupCarousel em app.js) e também dá pra
   arrastar/deslizar a qualquer momento, via scroll nativo com snap (bom pro touch do celular). */
.carousel {
  width: 100%;
  height: 100%;
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.carousel::-webkit-scrollbar { display: none; }
.carousel-slide {
  flex: 0 0 100%;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 30%;
  display: block;
  scroll-snap-align: start;
}
.carousel-dots {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 12px;
  z-index: 2;
  display: flex;
  justify-content: center;
  gap: 6px;
}
.carousel-dots.hidden { display: none !important; }
.carousel-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(239, 230, 212, 0.45);
  transition: background 0.2s ease, transform 0.2s ease;
}
.carousel-dot.active { background: var(--primary); transform: scale(1.35); }

.hero-content { position: relative; z-index: 1; max-width: 560px; }

.hero-logo {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
  margin: 0 auto 1.1rem;
  border: 1px solid color-mix(in srgb, var(--primary) 55%, transparent);
  animation: popIn 0.55s cubic-bezier(0.34, 1.56, 0.64, 1) both;
  animation-delay: 0.08s;
}
@keyframes popIn {
  from { opacity: 0; transform: scale(0.7); }
  to { opacity: 1; transform: scale(1); }
}

.hero-content .eyebrow {
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 0.6rem;
}
.hero-content h1 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 2.15rem;
  letter-spacing: 0.02em;
  margin: 0;
  color: var(--text);
}
@media (min-width: 640px) {
  .hero-content h1 { font-size: 2.9rem; }
}
.hero-content .divider {
  width: 40px;
  height: 1px;
  background: var(--primary-soft);
  margin: 1.05rem auto;
}
.hero-content .tagline {
  font-size: 0.74rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 1.3rem;
}

.whatsapp-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  border: 1px solid var(--primary);
  color: var(--text);
  background: color-mix(in srgb, var(--primary) 12%, transparent);
  text-decoration: none;
  font-size: 0.76rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.6rem 1.25rem;
  border-radius: 999px;
  transition: transform 0.15s ease, background-color 0.15s ease;
}
.whatsapp-btn svg { color: var(--primary); flex: none; }
.whatsapp-btn:active { transform: scale(0.97); }

/* ---------- Navegação: Seção (grupo principal) + Categoria (dentro da seção ativa) ---------- */
/* Duas camadas empilhadas e fixas no topo: a de cima troca de Seção (Menu, Bebidas...), a de
   baixo mostra só as categorias da Seção atualmente em foco — em vez de uma barra única
   listando as categorias de todas as seções juntas, o que fica ilegível quando a casa tem
   várias seções com várias categorias cada (caso do cardápio completo). */

.nav-wrap {
  position: sticky;
  top: 0;
  z-index: 5;
  background: color-mix(in srgb, var(--bg) 90%, transparent);
  backdrop-filter: blur(8px) saturate(140%);
  -webkit-backdrop-filter: blur(8px) saturate(140%);
  border-bottom: 1px solid var(--border);
  transition: box-shadow 0.2s ease;
}
.nav-wrap.scrolled { box-shadow: 0 8px 18px rgba(0, 0, 0, 0.35); }

.secao-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 18px;
  justify-content: center;
  max-width: 780px;
  margin: 0 auto;
  padding: 0.75rem 0.8rem 0.5rem;
  border-bottom: 1px solid color-mix(in srgb, var(--border) 70%, transparent);
}
.secao-nav.hidden { display: none !important; }

.secao-nav-btn {
  flex: 0 0 auto;
  background: none;
  border: none;
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 500;
  color: var(--muted);
  font-size: 0.84rem;
  letter-spacing: 0.03em;
  padding: 0.2rem 0.15rem;
  cursor: pointer;
  white-space: nowrap;
  transition: color 0.15s ease;
}
.secao-nav-btn:hover { color: var(--primary); }
.secao-nav-btn.active { color: var(--primary); }

.cat-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  max-width: 780px;
  margin: 0 auto;
  padding: 0.5rem 0.8rem 0.75rem;
  scrollbar-width: none;
}
.cat-nav::-webkit-scrollbar { display: none; }

.cat-nav-group {
  display: none;
  flex-wrap: wrap;
  gap: 2px 0;
  justify-content: center;
  width: 100%;
}
.cat-nav-group.visible { display: flex; }

.cat-nav-btn {
  flex: 0 0 auto;
  background: none;
  border: none;
  font-family: var(--font-body);
  color: var(--muted);
  text-decoration: none;
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.45rem 0.75rem;
  cursor: pointer;
  white-space: nowrap;
  transition: color 0.15s ease;
}
.cat-nav-btn:hover { color: var(--primary); }
.cat-nav-btn.active { color: var(--primary); }

/* ---------- Conteúdo ---------- */

main { max-width: 780px; margin: 0 auto; padding-bottom: 2rem; }

/* Marcador de Seção (categoria-mãe, ex.: "Menu", "Bebidas") — divide o cardápio em grupos sem
   quebrar o padrão "flat" da referência; só aparece quando a casa tem mais de uma seção. */
.secao-block { scroll-margin-top: calc(var(--nav-h) + 10px); }
.secao-marker { text-align: center; padding: 2.8rem 1rem 0; }
.secao-marker .secao-name {
  display: inline-block;
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 500;
  font-size: 1rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--primary);
}
.section-divider-full { max-width: 780px; margin: 2.2rem auto 0; height: 1px; background: var(--border); }

/* Seção rodízio/preço fixo: sem preço em cada item, então a descrição da seção (onde mora o
   valor, ex.: "R$79,90 Por pessoa") vira um destaque visível em vez de some — substitui, aos
   olhos de quem está lendo o cardápio, a coluna de preço que não vai aparecer nos itens abaixo. */
.secao-rodizio-banner { max-width: 560px; margin: 1.1rem auto 0; padding: 0 1.3rem; text-align: center; }
.secao-rodizio-banner p {
  margin: 0;
  padding: 0.85rem 1.3rem;
  border: 1px solid color-mix(in srgb, var(--primary) 45%, transparent);
  border-radius: 4px;
  background: color-mix(in srgb, var(--primary) 10%, transparent);
  font-family: var(--font-display);
  font-style: italic;
  font-size: 0.95rem;
  line-height: 1.5;
  color: var(--text);
}

.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.reveal.visible { opacity: 1; transform: translateY(0); }

/* Categoria (subcategoria, ex.: "Entradas", "Burgers") */
.cat-section { padding: 3.4rem 1.3rem 0.4rem; scroll-margin-top: calc(var(--nav-h) + 10px); }
@media (min-width: 640px) {
  .cat-section { padding: 3.8rem 2.4rem 0.4rem; }
}

.section-head { text-align: center; margin-bottom: 0; }
.cat-title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 1.65rem;
  letter-spacing: 0.02em;
  margin: 0;
  color: var(--text);
}
@media (min-width: 640px) { .cat-title { font-size: 1.95rem; } }

.ember-rule { display: flex; align-items: center; justify-content: center; gap: 10px; margin: 0.9rem auto 0; width: 150px; }
.ember-rule span { height: 1px; flex: 1; background: linear-gradient(90deg, transparent, var(--border) 40%, var(--border) 60%, transparent); }
.ember-rule .dot { flex: none; width: 5px; height: 5px; border-radius: 50%; background: var(--ember); }

.cat-desc, .section-note {
  text-align: center;
  font-size: 0.78rem;
  color: var(--muted);
  font-style: italic;
  margin: 0.9rem auto 0;
  max-width: 46ch;
  line-height: 1.5;
}

/* lista de itens — grade de 2 colunas (igual ao livemenu.app original), foto do prato ao lado
   do nome/descrição/preço de cada item em vez de numa galeria à parte. */
.item-grid { display: grid; grid-template-columns: 1fr 1fr; column-gap: 1.3rem; margin-top: 1.5rem; }
@media (min-width: 640px) { .item-grid { column-gap: 2rem; } }
@media (max-width: 420px) { .item-grid { column-gap: 0.8rem; } }

.item-row {
  display: flex;
  align-items: flex-start;
  gap: 0.7rem;
  padding: 1.05rem 0;
  border-bottom: 1px solid var(--border);
  /* Grid items default to min-width:auto (o conteúdo mínimo intrínseco) — sem isso, um preço
     "não quebrável" (white-space:nowrap) força a coluna do grid a estourar a tela em vez de
     deixar o texto quebrar/comprimir normalmente. */
  min-width: 0;
}
.item-row:last-child { border-bottom: none; }

.item-body { flex: 1; min-width: 0; }
.item-top { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 0.3rem 0.5rem; }
.item-name-row { display: flex; align-items: baseline; gap: 0.5rem; flex-wrap: wrap; min-width: 0; }
.item-name { font-family: var(--font-display); font-weight: 500; font-size: 1.05rem; color: var(--text); letter-spacing: 0.01em; }

.item-seal {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  border: 1px solid var(--primary-soft);
  border-radius: 20px;
  padding: 0.15rem 0.6rem 0.15rem 0.4rem;
  font-size: 0.6rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--primary);
  font-weight: 600;
}
.item-seal svg { width: 10px; height: 10px; flex: none; }

.item-desc {
  white-space: pre-line; /* composição dos kits do delivery vem uma por linha */
  font-size: 0.8rem;
  color: var(--muted);
  font-weight: 300;
  margin-top: 0.3rem;
  line-height: 1.5;
}
.item-price {
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 0.95rem;
  color: var(--primary);
  white-space: nowrap;
  flex: none;
  padding-top: 0.1rem;
}
.item-tags { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-top: 0.5rem; }
.item-tag {
  font-size: 0.62rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.12rem 0.55rem;
}

.item-photo {
  flex: none;
  width: 104px;
  height: 104px;
  border-radius: 6px;
  overflow: hidden;
  background: var(--card);
  cursor: pointer;
  transition: opacity 0.15s ease;
}
.item-photo:hover, .item-photo:focus-visible { opacity: 0.82; outline: none; }
@media (max-width: 640px) { .item-photo { width: 84px; height: 84px; } }
@media (max-width: 420px) { .item-photo { width: 68px; height: 68px; } }
.item-photo img { width: 100%; height: 100%; object-fit: cover; filter: saturate(0.92) contrast(1.03); display: block; }

/* ---------- Detalhe do item (modal aberto ao clicar na foto) ---------- */

body.modal-open { overflow: hidden; }

.item-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 8, 5, 0.72);
  backdrop-filter: blur(2px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
  padding: 1.2rem;
}
.item-modal-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  max-width: 440px;
  width: 100%;
  max-height: 88vh;
  overflow-y: auto;
  position: relative;
  box-shadow: var(--shadow-md);
}
.item-modal-close {
  position: absolute;
  top: 0.6rem;
  right: 0.7rem;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: rgba(20, 16, 12, 0.65);
  color: var(--text);
  font-size: 1.3rem;
  line-height: 1;
  cursor: pointer;
  z-index: 1;
}
.item-modal-photo { width: 100%; aspect-ratio: 1 / 1; background: var(--bg); }
.item-modal-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.item-modal-body { padding: 1.3rem 1.4rem 1.6rem; }
.item-modal-top { display: flex; justify-content: space-between; align-items: baseline; gap: 0.8rem; }
.item-modal-top h3 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1.3rem;
  margin: 0;
  color: var(--text);
}
.item-modal-price { font-family: var(--font-body); font-weight: 500; color: var(--primary); white-space: nowrap; }
.item-modal-desc { color: var(--muted); font-weight: 300; line-height: 1.6; margin: 0.7rem 0 0; white-space: pre-line; }
.item-modal-body .item-seal { margin-top: 0.6rem; }
.item-modal-body .item-tags { margin-top: 0.8rem; }

.empty-menu { text-align: center; padding: 3rem 1rem; color: var(--muted); }
.empty-menu .state-icon { font-size: 2rem; margin-bottom: 0.5rem; }

.footer-note {
  text-align: center;
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  opacity: 0.75;
  padding: 3rem 0 2.2rem;
}

/* ---------- Botão flutuante de WhatsApp ---------- */
/* Mantém o verde reconhecível do WhatsApp mesmo no tema escuro — é um elemento utilitário à
   parte da identidade visual do cardápio, e reconhecimento imediato importa mais aqui. */
.floating-whatsapp {
  position: fixed;
  right: 1.1rem;
  bottom: 1.1rem;
  z-index: 10;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: #25d366;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.5);
  opacity: 0;
  transform: translateY(14px) scale(0.9);
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
}
.floating-whatsapp.visible { opacity: 1; transform: translateY(0) scale(1); pointer-events: auto; }
.floating-whatsapp:active { transform: scale(0.92); }
.floating-whatsapp.hidden { display: none !important; }

@media (prefers-reduced-motion: reduce) {
  .cover-img,
  .hero-logo,
  .reveal,
  .cat-nav-btn,
  .whatsapp-btn,
  .floating-whatsapp {
    animation: none !important;
    transition: none !important;
  }
  .reveal { opacity: 1; transform: none; }
}

/* ---------- Faixa de condições do delivery (só em ?canal=delivery) ---------- */
.delivery-info {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.4rem 1.4rem;
  padding: 0.85rem 1rem;
  font-size: 0.82rem;
  color: var(--muted);
  border-bottom: 1px solid color-mix(in srgb, var(--primary) 25%, transparent);
  background: color-mix(in srgb, var(--primary) 7%, transparent);
  text-align: center;
}
.delivery-info strong { color: var(--text); font-weight: 600; }

.delivery-fee-list { margin: 0.4rem 0 0; padding-left: 1.1rem; max-height: 220px; overflow-y: auto; font-size: 0.85rem; text-align: left; }
#deliveryInfo details { margin-top: 0.3rem; }
#deliveryInfo summary { cursor: pointer; font-weight: 600; }
