    * {
      box-sizing: border-box; /* Include padding e bordi nelle dimensioni */
      max-width: 100%; /* Impedisce che gli elementi superino la larghezza del contenitore */
    }

    :root {
      --ui-duration: 400ms;
      --ui-ease: cubic-bezier(0.45, 0, 0.55, 1);
      --ui-shift: 10px;
    }
    body {
      margin: 0;
      padding: 0;
      overflow-x: hidden; /* Impedisce lo scorrimento orizzontale */
      width: 100vw; /* Assicura che il body occupi la larghezza dello schermo */
      height: 100%; /* Assicura che il body occupi l'altezza dello schermo */
      font-family: 'Poppins', sans-serif;
       /* Imposta l'immagine come sfondo */
      background-size: cover; /* Adatta l'immagine per coprire l'intero schermo */
      color: black;
      box-sizing: border-box; /* Include padding e bordi nelle dimensioni */
    }
   
    html, body {
  overscroll-behavior-y: contain;
  height: 100%;
  
  background-size: cover;
  background-attachment: fixed;
  overflow-x: hidden;
}  

    .container {
      max-width: 100%; /* Assicura che i contenitori non superino la larghezza dello schermo */
    }

    img {
      max-width: 100%; /* Impedisce che le immagini superino la larghezza del contenitore */
      height: auto; /* Mantiene le proporzioni */
    }

 .categoria-container {
  display: flex;
  overflow-x: auto;
  gap: 0.5rem;
  padding: 0.2rem 0.5rem;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  top: 0;
  z-index: 1000;
}

#language-select {
  position: fixed;
  top: 10px;
  right: 10px;
  z-index: 1;
  padding: 6px 12px;
  font-size: 1.3rem;
  font-weight: bold;
  color: black;
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  border: 2px solid black;
  border-radius: 20px;
  box-shadow: 0 0 8px rgba(0,0,0,0.2);
  appearance: none;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s ease;
}

#language-select:hover {
  transform: scale(1.05);
  box-shadow: 0 0 8px 2px black;
}

.custom-lang-selector {
  position: fixed;
  top: max(10px, env(safe-area-inset-top));
  right: max(10px, env(safe-area-inset-right));
  font-size: 1.5rem;
  user-select: none;
  z-index: 2500;
}

.selected-lang,
.icona-tavolo-badge {
  padding: 0.4rem 0.6rem;
  border: 2px solid black;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.3);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  text-align: center;
  transition: all 0.2s ease;
}

.selected-lang {
  cursor: pointer;
}

.icona-tavolo {
  position: fixed;
  top: max(10px, env(safe-area-inset-top));
  left: max(10px, env(safe-area-inset-left));
  z-index: 2500;
  user-select: none;
  font-size: 1.5rem;
}

.icona-tavolo-badge {
  display: inline-block;
  font-size: 0.95rem;
  font-weight: bold;
  color: black;
  pointer-events: none;
  cursor: default;
}

.lang-options {
  display: none;
  margin-top: 0.3rem;
  border: 2px solid black;
  border-radius: 12px;
  overflow: hidden;
  background: white;
  box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}

.lang-options div {
  padding: 0.4rem 0.6rem;
  cursor: pointer;
  background: white;
  transition: background 0.2s ease;
  text-align: center;
}

.categoria-container::-webkit-scrollbar {
  height: 4px;
  background: transparent;
}

.categoria-container::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.4);
  border-radius: 10px;
}

.categoria {
  border: 2px solid black;
  flex: 0 0 auto;
  scroll-snap-align: start;
}

.prodotto {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem;
  border-radius: 18px;
  position: relative;
  background: rgba(255, 255, 255, 0.08); /* base chiara per rilievo */
  border: 2px solid black; /* contorno netto visibile */
  box-shadow:
    0 4px 12px rgba(255, 255, 255, 0.2),
    0 0 25px rgba(255, 255, 255, 0.15); /* glow evidente su mobile */
  backdrop-filter: blur(30px);
  -webkit-backdrop-filter: blur(30px);
  margin: 0.6rem auto;
  width: 95%;
  max-width: 95%;
      transition: transform var(--ui-duration) var(--ui-ease), box-shadow var(--ui-duration) var(--ui-ease);
}

