/* =====================================================================
   SALENTOTTO — stile del menu digitale (sito pubblico)
   Mobile-first, tema scuro, nessuna libreria esterna, font di sistema.
   Indice:
     1. Variabili e base          6. Prodotti
     2. Layout e utilità          7. Carrello (barra, pagina)
     3. Intestazione              8. Modali (prodotto, foto, info)
     4. Pulsanti e form           9. Checkout e pagine ordine
     5. Categorie (accordion)    10. Footer, avvisi, toast, stampa
   ===================================================================== */

/* 1. Variabili e base ------------------------------------------------ */
:root {
  --bg: #0f0e0d;
  --bg-2: #161412;
  --surface: #1d1a17;
  --surface-2: #25221e;
  --surface-3: #302c27;
  --line: rgba(255, 240, 220, .08);
  --line-2: rgba(255, 240, 220, .15);
  --text: #f7f2ea;
  --muted: #bdb3a5;
  --muted-2: #938a7d;
  --accent: #e6a94f;
  --accent-2: #f3c683;
  --accent-soft: rgba(var(--accent-rgb), .12);
  --accent-ink: #1f1405;
  --danger: #ff8575;
  --success: #6fd9a4;
  --radius: 18px;
  --radius-sm: 12px;
  --photo: 56px;
  --thumb: 38px;
  --gutter: 14px;
  --cartbar-h: 60px; /* altezza della barra «Visualizza carrello» (la usa anche l'invito dal basso) */
  --shadow: 0 12px 34px rgba(0, 0, 0, .38);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-display: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --ease: cubic-bezier(.2, .8, .2, 1);
  /* --- Variabili personalizzabili da Admin → Aspetto. I valori qui sotto sono il tema
         originale: il pannello genera solo le variabili cambiate (vedi includes/functions/appearance.php) --- */
  --bg-rgb: 15, 14, 13;
  --text-rgb: 247, 242, 234;
  --accent-rgb: 230, 169, 79;
  --success-rgb: 111, 217, 164;
  --danger-rgb: 255, 133, 117;
  --selected: var(--accent);
  --selected-rgb: var(--accent-rgb);
  --icon: var(--accent);
  --heading: var(--text);
  --subtitle: var(--text);
  --price: var(--text);
  --desc: var(--muted);
  --info-text: var(--muted);
  --link: var(--accent-2);
  --notify-text: var(--text);
  --error-text: #ffc2b9;
  --error-text-2: #ffd0c9;
  --fs-scale: 1;
  --title-scale: 1;
  --heading-weight: 600;
  --text-weight: 400;
  --lh: 1.45;
  --space: 1;
  --btn-bg: var(--accent);
  --btn-text: var(--accent-ink);
  --btn-border: transparent;
  --btn-hover: var(--accent-2);
  --btn2-bg: var(--surface);
  --btn2-text: var(--text);
  --btn2-border: var(--line-2);
  --add-bg: var(--accent-soft);
  --add-hover: rgba(var(--accent-rgb), .2);
  --add-text: var(--accent-2);
  --add-border: rgba(var(--accent-rgb), .45);
  --btn-radius: 14px;
  --btn-h: 50px;
  --btn-px: 22px;
  --bw: 1px;
  --card-shadow: none;
  --header-bg: rgba(var(--bg-rgb), .9);
  --tagline: var(--muted);
  --pill-bg: var(--surface);
  --pill-text: var(--text);
  --pill-border: var(--line);
  --cartlink-bg: var(--accent);
  --cartlink-hover: var(--btn-hover);
  --cartlink-text: var(--accent-ink);
  --footer-bg: transparent;
  --footer-title: var(--text);
  --footer-text: var(--muted-2);
  --footer-link: var(--muted);
  --cat-bg: var(--surface);
  --cat-border: var(--line);
  --cat-title: var(--text);
  --cat-meta: var(--muted-2);
  --chip-bg: var(--surface);
  --chip-text: var(--text);
  --chip-active-bg: var(--accent);
  --chip-active-text: var(--accent-ink);
  --prod-name: var(--text);
  --prod-divider: var(--line);
  --cartbar-bg: var(--accent);
  --cartbar-text: var(--accent-ink);
  --cartbar-count: var(--accent-2);
  --summary-bg: var(--surface);
  --summary-text: var(--text);
  --co-bg: var(--surface);
  --co-text: var(--text);
  --step-bg: var(--accent-soft);
  --step-text: var(--accent);
  --co-card-bg: var(--bg-2);
  --co-card-border: var(--line-2);
  --co-selected: var(--selected);
  --co-selected-rgb: var(--selected-rgb);
  --co-radio: var(--selected);
  --input-bg: var(--bg-2);
  --input-text: var(--text);
  --input-border: var(--line-2);
  --select-bg: var(--input-bg);
  --select-text: var(--input-text);
  --select-border: var(--input-border);
  --confirm-bg: var(--btn-bg);
  --confirm-hover: var(--btn-hover);
  --confirm-text: var(--btn-text);
  --confirm-border: transparent;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }

