/* Prevent the full-bleed/pinned hero from creating a horizontal page scrollbar.
 * This does not touch vertical overflow, so ScrollTrigger scrolling/pinning is unchanged. */
html.wsm-hero-no-horizontal-scroll,
body.wsm-hero-no-horizontal-scroll {
    overflow-x: hidden !important;
}

@supports (overflow: clip) {
    html.wsm-hero-no-horizontal-scroll,
    body.wsm-hero-no-horizontal-scroll {
        overflow-x: clip !important;
    }
}

.wsm-hero-section-gsap {
    position: relative;
    width: 100%;
}

/* ScrollTrigger injects inline dimensions on the pin spacer. Keep them inside
 * the widget width so the hero never creates horizontal page overflow. */
.wsm-hero-section-gsap > .pin-spacer,
.wsm-hero-section-gsap .pin-spacer {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box;
}

.wsm-hero-section-gsap__stage {
    position: relative;
    width: 100%;
    height: 100vh;
    height: 100svh;
    min-height: 560px;
    overflow: hidden;
    isolation: isolate;
}

.wsm-hero-section-gsap--full-bleed .wsm-hero-section-gsap__stage {
    width: 100vw;
    max-width: none;
    margin-left: calc(50% - 50vw);
}

/* There is now one nested container only: Start Preview. */
.wsm-hero-section-gsap__stage > .scroller-start-box {
    position: absolute !important;
    inset: 0;
    z-index: 1;
    width: 100%;
    max-width: none;
    min-height: 100%;
    margin: 0;
    overflow: visible !important;
}

/* Only the real image inside .zoom-pic is animated. Ancestors on its path are
 * marked by JS so the image can grow beyond its original Elementor box while
 * the stage itself remains the final clipping viewport. */
.wsm-hero-section-gsap .wsm-hero-section-gsap__zoom-ancestor,
.wsm-hero-section-gsap .zoom-pic,
.wsm-hero-section-gsap .zoom-pic .elementor-widget-container {
    overflow: visible !important;
}

.wsm-hero-section-gsap .zoom-pic {
    position: relative;
    z-index: 100;
}

.wsm-hero-section-gsap .zoom-pic img {
    position: relative;
    z-index: 1000;
    display: block;
    transform-origin: 50% 50%;
    translate: var(--wsm-hero-effect-x, 0px) var(--wsm-hero-effect-y, 0px);
    scale: var(--wsm-hero-effect-scale, 1);
    backface-visibility: hidden;
}

/* Mobile uses the exact same layout + GSAP animation as desktop.
 * Only lock the stage viewport height so Safari/Chrome browser chrome cannot
 * change the ScrollTrigger geometry while scrolling. Do NOT override the Start
 * Preview width/height here: Elementor's responsive layout must remain intact. */
@media (max-width: 767px), (hover: none) and (pointer: coarse) {
    .wsm-hero-section-gsap__stage {
        height: var(--wsm-hero-viewport-height, 100vh);
        min-height: 0;
    }

    .wsm-hero-section-gsap .zoom-pic img {
        backface-visibility: hidden;
        -webkit-backface-visibility: hidden;
    }
}

.wsm-hero-section-gsap--reduced .wsm-hero-section-gsap__stage {
    height: auto;
    min-height: 0;
    overflow: visible;
}

.wsm-hero-section-gsap--reduced .wsm-hero-section-gsap__stage > .scroller-start-box {
    position: relative !important;
    inset: auto;
    min-height: 100vh;
    min-height: 100svh;
}

/* Elementor editor: keep the single Start Preview directly editable and never
 * run the pinned frontend geometry inside the editor canvas. */
.elementor-editor-active .wsm-hero-section-gsap__stage,
.elementor-editor-preview .wsm-hero-section-gsap__stage {
    display: block;
    height: auto !important;
    min-height: 0;
    overflow: visible;
    padding: 12px;
    background: rgba(127, 127, 127, 0.06);
}

.elementor-editor-active .wsm-hero-section-gsap--full-bleed .wsm-hero-section-gsap__stage,
.elementor-editor-preview .wsm-hero-section-gsap--full-bleed .wsm-hero-section-gsap__stage {
    width: 100%;
    margin-left: 0;
}

.elementor-editor-active .wsm-hero-section-gsap__stage > .scroller-start-box,
.elementor-editor-preview .wsm-hero-section-gsap__stage > .scroller-start-box,
.elementor-editor-active .wsm-hero-section-gsap__stage > .e-con:first-of-type,
.elementor-editor-preview .wsm-hero-section-gsap__stage > .e-con:first-of-type {
    position: relative !important;
    inset: auto;
    min-height: 320px;
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
    outline: 1px dashed rgba(127, 127, 127, 0.35);
}
