/*
 * menu.css — La Stazione · Menu Digitale
 * Stili specifici di pages/menu.php.
 * Font Awesome Free caricato via CDN nell'<head>.
 */

/* ── LAYOUT PAGINA ──────────────────────────────────────────────────────────── */
.menu-page { padding-top: var(--nav-h); min-height: 100vh; }

/* ── HERO ───────────────────────────────────────────────────────────────────── */
.menu-hero {
  background: var(--ink);
  padding: 52px var(--sp-xl) 44px;
  border-bottom: 2px solid var(--orange);
  position: relative;
  overflow: hidden;
}
.menu-hero::before {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(ellipse 70% 80% at 80% 50%, rgba(224,123,26,.10) 0%, transparent 65%);
  pointer-events: none;
}

.menu-hero-inner {
  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: var(--sp-lg);
}

.menu-hero-back {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: var(--text-xs); font-weight: 600;
  letter-spacing: var(--tracking-wide); text-transform: uppercase;
  color: rgba(255,255,255,.45); text-decoration: none;
  transition: color var(--ease);
  margin-bottom: 20px;
}
.menu-hero-back:hover { color: var(--orange); }
.menu-hero-back i { transition: transform var(--ease); }
.menu-hero-back:hover i { transform: translateX(-4px); }

.menu-hero-label {
  font-size: var(--text-xs); font-weight: 600;
  letter-spacing: .45em; text-transform: uppercase;
  color: var(--orange); margin-bottom: 12px;
}
.menu-hero-title {
  font-size: clamp(2.2rem, 4vw, 3.8rem);
  font-weight: 700; color: var(--white); line-height: 1.05;
}
.menu-hero-title em { font-style: italic; font-weight: 300; color: var(--orange); }

.menu-hero-meta {
  font-size: var(--text-sm);
  color: rgba(255,255,255,.35);
  letter-spacing: .05em;
  text-align: right;
  white-space: nowrap;
}

/* ── TABS ───────────────────────────────────────────────────────────────────── */
.menu-tabs-wrap {
  position: sticky;
  top: var(--nav-h);
  z-index: 100;
  background: var(--paper-alt);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 2px 12px rgba(26,18,8,.06);
}

.menu-tabs {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding: 0 var(--sp-xl);
}
.menu-tabs::-webkit-scrollbar { display: none; }

.menu-tab {
  flex-shrink: 0;
  scroll-snap-align: start;
  padding: 18px 24px;
  font-size: var(--text-xs); font-weight: 600;
  letter-spacing: var(--tracking-wide); text-transform: uppercase;
  color: var(--stone);
  background: none; border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: color var(--ease), border-color var(--ease);
  white-space: nowrap;
  font-family: 'Montserrat', sans-serif;
}
.menu-tab:hover  { color: var(--ink); }
.menu-tab.active { color: var(--orange); border-bottom-color: var(--orange); }

/* ── CORPO ──────────────────────────────────────────────────────────────────── */
.menu-body {
  padding: var(--sp-xl);
  max-width: 900px;
  margin: 0 auto;
}

/* ── CATEGORIA ──────────────────────────────────────────────────────────────── */
.menu-category {
  margin-bottom: 64px;
  scroll-margin-top: calc(var(--nav-h) + 56px + 16px);
}
.menu-category-header {
  margin-bottom: 28px;
  padding-bottom: 16px;
  border-bottom: 2px solid var(--line);
}
.menu-category-label {
  font-size: var(--text-xs); font-weight: 600;
  letter-spacing: .45em; text-transform: uppercase;
  color: var(--orange); margin-bottom: 6px;
}
.menu-category-name {
  font-size: clamp(1.4rem, 3vw, 2rem);
  font-weight: 700; color: var(--ink); line-height: 1.1;
}
.menu-category-desc {
  font-size: var(--text-sm); color: var(--stone);
  margin-top: 6px; font-weight: 300;
}

/* ── CARD PIETANZA ──────────────────────────────────────────────────────────── */
.menu-item {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: start;
  gap: var(--sp-sm);
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
}
.menu-item:last-child { border-bottom: none; }

.menu-item-left { display: flex; flex-direction: column; gap: 4px; }

