/* ===================================
   CSS CUSTOM PROPERTIES (Variables)
   =================================== */
:root {
  /* Color Palette */
  --ts-acid: #A6C238;
  --ts-meadow: #79AC32;
  --ts-fern: #457B32;
  --ts-forest: #285128;
  --ts-night: #1D2D1A;
  --ts-dark: #2D2C24;
  --ts-pearl: #C5C9BF;
  --ts-indigo: #4A4A8F;
  
  /* Neutral Colors */
  --bg-primary: #F8F9FA;
  --text-primary: #2D2C24;
  --glass-bg: rgba(255, 255, 255, 0.95);
  --glass-border: rgba(45, 44, 36, 0.2);
  --glass-shadow: 0 4px 16px 0 rgba(0, 0, 0, 0.12);
  
  /* Transitions */
  --transition-fast: 0.2s ease;
  --transition-base: 0.3s ease;
  --transition-slow: 0.5s cubic-bezier(0.19, 1, 0.22, 1);
  
  /* Z-index Scale */
  --z-under-stripes: 0;
  --z-stripes: 2;
  --z-content: 3;
  --z-glass: 5;
  --z-dropdown: 1000;
  --z-sticky: 1020;
  --z-fixed: 1030;
  --z-modal-backdrop: 1040;
  --z-modal: 1050;
  --z-popover: 1060;
  --z-tooltip: 1070;
}

/* ===================================
   TEXT COLOR UTILITIES (TS Palette)
   =================================== */
.text-ts-acid { color: var(--ts-acid) !important; }
.text-ts-meadow { color: var(--ts-meadow) !important; }
.text-ts-fern { color: var(--ts-fern) !important; }
.text-ts-forest { color: var(--ts-forest) !important; }
.text-ts-night { color: var(--ts-night) !important; }
.text-ts-dark { color: var(--ts-dark) !important; }
.text-ts-pearl { color: var(--ts-pearl) !important; }
.text-ts-indigo { color: var(--ts-indigo) !important; }

/* ===================================
   CONTACTS: COUNTRY GRID (compact)
   =================================== */
.contacts-country-head {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  margin-bottom: 1.75rem;
}
@media (min-width: 768px) {
  .contacts-country-head {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem 2rem;
    margin-bottom: 2rem;
  }
  .contacts-country-head h2 {
    flex: 1 1 16rem;
    margin-bottom: 0 !important;
  }
}
.contacts-country-toolbar {
  flex: 1 1 14rem;
  max-width: 100%;
}
@media (min-width: 768px) {
  .contacts-country-toolbar {
    flex: 0 1 22rem;
    max-width: 22rem;
  }
}
.contacts-country-search-label {
  display: block;
  margin-bottom: 0.35rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(47, 72, 88, 0.65);
}
.contacts-country-search {
  display: block;
  width: 100%;
  padding: 0.65rem 0.85rem;
  border: 1px solid rgba(47, 72, 88, 0.18);
  border-radius: 0.65rem;
  background: rgba(255, 255, 255, 0.92);
  color: var(--ts-dark);
  font-size: 0.95rem;
  line-height: 1.35;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.contacts-country-search::placeholder {
  color: rgba(45, 44, 36, 0.45);
}
.contacts-country-search:hover {
  border-color: rgba(121, 172, 50, 0.35);
}
.contacts-country-search:focus {
  outline: none;
  border-color: var(--ts-meadow);
  box-shadow: 0 0 0 3px rgba(121, 172, 50, 0.18);
}
.contacts-country-count {
  margin: 0.45rem 0 0;
  font-size: 0.82rem;
  color: rgba(47, 72, 88, 0.62);
}
.contacts-country-empty {
  margin: 1.25rem 0 0;
  padding: 1rem 1.1rem;
  border: 1px dashed rgba(47, 72, 88, 0.22);
  border-radius: 0.75rem;
  text-align: center;
  color: rgba(47, 72, 88, 0.72);
  background: rgba(197, 201, 191, 0.18);
}
.contacts-country-grid{
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
  align-items: start;
}
@media (min-width: 640px) {
  .contacts-country-grid{
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.85rem;
  }
}
@media (min-width: 1024px) {
  .contacts-country-grid{
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
  }
}
@media (min-width: 1280px) {
  .contacts-country-grid{
    grid-template-columns: repeat(auto-fill, minmax(18.5rem, 1fr));
  }
}
.contacts-country-grid .glass{
  border-radius: 0.9rem;
  height: auto;
}
.contacts-country-grid .glass.is-filtered-out {
  display: none;
}
.contacts-country-grid .accordion-button{
  padding: 0.8rem 1rem !important;
}
.contacts-country-grid .accordion-button h3{
  font-size: 1.05rem !important;
  line-height: 1.2 !important;
}
@media (min-width: 768px){
  .contacts-country-grid .accordion-button h3{
    font-size: 1.15rem !important;
  }
}
.contacts-country-grid .accordion-button svg{
  width: 1.25rem !important;
  height: 1.25rem !important;
}
.contacts-country-grid .accordion-content > div{
  padding: 0.1rem 1rem 0.85rem !important;
}
.contacts-country-grid .accordion-content ul{
  margin: 0 !important;
  padding: 0 !important;
}
.contacts-country-grid .accordion-content ul > li{
  padding-left: 0.75rem !important;
}
.contacts-country-grid .accordion-content p{
  margin: 0.15rem 0 !important;
  font-size: 0.95rem;
}
.contacts-country-grid .accordion-content p.text-sm{
  font-size: 0.82rem !important;
}
.contacts-country-grid .accordion-content p.mt-1{
  margin-top: 0.25rem !important;
}

/* ===================================
   CONTACTS: OSM MAP (Leaflet + clusters)
   =================================== */
/* Mappa fuori da max-w in HTML: sezione a tutta larghezza viewport */
.contacts-map-outer{
  width: 100%;
  max-width: 100%;
}
.contacts-map-shell{
  width: 100%;
}
/*
  Altezza su #id: la regola .contacts-map-shell .leaflet-container { height:100% }
  vinceva su .contacts-osm-map e annullava i vh (genitore senza altezza definita).
*/
#contacts-osm-map.contacts-osm-map{
  width: 100%;
  height: 100vh;
  min-height: 280px;
  box-sizing: border-box;
}
@media (min-width: 768px){
  #contacts-osm-map.contacts-osm-map{
    height: 50vh;
    min-height: 320px;
  }
}
.contacts-map-shell .leaflet-container{
  width: 100%;
  background: rgba(255,255,255,0.9);
}

