/* ============================================================
   ANTICA PIZZA — Carta Digital
   Refined Italian-warmth aesthetic: cream + gold + ember dark.
   Pure CSS, mobile-first. No frameworks.
   ============================================================ */

:root {
  /* Palette */
  --bg-primary: #FAFAF7;
  --bg-card: #FFFFFF;
  --bg-dark: #1A1208;
  --text-primary: #1A1A1A;
  --text-secondary: #5A5A5A;
  --gold: #C9A84C;
  --gold-light: #E8C96C;
  /* deepened from #A07830 → meets WCAG AA (≈4.9:1 on white) for prices &
     small text while staying clearly gold */
  --gold-dark: #8C6824;
  --accent-orange: #D4713A;
  --border: #E8E0D0;

  /* Type */
  --font-display: "Playfair Display", Georgia, serif;
  --font-body: "Lato", -apple-system, BlinkMacSystemFont, sans-serif;

  /* Layout */
  --maxw: 720px;
  --nav-h: 64px;
  --radius: 10px;
  --shadow-sm: 0 1px 3px rgba(26, 18, 8, 0.04);
  --shadow-lift: 0 12px 28px -10px rgba(26, 18, 8, 0.22);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  /* Section offset is handled by scroll-margin-top on .menu-section.
     Keep this 0 — otherwise it STACKS with scroll-margin and double-offsets
     (sections landed ~168px down instead of ~84px). */
  scroll-padding-top: 0;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  background-color: var(--bg-primary);
  /* layered warm atmosphere: soft gold vignettes over cream */
  background-image:
    radial-gradient(120% 60% at 50% -10%, rgba(201, 168, 76, 0.10), transparent 60%),
    radial-gradient(80% 50% at 100% 100%, rgba(212, 113, 58, 0.06), transparent 55%);
  color: var(--text-primary);
  line-height: 1.5;
  padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom, 0px) + 12px);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  /* NOTE: background-attachment:fixed removed — it causes scroll jank/jitter
     on mobile (esp. iOS Safari) near the top. Gradients scroll with content. */
}

/* ============================================================
   EMBER PARTICLES — wood-oven sparks drifting upward
   ============================================================ */
.embers {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}
.ember {
  position: absolute;
  bottom: -10px;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--gold-light);
  opacity: 0;
  animation: ember-rise linear infinite;
  will-change: transform, opacity;
}
.ember.orange { background: var(--accent-orange); }

@keyframes ember-rise {
  0%   { transform: translateY(0) translateX(0) scale(1); opacity: 0; }
  10%  { opacity: 0.22; }
  50%  { opacity: 0.18; }
  90%  { opacity: 0.12; }
  100% { transform: translateY(-105vh) translateX(14px) scale(0.5); opacity: 0; }
}

/* keep content above the embers */
.app-header, main, .bottom-nav { position: relative; z-index: 1; }

/* ============================================================
   HEADER
   ============================================================ */
.app-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: #ffffff;
  border-bottom: 1px solid transparent;
  border-image: linear-gradient(90deg, transparent, var(--gold), transparent) 1;
  /* FIXED height — header no longer resizes on scroll (that caused the
     top-of-page jitter on mobile). Only the shadow/blur change. */
  padding: 11px 16px;
  transition: box-shadow 0.3s ease, background 0.3s ease;
}
.app-header.scrolled {
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 8px 22px -12px rgba(26, 18, 8, 0.35);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

.header-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

/* ---- Brand logo: the real logo.svg, inlined (light header) ---- */
.brand-logo {
  height: 50px;
  width: auto;
  display: block;
  flex: none;
  opacity: 0;
  transform: translateY(10px);
  animation: logo-in 0.7s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes logo-in {
  to { opacity: 1; transform: translateY(0); }
}

/* Language switcher (light header) */
.lang-switch {
  flex: none;
  display: flex;
  gap: 2px;
  background: rgba(31, 58, 46, 0.05);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 3px;
}
.lang-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--text-secondary);
  background: transparent;
  border: none;
  border-radius: 999px;
  padding: 0 9px;
  min-width: 34px;
  min-height: 44px; /* touch-target-size: ≥44px tap area */
  cursor: pointer;
  touch-action: manipulation; /* tap-delay: kill 300ms */
  transition: color 0.2s ease, background 0.2s ease;
}
.lang-btn:hover { color: var(--text-primary); }
.lang-btn.active {
  color: #fff;
  background: linear-gradient(135deg, var(--gold), var(--gold-dark));
  box-shadow: 0 1px 6px rgba(140, 104, 36, 0.4);
}

/* focus-states: visible keyboard focus ring on all controls */
.lang-btn:focus-visible,
.nav-tab:focus-visible {
  outline: 2px solid var(--gold-dark);
  outline-offset: 2px;
  border-radius: 8px;
}

/* ============================================================
   MAIN / SECTIONS
   ============================================================ */
main {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 16px;
  /* content fades in once language data is rendered */
  opacity: 1;
  transition: opacity 0.15s ease;
}
main.lang-fading { opacity: 0; }

