/* =====================================================================
   UNIVERBAR DESIGN SYSTEM
   Token e componenti condivisi. Guida d'uso: DESIGN-SYSTEM.md (radice).
   Caricato per ULTIMO nel <head> di ogni pagina.

   Regola di cascata (Tailwind 4):
   - i default di base stanno in @layer base -> le classi Tailwind
     (text-*, border-*, font-*) continuano a vincere;
   - i componenti (.ub-*, .site-*) sono fuori dai layer -> vincono su
     Tailwind e su ux-improvements.css. Non scrivere qui regole generiche
     su tag (h2, a, div...) fuori da @layer base.
   ===================================================================== */

/* ---------------------------------------------------------------------
   1. TOKEN
   --------------------------------------------------------------------- */
:root {
  /* Colore: dal logo */
  --ub-red: #E30613;          /* rosso marchio: CTA, accenti, link attivi */
  --ub-red-strong: #B8050F;   /* hover / premuto */
  --ub-red-tint: #FDECEE;     /* fondo di icone e badge */
  --ub-ink: #1D1D1B;          /* nero marchio: testo, footer, fasce scure */
  --ub-ink-soft: #2C2C2A;

  /* Neutri "acciaio": grigi con leggera dominante fredda, come l'inox */
  --ub-steel-0: #FFFFFF;
  --ub-steel-50: #F5F6F7;
  --ub-steel-100: #ECEEF0;
  --ub-steel-200: #DCE0E4;
  --ub-steel-400: #9AA1A9;
  --ub-steel-600: #5D646C;
  --ub-steel-800: #33383E;

  /* Ruoli (usare questi nei componenti) */
  --ub-bg: var(--ub-steel-0);
  --ub-surface: var(--ub-steel-50);
  --ub-surface-strong: var(--ub-steel-100);
  --ub-line: var(--ub-steel-200);
  --ub-text: var(--ub-ink);
  --ub-text-muted: var(--ub-steel-600);
  --ub-on-dark: #FFFFFF;
  --ub-on-dark-muted: #B9BEC4;

  /* Tipografia */
  --ub-font-display: "Saira", "Inter", system-ui, sans-serif;
  --ub-font-body: "Inter", "Noto Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --ub-stretch: 112%;         /* Saira semi-espanso: richiama le lettere del logo */
  --ub-fs-xs: 0.75rem;
  --ub-fs-sm: 0.875rem;
  --ub-fs-base: 1rem;
  --ub-fs-lg: 1.125rem;
  --ub-fs-xl: 1.375rem;
  --ub-fs-2xl: clamp(1.5rem, 1.15rem + 1.2vw, 2rem);
  --ub-fs-3xl: clamp(1.875rem, 1.3rem + 2.2vw, 2.75rem);
  --ub-fs-4xl: clamp(2.25rem, 1.3rem + 3.8vw, 4rem);

  /* Spaziatura: griglia di 4 px */
  --ub-space-1: 4px;
  --ub-space-2: 8px;
  --ub-space-3: 12px;
  --ub-space-4: 16px;
  --ub-space-6: 24px;
  --ub-space-8: 32px;
  --ub-space-12: 48px;
  --ub-space-16: 64px;
  --ub-space-24: 96px;

  /* Forma: angoli piccoli, come i blocchi del logo */
  --ub-radius-sm: 4px;
  --ub-radius: 8px;
  --ub-radius-lg: 12px;
  --ub-radius-pill: 999px;

  /* Elevazione */
  --ub-shadow-1: 0 1px 2px rgba(29, 29, 27, 0.06);
  --ub-shadow-2: 0 8px 20px -8px rgba(29, 29, 27, 0.18), 0 2px 4px rgba(29, 29, 27, 0.04);
  --ub-shadow-3: 0 22px 44px -16px rgba(29, 29, 27, 0.30);

  /* Movimento */
  --ub-ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --ub-dur-fast: 150ms;
  --ub-dur: 260ms;
  --ub-dur-slow: 700ms;

  /* Layout */
  --ub-container: 72rem;      /* = max-w-6xl di Tailwind */
  --ub-gutter: clamp(16px, 4vw, 32px);

  /* Ponte verso Tailwind e ux-improvements.css: stessi valori ovunque */
  --color-primary: var(--ub-red);
  --color-text-light: var(--ub-ink);
  --color-border-light: var(--ub-line);
  --color-card-light: var(--ub-surface);
  --primary: var(--ub-red);
  --border: 1px solid var(--ub-line);
  --header-offset: 0px;       /* l'header e' sticky: niente spazio extra sopra <main> */
}

/* Browser senza color-mix (precedenti al 2023): Tailwind compilato ha le
   trasparenze del primario scritte con il vecchio rosso #FD2601. */
@supports not (color: color-mix(in lab, red, red)) {
  .bg-primary\/10, .hover\:bg-primary\/10:hover { background-color: rgba(227, 6, 19, 0.10); }
  .border-primary\/30 { border-color: rgba(227, 6, 19, 0.30); }
  .hover\:bg-primary\/90:hover { background-color: rgba(227, 6, 19, 0.90); }
}

/* ---------------------------------------------------------------------
   2. BASE (dentro @layer base: le utility Tailwind vincono)
   --------------------------------------------------------------------- */