/* Greyscale map tiles (no provider change) */
.contacts-map-shell .leaflet-tile-pane{
  filter: grayscale(1) contrast(1.05) brightness(1.02);
}
.contacts-map-shell .leaflet-control-attribution{
  background: rgba(255,255,255,0.75);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  border-radius: 0;
  padding: 0.25rem 0.6rem;
  margin: 0.5rem;
  border: 1px solid rgba(0,0,0,0.08);
}
.contacts-map-shell .leaflet-control-attribution,
.contacts-map-shell .leaflet-control-attribution a{
  color: rgba(45,44,36,0.75);
  font-weight: 700;
}

.ts-cluster{
  width: 52px;
  height: 52px;
  border-radius: 9999px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: "Montserrat", system-ui, sans-serif;
  font-weight: 900;
  font-size: 1.05rem;
  letter-spacing: 0.02em;
  color: var(--ts-night);
  background:
    radial-gradient(circle at 30% 30%, rgba(255,255,255,0.92), rgba(255,255,255,0.55) 55%, rgba(255,255,255,0.35) 100%),
    linear-gradient(135deg, color-mix(in srgb, var(--ts-meadow) 42%, transparent), color-mix(in srgb, var(--ts-fern) 24%, transparent));
  border: 1px solid color-mix(in srgb, var(--ts-forest) 22%, transparent);
  box-shadow: 0 18px 55px rgba(47,72,88,0.18);
}
.ts-pin{
  width: 18px;
  height: 18px;
  border-radius: 9999px;
  background: var(--ts-meadow);
  border: 3px solid rgba(255,255,255,0.94);
  box-shadow: 0 14px 28px rgba(47,72,88,0.28);
}
.ts-map-popup{
  font-family: "Montserrat", system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
}
.ts-map-popup__title{
  font-weight: 900;
  color: var(--ts-fern);
  margin-bottom: 0.25rem;
}
.ts-map-popup__addr{
  color: rgba(45,44,36,0.8);
  font-weight: 600;
  font-size: 0.9rem;
  line-height: 1.35;
}
.ts-map-popup__meta{
  margin-top: 0.5rem;
  font-size: 0.9rem;
  color: rgba(45,44,36,0.85);
}
.ts-map-popup__meta a{
  color: var(--ts-fern);
  text-decoration: underline;
  text-underline-offset: 2px;
  font-weight: 800;
}

/* ===================================
   BASE STYLES & RESETS
   =================================== */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html.lenis {
  height: auto;
}

.lenis.lenis-smooth {
  scroll-behavior: auto;
}

.lenis.lenis-smooth [data-lenis-prevent] {
  overscroll-behavior: contain;
}

.lenis.lenis-stopped {
  overflow: hidden;
}

.lenis.lenis-scrolling iframe {
  pointer-events: none;
}

body {
  background: transparent;
  color: var(--text-primary);
  font-weight: 500;
  overflow-x: hidden;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ===================================
   TYPOGRAPHY SCALE (Global)
   - Centralized, fluid sizing via clamp()
   - Safe with Tailwind: utility classes on elements will override these
   =================================== */
:root {
  /* Base font size (body) */
  --ts-body: clamp(0.95rem, 0.28vw + 0.9rem, 1.05rem);

  /* Headings scale */
  --ts-h1: clamp(2.1rem, 2.4vw + 1.55rem, 3.4rem);
  --ts-h2: clamp(1.65rem, 1.55vw + 1.25rem, 2.35rem);
  --ts-h3: clamp(1.35rem, 1.05vw + 1.1rem, 1.85rem);
  --ts-h4: clamp(1.15rem, 0.65vw + 1.02rem, 1.45rem);
  --ts-h5: clamp(1.02rem, 0.35vw + 0.98rem, 1.2rem);
  --ts-h6: clamp(0.95rem, 0.22vw + 0.92rem, 1.08rem);
}

body {
  font-size: var(--ts-body);
  line-height: 1.65;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4, h5, h6 {
  font-family: "Montserrat Alternates", "Montserrat", system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.12;
  margin: 0;
}

h1 { font-size: var(--ts-h1); letter-spacing: -0.03em; }
h2 { font-size: var(--ts-h2); letter-spacing: -0.03em; }
h3 { font-size: var(--ts-h3); }
h4 { font-size: var(--ts-h4); letter-spacing: -0.01em; }
h5 { font-size: var(--ts-h5); letter-spacing: -0.01em; }
h6 { font-size: var(--ts-h6); letter-spacing: 0; }

p {
  margin: 0;
}

/* Content layering: stripes = background (z 2), content above stripes (z 3), nav on top (z 10) */
nav {
  position: relative;
  z-index: 10;
}

/* Tutto il contenuto (header, section, main) sopra le parallax-stripes così glass e card restano sopra le diagonali */
header,
section,
main {
  position: relative;
  z-index: var(--z-content);
}

/* Performance: skip layout/paint when section is off-screen (no visual change) */
.content-visibility-auto {
  content-visibility: auto;
  contain-intrinsic-size: auto 400px;
}

/* Hero e testate sotto le stripes: le diagonali passano sopra per effetto grafico */
header.under-stripes,
section.under-stripes {
  z-index: var(--z-under-stripes);
}

.text-balance {
  text-wrap: balance;
}

/* Preloader hero: infinite zoom animation (600ms) */
@keyframes preloader-zoom {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.08); }
}

