/* ============================================================
   LA MIMOSA – Shop online (shop.html, shop-ordine.html)
   Tutte le classi hanno il prefisso es- ("e-shop"): .shop, .shop-grid e .shop-tab esistono gia'
   in style.css e sono il MENU del bar, non questo.
   ============================================================ */

/* Con un popup aperto la pagina sotto non scorre (su iPhone scorreva il catalogo dietro la scheda).
   scrollbar-gutter tiene fermo il layout quando la barra di scorrimento sparisce. */
html:has(.es-body) { scrollbar-gutter: stable; }
html:has(dialog.es-dialog[open]) { overflow: hidden; }

.es-page { padding-top: calc(var(--nav-height) + 2.5rem); padding-bottom: 6rem; min-height: 80vh; }
.es-header { margin-bottom: 1.5rem; }
.es-errore-centrato { text-align: center; }

/* --- Avviso della festa ("per Natale ordina entro...") --- */
.es-festa {
  display: flex; align-items: center; justify-content: center; gap: 0.5rem; flex-wrap: wrap;
  max-width: 720px; margin: 0 auto 1.25rem; padding: 0.7rem 1.1rem; border-radius: 50px;
  background: var(--pink-pale); color: var(--pink-dark); font-weight: 700; font-size: 0.95rem; text-align: center;
  border: 1.5px solid var(--rose);
}

/* --- Vantaggi (spedizione, ritiro, pagamenti) --- */
.es-vantaggi {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 0.5rem 1.5rem;
  margin: 0 auto 2.25rem; padding: 0; font-size: 0.9rem; color: var(--text-muted);
}
.es-vantaggi li { display: inline-flex; align-items: center; gap: 0.4rem; }
.es-vantaggi b { color: var(--pink-dark); }

/* --- Shop chiuso --- */
.es-chiuso {
  max-width: 560px; margin: 0 auto; text-align: center; padding: 2.25rem 1.5rem;
  background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow-sm);
}
.es-chiuso-icona { font-size: 2.5rem; display: block; margin-bottom: 0.5rem; }
.es-chiuso p { color: var(--text-muted); margin-bottom: 1.25rem; }
.es-chiuso-azioni { display: flex; flex-wrap: wrap; gap: 0.75rem; justify-content: center; }

/* --- Griglia prodotti --- */
.es-griglia {
  display: grid; gap: 1.5rem;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
}
/* Pochi prodotti (1-3): colonne di larghezza fissa e centrate, invece di schede ammassate a
   sinistra con mezza pagina vuota a destra. */
.es-griglia--poche { grid-template-columns: repeat(auto-fit, minmax(240px, 290px)); justify-content: center; }
.es-card {
  background: var(--white); border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow-sm); transition: transform var(--transition), box-shadow var(--transition);
}
.es-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
@media (prefers-reduced-motion: reduce) { .es-card:hover { transform: none; } }
.es-card--scheletro {
  min-height: 340px;
  background: linear-gradient(100deg, var(--cream-dark) 40%, var(--white) 50%, var(--cream-dark) 60%) 0 0 / 200% 100%;
  animation: es-luccica 1.4s linear infinite;
}
@keyframes es-luccica { to { background-position: -200% 0; } }
.es-card--esaurito .es-card-foto img, .es-card--esaurito .es-foto-vuota { opacity: 0.55; }
.es-card-btn {
  all: unset; box-sizing: border-box; display: flex; flex-direction: column; width: 100%; height: 100%; cursor: pointer;
}
.es-card-btn:focus-visible { outline: 3px solid var(--pink); outline-offset: -3px; border-radius: var(--radius); }
.es-card-foto {
  position: relative; display: flex; align-items: center; justify-content: center;
  aspect-ratio: 4 / 3; background: linear-gradient(135deg, var(--pink-pale), var(--cream-dark)); overflow: hidden;
}
.es-card-foto img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s ease; }
.es-card:hover .es-card-foto img { transform: scale(1.04); }
@media (prefers-reduced-motion: reduce) { .es-card:hover .es-card-foto img { transform: none; } }
.es-foto-vuota { font-size: 3.5rem; opacity: 0.75; }
.es-badge {
  position: absolute; top: 0.75rem; left: 0.75rem; padding: 0.25rem 0.7rem; border-radius: 50px;
  background: var(--gold-text); color: var(--white); font-size: 0.75rem; font-weight: 700; letter-spacing: 0.02em;
}
.es-badge--esaurito { background: var(--text-muted); }
.es-card-corpo { display: flex; flex-direction: column; gap: 0.2rem; padding: 1rem 1.15rem 1.25rem; flex: 1; }
.es-card-nome { font-family: var(--font-heading); font-size: 1.2rem; font-weight: 700; line-height: 1.25; }
.es-card-sotto { font-size: 0.88rem; color: var(--text-muted); line-height: 1.4; }
.es-card-prezzo { margin-top: auto; padding-top: 0.6rem; font-weight: 700; color: var(--pink); font-size: 1.05rem; }
.es-vuoto { grid-column: 1 / -1; text-align: center; color: var(--text-muted); padding: 2rem 0; list-style: none; }

