/* ==========================================================================
   Duca Merch — foglio di stile condiviso
   ========================================================================== */

:root {
  --verde-950: #071811;
  --verde-900: #0b2118;
  --verde-800: #112e21;
  --verde-700: #1a432f;
  --verde-600: #25583f;
  --crema: #f4eee1;
  --crema-2: #e9e0cc;
  --carta: #faf7f0;
  --oro: #c9a24b;
  --oro-chiaro: #e7cd88;
  --oro-scuro: #8f6f26;
  --inchiostro: #14201a;
  --muto: #5d6a62;
  --linea: rgba(20, 32, 26, .12);
  --errore: #b42318;
  --ok: #2c7a4b;

  --font-display: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  --font-testo: "Manrope", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --raggio: 20px;
  --raggio-s: 12px;
  --ombra: 0 12px 30px -14px rgba(7, 24, 17, .28);
  --ombra-l: 0 40px 80px -30px rgba(7, 24, 17, .45);
  --easing: cubic-bezier(.2, .75, .2, 1);
  --gutter: clamp(16px, 4vw, 48px);
  --max: 1200px;
  --altezza-testata: 72px;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--altezza-testata) + 16px); }
body {
  margin: 0;
  font-family: var(--font-testo);
  font-size: 16px;
  line-height: 1.6;
  color: var(--inchiostro);
  background: var(--carta);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img, svg { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
h1, h2, h3 { margin: 0; }
p { margin: 0 0 1em; }
:focus-visible { outline: 3px solid var(--oro); outline-offset: 3px; border-radius: 6px; }
::selection { background: var(--oro-chiaro); color: var(--verde-950); }

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

.contenitore { width: min(100% - 2 * var(--gutter), var(--max)); margin-inline: auto; }
.display { font-family: var(--font-display); font-weight: 600; line-height: 1; letter-spacing: -.01em; }
.display em { font-style: italic; font-weight: 500; color: var(--oro); }
.sovratitolo {
  font-size: .74rem; font-weight: 800; letter-spacing: .24em; text-transform: uppercase;
  color: var(--oro-scuro); margin: 0 0 1rem;
}
.muto { color: var(--muto); }
.piccolo { font-size: .85rem; }

/* Stemma: PNG trasparente bianco. Su fondo chiaro lo rendiamo verde scuro. */
.stemma { width: auto; height: 100%; user-select: none; -webkit-user-drag: none; }
.stemma--scuro { filter: brightness(0); opacity: .86; }

/* --------------------------------------------------------------------------
   Pulsanti
   -------------------------------------------------------------------------- */
.btn {
  --btn-bg: var(--verde-800); --btn-fg: var(--crema);
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: .6em;
  min-height: 48px; padding: .8em 1.5em;
  border: 0; border-radius: 999px;
  background: var(--btn-bg); color: var(--btn-fg);
  font-weight: 700; font-size: .95rem; letter-spacing: .02em; text-decoration: none;
  transition: transform .25s var(--easing), box-shadow .25s var(--easing), background .25s, opacity .2s;
  overflow: hidden; isolation: isolate;
}
.btn:hover { transform: translateY(-2px); box-shadow: var(--ombra); }
.btn:active { transform: translateY(0); }
.btn[disabled] { opacity: .45; pointer-events: none; }
.btn--primario { --btn-bg: var(--oro); --btn-fg: var(--verde-950); }
.btn--primario:hover { --btn-bg: var(--oro-chiaro); }
.btn--chiaro { --btn-bg: var(--crema); --btn-fg: var(--verde-950); }
.btn--fantasma { --btn-bg: transparent; --btn-fg: currentColor; box-shadow: inset 0 0 0 1.5px currentColor; }
.btn--fantasma:hover { box-shadow: inset 0 0 0 1.5px currentColor, var(--ombra); }
.btn--pieno { width: 100%; }
.btn--piccolo { min-height: 38px; padding: .45em 1.1em; font-size: .85rem; }
.btn .spinner {
  width: 18px; height: 18px; border-radius: 50%;
  border: 2.5px solid currentColor; border-right-color: transparent;
  animation: gira .7s linear infinite; display: none;
}
.btn.in-corso .spinner { display: inline-block; }
@keyframes gira { to { transform: rotate(360deg); } }

/* --------------------------------------------------------------------------
   Testata
   -------------------------------------------------------------------------- */
.testata {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  height: var(--altezza-testata);
  color: var(--crema);
  transition: background .35s, color .35s, box-shadow .35s;
}
.testata__interno {
  height: 100%; display: flex; align-items: center; justify-content: space-between; gap: 1rem;
}
.testata__brand { display: flex; align-items: center; gap: .75rem; text-decoration: none; min-width: 0; }
.testata__brand .stemma { height: 42px; transition: filter .35s; }
.testata__nome { display: flex; flex-direction: column; line-height: 1.1; }
.testata__nome strong { font-family: var(--font-display); font-size: 1.35rem; font-weight: 700; letter-spacing: .01em; }
.testata__nome span { font-size: .66rem; letter-spacing: .2em; text-transform: uppercase; opacity: .75; font-weight: 700; }
.testata__nav { display: flex; align-items: center; gap: .4rem; }
.testata__link {
  padding: .5em .9em; border-radius: 999px; text-decoration: none; font-weight: 600; font-size: .92rem;
  transition: background .2s;
}
.testata__link:hover { background: rgba(255, 255, 255, .1); }
.testata__link[aria-current="page"] { box-shadow: inset 0 0 0 1.5px currentColor; }
.utente {
  display: flex; align-items: center; gap: .55rem; margin-left: .4rem;
  padding: .3rem .35rem .3rem .3rem; border-radius: 999px;
  background: rgba(255, 255, 255, .1);
}
.utente__avatar {
  width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center;
  background: var(--oro); color: var(--verde-950); font-weight: 800; font-size: .8rem; letter-spacing: .02em;
}
.utente__info { display: flex; flex-direction: column; line-height: 1.15; font-size: .82rem; }
.utente__info small { opacity: .7; font-size: .72rem; }
.utente__esci {
  border: 0; background: transparent; padding: .45rem .7rem; border-radius: 999px; font-size: .8rem; font-weight: 700;
  opacity: .8;
}
.utente__esci:hover { opacity: 1; background: rgba(255, 255, 255, .12); }

.testata--solida {
  background: rgba(250, 247, 240, .9);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  backdrop-filter: saturate(160%) blur(14px);
  color: var(--verde-900);
  box-shadow: 0 1px 0 var(--linea);
}
.testata--solida .stemma { filter: brightness(0); opacity: .86; }
.testata--solida .testata__link:hover, .testata--solida .utente__esci:hover { background: rgba(20, 32, 26, .07); }
.testata--solida .utente { background: rgba(20, 32, 26, .06); }

@media (max-width: 760px) {
  :root { --altezza-testata: 64px; }
  .testata__nome span, .utente__info, .testata__link--secondario { display: none; }
  .testata__brand .stemma { height: 36px; }
  .testata__nome strong { font-size: 1.15rem; }
  .utente { margin-left: 0; }
}

/* --------------------------------------------------------------------------
   Rivelazione allo scroll
   -------------------------------------------------------------------------- */
[data-reveal] {
  opacity: 0; transform: translateY(40px);
  transition: opacity 1s var(--easing), transform 1s var(--easing);
  transition-delay: var(--ritardo, 0s);
}
[data-reveal="sinistra"] { transform: translateX(-50px); }
[data-reveal="destra"] { transform: translateX(50px); }
[data-reveal="zoom"] { transform: scale(.92); }
[data-reveal].visibile { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
  [data-reveal] { opacity: 1; transform: none; }
}

/* Cielo stellato (canvas) */
.cielo { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }

/* --------------------------------------------------------------------------
   Form
   -------------------------------------------------------------------------- */
.campo { display: flex; flex-direction: column; gap: .4rem; margin-bottom: 1.1rem; }
.campo label { font-weight: 700; font-size: .85rem; letter-spacing: .01em; }
.campo input, .campo textarea, .campo select {
  width: 100%; min-height: 50px; padding: .8rem 1rem;
  border: 1.5px solid var(--linea); border-radius: var(--raggio-s);
  background: #fff; transition: border-color .2s, box-shadow .2s;
  font: inherit; color: inherit;
}
.campo select { cursor: pointer; }
.campo textarea { min-height: 84px; resize: vertical; }
.campo input:focus, .campo textarea:focus, .campo select:focus {
  outline: none; border-color: var(--verde-600); box-shadow: 0 0 0 4px rgba(37, 88, 63, .14);
}
.campo.ha-errore input, .campo.ha-errore select { border-color: var(--errore); box-shadow: 0 0 0 4px rgba(180, 35, 24, .1); }
.campo__errore { margin: 0; min-height: 0; font-size: .8rem; color: var(--errore); font-weight: 600; }
.campo__aiuto { margin: 0; font-size: .8rem; color: var(--muto); }
.campo-riga { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1rem; }
@media (max-width: 480px) { .campo-riga { grid-template-columns: 1fr; } }
.form-messaggio { margin: 1rem 0 0; min-height: 1.4em; font-weight: 600; font-size: .9rem; color: var(--errore); text-align: center; }

/* --------------------------------------------------------------------------
   LOGIN
   -------------------------------------------------------------------------- */
.login { min-height: 100vh; min-height: 100dvh; display: grid; grid-template-columns: 1.1fr 1fr; }
.login__lato {
  position: relative; overflow: hidden;
  background: radial-gradient(120% 90% at 30% 20%, var(--verde-700), var(--verde-950) 70%);
  color: var(--crema);
  display: flex; align-items: center; justify-content: center; padding: 3rem var(--gutter);
}
.login__brand { position: relative; text-align: center; max-width: 460px; }
.login__stemma { height: clamp(180px, 32vh, 320px); margin: 0 auto 2rem; animation: emergi 1.6s var(--easing) both; }
.login__brand .sovratitolo { color: var(--oro-chiaro); animation: emergi 1.2s .3s var(--easing) both; }
.login__brand h1 { font-size: clamp(2.4rem, 4.5vw, 3.8rem); animation: emergi 1.2s .45s var(--easing) both; }
@keyframes emergi { from { opacity: 0; transform: translateY(24px) scale(.98); } to { opacity: 1; transform: none; } }

.login__form-wrap { display: flex; align-items: center; justify-content: center; padding: 3rem var(--gutter); }
.login__form { width: min(100%, 440px); animation: emergi 1s .2s var(--easing) both; }
.login__form h2 { font-family: var(--font-display); font-size: 2.6rem; font-weight: 600; margin-bottom: .3rem; }
.login__form > p.muto { margin-bottom: 2rem; }
.login__privacy { margin-top: 1.4rem; font-size: .78rem; color: var(--muto); text-align: center; }

@media (max-width: 860px) {
  .login { grid-template-columns: 1fr; }
  .login__lato { padding: 3.5rem var(--gutter) 2.5rem; }
  .login__stemma { height: 150px; margin-bottom: 1.4rem; }
  .login__brand h1 { font-size: 2.3rem; }
  .login__form-wrap { padding-top: 2.2rem; }
}

/* --------------------------------------------------------------------------
   INDEX — Hero
   -------------------------------------------------------------------------- */
.hero {
  position: relative; min-height: 100vh; min-height: 100svh; overflow: hidden;
  display: grid; place-items: center; text-align: center;
  background: radial-gradient(90% 70% at 50% 35%, var(--verde-700) 0%, var(--verde-900) 55%, var(--verde-950) 100%);
  color: var(--crema);
  padding: calc(var(--altezza-testata) + 2rem) var(--gutter) 6rem;
}
.hero__contenuto { position: relative; z-index: 1; will-change: transform, opacity; }
.hero__stemma { height: clamp(200px, 38vh, 380px); margin: 0 auto 2.2rem; animation: emergi 1.8s var(--easing) both; filter: drop-shadow(0 20px 40px rgba(0, 0, 0, .35)); }
.hero .sovratitolo { color: var(--oro-chiaro); animation: emergi 1.2s .5s var(--easing) both; }
.hero__titolo { font-size: clamp(3rem, 9vw, 7.5rem); animation: emergi 1.3s .65s var(--easing) both; }
.hero__sottotitolo { max-width: 34rem; margin: 1.4rem auto 0; font-size: clamp(1rem, 1.6vw, 1.15rem); opacity: .85; animation: emergi 1.3s .8s var(--easing) both; }
.hero__scorri {
  position: absolute; left: 50%; bottom: 2rem; transform: translateX(-50%); z-index: 1;
  display: flex; flex-direction: column; align-items: center; gap: .6rem;
  font-size: .7rem; letter-spacing: .25em; text-transform: uppercase; opacity: .7; text-decoration: none;
}
.hero__scorri span {
  width: 24px; height: 40px; border-radius: 12px; border: 1.5px solid currentColor; position: relative;
}
.hero__scorri span::after {
  content: ""; position: absolute; left: 50%; top: 8px; width: 4px; height: 8px; margin-left: -2px; border-radius: 2px;
  background: currentColor; animation: rotella 1.8s infinite;
}
@keyframes rotella { 0% { opacity: 0; transform: translateY(0); } 30% { opacity: 1; } 100% { opacity: 0; transform: translateY(12px); } }

/* Nastro scorrevole */
.nastro {
  background: var(--oro); color: var(--verde-950); overflow: hidden; white-space: nowrap;
  padding: 1rem 0; transform: rotate(-1.5deg) scale(1.02); margin-top: -1.6rem; position: relative; z-index: 2;
  box-shadow: var(--ombra);
}
.nastro__traccia { display: inline-flex; animation: nastro 38s linear infinite; }
.nastro__traccia span {
  font-family: var(--font-display); font-weight: 700; font-size: clamp(1.3rem, 2.4vw, 1.9rem);
  letter-spacing: .06em; text-transform: uppercase; padding-right: 2.2rem;
}
.nastro__traccia span::after { content: "✶"; margin-left: 2.2rem; font-size: .8em; }
@keyframes nastro { to { transform: translateX(-50%); } }

/* Manifesto con parole che si accendono */
.manifesto { padding: clamp(6rem, 14vw, 11rem) 0; }
.manifesto__testo {
  font-family: var(--font-display); font-weight: 500; font-size: clamp(1.9rem, 4.4vw, 3.6rem); line-height: 1.15;
  max-width: 22ch; max-width: 980px; margin: 0;
}
.manifesto__testo .parola { color: rgba(20, 32, 26, .16); transition: color .4s; }
.manifesto__testo .parola.accesa { color: var(--inchiostro); }
.manifesto__testo .parola.accesa.oro { color: var(--oro-scuro); font-style: italic; }

/* --------------------------------------------------------------------------
   INDEX — Vetrina prodotti
   -------------------------------------------------------------------------- */
.vetrina { padding-bottom: clamp(4rem, 10vw, 8rem); }
.vetrina__intestazione { display: flex; align-items: end; justify-content: space-between; gap: 2rem; margin-bottom: clamp(3rem, 6vw, 5rem); flex-wrap: wrap; }
.vetrina__intestazione h2 { font-size: clamp(2.6rem, 6vw, 4.8rem); }
.vetrina__intestazione p { max-width: 26rem; margin: 0; }

.prodotto {
  display: grid; grid-template-columns: 1.15fr 1fr; align-items: center; gap: clamp(2rem, 6vw, 6rem);
  margin-bottom: clamp(5rem, 12vw, 10rem);
}
.prodotto:nth-child(even) { grid-template-columns: 1fr 1.15fr; }
.prodotto:nth-child(even) .prodotto__media { order: 2; }

.prodotto__media {
  position: relative; aspect-ratio: 4 / 4.4; border-radius: 28px; overflow: hidden;
  background: var(--sfondo, var(--crema-2));
  clip-path: inset(18% 8% 18% 8% round 28px);
  transition: clip-path 1.4s var(--easing), background .6s;
}
.prodotto.visibile .prodotto__media { clip-path: inset(0 0 0 0 round 28px); }
.prodotto__media::before {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(60% 50% at 50% 45%, rgba(255, 255, 255, .55), transparent 70%);
}
.prodotto__img {
  position: absolute; inset: 9%; display: grid; place-items: center;
  transform: scale(1.18) translateY(var(--parallasse, 0px)); opacity: 0;
  transition: transform 1.6s var(--easing), opacity 1.2s var(--easing);
}
.prodotto.visibile .prodotto__img { transform: scale(1) translateY(var(--parallasse, 0px)); opacity: 1; }
.prodotto__img svg, .prodotto__img img { width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 30px 30px rgba(7, 24, 17, .25)); }
.prodotto__img.cambio { animation: cambio .5s var(--easing); }
@keyframes cambio { 0% { opacity: .2; transform: scale(.94); } 100% { opacity: 1; transform: scale(1); } }
.prodotto__numero {
  position: absolute; left: 1.4rem; bottom: .6rem; font-family: var(--font-display); font-weight: 700;
  font-size: clamp(4rem, 9vw, 7rem); line-height: 1; color: rgba(255, 255, 255, .55); mix-blend-mode: overlay;
}

.prodotto__testo > * { opacity: 0; transform: translateY(26px); transition: opacity .9s var(--easing), transform .9s var(--easing); }
.prodotto.visibile .prodotto__testo > * { opacity: 1; transform: none; }
.prodotto.visibile .prodotto__testo > :nth-child(2) { transition-delay: .1s; }
.prodotto.visibile .prodotto__testo > :nth-child(3) { transition-delay: .2s; }
.prodotto.visibile .prodotto__testo > :nth-child(4) { transition-delay: .3s; }
.prodotto.visibile .prodotto__testo > :nth-child(5) { transition-delay: .4s; }
.prodotto.visibile .prodotto__testo > :nth-child(6) { transition-delay: .5s; }
.prodotto__testo h3 { font-family: var(--font-display); font-weight: 600; font-size: clamp(2.3rem, 4.6vw, 3.6rem); line-height: 1; margin-bottom: 1.1rem; }
.prodotto__testo p.descr { color: var(--muto); font-size: 1.05rem; max-width: 30rem; }
.prodotto__varianti { display: flex; flex-wrap: wrap; gap: .5rem; margin: 1.4rem 0; padding: 0; list-style: none; }
.prodotto__varianti li { padding: .35rem .9rem; border-radius: 999px; border: 1.5px solid var(--linea); font-weight: 700; font-size: .82rem; }
.prodotto__dettagli { display: flex; align-items: center; gap: 2rem; flex-wrap: wrap; margin-top: 1.4rem; }
.prodotto__prezzo { font-family: var(--font-display); font-size: 2.6rem; font-weight: 700; line-height: 1; }
.prodotto__taglie { font-size: .85rem; color: var(--muto); font-weight: 600; }

.pallini { display: flex; flex-wrap: wrap; gap: .55rem; margin-top: 1.4rem; }
.pallino {
  display: block; width: 30px; height: 30px; border-radius: 50%; border: 0; padding: 0;
  background: var(--c); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .15), 0 0 0 0 var(--carta);
  transition: transform .25s var(--easing), box-shadow .25s;
}
.pallino:hover { transform: scale(1.12); }
.pallino[aria-pressed="true"] { box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .15), 0 0 0 3px var(--carta), 0 0 0 5px var(--verde-800); }
.pallini__nome { font-size: .85rem; font-weight: 700; margin-top: .7rem; color: var(--muto); min-height: 1.4em; }