.scroll-to-top {
  position: fixed;
  bottom: max(20px, env(safe-area-inset-bottom));
  left: max(20px, env(safe-area-inset-left));
  z-index: 1999;
  width: 48px;
  height: 48px;
  padding: 0;
  margin: 0;
  border: 2px solid black;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.3);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  font-family: inherit;
  font-size: 1.35rem;
  font-weight: bold;
  line-height: 1;
  color: black;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.12);
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition:
    opacity var(--ui-duration) var(--ui-ease),
    transform var(--ui-duration) var(--ui-ease),
    visibility var(--ui-duration);
  pointer-events: none;
}
.scroll-to-top.scroll-to-top--visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  pointer-events: auto;
}
.scroll-to-top:focus-visible {
  outline: 2px solid black;
  outline-offset: 2px;
}

.carrello-sticky {
      position: fixed;
      z-index: 2000;
      display: none;
      bottom: 20px;
      right: 20px;
      -webkit-backdrop-filter: none;
      color: rgb(0, 0, 0);
      padding: 0.8rem 1.2rem;
      border-radius: 30px;
      font-weight: bold;
      box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
      cursor: pointer;
      transition: transform var(--ui-duration) var(--ui-ease), box-shadow var(--ui-duration) var(--ui-ease);
      border: 2px solid rgb(0, 0, 0);
      box-shadow: 0 0 4px 1px rgb(0, 0, 0); 
    }