html {
  font-size: calc(100% * var(--fs-scale));
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  font-size: calc(16px * var(--fs-scale));
  font-weight: var(--text-weight);
  line-height: var(--lh);
  color: var(--text);
  background:
    radial-gradient(900px 420px at 50% -120px, rgba(var(--accent-rgb), .13), transparent 70%),
    var(--bg);
  background-attachment: scroll;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body.has-cartbar { padding-bottom: calc(96px + env(safe-area-inset-bottom)); }
html.is-locked, html.is-locked body { overflow: hidden; }

img, picture, svg { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
a { color: var(--link); text-decoration-thickness: 1px; text-underline-offset: 3px; }
h1, h2, h3, p { margin: 0; }
ul[role="list"] { list-style: none; margin: 0; padding: 0; }

:focus-visible {
  outline: 2px solid var(--accent-2);
  outline-offset: 2px;
  border-radius: 6px;
}

.icon {
  width: 1.25em;
  height: 1.25em;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0);
  white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute; left: 12px; top: -60px; z-index: 100;
  padding: 10px 14px; border-radius: 10px;
  background: var(--accent); color: var(--accent-ink); font-weight: 700;
}
.skip-link:focus { top: 12px; }

/* 2. Layout e utilità ------------------------------------------------- */
.container {
  width: 100%;
  max-width: 1040px;
  margin: 0 auto;
  padding: 0 calc(var(--gutter) + env(safe-area-inset-right, 0px)) 0 calc(var(--gutter) + env(safe-area-inset-left, 0px));
}

.stack > * + * { margin-top: 12px; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.nowrap { white-space: nowrap; }
.center { text-align: center; }
@media (max-width: 419px) { .hide-xs { display: none; } }
[hidden] { display: none !important; }

/* 3. Intestazione ----------------------------------------------------- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: calc(14px + env(safe-area-inset-top, 0px));
}

.topbar__back {
  display: inline-flex; align-items: center; gap: 8px;
  min-height: 44px; padding: 0 14px 0 10px;
  border-radius: 999px;
  background: var(--pill-bg);
  border: 1px solid var(--pill-border);
  color: var(--pill-text); text-decoration: none; font-weight: 600; font-size: .92rem;
}

.topbar__brand {
  font-family: var(--font-display);
  font-size: 1.25rem;
  color: var(--text);
  text-decoration: none;
  letter-spacing: .02em;
}

.hero {
  padding: 14px 0 22px;
  text-align: center;
}

.hero__logo {
  display: inline-block;
  margin: 0 auto 10px;
}
.hero__logo img { height: var(--logo-h, 92px); max-height: none; width: auto; max-width: 100%; object-fit: contain; margin: 0 auto; }

.hero__name {
  font-family: var(--font-display);
  font-weight: var(--heading-weight);
  font-size: calc(clamp(2.2rem, 9vw, 3.4rem) * var(--title-scale));
  color: var(--heading);
  line-height: 1.05;
  letter-spacing: .01em;
}

.hero__tagline {
  margin-top: 8px;
  color: var(--tagline);
  font-size: .74rem;
  letter-spacing: .2em;
  text-transform: uppercase;
}

.hero__meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: 18px;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 14px;
  border-radius: 999px;
  background: var(--pill-bg);
  border: 1px solid var(--pill-border);
  color: var(--pill-text);
  font-size: .86rem;
  font-weight: 550;
  text-decoration: none;
}
.pill .icon { color: var(--icon); }
button.pill:hover, a.pill:hover { border-color: var(--line-2); background: var(--surface-2); }

/* 4. Pulsanti e form -------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: var(--btn-h);
  padding: 0 var(--btn-px);
  border-radius: var(--btn-radius);
  border: 1px solid transparent;
  font-weight: 700;
  font-size: 1rem;
  text-decoration: none;
  transition: transform .15s var(--ease), background-color .2s, border-color .2s, opacity .2s;
}
.btn:active { transform: scale(.98); }
.btn[disabled], .btn.is-loading { opacity: .6; cursor: not-allowed; }
.btn--primary { background: var(--btn-bg); color: var(--btn-text); border-color: var(--btn-border); }
.btn--primary:hover { background: var(--btn-hover); }
.btn--ghost { background: var(--btn2-bg); border-color: var(--btn2-border); color: var(--btn2-text); }
.btn--ghost:hover { background: var(--surface-2); }
.btn--whatsapp { background: #1f9d55; color: #fff; }
.btn--whatsapp:hover { background: #23b060; }
.btn--danger { background: transparent; border-color: rgba(var(--danger-rgb), .5); color: var(--danger); }
.btn--block { width: 100%; }
.btn--sm { min-height: calc(var(--btn-h) * .8); padding: 0 14px; font-size: .9rem; border-radius: max(0px, calc(var(--btn-radius) - 2px)); }
.btn .icon { width: 1.2em; height: 1.2em; }

.btn.is-loading::after {
  content: "";
  width: 16px; height: 16px;
  border-radius: 50%;
  border: 2px solid currentColor;
  border-right-color: transparent;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.field { display: grid; gap: 6px; }
.field > label, .field__label {
  font-size: .84rem;
  font-weight: 650;
  color: var(--muted);
}
.field__hint { font-size: .8rem; color: var(--muted-2); }
.field__error { font-size: .82rem; color: var(--danger); font-weight: 600; }
.req { color: var(--accent); }

.input, .select, .textarea {
  width: 100%;
  min-height: 50px;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--input-bg);
  border: max(1px, var(--bw)) solid var(--input-border);
  color: var(--input-text);
  font-size: 16px; /* evita lo zoom automatico su iPhone */
  transition: border-color .2s, box-shadow .2s;
}
.textarea { min-height: 88px; resize: vertical; line-height: 1.4; }
.select {
  appearance: none;
  padding-right: 40px;
  background-color: var(--select-bg);
  border-color: var(--select-border);
  color: var(--select-text);
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 20px) 50%, calc(100% - 15px) 50%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}
.input::placeholder, .textarea::placeholder { color: var(--muted-2); }
.input:focus, .select:focus, .textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(var(--accent-rgb), .22);
}
.is-invalid .input, .is-invalid .select, .is-invalid .textarea, .input.is-invalid { border-color: var(--danger); }

.grid-2 { display: grid; gap: 12px; grid-template-columns: 1fr 1fr; }
.grid-3 { display: grid; gap: 12px; grid-template-columns: 1fr 1fr; }
.grid-3 > :first-child { grid-column: 1 / -1; }

/* Scelte a card (modalità ordine, pagamento) */
.choices { display: grid; gap: 10px; }
.choice { position: relative; display: block; }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice__box {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 64px;
  padding: 14px 16px;
  border-radius: max(0px, calc(var(--radius) - 4px));
  background: var(--co-card-bg);
  border: max(1px, calc(var(--bw) * 1.5)) solid var(--co-card-border);
  cursor: pointer;
  transition: border-color .2s, background-color .2s;
}
.choice__icon {
  display: grid; place-items: center;
  width: 42px; height: 42px; flex: none;
  border-radius: 12px;
  background: var(--surface-2);
  color: var(--icon);
}
.choice__icon .icon { width: 22px; height: 22px; }
.choice__text { display: grid; gap: 2px; min-width: 0; }
.choice__title { font-weight: 700; }
.choice__desc { font-size: .84rem; color: var(--muted); }
.choice__box::after {
  content: "";
  margin-left: auto;
  width: 22px; height: 22px; flex: none;
  border-radius: 50%;
  border: 2px solid var(--co-card-border);
  transition: all .2s;
}
.choice input:checked + .choice__box {
  border-color: var(--co-selected);
  background: rgba(var(--co-selected-rgb), .12);
}
.choice input:checked + .choice__box::after {
  border-color: var(--co-radio);
  background: radial-gradient(circle, var(--co-radio) 45%, transparent 50%);
}
.choice input:focus-visible + .choice__box { outline: 2px solid var(--accent-2); outline-offset: 2px; }
.choice input:disabled + .choice__box { opacity: .45; cursor: not-allowed; }

.check {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: .92rem;
  color: var(--muted);
  cursor: pointer;
}
.check input {
  width: 22px; height: 22px;
  margin: 1px 0 0;
  flex: none;
  accent-color: var(--co-radio);
}

/* Stepper quantità */
.stepper {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  background: var(--surface-3);
  border: 1px solid var(--line);
}
.stepper button {
  display: grid; place-items: center;
  width: 42px; height: 42px;
  border-radius: 50%;
  color: var(--text);
}
.stepper button:hover { color: var(--accent-2); }
.stepper button[disabled] { opacity: .35; cursor: not-allowed; }
.stepper output, .stepper .stepper__value {
  min-width: 26px;
  text-align: center;
  font-weight: 750;
  font-variant-numeric: tabular-nums;
}
.stepper--sm button { width: 36px; height: 36px; }

/* 5. Categorie (accordion) -------------------------------------------- */
.menu { padding-bottom: 12px; }

.menu__title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin: 6px 2px 14px;
}
.menu__title h1, .menu__title h2 {
  font-family: var(--font-display);
  font-weight: var(--heading-weight);
  font-size: calc(1.45rem * var(--title-scale));
  color: var(--heading);
  letter-spacing: .01em;
}

.cats { display: grid; gap: calc(12px * var(--space)); }
#favorites-slot { display: contents; }

.cat {
  background: var(--cat-bg);
  border: var(--bw) solid var(--cat-border);
  border-radius: var(--radius);
  box-shadow: var(--card-shadow);
  overflow: hidden;
  scroll-margin-top: 12px;
  transition: border-color .25s, background-color .25s;
}
.cat.is-open { border-color: var(--line-2); background: var(--cat-bg); }

.cat__heading { font-size: inherit; font-weight: inherit; }

.cat__head {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 78px;
  padding: 14px 14px 14px 18px;
  text-align: left;
  color: var(--cat-title);
  border-radius: var(--radius);
  transition: background-color .2s;
}
.cat__head:hover { background: rgba(var(--text-rgb), .025); }
.cat__head:focus-visible { outline-offset: -2px; }

.cat__title { flex: 1; min-width: 0; display: grid; gap: 2px; }
.cat__name {
  font-size: calc(1.14rem * var(--title-scale));
  font-weight: 700;
  letter-spacing: .005em;
  line-height: 1.2;
  overflow-wrap: break-word;
}
.cat__meta { font-size: .8rem; color: var(--cat-meta); }
.cat--special .cat__name { color: var(--accent-2); }

.cat__thumbs { display: flex; gap: 6px; flex: none; }
.cat__thumbs img, .cat__thumbs picture {
  width: var(--thumb);
  height: var(--thumb);
  border-radius: 10px;
  object-fit: cover;
  background: var(--surface-2);
}