/* ---- Welcome strip (slim, above first section) ---- */
.hero {
  text-align: center;
  padding: 26px 16px 4px;
  animation: hero-in 0.7s cubic-bezier(0.16, 1, 0.3, 1) both;
}
@keyframes hero-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: none; }
}
.hero-welcome {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 600;
  font-size: clamp(22px, 6vw, 30px);
  letter-spacing: 0.01em;
  color: var(--text-primary);
}
.hero-orn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin: 9px 0;
}
.hero-orn::before,
.hero-orn::after {
  content: "";
  height: 1px;
  width: 44px;
  background: linear-gradient(90deg, transparent, var(--gold));
}
.hero-orn::after { background: linear-gradient(90deg, var(--gold), transparent); }
.hero-orn .d {
  width: 5px;
  height: 5px;
  flex: none;
  background: var(--gold);
  transform: rotate(45deg);
  box-shadow: 0 0 0 3px rgba(201, 168, 76, 0.15);
}
.hero-sub {
  font-family: var(--font-body);
  font-style: italic;
  font-size: 13px;
  letter-spacing: 0.06em;
  color: var(--gold-dark);
}

.menu-section {
  padding: 40px 0 20px;
  scroll-margin-top: 84px;
}
.menu-section + .menu-section {
  border-top: 1px solid var(--border);
}

.section-head {
  text-align: center;
  margin-bottom: 28px;
}
.section-title {
  font-family: var(--font-display);
  font-size: clamp(26px, 7vw, 32px);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--text-primary);
  display: inline-block;
}
/* gold brush underline that draws in on scroll */
.section-title::after {
  content: "";
  display: block;
  height: 3px;
  width: 120px;
  margin: 12px auto 0;
  border-radius: 3px;
  background: linear-gradient(90deg, transparent, var(--gold-dark), var(--gold-light), var(--gold-dark), transparent);
  /* animate transform (GPU) instead of width — no layout reflow */
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.7s cubic-bezier(0.16, 1, 0.3, 1) 0.1s;
}
.menu-section.in-view .section-title::after { transform: scaleX(1); }

.section-note {
  max-width: 460px;
  margin: 14px auto 0;
  font-size: 12.5px;
  font-style: italic;
  color: var(--accent-orange);
  text-align: center;
  line-height: 1.45;
}

/* sub-group title */
.group + .group { margin-top: 26px; }
.group-title {
  display: flex;
  align-items: center;
  gap: 9px;
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-primary);
  margin-bottom: 14px;
}
.group-title::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 0 3px rgba(201, 168, 76, 0.18);
  flex: none;
}

/* ============================================================
   CARD GRID + CARDS
   ============================================================ */
.cards {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.card {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left: 3px solid transparent;
  border-radius: var(--radius);
  padding: 13px 16px;
  box-shadow: var(--shadow-sm);
  /* entrance animation (triggered by .in-view on the section) */
  opacity: 0;
  transform: translateY(20px);
  transition:
    opacity 0.45s ease-out,
    transform 0.45s ease-out,
    border-color 0.2s ease,
    box-shadow 0.2s ease;
  transition-delay: calc(var(--i, 0) * 45ms);
}
.menu-section.in-view .card {
  opacity: 1;
  transform: translateY(0);
}

@media (hover: hover) {
  .card:hover {
    transform: translateY(-3px);
    border-left-color: var(--gold);
    box-shadow: var(--shadow-lift);
  }
  .card:hover .card-price { color: var(--gold-dark); }
}

.card-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
}
.card-name {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.01em;
  color: var(--text-primary);
  line-height: 1.25;
}
/* dotted leader between name and price — classic menu touch */
.card-leader {
  flex: 1 1 auto;
  border-bottom: 1.5px dotted var(--border);
  transform: translateY(-3px);
  min-width: 12px;
}
.card-price {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
  color: var(--gold-dark);
  white-space: nowrap;
  flex: none;
  transition: color 0.2s ease;
}
/* number-tabular: aligned figures so prices don't shift */
.card-price,
.wine-price .val,
.salsa-price .val,
.feature-price { font-variant-numeric: tabular-nums; }
/* translated dish name (shown only when language ≠ ES) — guest understands the
   dish, but the bold Spanish name above is what they tell the waiter. */
.card-name-tr {
  display: block;
  margin-top: 2px;
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 600;
  color: var(--gold-dark);
  letter-spacing: 0.01em;
}
.feature .card-name-tr { margin-top: -8px; margin-bottom: 12px; }
.card-desc {
  font-size: 12px;
  font-style: italic;
  color: var(--text-secondary);
  line-height: 1.45;
  margin-top: 5px;
}
.card-note {
  display: inline-block;
  margin-top: 6px;
  font-size: 11px;
  font-style: italic;
  color: var(--accent-orange);
}

/* ============================================================
   WINE CARDS (region badge + copa/botella)
   ============================================================ */
