/* =====================================================================
   "Biscotteria italiana, minimale" — mobile first.
   Crema, cacao e un solo accento (verde petrolio del logo). Spazio al posto dei
   bordi, angoli quasi vivi (2px), bersagli tattili da 44px.
   Le classi che app.js deve generare sono descritte in css-contract.md.
   ===================================================================== */
/* Caratteri ospitati sul sito (solo latino: copre á é í ó ú ñ ¿ ¡). Jost è variabile: un file per 400 e 500. */
@font-face { font-family: "Cormorant Garamond"; font-style: normal; font-weight: 500; font-display: swap; src: url("fonts/cormorant-garamond-500.woff2") format("woff2"); }
@font-face { font-family: "Cormorant Garamond"; font-style: italic; font-weight: 500; font-display: swap; src: url("fonts/cormorant-garamond-500-italic.woff2") format("woff2"); }
@font-face { font-family: "Jost"; font-style: normal; font-weight: 400 500; font-display: swap; src: url("fonts/jost.woff2") format("woff2"); }

:root {
  /* palette */
  --bg: #F6F1E8;          /* crema */
  --surface: #FFFDF9;     /* avorio */
  --surface-2: #EFE7DA;   /* crema scura: segnaposto foto, controlli segmentati */
  --ink: #2B211C;         /* cacao */
  --ink-soft: #6B5D52;    /* testo secondario, AA su crema (5.6:1) */
  --ink-faint: #6B5D52;   /* alias storico (admin): ora uguale a ink-soft per il contrasto AA */
  --line: #E5DCCD;
  --line-soft: #EFE7DA;
  --accent: #075461;      /* verde petrolio del logo */
  --accent-dark: #05404A;
  --on-accent: #F6F1E8;
  --gold: #B08D57;        /* solo piccoli ornamenti, mai testo */
  --danger: #A3342A;
  --danger-bg: #F7E6E1;

  /* forma e ritmo */
  --radius: 2px;
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px; --s7: 48px; --s8: 72px;
  --gutter: 20px;
  --page: 1120px;
  --header-h: 56px;
  --tap: 44px;
  --ease: cubic-bezier(.2, .7, .2, 1);
  --shadow-float: 0 10px 30px rgba(43, 33, 28, .16);
  --shadow-soft: 0 1px 2px rgba(43, 33, 28, .12);

  /* caratteri (ripieghi: i font dell'admin, poi di sistema) */
  --serif: "Cormorant Garamond", "Fraunces", Georgia, "Times New Roman", serif;
  --sans: "Jost", "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
/* chi ha l'attributo hidden resta nascosto anche se una regola imposta display */
[hidden] { display: none !important; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--header-h) + var(--s2)); }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: rgba(43, 33, 28, .06);
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; }
h1, h2, h3, h4 { margin: 0 0 var(--s2); line-height: 1.15; }
h1, h2 { font-family: var(--serif); font-weight: 500; letter-spacing: -.005em; }
h1 { font-size: clamp(2.5rem, 10vw, 3.5rem); }
h2 { font-size: clamp(1.875rem, 6vw, 2.5rem); }
h3, h4 { font-family: var(--sans); font-weight: 500; font-size: 1rem; }
p { margin: 0 0 var(--s3); }
ul, ol { margin: 0; padding: 0; }
a { color: inherit; }
button { font: inherit; color: inherit; }
code { font-family: var(--sans); font-variant-numeric: tabular-nums; letter-spacing: .04em; }
.plain { list-style: none; }
.muted { color: var(--ink-soft); }
.small { font-size: .875rem; }

/* etichetta in maiuscoletto spaziato */
.label, .eyebrow {
  font-family: var(--sans); font-weight: 500; font-size: .75rem; line-height: 1.4;
  letter-spacing: .12em; text-transform: uppercase; color: var(--ink-soft);
  margin: 0 0 var(--s2);
}
.link {
  color: var(--accent); font-weight: 500; text-decoration: underline;
  text-decoration-thickness: 1px; text-underline-offset: 4px;
}
.link:hover { color: var(--ink); }
.link-tap { display: inline-flex; align-items: center; min-height: var(--tap); }

/* focus visibile e coerente */
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
:focus:not(:focus-visible) { outline: none; }

.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: var(--s2); top: -100px; z-index: 100;
  background: var(--ink); color: var(--bg); padding: var(--s3) var(--s4); text-decoration: none;
}
.skip-link:focus { top: var(--s2); }

svg.icon {
  width: 24px; height: 24px; display: block; flex: none;
  fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round;
}
.icon-btn {
  display: inline-grid; place-items: center; width: var(--tap); height: var(--tap);
  padding: 0; border: 0; background: none; color: var(--ink); cursor: pointer; border-radius: var(--radius);
}
.icon-btn:hover { color: var(--accent); }

/* ---------- Bottoni ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s2);
  min-height: 48px; padding: var(--s3) var(--s5);
  border: 1px solid transparent; border-radius: var(--radius);
  font-family: var(--sans); font-size: .9375rem; font-weight: 500; letter-spacing: .03em; line-height: 1.2;
  text-decoration: none; cursor: pointer;
  transition: background-color .2s var(--ease), color .2s var(--ease), border-color .2s var(--ease);
}
.btn-primary { background: var(--accent); color: var(--on-accent); }
.btn-primary:hover:not(:disabled) { background: var(--accent-dark); }
.btn-dark { background: var(--ink); color: var(--bg); }
.btn-quiet { background: transparent; border-color: var(--ink); color: var(--ink); }
.btn-quiet:hover { background: var(--ink); color: var(--bg); }
.btn-block { display: flex; width: 100%; min-height: 52px; font-size: 1rem; }
.btn:disabled { opacity: .45; cursor: not-allowed; }

/* ---------- Campi (base, usata anche dall'admin) ---------- */
select, input[type="text"], input[type="tel"], input[type="date"], input[type="number"], textarea {
  width: 100%; font: inherit; font-size: 1rem; color: var(--ink);
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: .65rem .75rem;
}
select {
  appearance: none; padding-right: 2rem;
  background-image: linear-gradient(45deg, transparent 50%, var(--ink-soft) 50%), linear-gradient(135deg, var(--ink-soft) 50%, transparent 50%);
  background-position: calc(100% - 16px) 52%, calc(100% - 11px) 52%; background-size: 5px 5px; background-repeat: no-repeat;
}
textarea { resize: vertical; }
.hint { display: block; font-size: .8125rem; line-height: 1.45; color: var(--ink-soft); font-weight: 400; margin: 0; }
.error {
  margin: 0; padding: var(--s3) var(--s4); border-radius: var(--radius);
  background: var(--danger-bg); color: var(--danger); font-size: .9375rem;
}

