/* ─────────────────────────────────────────────────────────────
   CSS VARIABLES — override via JS da config.json
   ───────────────────────────────────────────────────────────── */
:root {
  --sfondo:       #1A1A1A;
  --superficie:   #242424;
  --superficie-h: #2e2e2e;
  --primario:     #D4A853;
  --testo:        #F5F5F5;
  --testo-2:      #A0A0A0;
  --bordo:        #333333;
  --accento:      #D4A853;
  --radius:       8px;
  --font-titoli:  'Fraunces', serif;
  --font-corpo:   'Inter', sans-serif;
  /* Google Fonts: https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,400;9..144,900&family=Inter:wght@400;700;900&display=swap */

  --header-h:   80px;
  --nav-h:      64px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

/* ─────────────────────────────────────────────────────────────
   RESET & BASE
   ───────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  background: var(--sfondo);
  color: var(--testo);
  font-family: var(--font-corpo);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
}

button { cursor: pointer; font: inherit; background: none; border: none; color: inherit; }
img    { display: block; max-width: 100%; }
a      { color: inherit; text-decoration: none; }
ul     { list-style: none; }

/* ─────────────────────────────────────────────────────────────
   LOADING SCREEN
   ───────────────────────────────────────────────────────────── */
#loading-screen {
  position: fixed;
  inset: 0;
  background: var(--sfondo);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999;
  transition: opacity .3s;
}
#loading-screen.fade-out { opacity: 0; pointer-events: none; }

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

/* ─────────────────────────────────────────────────────────────
   APP LAYOUT
   ───────────────────────────────────────────────────────────── */
#app {
  display: flex;
  flex-direction: column;
  min-height: 100%;
  position: relative;
  width: 100%;
}

/* ─────────────────────────────────────────────────────────────
   HEADER
   ───────────────────────────────────────────────────────────── */
#app-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: var(--header-h);
  background: rgba(26, 26, 26, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--bordo);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 clamp(16px, 5vw, 60px);
  z-index: 100;
}

#header-center {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  justify-content: center;
}
#logo-img  { height: 60px; width: auto; object-fit: contain; cursor: pointer; }
#header-title {
  font-family: var(--font-titoli);
  font-size: 1.3rem;
  letter-spacing: .05em;
  color: var(--testo);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 200px;
  cursor: pointer;
}

.header-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--testo);
  border-radius: 50%;
  transition: background .15s;
  z-index: 10;
}
#btn-back { left: clamp(16px, 5vw, 60px); }

#header-right {
  position: absolute;
  right: clamp(16px, 5vw, 60px);
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  gap: 2px;
}
/* I button dentro #header-right non sono più absolutamente posizionati */
#header-right .header-btn {
  position: relative;
  top: auto;
  right: auto;
  transform: none;
}

/* Pulsante search — icona ridotta + indicatore filtri attivi */
#btn-search { position: relative; }
#btn-search svg { width: 17px; height: 17px; }
#btn-search.search-active { color: var(--primario); }
.search-btn-dot {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--primario);
  border: 2px solid var(--sfondo);
}

.header-btn:hover  { background: var(--superficie-h); }
.header-btn:active { background: var(--bordo); }
.header-btn[hidden]{ display: none; }

/* Spacer per bilanciare il back-btn quando assente */
.header-spacer { width: 40px; flex-shrink: 0; }

/* ─────────────────────────────────────────────────────────────
   MAIN VIEW
   ───────────────────────────────────────────────────────────── */
#view {
  margin-top: var(--header-h);
  margin-bottom: calc(var(--nav-h) + var(--safe-bottom));
  overflow-y: auto;
  overflow-x: hidden;
  flex: 1;
  width: 100%;
  max-width: 1400px;
  margin-left: auto;
  margin-right: auto;
  padding: 0 4vw;
  -webkit-overflow-scrolling: touch;
}

/* ─────────────────────────────────────────────────────────────
   BOTTOM NAV
   ───────────────────────────────────────────────────────────── */
#bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  height: calc(var(--nav-h) + var(--safe-bottom));
  padding-bottom: var(--safe-bottom);
  background: rgba(26, 26, 26, 0.9);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-top: 1px solid var(--bordo);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(20px, 8vw, 80px);
  z-index: 100;
}

.nav-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 6px 16px;
  color: var(--testo-2);
  transition: color .2s;
}
.nav-btn svg { width: 28px; height: 28px; }
.nav-btn span { font-size: .85rem; font-weight: 600; letter-spacing: .03em; }

/* ─────────────────────────────────────────────────────────────
   VIEW: HOME — griglia macro-categorie
   ───────────────────────────────────────────────────────────── */
.view-home {
  padding: 24px 16px 16px;
}
.view-home-header {
  text-align: center;
  padding: 16px 0 28px;
}
.view-home-header h1 {
  font-family: var(--font-titoli);
  font-size: 2.4rem;
  letter-spacing: .06em;
  line-height: 1.1;
  color: var(--testo);
  margin-bottom: 8px;
}
.view-home-header p {
  color: var(--testo-2);
  font-size: .95rem;
  max-width: 380px;
  margin: 0 auto;
}

.macro-grid {
  display: flex;
  flex-direction: column;
  gap: 24px;
}
@media (min-width: 768px) {
  .macro-grid { gap: 40px; }
}

/* Card macro-categoria */
.macro-card {
  display: block;
  background: var(--superficie);
  border-radius: calc(var(--radius) * 3);
  overflow: hidden;
  transition: all .4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  -webkit-tap-highlight-color: transparent;
  border: 1px solid var(--bordo);
  box-shadow: 0 4px 20px rgba(0,0,0,0.15);
}

@media (min-width: 768px) {
  .macro-card {
    min-height: 480px; /* Altezza generosa per impatto visivo */
  }
}

.macro-card:active { transform: scale(.985); }

.macro-card-img {
  position: relative;
  height: 220px;
  overflow: hidden;
  background: var(--bordo);
}
@media (min-width: 768px) {
  .macro-card-img {
    height: 380px; /* Immagine molto visibile su desktop */
    border-right: none;
    border-bottom: 1px solid var(--bordo);
  }
}
.macro-card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .6s ease;
}
.macro-card:hover .macro-card-img img { transform: scale(1.05); }
.macro-card-img-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.macro-card-img-placeholder svg { width: 48px; height: 48px; opacity: .5; }