/* --- Dialoghi ---
   Il reset di style.css (* { margin: 0 }) toglie ai <dialog> il margin:auto con cui il browser li
   centra: senza le due righe qui sotto la scheda prodotto finiva incollata in alto a sinistra. */
.es-dialog {
  margin: auto; inset: 0;
  border: none; padding: 0; border-radius: var(--radius); background: var(--white); color: var(--text);
  width: min(980px, calc(100vw - 3rem)); max-height: min(780px, calc(100dvh - 3rem)); box-shadow: var(--shadow-lg);
  overflow: hidden; overscroll-behavior: contain;
}
.es-dialog::backdrop { background: rgba(45, 20, 34, 0.55); backdrop-filter: blur(3px); }
.es-dialog[open] { animation: es-entra 0.22s ease-out; }
@keyframes es-entra { from { opacity: 0; transform: translateY(14px) scale(0.99); } }
@media (prefers-reduced-motion: reduce) { .es-dialog[open], .es-dialog--cassetto[open], .es-card--scheletro { animation: none; } }
.es-dialog-chiudi {
  position: absolute; top: 0.85rem; right: 0.85rem; z-index: 3; width: 40px; height: 40px; border-radius: 50%;
  border: none; background: rgba(255, 255, 255, 0.94); color: var(--text); cursor: pointer;
  display: flex; align-items: center; justify-content: center; box-shadow: var(--shadow-sm); transition: var(--transition);
}
.es-dialog-chiudi:hover { background: var(--pink-pale); color: var(--pink-dark); }
.es-dialog-chiudi:focus-visible { outline: 3px solid var(--pink); outline-offset: 2px; }
.es-dialog-chiudi svg { width: 20px; height: 20px; }
.es-dialog-chiudi--statico { position: static; box-shadow: none; background: var(--cream-dark); flex-shrink: 0; }

