@font-face {
  font-family: system-ui;
  src: local("."); /* forza Safari a NON cercare font esterni */
}
/* === VARIABLES === */
:root {
  --bg: #f6f6f7;
  --card: #ffffff;
  --text: #111;
  --subtext: #6e6e73;
  --border: #e4e4e7;
  --radius: 14px;
  --transition: 0.28s cubic-bezier(.4,0,.2,1);
  --apple-blue: #007aff;
  --success: #28a745;
  --error: #ff4747;
}

/* === BASE === */
body {
  background: var(--bg);
  color: var(--text);
  margin: 0;
font-family: -apple-system, BlinkMacSystemFont, sans-serif;  font-size: 17px;
  letter-spacing: -0.3px;
  -webkit-font-smoothing: antialiased;
}

.page { padding: 22px; max-width: 450px; margin: auto; }
.page {
  margin-top: -10px;
}

/* === CARDS (I nostri locali — versione Apple pulita) === */
#stores { max-width: 600px; margin: auto; }

.store-card {
  background: var(--card);
  border-radius: 18px;
  padding: 20px;
  margin: 14px 0;
  border: 1px solid var(--border);
  box-shadow: 0 4px 14px rgba(0,0,0,.06);
  transition: var(--transition);
}

.store-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(0,0,0,.10);
}

.store-card h3 { font-size: 19px; margin-bottom: 6px; font-weight: 600; }
.store-card p { color: var(--subtext); margin-bottom: 14px; }

.store-actions { display: flex; justify-content: center; gap: 16px; font-size: 22px; }

/* === BUTTONS === */
button, .btn {
  background: var(--apple-blue);
  color: white;
  border-radius: 12px;
  padding: 14px 18px;
  font-weight: 500;
  border: none;
  cursor: pointer;
  width: 100%;
  transition: var(--transition);
}

button:active, .btn:active { transform: scale(0.97); opacity: 0.8; }

/* === SELECTION ITEMS === */
.menu-item.option, .select-item {
  border: 1.6px solid var(--border);
  background: var(--card);
  padding: 12px 16px;
  border-radius: var(--radius);
  margin: 14px auto;
  cursor: pointer;
  position: relative;
  transition: var(--transition);
  max-width: 360px;
}
.menu-item.option {
  white-space: nowrap;
}

.menu-item.option.selected,
.select-item.selected {
  border-color: var(--success);
  background: #eaffea;
}

/* ✅ Nessuna spunta automatica */
.menu-item.option.selected::after,
.select-item.selected::after {
  content: none !important;
}
.menu-item.option.error,
.select-item.error {
  border-color: var(--error);
  background: #ffe1e1;
}

.menu-item.option.error::after,
.select-item.error::after {
  content: "✖";
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--error);
  font-size: 18px;
  font-weight: 700;
}

/* === LANGUAGE MENU (risolto — si apre e chiude) === */
#lang-toggle {
  position: fixed;
  top: 12px;
  right: 12px;
  padding: 8px 12px;
  background: #ffffffcc;
  border-radius: 10px;
  border: 1px solid #ddd;
  cursor: pointer;
  z-index: 9999;
  backdrop-filter: blur(8px);
}

#lang-menu {
  position: fixed;
  top: 52px;
  right: 12px;
  display: none;
  flex-direction: column;
  background: white;
  border-radius: 10px;
  box-shadow: 0 6px 20px rgba(0,0,0,.12);
  overflow: hidden;
  z-index: 10000;
}

#lang-menu.show { display: flex; }

#lang-menu button {
  padding: 10px 14px;
  border: none;
  background: white;
  text-align: left;
  cursor: pointer;
  transition: 0.2s;
}

#lang-menu button:hover { background: #f2f2f2; }

/* === POPUP CREA COPPA === */
.popup {
  position: fixed;
  top: 0; left: 0;
  width: 100vw; height: 100vh;
  background: rgba(0,0,0,.35);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 99999;
}