@media (max-width: 860px) {
  .prodotto, .prodotto:nth-child(even) { grid-template-columns: 1fr; gap: 2rem; }
  .prodotto:nth-child(even) .prodotto__media { order: 0; }
}

/* Passaggi */
.passaggi { background: var(--crema); padding: clamp(5rem, 10vw, 8rem) 0; }
.passaggi h2 { font-size: clamp(2.4rem, 5vw, 4rem); margin-bottom: 3rem; }
.passaggi__griglia { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; counter-reset: passo; list-style: none; margin: 0; padding: 0; }
.passo {
  position: relative; padding: 2rem; border-radius: var(--raggio); background: var(--carta);
  box-shadow: 0 1px 0 var(--linea); counter-increment: passo;
  transition: transform .4s var(--easing), box-shadow .4s var(--easing);
}
.passo:hover { transform: translateY(-6px); box-shadow: var(--ombra-l); }
.passo::before {
  content: "0" counter(passo); display: block; font-family: var(--font-display); font-weight: 700;
  font-size: 3.2rem; line-height: 1; color: var(--oro); margin-bottom: 1.2rem;
}
.passo h3 { font-size: 1.15rem; margin-bottom: .5rem; }
.passo p { margin: 0; color: var(--muto); }
@media (max-width: 860px) { .passaggi__griglia { grid-template-columns: 1fr; } }