@layer base {
  *, ::before, ::after { border-color: var(--ub-line); }
  html { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; scroll-padding-top: 80px; }
  body { color: var(--ub-text); background-color: var(--ub-bg); }
  h1, h2, h3 {
    font-family: var(--ub-font-display);
    font-stretch: var(--ub-stretch);
    letter-spacing: -0.01em;
    text-wrap: balance;
  }
  ::selection { background: var(--ub-red); color: #fff; }
  :focus-visible { outline: 2px solid var(--ub-red); outline-offset: 2px; }
}

/* ---------------------------------------------------------------------
   3. HEADER
   --------------------------------------------------------------------- */
/* L'header sta dentro #header-container, alto quanto lui: "sticky" sull'header
   non aveva effetto (un elemento sticky non esce dal suo contenitore). Sticky va
   sul contenitore; su mobile ux-enhancements.js nasconde l'header con transform. */
#header-container { position: sticky; top: 0; z-index: 50; }
.site-header {
  position: relative;
  transition: transform var(--ub-dur) var(--ub-ease), box-shadow var(--ub-dur) var(--ub-ease);
  background: rgba(255, 255, 255, 0.92);
  -webkit-backdrop-filter: saturate(160%) blur(10px);
  backdrop-filter: saturate(160%) blur(10px);
  transition: box-shadow var(--ub-dur) var(--ub-ease), border-color var(--ub-dur) var(--ub-ease);
}
.site-header.is-scrolled { box-shadow: var(--ub-shadow-2); border-color: transparent; }
.site-logo { display: block; height: 28px; width: auto; }
@media (min-width: 768px) { .site-logo { height: 32px; } }

.site-nav__link {
  position: relative;
  font-weight: 500;
  color: var(--ub-text);
  background: none !important;   /* via il fondo rosato delle utility hover:bg-primary/10 */
}
.site-nav__link::after {
  content: "";
  position: absolute;
  left: 0.5rem; right: 0.5rem; bottom: -2px;
  height: 2px;
  background: var(--ub-red);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--ub-dur) var(--ub-ease);
}
.site-nav__link:hover::after,
.site-nav__link[aria-current="page"]::after,
.site-nav__link.is-active::after { transform: scaleX(1); }
.site-nav__link[aria-current="page"], .site-nav__link.is-active { color: var(--ub-text); }
.site-nav__menu {
  background: #fff;
  border: 1px solid var(--ub-line);
  border-radius: var(--ub-radius-lg);
  box-shadow: var(--ub-shadow-3);
  padding: var(--ub-space-2);
}
.site-nav__menu { width: max-content; min-width: 14rem; }
.site-nav__menu a { border-radius: var(--ub-radius-sm); }
/* Voci di menu sempre su una riga (header, tendina, menu mobile, footer) */
.site-header a, .site-header button, .site-footer li a, .site-footer__title { white-space: nowrap; }
.site-nav__menu a[aria-current="page"] { color: var(--ub-red); font-weight: 600; }

/* ---------------------------------------------------------------------
   4. PULSANTI
   .ub-btn (nuovo markup) + aggancio dei pulsanti Tailwind esistenti
   --------------------------------------------------------------------- */