.macro-card-body { 
  padding: 24px; 
  display: flex;
  flex-direction: column;
  justify-content: center;
}
@media (min-width: 768px) {
  .macro-card-body { padding: 40px; flex: 1; }
}
.macro-card-title-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}
.macro-card-icon { width: 28px; height: 28px; color: var(--primario); flex-shrink: 0; display: flex; align-items: center; justify-content: center; }
.macro-card-icon svg { width: 100%; height: 100%; }
.macro-card-icon-img { width: 28px; height: 28px; object-fit: contain; flex-shrink: 0; }
.macro-card-name {
  font-family: var(--font-titoli);
  font-size: 1.8rem;
  letter-spacing: .06em;
  color: var(--testo);
  text-transform: uppercase;
}
@media (min-width: 768px) {
  .macro-card-name { font-size: 2.2rem; }
}
.macro-card-sub { 
  font-size: .9rem; 
  color: var(--testo-2); 
  letter-spacing: .02em;
}
.macro-card-arrow {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
  color: var(--primario);
  font-size: .95rem;
  font-weight: 700;
  letter-spacing: .04rem;
  text-transform: uppercase;
}
.macro-card-arrow svg { width: 18px; height: 18px; }

/* Sezione In Evidenza */
.home-specials { padding: 8px 16px 24px; }
.section-title {
  font-family: var(--font-titoli);
  font-size: 1.5rem;
  letter-spacing: .05em;
  margin-bottom: 4px;
}
.section-sub { font-size: .82rem; color: var(--testo-2); margin-bottom: 16px; }

/* ─────────────────────────────────────────────────────────────
   SEZIONI SPECIALI
   ───────────────────────────────────────────────────────────── */
.sezioni-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 8px 0 16px;
}

/* — highlight — */
.sezione-highlight {
  --s-accent: var(--primario);
  background: var(--superficie);
  border-radius: var(--radius);
  border-left: 4px solid var(--s-accent);
  padding: 16px 18px;
}
.sezione-highlight-title {
  font-family: var(--font-titoli);
  font-size: 1.25rem;
  letter-spacing: .04em;
  color: var(--s-accent);
  margin-bottom: 6px;
}
.sezione-highlight-text {
  font-size: .88rem;
  color: var(--testo-2);
  line-height: 1.55;
}

/* — banner — */
.sezione-banner {
  background: var(--superficie);
  border-radius: calc(var(--radius) * 2);
  padding: 24px 20px;
  text-align: center;
  border-top: 2px solid var(--primario);
}
.sezione-banner-title {
  font-family: var(--font-titoli);
  font-size: 1.45rem;
  letter-spacing: .05em;
  color: var(--testo);
  margin-bottom: 8px;
}
.sezione-banner-text {
  font-size: .88rem;
  color: var(--testo-2);
  line-height: 1.55;
  margin-bottom: 16px;
}
.sezione-banner-cta {
  display: inline-block;
  background: var(--primario);
  color: var(--sfondo);
  font-size: .82rem;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
  padding: 9px 22px;
  border-radius: var(--radius);
  transition: opacity .15s;
}
.sezione-banner-cta:active { opacity: .8; }

/* — info — */
.sezione-info {
  padding: 12px 14px;
  border-left: 2px solid var(--bordo);
  margin-left: 4px;
}
.sezione-info-title {
  font-size: .82rem;
  font-weight: 700;
  color: var(--testo-2);
  letter-spacing: .03em;
  margin-bottom: 4px;
  text-transform: uppercase;
}
.sezione-info-text {
  font-size: .82rem;
  color: var(--testo-2);
  line-height: 1.6;
}

/* ─────────────────────────────────────────────────────────────
   VOCE CARD — orizzontale (lista)
   ───────────────────────────────────────────────────────────── */
.voce-card {
  display: flex;
  align-items: stretch;
  background: var(--superficie);
  border-radius: 12px;
  border: 1px solid var(--bordo);
  overflow: hidden;
  min-height: unset;
  height: 72px;
  cursor: pointer;
  transition: border-color .15s;
  -webkit-tap-highlight-color: transparent;
}
.voce-card:active { border-color: var(--primario); }

.voce-card-img {
  width: 80px;
  flex-shrink: 0;
  object-fit: cover;
  height: 72px;
  border-radius: 0;
  border-right: 1px solid var(--bordo);
}
.voce-card-img-placeholder {
  width: 80px;
  flex-shrink: 0;
  height: 72px;
  border-radius: 0;
  border-right: 1px solid rgba(255,255,255,0.05);
  background: var(--bordo);
  display: flex;
  align-items: center;
  justify-content: center;
}
.voce-card-img-placeholder svg { width: 28px; height: 28px; opacity: .35; }

.voce-card-info {
  flex: 1;
  padding: 10px 10px 10px 12px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
}
.voce-card--no-img .voce-card-info {
  padding-left: 16px;
}

/* Riga superiore: nome + prezzo affiancati */
.voce-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.voce-card-name {
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--testo);
  line-height: 1.3;
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
}
.voce-card-desc {
  font-size: .82rem;
  color: var(--testo-2);
  margin-top: 4px;
  line-height: 1.4;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.voce-card-badges {
  display: flex;
  gap: 4px;
  margin-top: 5px;
  flex-wrap: nowrap;
  overflow: hidden;
}

/* Prezzo nella riga superiore */
.voce-card-right {
  flex-shrink: 0;
  text-align: right;
  padding-top: 1px;
}
.voce-price {
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--primario);
  white-space: nowrap;
}
.voce-price-from {
  font-size: .78rem;
  color: var(--testo-2);
  display: block;
  margin-bottom: 1px;
}

/* VIEW: CATEGORIA */