/* ===================================================================
   Intestazione: lingua a sinistra, nome al centro, borsa a destra
   =================================================================== */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: grid; grid-template-columns: var(--tap) minmax(0, 1fr) var(--tap); align-items: center; gap: var(--s1);
  height: var(--header-h);
  padding-inline: max(var(--s3), env(safe-area-inset-left)) max(var(--s3), env(safe-area-inset-right));
  background: rgba(246, 241, 232, .94);
  -webkit-backdrop-filter: saturate(160%) blur(10px); backdrop-filter: saturate(160%) blur(10px);
}
.topbar-side { display: flex; align-items: center; }
.topbar-right { justify-content: flex-end; }

/* nome: maiuscoletto spaziato; app.js (fitBrand) lo rimpicciolisce per stare su una riga */
.brand {
  display: block; min-width: 0; text-align: center; text-decoration: none; color: var(--ink);
  font-family: var(--serif); font-weight: 500; font-size: 18px; line-height: var(--header-h);
  text-transform: uppercase; letter-spacing: .2em; padding-left: .2em; /* compensa la spaziatura finale */
  white-space: nowrap; overflow: hidden; text-overflow: clip;
}
.brand.is-long { text-transform: none; font-style: italic; letter-spacing: .01em; padding-left: 0; font-size: 22px; }

/* lingua: sul telefono si vede solo quella NON attiva (un tasto interruttore) */
.lang-switch { display: flex; align-items: center; }
.lang-switch button {
  min-width: var(--tap); height: var(--tap); padding: 0 var(--s1);
  border: 0; background: none; cursor: pointer;
  font-family: var(--sans); font-size: .75rem; font-weight: 500; letter-spacing: .12em; color: var(--ink-soft);
}
.lang-switch button:hover { color: var(--ink); }
.lang-switch button.active { display: none; }

.bag-btn {
  position: relative; display: grid; place-items: center; width: var(--tap); height: var(--tap);
  padding: 0; border: 0; background: none; color: var(--ink); cursor: pointer; border-radius: var(--radius);
}
.bag-btn:hover:not(:disabled) { color: var(--accent); }
.bag-btn:disabled { opacity: .4; cursor: not-allowed; }
.bag-btn .count {
  position: absolute; top: 5px; right: 3px;
  min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
  display: grid; place-items: center;
  background: var(--accent); color: var(--on-accent);
  font-size: .6875rem; font-weight: 500; line-height: 1; font-variant-numeric: tabular-nums;
}

/* ---------- Avviso di chiusura ---------- */
.notice { background: var(--ink); color: var(--bg); padding: var(--s4) var(--gutter); text-align: center; font-size: .9375rem; }
.notice strong { display: block; font-family: var(--serif); font-weight: 500; font-size: 1.375rem; margin-bottom: var(--s1); }
.notice span { opacity: .85; }

/* ===================================================================
   Layout
   =================================================================== */
.wrap {
  max-width: var(--page); margin: 0 auto;
  /* in orizzontale sui telefoni con notch il contenuto resta fuori dalle zone non sicure */
  padding-inline: max(var(--gutter), env(safe-area-inset-left)) max(var(--gutter), env(safe-area-inset-right));
}
.section { padding: var(--s7) 0; }
.section-head { max-width: 40ch; margin-bottom: var(--s5); }
.section-head h2 { margin-bottom: var(--s1); }
.section-head p { color: var(--ink-soft); margin: 0; }

/* ---------- Hero: tipografico, la foto si aggiunge da tablet in su ---------- */
.hero { padding: var(--s6) 0 var(--s2); text-align: center; }
.hero-inner { display: grid; gap: var(--s6); align-items: center; }
.ornament { display: block; width: 28px; height: 1px; margin: 0 auto var(--s4); background: var(--gold); position: relative; }
.ornament::after {
  content: ""; position: absolute; left: 50%; top: 50%; width: 5px; height: 5px;
  background: var(--gold); transform: translate(-50%, -50%) rotate(45deg);
}
.hero-title {
  font-style: italic; font-size: clamp(2.25rem, 9.6vw, 4rem); line-height: 1.06;
  max-width: 16ch; margin: 0 auto var(--s4); text-wrap: balance;
}
.hero-cta {
  display: inline-flex; align-items: center; gap: var(--s2); min-height: var(--tap);
  font-size: .75rem; font-weight: 500; letter-spacing: .12em; text-transform: uppercase;
  color: var(--accent); text-decoration: none;
}
.hero-cta span:first-child { border-bottom: 1px solid currentColor; padding-bottom: 2px; }
.hero-cta:hover { color: var(--ink); }
.hero-media { display: none; margin: 0; }
.hero-media img { display: block; width: 100%; height: 100%; object-fit: cover; border-radius: var(--radius); }

/* ===================================================================
   Menù: griglia a 2 colonne sul telefono
   =================================================================== */
.section-menu { padding-top: var(--s5); }
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s6) var(--s3); }
.grid > p { grid-column: 1 / -1; }

/* ---------- Card prodotto (struttura di destinazione, vedi css-contract) ---------- */
.card { position: relative; display: flex; flex-direction: column; min-width: 0; }
.card-media {
  /* le foto sono 4:3 su fondo bianco: quadrato bianco e foto intera (niente tagli) */
  position: relative; aspect-ratio: 1 / 1; overflow: hidden;
  background: #fff; border-radius: var(--radius);
}
.card-open {
  display: block; width: 100%; height: 100%; padding: 0; border: 0; background: none;
  cursor: pointer; border-radius: inherit;
}
.card-open:focus-visible { outline-offset: -2px; }
.card-media img, .card-img {
  display: block; width: 100%; height: 100%; object-fit: contain;
  /* la foto sta sopra la fascia del "+": il pulsante non copre mai il prodotto */
  padding-bottom: calc(var(--tap) + var(--s2));
  transition: transform .6s var(--ease);
}
@media (hover: hover) { .card-open:hover img { transform: scale(1.03); } }
/* segnaposto senza foto: il nome in corsivo su crema scura */
.card-placeholder {
  position: absolute; inset: 0; display: grid; place-items: center; padding: var(--s4);
  background: var(--surface-2); color: var(--ink-soft);
  font-family: var(--serif); font-style: italic; font-size: 1.25rem; line-height: 1.2; text-align: center;
}
.card-badge {
  position: absolute; top: var(--s2); left: var(--s2); z-index: 2; pointer-events: none;
  padding: var(--s1) var(--s2); background: var(--surface); color: var(--ink);
  font-size: .6875rem; font-weight: 500; letter-spacing: .12em; text-transform: uppercase; line-height: 1.3;
  border-radius: var(--radius);
}
.card-action { position: absolute; right: var(--s2); bottom: var(--s2); z-index: 2; }
.add-square {
  display: grid; place-items: center; width: var(--tap); height: var(--tap);
  padding: 0; border: 0; border-radius: var(--radius); cursor: pointer;
  background: var(--surface); color: var(--ink); box-shadow: var(--shadow-soft);
  transition: background-color .2s var(--ease), color .2s var(--ease), transform .15s var(--ease);
}
.add-square:hover { background: var(--ink); color: var(--surface); }
.add-square:active { transform: scale(.94); }
.add-square svg.icon { width: 20px; height: 20px; stroke-width: 1.6; }