/* Invito finale */
.invito {
  position: relative; overflow: hidden; text-align: center; color: var(--crema);
  background: radial-gradient(80% 80% at 50% 100%, var(--verde-700), var(--verde-950) 75%);
  padding: clamp(6rem, 14vw, 11rem) var(--gutter);
}
.invito__contenuto { position: relative; z-index: 1; }
.invito .sovratitolo { color: var(--oro-chiaro); }
.invito h2 { font-size: clamp(2.8rem, 8vw, 6.4rem); margin-bottom: 1.4rem; }
.invito p { max-width: 32rem; margin: 0 auto 3rem; opacity: .85; }
.btn-preordina {
  position: relative; display: inline-flex; align-items: center; gap: .9rem;
  padding: 1.35rem 3rem; border-radius: 999px; text-decoration: none;
  background: linear-gradient(135deg, var(--oro-chiaro), var(--oro) 55%, #b38a33);
  color: var(--verde-950); font-weight: 800; font-size: clamp(1.1rem, 2.4vw, 1.45rem); letter-spacing: .14em;
  box-shadow: 0 20px 50px -12px rgba(201, 162, 75, .65), inset 0 1px 0 rgba(255, 255, 255, .5);
  transition: transform .35s var(--easing), box-shadow .35s var(--easing);
  overflow: hidden; isolation: isolate;
}
.btn-preordina::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, .7) 50%, transparent 70%);
  transform: translateX(-120%); animation: luccichio 3.2s 1s infinite;
}
.btn-preordina::after {
  content: ""; position: absolute; inset: -6px; border-radius: inherit; z-index: -2;
  box-shadow: 0 0 0 0 rgba(231, 205, 136, .55); animation: impulso 2.4s infinite;
}
.btn-preordina:hover { transform: translateY(-4px) scale(1.03); box-shadow: 0 30px 60px -12px rgba(201, 162, 75, .8), inset 0 1px 0 rgba(255, 255, 255, .5); }
.btn-preordina svg { width: 1.3em; height: 1.3em; transition: transform .35s var(--easing); }
.btn-preordina:hover svg { transform: translateX(5px); }
@keyframes luccichio { 0% { transform: translateX(-120%); } 45%, 100% { transform: translateX(120%); } }
@keyframes impulso { 0% { box-shadow: 0 0 0 0 rgba(231, 205, 136, .5); } 100% { box-shadow: 0 0 0 26px rgba(231, 205, 136, 0); } }