.card-region {
  display: inline-block;
  font-family: var(--font-body);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gold-dark);
  background: rgba(201, 168, 76, 0.12);
  border: 1px solid rgba(201, 168, 76, 0.3);
  border-radius: 4px;
  padding: 2px 7px;
  margin-bottom: 6px;
}
.wine-prices {
  display: flex;
  gap: 18px;
  margin-top: 8px;
  flex-wrap: wrap;
}
.wine-price {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 13px;
  color: var(--text-primary);
}
.wine-price .label {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-secondary);
}
.wine-price .val {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--gold-dark);
}

/* ============================================================
   SALSAS (two-column price: sin / con relleno)
   ============================================================ */
.salsa-pick-note {
  text-align: center;
  font-size: 12px;
  font-style: italic;
  color: var(--text-secondary);
  background: rgba(201, 168, 76, 0.08);
  border: 1px dashed rgba(201, 168, 76, 0.4);
  border-radius: 8px;
  padding: 9px 12px;
  margin-bottom: 14px;
}
.salsa .card-row { align-items: flex-start; flex-wrap: wrap; }
.salsa .salsa-prices {
  display: flex;
  gap: 10px;
  flex: none;
  margin-left: auto;
}
.salsa-price {
  text-align: center;
  min-width: 64px;
  padding: 4px 8px;
  border-radius: 7px;
  background: var(--bg-primary);
  border: 1px solid var(--border);
}
.salsa-price .label {
  display: block;
  font-size: 9.5px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
}
.salsa-price .val {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
  color: var(--gold-dark);
}

/* ============================================================
   PASTA TYPES (elegant chips list — pick a pasta)
   ============================================================ */
.pasta-types {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}
.pasta-chip {
  flex: 1 1 calc(50% - 9px);
  min-width: 150px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 11px 14px;
  box-shadow: var(--shadow-sm);
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.45s ease-out, transform 0.45s ease-out, border-color 0.2s ease;
  transition-delay: calc(var(--i, 0) * 45ms);
}
.menu-section.in-view .pasta-chip { opacity: 1; transform: translateY(0); }
@media (hover: hover) {
  .pasta-chip:hover { border-color: var(--gold); }
}
.pasta-chip .card-name { font-size: 14px; }
.pasta-chip .card-desc { margin-top: 3px; }

/* ============================================================
   FEATURE (Kids combo menu)
   ============================================================ */
.feature {
  position: relative;
  background:
    linear-gradient(135deg, rgba(201, 168, 76, 0.06), rgba(212, 113, 58, 0.05)),
    var(--bg-card);
  border: 1px solid rgba(201, 168, 76, 0.35);
  border-radius: 14px;
  padding: 20px 18px;
  box-shadow: var(--shadow-sm);
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s ease-out, transform 0.5s ease-out;
}
.menu-section.in-view .feature { opacity: 1; transform: translateY(0); }
.feature-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.feature-name {
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--text-primary);
}
.feature-price {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, var(--gold), var(--gold-dark));
  padding: 5px 14px;
  border-radius: 8px;
  white-space: nowrap;
  box-shadow: 0 4px 12px -4px rgba(160, 120, 48, 0.6);
}
.feature-lines { list-style: none; display: grid; gap: 9px; }
.feature-lines li {
  display: flex;
  gap: 10px;
  font-size: 13.5px;
  color: var(--text-primary);
  line-height: 1.4;
}
.feature-lines li .num {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--gold-dark);
  flex: none;
}

/* ============================================================
   BOTTOM NAVIGATION
   ============================================================ */
.bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 60;
  display: flex;
  background: rgba(255, 255, 255, 0.96);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-top: 1px solid var(--border);
  box-shadow: 0 -6px 20px -8px rgba(26, 18, 8, 0.16);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
.nav-tab {
  flex: 1 1 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  min-height: var(--nav-h);
  padding: 8px 2px 6px;
  background: none;
  border: none;
  border-top: 2px solid transparent;
  color: var(--text-secondary);
  font-family: var(--font-body);
  cursor: pointer;
  touch-action: manipulation; /* tap-delay: kill 300ms */
  transition: color 0.2s ease, border-color 0.25s ease;
}
.nav-tab .nav-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease;
}
.nav-tab .nav-icon svg { width: 23px; height: 23px; display: block; }
.nav-tab .nav-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.nav-tab.active {
  color: var(--gold-dark);          /* svg stroke inherits via currentColor */
  border-top-color: var(--gold);
}
.nav-tab.active .nav-icon { transform: translateY(-1px); }

/* ============================================================
   RESPONSIVE — 2 columns on tablet+
   ============================================================ */
@media (min-width: 600px) {
  .cards { grid-template-columns: 1fr 1fr; }
  /* salsas & feature span full width for readability */
  .group--salsas .cards,
  .group--feature .cards { grid-template-columns: 1fr; }
}

/* very narrow phones: shrink the logo a touch so the header fits one row */
@media (max-width: 400px) {
  .brand-logo { height: 44px; }
}

/* ============================================================
   ACCESSIBILITY — respect reduced motion
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .ember { display: none; }
  .card, .pasta-chip, .feature, .brand-logo, .hero { opacity: 1 !important; transform: none !important; }
}