/* stepper compatto "− n +": scuro sopra la foto; .stepper-light nel carrello e nella scheda */
.stepper {
  display: inline-flex; align-items: center; height: var(--tap);
  background: var(--ink); color: var(--surface); border-radius: var(--radius);
  box-shadow: var(--shadow-soft); font-variant-numeric: tabular-nums;
}
.stepper button {
  width: var(--tap); height: var(--tap); padding: 0; border: 0; background: none; color: inherit;
  font-size: 1.125rem; line-height: 1; cursor: pointer; display: grid; place-items: center;
}
.stepper button:disabled { opacity: .35; cursor: not-allowed; }
.stepper output { min-width: 1.5rem; text-align: center; font-size: .9375rem; font-weight: 500; }
.stepper.stepper-light { background: var(--surface); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line); }
.stepper.stepper-light button:hover { color: var(--accent); }

.card-text { display: grid; gap: 2px; padding-top: var(--s3); }
.card-title[data-open] { cursor: pointer; }
.card-title {
  margin: 0; font-family: var(--serif); font-weight: 500; font-size: 1.1875rem; line-height: 1.15;
  text-wrap: balance; overflow-wrap: anywhere;
}
.card-sub {
  margin: 0; font-size: .8125rem; line-height: 1.4; color: var(--ink-soft);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.card-price { margin: var(--s1) 0 0; font-size: .9375rem; font-weight: 500; font-variant-numeric: lining-nums tabular-nums; }
.card-unit { font-weight: 400; color: var(--ink-soft); }
.card select { margin-top: var(--s2); font-size: .875rem; padding: .5rem .6rem; min-height: var(--tap); }

/* stati */
.card.is-soon .card-media img { filter: saturate(.6); opacity: .7; }
.card.is-soon .card-price { color: var(--ink-soft); font-weight: 400; font-style: italic; font-family: var(--serif); font-size: 1.0625rem; }
.card.is-sold-out .card-media img { filter: grayscale(1); opacity: .55; }
.card.is-sold-out .card-price { color: var(--ink-soft); }
.card.in-cart .card-media { outline: 1px solid var(--ink); outline-offset: -1px; }

/* galleria di più foto: si scorre col dito, frecce su schermi grandi */
.gallery {
  position: absolute; inset: 0; display: flex; overflow-x: auto; overflow-y: hidden;
  scroll-snap-type: x mandatory; scrollbar-width: none; -webkit-overflow-scrolling: touch;
}
.gallery::-webkit-scrollbar { display: none; }
.gallery img { flex: 0 0 100%; width: 100%; height: 100%; object-fit: contain; scroll-snap-align: start; }
.gal-nav {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 1;
  width: var(--tap); height: var(--tap); border: 0; border-radius: var(--radius);
  background: rgba(255, 253, 249, .9); color: var(--ink); font-size: 1.4rem; line-height: 1;
  cursor: pointer; opacity: 0; transition: opacity .2s var(--ease);
}
.gal-nav.prev { left: var(--s2); }
.gal-nav.next { right: var(--s2); }
.card-media:hover .gal-nav, .sheet-media:hover .gal-nav, .gal-nav:focus-visible { opacity: 1; }
@media (pointer: coarse) { .gal-nav { display: none; } }
.gal-dots { position: absolute; bottom: var(--s2); left: 0; right: 0; display: flex; justify-content: center; gap: 6px; pointer-events: none; }
.gal-dots span { width: 6px; height: 6px; border-radius: 50%; background: rgba(255, 253, 249, .55); box-shadow: 0 0 2px rgba(0, 0, 0, .3); }
.gal-dots span.on { background: var(--surface); }

/* ===================================================================
   Come funziona: elenco leggero, niente riquadri
   =================================================================== */
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s5); counter-reset: none; }
.steps li { display: grid; grid-template-columns: 32px 1fr; gap: var(--s3); align-items: baseline; }
.steps .num {
  font-family: var(--serif); font-style: italic; font-weight: 500; font-size: 1.75rem; line-height: 1;
  color: var(--accent); font-variant-numeric: lining-nums tabular-nums;
}
.steps h3 { margin: 0 0 2px; font-size: 1rem; }
.steps p { margin: 0; color: var(--ink-soft); font-size: .9375rem; }

/* ===================================================================
   Ritiro e pagamento
   =================================================================== */
.section-info { background: var(--surface); }
.info-grid { display: grid; gap: var(--s7); }
.info-block h2 { font-size: 1.875rem; margin-bottom: var(--s4); }
.info-block .label { margin-top: var(--s5); }
.address { font-size: 1.0625rem; margin-bottom: var(--s2); }
.slot-list li { padding: var(--s1) 0; }
.pay-list { display: grid; gap: var(--s4); margin-bottom: var(--s4); }
.pay-list strong { display: block; font-weight: 500; }
.pay-list span { color: var(--ink-soft); font-size: .9375rem; }
.info-block > p:last-child { margin-bottom: 0; }

/* ===================================================================
   Footer
   =================================================================== */
.footer { background: var(--ink); color: var(--bg); padding: var(--s7) 0 calc(var(--s7) + env(safe-area-inset-bottom)); font-size: .9375rem; }
.footer-inner { display: grid; gap: var(--s5); }
.footer-brand { font-family: var(--serif); font-weight: 500; font-size: 1.5rem; line-height: 1.2; margin: 0; }
.footer-cols { display: grid; gap: var(--s5); }
.footer .label { color: rgba(246, 241, 232, .72); }
.footer p { margin: 0 0 var(--s1); color: rgba(246, 241, 232, .9); }
.footer ul li { color: rgba(246, 241, 232, .9); }
.footer .link { color: var(--bg); }
.footer .link:hover { color: var(--gold); }
.footer-cols > div:empty { display: none; }

/* ===================================================================
   Barra del carrello (solo telefono): "Tu pedido · 3 — $550"
   =================================================================== */