/* Piè di pagina */
.piede { background: var(--verde-950); color: rgba(244, 238, 225, .7); padding: 3rem 0; font-size: .85rem; }
.piede__interno { display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; flex-wrap: wrap; }
.piede__brand { display: flex; align-items: center; gap: .9rem; color: var(--crema); }
.piede__brand .stemma { height: 46px; opacity: .9; }
.piede__brand strong { font-family: var(--font-display); font-size: 1.2rem; display: block; }
.piede a { text-decoration: none; opacity: .8; }
.piede a:hover { opacity: 1; text-decoration: underline; }

/* --------------------------------------------------------------------------
   PREORDINI
   -------------------------------------------------------------------------- */
.pagina-preordini { background: var(--crema); }
.preordini__intro { padding: calc(var(--altezza-testata) + clamp(2.5rem, 6vw, 4.5rem)) 0 2.5rem; }
.preordini__intro h1 { font-size: clamp(2.6rem, 6vw, 4.6rem); margin-bottom: 1rem; }
.preordini__intro p.lead { max-width: 40rem; font-size: 1.05rem; color: var(--muto); }
.chi-ordina {
  display: inline-flex; align-items: center; gap: .7rem; flex-wrap: wrap;
  padding: .55rem 1rem .55rem .55rem; border-radius: 999px; background: var(--carta);
  box-shadow: 0 1px 0 var(--linea); font-size: .9rem;
}
.chi-ordina .utente__avatar { width: 30px; height: 30px; font-size: .72rem; }
.avviso {
  margin-top: 1.4rem; padding: 1rem 1.2rem; border-radius: var(--raggio-s);
  background: #fff6dc; border: 1px solid #ecd79a; color: #5b4712; font-size: .92rem; max-width: 46rem;
}
.avviso--chiuso { background: #fde7e4; border-color: #f2b8b0; color: #7a1d12; }

.preordini__layout { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 2rem; align-items: start; padding-bottom: 5rem; }
@media (max-width: 1040px) { .preordini__layout { grid-template-columns: 1fr; } }

.catalogo { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 330px), 1fr)); gap: 1.5rem; }
.articolo {
  background: var(--carta); border-radius: var(--raggio); overflow: hidden;
  box-shadow: 0 1px 0 var(--linea), 0 10px 30px -22px rgba(7, 24, 17, .4);
  display: flex; flex-direction: column;
  transition: box-shadow .35s var(--easing), transform .35s var(--easing);
}
.articolo:hover { box-shadow: 0 1px 0 var(--linea), var(--ombra-l); }
.articolo__media { position: relative; aspect-ratio: 4 / 3.3; background: var(--sfondo, var(--crema-2)); transition: background .5s; }
.articolo__media::before { content: ""; position: absolute; inset: 0; background: radial-gradient(55% 55% at 50% 45%, rgba(255, 255, 255, .6), transparent 75%); }
.articolo__img { position: absolute; inset: 8% 14%; display: grid; place-items: center; }
.articolo__img svg, .articolo__img img { width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 18px 18px rgba(7, 24, 17, .22)); }
.articolo__img.cambio { animation: cambio .45s var(--easing); }
.articolo__prezzo {
  position: absolute; top: 1rem; right: 1rem; padding: .3rem .8rem; border-radius: 999px;
  background: var(--verde-900); color: var(--crema); font-weight: 800; font-size: .95rem;
}
.articolo__corpo { padding: 1.4rem 1.4rem 1.5rem; display: flex; flex-direction: column; gap: 1.1rem; flex: 1; }
.articolo__titolo h2 { font-size: 1.15rem; line-height: 1.25; }
.articolo__variante { display: inline-block; margin-top: .35rem; font-size: .75rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--oro-scuro); }

