/* ==========================================================================
   SANTALLERIA - Menu Digitale Sartoriale
   100% Fedele all'identità grafica del sito ufficiale (santalleria.it)
   Ottimizzato a Schermo Intero per Smartphone & iPhone Safari (iOS)
   Pulsanti bloccati in alto SENZA barre né contorni invasivi
   Filigrane artistiche monocromatiche/bicromatiche in terracotta & oro
   ========================================================================== */

:root {
  /* Palette Ufficiale Santalleria.it */
  --bg-primary: #fdfbf7;
  --bg-secondary: #f6efeb;
  --bg-card: #ffffff;
  --text-primary: #2c201c;
  --text-secondary: #6a5b55;
  --accent-terracotta: #b23b25;
  --accent-gold: #c29b48;
  --accent-gold-light: #f7efcf;
  --border-color: #eadfd7;

  /* Tipografia Ufficiale Santalleria */
  --font-serif: "Playfair Display", Georgia, serif;
  --font-sans: "Plus Jakarta Sans", system-ui, -apple-system, sans-serif;

  /* Ombre & Rifiniture */
  --shadow-sm: 0 2px 8px rgba(44, 32, 28, 0.06);
  --shadow-md: 0 8px 24px rgba(44, 32, 28, 0.12);
  --shadow-lg: 0 16px 40px rgba(44, 32, 28, 0.18);
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 24px;

  /* iPhone Safe Areas */
  --sat: env(safe-area-inset-top, 0px);
  --sab: env(safe-area-inset-bottom, 0px);
}

/* Reset Globale */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  width: 100%;
  max-width: 100vw;
  height: 100vh;
  height: 100dvh;
  max-height: 100dvh;
  overflow: hidden;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-sans);
  overscroll-behavior: none;
  -webkit-overscroll-behavior: none;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  touch-action: pan-y pinch-zoom;
  user-select: none;
  -webkit-user-select: none;
}

/* App Container - 100% Schermo Intero */
#app {
  width: 100%;
  max-width: 100vw;
  height: 100vh;
  height: 100dvh;
  max-height: 100dvh;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  background-color: var(--bg-primary);
}

/* ==========================================================================
   PULSANTI BLOCCATI IN ALTO (Zero Barre, Zero Contorni a tutto schermo)
   I pulsanti galleggiano sopra la pagina in modo discreto e sartoriale
   ========================================================================== */
.top-floating-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  padding: max(10px, var(--sat)) 16px 8px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  z-index: 1000;
  pointer-events: none; /* Lascia passare i tocchi alla pagina eccetto sui pulsanti */
}

.floating-btn, .floating-brand-title {
  pointer-events: auto; /* Solo i bottoni rispondono al tocco */
}

.floating-btn {
  background: rgba(253, 251, 247, 0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(178, 59, 37, 0.22);
  color: var(--accent-terracotta);
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 12px;
  border-radius: 50px;
  padding: 6px 12px;
  box-shadow: 0 2px 10px rgba(44, 32, 28, 0.08);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.floating-btn:active {
  transform: scale(0.93);
  background: var(--bg-secondary);
}

.table-pill {
  color: var(--text-primary);
  font-weight: 800;
  border-color: rgba(194, 155, 72, 0.35);
}

.table-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #25d366;
  box-shadow: 0 0 6px rgba(37, 211, 102, 0.8);
}

.floating-brand-title {
  display: flex;
  align-items: center;
  justify-content: center;
}

.floating-brand-logo-img {
  height: 28px;
  width: auto;
  max-width: 135px;
  object-fit: contain;
  image-rendering: -webkit-optimize-contrast;
  background: rgba(253, 251, 247, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 3px 10px;
  border-radius: 20px;
  border: 1px solid rgba(194, 155, 72, 0.3);
  box-shadow: 0 2px 10px rgba(44, 32, 28, 0.08);
  display: block;
}

.floating-brand-title .brand-name {
  font-family: var(--font-serif);
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 2px;
  color: var(--accent-terracotta);
  background: rgba(253, 251, 247, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 4px 14px;
  border-radius: 20px;
  border: 1px solid rgba(194, 155, 72, 0.25);
  box-shadow: 0 2px 10px rgba(44, 32, 28, 0.06);
}

.floating-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.index-pill {
  gap: 5px;
}

.index-pill svg {
  width: 14px;
  height: 14px;
  fill: currentColor;
}

.icon-only {
  width: 34px;
  height: 34px;
  padding: 0;
  justify-content: center;
  border-radius: 50%;
}

.icon-only svg {
  width: 15px;
  height: 15px;
  fill: currentColor;
}

.lang-pill {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.5px;
}

/* ==========================================================================
   STAGE DEL MENU & LIBRO (100% SCHERMO INTERO SENZA BANDE)
   ========================================================================== */
.menu-stage {
  width: 100%;
  max-width: 100vw;
  height: 100vh;
  height: 100dvh;
  max-height: 100dvh;
  position: absolute;
  inset: 0;
  z-index: 10;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 0;
  margin: 0;
  overflow: hidden;
}

.book-shadow-wrapper {
  width: 100%;
  max-width: 100vw;
  height: 100%;
  max-height: 100dvh;
  margin: 0;
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  border-radius: 0;
  box-shadow: none;
  will-change: transform;
  overflow: hidden;
}

.book-shadow-wrapper::after {
  display: none; /* Rimosso spessore artificiale per piena aderenza al display */
}

#flipbook {
  width: 100%;
  max-width: 100vw;
  height: 100%;
  max-height: 100dvh;
  position: relative;
  margin: 0 auto;
  border-radius: 0;
  overflow: hidden;
  will-change: transform;
  transform: translateZ(0);
}

.stf__wrapper {
  margin: 0 auto !important;
}

.stf__parent, #flipbook, .menu-stage, .book-shadow-wrapper {
  touch-action: pan-y pinch-zoom !important;
  -webkit-user-select: none;
  user-select: none;
}

/* ==========================================================================
   PAGINE DEL MENU (Fondo Carta Pulito, Chiaro & Senza Foto di Sfondo)
   ========================================================================== */
.page {
  background-color: var(--bg-primary);
  color: var(--text-primary);
  width: 100%;
  height: 100%;
  box-sizing: border-box;
  overflow: hidden;
  position: relative;
  border: none;
  border-radius: 0;
  box-shadow: none;
}

/* Ombreggiatura naturale di piegatura sfumata sul lato sinistro */
.page::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: 16px;
  pointer-events: none;
  z-index: 5;
  background: linear-gradient(to right, rgba(44, 32, 28, 0.04) 0%, transparent 100%);
}