#hero-fallback {
  animation: preloader-zoom 600ms ease-in-out infinite;
}

/* CTA Disciplines: horizontal scroll (slow, constant, infinite seamless, Montserrat light, big) */
.disciplines-scroll-mask {
  overflow: hidden;
}

.disciplines-scroll-track {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  width: max-content;
  animation: disciplines-scroll 50s linear infinite;
  will-change: transform;
}

.disciplines-scroll-gap {
  flex: 0 0 4rem;
  width: 4rem;
}

.disciplines-scroll-group {
  display: flex;
  align-items: center;
  gap: 4rem;
  flex: 0 0 auto;
  width: max-content;
  white-space: nowrap;
  font-family: "Montserrat", sans-serif;
  font-weight: 300;
  font-size: clamp(2.5rem, 8vw, 6rem);
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: rgba(197, 201, 191, 0.6);
}

.disciplines-scroll-group span {
  white-space: nowrap;
}

@keyframes disciplines-scroll {
  0% { transform: translate3d(0, 0, 0); }
  100% { transform: translate3d(-50%, 0, 0); }
}

/* Focus styles for accessibility */
*:focus-visible {
  outline: 2px solid var(--ts-acid);
  outline-offset: 2px;
}

/* ===================================
   UI COMPONENTS
   =================================== */

/* Buttons */
.btn-luxury {
  position: relative;
  overflow: hidden;
  display: inline-block;
  transition: var(--transition-fast);
}

.btn-luxury::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 100%;
  height: 1px;
  background-color: currentColor;
  transform: scaleX(0);
  transform-origin: right;
  transition: transform var(--transition-slow);
}

.btn-luxury:hover::after {
  transform: scaleX(1);
  transform-origin: left;
}

/* Images & Media */
.img-reveal-container {
  overflow: hidden;
  position: relative;
}

.img-reveal {
  transform: scale(1.15);
  transition: transform 1.5s cubic-bezier(0.19, 1, 0.22, 1);
  will-change: transform;
}

.img-reveal.active {
  transform: scale(1);
}

/* Glass Effect: sopra le stripes, blur visibile su ciò che sta dietro (stripes/sfondo sezione) */
.glass {
  position: relative;
  z-index: var(--z-glass);
  isolation: isolate; /* stacking context per backdrop-filter affidabile */
  background: rgba(255, 255, 255, 0.35);
  backdrop-filter: blur(8px) saturate(180%);
  -webkit-backdrop-filter: blur(8px) saturate(180%);
  border: 1px solid rgba(197, 201, 191, 0.5);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
  transition: var(--transition-base);
}

.glass:hover {
  background: rgba(255, 255, 255, 0.5);
  border-color: rgba(166, 194, 56, 0.55);
  box-shadow: 0 10px 26px rgba(166, 194, 56, 0.2);
  backdrop-filter: blur(12px) saturate(170%);
  -webkit-backdrop-filter: blur(12px) saturate(170%);
}

/* Glass blur forest green (CTA disciplines) */
.glass-forest {
  background: rgba(40, 81, 40, 0.4);
  backdrop-filter: blur(12px) saturate(300%);
  -webkit-backdrop-filter: blur(8px) saturate(140%);
  border: 1px solid rgba(40, 81, 40, 0.5);
}

/* Glass blur night (ts-night #1D2D1A) */
.glass-night {
  background: rgba(29, 45, 26, 0.8);
  backdrop-filter: blur(12px) saturate(140%);
  -webkit-backdrop-filter: blur(12px) saturate(140%);
  border: 1px solid rgba(29, 45, 26, 0.5);
}

/* Outline pulse – evidenzia link con bordo pulsante (color: Fence / ts-fern) */
.outline-pulse-fence {
  outline: 2px solid var(--ts-fern);
  outline-offset: 4px;
  border-radius: 4px;
  animation: outline-pulse-fence 2s ease-in-out infinite;
}

@keyframes outline-pulse-fence {
  0%, 100% {
    outline-color: var(--ts-fern);
    box-shadow: 0 0 0 0 rgba(69, 123, 50, 0.4);
  }
  50% {
    outline-color: var(--ts-meadow);
    box-shadow: 0 0 12px 2px rgba(69, 123, 50, 0.35);
  }
}