.scelta { border: 0; margin: 0; padding: 0; min-width: 0; }
.scelta legend { padding: 0; margin-bottom: .55rem; font-size: .8rem; font-weight: 700; color: var(--muto); }
.scelta legend b { color: var(--inchiostro); }
.opzioni { display: flex; flex-wrap: wrap; gap: .45rem; }
.opzioni label { position: relative; display: inline-flex; }
.opzioni input { position: absolute; inset: 0; opacity: 0; pointer-events: none; margin: 0; }
.swatch {
  display: block; width: 32px; height: 32px; border-radius: 50%; background: var(--c); cursor: pointer;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .15); transition: transform .2s var(--easing), box-shadow .2s;
}
.swatch:hover { transform: scale(1.1); }
input:checked + .swatch { box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .15), 0 0 0 3px var(--carta), 0 0 0 5px var(--verde-800); }
input:focus-visible + .swatch, input:focus-visible + .chip { outline: 3px solid var(--oro); outline-offset: 3px; }
.chip {
  min-width: 46px; height: 38px; padding: 0 .7rem; display: grid; place-items: center; cursor: pointer;
  border-radius: 10px; border: 1.5px solid var(--linea); font-weight: 700; font-size: .82rem; background: #fff;
  transition: background .2s, color .2s, border-color .2s;
}
.chip:hover { border-color: var(--verde-600); }
input:checked + .chip { background: var(--verde-800); border-color: var(--verde-800); color: var(--crema); }
.scelta.manca .chip { border-color: var(--errore); animation: scuoti .4s; }
@keyframes scuoti { 20%, 60% { transform: translateX(-4px); } 40%, 80% { transform: translateX(4px); } }