/* Tabs categorie — sticky sotto header */
.cat-tabs-wrap {
  position: sticky;
  top: 8px; /* Leggero stacco dall'header */
  margin-top: 8px;
  z-index: 50;
  background: var(--sfondo);
  border-bottom: 1px solid var(--bordo);
  margin-bottom: 10px; /* Small gap even when sticky */
}
/* Sfumatura ai bordi per indicare lo scroll */
.cat-tabs-wrap::after {
  content: '';
  position: absolute;
  top: 0; right: 0; bottom: 0;
  width: 40px;
  background: linear-gradient(to left, var(--sfondo), transparent);
  pointer-events: none;
  z-index: 2;
}
.cat-tabs-wrap::before {
  content: '';
  position: absolute;
  top: 0; left: 0; bottom: 0;
  width: 40px;
  background: linear-gradient(to right, var(--sfondo), transparent);
  pointer-events: none;
  z-index: 2;
}
.cat-tabs {
  display: flex;
  overflow-x: auto;
  gap: 0;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.cat-tabs::-webkit-scrollbar { display: none; }

@media (min-width: 1024px) {
  .cat-tabs {
    justify-content: center;
    gap: 12px;
  }
}

.cat-tab {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 18px;
  font-size: .92rem;
  font-weight: 700;
  letter-spacing: .04em;
  color: var(--testo-2);
  white-space: nowrap;
  border-bottom: 2px solid transparent;
  transition: color .2s, border-color .2s;
}
.cat-tab.active { color: var(--primario); border-bottom-color: var(--primario); }
.cat-tab-img { width: 18px; height: 18px; object-fit: contain; flex-shrink: 0; }
.cat-tab-icon { width: 18px; height: 18px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; }
.cat-tab-icon svg { width: 100%; height: 100%; }

/* Sezioni voci */
.cat-section { padding: 24px 0; }
.cat-section-title {
  font-family: var(--font-titoli);
  font-weight: 900;
  font-size: 2.2rem;
  letter-spacing: .08em;
  color: var(--testo);
  margin-bottom: 40px;
  text-transform: uppercase;
  text-align: center;
  position: relative;
}
.cat-section-title::after {
  content: '';
  position: absolute;
  bottom: -10px;
  left: 50%;
  transform: translateX(-50%);
  width: 40px;
  height: 2px;
  background: var(--primario);
}

/* Tipographic list */
.cat-items-list {
  display: flex;
  flex-direction: column;
  margin-top: 8px;
}

.list-item {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 16px 0;
  border-bottom: 1px solid #222;
  cursor: pointer;
  gap: 12px;
  transition: background .1s;
  -webkit-tap-highlight-color: transparent;
}
.list-item:active { background: #242424; }
.list-item--no-snap { cursor: default; }
.list-item--no-snap:active { background: transparent; }

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

.list-item-name {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--testo);
  line-height: 1.3;
}

.list-item-badges {
  display: flex;
  gap: 4px;
  margin-top: 9px;
  flex-wrap: nowrap;
  overflow: hidden;
}

.list-item-badges .badge {
  padding: 2px 8px;
  font-size: .7rem;
  font-weight: 500;
  letter-spacing: .02em;
  opacity: .75;
}

.list-item-price {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--primario);
  white-space: nowrap;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.list-item-price-from {
  font-size: .85rem;
  color: var(--testo-2);
  margin-bottom: 1px;
}

/* ─────────────────────────────────────────────────────────────
   VIEW: DETTAGLIO VOCE
   ───────────────────────────────────────────────────────────── */
.view-voce { padding: 20px 0 32px; }

/* Carosello immagini */
.voce-gallery {
  position: relative;
  background: var(--bordo);
  overflow: hidden;
  aspect-ratio: 16/9;
  max-height: 500px;
  border-radius: var(--radius);
  margin-bottom: 20px;
}
.voce-gallery-slides {
  display: flex;
  height: 100%;
  transition: transform .3s ease;
}
.voce-gallery-slide {
  min-width: 100%;
  height: 100%;
}
.voce-gallery-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.voce-gallery-dots {
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 6px;
}
.voce-gallery-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(255,255,255,.4);
  border: none;
  padding: 0;
  cursor: pointer;
  transition: background .2s;
}
.voce-gallery-dot.active { background: #fff; }

/* Placeholder hero senza immagini */
.voce-hero-placeholder {
  height: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--superficie), var(--bordo));
  border-radius: var(--radius);
  margin-bottom: 20px;
}
.voce-hero-placeholder svg { width: 56px; height: 56px; opacity: .3; }

/* Body dettaglio */
.voce-detail-body { padding: 20px 16px 0; }

.voce-detail-header { margin-bottom: 16px; }
.voce-detail-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}
.voce-detail-title {
  font-family: var(--font-titoli);
  font-weight: 900;
  font-size: 2rem;
  letter-spacing: .04em;
  line-height: 1.1;
  color: var(--testo);
  margin-bottom: 8px;
}
.voce-detail-desc {
  font-size: .9rem;
  color: var(--testo-2);
  line-height: 1.6;
  white-space: pre-line;
}

/* Varianti prezzo */
.voce-section { margin-top: 24px; }
.voce-section-label {
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--testo-2);
  margin-bottom: 10px;
}
.varianti-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.variante-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  background: var(--superficie);
  border-radius: var(--radius);
}
.variante-name { font-size: .9rem; color: var(--testo); }
.variante-price { font-weight: 700; font-size: 1rem; color: var(--primario); }
.voce-prezzo-base { font-weight: 700; font-size: 1.1rem; color: var(--primario); margin-bottom: 4px; }
.voce-varianti-nomi { font-size: .85rem; color: var(--testo-2); }
.snap-varianti-nomi { font-size: .8rem; color: var(--testo-2, #aaa); margin-top: 2px; }
.sheet-varianti-nomi { font-size: .8rem; color: var(--testo-2); margin-top: 4px; }

/* Caratteristiche */
.caratteristiche-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* Allergeni */
.allergeni-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.allergene-chip {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  background: var(--superficie);
  border-radius: 999px;
  font-size: .75rem;
  color: var(--testo-2);
  border: 1px solid var(--bordo);
}

/* ─────────────────────────────────────────────────────────────
   BADGE / CHIP GENERICI
   ───────────────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: .85rem;
  font-weight: 700;
  letter-spacing: .04em;
  white-space: nowrap;
}
.badge-veg    { background: rgba(76,175,80,.18);  color: #4CAF50; }
.badge-vegan  { background: rgba(139,196,138,.18); color: #8BC48A; }
.badge-star   { background: rgba(212,168,83,.18);  color: var(--primario); }

.car-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: .75rem;
  font-weight: 600;
  background: rgba(255,255,255,.07);
  border: 1px solid var(--bordo);
}

/* ─────────────────────────────────────────────────────────────
   OVERLAY + PANNELLI SLIDE-UP
   ───────────────────────────────────────────────────────────── */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.7);
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s;
}
.overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.panel {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%) translateY(100%);
  width: 100%;
  max-width: 800px;
  background: var(--superficie);
  border-radius: calc(var(--radius) * 3) calc(var(--radius) * 3) 0 0;
  padding: 0 0 calc(24px + var(--safe-bottom));
  z-index: 201;
  transition: transform .35s cubic-bezier(.32,.72,0,1);
  max-height: 90vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.panel.open {
  transform: translateX(-50%) translateY(0);
}

.panel-handle {
  width: 36px;
  height: 4px;
  background: var(--bordo);
  border-radius: 2px;
  margin: 12px auto 0;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px 12px;
  border-bottom: 1px solid var(--bordo);
}
.panel-title {
  font-family: var(--font-titoli);
  font-weight: 900;
  font-size: 1.35rem;
  letter-spacing: .05em;
}
.panel-close {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--testo-2);
  border-radius: 50%;
  transition: background .15s;
}
.panel-close:hover { background: var(--bordo); color: var(--testo); }

.panel-body { padding: 16px 20px; }
.panel-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--bordo);
}

.panel-row:last-child { border-bottom: none; }
.panel-row-icon {
  width: 20px;
  height: 20px;
  color: var(--primario);
  flex-shrink: 0;
  margin-top: 2px;
}
.panel-row-label { font-weight: 600; font-size: .9rem; color: var(--testo); }
.panel-row-value { font-size: .85rem; color: var(--testo-2); margin-top: 2px; }