.menu-item-top {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.menu-item-code {
  font-size: .6rem; font-weight: 700;
  letter-spacing: .2em; text-transform: uppercase;
  color: var(--stone);
  background: var(--linen);
  padding: 2px 7px;
  flex-shrink: 0;
}

.menu-item-name {
  font-size: var(--text-base); font-weight: 600;
  color: var(--ink); line-height: 1.3;
}

.menu-item-desc {
  font-size: var(--text-sm); font-weight: 400;
  color: var(--ink-soft); line-height: 1.6;
  margin-top: 2px;
}

/* ── PREZZO ─────────────────────────────────────────────────────────────────── */
.menu-item-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  padding-top: 2px;
}
.menu-item-price { font-size: var(--text-base); font-weight: 700; color: var(--orange); white-space: nowrap; }
.menu-item-price-label { font-size: var(--text-sm); font-weight: 400; color: var(--stone); white-space: nowrap; }

/* ── BADGES ─────────────────────────────────────────────────────────────────── */
.badges { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 5px; }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: .52rem; font-weight: 700;
  letter-spacing: .15em; text-transform: uppercase;
  padding: 3px 8px;
}
.badge i { font-size: .65rem; }

.badge-bestseller { background: var(--orange); color: var(--white); }
.badge-specialita  { background: var(--ink); color: var(--orange); border: 1px solid var(--orange); }
.badge-frozen {
  background: transparent;
  color: var(--stone);
  border: 1px solid var(--linen);
  font-size: .5rem;
}

/* ── ALLERGENI ──────────────────────────────────────────────────────────────── */
/*
 * Ogni allergene è un tag piatto: [icona FA] [numero]
 * Nessun cerchio, nessun emoji. Sobrio e leggibile.
 * Il tooltip mostra il nome completo via CSS attr().
 */
.allergen-list {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.allergen-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 7px;
  background: var(--paper-alt);
  border: 1px solid var(--linen);
  color: var(--ink-soft);
  font-size: .6rem;
  font-weight: 600;
  cursor: default;
  position: relative;
  transition: background var(--ease), color var(--ease);
  user-select: none;
}

.allergen-tag i {
  font-size: .72rem;
  color: var(--orange);
}

.allergen-tag:hover {
  background: var(--orange);
  color: var(--white);
  border-color: var(--orange);
}
.allergen-tag:hover i { color: var(--white); }

/* Tooltip al hover */
.allergen-tag::after {
  content: attr(data-name);
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--ink);
  color: var(--white);
  font-size: .5rem;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  white-space: nowrap;
  padding: 4px 8px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .15s;
  z-index: 10;
}
.allergen-tag:hover::after { opacity: 1; }

/* ── LEGENDA ALLERGENI ──────────────────────────────────────────────────────── */
.allergen-legend {
  margin-top: 48px;
  padding-top: 40px;
  border-top: 1px solid var(--line);
}
.allergen-legend-title {
  font-size: var(--text-xs); font-weight: 700;
  letter-spacing: .4em; text-transform: uppercase;
  color: var(--orange); margin-bottom: 20px;
}
.allergen-legend-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 8px;
}
.allergen-legend-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: var(--paper-alt);
  border: 1px solid var(--line);
}
.allergen-legend-num {
  font-size: .6rem; font-weight: 700;
  color: var(--stone); width: 16px;
  flex-shrink: 0; text-align: right;
}
.allergen-legend-icon {
  font-size: 1rem;
  color: var(--orange);
  width: 20px;
  text-align: center;
  flex-shrink: 0;
}
.allergen-legend-info { display: flex; flex-direction: column; gap: 1px; }
.allergen-legend-name { font-size: var(--text-sm); color: var(--ink); font-weight: 500; }
.allergen-legend-detail { font-size: .56rem; color: var(--stone); font-weight: 300; line-height: 1.4; }

/* ── NOTE LEGALI ────────────────────────────────────────────────────────────── */
.menu-legal {
  margin-top: 48px;
  padding: 24px 28px;
  background: var(--paper-alt);
  border-left: 3px solid var(--orange);
  font-size: var(--text-sm);
  color: var(--stone);
  line-height: 1.8;
}
.menu-legal strong { color: var(--ink-soft); font-weight: 600; }
.menu-legal p + p { margin-top: 10px; }