.articolo__azioni { display: flex; gap: .7rem; align-items: center; margin-top: auto; }
.campo--personalizza { margin: 0; }
.campo--personalizza label { font-size: .8rem; color: var(--muto); }
.campo--personalizza input { min-height: 44px; }
.articolo__azioni .btn { flex: 1; }
.stepper {
  display: inline-flex; align-items: center; height: 48px; border-radius: 999px; background: #fff;
  box-shadow: inset 0 0 0 1.5px var(--linea); flex-shrink: 0;
}
.stepper button {
  width: 40px; height: 100%; border: 0; background: transparent; font-size: 1.2rem; font-weight: 700; border-radius: 999px;
}
.stepper button:hover { background: rgba(20, 32, 26, .06); }
.stepper input {
  width: 34px; border: 0; text-align: center; font-weight: 800; background: transparent; -moz-appearance: textfield; appearance: textfield;
}
.stepper input::-webkit-outer-spin-button, .stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.stepper--piccolo { height: 34px; }
.stepper--piccolo button { width: 30px; font-size: 1rem; }
.stepper--piccolo input { width: 26px; font-size: .9rem; }

/* Riepilogo (carrello) */
.carrello {
  position: sticky; top: calc(var(--altezza-testata) + 1.2rem);
  background: var(--verde-900); color: var(--crema); border-radius: var(--raggio); padding: 1.6rem;
  box-shadow: var(--ombra-l); max-height: calc(100vh - var(--altezza-testata) - 2.4rem); display: flex; flex-direction: column;
}
.carrello__testa { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1rem; }
.carrello__testa h2 { font-family: var(--font-display); font-size: 1.8rem; font-weight: 600; }
.badge { min-width: 30px; height: 30px; padding: 0 .55rem; border-radius: 999px; display: grid; place-items: center; background: var(--oro); color: var(--verde-950); font-weight: 800; font-size: .85rem; }
.badge.salta { animation: salta .45s var(--easing); }
@keyframes salta { 40% { transform: scale(1.35); } }
.carrello__righe { list-style: none; margin: 0; padding: 0; overflow-x: hidden; overflow-y: auto; flex: 1; min-height: 0; }
.carrello__vuoto { text-align: center; padding: 1.5rem .5rem; opacity: .7; font-size: .92rem; }
.carrello__vuoto .stemma { height: 70px; margin: 0 auto 1rem; opacity: .35; }
.riga {
  display: grid; grid-template-columns: 54px minmax(0, 1fr) auto; gap: .8rem; align-items: center;
  padding: .8rem 0; border-bottom: 1px solid rgba(244, 238, 225, .12);
  animation: entra .4s var(--easing);
}
@keyframes entra { from { opacity: 0; transform: translateX(16px); } }
.riga__img { width: 54px; height: 54px; border-radius: 12px; background: rgba(244, 238, 225, .1); padding: 6px; }
.riga__img svg, .riga__img img { width: 100%; height: 100%; object-fit: contain; }
.riga__nome { font-weight: 700; font-size: .88rem; line-height: 1.3; }
.riga__dettagli { font-size: .78rem; opacity: .7; }
.riga__fondo { display: flex; align-items: center; gap: .6rem; margin-top: .4rem; }
.riga .stepper { background: rgba(244, 238, 225, .1); box-shadow: none; }
.riga .stepper button:hover { background: rgba(244, 238, 225, .12); }
.riga__destra { display: flex; flex-direction: column; align-items: end; gap: .3rem; }
.riga__prezzo { font-weight: 800; font-size: .95rem; white-space: nowrap; }
.riga__rimuovi { border: 0; background: transparent; color: inherit; opacity: .55; font-size: .75rem; text-decoration: underline; padding: .2rem; }
.riga__rimuovi:hover { opacity: 1; }
.carrello .campo { margin: 1.1rem 0 0; }
.carrello .campo label { font-size: .8rem; opacity: .85; }
.carrello .campo textarea { background: rgba(244, 238, 225, .08); border-color: rgba(244, 238, 225, .18); color: var(--crema); min-height: 64px; }
.carrello .campo textarea::placeholder { color: rgba(244, 238, 225, .45); }
.carrello__totale { display: flex; justify-content: space-between; align-items: baseline; margin: 1.2rem 0; padding-top: 1rem; border-top: 1px solid rgba(244, 238, 225, .2); }
.carrello__totale strong { font-family: var(--font-display); font-size: 2.3rem; line-height: 1; }
.carrello .nota { font-size: .76rem; opacity: .65; margin: .9rem 0 0; text-align: center; }

/* Barra in basso per telefoni */
.barra-mobile {
  position: fixed; left: 12px; right: 12px; bottom: 12px; z-index: 40;
  display: none; align-items: center; justify-content: space-between; gap: 1rem;
  padding: .6rem .6rem .6rem 1.2rem; border-radius: 999px; background: var(--verde-900); color: var(--crema);
  box-shadow: var(--ombra-l); transform: translateY(140%); transition: transform .45s var(--easing);
}
.barra-mobile.visibile { transform: none; }
.barra-mobile__info { font-size: .85rem; line-height: 1.2; }
.barra-mobile__info strong { display: block; font-size: 1.1rem; }
@media (max-width: 1040px) {
  .barra-mobile { display: flex; }
  .carrello { position: static; max-height: none; }
  .carrello__righe { overflow: visible; }
}