/* Splash Screen — stato iniziale esplicito (evita glitch Safari su opacity/transform) */
    #splash {
      position: fixed;
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
      min-height: 100%;
      /* Fallback (prima paint; customer-app applica gradiente benvenuto kids) */
      background-color: #eff6ff;
      background-size: cover;
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      text-align: center;
      padding: 1rem;
      padding-top: max(1rem, env(safe-area-inset-top));
      padding-bottom: max(1rem, env(safe-area-inset-bottom));
      box-sizing: border-box;
      font-size: 2rem;
      color: #0c2744;
      z-index: 9999;
      opacity: 1;
      transform: none;
      isolation: isolate;
      -webkit-transform: translateZ(0);
      transition: none;
    }
    #splash.splash--exiting {
      will-change: opacity, transform;
      opacity: 0;
      transform: translateY(calc(-1 * var(--ui-shift))) scale(1.012);
      pointer-events: none;
      transition:
        opacity 520ms cubic-bezier(0.33, 1, 0.68, 1),
        transform 520ms cubic-bezier(0.33, 1, 0.68, 1);
    }
    #splash img.splash-logo {
      display: block;
      width: min(400px, 92vw);
      max-width: 100%;
      height: auto;
      margin-bottom: 1rem;
      object-fit: contain;
    }

    /* Animazione fade-in per prodotti */
    .prodotto {
      opacity: 0;
      transform: translateY(var(--ui-shift));
      animation: fadeInUp var(--ui-duration) var(--ui-ease) forwards;
    }
    @keyframes fadeInUp {
      to {
        opacity: 1;
        transform: translateY(0);
      }
    }

    @keyframes qtyFlash {
      0%, 100% { transform: scale(1); }
      50% { transform: scale(1.06); }
    }
    .quantita span.qty-flash {
      display: inline-block;
      animation: qtyFlash var(--ui-duration) var(--ui-ease);
    }

    #prodotti {
      transition:
        opacity var(--ui-duration) var(--ui-ease),
        transform var(--ui-duration) var(--ui-ease);
    }
    #prodotti.prodotti-list--exit {
      opacity: 0;
      transform: translateY(var(--ui-shift));
    }
    #prodotti.prodotti-list--enter {
      opacity: 0;
      transform: translateY(var(--ui-shift));
    }
    #prodotti.prodotti-list--enter.prodotti-list--enter-active {
      opacity: 1;
      transform: none;
    }

    /* Immagini dei prodotti a forma di cerchio */
    .prodotto img {
      width: 80px; /* Dimensione dell'immagine */
      height: 80px; /* Dimensione dell'immagine */
      object-fit: cover; /* Adatta l'immagine al contenitore */
      border-radius: 0; /* Rimuove la forma circolare */
      border: none; /* Rimuove eventuali bordi */
      box-shadow: none; /* Rimuove eventuali ombre */
    }

    /* Centrare il testo */
    .prodotto .info {
      flex: 1;
      margin-left: 1.8rem;
      color: black;
    }

    .prodotto .info span {
     position: absolute;
     top: 0.8rem;
     right: 1rem;
     font-size: 1rem;
     font-weight: bold;
     color: black;
    }
     
    /* Allineare i pulsanti "+" e "-" */
    .prodotto .quantita {
      display: flex;
      align-items: center; /* Allinea verticalmente */
      justify-content: center; /* Allinea orizzontalmente */
      gap: 0.2rem; /* Spaziatura tra i pulsanti */
      margin-top: 3rem;
    }

    .prodotto .quantita button {
      background-color: black; /* Colore bianco */
      color: white; /* Testo verde */
      border: none;
      border-radius: 50%;
      width: 20px; /* Dimensione uniforme */
      height: 20px;
      font-size: 0.7rem;
      font-weight: bold;
      cursor: pointer;
      display: flex; /* Per centrare il contenuto */
      align-items: center; /* Centra verticalmente */
      justify-content: center; /* Centra orizzontalmente */
      transition: background-color 0.3s ease;
    }

    .prodotto .quantita span {
      font-size: 1rem;
      font-weight: bold;
      color: black;
      text-align: center;
      width: 40px; /* Larghezza fissa per mantenere allineamento */
    }

    .modal {
      display: none; /* Nascosto di default */
      position: fixed;
      z-index: 1001;
      left: 0;
      top: 0;
      width: 100%;
      height: 100%;
      overflow: auto;
    }

     .modal-content {
      margin: 10% auto;
      padding: 20px;
      border: 1px solid #ddd;
      width: 80%;
      max-width: 500px;
      border-radius: 10px;
      box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
      text-align: center;
    }

    /* Overlay full-screen: dissolvenza + traslazione (allineato al carrello) */
    .overlay-panel {
      opacity: 0;
      transform: translateY(var(--ui-shift));
      transition:
        opacity var(--ui-duration) var(--ui-ease),
        transform var(--ui-duration) var(--ui-ease);
      pointer-events: none;
    }
    .overlay-panel.overlay-visible {
      opacity: 1;
      transform: none;
      pointer-events: auto;
    }

    /*
     * Fullscreen modali: altezza vincolata alla viewport reale + area scroll interna.
     * Prima: min-height: 100vh sul .modal-content faceva crescere il box oltre il parent
     * (overflow:hidden), tagliando il basso su iOS Safari senza scroll utile.
     */
    .modal.modal-fullscreen {
      z-index: 10050;
      inset: 0;
      width: 100vw;
      display: flex;
      flex-direction: column;
      align-items: stretch;
      justify-content: flex-start;
      /* fallback → dvh → iOS dynamic toolbar */
      height: 100vh;
      height: 100dvh;
      max-height: 100vh;
      max-height: 100dvh;
      max-height: -webkit-fill-available;
      min-height: 0;
      overflow: hidden;
      background: rgba(255, 255, 255, 0.2);
      backdrop-filter: blur(30px);
      -webkit-backdrop-filter: blur(30px);
      border-top: 2px solid rgba(255, 255, 255, 0.2);
      box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.2);
    }

    .modal.modal-fullscreen .modal-content {
      position: relative;
      margin: 0;
      width: 100%;
      max-width: none;
      /* Flex child scrollabile: vincola l’altezza al parent (critico su iOS) */
      flex: 1 1 auto;
      min-height: 0;
      max-height: 100%;
      display: flex;
      flex-direction: column;
      gap: 12px;
      justify-content: flex-start;
      overflow-x: hidden;
      overflow-y: auto;
      -webkit-overflow-scrolling: touch;
      overscroll-behavior-y: contain;
      touch-action: pan-y;
      scroll-padding-top: max(8px, env(safe-area-inset-top));
      scroll-padding-bottom: max(1rem, env(safe-area-inset-bottom));
      padding: max(1rem, env(safe-area-inset-top)) max(1rem, env(safe-area-inset-right))
        max(1rem, env(safe-area-inset-bottom)) max(1rem, env(safe-area-inset-left));
      border-radius: 0;
      border: none;
      box-sizing: border-box;
      text-align: center;
      background: transparent;
    }

    .modal.modal-fullscreen .modal-content .close {
      position: absolute;
      top: max(10px, env(safe-area-inset-top));
      right: max(10px, env(safe-area-inset-right));
      z-index: 2;
      cursor: pointer;
      font-size: 1.75rem;
      line-height: 1;
      padding: 4px 10px;
    }

    /* Chiudi (X): resta accessibile in alto mentre si scorre il popup */
    .modal.modal-fullscreen .modal-content > .close-x {
      position: sticky;
      top: max(6px, env(safe-area-inset-top));
      align-self: flex-end;
      margin-left: auto;
      margin-right: max(4px, env(safe-area-inset-right));
      margin-bottom: 0.25rem;
      flex-shrink: 0;
      z-index: 10;
    }

    #banner-carrello.overlay-panel {
      box-sizing: border-box;
    }

    .rimuovi-prodotto {
  background-color: black;
  color: white;
  border: none;
  border-radius: 50%;
  width: 25px;
  height: 25px;
  font-size: 1rem;
  font-weight: bold;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
  transition: transform 0.2s ease;
}