.cart-bar {
  position: fixed; left: var(--s3); right: var(--s3); bottom: calc(var(--s3) + env(safe-area-inset-bottom)); z-index: 25;
  display: none; align-items: center; justify-content: space-between; gap: var(--s4);
  min-height: 56px; padding: 0 var(--gutter);
  border: 0; border-radius: var(--radius); background: var(--ink); color: var(--bg);
  box-shadow: var(--shadow-float);
  font-family: var(--sans); font-size: .9375rem; font-weight: 500; text-align: left; cursor: pointer;
  animation: rise .35s var(--ease) both;
}
.cart-bar .dot { opacity: .5; margin: 0 2px; }
.cart-bar-total { font-variant-numeric: lining-nums tabular-nums; letter-spacing: .02em; }
.cart-bar-total::after { content: " \2192"; opacity: .7; }

/* ===================================================================
   Scheda prodotto (bottom sheet)
   =================================================================== */
.sheet-backdrop, .drawer-backdrop { position: fixed; inset: 0; background: rgba(43, 33, 28, .42); }
.sheet-backdrop { z-index: 40; }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 41;
  display: flex; flex-direction: column; max-height: 92dvh;
  background: var(--bg); border-radius: var(--radius) var(--radius) 0 0; overflow: hidden;
  transform: translateY(100%); visibility: hidden;
  transition: transform .32s var(--ease), visibility 0s linear .32s;
}
.sheet.open { transform: none; visibility: visible; transition: transform .32s var(--ease); }
.sheet-close { position: absolute; top: var(--s2); right: var(--s2); z-index: 3; background: rgba(255, 253, 249, .92); }
.sheet-scroll { flex: 1; overflow-y: auto; overscroll-behavior: contain; }
.sheet-media { position: relative; aspect-ratio: 4 / 3; max-height: 52dvh; width: 100%; background: #fff; overflow: hidden; }
.sheet-media > img { display: block; width: 100%; height: 100%; object-fit: contain; }
.sheet-body { padding: var(--s5) var(--gutter) var(--s4); }
.sheet-title { font-size: 2rem; margin: 0 0 var(--s1); }
.sheet-sub { color: var(--ink-soft); margin: 0 0 var(--s3); }
.sheet-price { font-weight: 500; font-variant-numeric: lining-nums tabular-nums; margin: 0 0 var(--s4); }
.sheet-price .card-unit { font-weight: 400; }
.sheet-desc { color: var(--ink-soft); margin: 0 0 var(--s4); }
.sheet-variants { display: grid; gap: var(--s2); }
.sheet-variants:empty { display: none; }
.sheet-foot {
  display: flex; gap: var(--s3); align-items: center;
  padding: var(--s3) var(--gutter) calc(var(--s3) + env(safe-area-inset-bottom));
  background: var(--bg); box-shadow: 0 -1px 0 var(--line);
}
.sheet-foot .btn { flex: 1; }
.sheet-foot:empty { display: none; }

/* ===================================================================
   Pannello ordine (drawer): 3 blocchi + invio fisso in basso
   =================================================================== */
.drawer-backdrop { z-index: 30; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 31; width: 100%;
  display: flex; flex-direction: column; background: var(--bg);
  transform: translateX(100%);
  /* da chiuso è invisibile anche a tastiera e lettori di schermo (dopo l'animazione) */
  visibility: hidden; transition: transform .32s var(--ease), visibility 0s linear .32s;
}
.drawer.open { transform: translateX(0); visibility: visible; transition: transform .32s var(--ease); }
.drawer-head {
  flex: none; display: flex; align-items: center; justify-content: space-between; gap: var(--s3);
  height: var(--header-h); padding: 0 var(--s2) 0 var(--gutter);
}
.drawer-head h2 { margin: 0; font-size: 1.625rem; }
.drawer-body { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: var(--s2) var(--gutter) 0; }
.drawer-body > div:not(.checkout) { padding-bottom: calc(var(--s6) + env(safe-area-inset-bottom)); }

.empty { text-align: center; padding: var(--s8) var(--s4); display: grid; gap: var(--s5); justify-items: center; }
.empty p { font-family: var(--serif); font-style: italic; font-size: 1.5rem; margin: 0; color: var(--ink-soft); }

.checkout { display: grid; gap: var(--s6); }
.block { display: grid; gap: var(--s4); min-width: 0; }
#order-form { display: grid; gap: var(--s6); }
.block-title {
  display: flex; align-items: baseline; gap: var(--s3); margin: 0;
  font-family: var(--serif); font-weight: 500; font-size: 1.5rem; line-height: 1.2;
}
.block-num { font-style: italic; color: var(--accent); font-size: 1.25rem; min-width: 1ch; font-variant-numeric: lining-nums tabular-nums; }
.sub-title { margin: var(--s2) 0 calc(var(--s2) * -1); font-size: .75rem; font-weight: 500; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-soft); }
#method-box, #address-box { display: grid; gap: var(--s4); }
/* punto di ritiro dentro al pannello (solo con "Paso a recogerlo") */
.pickup-hint { display: grid; gap: var(--s1); margin-top: calc(var(--s2) * -1); }
.pickup-hint p { margin: 0; }
.pickup-hint p:empty { display: none; }
.pickup-address { font-size: .9375rem; }
.pickup-hint .link-tap { justify-self: start; margin: calc(var(--s2) * -1) 0; }

/* campi del modulo: fondo avorio e riga di base, niente riquadri */
.field { display: grid; gap: 6px; min-width: 0; margin: 0; padding: 0; border: 0; }
.field-label, legend.field-label { font-size: .875rem; font-weight: 500; color: var(--ink); padding: 0; margin: 0 0 6px; }
label.field > .field-label { margin: 0; }
.field input[type="text"], .field input[type="tel"], .field input[type="date"], .field textarea, .field select {
  min-height: 48px; padding: var(--s3); font-size: 1rem;
  background: var(--surface); border: 0; border-bottom: 1px solid var(--ink-soft);
  border-radius: var(--radius) var(--radius) 0 0;
  transition: border-color .2s var(--ease), box-shadow .2s var(--ease);
}
.field input:focus, .field textarea:focus, .field select:focus { border-bottom-color: var(--accent); box-shadow: inset 0 -1px 0 var(--accent); }
.field textarea { min-height: 72px; }
.field [aria-invalid="true"] { border-bottom-color: var(--danger) !important; box-shadow: inset 0 -1px 0 var(--danger); }
.field-error { margin: calc(var(--s2) * -1) 0 0; color: var(--danger); font-size: .875rem; }
.trap { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* controllo segmentato: "Recoger | Envío +$80", "Efectivo | Transferencia" */
.segmented {
  display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: var(--s1);
  padding: var(--s1); background: var(--surface-2); border-radius: var(--radius);
}
.segmented .seg {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center;
  min-height: var(--tap); padding: var(--s2) var(--s3); border-radius: var(--radius);
  font-size: .9375rem; font-weight: 500; line-height: 1.25; text-align: center; color: var(--ink-soft);
  cursor: pointer; transition: background-color .2s var(--ease), color .2s var(--ease);
}
.segmented .seg input {
  position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer;
}
.segmented .seg:has(input:checked) { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-soft); }
.segmented .seg:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.segmented .seg:has(input:disabled) { opacity: .45; cursor: not-allowed; }
.segmented .seg:has(input:disabled) input { cursor: not-allowed; }
.segmented .seg:has(input[aria-invalid="true"]) { box-shadow: inset 0 0 0 1px var(--danger); }
.seg-extra { display: block; font-size: .8125rem; font-weight: 400; color: var(--accent); }
.seg-extra:empty { display: none; }