/* Orari table */
.orari-table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.orari-table tr { border-bottom: 1px solid var(--bordo); }
.orari-table tr:last-child { border-bottom: none; }
.orari-table td { padding: 10px 4px; vertical-align: top; }
.orari-table td:first-child { color: var(--testo); font-weight: 600; width: 110px; }
.orari-table td:last-child { color: var(--testo-2); }
.orari-oggi td { color: var(--primario) !important; }
.tag-chiuso { font-size: .75rem; background: rgba(255,80,80,.15); color: #ff5050; padding: 2px 7px; border-radius: 4px; }
.tag-aperto { font-size: .75rem; background: rgba(76,175,80,.15); color: #4CAF50; padding: 2px 7px; border-radius: 4px; }

/* Social links */
.social-row {
  display: flex;
  gap: 16px;
  padding-top: 16px;
  align-items: center;
}
.social-link {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: .82rem;
  color: var(--testo-2);
  transition: color .2s;
}
.social-link:hover, .social-link:active { color: var(--primario); }
.social-link svg { width: 20px; height: 20px; }

/* ─────────────────────────────────────────────────────────────
   EMPTY & ERROR STATES
   ───────────────────────────────────────────────────────────── */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 24px;
  text-align: center;
  color: var(--testo-2);
  gap: 12px;
}
.empty-state svg { width: 48px; height: 48px; opacity: .35; }
.empty-state p   { font-size: .9rem; }

/* ─────────────────────────────────────────────────────────────
   TOUCH SWIPE FEEDBACK
   ───────────────────────────────────────────────────────────── */
@media (hover: hover) {
  .macro-card:hover { background: var(--superficie-h); }
  .macro-card:hover .macro-card-img img { transform: scale(1.04); }
  .voce-card:hover  { background: var(--superficie-h); }
}

/* ─────────────────────────────────────────────────────────────
   RICERCA + FILTRI
   ───────────────────────────────────────────────────────────── */
.search-wrap {
  padding: 20px 0 0;
  animation: searchAppear .22s ease-out;
}
@keyframes searchAppear {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Input row */
.search-input-row {
  position: relative;
  display: flex;
  align-items: center;
}

.search-icon-inner {
  position: absolute;
  left: 14px;
  color: var(--testo-2);
  pointer-events: none;
  display: flex;
  align-items: center;
}
.search-icon-inner svg { width: 17px; height: 17px; }

.search-input {
  width: 100%;
  background: var(--superficie);
  border: 1.5px solid var(--bordo);
  border-radius: 999px;
  padding: 14px 44px;
  font: inherit;
  font-size: 1rem;
  color: var(--testo);
  outline: none;
  transition: border-color .2s, background .2s;
  -webkit-appearance: none;
  appearance: none;
}
.search-input::placeholder { color: var(--testo-2); }
.search-input:focus {
  border-color: var(--primario);
  background: var(--superficie-h);
}
.search-input::-webkit-search-cancel-button,
.search-input::-webkit-search-decoration { display: none; }

.search-clear {
  position: absolute;
  right: 10px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--bordo);
  color: var(--testo-2);
  font-size: 1.2rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .15s;
}
.search-clear:active { background: var(--superficie-h); }

/* Chip filtri */
.search-chips {
  display: flex;
  gap: 8px;
  margin: 12px -16px 0;
  padding: 0 16px 2px;
  overflow-x: auto;
  scrollbar-width: none;
}
.search-chips::-webkit-scrollbar { display: none; }

.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1.5px solid var(--bordo);
  background: none;
  color: var(--testo-2);
  font-size: .82rem;
  font-weight: 600;
  white-space: nowrap;
  transition: border-color .15s, color .15s, background .15s;
  -webkit-tap-highlight-color: transparent;
  flex-shrink: 0;
}
.filter-chip svg { width: 13px; height: 13px; flex-shrink: 0; }
.filter-chip.active {
  border-color: var(--primario);
  color: var(--primario);
  background: rgba(212,168,83,.12);
}
.filter-chip:active { opacity: .65; }

.chip-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  background: var(--primario);
  color: #1A1A1A;
  border-radius: 999px;
  font-size: .65rem;
  font-weight: 800;
  margin-left: 2px;
}

.filter-chip-reset {
  display: inline-flex;
  align-items: center;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1.5px solid rgba(255,80,80,.35);
  background: rgba(255,80,80,.07);
  color: #ff6060;
  font-size: .82rem;
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
  transition: background .15s;
}
.filter-chip-reset:active { opacity: .65; }

/* Pannello allergeni espandibile */
.aller-panel {
  margin-top: 12px;
  padding: 14px 16px 16px;
  background: var(--superficie);
  border-radius: var(--radius);
  border: 1px solid var(--bordo);
  animation: slideDown .18s ease-out;
}
@keyframes slideDown {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.aller-panel-label {
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--testo-2);
  margin-bottom: 12px;
}
.aller-chips-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.aller-chip {
  padding: 7px 13px;
  border-radius: 999px;
  border: 1.5px solid var(--bordo);
  background: none;
  color: var(--testo-2);
  font-size: .78rem;
  font-weight: 600;
  transition: border-color .15s, color .15s, background .15s;
  -webkit-tap-highlight-color: transparent;
}
.aller-chip.selected {
  border-color: rgba(255,80,80,.6);
  color: #ff6060;
  background: rgba(255,80,80,.1);
  text-decoration: line-through;
  text-decoration-color: rgba(255,80,80,.5);
}
.aller-chip:active { opacity: .65; }

/* Header conteggio risultati */
.search-results-header {
  font-size: .82rem;
  color: var(--testo-2);
  padding: 20px 0 4px;
  font-weight: 600;
  letter-spacing: .02em;
}

/* Contenitore lista risultati */
.search-results-list {
  display: flex;
  flex-direction: column;
  gap: 28px;
  margin-top: 12px;
  padding-bottom: 16px;
}

/* Gruppo per categoria */
.search-group {
  display: flex;
  flex-direction: column;
}

/* Header del gruppo: MACRO · Categoria */
.search-group-label {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 0 10px;
  border-bottom: 1px solid var(--bordo);
  margin-bottom: 4px;
}
.search-group-macro {
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--primario);
}
.search-group-sep {
  font-size: .68rem;
  color: var(--bordo);
  font-weight: 400;
}
.search-group-cat {
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--testo-2);
}

/* Voci dentro il gruppo: usa lo stile list-item esistente */
.search-group-items {
  display: flex;
  flex-direction: column;
}

/* Override: rimuovi vecchia griglia piatta */
.search-grid { display: none; }


/* ─────────────────────────────────────────────────────────────
   BACK TO TOP
   ───────────────────────────────────────────────────────────── */