.popup-content {
  background: white;
  padding: 26px 20px;
  border-radius: 18px;
  max-width: 340px;
  text-align: center;
}

/* PRINT */
@media print { .home-btn, #lang-toggle, #dynamic-island { display:none !important;} }
/* === POPUP CREA COPPA === */
.popup {
  position: fixed;
  top: 0; left: 0;
  width: 100vw; height: 100vh;
  background: rgba(0,0,0,.35);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 99999;
  animation: fadeIn .3s ease;
}

.popup-content {
  background: white;
  padding: 26px 20px;
  border-radius: 18px;
  max-width: 340px;
  text-align: center;
  animation: popupIn .25s ease;
}

.popup-content h2 { margin-top: 0; font-size: 20px; }
.popup-content p { color: #6e6e73; margin: 10px 0 18px; }

.popup button {
  background: #007aff;
  color: white;
  border-radius: 12px;
  padding: 12px 16px;
  width: 100%;
  border: none;
  font-size: 16px;
  font-weight: 500;
}

/* Animazioni morbide */
@keyframes fadeIn { from{opacity:0;} to{opacity:1;} }
@keyframes popupIn { from{transform:scale(.88);} to{transform:scale(1);} }
/* ================= DYNAMIC ISLAND ================= */
#dynamic-island {
  position: fixed;
  top: 12px;
  left: 12px;           /* ⬅️ da cambiare */
  transform: none;      /* ⬅️ rimuove la centratura */
  
  background: #111;
  color: #fff;
  padding: 8px 18px;
  border-radius: 18px;
  font-size: 15px;
  font-weight: 500;
  opacity: 0;
  transition: opacity .4s;
  z-index: 9999;
}
#dynamic-island.show {
  opacity: 1;
}
#island-progress {
  width: 100%;
  height: 4px;
  background: #333;
  margin-top: 4px;
  border-radius: 5px;
  overflow: hidden;
}
#island-bar {
  height: 4px;
  width: 0%;
  background: #ff7a00;
  transition: width .4s;
}
/* ====== NUOVO TESTO DYNAMIC ISLAND ====== */
#island-title {
  font-size: 13px;
  font-weight: 600;
  opacity: 0.9;
}

#island-added {
  font-size: 15px;
  font-weight: 700;
}

/* ================= LISTA SELEZIONABILE ================= */
.menu-item {
  padding: 12px 18px;
  margin: 8px auto;
  background: #ffffffd6;
  border-radius: 14px;
  font-size: 18px;
  width: 90%;
  max-width: 420px;
  text-align: center;
  border: 1px solid #ddd;
  cursor: pointer;
  transition: .3s;
}
.menu-item:hover {
  transform: scale(1.03);
}
.menu-item.selected {
  background: #ff7a00;
  color: #fff;
  border-color: #ff7a00;
}

/* ================= POPUP INFO ================= */
#popup-coppa {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0,0,0,0.45);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 20000;
}
#popup-coppa .popup-content {
  background: #fff;
  padding: 22px;
  border-radius: 16px;
  width: 80%;
  max-width: 350px;
  text-align: center;
  font-size: 17px;
  line-height: 1.4;
}
#popup-coppa button {
  margin-top: 14px;
  background: #ff7a00;
  color: white;
  border: none;
  padding: 10px;
  border-radius: 10px;
  width: 100%;
  font-size: 16px;
  cursor: pointer;
}
/* LISTA INGREDIENTI */
.ingredienti-lista {
  display:flex;
  flex-direction:column;
  gap:10px;
  padding:20px;
  max-width:450px;
  margin:0 auto;
}

/* OGNI ELEMENTO SELEZIONABILE */
.item {
  background:white;
  border:2px solid #d8d8d8;
  padding:12px 16px;
  border-radius:12px;
  font-size:18px;
  cursor:pointer;
  transition:.25s;
  text-align:center;
}

.item:hover {
  border-color:#8ac6ff;
  background:#f5fbff;
}