/* Background ts-fern */
.bg-ts-fern {
  background-color: var(--ts-fern);
}

/* Accordion Components */
.accordion-button {
  transition: var(--transition-base);
  cursor: pointer;
}

.accordion-button:hover {
  background: rgba(166, 194, 56, 0.1);
}

.accordion-button[aria-expanded="true"] {
  background: rgba(166, 194, 56, 0.15);
}

.accordion-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s ease;
}

.accordion-content.open {
  max-height: 2000px;
}

/* Color selector — Release palette: max 5 swatches per row */
[data-color-selector-release] {
  display: grid !important;
  grid-template-columns: repeat(5, 2rem) !important;
  gap: 0.5rem !important;
  flex-wrap: unset !important;
}

/* Color selector swatch active state */
.color-swatch.is-active {
  box-shadow: 0 0 0 2px var(--ts-night);
}
.color-swatch.is-active::after {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: 9999px;
  border: 2px solid var(--ts-meadow);
  pointer-events: none;
}
.color-swatch {
  position: relative;
}

/* Links */
.contact-link {
  transition: color var(--transition-fast);
}

.contact-link:hover {
  color: var(--ts-acid);
}

/* ===================================
   HERO & ANIMATIONS
   =================================== */

/* Hero overlay */
.glass-overlay {
  background: linear-gradient(
    to top,
    rgba(29, 45, 26, 0.9) 0%,
    rgba(29, 45, 26, 0.2) 100%
  );
}

/* Ken Burns effect */
.hero-kenburns {
  animation: kenburns 18s ease-in-out infinite alternate;
  transform-origin: center;
}

@keyframes kenburns {
  from {
    transform: scale(1.05) translate(-2%, -2%);
  }
  to {
    transform: scale(1.2) translate(2%, 2%);
  }
}

/* Text underline accent */
.underline-indigo {
  border-bottom: 3px solid var(--ts-indigo);
  display: inline-block;
  padding-bottom: 0.1em;
}

/* ===================================
   NAVIGATION & MENU
   =================================== */

/* Hamburger */
#hamburger {
  z-index: 80 !important;
}

.hamburger-line {
  transition: all var(--transition-base);
  transform-origin: center;
  background: var(--ts-acid);
}

#hamburger.active .hamburger-line:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
  background-color: var(--ts-acid) !important;
}

#hamburger.active .hamburger-line:nth-child(2) {
  opacity: 0;
  transform: translateX(10px);
}

#hamburger.active .hamburger-line:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
  background-color: var(--ts-acid) !important;
}

/* Navbar — link cubo 3D → /3d */
.ts-nav-lab-link {
  flex-shrink: 0;
  transition: opacity 0.2s ease, border-color 0.2s ease;
  border: 1px solid rgba(121, 172, 50, 0.25);
}
.ts-nav-lab-link:hover {
  opacity: 0.95;
  border-color: rgba(204, 255, 0, 0.45);
}
.ts-nav-lab-link:hover .ts-nav-lab-cube {
  transform: scale(1.06);
}
.ts-nav-lab-link:hover .ts-nav-lab-label {
  color: var(--ts-acid);
}
.ts-nav-lab-label {
  font-family: var(--font-montserrat, 'Montserrat', sans-serif);
  font-size: 0.625rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  line-height: 1;
  text-transform: uppercase;
  color: var(--ts-meadow);
  white-space: nowrap;
  pointer-events: none;
}
@media (min-width: 640px) {
  .ts-nav-lab-label {
    font-size: 0.6875rem;
  }
}
@media (min-width: 768px) {
  .ts-nav-lab-label {
    font-size: 0.75rem;
  }
}
.ts-nav-lab-cube {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  transition: transform 0.2s ease;
  pointer-events: none;
}
@media (min-width: 768px) {
  .ts-nav-lab-cube {
    width: 2.25rem;
    height: 2.25rem;
  }
}
.ts-nav-lab-cube .ts-cube-outline__svg,
.ts-nav-lab-cube svg {
  display: block;
  width: 100%;
  height: 100%;
}

/* Menu overlay */
#menu-overlay.active {
  opacity: 1;
  pointer-events: all;
}


/* ===================================
   PARALLAX STRIPES
   =================================== */
.parallax-stripes {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: var(--z-stripes);
  overflow: hidden;
  transform: translateZ(0);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

/* Hero-only stripes: sopra lo sfondo dell'hero, sotto 3D/testo */
.hero-stripes {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 5;
  overflow: hidden;
  transform: translateZ(0);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

.stripe {
  position: absolute;
  width: 150%;
  height: 400px;
  transform: rotate(-40deg) translateZ(0);
  will-change: transform;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  transform-style: preserve-3d;
  -webkit-transform-style: preserve-3d;
}

/* Stripe colors using CSS variables */
.stripe-1 {
  top: 10%;
  left: -25%;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(166, 194, 56, 0.08) 20%,
    rgba(166, 194, 56, 0.08) 50%,
    rgba(166, 194, 56, 0.08) 80%,
    transparent 100%
  );
}

.stripe-2 {
  top: 25%;
  left: -25%;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(121, 172, 50, 0.08) 20%,
    rgba(121, 172, 50, 0.08) 50%,
    rgba(121, 172, 50, 0.08) 80%,
    transparent 100%
  );
}