.ub-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--ub-space-2);
  min-height: 48px;
  padding: 0 var(--ub-space-6);
  border-radius: var(--ub-radius);
  border: 1.5px solid transparent;
  font-family: var(--ub-font-body);
  font-size: var(--ub-fs-base);
  font-weight: 600;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
  transition: background-color var(--ub-dur-fast) var(--ub-ease), color var(--ub-dur-fast) var(--ub-ease),
              border-color var(--ub-dur-fast) var(--ub-ease), transform var(--ub-dur-fast) var(--ub-ease),
              box-shadow var(--ub-dur-fast) var(--ub-ease);
}
.ub-btn .material-symbols-outlined { font-size: 20px; transition: transform var(--ub-dur) var(--ub-ease); }
.ub-btn:hover .material-symbols-outlined { transform: translateX(3px); }
.ub-btn--primary { background: var(--ub-red); color: #fff; }
.ub-btn--primary:hover { background: var(--ub-red-strong); transform: translateY(-1px); box-shadow: 0 10px 22px -10px rgba(227, 6, 19, 0.7); }
.ub-btn--ghost { border-color: rgba(255, 255, 255, 0.7); color: #fff; background: rgba(255, 255, 255, 0.06); }
.ub-btn--ghost:hover { background: #fff; color: var(--ub-ink); border-color: #fff; }
.ub-btn--outline { border-color: var(--ub-ink); color: var(--ub-ink); background: transparent; }
.ub-btn--outline:hover { background: var(--ub-ink); color: #fff; }

/* Pulsanti esistenti scritti con le utility Tailwind */
a.bg-primary, button.bg-primary {
  transition: background-color var(--ub-dur-fast) var(--ub-ease), transform var(--ub-dur-fast) var(--ub-ease), box-shadow var(--ub-dur-fast) var(--ub-ease);
}
a.bg-primary:hover, button.bg-primary:hover {
  background-color: var(--ub-red-strong);
  opacity: 1;
  transform: translateY(-1px);
}

/* ---------------------------------------------------------------------
   5. TITOLI DI SEZIONE ed EYEBROW
   --------------------------------------------------------------------- */
/* Titoli di sezione: i rossi in maiuscolo e quelli centrati in testa a una
   sezione hanno tutti lo stesso stile (nero, minuscolo naturale, Saira) */
main h2.uppercase.text-primary,
main .text-center > h2 {
  text-transform: none;
  color: var(--ub-ink);
  font-size: clamp(1.75rem, 1.25rem + 1.8vw, 2.5rem);
  font-weight: 650;
  line-height: 1.12;
  letter-spacing: -0.015em;
}

/* Etichetta sopra un titolo: tratto rosso + maiuscoletto */
.ub-eyebrow,
.line-hero__kicker {
  display: inline-flex;
  align-items: center;
  gap: 0.6em;
  font-family: var(--ub-font-display);
  font-stretch: var(--ub-stretch);
  font-size: var(--ub-fs-sm);
  font-weight: 600;
  letter-spacing: 0.14em;
  line-height: 1.3;
  text-transform: uppercase;
}
.ub-eyebrow::before,
.line-hero__kicker::before {
  content: "";
  flex: 0 0 auto;
  width: 1.75em;
  height: 2px;
  background: var(--ub-red);
}
.ub-eyebrow { color: var(--ub-text-muted); }

/* Le vecchie etichette a pillola rosata sopra i titoli (es. "Eccellenza
   tecnica" nelle linee) prendono l'aspetto dell'eyebrow */
main .text-center > .rounded-full.bg-primary\/10.uppercase {
  gap: 0.6em;
  padding: 0;
  border-radius: 0;
  background: none;
  color: var(--ub-text-muted);
  font-family: var(--ub-font-display);
  font-stretch: var(--ub-stretch);
  font-size: var(--ub-fs-sm);
  font-weight: 600;
  letter-spacing: 0.14em;
}
main .text-center > .rounded-full.bg-primary\/10.uppercase::before {
  content: "";
  width: 1.75em;
  height: 2px;
  background: var(--ub-red);
}
.line-hero__kicker { color: rgba(255, 255, 255, 0.92); }

/* ---------------------------------------------------------------------
   6. HERO — UN SOLO COMPONENTE PER TUTTE LE PAGINE
   .line-hero              foto a tutta larghezza (style inline sulla <section>)
   .line-hero--tall        variante alta della home
   .line-hero--solid       senza foto: fascia nera del marchio (privacy)
   Figli: __overlay (velo), __content, __badge, __title (con __kicker),
   __subtitle, __actions. La foto e' ereditata dallo pseudo-elemento, che
   la anima con uno zoom lento.
   --------------------------------------------------------------------- */
.line-hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: flex;
  align-items: flex-end;
  justify-content: flex-start;
  min-height: min(62vh, 540px);
  height: auto;                 /* ux-improvements.css fissava 60vh: tagliava i contenuti lunghi */
  color: #fff;
  background-color: var(--ub-ink);
  background-size: cover;
  background-position: center;
}
.line-hero--tall { min-height: min(78vh, 720px); }
.line-hero--solid { min-height: 0; background-image: none !important; }
.line-hero:not(.line-hero--solid)::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -2;
  background-image: inherit;
  background-size: cover;
  background-position: inherit;  /* l'inquadratura si regola sulla <section> */
  transform-origin: 60% 40%;
}
.line-hero__overlay {
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(90deg, rgba(20, 20, 19, 0.88) 0%, rgba(20, 20, 19, 0.6) 45%, rgba(20, 20, 19, 0.2) 100%),
    linear-gradient(0deg, rgba(20, 20, 19, 0.7) 0%, rgba(20, 20, 19, 0) 45%) !important;
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
}
.line-hero .line-hero__content {
  position: relative;
  width: 100%;
  max-width: var(--ub-container);
  margin: 0 auto;
  padding: var(--ub-space-24) var(--ub-gutter) var(--ub-space-16);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--ub-space-6);
  text-align: left;
}
.line-hero--solid .line-hero__content { padding-top: var(--ub-space-16); padding-bottom: var(--ub-space-12); }
.line-hero__title {
  margin: 0;
  max-width: 20ch;
  font-family: var(--ub-font-display);
  font-size: var(--ub-fs-4xl);
  font-stretch: 118%;
  font-weight: 800;
  line-height: 1.02;
  letter-spacing: -0.02em;
  text-transform: none;
  color: #fff;
  filter: none;
}
.line-hero__title .line-hero__kicker { display: flex; justify-content: flex-start; margin-bottom: var(--ub-space-4); }
.line-hero .line-hero__subtitle {
  margin: 0;
  max-width: 52ch;
  text-align: left;
  font-size: var(--ub-fs-lg);
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.86);
  filter: none;
}
.line-hero__badge {
  display: inline-flex;
  align-items: center;
  gap: var(--ub-space-2);
  margin: 0;
  padding: 6px 14px 6px 10px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: var(--ub-radius-pill);
  background: rgba(255, 255, 255, 0.08);
  font-size: var(--ub-fs-sm);
  font-weight: 600;
}
.line-hero__badge::before {
  content: "";
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--ub-red);
  box-shadow: 0 0 0 4px rgba(227, 6, 19, 0.25);
}
.line-hero__actions { display: flex; flex-wrap: wrap; gap: var(--ub-space-3); }
.line-hero .ub-quick-contacts { width: 100%; max-width: 40rem; }

@media (prefers-reduced-motion: no-preference) {
  .line-hero:not(.line-hero--solid)::before { animation: ub-drift 26s var(--ub-ease) both; }
  .line-hero__content > * { animation: ub-rise var(--ub-dur-slow) var(--ub-ease) both; }
  .line-hero__content > :nth-child(2) { animation-delay: 80ms; }
  .line-hero__content > :nth-child(3) { animation-delay: 160ms; }
  .line-hero__content > :nth-child(4) { animation-delay: 240ms; }
}
@keyframes ub-drift { from { transform: scale(1.1); } to { transform: scale(1); } }
@keyframes ub-rise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }

/* ---------------------------------------------------------------------
   8. FASCIA "IN CIFRE" (.ub-facts)
   --------------------------------------------------------------------- */