.rimuovi-prodotto:hover {
  transform: scale(1.1);
}

    .banner {
      display: none; /* Nascosto di default */
      position: fixed;
      bottom: 0;
      left: 0;
      width: 100%;
      background: rgba(255, 255, 255, 0.2); /* Sfondo trasparente */
      backdrop-filter: blur(30px); /* Effetto sfocato */
      -webkit-backdrop-filter: blur(30px); /* Supporto per Safari */
      border-top: 2px solid rgba(255, 255, 255, 0.2); /* Bordo trasparente */
      box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.2);
      z-index: 1001;
      padding: 1rem;
      height: 60vh;              /* altezza visibile (puoi aumentare o diminuire) */
    }

    .banner-content {
      max-width: 800px;
      margin: 0 auto;
      text-align: center;
    }
    
    .ordina-paga {
      color: black;
      font-size: 1rem;
      padding: 0.8rem 1.6rem;
      border: none;
      border-radius: 30px;
      font-weight: bold;
      box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
      cursor: pointer;
      margin-top: 1rem;
    }
  
    #splash.hidden {
      display: none; /* Nasconde il contenitore */
    }

    .chiudi-banner {
      background-color: #ddd;
      color: #000000;
      padding: 0.8rem 1.5rem;
      border: none;
      border-radius: 30px;
      font-weight: bold;
      cursor: pointer;
      display: block;
      width: fit-content; /* Adatta la larghezza al contenuto */
      box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
    }

    #logo-container {
      display: flex;
      justify-content: center; /* Centra orizzontalmente */
      align-items: flex-start; /* Allinea in alto */
      position: relative; /* Posizionamento relativo */
      /* Sotto fascia fissa lingua/tavolo (position: fixed) */
      margin-top: max(3.5rem, calc(1rem + env(safe-area-inset-top)));
    }

    #logo-container img {
      height: 100px; /* Altezza del logo */
      width: auto; /* Mantieni le proporzioni */
    }

    .categoria {
      border: 2px solid black;
      display: inline-block;
      margin: 0.5rem; /* Spaziatura tra i pulsanti */
      padding: 0.4rem 1rem;
      border-radius: 16px;
      background: rgba(255, 255, 255, 0.2); /* Sfondo trasparente */
      backdrop-filter: blur(30px); /* Effetto glassmorphism */
      -webkit-backdrop-filter: blur(30px); /* Supporto per Safari */
      box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2); /* Ombra */
      color: black; /* Testo bianco */
      font-size: 1rem;
      font-weight: bold;
      text-decoration: none; /* Rimuove la sottolineatura */
      cursor: pointer;
      transition:
        transform var(--ui-duration) var(--ui-ease),
        box-shadow var(--ui-duration) var(--ui-ease),
        background-color var(--ui-duration) var(--ui-ease);
    }
    
    .categoria.active {
     background: transparent;
     color: rgb(0, 0, 0);
     font-weight: bold;
     border: 2px solid rgb(0, 0, 0);
     box-shadow: 0 0 8px 2px #000000;
    }
 
    #btn-chiudi-carrello {
     position: fixed;
     bottom: 20px;
     right: 20px;
     z-index: 1000;
    }

    .contenuto {
     position: relative;
     z-index: 1;
     padding-bottom: 120px; /* spazio per footer */
     opacity: 0;
     transform: translateY(8px);
     transition:
       opacity 550ms cubic-bezier(0.4, 0, 0.2, 1),
       transform 550ms cubic-bezier(0.4, 0, 0.2, 1);
    }
    body.menu-revealing .contenuto,
    body.menu-ready .contenuto {
      opacity: 1;
      transform: none;
    }

    #popup-prodotto .modal-content * { 
     color: black; 
    }

    /* Sezione note — popup prodotto (priorità mobile, coerente con card/pulsanti) */
    #popup-prodotto .popup-note-section {
      width: 100%;
      margin-top: 1.5rem;
      margin-bottom: 1.5rem;
      text-align: left;
    }
    #popup-prodotto .popup-note-label {
      display: block;
      color: #000;
      font-weight: 600;
      font-size: 1.05rem;
      line-height: 1.35;
      margin-bottom: 0.75rem;
      letter-spacing: 0.01em;
    }
    #popup-prodotto .popup-note-textarea {
      display: block;
      width: 100%;
      min-height: 100px;
      max-height: 320px;
      padding: 16px 18px;
      box-sizing: border-box;
      border: 2px solid #000;
      border-radius: 16px;
      font-family: inherit;
      font-size: 16px;
      line-height: 1.5;
      color: #111;
      background: rgba(255, 255, 255, 0.55);
      backdrop-filter: blur(12px);
      -webkit-backdrop-filter: blur(12px);
      resize: none;
      overflow-y: auto;
      -webkit-overflow-scrolling: touch;
      transition:
        box-shadow var(--ui-duration) var(--ui-ease),
        border-color var(--ui-duration) var(--ui-ease),
        background-color var(--ui-duration) var(--ui-ease);
      box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    }
    #popup-prodotto .popup-note-textarea::placeholder {
      color: #444;
      opacity: 1;
    }
    #popup-prodotto .popup-note-textarea:focus {
      outline: none;
    }
    #popup-prodotto .popup-note-textarea:focus-visible {
      border-color: #000;
      background: rgba(255, 255, 255, 0.78);
      box-shadow:
        0 0 0 3px rgba(0, 0, 0, 0.12),
        0 6px 18px rgba(0, 0, 0, 0.1);
    }

    .ingrediente-riga button.btn-extra {
     background-color: rgb(255, 255, 255);
     color: white;
     border: none;
     border-radius: 50%;
     width: 30px;
     height: 30px;
     font-size: 1rem;
     font-weight: bold;
     cursor: pointer;
    }
    
    .ingrediente-riga {
     display: flex;
     align-items: center;
     justify-content: space-between;
     gap: 1rem;
     padding: 0.3rem 0;
    }

  #popup-rimuovi-lista .btn-extra {
  background-color: black;
  color: white;
  border: none;
  border-radius: 50%;
  width: 30px;
  height: 30px;
  font-size: 1.2rem;
  font-weight: bold;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;

  display: flex;
  align-items: center;   /* CENTRA VERTICALMENTE */
  justify-content: center; /* CENTRA ORIZZONTALMENTE */
  padding: 0; /* IMPORTANTE: senza padding interno */
}