/* Filigrana d'autore stilizzata (Simboli di Napoli: Vesuvio, Pulcinella, San Gennaro, Pizza, Caffè, Mandolino) */
.page:not(.page-cover):not(.back-cover)::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url('../assets/watermarks/napoli_pattern_watermark_vertical.png');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  opacity: 0.065;
  pointer-events: none;
  z-index: 1;
}

.page-watermark {
  display: none !important;
}

/* Contenuto Pagina Interna (Aderente allo schermo ma protetto dai pulsanti) */
.page-content {
  position: relative;
  z-index: 10;
  width: 100%;
  height: 100%;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding-top: max(56px, calc(var(--sat) + 48px));
  padding-bottom: max(16px, calc(var(--sab) + 12px));
  padding-left: 20px;
  padding-right: 20px;
  overflow: hidden;
  touch-action: pan-y pinch-zoom !important;
}

/* ==========================================================================
   COPERTINA SARTORIALE 3D (Pelle Pregiata, Fregi in Oro & Stampa a Caldo)
   ========================================================================== */
.page-cover {
  background-color: #0e3320 !important;
  /* Vera pelle verde smeraldo nobile con riflesso naturale e vignettatura da rilegatura */
  background-image:
    linear-gradient(135deg, rgba(255, 255, 255, 0.08) 0%, rgba(255, 255, 255, 0) 38%, rgba(0, 0, 0, 0.24) 100%),
    radial-gradient(ellipse at 50% 42%, rgba(24, 82, 52, 0.14) 0%, rgba(5, 18, 11, 0.62) 100%),
    url('../assets/textures/green_leather_cover.jpg') !important;
  background-size: cover, cover, 480px 480px !important;
  background-repeat: no-repeat, no-repeat, repeat !important;
  color: #fdfbf7 !important;
  /* Bordi smussati e spessore cartonato della copertina in pelle */
  box-shadow:
    inset 2px 2px 3px rgba(255, 255, 255, 0.14),
    inset -3px -3px 6px rgba(0, 0, 0, 0.72),
    inset 0 0 48px rgba(0, 0, 0, 0.68),
    0 12px 28px rgba(0, 0, 0, 0.55);
  border-radius: 3px 8px 8px 3px;
  position: relative;
  overflow: hidden;
}

/* Dorso rigido + scanalatura di piegatura (hinge) della copertina */
.page-cover.front-cover::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: 26px;
  background: linear-gradient(to right,
    rgba(0, 0, 0, 0.72) 0%,
    rgba(255, 255, 255, 0.13) 18%,
    rgba(0, 0, 0, 0.15) 42%,
    rgba(0, 0, 0, 0.62) 58%,
    rgba(255, 255, 255, 0.14) 68%,
    rgba(0, 0, 0, 0.12) 82%,
    transparent 100%
  );
  pointer-events: none;
  z-index: 25;
}