.stripe-3 {
  top: 40%;
  left: -25%;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(69, 123, 50, 0.08) 20%,
    rgba(69, 123, 50, 0.08) 50%,
    rgba(69, 123, 50, 0.08) 80%,
    transparent 100%
  );
}

.stripe-4 {
  top: 55%;
  left: -25%;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(40, 81, 40, 0.08) 20%,
    rgba(40, 81, 40, 0.08) 50%,
    rgba(40, 81, 40, 0.08) 80%,
    transparent 100%
  );
}

.stripe-5 {
  top: 70%;
  left: -25%;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(29, 45, 26, 0.08) 20%,
    rgba(29, 45, 26, 0.08) 50%,
    rgba(29, 45, 26, 0.08) 80%,
    transparent 100%
  );
}

/* Extra stripes (denser pattern) — same look, interleaved positions */
.stripe-6 {
  top: 17.5%;
  left: -25%;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(166, 194, 56, 0.08) 20%,
    rgba(166, 194, 56, 0.08) 50%,
    rgba(166, 194, 56, 0.08) 80%,
    transparent 100%
  );
}

.stripe-7 {
  top: 32.5%;
  left: -25%;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(121, 172, 50, 0.08) 20%,
    rgba(121, 172, 50, 0.08) 50%,
    rgba(121, 172, 50, 0.08) 80%,
    transparent 100%
  );
}

.stripe-8 {
  top: 47.5%;
  left: -25%;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(69, 123, 50, 0.08) 20%,
    rgba(69, 123, 50, 0.08) 50%,
    rgba(69, 123, 50, 0.08) 80%,
    transparent 100%
  );
}

.stripe-9 {
  top: 62.5%;
  left: -25%;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(40, 81, 40, 0.08) 20%,
    rgba(40, 81, 40, 0.08) 50%,
    rgba(40, 81, 40, 0.08) 80%,
    transparent 100%
  );
}

.stripe-10 {
  top: 77.5%;
  left: -25%;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(29, 45, 26, 0.08) 20%,
    rgba(29, 45, 26, 0.08) 50%,
    rgba(29, 45, 26, 0.08) 80%,
    transparent 100%
  );
}

/* ===================================
   CLOUDFLARE TURNSTILE (footer form) — responsive
   =================================== */
/* Non usare min-width:0 sul root né flex+min-w-0 sul wrapper: collassa il widget (iframe a larghezza 0).
   Non forzare width:100% sull'iframe: Turnstile imposta dimensioni interne; max-width basta su mobile. */
.turnstile-row {
  overflow-x: auto;
  overflow-y: visible;
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
}
.turnstile-responsive {
  display: block;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  min-height: 4rem;
}
.turnstile-responsive > div {
  max-width: 100%;
  box-sizing: border-box;
}
.turnstile-responsive iframe {
  max-width: 100%;
  box-sizing: border-box;
}

/* ===================================
   PERFORMANCE OPTIMIZATIONS
   =================================== */

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  .glass {
    background: rgba(255, 255, 255, 0.98);
    border: 2px solid var(--text-primary);
  }
}

/* ===================================
   PARALLAX STRIPES — hub & catalog pages
   (all-stirrups, classic-stirrups, disciplines, dressage, hunter, jumping,
   safety-stirrups, endurance-racing-polo, collections)
   =================================== */
.parallax-stripes .stripe-1 {
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(166, 194, 56, 0.22) 20%,
    rgba(166, 194, 56, 0.22) 50%,
    rgba(166, 194, 56, 0.22) 80%,
    transparent 100%
  );
}
.parallax-stripes .stripe-2 {
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(121, 172, 50, 0.2) 20%,
    rgba(121, 172, 50, 0.2) 50%,
    rgba(121, 172, 50, 0.2) 80%,
    transparent 100%
  );
}
.parallax-stripes .stripe-3 {
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(69, 123, 50, 0.2) 20%,
    rgba(69, 123, 50, 0.2) 50%,
    rgba(69, 123, 50, 0.2) 80%,
    transparent 100%
  );
}
.parallax-stripes .stripe-4 {
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(40, 81, 40, 0.2) 20%,
    rgba(40, 81, 40, 0.2) 50%,
    rgba(40, 81, 40, 0.2) 80%,
    transparent 100%
  );
}
.parallax-stripes .stripe-5 {
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(29, 45, 26, 0.18) 20%,
    rgba(29, 45, 26, 0.18) 50%,
    rgba(29, 45, 26, 0.18) 80%,
    transparent 100%
  );
}

/* ===================================
   VENICE — storytelling (venice.html)
   =================================== */
/* Venice storytelling: full-viewport bg + Ken Burns */

.venice-page { position: relative; min-height: 100vh; }

.venice-bg {

    position: fixed;

    inset: 0;

    z-index: 0;

    overflow: hidden;

}

.venice-bg img {

    position: absolute;

    width: 110%;

    height: 110%;

    left: -5%;

    top: -5%;

    object-fit: cover;

    animation: venice-kenburns 22s ease-in-out infinite alternate;

}

@media (prefers-reduced-motion: reduce) {

    .venice-bg img { animation: none; }

}

@keyframes venice-kenburns {

    0%   { transform: scale(1) translate(0, 0); }

    100% { transform: scale(1.08) translate(-2.5%, -1.5%); }

}