/* I miei preordini */
.miei { padding: 1rem 0 6rem; }
.miei h2 { font-size: clamp(2rem, 4vw, 2.8rem); margin-bottom: 1.5rem; }
.miei__lista { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); gap: 1.2rem; }
.scheda-ordine { background: var(--carta); border-radius: var(--raggio); padding: 1.4rem; box-shadow: 0 1px 0 var(--linea); }
.scheda-ordine__testa { display: flex; justify-content: space-between; align-items: start; gap: 1rem; margin-bottom: 1rem; }
.scheda-ordine__testa h3 { font-size: 1.05rem; }
.scheda-ordine__testa time { font-size: .8rem; color: var(--muto); }
.stato { padding: .25rem .7rem; border-radius: 999px; font-size: .72rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; white-space: nowrap; }
.stato--ricevuto { background: #dcefe3; color: var(--ok); }
.stato--annullato { background: #f3e2df; color: var(--errore); }
.scheda-ordine ul { list-style: none; margin: 0 0 1rem; padding: 0; font-size: .88rem; }
.scheda-ordine li { display: flex; justify-content: space-between; gap: 1rem; padding: .35rem 0; border-bottom: 1px dashed var(--linea); }
.scheda-ordine li span:last-child { font-weight: 700; white-space: nowrap; }
.scheda-ordine__fondo { display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.scheda-ordine__fondo strong { font-size: 1.15rem; }
.scheda-ordine--annullato { opacity: .6; }
.scheda-ordine--annullato ul, .scheda-ordine--annullato strong { text-decoration: line-through; }
.scheda-ordine .note { font-size: .82rem; color: var(--muto); font-style: italic; margin: -.4rem 0 1rem; }
.miei__vuoto { color: var(--muto); }

/* --------------------------------------------------------------------------
   Finestre di dialogo e notifiche
   -------------------------------------------------------------------------- */
dialog.finestra {
  width: min(100% - 32px, 520px); max-height: min(90vh, 760px); border: 0; padding: 0;
  border-radius: 24px; background: var(--carta); color: var(--inchiostro); box-shadow: var(--ombra-l);
}
dialog.finestra[open] { animation: finestra .4s var(--easing); }
dialog.finestra::backdrop { background: rgba(7, 24, 17, .55); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
@keyframes finestra { from { opacity: 0; transform: translateY(20px) scale(.97); } }
.finestra__corpo { padding: 2rem; }
dialog.finestra--grafica { width: min(100% - 32px, 640px); }
.grafiche { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; margin: 1.2rem 0 .4rem; }
.grafica {
  display: grid; gap: .6rem; padding: .7rem; text-align: center; font: inherit; font-weight: 700; color: inherit;
  background: #fff; border: 2px solid rgba(20, 32, 26, .12); border-radius: 18px; cursor: pointer;
  transition: border-color .2s, transform .2s, box-shadow .2s;
}
.grafica:hover, .grafica:focus-visible { border-color: var(--oro, #c9a24b); transform: translateY(-2px); box-shadow: var(--ombra-l); outline: none; }
.grafica img { width: 100%; aspect-ratio: 1; object-fit: contain; border-radius: 12px; }
.grafica small { font-weight: 500; opacity: .7; }
@media (max-width: 480px) { .grafiche { gap: .6rem; } .finestra__corpo { padding: 1.4rem; } }
.finestra h2 { font-family: var(--font-display); font-size: 2.1rem; font-weight: 600; margin-bottom: .6rem; line-height: 1.05; }
.finestra ul { list-style: none; padding: 0; margin: 1.2rem 0; font-size: .9rem; max-height: 40vh; overflow-y: auto; }
.finestra li { display: flex; justify-content: space-between; gap: 1rem; padding: .5rem 0; border-bottom: 1px solid var(--linea); }
.finestra__totale { display: flex; justify-content: space-between; font-weight: 800; font-size: 1.15rem; margin-bottom: 1.5rem; }
.finestra__azioni { display: flex; gap: .7rem; justify-content: flex-end; flex-wrap: wrap; }
.finestra--successo { text-align: center; }
.finestra--successo .spunta {
  width: 84px; height: 84px; margin: 0 auto 1.2rem; border-radius: 50%; background: var(--verde-800); display: grid; place-items: center;
}
.finestra--successo .spunta svg { width: 42px; height: 42px; stroke: var(--oro-chiaro); stroke-width: 3; fill: none; stroke-dasharray: 50; stroke-dashoffset: 50; animation: traccia .7s .25s var(--easing) forwards; }
@keyframes traccia { to { stroke-dashoffset: 0; } }
.finestra--successo .finestra__azioni { justify-content: center; }

.toast {
  position: fixed; left: 50%; bottom: 96px; z-index: 100; transform: translate(-50%, 30px);
  padding: .85rem 1.3rem; border-radius: 999px; background: var(--inchiostro); color: var(--crema);
  font-weight: 600; font-size: .9rem; box-shadow: var(--ombra-l); opacity: 0; pointer-events: none;
  transition: opacity .3s, transform .4s var(--easing); max-width: calc(100% - 32px); text-align: center;
}
.toast.visibile { opacity: 1; transform: translate(-50%, 0); }
.toast--errore { background: var(--errore); }
@media (min-width: 1041px) { .toast { bottom: 32px; } }

/* Scheletro di caricamento */
.caricamento { padding: 3rem; text-align: center; color: var(--muto); }

/* --------------------------------------------------------------------------
   ADMIN
   -------------------------------------------------------------------------- */
.pagina-admin { background: var(--crema); }
.admin-accesso { min-height: 100vh; display: grid; place-items: center; padding: 2rem var(--gutter); }
.admin-accesso form { width: min(100%, 400px); background: var(--carta); padding: 2.4rem; border-radius: 24px; box-shadow: var(--ombra-l); text-align: center; }
.admin-accesso .stemma { height: 90px; margin: 0 auto 1.2rem; }
.admin-accesso h1 { font-family: var(--font-display); font-size: 2.2rem; margin-bottom: 1.5rem; }
.admin-accesso .campo { text-align: left; }
.admin { padding: calc(var(--altezza-testata) + 2rem) 0 5rem; }
.admin__testa { display: flex; justify-content: space-between; align-items: end; gap: 1rem; flex-wrap: wrap; margin-bottom: 2rem; }
.admin__testa h1 { font-size: clamp(2.4rem, 5vw, 3.6rem); }
.admin__azioni { display: flex; gap: .6rem; flex-wrap: wrap; }
.kpi { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; margin-bottom: 2.5rem; }
.kpi__box--netto { background: var(--verde-900) !important; color: var(--crema); }
.filtro-classe { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem 1rem; margin: 0 0 1.2rem; }
.filtro-classe label { font-weight: 800; }
.filtro-classe select {
  min-height: 44px; padding: .5rem 2.2rem .5rem .9rem; font: inherit; font-weight: 700; color: inherit;
  border: 1.5px solid var(--linea); border-radius: var(--raggio-s); background: #fff; cursor: pointer;
}
.filtro-classe p { margin: 0; font-size: .85rem; }
.tabella tr.vuota td { opacity: .45; }
.kpi__box--netto span { color: var(--oro-chiaro) !important; }
.economia { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .5rem; margin: 0 0 1rem; padding: .7rem .9rem; border-radius: var(--raggio-s); background: var(--crema); }
.economia div { min-width: 0; }
.economia dt { font-size: .66rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--muto); }
.economia dd { margin: 0; font-size: .95rem; font-weight: 600; }
@media (max-width: 520px) { .economia { grid-template-columns: 1fr 1fr; } }
.kpi__box { background: var(--carta); border-radius: var(--raggio); padding: 1.3rem 1.4rem; box-shadow: 0 1px 0 var(--linea); }
.kpi__box span { font-size: .75rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--muto); }
.kpi__box strong { display: block; font-family: var(--font-display); font-size: 2.6rem; line-height: 1.1; }
@media (max-width: 760px) { .kpi { grid-template-columns: 1fr 1fr; } }

/* Foto prodotto con fronte/retro */
.foto { position: relative; width: 100%; height: 100%; }
.foto img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; transition: opacity .5s var(--easing); filter: none !important; }
.foto__retro { opacity: 0; }
.foto.girata .foto__retro { opacity: 1; }
.foto.girata .foto__fronte { opacity: 0; }
.foto__gira {
  position: absolute; left: 50%; bottom: -4%; transform: translateX(-50%); z-index: 2;
  display: inline-flex; align-items: center; gap: .35rem; padding: .35rem .85rem; border-radius: 999px;
  border: 0; background: var(--verde-900); color: var(--crema); font-size: .75rem; font-weight: 700; letter-spacing: .04em;
  box-shadow: var(--ombra);
}
.foto__gira:hover { background: var(--verde-700); }
.riga__img .foto__gira { display: none; }
.riga__img:has(img) { background: #fff; }
.schede { display: flex; gap: .4rem; margin-bottom: 1.5rem; flex-wrap: wrap; }
.schede button { border: 0; padding: .6rem 1.1rem; border-radius: 999px; background: transparent; font-weight: 700; }
.schede button[aria-selected="true"] { background: var(--verde-800); color: var(--crema); }
.grafici { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 520px), 1fr)); gap: 1.2rem; }
.grafico { background: var(--carta); border-radius: var(--raggio); padding: 1.4rem; box-shadow: 0 1px 0 var(--linea); min-width: 0; }
.grafico h3 { font-size: 1.05rem; }
.grafico__sotto { font-size: .82rem; color: var(--muto); margin-bottom: 1rem; }
.legenda { display: flex; flex-wrap: wrap; gap: .4rem .9rem; font-size: .72rem; font-weight: 700; margin-bottom: .6rem; }
.legenda span { display: inline-flex; align-items: center; gap: .3rem; }
.legenda i { width: 10px; height: 10px; border-radius: 2px; background: var(--c); }
.grafico svg { width: 100%; height: auto; overflow: visible; }
.grafico svg text { font-family: var(--font-testo); font-size: 10px; fill: var(--muto); }
.grafico svg rect.barra { transform-box: fill-box; transform-origin: bottom; animation: cresci .8s var(--easing) both; }
@keyframes cresci { from { transform: scaleY(0); } }
.tabella-wrap { overflow-x: auto; margin-top: 1rem; }
table.tabella { width: 100%; border-collapse: collapse; font-size: .82rem; }
.tabella th, .tabella td { padding: .5rem .6rem; text-align: left; border-bottom: 1px solid var(--linea); white-space: nowrap; }
.tabella th { font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muto); }
.tabella td.num, .tabella th.num { text-align: right; }
.tabella tr.totale td { font-weight: 800; }
.tabella .zero { color: rgba(20, 32, 26, .25); }
.ordini-admin { background: var(--carta); border-radius: var(--raggio); padding: 1.4rem; box-shadow: 0 1px 0 var(--linea); }
.ordini-admin input[type="search"] { width: min(100%, 360px); min-height: 44px; padding: .6rem 1rem; border-radius: 999px; border: 1.5px solid var(--linea); margin-bottom: 1rem; }
.ordini-admin td { white-space: normal; vertical-align: top; }
.ordini-admin tr.annullato td:not(.azioni) { opacity: .5; text-decoration: line-through; }
.ordini-admin td.azioni { white-space: nowrap; }
.ordini-admin td.azioni .btn { margin: 0 .2rem .3rem 0; }
.btn--pericolo { --btn-bg: #fbe9e7; --btn-fg: var(--errore); }
.btn--pericolo:hover { --btn-bg: var(--errore); --btn-fg: #fff; }