.close {
  position: absolute;
  top: 10px;
  right: 10px;
  font-size: 20px;
  font-weight: bold;
  cursor: pointer;
  color: black; 
}

.ingrediente-riga {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(255, 255, 255, 0.08);
  border: 2px solid black;
  border-radius: 20px;
  padding: 12px 16px;
  margin: 10px 0;
  width: 92%;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(30px);
  -webkit-backdrop-filter: blur(30px);
}

.nome-ingrediente {
  font-size: 1rem;
  font-weight: bold;
  color: black;
}

.prezzo-extra {
  font-weight: normal;
  color: #555;
  font-size: 0.9rem;
  margin-left: 4px;
}

.extra-controls {
  display: flex;
  align-items: center;
  gap: 6px;
}

.btn-extra {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background-color: black;
  color: white;
  font-size: 1rem;
  font-weight: bold;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.extra-quantita {
  font-size: 1rem;
  font-weight: bold;
  color: black;
  min-width: 20px;
  text-align: center;
}

.banner-button {
  color: black;
  padding: 1.2rem 2rem;
  border: none;
  border-radius: 30px;
  font-size: 1rem;
  font-weight: bold;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
  cursor: pointer;
  margin: 1rem;
}

#popup-ordina-paga.modal-fullscreen .modal-content {
  color: black;
  text-align: center;
  font-size: 1.2rem;
  justify-content: center;
}

html, body, #splash, #welcome {
  
  background-attachment: fixed;
}

