html.lenis,
html.lenis body {
  height: auto;
}

.lenis:not(.lenis-autoToggle).lenis-stopped {
  overflow: clip;
}

.lenis [data-lenis-prevent],
.lenis [data-lenis-prevent-wheel],
.lenis [data-lenis-prevent-touch],
.lenis [data-lenis-prevent-vertical],
.lenis [data-lenis-prevent-horizontal] {
  overscroll-behavior: contain;
}

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

.lenis.lenis-autoToggle {
  transition-property: overflow;
  transition-duration: 1ms;
  transition-behavior: allow-discrete;
}

/* ---------------------------------------------------------------
   XSSO additions
   --------------------------------------------------------------- */

/* Bootstrap sets `:root { scroll-behavior: smooth }` under a
   prefers-reduced-motion query. Native smooth scrolling and Lenis both
   try to own the scroll position, and the browser interpolating on top
   of Lenis's per-frame writes is exactly the jitter this rebuild is
   fixing. Turn it off wherever Lenis is running. */
html.lenis,
html.lenis body {
  scroll-behavior: auto !important;
}

/* Give the compositor a hint on the elements that move every frame.
   Scoped tightly on purpose: a blanket will-change costs memory and
   can make things slower, not faster. */
.lenis-scrolling .navbar {
  will-change: transform;
}

/* Long image-heavy sections: let the browser skip layout and paint work
   for the parts that are nowhere near the viewport. */
.xsso_collection_card,
.xsso_home_detailing_image_area {
  contain: layout paint style;
}

/* Blur-in reveals are the most expensive effect on these pages — the
   layer is re-rasterised on every frame of the tween. Promoting them
   for the duration keeps that off the main thread. */
[data-bgcolor],
.xsso_collection_card {
  backface-visibility: hidden;
}

@media (prefers-reduced-motion: reduce) {
  /* Core already skips Lenis entirely here; this stops the GSAP reveals
     from animating too. */
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}