.ub-facts { background: var(--ub-ink); color: var(--ub-on-dark); }
.ub-facts__grid {
  max-width: var(--ub-container);
  margin: 0 auto;
  padding: var(--ub-space-8) var(--ub-gutter);
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--ub-space-6) var(--ub-space-8);
}
@media (min-width: 900px) { .ub-facts__grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.ub-facts__item { display: flex; flex-direction: column; gap: var(--ub-space-1); padding-left: var(--ub-space-4); border-left: 2px solid var(--ub-red); }
.ub-facts__value {
  font-family: var(--ub-font-display);
  font-stretch: 118%;
  font-size: var(--ub-fs-2xl);
  font-weight: 700;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}
.ub-facts__label { margin: 0; font-size: var(--ub-fs-sm); line-height: 1.45; color: var(--ub-on-dark-muted); }

/* ---------------------------------------------------------------------
   9. CARD PRODOTTO e CARD FUNZIONE
   --------------------------------------------------------------------- */
.product-card {
  background: #fff;
  border: 1px solid var(--ub-line);
  border-radius: var(--ub-radius-lg);
  box-shadow: var(--ub-shadow-1);
  transition: transform var(--ub-dur) var(--ub-ease), box-shadow var(--ub-dur) var(--ub-ease), border-color var(--ub-dur) var(--ub-ease);
}
.product-card:hover { transform: translateY(-4px); box-shadow: var(--ub-shadow-3); border-color: var(--ub-steel-400); }
.product-card h3 { font-family: var(--ub-font-display); font-stretch: var(--ub-stretch); font-weight: 700; }
.product-card .media-box,
.product-grid--home .media-box {
  border-radius: 0;
  background: linear-gradient(180deg, #fff 0%, var(--ub-steel-50) 100%);
  border-bottom: 1px solid var(--ub-line);
}
.media-box img { transition: transform var(--ub-dur-slow) var(--ub-ease); }
.product-card:hover .media-box img { transform: scale(1.04); }
.product-grid--home .product-card--sprint:hover .media-box img { transform: scale(calc(var(--home-sprint-scale, 0.68) * 1.04)); }
@media (min-width: 1024px) {
  /* 6 linee = 2 righe da 3, senza card isolate */
  .product-grid--home { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

.stitch-feature-card {
  background: #fff !important;
  border: 1px solid var(--ub-line) !important;
  border-radius: var(--ub-radius-lg) !important;
  transition: border-color var(--ub-dur) var(--ub-ease), box-shadow var(--ub-dur) var(--ub-ease), transform var(--ub-dur) var(--ub-ease);
}
.stitch-feature-card:hover { border-color: var(--ub-steel-400) !important; box-shadow: var(--ub-shadow-2); transform: translateY(-2px); }

/* ---------------------------------------------------------------------
   10. RECAPITI E RIQUADRI (pagina Contatti)
   --------------------------------------------------------------------- */
/* Recapiti rapidi */
.ub-quick-contacts { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--ub-space-3); }
@media (min-width: 560px) { .ub-quick-contacts { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.ub-quick-contact {
  display: flex;
  align-items: center;
  gap: var(--ub-space-3);
  padding: var(--ub-space-3) var(--ub-space-4);
  background: #fff;
  border: 1px solid var(--ub-line);
  border-radius: var(--ub-radius);
  color: var(--ub-ink);
  text-decoration: none;
  transition: border-color var(--ub-dur-fast) var(--ub-ease), box-shadow var(--ub-dur-fast) var(--ub-ease), transform var(--ub-dur-fast) var(--ub-ease);
}
a.ub-quick-contact:hover { border-color: var(--ub-red); box-shadow: var(--ub-shadow-2); transform: translateY(-1px); }
.ub-quick-contact__icon {
  flex: 0 0 auto;
  display: grid; place-items: center;
  width: 40px; height: 40px;
  border-radius: var(--ub-radius);
  background: var(--ub-red-tint);
  color: var(--ub-red);
}
.ub-quick-contact__text { display: flex; flex-direction: column; min-width: 0; }
.ub-quick-contact__label { font-size: var(--ub-fs-xs); font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ub-text-muted); }
.ub-quick-contact__value { font-weight: 600; overflow-wrap: anywhere; }

/* Riquadri della pagina Contatti */
.ub-panel { background: #fff; border: 1px solid var(--ub-line); border-radius: var(--ub-radius-lg); box-shadow: var(--ub-shadow-1); }
.ub-panel h2 { color: var(--ub-ink); }
.hs-form-frame { min-height: 420px; }

/* ---------------------------------------------------------------------
   11. FOOTER
   --------------------------------------------------------------------- */
.site-footer { background: var(--ub-ink); color: var(--ub-on-dark-muted); font-size: var(--ub-fs-sm); }
.site-footer a { color: var(--ub-on-dark-muted); text-decoration: none; transition: color var(--ub-dur-fast) var(--ub-ease); }
.site-footer a:hover { color: #fff; }
.site-footer__inner {
  max-width: var(--ub-container);
  margin: 0 auto;
  padding: var(--ub-space-16) var(--ub-gutter) var(--ub-space-12);
  display: grid;
  gap: var(--ub-space-8) var(--ub-space-6);
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
@media (min-width: 900px) { .site-footer__inner { grid-template-columns: 1.6fr 1fr 1fr 1fr; } }
.site-footer__brand { grid-column: 1 / -1; display: flex; flex-direction: column; gap: var(--ub-space-4); max-width: 34ch; }
@media (min-width: 900px) { .site-footer__brand { grid-column: auto; } }
.site-footer__logo img { display: block; height: 30px; width: auto; }
.site-footer__brand p { margin: 0; line-height: 1.6; }
.site-footer__brand address { font-style: normal; line-height: 1.7; }
.site-footer__title {
  margin: 0 0 var(--ub-space-4);
  font-family: var(--ub-font-display);
  font-stretch: var(--ub-stretch);
  font-size: var(--ub-fs-xs);
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #fff;
}
.site-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--ub-space-2); }
.site-footer__social { display: inline-flex; margin-top: var(--ub-space-2); }
.site-footer__social svg { width: 22px; height: 22px; }
.site-footer__bottom { border-top: 1px solid rgba(255, 255, 255, 0.12); }
.site-footer__bottom-inner {
  max-width: var(--ub-container);
  margin: 0 auto;
  padding: var(--ub-space-6) var(--ub-gutter);
  display: flex;
  flex-wrap: wrap;
  gap: var(--ub-space-2) var(--ub-space-6);
  justify-content: space-between;
  font-size: var(--ub-fs-xs);
}

/* ---------------------------------------------------------------------
   11b. SCHEDA PRODOTTO (.pdp) — 25 schede macchina
   Ordine dei blocchi (vincolante, vedi STRUTTURA-PAGINE.md):
   Caratteristiche (dentro .pdp-summary) > Dotazioni > Disegni > Cesti.
   --------------------------------------------------------------------- */
.pdp-wrap { max-width: var(--ub-container); margin: 0 auto; padding-left: var(--ub-gutter); padding-right: var(--ub-gutter); }

.pdp-crumbs { padding: var(--ub-space-4) 0; border-bottom: 1px solid var(--ub-line); font-size: var(--ub-fs-sm); color: var(--ub-text-muted); }
.pdp-crumbs ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; align-items: center; gap: var(--ub-space-2); }
.pdp-crumbs li + li::before { content: "/"; margin-right: var(--ub-space-2); color: var(--ub-steel-400); }
.pdp-crumbs a { color: var(--ub-text-muted); text-decoration: none; }
.pdp-crumbs a:hover { color: var(--ub-red); }
.pdp-crumbs [aria-current] { color: var(--ub-ink); font-weight: 600; }

.pdp-hero { padding: var(--ub-space-12) 0 var(--ub-space-16); }
.pdp-hero__grid { display: grid; gap: var(--ub-space-12); align-items: start; }
@media (min-width: 960px) { .pdp-hero__grid { grid-template-columns: 1.1fr 1fr; gap: var(--ub-space-16); } }

/* Galleria */
.pdp-gallery { display: flex; flex-direction: column; gap: var(--ub-space-3); min-width: 0; }
.pdp-gallery__stage {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 1 / 1;
  padding: var(--ub-space-8);
  border: 1px solid var(--ub-line);
  border-radius: var(--ub-radius-lg);
  background: #fff;             /* le foto prodotto hanno fondo bianco: niente sfumature dietro */
  cursor: zoom-in;
  overflow: hidden;
}
/* La foto occupa il riquadro meno il margine e resta sempre intera (contain):
   con height:100% dentro la cella della griglia usciva dal riquadro e veniva tagliata */
.pdp-gallery__stage img {
  position: absolute;
  inset: var(--ub-space-8);
  width: calc(100% - 2 * var(--ub-space-8));
  height: calc(100% - 2 * var(--ub-space-8));
  object-fit: contain;
  transition: transform var(--ub-dur-slow) var(--ub-ease);
}
.pdp-gallery__stage:hover img { transform: scale(1.03); }
.pdp-gallery__zoom {
  position: absolute;
  top: var(--ub-space-3);
  right: var(--ub-space-3);
  display: inline-flex;
  align-items: center;
  gap: var(--ub-space-1);
  padding: 6px 10px;
  border: 1px solid var(--ub-line);
  border-radius: var(--ub-radius-pill);
  background: rgba(255, 255, 255, 0.9);
  font-size: var(--ub-fs-xs);
  font-weight: 600;
  color: var(--ub-steel-800);
}
.pdp-gallery__zoom .material-symbols-outlined { font-size: 16px; }
.pdp-gallery__thumbs { display: flex; gap: var(--ub-space-3); }
/* Pallini aggiunti da ux-enhancements.js: con le miniature visibili sono superflui */
.pdp-gallery__thumbs + .flex.justify-center { display: none; }
.pdp-thumb {
  width: 76px;
  height: 76px;
  padding: 6px;
  border: 1.5px solid var(--ub-line) !important;
  border-radius: var(--ub-radius);
  background: #fff;
  cursor: pointer;
  overflow: hidden;
  transition: border-color var(--ub-dur-fast) var(--ub-ease);
}
.pdp-thumb img { width: 100%; height: 100%; object-fit: contain; }
.pdp-thumb:hover { border-color: var(--ub-steel-400) !important; }
.pdp-thumb.border-primary { border-color: var(--ub-red) !important; box-shadow: 0 0 0 3px rgba(227, 6, 19, 0.12); }

/* Riepilogo */
.pdp-summary { display: flex; flex-direction: column; gap: var(--ub-space-6); min-width: 0; }
.pdp-title { margin: 0; font-size: var(--ub-fs-4xl); font-weight: 800; font-stretch: 118%; line-height: 1.02; letter-spacing: -0.02em; color: var(--ub-ink); }
.pdp-title__cat {
  display: block;
  margin-top: var(--ub-space-3);
  font-family: var(--ub-font-body);
  font-stretch: 100%;
  font-size: var(--ub-fs-xl);
  font-weight: 500;
  letter-spacing: 0;
  line-height: 1.3;
  color: var(--ub-text-muted);
}
.pdp-lead { margin: 0; max-width: 46ch; font-size: var(--ub-fs-lg); line-height: 1.6; color: var(--ub-steel-800); }

.pdp-specs {
  margin: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border: 1px solid var(--ub-line);
  border-radius: var(--ub-radius-lg);
  overflow: hidden;
  background: var(--ub-line);
  gap: 1px;
}
.pdp-spec { display: flex; flex-direction: column-reverse; gap: var(--ub-space-1); padding: var(--ub-space-4) var(--ub-space-4) var(--ub-space-4) var(--ub-space-4); background: #fff; min-width: 0; }
.pdp-spec dt { font-size: var(--ub-fs-xs); font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ub-text-muted); }
.pdp-spec dd {
  margin: 0;
  font-family: var(--ub-font-display);
  font-stretch: 112%;
  font-size: var(--ub-fs-2xl);
  font-weight: 700;
  line-height: 1.1;
  color: var(--ub-ink);
  font-variant-numeric: tabular-nums;
}
.pdp-actions { display: flex; flex-wrap: wrap; gap: var(--ub-space-3); }
.pdp-tools { display: flex; align-items: center; gap: var(--ub-space-4); font-size: var(--ub-fs-sm); color: var(--ub-text-muted); }
.pdp-tools button {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px;
  border: 1px solid var(--ub-line);
  border-radius: 50%;
  background: #fff;
  color: var(--ub-steel-800);
  cursor: pointer;
  transition: border-color var(--ub-dur-fast) var(--ub-ease), color var(--ub-dur-fast) var(--ub-ease);
}
.pdp-tools button:hover { border-color: var(--ub-red); color: var(--ub-red); }

/* Navigazione interna (resta visibile sotto l'header) */
.pdp-tabs {
  position: sticky;
  top: 63px;                    /* altezza dell'header */
  z-index: 40;
  background: rgba(255, 255, 255, 0.94);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  border-top: 1px solid var(--ub-line);
  border-bottom: 1px solid var(--ub-line);
}
.pdp-tabs ul { list-style: none; margin: 0; padding: 0; display: flex; gap: var(--ub-space-6); overflow-x: auto; scrollbar-width: none; }
.pdp-tabs a {
  display: block;
  padding: var(--ub-space-4) 0;
  border-bottom: 2px solid transparent;
  font-size: var(--ub-fs-sm);
  font-weight: 600;
  color: var(--ub-steel-800);
  text-decoration: none;
  white-space: nowrap;
  transition: color var(--ub-dur-fast) var(--ub-ease), border-color var(--ub-dur-fast) var(--ub-ease);
}
.pdp-tabs a:hover { color: var(--ub-ink); border-bottom-color: var(--ub-red); }

/* Sezioni */
.pdp-section { padding: var(--ub-space-16) 0; scroll-margin-top: 120px; }
.pdp-section--alt { background: var(--ub-surface); border-top: 1px solid var(--ub-line); border-bottom: 1px solid var(--ub-line); }
.pdp-section__head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: var(--ub-space-4); margin-bottom: var(--ub-space-8); }
.pdp-section__head > div { display: flex; flex-direction: column; gap: var(--ub-space-2); }
.pdp-h2 { margin: 0; font-size: clamp(1.5rem, 1.2rem + 1vw, 2rem); font-weight: 700; color: var(--ub-ink); }
.pdp-section__sub { margin: 0; color: var(--ub-text-muted); }

/* Dotazioni */
.pdp-equip { display: grid; gap: var(--ub-space-6); }
@media (min-width: 800px) { .pdp-equip { grid-template-columns: 1fr 1fr; } }
.pdp-equip__col { padding: var(--ub-space-6); border: 1px solid var(--ub-line); border-radius: var(--ub-radius-lg); background: #fff; }
.pdp-equip__head { display: flex; align-items: center; gap: var(--ub-space-3); margin-bottom: var(--ub-space-4); padding-bottom: var(--ub-space-4); border-bottom: 1px solid var(--ub-line); }
.pdp-equip__head h3 { margin: 0; font-size: var(--ub-fs-xl); font-weight: 700; color: var(--ub-ink); }
.pdp-equip__head p { margin: 0; font-size: var(--ub-fs-sm); color: var(--ub-text-muted); }
.pdp-equip__badge {
  flex: 0 0 auto;
  display: grid; place-items: center;
  width: 40px; height: 40px;
  border-radius: var(--ub-radius);
  background: var(--ub-red);
  color: #fff;
}
.pdp-equip__col--opt .pdp-equip__badge { background: var(--ub-steel-100); color: var(--ub-steel-800); }
.pdp-equip ul { list-style: none; margin: 0; padding: 0; display: grid; }
.pdp-equip li { display: flex; align-items: center; gap: var(--ub-space-3); padding: var(--ub-space-3) 0; border-bottom: 1px dashed var(--ub-line); }
.pdp-equip li:last-child { border-bottom: 0; }
.pdp-equip li .material-symbols-outlined { flex: 0 0 auto; font-size: 20px; color: var(--ub-red); }
.pdp-equip__col--opt li .material-symbols-outlined { color: var(--ub-steel-600); }

/* Disegni tecnici */
.pdp-drawings { display: grid; gap: var(--ub-space-4); }
@media (min-width: 720px) { .pdp-drawings { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.pdp-drawing { margin: 0; display: flex; flex-direction: column; border: 1px solid var(--ub-line); border-radius: var(--ub-radius-lg); background: #fff; overflow: hidden; }
.pdp-drawing img { width: 100%; height: 220px; object-fit: contain; padding: var(--ub-space-4); cursor: zoom-in; }
.pdp-drawing figcaption { padding: var(--ub-space-3) var(--ub-space-4); border-top: 1px solid var(--ub-line); font-size: var(--ub-fs-sm); font-weight: 600; color: var(--ub-steel-800); }

/* Fascia finale */
.pdp-cta { background: var(--ub-ink); color: #fff; }
.pdp-cta__inner { display: grid; gap: var(--ub-space-8); align-items: center; padding-top: var(--ub-space-16); padding-bottom: var(--ub-space-16); }
@media (min-width: 900px) { .pdp-cta__inner { grid-template-columns: 1.3fr 1fr; } }
.pdp-cta h2 { margin: 0 0 var(--ub-space-3); font-size: var(--ub-fs-3xl); font-weight: 800; font-stretch: 118%; line-height: 1.05; color: #fff; }
.pdp-cta p { margin: 0; max-width: 52ch; color: var(--ub-on-dark-muted); line-height: 1.6; }
.pdp-cta__actions { display: flex; flex-wrap: wrap; gap: var(--ub-space-3); }
.pdp-cta__phone { display: block; margin-top: var(--ub-space-4); color: var(--ub-on-dark-muted); font-size: var(--ub-fs-sm); }
.pdp-cta__phone a { color: #fff; font-weight: 600; text-decoration: none; }

/* ---------------------------------------------------------------------
   11c. PREFERITI -> PREVENTIVO (assets/js/preferiti.js)
   --------------------------------------------------------------------- */
.ub-favs-btn {
  position: relative;
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px;
  border: 1px solid var(--ub-line);
  border-radius: 50%;
  background: #fff;
  color: var(--ub-red);
  cursor: pointer;
  transition: border-color var(--ub-dur-fast) var(--ub-ease);
}
.ub-favs-btn[hidden] { display: none; }
.ub-favs-btn:hover { border-color: var(--ub-red); }
.ub-favs-btn .material-symbols-outlined { font-size: 20px; font-variation-settings: 'FILL' 1; }
.ub-favs-btn__count {
  position: absolute; top: -4px; right: -4px;
  min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: var(--ub-radius-pill);
  background: var(--ub-ink); color: #fff;
  font-size: 11px; font-weight: 700; line-height: 18px; text-align: center;
}
.product-fav-btn.is-favorite { color: var(--ub-red); font-variation-settings: 'FILL' 1; }

.ub-favs-panel { position: fixed; inset: 0; z-index: 8000; visibility: hidden; }
.ub-favs-panel.is-open { visibility: visible; }
.ub-favs-panel__backdrop { position: absolute; inset: 0; background: rgba(20, 20, 19, 0.5); opacity: 0; transition: opacity var(--ub-dur) var(--ub-ease); }
.ub-favs-panel.is-open .ub-favs-panel__backdrop { opacity: 1; }
.ub-favs-panel__sheet {
  position: absolute; top: 0; right: 0; bottom: 0;
  width: min(420px, 100%);
  display: flex; flex-direction: column;
  background: #fff;
  box-shadow: var(--ub-shadow-3);
  transform: translateX(100%);
  transition: transform var(--ub-dur) var(--ub-ease);
}
.ub-favs-panel.is-open .ub-favs-panel__sheet { transform: none; }
.ub-favs-panel__head { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--ub-space-4); padding: var(--ub-space-6); border-bottom: 1px solid var(--ub-line); }
.ub-favs-panel__head h2 { margin: 0; font-size: var(--ub-fs-xl); font-weight: 700; color: var(--ub-ink); }
.ub-favs-panel__sub { margin: var(--ub-space-1) 0 0; font-size: var(--ub-fs-sm); color: var(--ub-text-muted); }
.ub-favs-panel__close { display: grid; place-items: center; width: 40px; height: 40px; border: 1px solid var(--ub-line); border-radius: 50%; background: #fff; cursor: pointer; }
.ub-favs-panel__list { list-style: none; margin: 0; padding: var(--ub-space-2) var(--ub-space-6); overflow-y: auto; flex: 1 1 auto; }
.ub-favs-panel__empty { padding: var(--ub-space-8) var(--ub-space-6); color: var(--ub-text-muted); line-height: 1.6; }
.ub-favs-panel__foot { display: flex; flex-direction: column; gap: var(--ub-space-3); padding: var(--ub-space-6); border-top: 1px solid var(--ub-line); }
.ub-favs-panel__foot[hidden], .ub-favs-panel__empty[hidden] { display: none; }
.ub-favs-panel__clear { align-self: center; border: 0; background: none; color: var(--ub-text-muted); font-size: var(--ub-fs-sm); text-decoration: underline; cursor: pointer; }
.ub-favs-item { display: flex; align-items: center; gap: var(--ub-space-3); padding: var(--ub-space-3) 0; border-bottom: 1px solid var(--ub-line); }
.ub-favs-item__img { flex: 0 0 auto; width: 56px; height: 56px; padding: 4px; border: 1px solid var(--ub-line); border-radius: var(--ub-radius); background: #fff; }
.ub-favs-item__img img { width: 100%; height: 100%; object-fit: contain; }
.ub-favs-item__name { flex: 1 1 auto; min-width: 0; font-family: var(--ub-font-display); font-stretch: var(--ub-stretch); font-weight: 700; color: var(--ub-ink); text-decoration: none; }
.ub-favs-item__name:hover { color: var(--ub-red); }
.ub-favs-item__remove { flex: 0 0 auto; display: grid; place-items: center; width: 32px; height: 32px; border: 0; border-radius: 50%; background: none; color: var(--ub-text-muted); cursor: pointer; }
.ub-favs-item__remove:hover { background: var(--ub-red-tint); color: var(--ub-red); }

.ub-favs-toast {
  position: fixed; left: 50%; bottom: max(24px, env(safe-area-inset-bottom, 0px));
  z-index: 9500;
  display: flex; align-items: center; gap: var(--ub-space-4);
  padding: var(--ub-space-3) var(--ub-space-3) var(--ub-space-3) var(--ub-space-4);
  border-radius: var(--ub-radius);
  background: var(--ub-ink); color: #fff;
  font-size: var(--ub-fs-sm);
  box-shadow: var(--ub-shadow-3);
  transform: translateX(-50%);
  transition: opacity var(--ub-dur) var(--ub-ease);
  max-width: calc(100% - 32px);
}
.ub-favs-toast.is-out { opacity: 0; }
.ub-favs-toast button { border: 0; border-radius: var(--ub-radius-sm); background: #fff; color: var(--ub-ink); font-weight: 600; padding: 6px 10px; cursor: pointer; white-space: nowrap; }

.ub-favs-summary { margin-bottom: var(--ub-space-4); padding: var(--ub-space-4); border: 1px solid var(--ub-line); border-left: 3px solid var(--ub-red); border-radius: var(--ub-radius); background: var(--ub-surface); }
.ub-favs-summary p { margin: 0 0 var(--ub-space-2); font-size: var(--ub-fs-sm); color: var(--ub-steel-800); }
.ub-favs-summary pre { margin: 0 0 var(--ub-space-3); font-family: var(--ub-font-body); font-size: var(--ub-fs-sm); font-weight: 600; white-space: pre-wrap; color: var(--ub-ink); }
.ub-favs-summary .ub-btn { min-height: 36px; padding: 0 var(--ub-space-4); font-size: var(--ub-fs-sm); }

/* ---------------------------------------------------------------------
   12. ENTRATA IN SCORRIMENTO
   Solo nei browser che supportano animation-timeline (Chrome, Edge):
   altrove gli elementi sono semplicemente visibili. Niente JavaScript,
   nessun contenuto nascosto ai motori di ricerca.
   --------------------------------------------------------------------- */
@media (prefers-reduced-motion: no-preference) {
  @supports (animation-timeline: view()) {
    .product-card, .stitch-feature-card, .accessory-card, .ub-reveal {
      animation: ub-reveal linear both;
      animation-timeline: view();
      animation-range: entry 0% entry 35%;
    }
  }
}
/* Usa "translate" e non "transform": cosi' l'hover (transform) resta libero */
@keyframes ub-reveal { from { opacity: 0; translate: 0 24px; } to { opacity: 1; translate: 0 0; } }
/* Mobile: l'header si nasconde scorrendo (ux-enhancements.js), la barra della scheda sale in cima */
@media (max-width: 767px) { .pdp-tabs { top: 0; } }
/* Scheda senza opzionali (es. Ozmowash): una sola colonna "Di serie" a tutta larghezza */
.pdp-equip__col:only-child { grid-column: 1 / -1; }
@media (min-width: 800px) { .pdp-equip__col:only-child ul { grid-template-columns: 1fr 1fr; column-gap: var(--ub-space-8); } }

/* ---------------------------------------------------------------------
   PAGINE LEGALI (privacy-policy, cookie-policy)
   Il testo IT e quello EN sono due blocchi interi .ub-legal[data-lang]: si
   mostra quello della lingua scritta da lang.js in <html lang>. Senza
   JavaScript resta l'italiano. Le tabelle larghe scorrono in .ub-legal__table.
   --------------------------------------------------------------------- */
html:not([lang="en"]) .ub-legal[data-lang="en"],
html[lang="en"] .ub-legal[data-lang="it"] { display: none; }
.ub-legal { color: var(--ub-text); font-size: var(--ub-fs-sm); line-height: 1.65; }
.ub-legal h2 { font-family: var(--ub-font-display); font-size: var(--ub-fs-xl); font-weight: 700; color: var(--ub-ink); margin: var(--ub-space-8) 0 var(--ub-space-3); }
.ub-legal p { margin: 0 0 var(--ub-space-4); }
.ub-legal ul { list-style: disc; margin: 0 0 var(--ub-space-4) var(--ub-space-6); }
.ub-legal li { margin-bottom: var(--ub-space-1); }
.ub-legal a { color: var(--ub-red); text-decoration: underline; text-underline-offset: 2px; }
.ub-legal a:hover { color: var(--ub-red-strong); }
.ub-legal code { font-size: 0.9em; padding: 0 var(--ub-space-1); border-radius: var(--ub-radius-sm); background: var(--ub-surface-strong); }
.ub-legal__table { overflow-x: auto; margin: 0 0 var(--ub-space-4); }
.ub-legal table { width: 100%; min-width: 36rem; border-collapse: collapse; }
.ub-legal th, .ub-legal td { border: 1px solid var(--ub-line); padding: var(--ub-space-2) var(--ub-space-3); text-align: left; vertical-align: top; }
.ub-legal th { background: var(--ub-surface); font-weight: 600; }
.ub-legal__note { border-left: 3px solid var(--ub-red); padding: var(--ub-space-3) var(--ub-space-4); margin: 0 0 var(--ub-space-4); background: var(--ub-surface); border-radius: 0 var(--ub-radius-sm) var(--ub-radius-sm) 0; }
.ub-legal__note p:last-child { margin-bottom: 0; }