.back-to-top {
  position: fixed;
  bottom: calc(var(--nav-h) + var(--safe-bottom) + 20px);
  right: 20px;
  width: 44px;
  height: 44px;
  background: var(--primario);
  color: var(--sfondo);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
  z-index: 90;
  opacity: 0;
  visibility: hidden;
  transition: opacity .3s, transform .3s, visibility .3s;
  transform: translateY(10px);
}
.back-to-top.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.back-to-top:active {
  transform: scale(0.92);
}
.back-to-top svg {
  width: 24px;
  height: 24px;
}

/* ─────────────────────────────────────────────────────────────
   PANNELLO ESPLORA (NAVIGAZIONE RAPIDA A TAB)
   ───────────────────────────────────────────────────────────── */
.explora-tabs-wrap {
  margin: -16px -20px 24px -20px; /* Estende ai bordi del panel */
  background: var(--superficie);
  border-bottom: 1px solid var(--bordo);
  padding: 0 10px;
}
.explora-tabs {
  display: flex;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  gap: 8px;
}
.explora-tabs::-webkit-scrollbar { display: none; }

.explora-tab {
  padding: 16px 20px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--testo-2);
  font-family: var(--font-titoli);
  font-weight: 900;
  font-size: 1.1rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  white-space: nowrap;
  cursor: pointer;
  transition: all .2s;
  flex-shrink: 0;
}
.explora-tab.active {
  color: var(--primario);
  border-bottom-color: var(--primario);
}

.explora-content {
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.explora-micro-list {
  display: flex;
  flex-direction: column;
}
.explora-micro-btn {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 0;
  border-bottom: 1px solid var(--bordo);
  transition: opacity .15s;
  width: 100%;
  text-align: left;
}
.explora-micro-btn:last-child {
  border-bottom: none;
}
.explora-micro-btn:active {
  opacity: 0.6;
}
.explora-micro-name {
  font-family: var(--font-titoli);
  font-size: 1.15rem;
  font-weight: 400;
  color: var(--testo);
}
.explora-micro-count {
  font-size: .85rem;
  color: var(--testo-2);
  font-weight: 400;
  opacity: .5;
}

.explora-home-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 18px 0;
  border-top: 1px solid var(--bordo);
  margin-top: 8px;
  color: var(--testo-2);
  font-family: var(--font-titoli);
  font-size: 1rem;
  font-weight: 400;
  letter-spacing: .03em;
  text-align: left;
  transition: color .15s, opacity .15s;
  -webkit-tap-highlight-color: transparent;
}
.explora-home-btn:active { opacity: .6; }
.explora-home-icon {
  display: flex;
  align-items: center;
  color: var(--primario);
  opacity: .7;
}
.explora-home-icon svg { width: 18px; height: 18px; }

/* ── Coperto note (home) ── */
.coperto-note {
  margin: 20px 16px 36px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  text-align: center;
}
.coperto-note-row {
  display: flex;
  align-items: baseline;
  gap: 5px;
}
.coperto-note-label {
  font-size: .78rem;
  color: var(--testo-2);
  letter-spacing: .04em;
}
.coperto-note-price {
  font-size: .9rem;
  font-weight: 700;
  color: var(--primario);
}
.coperto-note-sub {
  font-size: .75rem;
  color: var(--testo-2);
  opacity: .7;
}
.coperto-note-phrase {
  font-size: .78rem;
  color: var(--testo-2);
  line-height: 1.5;
  max-width: 280px;
}

/* ─────────────────────────────────────────────────────────────
   VIEW: SNAP FULLSCREEN DETAIL
   ───────────────────────────────────────────────────────────── */
.view-voce-snap {
  position: relative;
  height: 100vh;
  overflow: hidden;
}

.snap-header {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 56px;
  background: linear-gradient(to bottom, rgba(0,0,0,0.8), transparent);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 14px;
  z-index: 30;
  pointer-events: none;
}
.snap-header > * { pointer-events: auto; }

.snap-back-btn {
  color: #fff;
  font-size: 26px;
  background: none; border: none;
  cursor: pointer;
  padding: 10px 14px;
  margin: -10px -6px; /* Compensa il padding visivamente senza spostare il layout */
  min-width: 44px;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
}

.snap-header-center {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 0;
  width: 60%;
  pointer-events: none;
}
.snap-header-macro {
  font-family: var(--font-corpo);
  font-size: .6rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.4);
  line-height: 1;
  margin-bottom: 2px;
}
.snap-header-cat {
  font-family: var(--font-titoli);
  font-weight: 900;
  font-size: 1rem;
  color: #fff;
  letter-spacing: .05em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 180px;
  line-height: 1.1;
}

.snap-header-right {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.snap-esplora-btn {
  color: var(--primario);
  background: rgba(0,0,0,0.4);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 50%;
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform .15s, opacity .15s;
  -webkit-tap-highlight-color: transparent;
}
.snap-esplora-btn svg {
  width: 18px;
  height: 18px;
}
.snap-esplora-btn:active {
  opacity: 0.7;
  transform: scale(0.92);
}

/* Transizione tra categorie */
#view.snap-transition {
  animation: snapCatIn .25s ease-out forwards;
}
@keyframes snapCatIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

.snap-container {
  height: 100dvh;
  height: 100vh; /* Fallback */
  overflow-y: scroll;
  scroll-snap-type: y mandatory;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.snap-container::-webkit-scrollbar { display: none; }

.snap-item {
  height: 100dvh;
  height: 100vh; /* Fallback */
  scroll-snap-align: start;
  scroll-snap-stop: always;
  position: relative;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  overflow: hidden;
}

/* ── Card transizione categoria ── */
.snap-cat-card {
  height: 100dvh;
  height: 100vh; /* Fallback */
  scroll-snap-align: start;
  scroll-snap-stop: always;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  padding: 40px 32px calc(40px + var(--nav-h) + var(--safe-bottom)); /* Più spazio sotto */
  background: var(--sfondo);
  position: relative;
  overflow: hidden;
}

.snap-cat-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center, rgba(212,168,83,0.06) 0%, transparent 70%);
  pointer-events: none;
}

.snap-cat-card-label {
  font-family: var(--font-corpo);
  font-size: .65rem;
  font-weight: 700;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--testo-2);
}

.snap-cat-card-title {
  font-family: var(--font-titoli);
  font-weight: 900;
  font-size: 2.4rem;
  color: var(--testo);
  letter-spacing: .04em;
  line-height: 1.1;
  text-align: center;
}

.snap-cat-card-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 28px;
  background: var(--primario);
  color: #1A1A1A;
  border-radius: 999px;
  font-family: var(--font-corpo);
  font-weight: 700;
  font-size: .95rem;
  letter-spacing: .04em;
  cursor: pointer;
  border: none;
  transition: transform .15s, box-shadow .15s, opacity .15s;
  -webkit-tap-highlight-color: transparent;
}
.snap-cat-card-btn:active {
  transform: scale(0.95);
  opacity: .85;
}
.snap-cat-card-btn svg {
  width: 18px;
  height: 18px;
}