/* ✅ SELEZIONATO */
.item.selected {
  border-color:#36c463;
  background:#e7ffe9;
  position:relative;
}

.item.selected::after {
  content:"✅";
  position:absolute;
  right:14px;
  top:50%;
  transform:translateY(-50%);
  font-size:20px;
}
/* ================= LISTA INGREDIENTI (VERSIONE FINALE STABILE) ================= */
.ingredienti-lista {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 18px;
  max-width: 450px;
  margin: 0 auto;
}

/* OGNI ELEMENTO SELEZIONABILE */
.item {
  background: white;
  border: 2px solid #d8d8d8;
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 18px;
  cursor: pointer;
  transition: .25s;
  text-align: center;
}

.item:hover {
  border-color: #8ac6ff;
  background: #f5fbff;
}

/* ✅ SELEZIONATO */
.item.selected {
  border-color:#36c463;
  background:#e7ffe9;
  position:relative;
}

.item.selected::after {
  content:"✅";
  position:absolute;
  right:14px;
  top:50%;
  transform:translateY(-50%);
  font-size:20px;
}
/* ✅ Animazione AGGIUNTA (verde soft) */
.add-ok {
  animation: addOkAnim 0.4s ease-out;
}
@keyframes addOkAnim {
  0%   { background-color: #d4ffd4; }
  100% { background-color: transparent; }
}

/* ❌ Animazione LIMITE (rosso soft) */
.limit-error {
  animation: limitErrorAnim 0.4s ease-out;
}
@keyframes limitErrorAnim {
  0%   { background-color: #ffd4d4; }
  100% { background-color: transparent; }
}

/* Quando aggiungo (spunta verde) */
.add-anim {
  background: #e9ffe9 !important;
  border-color: #69cf69 !important;
  transform: scale(1.05);
}

/* Quando tolgo */
.remove-anim {
  background: #fffbe6 !important;
  border-color: #d4c45c !important;
  transform: scale(0.95);
}

/* Quando supero il limite → X rossa */
.item.limit {
  background: #ffe6e6 !important;
  border-color: #ff4d4d !important;
  animation: shake 0.25s ease;
}

@keyframes shake {
  0% { transform: translateX(0); }
  25% { transform: translateX(-3px); }
  50% { transform: translateX(3px); }
  75% { transform: translateX(-3px); }
  100% { transform: translateX(0); }
}
.nav-buttons {
  display: flex;
  justify-content: space-between;
  margin-top: 18px;
}

.back-btn, .next-btn {
  padding: 12px 16px;
  border: none;
  font-size: 16px;
  cursor: pointer;
  border-radius: 8px;
}

.back-btn {
  background: #ddd;
}

.next-btn {
  background: #ffcf3f;
}
.item.error {
  border: 2px solid red !important;
  color: red;
  transform: scale(1.05);
  transition: 0.3s;
}
/* ✅ Effetto AGGIUNTO (bagliore verde leggero) */
.add-ok {
  animation: addOkAnim 0.4s ease-out;
}

@keyframes addOkAnim {
  0%   { background-color: #d4ffd4; }
  100% { background-color: transparent; }
}

/* ❌ Effetto LIMITE (bagliore rosso leggero) */
.limit-error {
  animation: limitErrorAnim 0.4s ease-out;
}

@keyframes limitErrorAnim {
  0%   { background-color: #ffd4d4; }
  100% { background-color: transparent; }
}
/* 🔥 Elimina contatore step (1/2, 2/3, ecc.) */
.step-counter,
.progresso,
.progress-text,
.progress-step {
  display: none !important;
}
.scontrino {
  width: 90%;
  margin: auto;
  padding: 20px;
  background: #fff;
  border: 1px dashed #444;
  font-family: monospace;
  font-size: 16px;
  line-height: 1.5;
}
.scontrino hr {
  border: none;
  border-top: 1px dashed #444;
  margin: 10px 0;
}
.item.limit-warning {
  background: rgba(255, 0, 0, 0.3) !important;
  border-color: red !important;
  transition: background 0.3s, border-color 0.3s;
}

.item.limit-warning.shake {
  animation: shake 0.4s ease;
}

@keyframes shake {
  0% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  50% { transform: translateX(4px); }
  75% { transform: translateX(-4px); }
  100% { transform: translateX(0); }
}
.limit-reached {
  background: rgba(255, 0, 0, 0.25) !important;
  border-color: red !important;
  animation: shake 0.4s ease;
}
/* ----------------------------------
   Forza: niente spunta di default
   ---------------------------------- */
.menu-item.option::after,
.select-item::after,
.item::after,
.menu-item::after {
  content: none !important;
}

/* Assicura che gli elementi abbiano positioning per il ::after */
.item { position: relative; }

/* Mostra la spunta SOLO quando l'elemento è selezionato */
.item.selected::after {
  content: "✔";
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 20px;
  color: #2c8a2c; /* verde spunta */
  font-weight: 700;
}

/* Compatibilità: se hai altri tipi di card usali anche per loro */
.menu-item.option.selected::after,
.select-item.selected::after {
  content: "✔" !important;
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 18px;
  color: #2c8a2c;
  font-weight: 700;
}
#quick-next {
  position: fixed;
  top: 62px;
  right: 14px;
  background: #ffcf3f;
  border: none;
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  display: none; /* 🔥 parte nascosto */
  z-index: 9999;
}

/* titolo (es. PICCOLA) */
#riepilogo-mini .riepilogo-titolo{
  font-weight: 800;
  font-size: 13px;
  width: 100%;
  text-align: right;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  pointer-events: auto;
}

/* ogni riga: label in grassetto e valore normale */
#riepilogo-mini .riepilogo-line{
  width: 100%;
  text-align: right;
  color: #222;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* label (G, Gr, T, Ing, Extra) */
#riepilogo-mini .riepilogo-line b{
  font-weight: 800;
  margin-right: 6px;
}

/* nascondi se vuoto (utile) */
#riepilogo-mini.hidden { opacity: 0; transform: translateY(-6px); pointer-events:none; }
/* =================== SISTEMA SELEZIONE PULITO =================== */

/* Forza: nessuna spunta di default */
.menu-item.option::after,
.select-item::after,
.item::after {
  content: none !important;
}

/* La spunta appare SOLO quando selezionato */
.item.selected::after {
  content: "✔";
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 20px;
  color: #2c8a2c;
  font-weight: 700;
}

/* ================= MINI RIEPILOGO (versione FINALE) ================= */
#riepilogo-mini {
  position: fixed;
  top: 12px;
  right: 12px;

  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(6px);
  padding: 8px 12px;                /* compatto */
  border-radius: 14px;
  box-shadow: 0 3px 12px rgba(0,0,0,0.18);

  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;

  width: fit-content;
  max-width: 200px;                 /* NON esplode più */
  min-width: 110px;

  font-size: 14px;
  line-height: 1.28;
  color: #000;
  z-index: 99999;
  cursor: pointer;

  transform: none !important;       /* nessuna centratura */
  left: auto !important;
}