.venice-bg-overlay {

    position: absolute;

    inset: 0;

    background: linear-gradient(180deg, rgba(29,45,26,0.4) 0%, rgba(29,45,26,0.55) 50%, rgba(29,45,26,0.7) 100%);

    z-index: 1;

}

/* Venice diagonal stripes: davanti al background, visibili sopra sfondo e overlay */

.venice-stripes {

    position: fixed;

    top: 0;

    left: 0;

    width: 100%;

    height: 100%;

    pointer-events: none;

    z-index: 1.1;

    overflow: hidden;

    transform: translateZ(0);

    backface-visibility: hidden;

}

.venice-stripes .stripe {

    position: absolute;

    width: 150%;

    height: 380px;

    transform: rotate(-38deg) translateZ(0);

    will-change: transform;

    backface-visibility: hidden;

}

.venice-stripes .stripe-1 {

    top: 8%;

    left: -25%;

    background: linear-gradient(90deg, transparent 0%, rgba(180,140,80,0.28) 20%, rgba(180,140,80,0.35) 50%, rgba(180,140,80,0.28) 80%, transparent 100%);

}

.venice-stripes .stripe-2 {

    top: 24%;

    left: -25%;

    background: linear-gradient(90deg, transparent 0%, rgba(166,194,56,0.25) 20%, rgba(166,194,56,0.32) 50%, rgba(166,194,56,0.25) 80%, transparent 100%);

}

.venice-stripes .stripe-3 {

    top: 40%;

    left: -25%;

    background: linear-gradient(90deg, transparent 0%, rgba(121,172,50,0.25) 20%, rgba(121,172,50,0.32) 50%, rgba(121,172,50,0.25) 80%, transparent 100%);

}

.venice-stripes .stripe-4 {

    top: 56%;

    left: -25%;

    background: linear-gradient(90deg, transparent 0%, rgba(69,123,50,0.27) 20%, rgba(69,123,50,0.34) 50%, rgba(69,123,50,0.27) 80%, transparent 100%);

}

.venice-stripes .stripe-5 {

    top: 72%;

    left: -25%;

    background: linear-gradient(90deg, transparent 0%, rgba(29,45,26,0.3) 20%, rgba(29,45,26,0.38) 50%, rgba(29,45,26,0.3) 80%, transparent 100%);

}

/* Scroll scenes: emotional overlay per chapter */

.venice-scene {

    position: fixed;

    inset: 0;

    z-index: 1.2;

    pointer-events: none;

    opacity: 0;

    transition: opacity 0.6s ease;

}

.venice-scene-1 { background: linear-gradient(180deg, rgba(180,140,80,0.18) 0%, rgba(29,45,26,0.5) 40%, rgba(29,45,26,0.65) 100%); }

.venice-scene-2 { background: linear-gradient(180deg, rgba(70,90,110,0.12) 0%, rgba(29,45,26,0.52) 50%, rgba(20,30,40,0.7) 100%); }

.venice-scene-3 { background: linear-gradient(180deg, rgba(29,45,26,0.5) 0%, rgba(15,22,18,0.75) 50%, rgba(10,15,12,0.85) 100%); }

.venice-scene-4 { background: linear-gradient(180deg, rgba(220,210,190,0.08) 0%, rgba(29,45,26,0.45) 40%, rgba(60,50,45,0.6) 100%); }

/* Parallax layer: fixed, image 75vw, centered, diagonal parallax on scroll */

.venice-parallax {

    position: fixed;

    inset: 0;

    z-index: 0.5;

    overflow: hidden;

    pointer-events: none;

    display: flex;

    align-items: center;

    justify-content: center;

}

.venice-parallax-inner {

    width: 100vw;

    height: 60vh;

    position: relative;

    overflow: hidden;

}

.venice-parallax img {

    position: absolute;

    width: auto;

    height: 100%;

    left: 0;

    top: 0;

    object-fit: contain;

    object-position: left center;

    will-change: transform;

    opacity: 0.85;

}

.venice-content { position: relative; z-index: 2; }



/* Glass luxury */

.venice-glass {

    background: rgba(255, 255, 255, 0.08);

    backdrop-filter: blur(16px) saturate(140%);

    -webkit-backdrop-filter: blur(16px) saturate(140%);

    border: 1px solid rgba(255, 255, 255, 0.15);

    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.2);

}



/* Chapter blocks: initial state for GSAP */

.venice-chapter { opacity: 0; transform: translateY(28px); }

.venice-chapter-title { opacity: 0; transform: translateY(16px); }

.venice-chapter-body { opacity: 0; transform: translateY(12px); }

/* Parallax target: will-change for smooth vertical drift */

.venice-chapter-parallax { will-change: transform; }

/* ===================================
   PARA-DRESSAGE — Swiper (product-venice-para-dressage.html)
   =================================== */
.vpd-swiper .swiper-pagination-bullet {
  background: #457b32;
  opacity: 0.4;
}
.vpd-swiper .swiper-pagination-bullet-active {
  background: #457b32;
  opacity: 1;
}
.vpd-swiper .swiper-button-prev,
.vpd-swiper .swiper-button-next {
  color: #457b32;
}
.vpd-swiper .swiper-button-prev::after,
.vpd-swiper .swiper-button-next::after {
  font-size: 1.25rem;
  font-weight: 700;
}