/* --- Scheda prodotto (desktop: foto a sinistra ferma, testo a destra che scorre) --- */
.es-prodotto { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); max-height: inherit; }
.es-prodotto-media {
  display: flex; flex-direction: column; min-height: 0;
  background: linear-gradient(135deg, var(--pink-pale), var(--cream-dark));
}
.es-prodotto-foto { position: relative; flex: 1; min-height: 420px; display: flex; align-items: center; justify-content: center; }
.es-prodotto-foto img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.es-prodotto-foto .es-foto-vuota { font-size: 5.5rem; }
.es-prodotto-miniature { display: flex; gap: 0.5rem; padding: 0.75rem; overflow-x: auto; background: rgba(255, 255, 255, 0.6); }
.es-prodotto-miniature:empty { display: none; }
.es-prodotto-miniature button {
  flex: 0 0 64px; height: 64px; padding: 0; border: 2px solid transparent; border-radius: var(--radius-sm);
  overflow: hidden; cursor: pointer; background: var(--white);
}
.es-prodotto-miniature button.attiva { border-color: var(--pink); }
.es-prodotto-miniature img { width: 100%; height: 100%; object-fit: cover; }
.es-prodotto-info {
  padding: 2.25rem 2rem 2rem; display: flex; flex-direction: column; gap: 0.9rem;
  overflow-y: auto; max-height: min(780px, calc(100dvh - 3rem)); overscroll-behavior: contain;
}
.es-prodotto-nome { font-family: var(--font-heading); font-size: 1.85rem; line-height: 1.2; padding-right: 2.75rem; }
.es-prodotto-sottotitolo { color: var(--text-muted); margin-top: -0.55rem; }
.es-prodotto-prezzo { font-size: 1.5rem; font-weight: 700; color: var(--pink); }
.es-varianti { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.es-variante { position: relative; }
.es-variante input { position: absolute; opacity: 0; pointer-events: none; }
.es-variante span {
  display: flex; flex-direction: column; align-items: center; padding: 0.55rem 1rem; min-width: 88px;
  border: 1.5px solid var(--rose); border-radius: var(--radius-sm); cursor: pointer; font-weight: 700; font-size: 0.92rem;
  transition: var(--transition); background: var(--white);
}
.es-variante span:hover { border-color: var(--pink); }
.es-variante small { font-weight: 400; color: var(--text-muted); font-size: 0.8rem; }
.es-variante input:checked + span { border-color: var(--pink); background: var(--pink-pale); box-shadow: 0 0 0 1px var(--pink); }
.es-variante input:focus-visible + span { outline: 3px solid var(--pink); outline-offset: 2px; }
.es-variante--esaurita span { color: var(--text-muted); border-style: dashed; }
.es-rimasti { color: var(--gold-text); font-weight: 700; font-size: 0.9rem; margin-top: -0.3rem; }
.es-solo { font-size: 0.88rem; color: var(--pink-dark); background: var(--pink-pale); padding: 0.55rem 0.8rem; border-radius: var(--radius-sm); }
.es-consegna { display: flex; flex-direction: column; gap: 0.2rem; font-size: 0.9rem; color: var(--text-muted); }
.es-consegna[hidden] { display: none; }
.es-acquista { display: flex; gap: 0.75rem; align-items: stretch; flex-wrap: wrap; }
.es-acquista[hidden] { display: none; }
.es-acquista .btn { flex: 1; justify-content: center; min-width: 190px; }
.es-acquista .btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; box-shadow: none; }
.es-qta {
  display: inline-flex; align-items: center; border: 1.5px solid var(--rose); border-radius: 50px; overflow: hidden; background: var(--white);
}
.es-qta button {
  width: 42px; height: 46px; border: none; background: transparent; font-size: 1.25rem; cursor: pointer; color: var(--pink);
  font-family: var(--font-body);
}
.es-qta button:hover:not(:disabled) { background: var(--pink-pale); }
.es-qta button:disabled { color: var(--rose); cursor: not-allowed; }
.es-qta output { min-width: 2ch; text-align: center; font-weight: 700; }
.es-qta--piccola button { width: 32px; height: 32px; font-size: 1.05rem; }
.es-prodotto-descrizione p { margin-bottom: 0.6rem; color: var(--text); }
.es-prodotto-descrizione:empty { display: none; }
.es-dettagli details { border-top: 1px solid var(--pink-pale); padding: 0.7rem 0; }
.es-dettagli summary { cursor: pointer; font-weight: 700; color: var(--pink-dark); }
.es-dettagli summary::marker { color: var(--pink); }
.es-dettagli details p { margin-top: 0.5rem; font-size: 0.92rem; color: var(--text-muted); line-height: 1.55; }
.es-dettagli details p b { color: var(--text); }
.es-nota-lingua { font-size: 0.8rem; color: var(--text-muted); font-style: italic; border-top: 1px solid var(--pink-pale); padding-top: 0.6rem; }