.snap-cat-card-divider {
  width: 48px;
  height: 1px;
  background: var(--bordo);
  opacity: .6;
}

.snap-img, .snap-gallery {
  height: 40vh;
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  position: relative;
  overflow: hidden;
}

.snap-gallery-slides {
  display: flex;
  width: 100%;
  height: 100%;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  -ms-overflow-style: none;
  -webkit-overflow-scrolling: touch;
}
.snap-gallery-slides::-webkit-scrollbar { display: none; }

.snap-gallery-slide {
  flex-shrink: 0;
  width: 100%;
  height: 100%;
  scroll-snap-align: start;
}

.snap-img-real {
  width: 100%; height: 100%;
  object-fit: cover;
}

.snap-dots {
  position: absolute;
  bottom: 15px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 6px;
  z-index: 10;
  pointer-events: none;
}
.snap-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255,255,255,0.35);
  transition: all .2s ease;
}
.snap-dot.active {
  background: #fff;
  transform: scale(1.2);
  box-shadow: 0 0 4px rgba(0,0,0,0.3);
}
.snap-placeholder-initial {
  font-family: var(--font-titoli);
  font-weight: 900;
  font-size: 5rem;
  opacity: 0.75;
  user-select: none;
}
.snap-img-gradient {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 100px;
  background: linear-gradient(to bottom, transparent, var(--sfondo));
  pointer-events: none;
}

.snap-content {
  flex: 1;
  padding: 12px 20px calc(45px + var(--safe-bottom)); /* Compromesso spazio testi */
  display: flex; flex-direction: column;
  overflow: hidden;
}
.snap-item--no-img .snap-content {
  justify-content: flex-start;
  padding-top: calc(56px + 20px);
}
.snap-name {
  font-family: var(--font-titoli);
  font-weight: 900;
  font-size: 2.2rem;
  color: var(--testo);
  letter-spacing: .05em;
  line-height: 1.1;
  margin-bottom: 8px;
}
.snap-price {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 12px;
}
.snap-price .price-unit {
  gap: 3px;
}
.snap-price .price-unit-label {
  font-size: .7rem;
  color: rgba(255,255,255,.55);
  opacity: 1;
}
.snap-price .price-unit-val {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--primario);
}
.snap-variants-inline {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 12px;
}
.snap-variant-inline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 0;
}
.snap-variant-label {
  font-size: .95rem;
  color: var(--testo);
}
.snap-variant-price {
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--primario);
}
.snap-badges {
  display: flex;
  gap: 6px;
  flex-wrap: nowrap;
  overflow: hidden;
  margin-bottom: 10px;
}
.snap-badges .badge {
  padding: 3px 9px;
  font-size: .73rem;
  font-weight: 500;
  letter-spacing: .02em;
  opacity: .75;
}
.snap-desc-preview {
  font-family: var(--font-corpo);
  font-size: .95rem;
  color: var(--testo-2);
  line-height: 1.55;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 6; /* Mostra più righe per visualizzare più descrizione possibile */
  -webkit-box-orient: vertical;
  margin-bottom: 6px;
  white-space: pre-line; /* Preserva a capo e spaziatura provenienti dal backend */
}
.snap-item--no-img .snap-desc-preview {
  display: block;
  -webkit-line-clamp: unset;
}
.snap-item--no-img .btn-leggi-tutto {
  display: none;
}
.snap-noimg-section {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--bordo);
}
.snap-noimg-label {
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--testo-2);
  margin-bottom: 8px;
}
.snap-noimg-nomi {
  font-size: .92rem;
  color: var(--testo);
}
.snap-noimg-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 7px 0;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}
.snap-noimg-row:last-child { border-bottom: none; }
.snap-noimg-row-name {
  font-size: .95rem;
  color: var(--testo);
}
.snap-noimg-row-price {
  font-weight: 700;
  font-size: .95rem;
  color: var(--primario);
}
.btn-leggi-tutto {
  font-family: var(--font-corpo);
  font-size: .82rem;
  font-weight: 700;
  color: var(--primario);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  letter-spacing: .02em;
  -webkit-tap-highlight-color: transparent;
}
.snap-caratteristiche {
  margin-top: 10px;
  font-size: .82rem;
  flex-shrink: 0;
}
.snap-car-sep {
  color: #555;
}
.snap-allergeni {
  margin-top: 10px;
  font-size: .82rem;
  color: #555;
  border-top: 1px solid #2a2a2a;
  padding-top: 8px;
  flex-shrink: 0;
}
.snap-allergeni-label {
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
}
/* Dots di navigazione laterali — snap view */
.snap-dots-nav {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  z-index: 25;
  pointer-events: none;
}
.snap-dot-nav {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: rgba(255,255,255,0.22);
  flex-shrink: 0;
  transition: background .25s ease, transform .25s ease;
}
.snap-dot-nav.active {
  background: rgba(255,255,255,0.9);
  transform: scale(1.5);
}

/* ─────────────────────────────────────────────────────────────
   SNAP BOTTOM SHEET
   ───────────────────────────────────────────────────────────── */
.snap-sheet-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0);
  z-index: 110;
  pointer-events: none;
  transition: background .3s ease;
}
.snap-sheet-overlay.visible {
  background: rgba(0,0,0,0.55);
  pointer-events: all;
}

.snap-bottom-sheet {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  background: var(--superficie);
  border-radius: 20px 20px 0 0;
  border-top: 1px solid var(--bordo);
  z-index: 120;
  transform: translateY(100%);
  transition: transform .35s cubic-bezier(0.32, 0.72, 0, 1);
  max-height: 75%;
  display: flex;
  flex-direction: column;
}
.snap-bottom-sheet.open { transform: translateY(0); }

.sheet-handle-wrap {
  display: flex;
  justify-content: center;
  padding: 10px 0 6px;
  flex-shrink: 0;
  cursor: pointer;
}
.sheet-handle {
  width: 36px; height: 4px;
  background: var(--bordo);
  border-radius: 2px;
}

.sheet-body {
  padding: 0 20px calc(40px + var(--safe-bottom));
  overflow-y: auto;
  flex: 1;
  scrollbar-width: none;
}
.sheet-body::-webkit-scrollbar { display: none; }