/* --- MINI RIEPILOGO SUPER COMPATTO (nuova versione) --- */

#riepilogo-mini.collapsed {
    width: 105px !important;      /* ⭐ PERFETTO per PICCOLA / MEDIA / GRANDE */
    min-width: 105px !important;
    max-width: 105px !important;

    padding: 4px 8px !important;   /* margini piccoli ma leggibili */
    border-radius: 14px !important;

    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;

    display: flex;
    justify-content: center;       /* ⭐ centra tutto, zero lingua bianca */
}

/* Impedisce l’allungamento */
#riepilogo-mini {
    display: inline-block;
}

/* Evita che le righe interne espandano la pillola da chiusa */
#riepilogo-mini.collapsed .riepilogo-line,
#riepilogo-mini.collapsed .riepilogo-titolo {
    width: auto !important;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
}
#riepilogo-mini .riepilogo-line b {
  font-size: 12px;
  margin-bottom: 2px;
}

/* VALORI (gusti, topping ecc.) */
/* RIGHE DEL RIEPILOGO */
#riepilogo-mini .riepilogo-line {
  width: 100%;                      /* <--- RISOLVE i gusti lunghi */
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 2px 0;
}

#riepilogo-mini .riepilogo-line b {
  font-size: 12px;
  margin-bottom: 2px;
}