.scorrimento-prodotti-carrello {
  display: none;
  margin-top: 1rem;
  max-height: 300px;
  overflow-y: auto;
  padding-right: 8px;
}

.scorrimento-prodotti-carrello::-webkit-scrollbar {
  width: 6px;
}

.scorrimento-prodotti-carrello::-webkit-scrollbar-track {
  background: transparent;
}

.scorrimento-prodotti-carrello::-webkit-scrollbar-thumb {
  background-color: #7de9dc;
  border-radius: 10px;
  border: 1px solid transparent;
}

.scorrimento-prodotti-carrello {
  scrollbar-width: thin;
  scrollbar-color: #7de9dc transparent;
}

.riepilogo-prodotto span,
.riepilogo-prodotto strong {
  font-size: 0.9rem !important;
  font-weight: bold !important;
  color: black !important;
}


/* Stack buttons vertically: Add to Cart ABOVE, Allergens BELOW */
#popup-actions { display:flex; flex-direction:column; align-items:center; }
#popup-actions #btn-allergeni { margin-top: 12px !important; }

/* Center Allergens popup content (including Close button) */
#popup-allergeni .modal-content { text-align: center; }
#popup-allergeni h3 { text-align: center; margin-top: 0; margin-bottom: 0.5rem; }
#popup-allergeni #lista-allergeni {
  list-style: disc;
  list-style-position: inside;
  text-align: center;
  padding-left: 0;
  margin: 0.5rem auto 1rem;
  display: inline-block;
}
#popup-allergeni .chiudi-banner {
  display: block;
  width: fit-content;
  margin: 1rem auto 0;
}


/* (updated) FULLSCREEN banner — buttons keep original width */
/* Tweak sticky cart visibility overlaps */
.carrello-sticky[style*="display: block"] {
  display: block !important;
}


/* === Cart banner FULLSCREEN (revised) === */
#banner-carrello.banner { inset: 0; width: 100vw; height: 100dvh; min-height: 100vh; }
#banner-carrello .banner-content {
  height: 100%;
  display: flex;
  flex-direction: column;
  gap: 12px;
  /* allow internal sections to overflow individually */
  overflow: visible;
  padding-bottom: env(safe-area-inset-bottom);
}
/* Make only the list scrollable and visible */
#banner-contenuto {
  flex: 1 1 auto;
  min-height: 140px;
  overflow-y: auto;
  margin-top: .5rem !important;
  padding-right: 8px;
}
/* DO NOT force button width — keep original styling */
#btn-chiudi-carrello, #btn-ordina-e-paga { width: auto; }


/* Ensure cart list is visible by default (overrides .scorrimento-prodotti-carrello {display:none}) */
#banner-contenuto { display: block !important; }


/* === Mobile fixes: overlay fixed, safe-area padding, list scroll only, buttons visible === */
#banner-carrello.banner {
  position: fixed;          /* stay above the page */
  z-index: 9999;            /* ensure on top of everything */
  inset: 0;
  width: 100vw;
  height: 100dvh;
  min-height: 100vh;
}
#banner-carrello .banner-content {
  height: 100%;
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow: hidden;         /* prevent background of this container from scrolling */
  padding-bottom: max(12px, env(safe-area-inset-bottom));
}
#banner-contenuto {
  flex: 1 1 auto;
  min-height: 140px;
  overflow-y: auto;         /* only the product list scrolls */
  -webkit-overflow-scrolling: touch;
}
#btn-chiudi-carrello, #btn-ordina-e-paga {
  width: auto;              /* keep original button widths */
  display: inline-block;
  margin-bottom: max(6px, env(safe-area-inset-bottom));
}


/* === Layout requested: Pay TOP, List MIDDLE, Close BOTTOM === */
#btn-chiudi-carrello {
  position: static !important;
  bottom: auto !important;
  right: auto !important;
  z-index: auto !important;
  align-self: center;             /* keep it centered horizontally */
  margin-top: 8px;
  margin-bottom: max(10px, env(safe-area-inset-bottom));
  display: inline-block !important;
  visibility: visible !important;
}

/* Container fills viewport; only the list scrolls */
#banner-carrello.banner {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100dvh;
  min-height: 100vh;
  z-index: 9999;
}
#banner-carrello .banner-content {
  height: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow: hidden;               /* block internal scrolling except list */
  padding-bottom: max(12px, env(safe-area-inset-bottom));
}