.sheet-name {
  font-family: var(--font-titoli);
  font-weight: 900;
  font-size: 1.75rem;
  color: var(--testo);
  letter-spacing: .02em;
  line-height: 1.1;
  margin-bottom: 10px;
}
.sheet-badges {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.sheet-badges .badge {
  font-size: .75rem;
  padding: 4px 10px;
  font-weight: 500;
  letter-spacing: .02em;
  opacity: .75;
}
.sheet-badges .badge-vegan {
  background: #1b3a1e;
  color: #85c98a;
}
.sheet-badges .badge-veg {
  background: #1e3620;
  color: #72c476;
}
.sheet-desc {
  font-size: 15px;
  color: var(--testo);
  opacity: .6;
  line-height: 1.8;
  margin-bottom: 20px;
  overflow-wrap: break-word;
  word-break: break-word;
  white-space: pre-line;
}
.sheet-price-single {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--primario);
  margin-bottom: 20px;
}
.sheet-section {
  margin-bottom: 18px;
}
.sheet-section-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .09em;
  color: var(--testo-2);
  margin-bottom: 8px;
}
.sheet-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 6px 0;
  font-size: .92rem;
  border-bottom: 1px solid var(--bordo);
}
.sheet-row:last-child { border-bottom: none; }
.sheet-row-name { color: var(--testo); }
.sheet-row-price {
  color: var(--primario);
  font-weight: 700;
  white-space: nowrap;
  margin-left: 12px;
}
.sheet-caratteristiche {
  font-size: .82rem;
  margin-top: 10px;
}
.sheet-allergeni {
  font-size: .75rem;
  color: var(--testo-2);
  line-height: 1.6;
  padding-top: 2px;
  margin-top: 8px;
}

/* ── Bevande: Hub ────────────────────────────────────────────────── */
.view-bev-hub {
  padding: 16px 0 0;
}

.bev-hub-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 200px;
}

.hub-tiles {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}

.hub-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 24px 12px;
  background: var(--superficie);
  border: 1px solid var(--bordo);
  border-radius: calc(var(--radius) * 2);
  cursor: pointer;
  transition: background .2s, transform .15s;
  -webkit-tap-highlight-color: transparent;
  text-align: center;
}
.hub-tile:active { transform: scale(.96); background: var(--superficie-h); }

.hub-tile--special {
  border-color: rgba(212,168,83,.3);
  background: linear-gradient(135deg, var(--superficie), rgba(212,168,83,.07));
}

.hub-tile-img-wrap {
  width: 64px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 4px;
  flex-shrink: 0;
}

.hub-tile-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: var(--radius);
}

.hub-tile-icon {
  width: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--bordo);
  color: var(--testo-2);
}

.hub-tile-name {
  font-family: var(--font-titoli);
  font-size: 0.95rem;
  letter-spacing: .05em;
  color: var(--testo);
  text-transform: uppercase;
  line-height: 1.2;
}

.hub-tile-count {
  font-size: .72rem;
  color: var(--testo-2);
  letter-spacing: .02em;
  opacity: 0.7;
}

/* ── Bevande: Viste vini / birre ─────────────────────────────────── */
.view-bev {
  padding-bottom: 32px;
}

.bev-view-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 32px 16px 0;
  font-family: var(--font-titoli);
  font-size: .85rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--testo-2);
  /* Nuove proprietà sticky */
  position: sticky;
  top: 8px;
  z-index: 60;
  background: var(--sfondo);
  padding-bottom: 16px;
  border-bottom: 1px solid var(--bordo);
}

/* Regola per le tab sotto il toggle bevande */
.view-bev .cat-tabs-wrap {
  top: 94px; /* 8px stacco + 86px toggle */
  z-index: 55;
}


.bev-view-toggle button {
  background: none;
  border: none;
  color: inherit;
  font: inherit;
  cursor: pointer;
  transition: all .2s;
  padding: 4px 8px;
  opacity: 0.5;
}

.bev-view-toggle button.active {
  color: var(--primario);
  opacity: 1;
  transform: scale(1.1);
}

/* Hub Bevande — Editorial List */
.bev-hub-list {
  display: flex;
  flex-direction: column;
  padding: 0 24px 32px;
}

.hub-tile-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 0;
  background: none;
  border-radius: 0;
  text-align: left;
  transition: opacity .15s;
  cursor: pointer;
  width: 100%;
  -webkit-tap-highlight-color: transparent;
}
.hub-tile-row:active { opacity: .45; }

.hub-tile-row-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.hub-tile-row-name {
  font-family: var(--font-titoli);
  font-size: 1.7rem;
  font-weight: 400;
  color: var(--testo);
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.hub-tile-row-count {
  font-size: .72rem;
  color: var(--testo-2);
  text-transform: uppercase;
  letter-spacing: .12em;
  font-weight: 500;
  opacity: .6;
}

.hub-tile-row-arrow {
  color: var(--primario);
  flex-shrink: 0;
  display: flex;
  align-items: center;
}
.hub-tile-row-arrow svg { width: 18px; height: 18px; }

/* Tabs tipo (Bianco, Rosso, IPA…) */
.bev-type-tabs-wrap {
  position: sticky;
  top: calc(var(--header-h) + 72px);
  z-index: 40;
  background: var(--sfondo);
  padding: 8px 0;
  border-bottom: 1px solid var(--bordo);
}
.bev-type-tabs {
  display: flex;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding: 0 16px;
  gap: 8px;
}
.bev-type-tabs::-webkit-scrollbar { display: none; }

.bev-type-tab {
  padding: 8px 16px;
  font-size: .82rem;
  font-weight: 600;
  letter-spacing: .02em;
  color: var(--testo-2);
  white-space: nowrap;
  background: var(--superficie);
  border-radius: 30px;
  transition: all .2s;
  flex-shrink: 0;
  border: 1px solid var(--bordo);
}
.bev-type-tab.active {
  background: var(--primario);
  color: #000;
  border-color: var(--primario);
}

/* Sort bar (A-Z / €↑) */
.bev-sort-bar {
  display: flex;
  gap: 20px;
  padding: 16px 16px 8px;
  align-items: center;
}

.bev-sort-chip {
  background: none;
  border: none;
  color: var(--testo-2);
  font-family: var(--font-titoli);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  padding: 0;
  cursor: pointer;
  opacity: .45;
  transition: color .18s, opacity .18s;
  -webkit-tap-highlight-color: transparent;
}

.bev-sort-chip.active {
  color: var(--primario);
  opacity: 1;
}

/* Gruppo cantina / birrificio */
.bev-group {
  margin-bottom: 12px;
}

.bev-group-title {
  font-family: var(--font-titoli);
  font-size: .82rem;
  font-weight: 900;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--primario);
  padding: 24px 16px 12px;
  opacity: .9;
}

/* Filtri e Ricerca */
.bev-filter-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  background: var(--sfondo);
  border-bottom: 1px solid var(--bordo);
}

.bev-search-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--superficie);
  padding: 8px 14px;
  border-radius: 12px;
  border: 1px solid var(--bordo);
}
.bev-search-wrap svg {
  width: 18px;
  height: 18px;
  color: var(--testo-2);
  opacity: .5;
}
.bev-search-wrap input {
  flex: 1;
  background: none;
  border: none;
  color: var(--testo);
  font-size: .9rem;
  outline: none;
}