/* chip delle date: i prossimi giorni disponibili, scorrono in orizzontale */
.date-field { display: grid; gap: var(--s2); min-width: 0; }
.date-field.has-chips > label.field { display: none; }
.date-chips {
  display: flex; gap: var(--s2); overflow-x: auto; scroll-snap-type: x proximity;
  margin: 0 calc(var(--gutter) * -1); padding: 2px var(--gutter) var(--s1); scroll-padding-inline: var(--gutter);
  scrollbar-width: none;
}
.date-chips::-webkit-scrollbar { display: none; }
.chip {
  position: relative; flex: 0 0 auto; width: 64px; min-height: 76px;
  display: grid; align-content: center; justify-items: center; gap: 2px; padding: var(--s2) 0;
  background: var(--surface); color: var(--ink); border-radius: var(--radius);
  box-shadow: inset 0 0 0 1px var(--line); cursor: pointer; scroll-snap-align: start;
  transition: background-color .2s var(--ease), color .2s var(--ease);
}
.chip input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.chip-dow, .chip-mon { font-size: .6875rem; font-weight: 500; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-soft); line-height: 1.2; }
.chip-day { font-family: var(--serif); font-size: 1.625rem; font-weight: 500; line-height: 1; font-variant-numeric: lining-nums tabular-nums; }
.chip:has(input:checked) { background: var(--ink); color: var(--bg); box-shadow: none; }
.chip:has(input:checked) .chip-dow, .chip:has(input:checked) .chip-mon { color: rgba(246, 241, 232, .8); }
.chip:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.chip:has(input[aria-invalid="true"]) { box-shadow: inset 0 0 0 1px var(--danger); }
.chip-more { /* "Otra fecha": stesso formato, apre il selettore nativo */
  flex: 0 0 auto; width: 76px; min-height: 76px; padding: var(--s2);
  border: 0; border-radius: var(--radius); background: transparent; color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--line); cursor: pointer;
  font-size: .75rem; font-weight: 500; letter-spacing: .08em; text-transform: uppercase; line-height: 1.3;
}

/* orari: elenco a righe; con un solo orario diventa testo semplice */
.options { display: grid; gap: var(--s2); }
.options .option {
  position: relative; display: flex; align-items: center; gap: var(--s3);
  min-height: 48px; padding: var(--s3) var(--s4); border-radius: var(--radius);
  background: var(--surface); cursor: pointer; font-size: .9375rem;
}
.options .option input { accent-color: var(--ink); width: 18px; height: 18px; margin: 0; flex: none; }
.options .option:has(input:checked) { box-shadow: inset 0 0 0 1.5px var(--ink); }
.options .option:has(input[aria-invalid="true"]) { box-shadow: inset 0 0 0 1px var(--danger); }
.slot-field .options:has(> .option:only-child) .option { min-height: 0; padding: 0; background: none; box-shadow: none; cursor: default; font-size: 1rem; }
.slot-field .options:has(> .option:only-child) .option input { position: absolute; opacity: 0; pointer-events: none; }

/* ---------- Righe del carrello ---------- */
.cart-items { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s4); }
.cart-item {
  display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s1) var(--s3); align-items: center;
}
/* struttura di destinazione: miniatura 56px | nome, variante, stepper | importo e rimuovi */
.cart-item:has(.ci-thumb) { grid-template-columns: 56px minmax(0, 1fr) auto; align-items: start; }
.ci-thumb { width: 56px; height: 70px; object-fit: cover; border-radius: var(--radius); background: var(--surface); display: block; }
.ci-info { display: grid; gap: 2px; min-width: 0; }
.ci-info .stepper { margin-top: var(--s2); justify-self: start; }
.ci-end { display: grid; justify-items: end; align-content: space-between; min-height: 70px; }
.cart-item .ci-name { font-family: var(--serif); font-weight: 500; font-size: 1.125rem; line-height: 1.2; margin: 0; overflow-wrap: anywhere; }
.cart-item .ci-variant { font-size: .8125rem; color: var(--ink-soft); margin: 0; }
.cart-item .ci-variant:empty { display: none; }
.cart-item .ci-sub { font-size: .9375rem; font-weight: 500; font-variant-numeric: lining-nums tabular-nums; text-align: right; }
/* struttura attuale: nome, poi riga con quantità, importo e rimuovi */
.cart-item .ci-right { display: flex; align-items: center; gap: var(--s3); }
.cart-item .ci-right .ci-sub { margin-left: auto; }
.remove {
  display: grid; place-items: center; width: var(--tap); height: var(--tap); margin-right: calc(var(--s3) * -1);
  padding: 0; border: 0; background: none; color: var(--ink-soft); cursor: pointer; font-size: 1.5rem; line-height: 1;
}
.remove:hover { color: var(--danger); }
.remove svg.icon { width: 18px; height: 18px; }

/* ---------- Riepilogo, errori, invio ---------- */
.summary { display: grid; gap: var(--s2); padding-top: var(--s5); border-top: 1px solid var(--line); }
.summary-row { display: flex; justify-content: space-between; align-items: baseline; gap: var(--s4); color: var(--ink-soft); font-size: .9375rem; font-variant-numeric: lining-nums tabular-nums; }
.summary-total { color: var(--ink); font-size: 1rem; font-weight: 500; }
.summary-total strong { font-family: var(--serif); font-weight: 500; font-size: 1.75rem; line-height: 1; font-variant-numeric: lining-nums tabular-nums; }
#order-form[hidden] ~ .submit-bar { display: none; }
.submit-bar {
  position: sticky; bottom: 0; z-index: 2;
  margin: calc(var(--s4) * -1) calc(var(--gutter) * -1) 0;
  padding: var(--s3) var(--gutter) calc(var(--s3) + env(safe-area-inset-bottom));
  background: var(--bg); box-shadow: 0 -10px 16px -12px rgba(43, 33, 28, .18);
}
.submit-bar .btn { font-variant-numeric: lining-nums tabular-nums; }
.submit-total { opacity: .85; }
.submit-total::before { content: "·"; margin: 0 var(--s2); opacity: .7; }
.submit-note { text-align: center; margin-top: var(--s2); }
.submit-note:empty { display: none; }
.notice-box { margin: 0; padding: var(--s4); background: var(--surface); border-radius: var(--radius); text-align: center; }