/* Avvisami quando torna disponibile */
.es-avvisami { display: flex; flex-direction: column; gap: 0.45rem; padding: 1rem; border-radius: var(--radius-sm); background: var(--cream); border: 1.5px dashed var(--rose); }
.es-avvisami[hidden] { display: none; }
.es-avvisami-titolo { font-weight: 700; color: var(--pink-dark); }
.es-avvisami-riga { display: flex; gap: 0.5rem; }
.es-avvisami-riga input {
  flex: 1; min-width: 0; padding: 0.6rem 0.85rem; border: 1.5px solid var(--rose); border-radius: var(--radius-sm);
  font-family: var(--font-body); font-size: 0.95rem; background: var(--white); color: var(--text);
}
.es-avvisami-riga input:focus { outline: none; border-color: var(--pink); box-shadow: 0 0 0 3px rgba(194, 24, 91, 0.12); }
.es-avvisami-esito { font-size: 0.88rem; font-weight: 700; color: #B71C1C; }
.es-avvisami-esito--ok { color: #2E7D32; }

/* --- Carrello (cassetto laterale) --- */
.es-dialog--cassetto {
  margin: 0 0 0 auto; inset: 0 0 0 auto; height: 100dvh; max-height: 100dvh; width: min(420px, 100vw); border-radius: 0;
}
.es-dialog--cassetto[open] { animation: es-scorre 0.24s ease-out; }
@keyframes es-scorre { from { transform: translateX(40px); opacity: 0; } }
.es-cassetto { display: flex; flex-direction: column; height: 100%; }
.es-cassetto-testa { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1.25rem 1.25rem 0.85rem; border-bottom: 1px solid var(--pink-pale); }
.es-cassetto-testa h2 { font-family: var(--font-heading); font-size: 1.35rem; }
.es-carrello-righe { flex: 1; overflow-y: auto; padding: 0 1.25rem; margin: 0; list-style: none; overscroll-behavior: contain; }
.es-riga { display: grid; grid-template-columns: 56px minmax(0, 1fr) auto; gap: 0.75rem; align-items: center; padding: 0.9rem 0; border-bottom: 1px solid var(--pink-pale); }
.es-riga-foto {
  width: 56px; height: 56px; border-radius: var(--radius-sm); overflow: hidden; display: flex; align-items: center; justify-content: center;
  background: var(--pink-pale); font-size: 1.5rem;
}
.es-riga-foto img { width: 100%; height: 100%; object-fit: cover; }
.es-riga-testo { display: flex; flex-direction: column; line-height: 1.3; font-size: 0.95rem; min-width: 0; }
.es-riga-testo b { overflow-wrap: anywhere; }
.es-riga-testo small { color: var(--text-muted); font-size: 0.82rem; }
.es-riga-azioni { display: flex; align-items: center; gap: 0.25rem; }
.es-riga-togli {
  width: 32px; height: 32px; border: none; border-radius: 50%; background: none; color: var(--text-muted); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.es-riga-togli:hover { background: var(--pink-pale); color: var(--pink-dark); }
.es-riga-togli svg { width: 17px; height: 17px; }
.es-carrello-vuoto { display: flex; flex-direction: column; align-items: center; gap: 0.75rem; text-align: center; color: var(--text-muted); padding: 3rem 1rem; }
.es-carrello-vuoto > span { font-size: 2.5rem; opacity: 0.6; }
.es-cassetto-piede {
  padding: 1rem 1.25rem max(1.25rem, env(safe-area-inset-bottom)); border-top: 1px solid var(--pink-pale);
  display: flex; flex-direction: column; gap: 0.6rem; background: var(--cream);
}
.es-cassetto-piede[hidden] { display: none; }
.es-carrello-sub { display: flex; justify-content: space-between; font-size: 1.05rem; }
.es-gratis-hint { font-size: 0.88rem; color: var(--gold-text); font-weight: 700; }
.es-cassetto-piede .btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* --- Cassa --- */
.es-indietro {
  display: inline-flex; align-items: center; gap: 0.4rem; border: none; background: none; cursor: pointer;
  color: var(--pink); font-weight: 700; font-size: 0.92rem; padding: 0.25rem 0; margin-bottom: 1rem; font-family: var(--font-body);
}
.es-indietro:hover { color: var(--pink-dark); }
.es-indietro svg { width: 18px; height: 18px; }
.es-titolo-cassa { font-size: clamp(1.6rem, 3.5vw, 2.2rem); margin-bottom: 1.5rem; }
.es-cassa { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 2rem; align-items: start; }
.es-form { background: var(--white); border-radius: var(--radius); padding: 1.75rem; box-shadow: var(--shadow-sm); gap: 1.75rem; }
.es-campi { display: flex; flex-direction: column; gap: 1rem; }
.es-campi[hidden] { display: none; }
.es-row-3 { grid-template-columns: 110px minmax(0, 1fr) 80px; }
.es-form textarea { min-height: 70px; }
.es-obbl { color: var(--pink); }
.es-scelte { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }
.es-scelta {
  position: relative; display: flex; align-items: center; gap: 0.75rem; padding: 0.9rem 1rem;
  border: 1.5px solid var(--rose); border-radius: var(--radius-sm); cursor: pointer; transition: var(--transition);
}
.es-scelta[hidden] { display: none; }
.es-scelta input { position: absolute; opacity: 0; pointer-events: none; }
.es-scelta:has(input:checked) { border-color: var(--pink); background: var(--pink-pale); box-shadow: 0 0 0 1px var(--pink); }
.es-scelta:has(input:disabled) { opacity: 0.45; cursor: not-allowed; }
.es-scelta:has(input:focus-visible) { outline: 3px solid var(--pink); outline-offset: 2px; }
.es-scelta-icona { font-size: 1.6rem; }
.es-scelta-testo { display: flex; flex-direction: column; line-height: 1.3; }
.es-scelta-testo small { color: var(--text-muted); font-size: 0.8rem; }
.es-perche { font-size: 0.85rem; color: var(--text-muted); margin-top: 0.6rem; }

/* Campo sbagliato: bordo rosso e il motivo sotto, nella lingua del cliente */
.es-campo-errore input, .es-campo-errore select, .es-campo-errore textarea { border-color: #C62828 !important; }
.es-campo-msg { color: #B71C1C; font-size: 0.8rem; font-weight: 700; }

/* Totale in cima alla cassa, solo sul telefono (li' il riepilogo sta in fondo al modulo) */
.es-totale-mobile { display: none; }

.es-riepilogo {
  position: sticky; top: calc(var(--nav-height) + 1rem); scroll-margin-top: calc(var(--nav-height) + 1rem);
  background: var(--white); border-radius: var(--radius); padding: 1.5rem; box-shadow: var(--shadow-sm);
  display: flex; flex-direction: column; gap: 0.9rem;
}
.es-riepilogo-titolo { font-family: var(--font-heading); font-size: 1.25rem; }
.es-riepilogo-righe { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.45rem; }
.es-riepilogo-righe:empty { display: none; }
.es-riepilogo-righe li { display: flex; justify-content: space-between; gap: 1rem; font-size: 0.92rem; }
.es-riepilogo-righe li > span:last-child { white-space: nowrap; }
.es-riepilogo-righe small { color: var(--text-muted); }
.es-codice { display: flex; gap: 0.5rem; }
.es-codice input {
  flex: 1; min-width: 0; padding: 0.6rem 0.85rem; border: 1.5px solid var(--rose); border-radius: var(--radius-sm);
  font-family: var(--font-body); font-size: 0.92rem; text-transform: uppercase; background: var(--cream); color: var(--text);
}
/* Il codice si scrive in maiuscolo, il testo d'esempio no. */
.es-codice input::placeholder { text-transform: none; color: var(--text-muted); }
.es-codice input:focus { outline: none; border-color: var(--pink); box-shadow: 0 0 0 3px rgba(194, 24, 91, 0.12); }
.es-btn-sm { padding: 0.55rem 1rem; font-size: 0.85rem; }
.es-totali { display: grid; grid-template-columns: 1fr auto; gap: 0.35rem 1rem; margin: 0; padding-top: 0.75rem; border-top: 1px solid var(--pink-pale); font-size: 0.92rem; }
.es-totali:empty { display: none; }
.es-totali dt { color: var(--text-muted); }
.es-totali dd { margin: 0; text-align: right; }
.es-totali .es-totale { font-size: 1.15rem; font-weight: 700; color: var(--text); padding-top: 0.4rem; }
.es-accetto { font-size: 0.82rem; line-height: 1.45; align-items: flex-start; }
.es-accetto a { color: var(--pink); text-decoration: underline; }
.es-riepilogo .btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; box-shadow: none; }
.es-metodi { text-align: center; font-size: 0.8rem; color: var(--text-muted); }
.es-metodi::first-letter { text-transform: uppercase; }

/* --- Pagamento --- */
.es-pagamento { max-width: 560px; margin: 0 auto; display: flex; flex-direction: column; gap: 1rem; }
.es-pagamento .es-titolo-cassa { margin-bottom: 0; }
.es-pag-riepilogo {
  background: var(--white); border-radius: var(--radius); padding: 1.1rem 1.25rem; box-shadow: var(--shadow-sm);
  display: flex; flex-direction: column; gap: 0.6rem;
}
.es-pagamento-sotto { color: var(--text-muted); font-size: 0.92rem; }
.es-pagamento-sotto b { color: var(--text); letter-spacing: 0.03em; }
.es-pag-totale { display: flex; justify-content: space-between; border-top: 1px solid var(--pink-pale); padding-top: 0.6rem; font-weight: 700; font-size: 1.1rem; }
.es-timer { font-size: 0.9rem; color: var(--gold-text); font-weight: 700; }
.es-timer:empty { display: none; }
.es-widget { background: var(--white); border-radius: var(--radius); padding: 1rem; box-shadow: var(--shadow-sm); min-height: 120px; }
.es-widget[hidden] { display: none; }
.es-finto { background: #FFF8E1; border: 1.5px dashed var(--gold); border-radius: var(--radius); padding: 1.25rem; }
.es-finto[hidden] { display: none; }
.es-finto-azioni { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 0.75rem; }
.es-sicuro { font-size: 0.85rem; color: var(--text-muted); }

/* --- Pagina dell'ordine --- */
.es-ordine, #es-o-contenuto { max-width: 640px; display: flex; flex-direction: column; gap: 1.25rem; }
#es-o-contenuto[hidden] { display: none; }
.es-o-stato {
  text-align: center; background: var(--white); border-radius: var(--radius); padding: 2rem 1.5rem; box-shadow: var(--shadow-sm);
  display: flex; flex-direction: column; align-items: center; gap: 0.6rem;
}
.es-o-stato[hidden] { display: none; }
.es-o-stato h1 { font-family: var(--font-heading); font-size: clamp(1.4rem, 3.5vw, 1.9rem); line-height: 1.25; }
.es-o-stato p { color: var(--text-muted); }
.es-o-stato--ok { border-top: 5px solid #2e7d32; }
.es-o-stato--errore { border-top: 5px solid var(--gold); }
.es-o-stato--attesa { border-top: 5px solid var(--pink); }
.es-o-icona { font-size: 2.6rem; }
.es-spinner {
  width: 42px; height: 42px; border-radius: 50%; border: 4px solid var(--pink-pale); border-top-color: var(--pink);
  animation: es-gira 0.9s linear infinite;
}
@keyframes es-gira { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .es-spinner { animation-duration: 3s; } }
.es-o-box { background: var(--white); border-radius: var(--radius); padding: 1.5rem; box-shadow: var(--shadow-sm); display: flex; flex-direction: column; gap: 0.75rem; }
.es-o-box[hidden] { display: none; }
.es-o-box h2 { font-family: var(--font-heading); font-size: 1.2rem; }
.es-o-box h2 small { font-family: var(--font-body); font-size: 0.85rem; color: var(--text-muted); font-weight: 400; }
.es-o-nota { font-size: 0.9rem; color: var(--text-muted); }
.es-o-aiuto { text-align: center; font-size: 0.9rem; color: var(--text-muted); }
.es-o-aiuto a { color: var(--pink); font-weight: 700; }
.es-o-azioni { display: flex; justify-content: center; }

/* --- Pagina condizioni di vendita --- */
.es-legale { max-width: 780px; }
.es-legale h1 { font-family: var(--font-heading); font-size: clamp(1.8rem, 4vw, 2.4rem); margin-bottom: 0.5rem; }
.es-legale h2 { font-family: var(--font-heading); font-size: 1.25rem; color: var(--pink-dark); margin: 1.75rem 0 0.5rem; }
.es-legale p, .es-legale li { color: var(--text); margin-bottom: 0.6rem; }
.es-legale ul { list-style: disc; padding-left: 1.4rem; }
.es-legale a { color: var(--pink); text-decoration: underline; }
.es-legale .es-aggiornato { color: var(--text-muted); font-size: 0.9rem; }

/* --- Tablet --- */
@media (max-width: 900px) {
  .es-cassa { grid-template-columns: 1fr; }
  .es-riepilogo { position: static; }
  .es-totale-mobile {
    display: flex; align-items: center; justify-content: center; gap: 0.4rem; margin: -0.5rem 0 1.25rem;
    padding: 0.75rem 1rem; border-radius: var(--radius-sm); background: var(--white); box-shadow: var(--shadow-sm);
    font-weight: 700; color: var(--pink-dark); font-size: 0.95rem;
  }
  .es-totale-mobile[hidden] { display: none; }
  .es-totale-mobile::after { content: "↓"; }
  .es-prodotto-foto { min-height: 360px; }
}

/* --- Telefono --- */
@media (max-width: 680px) {
  .es-page { padding-top: calc(var(--nav-height) + 1.5rem); }
  .es-festa { border-radius: var(--radius-sm); font-size: 0.88rem; }
  .es-vantaggi { flex-direction: column; align-items: center; gap: 0.35rem; }
  .es-griglia, .es-griglia--poche { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.85rem; justify-content: stretch; }
  .es-card-corpo { padding: 0.75rem 0.85rem 0.95rem; }
  .es-card-nome { font-size: 1rem; }
  .es-card-sotto { display: none; }
  .es-card-prezzo { font-size: 0.95rem; }
  .es-badge { top: 0.5rem; left: 0.5rem; font-size: 0.7rem; }

  /* La scheda prodotto diventa un foglio che sale dal basso, e scorre tutta insieme. */
  .es-dialog:not(.es-dialog--cassetto) {
    width: 100%; max-width: 100%; max-height: 92dvh; margin: auto 0 0; inset: auto 0 0 0;
    border-radius: var(--radius) var(--radius) 0 0; overflow-y: auto;
  }
  .es-prodotto { grid-template-columns: 1fr; max-height: none; }
  .es-prodotto-foto { flex: none; min-height: 0; aspect-ratio: 4 / 3; }
  .es-prodotto-info { padding: 1.25rem 1.1rem max(1.5rem, env(safe-area-inset-bottom)); max-height: none; overflow: visible; }
  .es-prodotto-nome { font-size: 1.45rem; }
  .es-acquista .btn { min-width: 0; }

  .es-form { padding: 1.25rem 1rem; }
  .es-scelte { grid-template-columns: 1fr; }
  .es-row-3 { grid-template-columns: 96px minmax(0, 1fr); }
  .es-row-3 .form-group:last-child { grid-column: 1 / -1; }
  .es-riepilogo { padding: 1.25rem 1rem; }
}