.bev-sort-btns {
  display: flex;
  gap: 4px;
}
.bev-sort-btn {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--superficie);
  border: 1px solid var(--bordo);
  border-radius: 12px;
  color: var(--testo-2);
  font-size: .85rem;
  font-weight: 700;
  transition: all .2s;
}
.bev-sort-btn.active {
  background: var(--primario);
  color: #000;
  border-color: var(--primario);
}

/* Card Wine + Cantina */
.list-item-cantina {
  font-size: .7rem;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--primario);
  margin-top: 1px;
  font-weight: 700;
  opacity: .7;
}

.meta-tipo {
  color: var(--testo-2);
  font-weight: 500;
}

.list-item-prices-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 4px;
}

.price-unit {
  display: flex;
  align-items: baseline;
  gap: 4px;
}

.price-unit-label {
  font-size: .65rem;
  text-transform: uppercase;
  color: var(--testo-2);
  font-weight: 700;
  opacity: .5;
}

.price-unit-val {
  font-size: .82rem;
  font-weight: 800;
  color: var(--testo);
}

.list-item-annata {
  font-size: .85rem;
  color: var(--testo-2);
  margin-left: 6px;
  font-weight: 400;
}

/* Nascondiamo il prezzo a destra se usiamo la riga prezzi */
.list-item--multi-price .list-item-price {
  display: none;
}

/* Griglia Cantine (Level 1) */
.cantine-list-grid {
  display: flex;
  flex-direction: column;
  padding: 0; /* Full width for more premium look */
}

.cantina-tile {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 32px 24px;
  background: var(--sfondo);
  border: none;
  border-bottom: 1px solid var(--bordo);
  text-align: left;
  transition: all .3s ease;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.cantina-tile:active {
  background: var(--superficie);
}

.cantina-tile-info {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.cantina-tile-name {
  font-family: var(--font-titoli);
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--testo);
  line-height: 1;
}

.cantina-tile-origin {
  font-size: .72rem;
  color: var(--primario);
  text-transform: uppercase;
  letter-spacing: .15em;
  font-weight: 700;
  opacity: .9;
}

.cantina-tile-meta {
  display: flex;
  align-items: center;
  gap: 20px;
}

.cantina-tile-count {
  font-size: 1rem;
  color: var(--testo-2);
  font-weight: 300;
  opacity: .5;
  font-family: var(--font-titoli);
}

.cantina-tile-arrow {
  color: var(--primario);
  opacity: .3;
  font-size: 1.2rem;
}

/* Dettaglio Cantina (Level 2) */
.cantina-detail-view {
  padding-bottom: 40px;
}

.btn-back-to-cantine {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 16px;
  font-size: .85rem;
  color: var(--testo-2);
  background: none;
  border: none;
  text-transform: uppercase;
  letter-spacing: .1em;
  font-weight: 700;
  cursor: pointer;
}
.btn-back-to-cantine svg {
  width: 16px;
  height: 16px;
}

.cantina-header-detail {
  padding: 12px 16px 32px;
  border-bottom: 1px solid var(--bordo);
  margin-bottom: 24px;
}

.cantina-detail-name {
  font-family: var(--font-titoli);
  font-size: 2.4rem;
  font-weight: 900;
  color: var(--testo);
  margin-bottom: 12px;
  line-height: 1;
}

.cantina-desc-wrap {
  position: relative;
}
.cantina-detail-desc {
  font-size: 1rem;
  line-height: 1.6;
  color: var(--testo-2);
  opacity: .9;
  white-space: pre-line;
}
.cantina-desc-wrap.clamped .cantina-detail-desc {
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 6;
  -webkit-box-orient: vertical;
}
.cantina-desc-wrap.clamped::after {
  content: '';
  position: absolute;
  bottom: 26px;
  left: 0;
  right: 0;
  height: 2.5rem;
  background: linear-gradient(to bottom, transparent, var(--sfondo));
  pointer-events: none;
}
.cantina-desc-toggle {
  display: block;
  margin-top: 6px;
  padding: 0;
  background: none;
  border: none;
  cursor: pointer;
  font-family: var(--font-corpo);
  font-size: .82rem;
  font-weight: 700;
  color: var(--primario);
  letter-spacing: .02em;
  -webkit-tap-highlight-color: transparent;
}

.list-item-tipo-badge {
  display: inline-block;
  font-size: .6rem;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--testo-2);
  background: var(--superficie-2);
  border: 1px solid var(--bordo);
  padding: 2px 8px;
  border-radius: 4px;
  margin-top: 6px;
  letter-spacing: .08em;
  opacity: .8;
}

/* Singolo prodotto */
.bev-product-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--bordo);
}
.bev-product-row:last-child { border-bottom: none; }

.bev-product-img {
  width: 50px;
  height: 50px;
  object-fit: cover;
  border-radius: calc(var(--radius) * 1.5);
  flex-shrink: 0;
  background: var(--bordo);
}

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

.bev-product-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}

.bev-product-name {
  font-size: .97rem;
  font-weight: 600;
  color: var(--testo);
  letter-spacing: .01em;
  line-height: 1.3;
}

.bev-product-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 4px;
  align-items: center;
}

.bev-badge {
  display: inline-block;
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 20px;
  background: var(--bordo);
  color: var(--testo-2);
}
.bev-badge--doc {
  background: rgba(212,168,83,.18);
  color: var(--primario);
}

.bev-meta-item {
  font-size: .75rem;
  color: var(--testo-2);
  letter-spacing: .02em;
}
.bev-meta-item::before { content: '·'; margin-right: 4px; opacity: .5; }

.bev-product-note {
  font-size: .82rem;
  color: var(--testo-2);
  line-height: 1.55;
  margin: 5px 0 6px;
  white-space: pre-line;
}

/* Prezzi */
.bev-prices {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 6px;
}

.bev-price-item {
  display: flex;
  align-items: baseline;
  gap: 4px;
}

.bev-price-label {
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--testo-2);
}

.bev-price-val {
  font-size: .9rem;
  font-weight: 700;
  color: var(--primario);
}

@media (min-width: 768px) {
  .hub-tiles {
    grid-template-columns: repeat(4, 1fr);
    max-width: 700px;
    margin: 0 auto;
  }
  .bev-product-row { padding: 16px 24px; }
  .bev-cantina-header { padding: 20px 24px 10px; }
}

/* ── Bevande: Snap View Variants ─────────────────────────────────── */
.snap-bev-prices {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 16px;
  padding: 16px;
  background: rgba(255,255,255,0.03);
  border-radius: 12px;
}

.snap-bev-price-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.snap-bev-price-label {
  font-size: .75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--testo-2);
}

.snap-bev-price-val {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--primario);
}

.snap-bev-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.snap-bev-meta-item {
  font-size: .85rem;
  color: var(--testo-2);
  background: var(--bordo);
  padding: 4px 10px;
  border-radius: 6px;
}