.cat__chev {
  display: grid; place-items: center;
  width: 34px; height: 34px; flex: none;
  border-radius: 50%;
  background: var(--surface-2);
  color: var(--muted);
  transition: transform .32s var(--ease), background-color .2s, color .2s;
}
.cat.is-open .cat__chev { transform: rotate(180deg); background: var(--accent-soft); color: var(--accent); }

.cat__panel {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows .34s var(--ease);
}
.cat.is-open .cat__panel { grid-template-rows: 1fr; }
.cat__inner { overflow: hidden; min-height: 0; }
.cat__desc { padding: 0 18px 10px; color: var(--muted); font-size: .9rem; }

/* 6. Prodotti --------------------------------------------------------- */
.prods { border-top: 1px solid var(--prod-divider); }

.prod {
  padding: calc(14px * var(--space)) 16px calc(14px * var(--space)) 18px;
  border-bottom: 1px solid var(--prod-divider);
}
.prods > li:last-child .prod { border-bottom: 0; }
.prod.is-featured { background: linear-gradient(90deg, rgba(var(--accent-rgb), .07), transparent 60%); }

/* Riga principale: NOME | FOTO | PREZZO — la foto sta a destra, vicino al prezzo;
   colonna del prezzo di larghezza fissa così le foto restano allineate (si allarga solo per prezzi lunghi) */
.prod__row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--photo) minmax(4.2em, auto);
  align-items: center;
  column-gap: 12px;
}

.prod__name {
  font-size: 1rem;
  font-weight: 650;
  color: var(--prod-name);
  line-height: 1.25;
  /* parole intere a capo; si spezza solo una parola più lunga dell'intera colonna */
  overflow-wrap: break-word;
  word-break: normal;
  hyphens: manual;
}
@media (max-width: 359px) { .prod__name { font-size: .94rem; } }

.prod__photo {
  width: var(--photo);
  height: var(--photo);
  border-radius: 12px;
  overflow: hidden;
  background: var(--surface-2);
  border: 1px solid var(--line);
}
button.prod__photo { cursor: zoom-in; transition: transform .2s var(--ease), border-color .2s; }
button.prod__photo:hover { transform: scale(1.04); border-color: var(--line-2); }
.prod__photo picture, .prod__photo img { width: 100%; height: 100%; object-fit: cover; }
.prod__photo--empty {
  display: grid;
  place-items: center;
  color: rgba(var(--accent-rgb), .38);
  background: linear-gradient(145deg, var(--surface-2), var(--surface));
}
.prod__photo--empty .icon { width: 44%; height: 44%; stroke-width: 1.5; }

.prod__price {
  justify-self: end;
  text-align: right;
  font-weight: 800;
  font-size: 1rem;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  color: var(--price);
}
.prod__price small { font-weight: 600; color: var(--muted); font-size: .78em; }

.prod__desc {
  margin-top: 8px;
  font-size: .88rem;
  line-height: 1.5;
  color: var(--desc);
  overflow-wrap: break-word;
}
.prod__allergens { margin-top: 4px; font-size: .78rem; color: var(--muted-2); }