/* dati bancari */
.bank-box { background: var(--surface); border-radius: var(--radius); padding: var(--s4); font-size: .9375rem; }
.bank-title { font-weight: 500; margin: 0 0 var(--s3); }
.bank-box dl, .done-summary dl { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: var(--s2) var(--s4); margin: 0 0 var(--s3); align-items: center; }
.bank-box dt, .done-summary dt { color: var(--ink-soft); font-size: .875rem; }
.bank-box dd, .done-summary dd { margin: 0; min-width: 0; }
.bank-box dd, .done-summary dd:has(.copy) { display: flex; align-items: center; justify-content: space-between; gap: var(--s2); flex-wrap: nowrap; }
.bank-box code, .done-summary code { min-width: 0; overflow-wrap: anywhere; }
.bank-box .copy, .done-summary .copy { flex: none; padding: 0 var(--s2); }
.copy {
  display: inline-flex; align-items: center; min-height: var(--tap); padding: 0 var(--s3); margin: -6px 0;
  border: 0; background: none; color: var(--accent); cursor: pointer; border-radius: var(--radius);
  font-size: .75rem; font-weight: 500; letter-spacing: .12em; text-transform: uppercase;
}
.copy:hover { color: var(--ink); }

/* ---------- Conferma ---------- */
.done { text-align: center; padding: var(--s6) 0; display: grid; gap: var(--s2); justify-items: center; }
.done-kicker { font-size: .75rem; font-weight: 500; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-soft); margin: 0; }
.done-id { /* numero d'ordine da copiare come concepto: chiaro, senza numeri "antichi" */
  font-family: var(--sans); font-weight: 500; font-size: 1.75rem; line-height: 1.2; letter-spacing: .06em;
  font-variant-numeric: lining-nums tabular-nums; margin: 0 0 var(--s2);
}
.done-id:focus { outline: none; }
.done > p { color: var(--ink-soft); max-width: 34ch; margin: 0; }
.done-summary { width: 100%; text-align: left; background: var(--surface); border-radius: var(--radius); padding: var(--s4); margin: var(--s5) 0 var(--s3); font-size: .9375rem; }
.done-summary dl { margin: 0; }
/* righe dell'ordine nella conferma: "2 × El Reno   $300" */
.done-items { list-style: none; margin: 0 0 var(--s3); padding: 0 0 var(--s3); border-bottom: 1px solid var(--line-soft); display: grid; gap: var(--s1); }
.done-items li { display: flex; justify-content: space-between; gap: var(--s4); font-variant-numeric: lining-nums tabular-nums; }
.done-items li span:last-child { flex: none; }
.done-bank { margin-top: var(--s4); padding-top: var(--s4); border-top: 1px solid var(--line-soft); }
.done-bank-title { font-weight: 500; margin: 0 0 var(--s3); }
.done-bank .muted { margin: var(--s3) 0 0; font-size: .875rem; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: calc(var(--s5) + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 50;
  max-width: calc(100vw - 2 * var(--gutter));
  background: var(--ink); color: var(--bg); padding: var(--s3) var(--s4); border-radius: var(--radius);
  font-size: .9375rem; box-shadow: var(--shadow-float);
  animation: toast-in .25s var(--ease) both;
}
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 8px); } to { opacity: 1; transform: translate(-50%, 0); } }

/* ===================================================================
   Solo telefono: la barra in basso è l'unico accesso al carrello con articoli
   =================================================================== */
@media (max-width: 759px) {
  .cart-bar { display: flex; }
  body.has-cart-bar { padding-bottom: calc(56px + var(--s5) + env(safe-area-inset-bottom)); }
  body.has-cart-bar .toast { bottom: calc(56px + var(--s5) + env(safe-area-inset-bottom)); }
  /* niente doppio contatore: con la barra visibile la borsa in alto resta senza numero */
  body.has-cart-bar .bag-btn .count { display: none; }
}

/* ===================================================================
   Tablet e desktop
   =================================================================== */
@media (min-width: 760px) {
  :root { --gutter: 32px; }
  /* logo, lingua e borsa allineati alla colonna dei contenuti */
  .topbar {
    grid-template-columns: minmax(0, 1fr) minmax(0, 2fr) minmax(0, 1fr);
    padding-inline: max(var(--gutter), env(safe-area-inset-left), calc((100% - var(--page)) / 2 + var(--gutter)))
                    max(var(--gutter), env(safe-area-inset-right), calc((100% - var(--page)) / 2 + var(--gutter)));
  }
  .brand { font-size: 20px; }
  .lang-switch button.active { display: inline-block; color: var(--ink); text-decoration: underline; text-underline-offset: 6px; }
  .section { padding: var(--s8) 0; }
  .section-head { margin-bottom: var(--s6); }

  .hero { padding: var(--s7) 0 var(--s5); text-align: left; }
  .hero-inner { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--s7); }
  .hero .ornament { margin-left: 0; }
  .hero-title { margin-left: 0; max-width: 14ch; font-size: clamp(3rem, 4.8vw, 4.25rem); }
  .hero-media { display: block; aspect-ratio: 4 / 3; max-height: 440px; }
  .section-menu { padding-top: var(--s7); }

  .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s7) var(--s5); }
  .card-title { font-size: 1.375rem; }
  .card-sub { font-size: .875rem; }

  .steps { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--s6); }
  .steps li { grid-template-columns: 1fr; gap: var(--s2); align-items: start; }
  .steps .num { font-size: 2.25rem; }

  .info-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s8); }
  .footer-inner { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: var(--s7); }
  .footer-cols { grid-template-columns: repeat(3, minmax(0, 1fr)); }

  .drawer { width: min(480px, 100%); box-shadow: var(--shadow-float); }

  /* la scheda prodotto diventa una finestra centrata con foto e testo affiancati */
  .sheet {
    left: 50%; right: auto; top: 50%; bottom: auto; width: min(880px, calc(100vw - 64px)); max-height: min(640px, calc(100dvh - 64px));
    border-radius: var(--radius); box-shadow: var(--shadow-float);
    transform: translate(-50%, -46%); opacity: 0;
    transition: transform .32s var(--ease), opacity .32s var(--ease), visibility 0s linear .32s;
  }
  .sheet.open { transform: translate(-50%, -50%); opacity: 1; transition: transform .32s var(--ease), opacity .32s var(--ease); }
  .sheet-scroll { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .sheet-media { aspect-ratio: 4 / 5; max-height: none; }
  .sheet-body { padding: var(--s7) var(--s6) var(--s5); }
  .sheet-foot { justify-content: flex-end; }
  .sheet-foot .btn { flex: 0 1 50%; }
}