/* VALORI (gusti, topping ecc.) */


/* Pulsante 'Avanti' */
#riepilogo-mini .quick-next-inside {
  display: block;
  margin-top: 6px;
  padding: 6px 10px;
  background: #2c8a2c;
  color: #fff;
  border-radius: 8px;
  width: 100%;
  text-align: center;
}

#riepilogo-mini.collapsed .quick-next-inside {
  display: none;
}

/* 🔥 SHAKE SEMPRE FUNZIONANTE */
@keyframes riepilogoShake {
  0%   { transform: translateX(0); }
  25%  { transform: translateX(-4px); }
  50%  { transform: translateX(4px); }
  75%  { transform: translateX(-4px); }
  100% { transform: translateX(0); }
}

#riepilogo-mini.shake {
  animation: riepilogoShake 0.30s ease;
}

/* --- Animazione fluida apertura/chiusura mini riepilogo --- */
#riepilogo-mini {
  overflow: hidden;
  transition:
    max-height 0.35s ease,
    opacity 0.25s ease,
    padding 0.35s ease;
}

/* Aperto */
#riepilogo-mini.open {
  max-height: 500px;   /* si espande con animazione */
  opacity: 1;
  padding: 10px 14px;
}

/* Chiuso (mini pill) */
#riepilogo-mini.collapsed {
  max-height: 40px;    /* anima la chiusura */
  opacity: .96;
  padding: 4px 6px;
}



/* Shake */
#riepilogo-mini.shake {
  animation: riepilogoShake 0.30s ease;
}

@keyframes riepilogoShake {
  0%   { transform: translateX(0); }
  25%  { transform: translateX(-4px); }
  50%  { transform: translateX(4px); }
  75%  { transform: translateX(-4px); }
  100% { transform: translateX(0); }
}

.home-btn img {
    width: 30px;   /* ← DIMENSIONE PERFETTA DEL LOGO */
    height: auto;
    pointer-events: none;  /* il click resta sul tasto */
}

.home-btn span {
  font-size: 11px;          /* 🔹 scritta piccola */
  color: white;
  margin-top: 2px;          /* 🔹 più vicina all’icona */
  text-shadow: 0 1px 3px rgba(0,0,0,0.5);
}

body.step-size #riepilogo-mini {
    display: none !important;
}

#top-fixed-bar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 50px;
    display: flex;
    justify-content: center;
    align-items: center;
    background: white;
    z-index: 9999;
}
#top-fixed-spacer {
    height: 50px; /* Deve essere uguale all’altezza della barra */
}
.home-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 16px;
    color: #444;
    text-decoration: none;
}

.home-btn img {
    width: 28px;
    height: 28px;
}

/* ===== TITOLO DELLA SEZIONE (Gusti, Topping, ecc.) ===== */
.step-title {
    font-size: 22px;
    font-weight: 700;
    text-align: center;
    margin: 10px 0 14px;
    opacity: 0.85;
    transition: opacity .25s ease, transform .25s ease;
}

/* quando deve sparire */
.step-title.hidden {
    opacity: 0;
    transform: translateY(-6px);
    pointer-events: none;
}

.step-title {
  text-align: center;
  font-size: 22px;
  font-weight: 700;
  margin-top: 10px;
  margin-bottom: 16px;
}

/* ========== GESTIONE GUSTI CON QUANTITÀ ========== */

.gusto-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
}