/* ===================================
   TS LAB — CTA configuratore 3D
   =================================== */
.ts-lab-cta {
  display: grid;
  grid-template-columns: 1fr;
  grid-template-areas:
    "claim"
    "cols";
  gap: 1.25rem;
  align-items: stretch;
  width: 100%;
  box-sizing: border-box;
  text-decoration: none;
}
.ts-lab-cta__claim {
  grid-area: claim;
  margin: 0;
  width: 100%;
  max-width: none;
  text-align: center;
  text-wrap: balance;
  font-size: clamp(0.875rem, 2.5vw, 1.0625rem);
  line-height: 1.45;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.92);
  padding: 0 0.25rem;
}
.ts-lab-cta__cols {
  grid-area: cols;
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
  width: 100%;
  align-items: center;
  justify-items: center;
}
.ts-lab-cta__logo {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
}
.ts-lab-cta__logo-img {
  display: block;
  width: min(72vw, 11rem);
  height: auto;
  transition: transform 0.2s ease;
}
.ts-lab-cta:hover .ts-lab-cta__logo-img,
.ts-lab-cta:focus-visible .ts-lab-cta__logo-img {
  transform: scale(1.02);
}
@media (min-width: 640px) {
  .ts-lab-cta {
    gap: 1.5rem;
  }
  .ts-lab-cta__cols {
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem 2rem;
    align-items: center;
  }
  .ts-lab-cta__logo-img {
    width: 10rem;
  }
}
@media (min-width: 768px) {
  .ts-lab-cta {
    gap: 1.75rem;
  }
  .ts-lab-cta__claim {
    font-size: 1.0625rem;
  }
  .ts-lab-cta__cols {
    gap: 2rem 2.5rem;
  }
  .ts-lab-cta__logo-img {
    width: 11rem;
  }
}
@media (min-width: 1024px) {
  .ts-lab-cta__logo-img {
    width: 11.5rem;
  }
}

/* Cubo 3D + etichetta CONFIGURATOR */
.ts-lab-cta__cube-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  flex-shrink: 0;
  width: 100%;
}
.ts-lab-cta__cube-label {
  font-family: var(--font-montserrat, 'Montserrat', sans-serif);
  font-size: 0.625rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  line-height: 1;
  text-transform: uppercase;
  color: var(--ts-meadow);
  pointer-events: none;
  transition: color 0.2s ease;
}
.ts-lab-cta:hover .ts-lab-cta__cube-label,
.ts-lab-cta:focus-visible .ts-lab-cta__cube-label {
  color: var(--ts-acid);
}
@media (min-width: 640px) {
  .ts-lab-cta__cube-label {
    font-size: 0.6875rem;
  }
}
@media (min-width: 768px) {
  .ts-lab-cta__cube-label {
    font-size: 0.75rem;
  }
}