.prod__actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 10px;
  min-height: 40px;
}
.prod__tags { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; min-width: 0; }
.prod__cta { display: flex; align-items: center; gap: 4px; margin-left: auto; flex: none; }

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 9px;
  border-radius: 999px;
  font-size: .72rem;
  font-weight: 750;
  letter-spacing: .03em;
  text-transform: uppercase;
  background: var(--accent-soft);
  color: var(--accent-2);
}
.badge--orange { background: rgba(255, 150, 70, .14); color: #ffb47a; }
.badge--red { background: rgba(255, 110, 95, .14); color: #ff9d90; }
.badge--green { background: rgba(111, 217, 164, .13); color: #8ee5b8; }
.badge--blue { background: rgba(110, 170, 255, .14); color: #9cc4ff; }
.badge--purple { background: rgba(190, 140, 255, .14); color: #d2b3ff; }
.badge--gray { background: rgba(var(--text-rgb), .08); color: var(--muted); }

.fav {
  display: grid; place-items: center;
  width: 40px; height: 40px;
  border-radius: 50%;
  color: var(--muted-2);
  transition: color .2s, transform .2s var(--ease);
}
.fav:hover { color: var(--accent-2); }
.fav[aria-pressed="true"] { color: #ff7d87; }
.fav[aria-pressed="true"] .icon { fill: currentColor; }
.fav.pop { animation: pop .35s var(--ease); }
@keyframes pop { 50% { transform: scale(1.25); } }

.add {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 40px;
  padding: 0 16px 0 12px;
  border-radius: 999px;
  border: 1px solid var(--add-border);
  background: var(--add-bg);
  color: var(--add-text);
  font-weight: 700;
  font-size: .88rem;
  transition: background-color .2s, border-color .2s, transform .15s var(--ease);
}
.add:hover { background: var(--add-hover); border-color: var(--accent); }
.add:active { transform: scale(.96); }
.add__count {
  display: inline-grid; place-items: center;
  min-width: 20px; height: 20px; padding: 0 5px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-ink);
  font-size: .72rem;
}

.soldout {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(var(--danger-rgb), .12);
  color: var(--danger);
  font-size: .8rem;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.prod.is-soldout .prod__name, .prod.is-soldout .prod__price { color: var(--muted-2); }
.prod.is-soldout .prod__photo img { filter: grayscale(1) brightness(.7); }

.menu__note { margin: 16px 4px 0; font-size: .8rem; color: var(--muted-2); text-align: center; }

/* Legenda allergeni */
.legend {
  margin: 22px 0 8px;
  background: var(--cat-bg);
  border: var(--bw) solid var(--cat-border);
  border-radius: var(--radius);
}
.legend summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 58px;
  padding: 0 18px;
  cursor: pointer;
  font-weight: 650;
  list-style: none;
}
.legend summary::-webkit-details-marker { display: none; }
.legend summary .icon { transition: transform .3s var(--ease); color: var(--muted); }
.legend[open] summary .icon { transform: rotate(180deg); }
.legend__body { padding: 0 18px 18px; color: var(--muted); font-size: .88rem; }
.legend__list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 6px 16px;
  margin: 10px 0 12px;
  padding: 0;
  list-style: none;
}
.legend__list b { color: var(--accent-2); display: inline-block; min-width: 22px; }

/* 7. Carrello ---------------------------------------------------------- */
.cartbar {
  position: fixed;
  left: calc(12px + env(safe-area-inset-left, 0px));
  right: calc(12px + env(safe-area-inset-right, 0px));
  bottom: calc(12px + env(safe-area-inset-bottom));
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: 600px;
  min-height: var(--cartbar-h);
  margin: 0 auto;
  padding: 0 18px 0 14px;
  border-radius: 18px;
  background: var(--cartbar-bg);
  color: var(--cartbar-text);
  font-weight: 800;
  text-decoration: none;
  box-shadow: 0 14px 34px rgba(0, 0, 0, .5), 0 0 0 1px rgba(255, 255, 255, .06) inset;
  transform: translateY(160%);
  transition: transform .35s var(--ease);
}
.cartbar.is-visible { transform: none; }
.cartbar.bump { animation: bump .4s var(--ease); }
@keyframes bump { 40% { transform: scale(1.03); } }
.cartbar__icon { position: relative; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: rgba(31, 20, 5, .12); }
.cartbar__icon .icon { width: 22px; height: 22px; }
.cartbar__count {
  position: absolute; top: -6px; right: -6px;
  display: grid; place-items: center;
  min-width: 20px; height: 20px; padding: 0 5px;
  border-radius: 999px;
  background: var(--cartbar-text); color: var(--cartbar-count);
  font-size: .72rem;
}
.cartbar__label { flex: 1; font-size: 1rem; }
.cartbar__total { font-size: 1.05rem; font-variant-numeric: tabular-nums; }

.page-title {
  font-family: var(--font-display);
  font-weight: var(--heading-weight);
  font-size: calc(clamp(1.7rem, 6vw, 2.2rem) * var(--title-scale));
  color: var(--heading);
  margin: 18px 0 16px;
}

.panel {
  background: var(--surface);
  border: var(--bw) solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--card-shadow);
  padding: calc(18px * var(--space));
}
.panel + .panel { margin-top: 14px; }
.panel__title {
  display: flex; align-items: center; gap: 10px;
  font-size: 1.05rem;
  font-weight: 750;
  margin-bottom: 14px;
  color: var(--subtitle);
}
.panel__title .step {
  display: grid; place-items: center;
  width: 26px; height: 26px;
  border-radius: 50%;
  background: var(--step-bg); color: var(--step-text);
  font-size: .8rem;
}

.cart-lines { display: grid; }
.cart-line {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) auto;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}
.cart-line:first-child { padding-top: 0; }
.cart-line:last-child { border-bottom: 0; padding-bottom: 0; }
.cart-line__img {
  width: 52px; height: 52px;
  border-radius: 10px;
  overflow: hidden;
  background: var(--surface-2);
  display: grid; place-items: center;
  color: rgba(var(--accent-rgb), .4);
}
.cart-line__img img, .cart-line__img picture { width: 100%; height: 100%; object-fit: cover; }
.cart-line__name { font-weight: 700; line-height: 1.25; }
.cart-line__opts { margin-top: 3px; font-size: .82rem; color: var(--muted); }
.cart-line__opts li { list-style: none; }
.cart-line__opts ul { margin: 0; padding: 0; }
.cart-line__unit { margin-top: 3px; font-size: .8rem; color: var(--muted-2); }
.cart-line__tools { display: flex; align-items: center; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.cart-line__price { font-weight: 800; white-space: nowrap; font-variant-numeric: tabular-nums; text-align: right; }
.cart-line.is-unavailable { opacity: .7; }
.cart-line.is-unavailable .cart-line__price { text-decoration: line-through; color: var(--muted-2); }
.linkbtn {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 36px; padding: 0 10px;
  border-radius: 10px;
  color: var(--muted);
  font-size: .85rem; font-weight: 600;
}
.linkbtn:hover { color: var(--text); background: var(--surface-2); }
.linkbtn--danger:hover { color: var(--danger); }

.totals { display: grid; gap: 8px; font-variant-numeric: tabular-nums; }
.totals__row { display: flex; justify-content: space-between; gap: 12px; color: var(--muted); }
.totals__row b { color: var(--text); font-weight: 650; }
.totals__row--total {
  margin-top: 6px; padding-top: 12px;
  border-top: 1px solid var(--line-2);
  color: var(--text); font-size: 1.15rem; font-weight: 800;
}
.totals__row--total b { font-weight: 850; }
.totals__note { font-size: .8rem; color: var(--muted-2); }

.segmented {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 4px;
  border-radius: 14px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  margin-bottom: 16px;
}
.segmented button {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px;
  border-radius: 10px;
  color: var(--muted);
  font-weight: 700; font-size: .9rem;
}
.segmented button[aria-pressed="true"] { background: var(--surface-3); color: var(--text); }
.segmented button .icon { color: var(--icon); }

.empty {
  display: grid;
  justify-items: center;
  gap: 14px;
  padding: 44px 18px;
  text-align: center;
  color: var(--muted);
}
.empty .icon { width: 54px; height: 54px; color: var(--icon); stroke-width: 1.4; }
.empty h2 { color: var(--text); font-size: 1.2rem; }

/* 8. Modali ------------------------------------------------------------ */
dialog {
  padding: 0;
  border: 0;
  color: var(--text);
  background: transparent;
  max-width: 100vw;
  max-height: 100vh;
}
dialog::backdrop { background: rgba(8, 7, 6, .74); }
dialog[open]::backdrop { animation: fade-in .22s ease; }
@keyframes fade-in { from { opacity: 0; } }

.sheet {
  width: 100%;
  max-width: 560px;
  margin: auto auto 0;
  max-height: 92vh;
  max-height: 92dvh;
  border-radius: 24px 24px 0 0;
  background: var(--surface);
  border: 1px solid var(--line-2);
  border-bottom: 0;
  box-shadow: var(--shadow);
  overflow: hidden;
}
.sheet[open] { display: flex; flex-direction: column; animation: sheet-in .32s var(--ease); }
@keyframes sheet-in { from { transform: translateY(40px); opacity: 0; } }

.sheet__form { display: flex; flex-direction: column; min-height: 0; flex: 1; margin: 0; }
.sheet__scroll { overflow-y: auto; overscroll-behavior: contain; flex: 1; min-height: 0; }
.sheet__close {
  position: absolute; top: 12px; right: 12px; z-index: 2;
  display: grid; place-items: center;
  width: 42px; height: 42px;
  border-radius: 50%;
  background: rgba(var(--bg-rgb), .72);
  color: var(--text);
  border: 1px solid var(--line-2);
}
.sheet__media { background: var(--surface-2); aspect-ratio: 16 / 10; overflow: hidden; }
.sheet__media img, .sheet__media picture { width: 100%; height: 100%; object-fit: cover; }
.sheet__body { padding: 20px 20px 8px; display: grid; gap: 10px; }
.sheet__body--nomedia { padding-top: 26px; }
.sheet__title { color: var(--subtitle); font-size: calc(1.35rem * var(--title-scale)); font-weight: 750; line-height: 1.2; padding-right: 44px; }
.sheet__price { font-size: 1.1rem; font-weight: 800; color: var(--accent-2); }
.sheet__desc { color: var(--muted); font-size: .92rem; line-height: 1.5; }
.sheet__allergens { color: var(--muted-2); font-size: .82rem; }
.sheet__footer {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px calc(14px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  background: var(--surface);
}
.sheet__footer .btn { flex: 1; }

.optgroup { border: 0; margin: 6px 0 0; padding: 0; display: grid; gap: 8px; }
.optgroup legend {
  display: flex; justify-content: space-between; width: 100%;
  font-weight: 750; font-size: .95rem; margin-bottom: 8px; padding: 0;
}
.optgroup legend small { color: var(--muted-2); font-weight: 600; }
.opt {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 52px;
  padding: 10px 14px;
  border-radius: 12px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  cursor: pointer;
  transition: border-color .2s, background-color .2s;
}
.opt:hover { border-color: var(--line-2); }
.opt input { width: 20px; height: 20px; flex: none; accent-color: var(--accent); margin: 0; }
.opt span { flex: 1; min-width: 0; }
.opt b { font-weight: 700; white-space: nowrap; color: var(--muted); font-size: .9rem; }
.opt:has(input:checked) { border-color: rgba(var(--accent-rgb), .6); background: var(--accent-soft); }

/* Lightbox foto */
.lightbox {
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  max-width: none;
  max-height: none;
  margin: 0;
  background: rgba(6, 5, 4, .94);
}
.lightbox[open] { display: grid; place-items: center; animation: fade-in .2s ease; }
.lightbox::backdrop { background: transparent; }
.lightbox__figure { margin: 0; display: grid; justify-items: center; gap: 12px; padding: 60px 12px 24px; max-width: 100%; }
.lightbox__figure img, .lightbox__figure picture {
  max-width: min(94vw, 1100px);
  max-height: 78vh;
  max-height: 78dvh;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 14px;
}
.lightbox__caption { color: var(--muted); font-weight: 600; text-align: center; }
.lightbox__close {
  position: fixed; top: calc(14px + env(safe-area-inset-top)); right: 14px;
  display: grid; place-items: center;
  width: 48px; height: 48px;
  border-radius: 50%;
  background: var(--surface-2);
  border: 1px solid var(--line-2);
  color: var(--text);
}

/* Info attività */
.info-list { display: grid; gap: 14px; padding: 4px 0; }
.info-row { display: flex; gap: 12px; align-items: flex-start; color: var(--muted); }
.info-row .icon { color: var(--icon); margin-top: 2px; }
.info-row a { color: var(--text); }
.hours { width: 100%; border-collapse: collapse; font-size: .92rem; }
.hours td { padding: 7px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.hours td:last-child { text-align: right; color: var(--text); font-variant-numeric: tabular-nums; }
.hours tr.is-today td { color: var(--accent-2); font-weight: 700; }
.socials { display: flex; gap: 8px; flex-wrap: wrap; }

/* 9. Checkout e pagine ordine ----------------------------------------- */
.checkout { display: grid; gap: calc(14px * var(--space)); padding-bottom: 32px; }
.checkout .panel, .checkout .panel__title { color: var(--co-text); }
.checkout .panel { background: var(--co-bg); }
.checkout .checkout__summary, .cart-layout > aside.panel { background: var(--summary-bg); color: var(--summary-text); }
.checkout .checkout__summary .totals__row b, .cart-layout > aside.panel .totals__row b,
.checkout .checkout__summary .totals__row--total { color: var(--summary-text); }
.checkout__summary .cart-line { grid-template-columns: minmax(0, 1fr) auto; }
.checkout__summary .cart-line__img { display: none; }
.summary-toggle {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  width: 100%; font-weight: 750; font-size: 1rem;
}
.summary-toggle > span:last-child { display: inline-flex; align-items: center; gap: 6px; }
.summary-toggle .icon { transition: transform .3s var(--ease); color: var(--muted); }
.summary-toggle[aria-expanded="true"] .icon { transform: rotate(180deg); }
.form-stack { display: grid; gap: calc(14px * var(--space)); }
.form-error {
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(var(--danger-rgb), .1);
  border: 1px solid rgba(var(--danger-rgb), .35);
  color: var(--error-text);
  font-size: .9rem;
}
.form-error ul { margin: 6px 0 0; padding-left: 18px; }
.submit-bar { display: grid; gap: 10px; }
.submit-bar .btn--primary { background: var(--confirm-bg); color: var(--confirm-text); border-color: var(--confirm-border); }
.submit-bar .btn--primary:hover { background: var(--confirm-hover); }
.secure-note { display: flex; align-items: center; justify-content: center; gap: 6px; font-size: .8rem; color: var(--muted-2); }

.result {
  display: grid;
  justify-items: center;
  gap: 10px;
  padding: 34px 20px 26px;
  text-align: center;
}
.result__icon {
  display: grid; place-items: center;
  width: 74px; height: 74px;
  border-radius: 50%;
  background: rgba(var(--success-rgb), .12);
  color: var(--success);
  margin-bottom: 4px;
}
.result__icon .icon { width: 38px; height: 38px; stroke-width: 2.2; }
.result__icon--wait { background: var(--accent-soft); color: var(--accent); }
.result__icon--wait .icon { animation: spin 2.4s linear infinite; }
.result__icon--error { background: rgba(var(--danger-rgb), .12); color: var(--danger); }
.result__title { font-family: var(--font-display); font-size: calc(clamp(1.6rem, 6vw, 2.1rem) * var(--title-scale)); font-weight: var(--heading-weight); color: var(--heading); }
.order-number {
  margin-top: 6px;
  padding: 12px 20px;
  border-radius: 14px;
  background: var(--bg-2);
  border: 1px dashed rgba(var(--accent-rgb), .55);
  font-size: clamp(1.25rem, 5.5vw, 1.6rem);
  font-weight: 850;
  letter-spacing: .04em;
  color: var(--accent-2);
  font-variant-numeric: tabular-nums;
}
.status-chip {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 12px; border-radius: 999px;
  background: var(--surface-2); font-size: .85rem; font-weight: 700;
}
.status-chip::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.kv { display: grid; gap: 10px; }
.kv__row { display: flex; justify-content: space-between; gap: 16px; font-size: .92rem; }
.kv__row span { color: var(--muted); }
.kv__row b { text-align: right; font-weight: 650; }
.actions { display: grid; gap: 10px; margin-top: 16px; }

/* 10. Footer, avvisi, toast -------------------------------------------- */
.notice {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 14px 16px;
  margin-bottom: 14px;
  border-radius: 14px;
  background: var(--surface);
  border: 1px solid var(--line-2);
  color: var(--info-text);
  font-size: .92rem;
}
.notice .icon { color: var(--icon); margin-top: 1px; }
.notice strong { color: var(--notify-text); }
.notice--warn { background: rgba(var(--accent-rgb), .09); border-color: rgba(var(--accent-rgb), .4); color: var(--notify-text); }
.notice--error { background: rgba(var(--danger-rgb), .09); border-color: rgba(var(--danger-rgb), .4); color: var(--error-text-2); }
.notice--error .icon { color: var(--danger); }

.site-footer {
  margin-top: 26px;
  padding: 26px 0 30px;
  border-top: 1px solid var(--line);
  background: var(--footer-bg);
  color: var(--footer-text);
  font-size: .84rem;
  text-align: center;
}
.site-footer__name { font-family: var(--font-display); color: var(--footer-title); font-size: 1.15rem; margin-bottom: 6px; }
.site-footer p + p { margin-top: 4px; }
.site-footer nav { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 16px; margin-top: 12px; }
.site-footer a { color: var(--footer-link); }
.install-btn { margin-top: 14px; }

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(88px + env(safe-area-inset-bottom));
  z-index: 60;
  display: flex; align-items: center; gap: 8px;
  max-width: calc(100vw - 32px);
  padding: 12px 18px;
  border-radius: 999px;
  background: var(--surface-3);
  border: 1px solid var(--line-2);
  box-shadow: var(--shadow);
  color: var(--notify-text);
  font-size: .9rem; font-weight: 650;
  transform: translate(-50%, 20px);
  opacity: 0;
  pointer-events: none;
  transition: transform .3s var(--ease), opacity .3s;
}
.toast.is-visible { transform: translate(-50%, 0); opacity: 1; }
.toast .icon { color: var(--success); }

.prose { color: var(--muted); line-height: 1.65; }
.prose h2 { color: var(--text); font-size: 1.1rem; margin: 22px 0 8px; }
.prose p + p { margin-top: 10px; }
.prose ul { padding-left: 20px; }
.credits li { overflow-wrap: anywhere; margin-bottom: 10px; }
.credits a { color: var(--text); }

/* Schermi più grandi ---------------------------------------------------- */
@media (min-width: 420px) {
  :root { --photo: 62px; --thumb: 42px; }
  .grid-3 { grid-template-columns: 1.3fr .8fr .6fr; }
  .grid-3 > :first-child { grid-column: auto; }
}

@media (min-width: 700px) {
  :root { --gutter: 24px; --photo: 72px; --thumb: 48px; }
  .hero { padding-bottom: 28px; }
  .cat__head { min-height: 88px; padding: 16px 18px 16px 24px; }
  .cat__name { font-size: calc(1.28rem * var(--title-scale)); }
  .prod { padding: 16px 22px 16px 24px; }
  .prod__row { column-gap: 18px; }
  .prod__name { font-size: 1.06rem; }
  .prod__price { font-size: 1.06rem; }
  .sheet { margin: auto; border-radius: 24px; border-bottom: 1px solid var(--line-2); max-height: 88vh; }
  .sheet[open] { animation-name: pop-in; }
  @keyframes pop-in { from { transform: scale(.96); opacity: 0; } }
  .checkout { grid-template-columns: minmax(0, 1fr) 360px; align-items: start; }
  .checkout__summary { position: sticky; top: 16px; grid-column: 2; grid-row: 1 / span 3; }
  .cart-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 16px; align-items: start; }
  .cart-layout > aside { position: sticky; top: 16px; }
}

@media (min-width: 1000px) {
  :root { --photo: 80px; --thumb: 52px; }
  .cats { gap: 14px; }
}

@media (max-width: 359px) {
  :root { --photo: 50px; --thumb: 32px; --gutter: 12px; }
  .prod { padding-left: 14px; padding-right: 12px; }
  .prod__row { column-gap: 8px; }
  .cat__head { padding-left: 14px; gap: 8px; }
  .cat__thumbs { gap: 4px; }
  .add span { display: none; }
  .add { padding: 0 12px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}

@media print {
  body { background: #fff; color: #000; }
  .cartbar, .toast, .site-footer nav, .btn, .topbar { display: none !important; }
}

/* Riga con lingua, account e carrello sopra il logo (su smartphone: sottile e fissa in alto).
   iPhone a tutto schermo / web app: la riga inizia sotto l'area di stato (ora, rete, batteria) grazie a
   env(safe-area-inset-top), applicato solo qui (0 nel browser normale e su Android senza ritagli). */
.topstrip { position: relative; z-index: 60; padding-top: calc(12px + env(safe-area-inset-top, 0px)); }
.topstrip__inner { display: flex; justify-content: flex-end; align-items: center; gap: 8px; }
@media (max-width: 699px) {
  .topstrip {
    position: sticky; top: 0;
    padding: calc(6px + env(safe-area-inset-top, 0px)) 0 6px;
    background: var(--header-bg);
    -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--line);
  }
  .topstrip__inner { justify-content: space-between; }
  .topstrip .lang { order: -1; }
  .topstrip .lang__menu { left: 0; right: auto; }
  .topstrip .lang__btn, .topstrip .cartlink { min-height: 34px; padding-top: 0; padding-bottom: 0; }
  .topstrip .cartlink { font-size: .8rem; box-shadow: none; }
  .topstrip .cartlink .icon { width: 18px; height: 18px; }
  .topstrip .cartlink__count { top: -4px; right: -4px; min-width: 18px; height: 18px; font-size: .68rem; }
  /* i testi non vanno mai a capo: se lo spazio non basta si accorciano (…) invece di uscire */
  .topstrip .acclink, .topstrip .cartlink { min-width: 0; white-space: nowrap; }
  .topstrip .acclink__label, .topstrip .cartlink__label { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
  .hero { padding-top: 26px; } /* logo staccato dalla barra in alto */
  .hero__logo img { height: var(--logo-h-m, 56px); }
  /* la categoria raggiunta resta sotto la barra in alto (altezza reale misurata da menu.js) */
  .cat, #main { scroll-margin-top: calc(var(--mobile-header-height, 47px) + 11px); }
}
/* smartphone stretti: pulsanti più compatti (la lingua resta con bandiera e sigla) */
@media (max-width: 399px) {
  .topstrip__inner { gap: 6px; }
  .topstrip .lang__btn .icon { display: none; }
  .topstrip .lang__btn, .topstrip .acclink, .topstrip .cartlink { padding-left: 11px; padding-right: 11px; }
}
.topbar__end { display: flex; align-items: center; gap: 10px; }
.lang { position: relative; }
.lang__btn { list-style: none; display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 12px; border-radius: 999px; background: var(--pill-bg); border: 1px solid var(--pill-border); color: var(--pill-text); font-size: .82rem; font-weight: 650; cursor: pointer; }
.lang__btn::-webkit-details-marker { display: none; }
.lang__btn .icon { color: var(--icon); width: 18px; height: 18px; }
.flag { display: block; border-radius: 3px; box-shadow: 0 0 0 1px rgba(255,255,255,.18); object-fit: cover; }
.lang__menu { position: absolute; right: 0; top: calc(100% + 8px); min-width: 210px; margin: 0; padding: 6px; list-style: none; background: var(--surface-2); border: 1px solid var(--line-2); border-radius: 14px; box-shadow: 0 18px 40px rgba(0,0,0,.45); text-align: left; }
.lang__item { display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 0 12px; border-radius: 10px; color: var(--text); text-decoration: none; font-size: .95rem; }
.lang__item:hover { background: var(--surface-3); }
.lang__item.is-current { background: var(--accent-soft); }
.lang__item .icon { margin-left: auto; color: var(--accent); width: 18px; height: 18px; }

/* Pulsante carrello in alto */
.cartlink { position: relative; display: inline-flex; align-items: center; gap: 7px; min-height: 40px; padding: 0 14px; border-radius: 999px; background: var(--cartlink-bg); color: var(--cartlink-text); font-size: .84rem; font-weight: 700; text-decoration: none; box-shadow: 0 6px 18px rgba(var(--accent-rgb), .22); }
.cartlink:hover { background: var(--cartlink-hover); }
.cartlink .icon { width: 20px; height: 20px; stroke-width: 2; }
.cartlink__count { position: absolute; top: -6px; right: -6px; display: grid; place-items: center; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 999px; background: var(--text); color: var(--accent-ink); font-size: .72rem; font-weight: 800; box-shadow: 0 0 0 2px var(--bg); }
@media (max-width: 359px) { .cartlink__label { display: none; } }

/* Pulsanti delle categorie sotto il titolo del menu */
.cat-nav { display: flex; flex-wrap: wrap; gap: 8px; margin: -4px 0 16px; padding: 12px; border-radius: var(--radius-sm); background: var(--accent-soft); border: 1px solid rgba(var(--accent-rgb), .28); }
.cat-nav a { display: inline-flex; align-items: center; min-height: 36px; padding: 0 14px; border-radius: 999px; background: var(--chip-bg); border: 1px solid var(--line-2); color: var(--chip-text); font-size: .85rem; font-weight: 650; text-decoration: none; transition: background-color .2s, color .2s, border-color .2s; }
.cat-nav a:hover { border-color: var(--accent); }
.cat-nav a.is-active { background: var(--chip-active-bg); border-color: var(--chip-active-bg); color: var(--chip-active-text); }
.cat-nav__hint { display: none; }

/* Smartphone (e tablet touch): una sola riga scorrevole col dito, senza riquadro.
   Larghezza dei pulsanti calcolata sullo schermo: 3 interi + metà del quarto (5 e mezzo sui tablet).
   La barra arriva ai bordi dello schermo; lo scroll-snap riallinea i pulsanti dopo lo swipe.
   touch-action pan-x pan-y: swipe orizzontale sulla barra, ma la pagina scorre ancora in verticale
   anche partendo con il dito sopra i pulsanti. Desktop: riquadro con tutte le categorie (sopra). */
@media (max-width: 699px), (max-width: 999px) and (pointer: coarse) {
  .cat-nav {
    --cat-gap: 8px;
    --cat-visible: 3.5;
    flex-wrap: nowrap;
    gap: var(--cat-gap);
    margin: -6px calc(-1 * var(--gutter)) 12px;
    padding: 3px var(--gutter);
    border: 0;
    border-radius: 0;
    background: none;
    overflow-x: auto;
    overflow-y: hidden;
    overscroll-behavior-x: contain;
    scroll-snap-type: x mandatory;
    scroll-padding-inline: var(--gutter);
    -webkit-overflow-scrolling: touch;
    touch-action: pan-x pan-y;
    scrollbar-width: none;
  }
  .cat-nav::-webkit-scrollbar { display: none; }
  .cat-nav a {
    flex: 0 0 calc((100% + var(--gutter) - (var(--cat-visible) - .5) * var(--cat-gap)) / var(--cat-visible));
    display: block;
    min-width: 0;
    height: 38px;
    padding: 0 10px;
    line-height: 36px;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: .82rem;
    scroll-snap-align: start;
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    user-select: none;
  }
  .cat-nav a:focus-visible { outline-offset: -3px; }
  .cat-nav__hint {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin: -6px 2px 12px;
    color: var(--accent-2);
    font-size: .78rem;
    font-weight: 600;
  }
  .cat-nav__hint .icon { width: 18px; height: 18px; flex: none; }
}
@media (min-width: 700px) and (max-width: 999px) and (pointer: coarse) { .cat-nav { --cat-visible: 5.5; } }

/* Categorie fisse durante lo scroll (Aspetto → Menu mobile), solo dove la barra è scorrevole.
   Si fermano subito sotto la barra in alto: --mobile-header-height è la sua altezza reale, misurata da
   menu.js (cambia con lo schermo e la lingua; 0 dove la barra in alto non è fissa, es. tablet).
   Stesse misure della versione normale (padding più alto compensato dai margini): nessun salto.
   Sfondo pieno: i prodotti non si vedono in trasparenza. Il titolo «Il nostro menu» scorre via. */
@media (max-width: 699px), (max-width: 999px) and (pointer: coarse) {
  .cat-nav--sticky {
    position: -webkit-sticky;
    position: sticky;
    top: var(--mobile-header-height, 0px);
    z-index: 30;
    margin-top: -9px;
    margin-bottom: 8px;
    padding-top: 6px;
    padding-bottom: 6px;
    background: var(--bg);
    border-bottom: 1px solid transparent;
    transition: border-color .2s, box-shadow .2s;
  }
  .cat-nav--sticky.is-stuck { border-bottom-color: var(--line); box-shadow: 0 12px 18px -14px rgba(0, 0, 0, .85); }
  /* la categoria raggiunta resta visibile sotto le due barre */
  .has-sticky-cats .cat { scroll-margin-top: calc(var(--mobile-header-height, 0px) + var(--cat-nav-height, 52px) + 8px); }
}
@media (max-width: 359px) { .cat-nav a { padding: 0 8px; font-size: .78rem; } }
@media (max-width: 520px) { .topbar__brand { display: none; } }
.topbar .cartlink__label { display: none; }
.topbar .cartlink { padding: 0 12px; }
.site-footer__credit { margin-top: 6px; font-size: .78rem; color: var(--footer-text); }
.site-footer__credit a { color: var(--accent-2); font-weight: 600; }

/* 11. Account clienti (accedi, registrati, il mio account, checkout) --- */
.acclink { display: inline-flex; align-items: center; gap: 7px; min-height: 40px; padding: 0 14px; border-radius: 999px; background: var(--pill-bg); border: 1px solid var(--line-2); color: var(--pill-text); font-size: .84rem; font-weight: 700; text-decoration: none; }
.acclink:hover { background: var(--surface-2); }
.acclink .icon { width: 18px; height: 18px; color: var(--icon); }
.acclink.is-logged { border-color: rgba(var(--accent-rgb), .45); }
.topbar .acclink__label { display: none; }
.topbar .acclink { padding: 0 11px; }
@media (max-width: 699px) {
  .topstrip .acclink { margin-left: auto; min-height: 34px; font-size: .8rem; }
  .topstrip .acclink .icon { width: 16px; height: 16px; }
}

.auth { max-width: 480px; padding-bottom: 28px; }
.auth__lead { display: flex; gap: 10px; align-items: flex-start; margin: -6px 0 16px; color: var(--muted); font-size: .95rem; }
.auth__lead .icon { flex: none; width: 20px; height: 20px; margin-top: 1px; color: var(--accent); }
.auth__forgot { justify-self: center; font-size: .9rem; color: var(--muted); }
.auth__switch { margin: 18px 0 0; text-align: center; color: var(--muted); }
.auth__switch a { font-weight: 700; }

.pw { position: relative; }
.pw .input { padding-right: 54px; }
.pw__toggle { position: absolute; top: 50%; right: 5px; transform: translateY(-50%); display: grid; place-items: center; width: 42px; height: 42px; border-radius: 10px; color: var(--muted); }
.pw__toggle:hover { color: var(--text); background: var(--surface-2); }
.pw__toggle .icon { width: 20px; height: 20px; }

.notice--success { background: rgba(var(--success-rgb), .08); border-color: rgba(var(--success-rgb), .35); color: var(--notify-text); }
.notice--success .icon { color: var(--success); }
.notice > div { min-width: 0; overflow-wrap: anywhere; }

.account { max-width: 760px; padding-bottom: 28px; }
.account__hello { margin: -8px 0 12px; font-weight: 650; overflow-wrap: anywhere; }
.account__nav { display: flex; gap: 8px; margin: 0 0 16px; padding-bottom: 4px; overflow-x: auto; scrollbar-width: none; }
.account__nav::-webkit-scrollbar { display: none; }
.account__nav a { flex: none; display: inline-flex; align-items: center; min-height: 38px; padding: 0 14px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); color: var(--text); font-size: .85rem; font-weight: 650; text-decoration: none; }
.account__nav a:hover { border-color: var(--accent); }
.account .panel { scroll-margin-top: 70px; }
.account .panel__title .icon { width: 20px; height: 20px; color: var(--accent); }
.account__row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.sep { border: 0; border-top: 1px solid var(--line); margin: 18px 0; }

.orders-list { display: grid; gap: 12px; }
.order-card { padding: 14px; border-radius: var(--radius-sm); background: var(--bg-2); border: 1px solid var(--line); }
.order-card__head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.order-card__num { font-weight: 800; letter-spacing: .02em; font-variant-numeric: tabular-nums; }
.order-card__meta { margin-top: 2px; font-size: .82rem; color: var(--muted); }
.order-card__items { margin-top: 10px; font-size: .9rem; color: var(--muted); }
.order-card__foot { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.order-card__total { font-size: 1.05rem; font-variant-numeric: tabular-nums; }
.order-card__actions { display: flex; flex-wrap: wrap; gap: 8px; }
.order-card__details { margin-top: 10px; padding-top: 6px; border-top: 1px solid var(--line); }
.order-card__details > summary { list-style: none; display: inline-flex; align-items: center; gap: 6px; min-height: 36px; color: var(--muted); font-size: .88rem; font-weight: 650; cursor: pointer; }
.order-card__details > summary::-webkit-details-marker { display: none; }
.order-card__details > summary .icon { width: 16px; height: 16px; transition: transform .25s var(--ease); }
.order-card__details[open] > summary .icon { transform: rotate(180deg); }
.order-card__details .cart-line { grid-template-columns: minmax(0, 1fr) auto; }
.order-card .status-chip { flex: none; white-space: nowrap; font-size: .78rem; }
.status-chip--completed::before { background: var(--success); }
.status-chip--cancelled::before { background: var(--danger); }
.status-chip--pending_payment::before { background: var(--muted-2); }

.addr-list { display: grid; gap: 10px; margin-bottom: 14px; }
.addr { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 10px; padding: 12px 14px; border-radius: var(--radius-sm); background: var(--bg-2); border: 1px solid var(--line); }
.addr__line { font-weight: 650; overflow-wrap: anywhere; }
.addr__line .badge { margin-left: 6px; vertical-align: middle; }
.addr__actions { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.addr__edit { grid-column: 1 / -1; }
.addr__edit > summary, .addr__new > summary { list-style: none; width: max-content; cursor: pointer; }
.addr__edit > summary::-webkit-details-marker, .addr__new > summary::-webkit-details-marker { display: none; }
@media (max-width: 520px) {
  .addr { grid-template-columns: 1fr; }
  .addr__actions { flex-direction: row; flex-wrap: wrap; align-items: center; }
}

/* Checkout: cliente riconosciuto, accesso/registrazione, ordine senza account, indirizzi salvati */
.who { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; }
.who__avatar { flex: none; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); }
.who__text { min-width: 0; flex: 1 1 160px; }
.who__name { font-weight: 750; overflow-wrap: anywhere; }
.who__email { font-size: .85rem; color: var(--muted); overflow-wrap: anywhere; }
.who__business { font-size: .9rem; font-weight: 650; color: var(--accent-2); overflow-wrap: anywhere; }
.auth__group { display: grid; gap: 12px; min-width: 0; margin: 4px 0 0; padding: 16px 0 0; border: 0; border-top: 1px solid var(--line); }
.auth__group > legend { float: left; width: 100%; display: flex; align-items: center; gap: 8px; padding: 0; font-weight: 750; font-size: .98rem; }
.auth__group > legend .icon { width: 18px; height: 18px; color: var(--accent); }
.auth__group > .field__hint { margin-top: -6px; }
.who__actions { display: flex; flex-wrap: wrap; gap: 4px; margin-left: auto; }
.auth-choice { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.auth-choice .btn { width: 100%; padding: 0 10px; white-space: nowrap; }
@media (max-width: 359px) { .auth-choice { grid-template-columns: 1fr; } }
.guest { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.guest__toggle { list-style: none; display: inline-flex; align-items: center; gap: 6px; min-height: 40px; color: var(--accent-2); font-weight: 700; cursor: pointer; }
.guest__toggle::-webkit-details-marker { display: none; }
.guest__toggle .icon { width: 16px; height: 16px; transition: transform .25s var(--ease); }
.guest[open] .guest__toggle .icon { transform: rotate(180deg); }
.is-invalid > .auth-choice .btn--ghost { border-color: var(--danger); }
.addr-choices .choice__box { min-height: 58px; }
.auth-gate .panel__title .icon { width: 20px; height: 20px; color: var(--accent); }

/* Checkout: giorno fisso «Oggi — data» quando gli ordini per i giorni futuri sono spenti */
.input--static { display: flex; align-items: center; gap: 10px; margin: 0; font-weight: 700; line-height: 1.3; cursor: default; }
.input--static .icon { flex: none; width: 20px; height: 20px; color: var(--icon); }
.schedule--today { grid-template-columns: 1fr; }
@media (min-width: 520px) { .schedule--today { grid-template-columns: 1.25fr 1fr; } }

/* Invito «Installa l'App» (assets/js/install.js, Admin → Impostazioni → Installazione app) ---------
   Colori e arrotondamento: quelli del sito (Aspetto), salvo valori scelti nell'admin (style="--ib-…").
   Dall'alto: sotto la barra in alto (altezza reale misurata da menu.js, area di stato compresa).
   Dal basso: sopra «Visualizza carrello» quando c'è. A tutto schermo: finestra <dialog>. */
.ib, .ib-full {
  --ib-bg: var(--surface);
  --ib-text: var(--text);
  --ib-btn: var(--btn-bg);
  --ib-btn-text: var(--btn-text);
  --ib-border: rgba(var(--accent-rgb), .45);
  --ib-radius: var(--radius);
}
.ib {
  position: fixed;
  left: calc(12px + env(safe-area-inset-left, 0px));
  right: calc(12px + env(safe-area-inset-right, 0px));
  z-index: 55; /* sopra categorie e carrello, sotto la barra in alto (menu delle lingue) */
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  max-width: 520px;
  margin: 0 auto;
  padding: 14px 46px 14px 14px;
  border-radius: var(--ib-radius);
  background: var(--ib-bg);
  color: var(--ib-text);
  border: 1px solid var(--ib-border);
  box-shadow: 0 18px 44px rgba(0, 0, 0, .55);
  opacity: 0;
  transition: transform .45s var(--ease), opacity .3s ease, bottom .3s var(--ease);
}
.ib.is-visible { transform: none; opacity: 1; }
.ib--top {
  top: max(calc(var(--mobile-header-height, 0px) + 10px), calc(env(safe-area-inset-top, 0px) + 10px));
  transform: translateY(calc(-100% - 160px));
}
.ib--bottom {
  bottom: calc(12px + env(safe-area-inset-bottom, 0px));
  transform: translateY(calc(100% + 160px));
}
body.has-cartbar .ib--bottom { bottom: calc(12px + var(--cartbar-h) + 10px + env(safe-area-inset-bottom, 0px)); }
.ib__icon { width: 52px; height: 52px; border-radius: 13px; box-shadow: 0 0 0 1px var(--ib-border); }
.ib__title { font-weight: 800; font-size: 1rem; line-height: 1.25; }
.ib__text { margin-top: 4px; font-size: .86rem; line-height: 1.4; opacity: .82; }
.ib__actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.ib__install {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 42px; padding: 0 18px;
  border-radius: 999px;
  background: var(--ib-btn); color: var(--ib-btn-text);
  font-weight: 800; font-size: .9rem;
}
.ib__install .icon { width: 20px; height: 20px; }
.ib__later {
  min-height: 42px; padding: 0 16px;
  border-radius: 999px;
  border: 1px solid var(--ib-border);
  color: var(--ib-text); font-weight: 650; font-size: .86rem;
}
.ib__x {
  position: absolute; top: 8px; right: 8px;
  display: grid; place-items: center;
  width: 38px; height: 38px;
  border-radius: 50%;
  color: var(--ib-text); opacity: .75;
}
.ib__x .icon { width: 18px; height: 18px; }

.ib-full {
  --ib-bg: var(--bg);
  width: 100vw; height: 100vh; height: 100dvh;
  max-width: none; max-height: none;
  margin: 0;
  overflow-y: auto;
  background: radial-gradient(640px 380px at 50% -60px, rgba(var(--accent-rgb), .18), transparent 70%), var(--ib-bg);
  color: var(--ib-text);
}
.ib-full[open] { display: flex; animation: ib-full-in .35s var(--ease); }
.ib-full::backdrop { background: var(--bg); }
@keyframes ib-full-in { from { opacity: 0; transform: scale(.985); } }
.ib-full__inner {
  display: flex; flex-direction: column; align-items: center; gap: 14px;
  width: 100%; max-width: 420px;
  margin: auto;
  padding: calc(28px + env(safe-area-inset-top, 0px)) calc(24px + env(safe-area-inset-right, 0px))
           calc(28px + env(safe-area-inset-bottom, 0px)) calc(24px + env(safe-area-inset-left, 0px));
  text-align: center;
}
.ib-full__brand img { height: 56px; width: auto; max-width: 100%; margin: 0 auto; }
.ib-full__name { font-family: var(--font-display); font-size: 2rem; }
.ib-full__icon { width: 96px; height: 96px; margin-top: 8px; border-radius: 22px; box-shadow: 0 0 0 1px var(--ib-border), 0 18px 40px rgba(0, 0, 0, .55); }
.ib-full__title { font-family: var(--font-display); font-weight: var(--heading-weight); font-size: calc(1.7rem * var(--title-scale)); line-height: 1.15; }
.ib-full__text { font-size: 1rem; line-height: 1.5; opacity: .85; }
.ib-full__install { width: 100%; min-height: 52px; margin-top: 8px; font-size: 1rem; }
.ib-full__later { min-height: 46px; padding: 0 18px; color: var(--ib-text); font-weight: 650; text-decoration: underline; text-underline-offset: 4px; opacity: .85; }

/* Guida all'installazione (iPhone e browser senza installazione diretta): non si chiude da sola */
.ib-guide__body { padding-bottom: calc(20px + env(safe-area-inset-bottom, 0px)); }
.ib-guide__head { display: flex; align-items: center; gap: 12px; padding-right: 44px; }
.ib-guide__head img { width: 52px; height: 52px; border-radius: 13px; flex: none; }
.ib-steps { display: grid; gap: 12px; margin: 6px 0 0; padding: 0; list-style: none; }
.ib-steps li { display: grid; grid-template-columns: 42px minmax(0, 1fr); gap: 12px; align-items: center; font-size: .95rem; line-height: 1.4; }
.ib-steps small { display: block; margin-top: 3px; color: var(--muted); font-size: .82rem; }
.ib-steps__icon, .ib-guide__inapp > .icon {
  display: grid; place-items: center;
  width: 42px; height: 42px;
  border-radius: 12px;
  background: var(--surface-2); border: 1px solid var(--line-2);
  color: var(--accent-2);
}
.ib-steps__icon .icon { width: 22px; height: 22px; }
.ib-guide__inapp { display: grid; grid-template-columns: 42px minmax(0, 1fr); gap: 12px; align-items: center; margin: 6px 0 0; line-height: 1.4; }
.ib-guide__inapp > .icon { padding: 10px; }
.ib-guide__note { margin: 4px 0 6px; }