/* Nome gusto */
.gusto-name {
    font-weight: 600;
    font-size: 18px;
}

/* Controlli + / - */
.gusto-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Bottoni + e − */
.gusto-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    font-size: 20px;
    background: #f1f1f1;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* bottone + evidenziato */
.gusto-btn.plus {
    background: #ffda6a;
}

/* bottone - */
.gusto-btn.minus {
    background: #eaeaea;
}

/* quantità */
.gusto-qty {
    width: 24px;
    text-align: center;
    font-size: 18px;
    font-weight: 700;
    color: #333;
}

/* stato in modifica (giallo) */
.gusto-pending {
    background: #fff2b0 !important;
    border-color: #ffd75a !important;
}

/* stato confermato (verde) */
.gusto-confirmed {
    background: #e2ffe4 !important;
    border-color: #36c463 !important;
}

/* animazioni leggere */
.gusto-item {
    transition: 0.25s ease;
}

.gusto-btn.plus.limit-blink {
    animation: blinkPlus 0.45s ease-in-out;
    background: #ff3b3066 !important;
}

@keyframes blinkPlus {
    0%   { transform: scale(1);   background:#ff3b3066; }
    50%  { transform: scale(1.15); background:#ff3b30; }
    100% { transform: scale(1);   background:#ff3b3066; }
}

/* === COPPA PREVIEW FIX === */
#preview-area {
    position: relative;
    width: 650px;
    height: 420px;
    margin: 30px auto;
    background: #fff;
}

/* COPPA */
.coppa-base {
    position: absolute;
    width: 260px;
    left: 120px;
    top: 190px;
    z-index: 1;
}

/* PALLINE – più in alto */
.pallina {
    position: absolute;
    width: 110px;
    height: 110px;
    border-radius: 50%;
    z-index: 3;
}

.pallina1 {
    top: 80px;   /* alzata */
    left: 135px;
}

.pallina2 {
    top: 80px;   /* stessa altezza */
    left: 230px;
}

/* PANNA */
.panna {
    position: absolute;
    width: 240px;
    top: 10px;
    left: 110px;
    z-index: 2;
}

/* ELEMENTI A DESTRA */
.granella {
    position: absolute;
    width: 80px;
    top: 200px;      /* più vicino alla coppa */
    left: 420px;
}

.topping {
    position: absolute;
    width: 55px;     /* bottiglia più piccola */
    top: 200px;
    left: 520px;
}

.frutta {
    position: absolute;
    width: 85px;
    top: 205px;
    left: 600px;
}

.item-disabled,
.gusto-disabled {
    opacity: 0.35;
    filter: grayscale(100%);
    pointer-events: none;
}
/* 🚫 GUSTO BLOCCATO PER ALLERGIA */
.gusto-allergene {
  opacity: 0.35;
  border: 2px solid #007aff !important;
  background: #eef5ff;
  pointer-events: none;
}

/* ============================
   🛒 OVERLAY CARRELLO (VERSIONE FINALE)
   ============================ */
#carrello-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    backdrop-filter: blur(4px);
    justify-content: center;
    align-items: center;
    z-index: 99999;
}

#carrello-box {
    width: 92%;
    max-width: 420px;
    background: #fff;
    border-radius: 16px;
    padding: 18px;
    box-shadow: 0 8px 22px rgba(0,0,0,0.25);
}

/* HEADER */
#carrello-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

#carrello-header h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 700;
}

#chiudi-carrello {
    font-size: 22px;
    cursor: pointer;
    color: #ff3b30;
}

/* ============================
   🧊 CARD COPPA
   ============================ */
.carrello-card {
    background: #fafafa;
    border-radius: 12px;
    padding: 12px;
    border: 1px solid #e0e0e0;
    margin-bottom: 12px;
    position: relative;
}

/* titolo formato */
.carrello-formato {
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 4px;
}

/* dettagli (gusti, topping ecc.) */
.carrello-dettagli div {
    font-size: 13px;
    margin-bottom: 2px;
    line-height: 1.25;
}