/* Middle list: takes remaining space and scrolls */
#banner-contenuto {
  flex: 1 1 auto;
  min-height: 160px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  display: block !important;      /* visible by default */
}

/* Keep "Ordina e Paga" at top with natural size */
#btn-ordina-e-paga {
  align-self: center;
  width: auto !important;
}


/* ==== Carrello: mantieni forma "pill", sfondo trasparente, tasto "-" nero rotondo ==== */
#banner-contenuto .riepilogo-prodotto{
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 12px !important;
  padding: 14px 16px !important;
  margin: 10px 12px !important;
  border-radius: 16px !important;                 /* forma come nella foto */
  background: transparent !important;             /* sostituisce il bianco */
  border: 2px solid black !important;   /* contorno leggero per mantenere la forma */
  box-shadow: 0 6px 18px rgba(0,0,0,.06) !important; /* ombra soft per evidenziare la pill */
}
#banner-contenuto .riepilogo-prodotto .rimuovi-prodotto,
#banner-contenuto .riepilogo-prodotto button{
  width: 28px !important;
  height: 28px !important;
  border-radius: 50% !important;                  /* rotondo */
  border: none !important;
  background: #000 !important;                    /* nero */
  color: #fff !important;                         /* "-" bianco */
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  font-size: 18px !important;
  line-height: 1 !important;
  box-shadow: 0 2px 6px rgba(0,0,0,.25) !important;
  cursor: pointer;
}

.extra-toggle {
  width: 100%;
  padding: 14px;
  margin: 6px 0;
  border-radius: 18px;
  border: 2px solid black;
  background: rgba(255,255,255,0.4);
  backdrop-filter: blur(20px);
  font-weight: bold;
  cursor: pointer;
  transition: background var(--ui-duration) var(--ui-ease), transform var(--ui-duration) var(--ui-ease), border-color var(--ui-duration) var(--ui-ease);
  font-size: 1rem;
  color: black;
}

.extra-toggle.active {
  position: relative;
  background: rgba(0,0,0,0.15);
  border-color: #000;
  color: black;
  transform: scale(1.02);
}

.extra-toggle.active::after {
  content: "✔";
  position: absolute;
  right: 18px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.3rem;
  font-weight: 900;
  color: #000;
}

.close-x {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(0,0,0,0.6);
  color: white;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 1.2rem;
  display:flex;
  align-items:center;
  justify-content:center;
  cursor:pointer;
  z-index: 999;
  backdrop-filter: blur(4px);
  transition: background var(--ui-duration) var(--ui-ease), transform var(--ui-duration) var(--ui-ease);
  border: 2px solid white;
}

.close-x:hover {
  background: black;
  transform: scale(1.08);
}

/* Auth iniziale (client): blocco finché Firebase Auth non è pronto */
.auth-loading {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.96);
  font-family: "Poppins", sans-serif;
  font-size: 1.1rem;
  color: #111;
  text-align: center;
  padding: 1rem;
}

.auth-loading--hidden {
  display: none !important;
  pointer-events: none;
}

.auth-loading--fatal {
  background: rgba(255, 255, 255, 0.98);
}

/* Toast minimale (sostituisce alert) */
.app-toast {
  position: fixed;
  bottom: 1rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 100000;
  max-width: min(92vw, 420px);
  padding: 0.75rem 1rem;
  border-radius: 10px;
  font-size: 0.95rem;
  font-family: "Poppins", sans-serif;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.app-toast--error {
  background: #222;
  color: #fff;
  border: 1px solid #000;
}

.app-toast--ok {
  background: #e8f5f3;
  color: #000;
  border: 1px solid #00887a;
}

/* Locale disattivato (utenti.attivo / locali.attivo): messaggio sopra tutto */
.locale-blocked {
  position: fixed;
  inset: 0;
  z-index: 100002;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.98);
  font-family: "Poppins", sans-serif;
  padding: 1.5rem;
  text-align: center;
}

.locale-blocked.hidden {
  display: none !important;
}

.locale-blocked-text {
  margin: 0;
  font-size: 1.15rem;
  color: #111;
  max-width: 22rem;
  line-height: 1.45;
}

body.locale-access-denied .contenuto,
body.locale-access-denied .carrello-sticky,
body.locale-access-denied .scroll-to-top {
  visibility: hidden !important;
  pointer-events: none !important;
}