/* ── RESPONSIVE ─────────────────────────────────────────────────────────────── */
@media (max-width: 900px) {
  .menu-hero { padding: 40px var(--sp-md) 32px; }
  .menu-hero-inner { flex-direction: column; align-items: flex-start; gap: var(--sp-sm); }
  .menu-hero-meta { text-align: left; }
  .menu-tabs { padding: 0 var(--sp-md); }
  .menu-body { padding: var(--sp-lg) var(--sp-md); }
  .menu-legal { padding: var(--sp-md); }
}

@media (max-width: 480px) {
  .menu-tab { padding: 16px 18px; font-size: .55rem; }
  .menu-item { padding: 16px 0; }
  .allergen-legend-grid { grid-template-columns: 1fr 1fr; }
}

/* ── WA FLOAT: nascosto sulla pagina menu ───────────────────────────────────── */
.menu-page ~ .wa-float { display: none !important; }

/* ── FOTO PIATTO: anteprima circolare dopo il nome ──────────────────────────── */
/*
 * Cerchio stile "profile picture" inline dopo il nome della pietanza.
 * Appare SOLO se il piatto ha una foto associata nel JSON.
 * Click apre il lightbox.
 */
/*
 * Bottone reale (non un div con role="button"): tap/click/tastiera
 * funzionano nativamente, niente listener extra per Enter/Spazio.
 *
 * L'area cliccabile (.dish-photo-btn) è più grande del cerchio visibile
 * (.dish-photo): padding positivo + margin negativo della stessa misura
 * allargano la "hit area" a ~44px (soglia minima consigliata per il touch)
 * senza spostare il layout né ingrandire visivamente l'avatar.
 */
.dish-photo-btn {
  appearance: none;
  -webkit-appearance: none;
  background: none;
  border: none;
  padding: 5px;
  margin: -5px;
  flex-shrink: 0;
  display: inline-flex;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
.dish-photo-btn:focus-visible {
  outline: 2px solid var(--orange);
  outline-offset: 2px;
  border-radius: 50%;
}

/* Cerchio visibile, stile "foto profilo" */
.dish-photo {
  width: 34px;
  height: 34px;
  box-sizing: border-box;
  border-radius: 50%;
  border: 2px solid var(--orange);
  overflow: hidden;
  display: block;
  transition: transform var(--ease), box-shadow var(--ease);
}
.dish-photo img {
  /* 100%/100% invece di px fissi: l'immagine riempie SEMPRE
     esattamente il cerchio, qualunque sia il box-sizing ereditato */
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}
.dish-photo-btn:hover .dish-photo,
.dish-photo-btn:focus-visible .dish-photo {
  transform: scale(1.1);
  box-shadow: 0 0 0 3px rgba(224, 123, 26, .25);
}
.dish-photo-btn:active .dish-photo {
  transform: scale(0.94);
}

/* ── LIGHTBOX ───────────────────────────────────────────────────────────────── */
/*
 * Overlay scuro, immagine centrata.
 * object-fit: contain mostra la foto intera senza zoom né ritaglio.
 * max-height: 72vh evita overflow su schermi piccoli.
 */
.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 600;
  background: rgba(26, 18, 8, .94);
  backdrop-filter: blur(10px);
  align-items: center;
  justify-content: center;
  padding: var(--sp-md);
  cursor: zoom-out;
}
.lightbox.open {
  display: flex;
  animation: fadeIn .22s ease;
}
.lightbox-inner {
  width: 100%;
  max-width: 600px;
  cursor: default;
  animation: slideUp .32s cubic-bezier(.22, 1, .36, 1) both;
}
.lightbox-img-wrap {
  width: 100%;
  line-height: 0;
  background: var(--ink);
}
.lightbox-img {
  width: 100%;
  height: auto;
  max-height: 72vh;
  object-fit: contain;
  display: block;
}
.lightbox-caption {
  background: var(--ink);
  border-top: 2px solid var(--orange);
  padding: 12px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.lightbox-caption-name {
  font-size: .65rem;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, .65);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.lightbox-close {
  background: none;
  border: 1px solid rgba(255, 255, 255, .15);
  color: rgba(255, 255, 255, .45);
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  font-size: .9rem;
  line-height: 1;
  transition: color var(--ease), border-color var(--ease), background var(--ease);
}
.lightbox-close:hover {
  color: var(--white);
  border-color: var(--orange);
  background: var(--orange);
}

@media (max-width: 600px) {
  .lightbox { padding: var(--sp-sm); }
  .lightbox-inner { max-width: 100%; }
}