/* Prezzo */
.carrello-prezzo {
    margin-top: 6px;
    font-size: 15px;
    font-weight: 700;
    color: #007aff;
}

/* ============================
   ➕➖ CONTROLLI QUANTITÀ
   ============================ */
.carrello-qty-controls {
    position: absolute;
    right: 10px;
    bottom: 10px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.qty-btn {
    width: 26px;
    height: 26px;
    background: #007aff;
    border-radius: 50%;
    color: white;
    font-size: 18px;
    border: none;
    display: flex;
    justify-content: center;
    align-items: center;
}

.qty-number {
    font-size: 14px;
    min-width: 16px;
    text-align: center;
}

/* ============================
   🔴 SVUOTA CARRELLO
   ============================ */
#carrello-svuota {
    width: 100%;
    padding: 12px;
    margin-top: 12px;
    border: none;
    border-radius: 12px;
    background: #ff3b30;
    color: white;
    font-weight: 700;
    font-size: 16px;
    cursor: pointer;
}

#carrello-svuota:active {
    opacity: 0.8;
}

/* ============================
   💶 TOTALE CARRELLO
   ============================ */
#carrello-totale {
    text-align: right;
    font-size: 15px;
    font-weight: 700;
    margin-top: 10px;
}

#carrello-badge {
    position: absolute;
    top: -6px;
    right: -6px;

    background: #ff3b30;
    color: white;
    font-size: 12px;
    font-weight: 700;

    border-radius: 50%;
    width: 20px;
    height: 20px;

    display: none;
    align-items: center;
    justify-content: center;

    box-shadow: 0 0 6px rgba(0,0,0,0.25);
}

#btn-cronologia {
    background: #007aff;
    color: white;
    font-weight: 600;
    border-radius: 12px;
    padding: 12px;
    font-size: 15px;
    cursor: pointer;
    flex: 1;
}

#carrello-footer {
    display: flex;
    gap: 10px;
    margin-top: 12px;
}

/* ⭐ Bottom Navigation Bar */
#bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 70px;
    background: #ffffff;
    display: flex;
    justify-content: space-around;
    align-items: center;
    border-top: 1px solid #dadada;
    box-shadow: 0 -3px 12px rgba(0,0,0,0.08);
    z-index: 99999;
}

/* Singola voce */
.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: #333;
    font-size: 12px;
    font-weight: 500;
}

/* Icone */
.nav-item img {
    width: 26px;
    height: 26px;
    margin-bottom: 3px;
}

/* Badge rosso del carrello */
.nav-badge {
    position: absolute;
    top: -6px;
    right: -10px;
    background: #ff3b30;
    color: white;
    font-size: 11px;
    font-weight: bold;
    padding: 2px 6px;
    border-radius: 50px;
}
#carrello-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    backdrop-filter: blur(3px);
    justify-content: center;
    align-items: center;
    z-index: 200000 !important; /* 🔥 METTILO COSÌ */
}
#carrello-box {
    max-height: 85vh;    /* 🔥 impedisce di uscire fuori dallo schermo */
    overflow-y: auto;    /* 🔥 scroll verticale quando è pieno */
}
body {
    padding-bottom: 90px !important;
}

.carrello-card {
    position: relative;
}

.qr-top-right {
    position: absolute;
    top: 8px;
    right: 10px;
}

.qr-btn-small {
    padding: 6px 10px;
    font-size: 12px;
    border-radius: 8px;
    background: #0066ff;
    color: white;
    border: none;
    cursor: pointer;
}


#step-container {
  pointer-events: auto;
}

header,
.nav-buttons,
.ingredienti-lista {
  pointer-events: auto;
}

.formato-titolo {
  font-weight: 700;
  font-size: 18px;
  margin-bottom: 4px;
}

.formato-dettagli {
  font-size: 15px;
  color: #6e6e73;
  white-space: nowrap;   /* 🔥 MAI a capo */
}