/* Spessore realistico del bordo destro (taglio pelle + spessore pagine interne) */
.page-cover.front-cover::after {
  content: '';
  position: absolute;
  top: 2px;
  right: 0;
  bottom: 2px;
  width: 6px;
  background: linear-gradient(to right,
    transparent 0%,
    rgba(0, 0, 0, 0.48) 35%,
    rgba(235, 224, 200, 0.22) 65%,
    rgba(16, 48, 30, 0.92) 85%,
    rgba(0, 0, 0, 0.65) 100%
  );
  border-radius: 0 7px 7px 0;
  pointer-events: none;
  z-index: 25;
}

/* Pregiato Ricamo Dorato Sartoriale impresso a rilievo nella pelle */
.cover-border-frame {
  position: absolute;
  inset: 12px;
  border: 1.5px solid rgba(230, 189, 98, 0.85);
  border-radius: 6px;
  outline: 1px dashed rgba(243, 215, 147, 0.65);
  outline-offset: -6px;
  box-shadow: 
    0 0 0 2.5px rgba(14, 48, 30, 0.95),
    0 0 0 4px rgba(212, 175, 95, 0.4),
    inset 0 0 0 2.5px rgba(14, 48, 30, 0.95),
    inset 0 0 0 4px rgba(212, 175, 95, 0.4),
    inset 0 1px 6px rgba(0, 0, 0, 0.35),
    0 2px 8px rgba(0, 0, 0, 0.5);
  pointer-events: none;
  z-index: 12;
}

/* Greca interna / Cucitura del ricamo dorato in alto a sinistra */
.cover-border-frame::before {
  content: '✦';
  position: absolute;
  top: 9px;
  left: 10px;
  font-size: 13px;
  color: #f3d793;
  line-height: 1;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8), 0 0 6px rgba(240, 207, 123, 0.6);
}

.cover-content {
  position: relative;
  z-index: 15;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  text-align: center;
  box-sizing: border-box;
  padding-top: max(64px, calc(var(--sat) + 48px));
  padding-bottom: max(68px, calc(var(--sab) + 56px));
  padding-left: 24px;
  padding-right: 24px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  touch-action: pan-y pinch-zoom !important;
}

.cover-content::-webkit-scrollbar {
  display: none;
}

.cover-header {
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Medaglione in rilievo ottone/oro con stemma Maradona */
.cover-logo-wrapper {
  width: 94px;
  height: 94px;
  margin: 0 auto 10px auto;
  border-radius: 50%;
  padding: 3.5px;
  background: radial-gradient(circle, #f3d793 0%, #c49942 55%, #7a541c 100%);
  box-shadow: 
    0 8px 24px rgba(0, 0, 0, 0.75),
    0 2px 6px rgba(0, 0, 0, 0.95),
    inset 0 1px 2px rgba(255, 255, 255, 0.7),
    inset 0 -2px 4px rgba(0, 0, 0, 0.6);
}

.cover-official-logo {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  display: block;
  image-rendering: -webkit-optimize-contrast;
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.6);
}

.cover-brand-logo-container {
  width: 100%;
  max-width: 275px;
  margin: 6px auto 4px auto;
  display: flex;
  justify-content: center;
  align-items: center;
}

.cover-original-logo-img {
  width: 100%;
  max-width: 265px;
  height: auto;
  display: block;
  image-rendering: -webkit-optimize-contrast;
  filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.9)) drop-shadow(0 0 1px rgba(0, 0, 0, 0.8));
}

.back-logo-container {
  max-width: 210px !important;
}

.back-logo-container .cover-original-logo-img {
  max-width: 200px !important;
}

/* Titolo con stampa a caldo laminata oro */
.cover-title {
  font-family: var(--font-serif);
  font-size: 35px;
  font-weight: 900;
  letter-spacing: 3px;
  text-transform: uppercase;
  line-height: 1.1;
  margin-bottom: 4px;
  background: linear-gradient(180deg, #fff7df 0%, #e6bd62 45%, #b38529 75%, #f1cf7b 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.95)) drop-shadow(0 0 1px rgba(0, 0, 0, 0.8));
}

.cover-tagline {
  font-family: var(--font-sans);
  font-size: 10px;
  letter-spacing: 3.5px;
  color: #deb255;
  font-weight: 800;
  text-transform: uppercase;
  margin-bottom: 8px;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.9);
}

.cover-subtitle {
  font-family: var(--font-serif);
  font-size: 13px;
  color: #ebdcc9;
  font-style: italic;
  line-height: 1.45;
  max-width: 300px;
  margin: 0 auto;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.8);
}

.cover-hero-center {
  margin: auto 0;
  padding-top: 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  width: 100%;
}