/* Cubo 3D — animazione SVG SMIL (wireframe ruotato nel tempo) */
.ts-lab-cta .ts-cube-outline {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: min(42vw, 7.5rem);
  height: min(42vw, 7.5rem);
  min-width: 6.25rem;
  min-height: 6.25rem;
}
@media (min-width: 640px) {
  .ts-lab-cta .ts-cube-outline {
    width: 6.25rem;
    height: 6.25rem;
    min-width: 6.25rem;
    min-height: 6.25rem;
  }
}
@media (min-width: 768px) {
  .ts-lab-cta .ts-cube-outline {
    width: 7rem;
    height: 7rem;
    min-width: 7rem;
    min-height: 7rem;
  }
}
.ts-cube-outline__svg {
  display: block;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

/* ===================================
   TRK BRIDGE — toast ORDER / carrello WooCommerce
   (condiviso tra le pagine prodotto con trk-bridge.js)
   =================================== */
.trk-bridge-toast-container {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10060;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  padding: 0.75rem 0.75rem max(1rem, env(safe-area-inset-bottom));
  padding-left: max(0.75rem, env(safe-area-inset-left));
  padding-right: max(0.75rem, env(safe-area-inset-right));
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  align-items: stretch;
  pointer-events: none;
  transform: translateZ(0);
  -webkit-transform: translateZ(0);
  isolation: isolate;
}
@media (min-width: 640px) {
  .trk-bridge-toast-container {
    left: auto;
    right: max(1rem, env(safe-area-inset-right));
    bottom: max(1rem, env(safe-area-inset-bottom));
    width: min(22rem, calc(100vw - 2rem));
    max-width: min(22rem, calc(100vw - 2rem));
    align-items: stretch;
  }
}
.trk-bridge-toast {
  pointer-events: auto;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
  border-radius: 1rem;
  box-shadow: 0 10px 40px rgba(29, 45, 26, 0.15), 0 4px 12px rgba(0, 0, 0, 0.08);
  padding: 0.75rem 0.875rem;
  min-height: 44px;
  display: flex;
  align-items: flex-start;
  gap: 0.625rem;
  text-align: left;
  font-size: clamp(0.8125rem, 3.5vw, 0.875rem);
  line-height: 1.45;
  background: var(--glass-bg, rgba(255, 255, 255, 0.98));
  border: 1px solid var(--glass-border, rgba(45, 44, 36, 0.12));
  opacity: 1;
}
@media (min-width: 640px) {
  .trk-bridge-toast {
    align-items: center;
    padding: 0.875rem 1rem;
  }
}
.trk-bridge-toast[data-type="success"] { border-left: 4px solid var(--ts-fern, #457B32); }
.trk-bridge-toast[data-type="error"] { border-left: 4px solid var(--ts-night, #1D2D1A); }
.trk-bridge-toast[data-type="loading"] { border-left: 4px solid var(--ts-meadow, #79AC32); }
.trk-bridge-toast[data-type="info"] { border-left: 4px solid var(--ts-meadow, #79AC32); }
.trk-bridge-toast.is-exiting { animation: trk-toast-out 0.25s ease-in forwards; }
@media (prefers-reduced-motion: reduce) {
  .trk-bridge-toast { animation: none; }
  .trk-bridge-toast.is-exiting { animation: trk-toast-out-reduced 0.15s ease forwards; }
}
/* Mobile: niente slide-in da opacity 0 — su WebKit l’ingresso poteva restare “congelato” e il toast invisibile */
@media (max-width: 639.98px) {
  #trk-bridge-toast-container > .trk-bridge-toast:not(.is-exiting) {
    animation: none !important;
    opacity: 1 !important;
    transform: translate3d(0, 0, 0) !important;
  }
  #trk-bridge-toast-container > .trk-bridge-toast.is-exiting {
    animation: trk-toast-out-mobile 0.22s ease forwards !important;
  }
}
/* Desktop: animazione entrata */
@media (min-width: 640px) {
  #trk-bridge-toast-container > .trk-bridge-toast:not(.is-exiting) {
    animation: trk-toast-in-desktop 0.35s cubic-bezier(0.19, 1, 0.22, 1) forwards !important;
  }
  #trk-bridge-toast-container > .trk-bridge-toast.is-exiting {
    animation: trk-toast-out 0.25s ease-in forwards !important;
  }
}
@media (prefers-reduced-motion: reduce) {
  #trk-bridge-toast-container > .trk-bridge-toast:not(.is-exiting) {
    animation: none !important;
    opacity: 1 !important;
    transform: translate3d(0, 0, 0) !important;
  }
  #trk-bridge-toast-container > .trk-bridge-toast.is-exiting {
    animation: trk-toast-out-reduced 0.15s ease forwards !important;
  }
}
@keyframes trk-toast-out-mobile {
  from { opacity: 1; transform: translate3d(0, 0, 0); }
  to { opacity: 0; transform: translate3d(0, 12px, 0); }
}
@keyframes trk-toast-in-desktop {
  from { opacity: 0; transform: translateX(100%); }
  to { opacity: 1; transform: translateX(0); }
}
@keyframes trk-toast-out {
  from { opacity: 1; transform: translateY(0) scale(1); }
  to { opacity: 0; transform: translateY(20%) scale(0.98); }
}
@keyframes trk-toast-out-reduced {
  from { opacity: 1; }
  to { opacity: 0; }
}
.trk-bridge-toast-icon {
  flex-shrink: 0;
  width: 1.25rem;
  height: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
}
.trk-bridge-toast-icon svg { width: 1.25rem; height: 1.25rem; }
.trk-bridge-toast-icon-success { color: var(--ts-fern, #457B32); }
.trk-bridge-toast-icon-error { color: var(--ts-night, #1D2D1A); }
.trk-bridge-toast-body {
  flex: 1;
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.trk-bridge-toast-body a {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  margin-top: 0.375rem;
  font-weight: 700;
  color: var(--ts-fern, #457B32);
  text-underline-offset: 3px;
  min-height: 44px;
  padding: 0.25rem 0;
  max-width: 100%;
}
.trk-bridge-toast-body a:hover { text-decoration: underline; }
.trk-bridge-toast-body a:focus-visible { outline: 2px solid var(--ts-meadow); outline-offset: 2px; }
.trk-bridge-toast-close {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  border: 0;
  background: transparent;
  border-radius: 0.5rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ts-dark, #2D2C24);
  opacity: 0.7;
  transition: opacity 0.2s ease, background 0.2s ease;
}
.trk-bridge-toast-close:hover { opacity: 1; background: rgba(0, 0, 0, 0.06); }
.trk-bridge-toast-close:focus-visible { outline: 2px solid var(--ts-meadow); outline-offset: 2px; opacity: 1; }
.trk-bridge-toast-close svg { width: 1.25rem; height: 1.25rem; }
.trk-bridge-spinner {
  width: 1.25rem;
  height: 1.25rem;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: trk-spin 0.7s linear infinite;
}
#trk-bridge-toast-container .trk-bridge-spinner {
  border: 2px solid rgba(29, 45, 26, 0.12);
  border-top-color: var(--ts-meadow, #79ac32);
  animation: trk-spin 0.7s linear infinite !important;
}
@media (prefers-reduced-motion: reduce) {
  .trk-bridge-spinner { animation: trk-spin 1.2s linear infinite; }
  #trk-bridge-toast-container .trk-bridge-spinner {
    animation: trk-spin 1.2s linear infinite !important;
  }
}
@keyframes trk-spin { to { transform: rotate(360deg); } }
/* Schermi stretti: messaggi lunghi scrollabili, niente overflow orizzontale */
@media (max-width: 639.98px) {
  #trk-bridge-toast-container .trk-bridge-toast-body {
    max-height: min(45vh, 260px);
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
  }
}