@media (min-width: 1400px) {
  .grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* Schermi tattili: nessuno zoom involontario quando si tocca un campo (iOS sotto i 16px) */
@media (pointer: coarse) {
  input[type="text"], input[type="tel"], input[type="date"], textarea, select { font-size: 16px; }
}

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

/* ---------- Logo e identità (molecola dello zucchero) ---------- */
.brand-logo { display: flex; align-items: center; justify-content: center; padding: 0; transition: opacity .5s var(--ease), visibility .5s; }
.brand-logo img { display: block; height: 28px; width: auto; max-width: 100%; }
/* finché il logo grande è in vista, quello piccolo in alto non serve (e non si raggiunge col Tab) */
.has-intro:not(.past-hero) .topbar .brand-logo { opacity: 0; visibility: hidden; pointer-events: none; }
.has-intro:not(.past-hero) .topbar { background: transparent; -webkit-backdrop-filter: none; backdrop-filter: none; }

/* Apertura: il logo occupa il primo schermo, il menu arriva scorrendo */
.hero {
  /* esattamente un primo schermo: solo il logo, il menù arriva scorrendo.
     svh = altezza con la barra del browser visibile, così niente salti */
  min-height: calc(100vh - var(--header-h));
  min-height: calc(100svh - var(--header-h)); display: flex; align-items: center;
  padding: var(--s6) 0 var(--s7); text-align: center; position: relative;
}
.hero .hero-inner { display: flex; flex-direction: column; align-items: center; gap: 0; width: 100%; }
.hero-brand { margin: 0 0 var(--s6); line-height: 0; }
.hero-mark { display: block; width: min(48vw, 220px); height: auto; margin: 0 auto var(--s5); }
.hero-word { display: block; width: min(80vw, 380px); height: auto; margin: 0 auto; }
.hero .hero-title {
  font-family: var(--serif); font-style: italic; font-weight: 500; color: var(--ink-soft);
  font-size: clamp(1.25rem, 5vw, 1.75rem); line-height: 1.3; max-width: 24ch; margin: 0 auto; text-wrap: balance;
}
.hero .hero-cta { position: absolute; left: 50%; bottom: var(--s5); transform: translateX(-50%); white-space: nowrap; font-size: .8125rem; }
.hero .hero-cta span:last-child { display: inline-block; animation: nudge 2.4s var(--ease) 1.6s infinite; }

@keyframes form { from { clip-path: inset(0 100% 0 0); opacity: .2; } to { clip-path: inset(0 0 0 0); opacity: 1; } }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes nudge { 0%, 60%, 100% { transform: none; } 30% { transform: translateY(5px); } }
.hero-mark { animation: form .9s var(--ease) .05s both; }
.hero-word { animation: rise .7s var(--ease) .5s both; }
.hero .hero-title { animation: rise .7s var(--ease) .75s both; }
.hero .hero-cta { animation: fade .6s ease 1s both; }

/* "legame" della molecola: linea — atomo — linea, sopra i titoli di sezione */
/* firma dei titoli: il saccarosio in miniatura, stesso disegno della formula
   (anelli di Haworth, bordo anteriore pieno, ossigeni ad anello) */
.bond {
  display: block; width: 76px; height: 36px; margin-bottom: var(--s3);
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 72 34' fill='none' stroke='%23075461' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 6h6.6M23.4 6 30 16M4 16l8-10' stroke-width='1.3'/%3E%3Cpath d='M30 16l-6 11M12 27 4 16' stroke-width='2'/%3E%3Cpath d='M12 27h12' stroke-width='3.4'/%3E%3Ccircle cx='21' cy='6' r='2.4' stroke-width='1.3'/%3E%3Cpath d='M30 16v6.5l3.2 3.4M38.6 26.2 44 15' stroke-width='1.3'/%3E%3Ccircle cx='35.9' cy='27.6' r='2.4' stroke-width='1.3'/%3E%3Cpath d='M44 15l7.4-6.6M56.6 8.4 64 15' stroke-width='1.3'/%3E%3Ccircle cx='54' cy='7' r='2.4' stroke-width='1.3'/%3E%3Cpath d='M64 15l-4 12M48 27l-4-12' stroke-width='2'/%3E%3Cpath d='M48 27h12' stroke-width='3.4'/%3E%3C/svg%3E") left center / contain no-repeat;
}
/* ogni sezione ha il suo zucchero: saccarosio, glucosio, fruttosio, maltosio */
.bond-glucose { width: 36px; height: 38px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 -3 36 38' fill='none' stroke='%23075461' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M14 6H19.6M24.4 6L31 16M5 16L14 6' stroke-width='1.3'/%3E%3Cpath d='M31 16L25 27M13 27L5 16' stroke-width='2'/%3E%3Cpath d='M13 27H25' stroke-width='3.4'/%3E%3Ccircle cx='22' cy='6' r='2.4' stroke-width='1.3'/%3E%3Cpath d='M14 6V0M5 16v7M25 27v6M31 16v7' stroke-width='1.3'/%3E%3C/svg%3E"); }
.bond-fructose { width: 40px; height: 38px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 -3 40 38' fill='none' stroke='%23075461' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 15l8.4-7.6M21.6 7.4 30 15' stroke-width='1.3'/%3E%3Ccircle cx='18' cy='6' r='2.4' stroke-width='1.3'/%3E%3Cpath d='M30 15l-4 12M10 27 6 15' stroke-width='2'/%3E%3Cpath d='M10 27h16' stroke-width='3.4'/%3E%3Cpath d='M6 15V5M30 15v9M10 27v6' stroke-width='1.3'/%3E%3C/svg%3E"); }
.bond-maltose { width: 78px; height: 36px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 78 36' fill='none' stroke='%23075461' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M13 6H18.6M23.4 6L30 16M4 16L13 6' stroke-width='1.3'/%3E%3Cpath d='M30 16L24 27M12 27L4 16' stroke-width='2'/%3E%3Cpath d='M12 27H24' stroke-width='3.4'/%3E%3Ccircle cx='21' cy='6' r='2.4' stroke-width='1.3'/%3E%3Cpath d='M30 16l3.6 8.6M40.4 24.6 44 16' stroke-width='1.3'/%3E%3Ccircle cx='37' cy='27' r='2.4' stroke-width='1.3'/%3E%3Cpath d='M53 6H58.6M63.4 6L70 16M44 16L53 6' stroke-width='1.3'/%3E%3Cpath d='M70 16L64 27M52 27L44 16' stroke-width='2'/%3E%3Cpath d='M52 27H64' stroke-width='3.4'/%3E%3Ccircle cx='61' cy='6' r='2.4' stroke-width='1.3'/%3E%3C/svg%3E"); }

/* Comparsa morbida di titoli e prodotti (solo con JS attivo) */
.js-reveal .reveal { opacity: 0; transform: translateY(22px); transition: opacity 1s var(--ease), transform 1s var(--ease); transition-delay: var(--d, 0s); }
.js-reveal .reveal.is-in { opacity: 1; transform: none; }

.footer-brand { display: flex; flex-direction: column; align-items: flex-start; gap: var(--s3); line-height: 0; }
.footer-mark { width: 64px; height: auto; opacity: .9; }
.footer-word { width: 170px; height: auto; }

@media (min-width: 760px) {
  .brand-logo img { height: 32px; }
  .hero { text-align: center; padding-top: var(--s7); }
  /* su schermi bassi (portatili) il logo si adatta all'altezza: tutto sta nel primo schermo */
  .hero-mark { width: min(250px, 28vh); }
  .hero-word { width: min(440px, 50vh); }
  .hero { padding-bottom: calc(var(--s7) + var(--s5)); }
  .hero .hero-title { margin: 0 auto; max-width: 26ch; font-size: 1.875rem; }
}
@media (prefers-reduced-motion: reduce) {
  .hero-mark, .hero-word, .hero .hero-title, .hero .hero-cta, .hero .hero-cta span:last-child { animation: none; }
  .js-reveal .reveal { opacity: 1; transform: none; transition: none; }
}

/* ===================================================================
   Dettagli "zucchero" (identità: la molecola)
   =================================================================== */
.hero { overflow: hidden; isolation: isolate; }
/* numeri di "Cómo funciona" dentro l'anello esagonale dello zucchero */
.steps li { align-items: center; }
.steps .num {
  display: grid; place-items: center; width: 40px; height: 44px; font-size: 1.25rem; font-style: normal;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 44'%3E%3Cpath d='M20 2 37 12v20L20 42 3 32V12Z' fill='none' stroke='%23075461' stroke-width='1.4' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
}
.steps li { grid-template-columns: 40px 1fr; }

/* piè di pagina: grande molecola in filigrana */
.footer { position: relative; overflow: hidden; }
.footer::after {
  content: ""; position: absolute; right: -60px; bottom: -40px; width: 300px; aspect-ratio: 868 / 713;
  background: url("img/logo-mark-cream.svg") center / contain no-repeat; opacity: .05; pointer-events: none;
}

/* ===================================================================
   Natale (solo dal 25 nov al 6 gen, lo attiva app.js): "nieve de azúcar"
   cristalli di zucchero che scendono piano nell'apertura
   =================================================================== */
.sugar-snow { position: absolute; inset: 0; z-index: -1; pointer-events: none; overflow: hidden; }
.sugar-snow i {
  position: absolute; top: -12px; left: var(--x); width: var(--s); height: var(--s);
  background: var(--c); border-radius: 1px; opacity: 0;
  animation: sugar-fall var(--t) linear var(--d) infinite;
}
@keyframes sugar-fall {
  0% { transform: translate3d(0, 0, 0) rotate(0deg); opacity: 0; }
  8% { opacity: var(--o); }
  85% { opacity: var(--o); }
  100% { transform: translate3d(var(--sway), 92svh, 0) rotate(220deg); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .sugar-snow { display: none; }
}

/* ===================================================================
   La molecola: saccarosio a tratto fine, come una tavola scientifica
   =================================================================== */
.section-molecule { padding: var(--s7) 0; }
.molecule-inner { display: flex; flex-direction: column; align-items: center; text-align: center; }
.sucrose { display: block; width: min(100%, 360px); height: auto; color: var(--accent); overflow: visible; margin-bottom: var(--s5); }
.sucrose .bonds path { stroke-width: 1.3; }
.sucrose .bonds .front { stroke-width: 2; }
.sucrose .bonds .thick { stroke-width: 3.4; }
.sucrose .labels { font-family: var(--serif); font-style: italic; font-size: 16px; opacity: .85; }
.molecule-formula { margin: 0 0 var(--s2); color: var(--accent); font-variant-numeric: lining-nums; }
.molecule-formula sub { font-size: .75em; vertical-align: -.2em; line-height: 0; }
.molecule-text { max-width: 34ch; margin: 0 auto; font-family: var(--serif); font-style: italic; font-size: 1.25rem; line-height: 1.4; color: var(--ink-soft); text-wrap: balance; }

/* si disegna quando arriva sullo schermo */
.js-reveal .sucrose .bonds path { stroke-dasharray: 1; stroke-dashoffset: 1; transition: stroke-dashoffset 1.6s var(--ease); }
.js-reveal .sucrose .labels { opacity: 0; transition: opacity 1s ease 1s; }
.js-reveal .sucrose.is-in .bonds path { stroke-dashoffset: 0; }
.js-reveal .sucrose.is-in .labels { opacity: .85; }
.js-reveal .sucrose .bonds path:nth-child(n+6) { transition-delay: .35s; }
.js-reveal .sucrose .bonds path:nth-child(n+12) { transition-delay: .7s; }
@media (min-width: 760px) {
  .section-molecule { padding: var(--s8) 0; }
  .molecule-inner { display: grid; grid-template-columns: auto minmax(0, 28ch); align-items: center; justify-content: center; column-gap: var(--s7); text-align: left; }
  .sucrose { width: 440px; margin: 0; }
  .molecule-caption .molecule-text { margin: 0; font-size: 1.375rem; }
}

/* ===================================================================
   Apertura: la struttura scientifica del saccarosio (spigolosa, tratto
   sottile, OH e CH2OH) si trasforma nel marchio morbido: stesse linee,
   angoli che si arrotondano, spessori che crescono. Movimento in app.js.
   =================================================================== */
.hero-mark { overflow: visible; animation: none; }
.hero-mark path { fill: #024E46; fill-rule: evenodd; }
.hero-mark .mm { display: none; }
.hero-mark.is-morph .mm { display: inline; }
.morph .hero-mark:not(.is-done) .m-final { opacity: 0; }
.hero-mark .mm .o-gly { fill: none; stroke: #024E46; }
.hero-mark .mm line { stroke: #024E46; stroke-width: 7; stroke-linecap: round; }
.hero-mark .mm text { font-family: var(--sans); font-size: 46px; font-weight: 400; fill: #024E46; letter-spacing: .02em; }
.hero-mark .mm .sub2 { font-size: 32px; }
.hero-word { animation-delay: 1.2s; }
.hero .hero-title { animation-delay: 1.45s; }
.hero .hero-cta { animation-delay: 1.8s; }