.cover-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.cover-menu-word {
  font-family: var(--font-serif);
  font-size: 26px;
  font-style: italic;
  font-weight: 700;
  letter-spacing: 5px;
  text-transform: uppercase;
  padding: 2px 12px;
  color: #dbbd79;
  background: linear-gradient(180deg, #ead192 0%, #dbbd79 50%, #c8a45a 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.9)) drop-shadow(0 0 1px rgba(0, 0, 0, 0.8));
}

.cover-menu-word::before,
.cover-menu-word::after {
  content: "";
  display: inline-block;
  width: 24px;
  height: 1px;
  vertical-align: middle;
  margin: 0 10px;
  background: linear-gradient(90deg, transparent, #dbbd79, transparent);
}

/* Targhetta Tavolo in stile ottone brunito */
.cover-table-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(180deg, rgba(55, 36, 28, 0.9) 0%, rgba(26, 16, 12, 0.95) 100%);
  border: 1px solid rgba(212, 175, 95, 0.75);
  box-shadow: 
    0 4px 14px rgba(0, 0, 0, 0.6),
    inset 0 1px 1px rgba(255, 255, 255, 0.25),
    inset 0 -1px 2px rgba(0, 0, 0, 0.6);
  padding: 6px 18px;
  border-radius: 30px;
  color: #f7efcf;
  font-family: var(--font-sans);
  font-size: 12.5px;
  font-weight: 800;
  letter-spacing: 1px;
}

.cover-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #25d366;
  box-shadow: 0 0 8px rgba(37, 211, 102, 0.9);
}

.cover-hint {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-sans);
  font-size: 11.5px;
  color: #f3d793;
  letter-spacing: 0.5px;
  font-weight: 700;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.9);
  padding: 7px 16px;
  border-radius: 30px;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(222, 178, 85, 0.4);
  cursor: pointer;
  transition: all 0.2s ease;
}

.cover-hint:active {
  transform: scale(0.95);
  background: rgba(222, 178, 85, 0.2);
}

.cover-hint svg {
  width: 15px;
  height: 15px;
  fill: #f3d793;
  animation: pulseHint 1.8s ease-in-out infinite;
}

@keyframes pulseHint {
  0%, 100% { transform: translateX(0); opacity: 0.85; }
  50% { transform: translateX(4px); opacity: 1; }
}

/* ==========================================================================
   TIPOGRAFIA & ELENCO PIATTI (Stile Santalleria.it)
   ========================================================================== */
.page-top-decor {
  text-align: center;
  margin-bottom: 12px;
}

.page-category-badge {
  font-family: var(--font-sans);
  font-size: 10.5px;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: var(--accent-gold);
  font-weight: 700;
  display: inline-block;
  margin-bottom: 2px;
}

.page-title {
  font-family: var(--font-serif);
  font-size: 24px;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.2;
}

.page-subtitle-intro {
  font-family: var(--font-serif);
  font-size: 12.5px;
  font-style: italic;
  color: var(--accent-terracotta);
  margin-top: 2px;
  opacity: 0.95;
}

/* Elenco Piatti Arioso & Scorrevole */
.dishes-list {
  display: flex;
  flex-direction: column;
  gap: 11px;
  flex: 1;
  min-height: 0;
  justify-content: flex-start;
  overflow-y: auto !important;
  -webkit-overflow-scrolling: touch !important;
  overscroll-behavior-y: contain;
  scrollbar-width: thin;
  scrollbar-color: rgba(178, 59, 37, 0.35) transparent;
  padding-right: 4px;
  padding-bottom: max(68px, calc(var(--sab) + 56px));
  touch-action: pan-y pinch-zoom !important;
}

.dishes-list::-webkit-scrollbar {
  width: 4px;
}

.dishes-list::-webkit-scrollbar-track {
  background: transparent;
}

.dishes-list::-webkit-scrollbar-thumb {
  background: rgba(178, 59, 37, 0.3);
  border-radius: 4px;
}

.dish-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.dish-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
}

.dish-name {
  font-family: var(--font-serif);
  font-size: 14.5px;
  font-weight: 700;
  letter-spacing: 0.15px;
  color: var(--text-primary);
  line-height: 1.25;
  flex: 1;
}

.dish-price {
  font-family: var(--font-serif);
  font-size: 14px;
  font-weight: 700;
  color: var(--accent-terracotta);
  background-color: #faf4ee;
  border: 1px solid rgba(178, 59, 37, 0.15);
  padding: 2px 7px;
  border-radius: 6px;
  white-space: nowrap;
}

.dish-desc {
  font-size: 11.5px;
  line-height: 1.4;
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-weight: 400;
}

.dish-tags {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 2px;
  flex-wrap: wrap;
}

.dish-diet {
  display: inline-block;
  font-family: var(--font-sans);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.8px;
  color: var(--accent-terracotta);
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  padding: 1px 6px;
  text-transform: uppercase;
}

