/* Responsive overrides for inline-styled layouts */
:root { --ease-out: cubic-bezier(.23,1,.32,1); --ease-drawer: cubic-bezier(.32,.72,0,1); }
/* clip non crea un contenitore di scroll (sticky e scroll di window restano integri); hidden e' il fallback per browser vecchi */
html, body { overflow-x: hidden; overflow-x: clip; }
img, svg, video { max-width: 100%; }

@media (max-width: 1080px) {
  [style*="position: sticky"][style*="top: 100px"] { position: static !important; }
  [style*="max-width: 1400px"][style*="40px"] { padding-left: 28px !important; padding-right: 28px !important; }
  [style*="display: grid"][style*="columns: 340px"],
  [style*="display: grid"][style*="columns: 300px"],
  [style*="display: grid"][style*="columns: 280px"],
  [style*="display: grid"][style*="columns: 260px"] { grid-template-columns: 1fr !important; gap: 32px !important; }
  [style*="repeat(5, 1fr)"], [style*="repeat(6, 1fr)"] { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; }
}

@media (max-width: 860px) {
  [style*="display: grid"]:not([style*="auto-fit"]):not([style*="columns: 54px"]):not([style*="columns: 16px"]):not([style*="columns: 74px"]):not([style*="columns: 92px"]):not([style*="1fr 28px"]):not([style*="repeat("]) {
    grid-template-columns: minmax(0, 1fr) !important;
  }
  [style*="display: grid"][style*="gap: 60px"], [style*="display: grid"][style*="gap: 56px"],
  [style*="display: grid"][style*="gap: 64px"], [style*="display: grid"][style*="gap: 70px"],
  [style*="display: grid"][style*="gap: 80px"], [style*="display: grid"][style*="gap: 48px"] { gap: 28px !important; }
  [style*="repeat(3, 1fr)"], [style*="repeat(4, 1fr)"], [style*="repeat(4, minmax"], [style*="repeat(2, 1fr)"] { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  [style*="repeat(5, 1fr)"], [style*="repeat(6, 1fr)"] { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  [style*="justify-content: space-between"]:not([style*="position: sticky"]) { flex-wrap: wrap; row-gap: 8px; }
  table { font-size: 13.5px !important; }
  [data-tabs] { margin-top: 40px !important; }
  [data-tabs] > [style*="display: flex"] { flex-wrap: wrap; gap: 0 22px !important; padding-top: 4px !important; padding-bottom: 4px !important; }
  [data-tabs] > [style*="display: flex"] > a { padding: 10px 0 !important; }
  /* tabelle impilate: etichetta sopra, valore sotto */
  div:has(> table) > table, div:has(> table) > table tbody, div:has(> table) > table tr, div:has(> table) > table td { display: block; width: auto !important; }
  div:has(> table) > table thead { display: none; }
  div:has(> table) > table tr { padding: 13px 18px; }
  div:has(> table) > table td { padding: 0 !important; overflow-wrap: anywhere; }
  div:has(> table) > table td + td { margin-top: 4px; }
  div:has(> table) > table td:first-child { font-size: 12.5px; }
}

@media (max-width: 600px) {
  [style*="max-width: 1400px"][style*="40px"] { padding-left: 18px !important; padding-right: 18px !important; }
  section[style*="max-width: 1400px"][style*="padding: 100px"],
  section[style*="max-width: 1400px"][style*="padding: 96px"],
  section[style*="max-width: 1400px"][style*="padding: 86px"],
  section[style*="max-width: 1400px"][style*="padding: 84px"],
  section[style*="max-width: 1400px"][style*="padding: 80px"],
  section[style*="max-width: 1400px"][style*="padding: 76px"],
  section[style*="max-width: 1400px"][style*="padding: 72px"],
  section[style*="max-width: 1400px"][style*="padding: 70px"],
  section[style*="max-width: 1400px"][style*="padding: 64px"],
  section[style*="max-width: 1400px"][style*="padding: 60px"] { padding-top: 48px !important; }
  section[style*="max-width: 1400px"][style*="40px 110px"],
  section[style*="max-width: 1400px"][style*="40px 90px"] { padding-bottom: 64px !important; }
  [style*="repeat(3, 1fr)"], [style*="repeat(2, 1fr)"] { grid-template-columns: minmax(0, 1fr) !important; }
  [style*="auto-fit"][style*="minmax(2"], [style*="auto-fit"][style*="minmax(3"] { grid-template-columns: minmax(0, 1fr) !important; }
  [style*="padding: 44px 40px"], [style*="padding: 40px 36px"], [style*="padding: 40px 38px"], [style*="padding: 40px;"] { padding: 26px 20px !important; }
  [style*="font-size: 17.5px"], [style*="font-size: 18px"] { font-size: 16px !important; }
  h2 { overflow-wrap: anywhere; }
  [style*="columns: 74px 1fr auto"] { grid-template-columns: 56px minmax(0, 1fr) !important; gap: 14px !important; padding: 16px !important; }
  [style*="columns: 74px 1fr auto"] > :last-child { grid-column: 2; font-size: 12.5px; }
}

/* Mobile look: rhythm, carousels, CTAs */
@media (max-width: 860px) {
  /* card grids become swipe carousels */
  [style*="display: grid"][style*="repeat("]:has(> a) {
    display: flex !important; overflow-x: auto; scroll-snap-type: x mandatory; gap: 10px !important;
    margin-left: -28px; margin-right: -28px; padding: 0 28px 6px; scroll-padding: 0 28px; scrollbar-width: none;
  }
  [style*="display: grid"][style*="repeat("]:has(> a)::-webkit-scrollbar { display: none; }
  [style*="display: grid"][style*="repeat("]:has(> a) > a { flex: 0 0 min(78%, 340px); scroll-snap-align: start; }
  /* alternating bands */
  div > section[style*="max-width: 1400px"]:nth-of-type(even) { background: #fff; padding-bottom: 52px !important; max-width: none !important; }
  div > section[style*="max-width: 1400px"]:nth-of-type(even) + section { padding-top: 52px !important; }
  div > section[style*="max-width: 1400px"]:nth-of-type(even) a[style*="background: #fff"],
  div > section[style*="max-width: 1400px"]:nth-of-type(even) div[style*="background: #fff"] { background: #F2F1EF !important; }
  /* headings */
  section h2[style*="font-size: 28px"] { font-size: 30px !important; line-height: 1.08 !important; }
  /* CTAs */
  section a[style*="padding: 14px 24px"], section a[style*="padding: 15px 26px"], section a[style*="padding: 16px 28px"] {
    flex: 1 1 100%; justify-content: center; padding: 17px 20px !important; font-size: 16px !important;
  }
}
@media (max-width: 600px) {
  [style*="display: grid"][style*="repeat("]:has(> a) { margin-left: -18px; margin-right: -18px; padding: 0 18px 6px; scroll-padding: 0 18px; }
  [style*="display: grid"][style*="repeat("]:has(> a) > a { flex-basis: 82%; }
  div > section[style*="max-width: 1400px"]:nth-of-type(even) { padding-bottom: 44px !important; }
  div > section[style*="max-width: 1400px"]:nth-of-type(even) + section { padding-top: 44px !important; }
  [style*="border-radius: 16px"][style*="background: #006FB9"], [style*="border-radius: 14px"][style*="background: #006FB9"] { padding: 32px 22px !important; }
  footer > div[style*="auto-fit"] { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 32px 20px !important; }
  footer > div[style*="auto-fit"] > :first-child { grid-column: 1 / -1; }
  footer a { font-size: 14px; }
}

/* Polish */
@media (max-width: 860px) {
  h1 { font-size: clamp(40px, 12.5vw, 56px) !important; }
  section > div[style*="align-items: end"][style*="justify-content: space-between"] { margin-bottom: 22px !important; }
  [style*="display: grid"][style*="repeat("]:has(> a) > a { border-radius: 12px !important; }
  a[style*="border-radius: 12px"][style*="background: #fff"], div[style*="border-radius: 12px"][style*="background: #fff"] { border-radius: 12px !important; }
  img[style*="object-fit: cover"] { min-height: 260px; }
}


@media (max-width: 860px) {
  [data-sticky-media] { position: static !important; }
}


@media (max-width: 859px) {
  [data-plant-host] { height: 560px !important; }
  [data-plant-host][data-open] { height: auto !important; }
  [data-plant-host][data-open] > *, [data-plant-host][data-open] cuv-plant { height: auto !important; }
}

/* menu mobile: header sempre visibile e menu a tutto schermo */
.cuv-hdr:has([data-mnav]) { transform: none !important; }


/* ---------- Accessibilita' e feedback globali ---------- */
/* Focus visibile: anello blu + bordo bianco interno, leggibile su fondi chiari e scuri */
:focus-visible { outline: 2px solid #006FB9; outline-offset: 2px; border-radius: 6px; box-shadow: 0 0 0 2px #fff; }
:focus:not(:focus-visible) { outline: none; }

/* Press feedback: specificita' zero, cosi' le regole dei componenti (es. .cuv-pin) prevalgono */
:where(button:not(:disabled), .cuv-btn) {
  transition: transform 160ms var(--ease-out), background-color 150ms ease, color 150ms ease, border-color 150ms ease, opacity 150ms ease;
}
:where(button:not(:disabled), .cuv-btn):active { transform: scale(.97); transition-duration: 90ms; }

/* Touch target >= 44px su mobile (il segno visivo resta sottile) */
@media (max-width: 860px) {
  a.cuv-btn { min-height: 44px; box-sizing: border-box; }
  [data-tabs] > [style*="display: flex"] > a { min-height: 44px; box-sizing: border-box; display: inline-flex; align-items: center; }
}

/* Movimento ridotto: niente animazioni infinite ne' spostamenti; restano colore/opacita' */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto !important; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; }
  [style*="position: sticky"][style*="top: 0"] { transition: none !important; }
  :where(button:not(:disabled), .cuv-btn):active { transform: none; opacity: .85; }
}

/* Segnaposto dei componenti in caricamento (x-import): spazio riservato ma invisibile, niente riquadro */
.sc-placeholder { background: transparent !important; border-color: transparent !important; }
.sc-placeholder::before { display: none !important; }
