* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Manrope', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.25s ease, color 0.25s ease;
}

/* Só para leitores de tela e buscadores (ex.: nome do restaurante quando a
   exibição do título em texto está desligada em Configurações). */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.font-display {
  font-family: 'Fraunces', Georgia, serif;
}

::selection {
  background-color: var(--accent);
  color: var(--bg);
}

/* ---------- Hero ---------- */

.hero {
  position: relative;
  overflow: hidden;
  padding: 2.25rem 1.5rem 1.25rem;
  text-align: center;
}

.hero-leaf {
  position: absolute;
  top: -1.5rem;
  right: -2.5rem;
  width: 14rem;
  height: 14rem;
  color: rgba(var(--accent-secondary-rgb), 0.5);
  pointer-events: none;
}

/* Alternância claro/escuro (canto superior direito do topo) */
.theme-toggle {
  position: absolute;
  top: 0.9rem;
  right: 0.9rem;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  padding: 0;
  border-radius: 50%;
  border: 1px solid var(--hairline);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.theme-toggle:hover {
  background: var(--accent-secondary);
  color: var(--on-accent-secondary);
  border-color: transparent;
}

.theme-toggle:focus-visible,
.hero-action:focus-visible,
.category-rail button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.theme-toggle svg {
  width: 1.25rem;
  height: 1.25rem;
}

/* No claro mostra a lua (vai pro escuro); no escuro mostra o sol (volta pro claro). */
.theme-toggle .icon-sun { display: none; }
[data-theme="dark"] .theme-toggle .icon-moon { display: none; }
[data-theme="dark"] .theme-toggle .icon-sun { display: block; }

/* Logo maior: ocupa o topo como protagonista (nome do restaurante, se
   ligado em Configurações, vem abaixo dela). */
.hero-logo {
  display: block;
  width: auto;
  height: auto;
  max-width: min(300px, 78vw);
  max-height: 200px;
  margin: 0 auto 0.75rem;
  object-fit: contain;
}

/* Logo costuma ser escura (feita pro fundo claro): no tema escuro ela ganha uma
   plaquinha com a cor de fundo do tema claro, para continuar legível. */
[data-theme="dark"] .hero-logo {
  background: var(--logo-plate, #fff);
  padding: 0.75rem 1.25rem;
  border-radius: 1.25rem;
}

.hero h1 {
  font-size: 3rem;
  line-height: 1;
  margin: 0.25rem 0 0;
  font-weight: 500;
}

.hero .tagline {
  max-width: 26rem;
  margin: 0.75rem auto 0;
  font-size: 1.05rem;
  font-style: italic;
  font-weight: 400;
  line-height: 1.5;
  color: rgba(var(--text-rgb), 0.74);
}

/* Selo "Aberto agora · fecha às 23:00" */
.hero-status {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin: 1.1rem 0 0;
  padding: 0.35rem 0.95rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.hero-status .dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: currentColor;
}

.hero-status.open {
  background: rgba(var(--accent-secondary-rgb), 0.16);
  color: var(--accent-secondary);
}

.hero-status.closed {
  background: rgba(var(--muted-rgb), 0.16);
  color: var(--muted);
}

/* Atalhos: WhatsApp · Instagram · Como chegar */
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.6rem;
  margin: 1rem 0 0;
}

.hero-action {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.5rem 1rem;
  border-radius: 999px;
  border: 1px solid var(--hairline);
  background: var(--surface);
  color: var(--text);
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.hero-action svg {
  width: 1.05rem;
  height: 1.05rem;
  color: var(--accent);
  transition: color 0.15s ease;
}

.hero-action:hover {
  background: var(--accent-secondary);
  color: var(--on-accent-secondary);
  border-color: transparent;
}

.hero-action:hover svg {
  color: var(--on-accent-secondary);
}

/* Divisor fino com uma folha no meio, separando o topo do cardápio */
.hero-divider {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  max-width: 22rem;
  margin: 1.5rem auto 0;
  color: var(--accent);
}

.hero-divider span {
  flex: 1;
  height: 1px;
  background: linear-gradient(to right, transparent, rgba(var(--accent-rgb), 0.45));
}

.hero-divider span:last-child {
  background: linear-gradient(to left, transparent, rgba(var(--accent-rgb), 0.45));
}

.hero-divider svg {
  width: 0.9rem;
  height: 0.9rem;
  flex-shrink: 0;
}

/* Celular: atalhos só com o ícone (o texto fica só para leitores de tela). */
@media (max-width: 600px) {
  .hero-actions { gap: 0.75rem; }

  .hero-action {
    justify-content: center;
    width: 2.75rem;
    height: 2.75rem;
    padding: 0;
    border-radius: 50%;
  }

  .hero-action svg {
    width: 1.3rem;
    height: 1.3rem;
  }

  .hero-action span {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
  }
}

@media (max-width: 480px) {
  .hero { padding: 2rem 1.25rem 1rem; }
  .hero-logo { max-height: 170px; }
  .hero h1 { font-size: 2.4rem; }
}

/* ---------- Category nav ---------- */

/* O wrapper é quem fica fixo no topo; o <nav> dentro dele rola na horizontal.
   Os degradês das pontas (::before/::after) só aparecem do lado em que ainda
   há categorias escondidas (classes fade-left/fade-right, ver menu.js). */
.category-rail-wrap {
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgba(var(--bg-rgb), 0.95);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--hairline);
}

.category-rail-wrap::before,
.category-rail-wrap::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2.25rem;
  z-index: 1;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.category-rail-wrap::before {
  left: 0;
  background: linear-gradient(to right, var(--bg), rgba(var(--bg-rgb), 0));
}

.category-rail-wrap::after {
  right: 0;
  background: linear-gradient(to left, var(--bg), rgba(var(--bg-rgb), 0));
}

.category-rail-wrap.fade-left::before,
.category-rail-wrap.fade-right::after {
  opacity: 1;
}

.category-rail {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  white-space: nowrap;
  padding: 0.75rem 1rem;
  scrollbar-width: none; /* celular/tablet: sem barra de rolagem (os degradês avisam) */
}

.category-rail::-webkit-scrollbar {
  display: none;
}

/* Com mouse (computador) a barra fina continua, porque lá não dá pra "deslizar". */
@media (hover: hover) and (pointer: fine) {
  .category-rail {
    scrollbar-width: thin;
    scrollbar-color: rgba(var(--text-rgb), 0.25) transparent;
  }
  .category-rail::-webkit-scrollbar {
    display: block;
    height: 3px;
  }
  .category-rail::-webkit-scrollbar-thumb {
    background-color: rgba(var(--text-rgb), 0.25);
    border-radius: 2px;
  }
}

.category-rail button {
  flex-shrink: 0;
  border: 1px solid var(--hairline);
  border-radius: 999px;
  padding: 0.4rem 1rem;
  font-size: 0.9rem;
  font-weight: 500;
  font-family: inherit;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.category-rail button.active {
  background: var(--accent-secondary);
  border-color: var(--accent-secondary);
  color: var(--on-accent-secondary);
}

.category-rail button:hover:not(.active) {
  color: var(--text);
  border-color: rgba(var(--text-rgb), 0.3);
}

/* ---------- Sugestões do Chef (carrossel) ---------- */

.chef-suggestions {
  padding: 2rem 1.25rem 0.5rem;
  border-bottom: 1px solid var(--hairline);
}

.chef-suggestions-inner {
  max-width: 88rem;
  margin: 0 auto;
}

.chef-suggestions .category-heading {
  margin-bottom: 1.25rem;
}

.chef-carousel-wrap {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.chef-carousel {
  flex: 1;
  min-width: 0; /* permite o filho encolher certo dentro do flex com overflow */
  overflow-x: auto;
  overflow-y: hidden;
  overflow-anchor: none;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none; /* Firefox */
}

.chef-carousel::-webkit-scrollbar {
  display: none; /* Chrome, Safari, Edge */
}

.chef-arrow {
  flex-shrink: 0;
  width: 2.35rem;
  height: 2.35rem;
  border-radius: 50%;
  border: 1px solid var(--hairline);
  background: var(--surface);
  color: var(--text);
  font-family: 'Manrope', system-ui, sans-serif;
  font-size: 1.1rem;
  font-weight: 700;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.chef-arrow:hover {
  background: var(--accent-secondary);
  color: var(--on-accent-secondary);
}

.chef-arrow[hidden] {
  display: none;
}

.chef-track {
  display: flex;
  gap: 1rem;
  justify-content: flex-start;
}

/* Aplicada via JS só quando os cards cabem todos sem precisar rolar —
   nunca junto com overflow real, pra não esbarrar no bug clássico de
   flex centralizado que "esconde" o início do conteúdo que rola. */
.chef-track.is-centered {
  justify-content: center;
}

.chef-card {
  flex: 0 0 100%;
  background: var(--surface);
  border-radius: 0.85rem;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

@media (min-width: 700px) {
  .chef-card { flex-basis: calc(50% - 0.5rem); }
}
@media (min-width: 1024px) {
  .chef-card { flex-basis: calc(25% - 0.75rem); }
}
@media (min-width: 1440px) {
  .chef-card { flex-basis: calc(20% - 0.8rem); }
}

.chef-card-image {
  position: relative;
  width: 55%;
  margin: 1.1rem auto 0;
  padding-top: 55%; /* mesma % da largura -> continua quadrada (1:1) */
  background: rgba(var(--text-rgb), 0.06);
  overflow: hidden;
  border-radius: 0.5rem;
  cursor: pointer;
}

.chef-card-image img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.chef-card-body {
  padding: 0.9rem 1.1rem 1.1rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.chef-card-name {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.3;
}

.chef-card-desc {
  margin: 0.4rem 0 0;
  font-size: 0.85rem;
  line-height: 1.4;
  color: var(--muted);
  flex: 1;
}

.chef-card-price {
  margin: 0.7rem 0 0;
  font-variant-numeric: tabular-nums;
  color: var(--accent);
  font-weight: 700;
  font-size: 0.95rem;
}

/* ---------- Menu content ---------- */

.menu-wrap {
  max-width: 42rem;
  margin: 0 auto;
  padding: 2.5rem 1.25rem 6rem;
}

.category-section {
  scroll-margin-top: 5.5rem;
  padding-bottom: 3.5rem;
}

.category-heading {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.category-heading h2 {
  font-size: 1.75rem;
  font-style: italic;
  font-weight: 500;
  margin: 0;
  white-space: nowrap;
}

.category-heading .rule {
  height: 1px;
  flex: 1;
  background: linear-gradient(to right, rgba(var(--accent-rgb), 0.4), transparent);
}

ul.item-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.item-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 0;
  border-bottom: 1px solid var(--hairline);
}

.item-row:last-child {
  border-bottom: none;
}

.item-thumb {
  flex-shrink: 0;
  width: 4rem;
  height: 4rem;
  border-radius: 0.5rem;
  overflow: hidden;
  background: var(--surface);
  cursor: pointer;
}

.item-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.item-info {
  min-width: 0;
  flex: 1;
}

.item-name {
  font-size: 1.05rem;
  line-height: 1.35;
  margin: 0;
}

.chef-badge {
  display: inline-block;
  margin-left: 0.4rem;
  padding: 0.1rem 0.5rem;
  border-radius: 999px;
  background: rgba(var(--accent-rgb), 0.16);
  color: var(--accent);
  font-family: 'Manrope', system-ui, sans-serif;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  vertical-align: middle;
  white-space: nowrap;
}

.item-desc {
  font-size: 0.85rem;
  line-height: 1.4;
  color: var(--muted);
  margin: 0.25rem 0 0;
}

.dietary-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin: 0.45rem 0 0;
}

.diet-tag {
  display: inline-block;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 600;
  line-height: 1.4;
  white-space: nowrap;
}

.diet-tag-safe {
  background: rgba(var(--accent-secondary-rgb), 0.16);
  color: var(--accent-secondary);
}

.diet-tag-warn {
  background: rgba(var(--accent-rgb), 0.16);
  color: var(--accent);
}

.item-price {
  flex-shrink: 0;
  padding-top: 0.1rem;
  font-variant-numeric: tabular-nums;
  color: var(--accent);
  font-size: 0.95rem;
}

/* ---------- Footer ---------- */

.site-footer {
  border-top: 1px solid var(--hairline);
  padding: 2.5rem 1.5rem;
  text-align: center;
  font-size: 0.9rem;
  color: var(--muted);
}

.site-footer .headline {
  font-family: 'Fraunces', Georgia, serif;
  font-style: italic;
  font-size: 1.15rem;
  color: var(--text);
  margin: 0 0 0.5rem;
}

.site-footer .note {
  max-width: 22rem;
  margin: 0 auto;
}

.social-icons {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin: 1.1rem 0 0;
}

.social-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.35rem;
  height: 2.35rem;
  flex-shrink: 0;
  border-radius: 50%;
  border: 1px solid var(--hairline);
  background: var(--surface);
  color: var(--accent);
  transition: background-color 0.15s ease, color 0.15s ease;
}

.social-icon:hover {
  background: var(--accent-secondary);
  color: var(--on-accent-secondary);
}

.social-icon svg {
  width: 1.2rem;
  height: 1.2rem;
}

.address-block {
  max-width: 22rem;
  margin: 1.5rem auto 0;
}

.address-block .address-text {
  margin: 0 0 0.75rem;
}

.map-embed {
  display: block;
  width: 100%;
  height: 160px;
  border: 0;
  border-radius: 0.75rem;
}

.map-fallback-link {
  color: var(--accent);
  text-decoration: none;
}

.map-fallback-link:hover {
  text-decoration: underline;
}

.hours-block {
  margin-top: 1.5rem;
}

.hours-status {
  display: inline-block;
  margin: 0 0 0.75rem;
  padding: 0.3rem 0.9rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.hours-status.open {
  background: rgba(var(--accent-secondary-rgb), 0.16);
  color: var(--accent-secondary);
}

.hours-status.closed {
  background: rgba(var(--muted-rgb), 0.16);
  color: var(--muted);
}

.hours-list {
  list-style: none;
  margin: 0 auto;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  max-width: 28rem;
  font-size: 0.8rem;
}

.hours-list li {
  margin: 0 0.5rem 0.35rem;
}

.hours-list strong {
  color: var(--text);
  font-weight: 600;
}

.site-footer .fine-print {
  margin-top: 1.5rem;
  font-size: 0.75rem;
  color: rgba(var(--muted-rgb), 0.7);
}

/* ---------- Lightbox (foto ampliada) ---------- */

.lightbox-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 200;
  align-items: center;
  justify-content: center;
  padding: 2.5rem 1.25rem;
  background: rgba(0, 0, 0, 0.85);
}

.lightbox-overlay.is-open {
  display: flex;
}

.lightbox-image {
  display: block;
  max-width: 100%;
  max-height: 85vh;
  border-radius: 0.5rem;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.lightbox-close {
  position: absolute;
  top: 1rem;
  right: 1.25rem;
  width: 2.5rem;
  height: 2.5rem;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
}

.lightbox-close:hover {
  background: rgba(255, 255, 255, 0.22);
}