.allergen-chip {
  font-family: var(--font-sans);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.2px;
  padding: 2px 7px 2px 5px;
  border-radius: 20px;
  background: linear-gradient(135deg, #fdfaf5 0%, #f6efe4 100%);
  color: var(--text-primary);
  border: 1px solid rgba(194, 155, 72, 0.35);
  box-shadow: 0 1px 2px rgba(24, 38, 28, 0.05);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  line-height: 1.1;
}

.allergen-svg {
  width: 11px;
  height: 11px;
  flex-shrink: 0;
  display: block;
}

.allergen-chip.chip-gluten {
  border-color: rgba(184, 134, 45, 0.38);
  color: #7a5514;
}
.allergen-chip.chip-gluten .allergen-svg { color: #b8862d; }

.allergen-chip.chip-dairy {
  border-color: rgba(178, 59, 37, 0.28);
  color: #8c2d1b;
}
.allergen-chip.chip-dairy .allergen-svg { color: #b23b25; }

.allergen-chip.chip-fish {
  border-color: rgba(44, 95, 110, 0.32);
  color: #214a56;
}
.allergen-chip.chip-fish .allergen-svg { color: #2c5f6e; }

.allergen-chip.chip-nuts {
  border-color: rgba(124, 77, 43, 0.32);
  color: #5c371d;
}
.allergen-chip.chip-nuts .allergen-svg { color: #7c4d2b; }

.allergen-chip.chip-info {
  border-color: rgba(47, 79, 62, 0.28);
  background: linear-gradient(135deg, #f6faf7 0%, #edf4ef 100%);
  color: #274435;
}
.allergen-chip.chip-info .allergen-svg { color: #2f5742; }

/* Intestazioni di Sezione / Sottocategorie del Menu */
.menu-section-divider {
  font-family: var(--font-serif);
  font-size: 13px;
  font-weight: 700;
  color: var(--accent-terracotta);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  border-bottom: 1px solid rgba(178, 59, 37, 0.2);
  padding-bottom: 3px;
  margin-top: 6px;
  margin-bottom: 6px;
}

/* Riquadro Contorni Tradizionali */
.contorni-box {
  background: rgba(178, 59, 37, 0.04);
  border: 1px dashed rgba(178, 59, 37, 0.28);
  border-radius: 8px;
  padding: 8px 10px;
  margin-top: 6px;
}

.contorni-box-title {
  font-family: var(--font-serif);
  font-size: 13px;
  font-weight: 700;
  color: var(--accent-terracotta);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 6px;
  border-bottom: 1px solid rgba(178, 59, 37, 0.15);
  padding-bottom: 2px;
}

.contorni-items {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.contorno-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
}

.contorno-name {
  font-family: var(--font-serif);
  font-size: 14.5px;
  font-weight: 700;
  letter-spacing: 0.15px;
  line-height: 1.25;
  color: var(--text-primary);
  flex: 1;
}

.contorno-price {
  font-family: var(--font-serif);
  font-size: 14px;
  font-weight: 700;
  color: var(--accent-terracotta);
  background-color: #faf4ee;
  border: 1px solid rgba(178, 59, 37, 0.15);
  padding: 2px 7px;
  border-radius: 6px;
  white-space: nowrap;
}

/* Citazione e Filosofia */
.quote-banner {
  background: rgba(194, 155, 72, 0.12);
  border-left: 3px solid var(--accent-gold);
  padding: 5px 9px;
  border-radius: 0 6px 6px 0;
  margin-bottom: 8px;
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 11px;
  color: var(--text-primary);
  line-height: 1.35;
}

/* Piede Pagina */
.page-footer {
  margin-top: auto;
  padding-top: 6px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 10px;
  color: var(--text-secondary);
  border-top: 1px solid var(--border-color);
}

.page-num {
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 11px;
  color: var(--accent-terracotta);
}

/* ==========================================================================
   CARTA DEI VINI & ALLERGENI (SU CARTA CHIARA/AVORIO - ZERO NERO)
   ========================================================================== */
.page-wine {
  background-color: var(--bg-primary) !important;
  color: var(--text-primary) !important;
}

.wine-category-title {
  font-family: var(--font-serif);
  font-size: 13px;
  font-weight: 700;
  color: var(--accent-terracotta);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  border-bottom: 1px solid rgba(178, 59, 37, 0.2);
  padding-bottom: 3px;
  margin-top: 6px;
  margin-bottom: 6px;
}

.wine-item {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 6px;
}

.wine-name-block {
  flex: 1;
}

.wine-name {
  font-family: var(--font-serif);
  font-size: 14.5px;
  font-weight: 700;
  letter-spacing: 0.15px;
  line-height: 1.25;
  color: var(--text-primary);
}

.wine-zone {
  font-family: var(--font-sans);
  font-size: 11.5px;
  font-weight: 400;
  line-height: 1.4;
  color: var(--text-secondary);
  font-style: normal;
  margin-top: 2px;
}

.wine-prices {
  display: flex;
  gap: 5px;
  white-space: nowrap;
}

.wine-calice {
  font-family: var(--font-serif);
  font-size: 14px;
  font-weight: 700;
  color: var(--accent-terracotta);
  background: rgba(178, 59, 37, 0.08);
  padding: 2px 7px;
  border-radius: 6px;
  border: 1px solid rgba(178, 59, 37, 0.15);
}

.wine-bottiglia {
  font-family: var(--font-serif);
  font-size: 14px;
  font-weight: 700;
  color: var(--accent-terracotta);
  background-color: #faf4ee;
  padding: 2px 7px;
  border-radius: 6px;
  border: 1px solid rgba(178, 59, 37, 0.15);
}

.allergen-box {
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 7px 9px;
  margin-top: 6px;
}

.allergen-box-title {
  font-family: var(--font-serif);
  font-size: 11px;
  font-weight: 800;
  color: var(--accent-terracotta);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}

.allergen-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
}

.allergen-grid-item {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 9px;
  font-weight: 600;
  color: var(--text-primary);
  background: var(--bg-primary);
  padding: 2px 5px;
  border-radius: 4px;
  border: 1px solid rgba(194, 155, 72, 0.25);
}

.coperto-notice {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(178, 59, 37, 0.06);
  border: 1px dashed var(--accent-terracotta);
  border-radius: 6px;
  padding: 5px 8px;
  margin-top: 6px;
  font-size: 10.5px;
  font-weight: 700;
  color: var(--accent-terracotta);
}

/* ==========================================================================
   L'ULTIMA CENA NAPOLETANA (Lato interno copertina finale)
   ========================================================================== */
/* ==========================================================================
   RETRO COPERTINA ESTERNA 3D (Pelle Sartoriale Notturna)
   ========================================================================== */
.back-cover {
  background-color: #0e3320 !important;
  background-image:
    linear-gradient(135deg, rgba(255, 255, 255, 0.08) 0%, rgba(255, 255, 255, 0) 38%, rgba(0, 0, 0, 0.22) 100%),
    radial-gradient(ellipse at 50% 42%, rgba(24, 82, 52, 0.14) 0%, rgba(6, 22, 14, 0.58) 100%),
    url('../assets/textures/green_leather_cover.jpg') !important;
  background-size: cover, cover, 480px 480px !important;
  background-repeat: no-repeat, no-repeat, repeat !important;
  color: #fdfbf7 !important;
  box-shadow: inset 0 0 55px rgba(0, 0, 0, 0.72), inset 0 1px 0 rgba(255, 255, 255, 0.12);
  position: relative;
  overflow: hidden;
}

/* Piegatura del dorso sul lato destro per retro copertina */
.back-cover::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 22px;
  background: linear-gradient(to left, 
    rgba(0, 0, 0, 0.6) 0%, 
    rgba(255, 255, 255, 0.08) 40%, 
    rgba(0, 0, 0, 0.25) 75%, 
    transparent 100%
  );
  pointer-events: none;
  z-index: 25;
}

.back-info-card {
  background: rgba(10, 38, 24, 0.75);
  border: 1px solid rgba(212, 175, 95, 0.55);
  box-shadow: 
    0 4px 16px rgba(0, 0, 0, 0.45), 
    inset 0 1px 1px rgba(255, 255, 255, 0.15),
    inset 0 0 10px rgba(0, 0, 0, 0.35);
  border-radius: 10px;
  padding: 12px 14px;
  width: 100%;
  margin-bottom: 8px;
}

.info-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  margin-bottom: 6px;
}

.info-row:last-child {
  margin-bottom: 0;
}

.info-label {
  color: rgba(253, 251, 247, 0.7);
}

.info-val {
  color: var(--accent-gold-light);
  font-weight: 700;
}

.copy-wifi-btn {
  background: rgba(194, 155, 72, 0.2);
  border: 1px solid var(--accent-gold);
  color: var(--accent-gold-light);
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
}

.service-actions-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  width: 100%;
  margin-top: 10px;
}

.action-card-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(194, 155, 72, 0.3);
  border-radius: 10px;
  padding: 12px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  color: #fff;
  cursor: pointer;
  transition: all 0.2s ease;
}

.action-card-btn:active {
  transform: scale(0.96);
  background: rgba(178, 59, 37, 0.25);
  border-color: var(--accent-terracotta);
}

.action-card-btn svg {
  width: 20px;
  height: 20px;
  fill: var(--accent-gold);
}

.action-card-btn span {
  font-size: 10.5px;
  font-weight: 700;
  text-align: center;
}

/* ==========================================================================
   INDICATORE PAGINA FLOTTANTE IN BASSO (Discreto & Minimal)
   ========================================================================== */
.bottom-floating-hint {
  position: fixed;
  bottom: max(14px, var(--sab));
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(253, 251, 247, 0.94);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(194, 155, 72, 0.4);
  padding: 4px 16px;
  border-radius: 40px;
  box-shadow: 0 4px 18px rgba(44, 32, 28, 0.12);
  pointer-events: auto;
}

.floating-flip-btn {
  background: rgba(178, 59, 37, 0.09);
  border: 1px solid rgba(178, 59, 37, 0.22);
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  color: var(--accent-terracotta);
  cursor: pointer;
  font-weight: bold;
  line-height: 1;
  transition: all 0.15s cubic-bezier(0.16, 1, 0.3, 1);
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  touch-action: manipulation;
}

.floating-flip-btn:active {
  transform: scale(0.88);
  background: var(--accent-terracotta);
  color: #fff;
}

.floating-counter {
  font-family: var(--font-serif);
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: 1px;
  min-width: 48px;
  text-align: center;
}

/* ==========================================================================
   MODAL INDICE CAPITOLI (iOS Bottom Sheet)
   ========================================================================== */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(44, 32, 28, 0.6);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 2000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.modal-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-sheet {
  background: var(--bg-primary);
  border-top: 2px solid var(--accent-terracotta);
  border-radius: 20px 20px 0 0;
  padding: 16px 20px max(24px, var(--sab)) 20px;
  transform: translateY(100%);
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
}

.modal-backdrop.active .modal-sheet {
  transform: translateY(0);
}

.sheet-drag-handle {
  width: 36px;
  height: 4px;
  background: var(--border-color);
  border-radius: 2px;
  margin: 0 auto 16px auto;
}

.sheet-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
}

.sheet-title {
  font-family: var(--font-serif);
  font-size: 20px;
  font-weight: 800;
  color: var(--text-primary);
}

.sheet-close-btn {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.sheet-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.chapter-card {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #ffffff;
  border: 1px solid var(--border-color);
  padding: 12px 14px;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.chapter-card:active {
  background: var(--bg-secondary);
  border-color: var(--accent-terracotta);
  transform: scale(0.97);
}

.chapter-card.current {
  border-color: var(--accent-terracotta);
  background: #fffdf9;
  box-shadow: 0 2px 8px rgba(178, 59, 37, 0.12);
}

.chapter-icon {
  font-size: 22px;
}

.chapter-info h4 {
  font-family: var(--font-serif);
  font-size: 14px;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.chapter-info span {
  font-size: 11px;
  font-weight: 600;
  color: var(--accent-terracotta);
}

/* ==========================================================================
   TOAST NOTIFICATION
   ========================================================================== */
.toast-msg {
  position: fixed;
  top: max(20px, var(--sat));
  left: 50%;
  transform: translateX(-50%) translateY(-30px);
  background: rgba(44, 32, 28, 0.95);
  backdrop-filter: blur(12px);
  border: 1px solid var(--accent-gold);
  color: #fff;
  padding: 10px 18px;
  border-radius: 30px;
  font-size: 12.5px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
  z-index: 3000;
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.toast-msg.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ==========================================================================
   OTTIMIZZAZIONE RESPONSIVE MULTI-DISPOSITIVO (TABLET, PC DESKTOP & SCHERMI COMPATTI)
   ========================================================================== */

/* Tablet, Laptop & PC Desktop: Folio Centrato con Sfondo Sartoriale ed Effetto Libro 3D */
@media (min-width: 601px) {
  #app, .menu-stage {
    background: radial-gradient(circle at 50% 45%, #2b1e19 0%, #120c0a 100%);
  }

  .top-floating-bar {
    width: 100%;
    max-width: 500px;
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    padding: 14px 18px 8px 18px;
  }

  .book-shadow-wrapper {
    width: auto;
    height: auto;
    border-radius: 10px;
    box-shadow: 
      0 26px 70px rgba(0, 0, 0, 0.78),
      0 6px 20px rgba(0, 0, 0, 0.5),
      0 0 0 1px rgba(212, 175, 95, 0.3);
    overflow: hidden;
  }

  #flipbook {
    border-radius: 10px;
  }

  .modal-sheet {
    width: 100%;
    max-width: 500px;
    margin: 0 auto;
    border-left: 1px solid rgba(178, 59, 37, 0.25);
    border-right: 1px solid rgba(178, 59, 37, 0.25);
  }

  .dishes-list::-webkit-scrollbar {
    width: 5px;
  }
}

/* Interazioni Mouse / Trackpad su PC & Mac */
@media (hover: hover) and (pointer: fine) {
  .floating-btn:hover {
    background: #ffffff;
    border-color: var(--accent-terracotta);
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(44, 32, 28, 0.16);
  }

  .floating-flip-btn:hover {
    background: var(--accent-terracotta);
    color: #ffffff;
    transform: scale(1.06);
  }

  .chapter-card:hover {
    border-color: var(--accent-terracotta);
    background: #fffdf9;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(178, 59, 37, 0.12);
  }

  .action-card-btn:hover {
    background: rgba(212, 175, 95, 0.16);
    border-color: var(--accent-gold);
  }

  .copy-wifi-btn:hover {
    background: var(--accent-gold);
    color: #12281b;
  }

  .cover-hint:hover {
    background: rgba(222, 178, 85, 0.24);
    border-color: #f3d793;
    transform: translateY(-1px);
  }
}

/* Schermi Compatti in Altezza (es. iPhone SE, Mini o Finestre Laptop ridotte) */
@media (max-height: 700px) {
  .cover-content {
    padding-top: max(54px, calc(var(--sat) + 42px));
    padding-bottom: max(62px, calc(var(--sab) + 52px));
  }

  .cover-logo-wrapper {
    width: 76px;
    height: 76px;
    margin-bottom: 6px;
  }

  .cover-brand-logo-container {
    max-width: 230px;
  }

  .back-info-card {
    padding: 9px 12px;
    margin-bottom: 6px;
  }

  .action-card-btn {
    padding: 9px 8px;
  }

  .page-top-decor {
    margin-bottom: 8px;
  }

  .page-title {
    font-size: 21px;
  }
}

/* Smartphone Molto Stretti (es. 320px - 360px) */
@media (max-width: 360px) {
  .top-floating-bar {
    padding-left: 10px;
    padding-right: 10px;
  }

  .floating-brand-logo-img {
    height: 24px;
    max-width: 105px;
  }

  .floating-btn {
    padding: 5px 9px;
    font-size: 11px;
  }

  .page-content {
    padding-left: 14px;
    padding-right: 14px;
  }
}

/* ==========================================================================
   RICHIAMI ALLERGENI [1, 7] / [V] & PAGINA LEGENDA ALLERGENI 1-14
   ========================================================================== */
.allergen-ref {
  font-family: var(--font-sans);
  font-size: 9.5px;
  font-weight: 700;
  color: var(--accent-gold);
  background: rgba(194, 155, 72, 0.12);
  border: 1px solid rgba(194, 155, 72, 0.28);
  border-radius: 4px;
  padding: 0 4px;
  margin-left: 4px;
  vertical-align: middle;
  letter-spacing: 0.2px;
  white-space: nowrap;
}

.menu-section-subtitle {
  font-family: var(--font-sans);
  font-size: 9.5px;
  font-weight: 600;
  color: var(--text-secondary);
  letter-spacing: 0.4px;
  margin-top: -3px;
  margin-bottom: 6px;
}

.allergen-legend-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px 10px;
  margin-top: 4px;
}

.allergen-legend-item {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  font-size: 10px;
  line-height: 1.25;
}

.allergen-num-badge {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: linear-gradient(135deg, #fdfaf5 0%, #f6efe4 100%);
  border: 1px solid rgba(194, 155, 72, 0.38);
  box-shadow: 0 1px 3px rgba(24, 38, 28, 0.06);
  color: #b8862d;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 1px;
}

.allergen-num-badge svg {
  width: 13px;
  height: 13px;
  display: block;
}

.allergen-num-badge.badge-gluten { border-color: rgba(184, 134, 45, 0.42); color: #b8862d; }
.allergen-num-badge.badge-dairy { border-color: rgba(178, 59, 37, 0.32); color: #b23b25; }
.allergen-num-badge.badge-fish { border-color: rgba(44, 95, 110, 0.35); color: #2c5f6e; }
.allergen-num-badge.badge-nuts { border-color: rgba(124, 77, 43, 0.35); color: #7c4d2b; }
.allergen-num-badge.badge-info { border-color: rgba(47, 79, 62, 0.32); color: #2f5742; background: linear-gradient(135deg, #f6faf7 0%, #edf4ef 100%); }

.allergen-legend-text strong {
  display: block;
  font-size: 10.5px;
  font-weight: 700;
  color: var(--text-primary);
}

.allergen-legend-text span {
  display: block;
  font-size: 9px;
  color: var(--text-secondary);
  margin-top: 1px;
}

.allergen-notes-box {
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 7px 9px;
  margin-top: 6px;
  font-size: 10px;
  line-height: 1.35;
  color: var(--text-primary);
}

.allergen-notes-box h4 {
  font-family: var(--font-serif);
  font-size: 11px;
  font-weight: 800;
  color: var(--accent-terracotta);
  text-transform: uppercase;
  margin-bottom: 3px;
}

.allergen-notes-box p {
  margin-bottom: 2px;
}

.allergen-notes-box .legal-ref {
  font-size: 8.5px;
  color: var(--text-secondary);
  margin-top: 3px;
}
