/* ===== PRETPOT SCROLL BACKGROUND ===== */

.pretpot-scroll-bg-active {
	position: relative;
	overflow: hidden;
	transition: background-color 0.8s ease, background-image 0.8s ease;
}

/* Video Background Container — default for non-scrub video types */
.pretpot-scroll-bg-video-wrapper {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	z-index: 0;
	pointer-events: none;
	overflow: hidden;
}

/* Scrub mode: wrapper is fixed and covers only the viewport.
   JS sets position:fixed, top:0, left:0, width:100%, height:100vh directly. */
.pretpot-scroll-bg-video-wrapper.pretpot-scrub-wrapper {
	position: fixed;
	height: 100vh;
	display: none; /* shown/hidden by JS based on section visibility */
}

.pretpot-scroll-bg-video {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	min-width: 100%;
	min-height: 100%;
	width: auto;
	height: auto;
	opacity: 0;
	transition: opacity 0.8s ease;
}

.pretpot-scroll-bg-video.active {
	opacity: 1;
}

/* Video Size Options */
.pretpot-scroll-bg-video-wrapper[data-video-size="cover"] .pretpot-scroll-bg-video {
	object-fit: cover;
}

.pretpot-scroll-bg-video-wrapper[data-video-size="contain"] .pretpot-scroll-bg-video {
	object-fit: contain;
}

.pretpot-scroll-bg-video-wrapper[data-video-size="auto"] .pretpot-scroll-bg-video {
	object-fit: none;
}

/* Ensure content stays above background */
.pretpot-scroll-bg-active > .elementor-container,
.pretpot-scroll-bg-active > .elementor-background-overlay {
	position: relative;
	z-index: 1;
}

/* Image Background Layers */
.pretpot-scroll-bg-image-layer {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background-size: cover;
	background-position: center center;
	background-repeat: no-repeat;
	opacity: 0;
	transition: opacity 0.8s ease;
	z-index: 0;
}

.pretpot-scroll-bg-image-layer.active {
	opacity: 1;
}

/* Gradient Background */
.pretpot-scroll-bg-active[data-scroll-bg-type="gradient"] {
	background-image: linear-gradient(45deg, transparent, transparent);
	transition: background-image 0.8s ease;
}

/* Loading State */
.pretpot-scroll-bg-loading {
	opacity: 0.5;
}

/* Smooth Transitions */
.pretpot-scroll-bg-transition-fast {
	transition-duration: 0.3s !important;
}

.pretpot-scroll-bg-transition-slow {
	transition-duration: 1.5s !important;
}

/* Mobile Optimization */
@media (max-width: 768px) {
	.pretpot-scroll-bg-video {
		display: none;
	}
	
	.pretpot-scroll-bg-active[data-mobile-optimize="yes"] {
		background-attachment: scroll !important;
	}
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
	.pretpot-scroll-bg-active,
	.pretpot-scroll-bg-video,
	.pretpot-scroll-bg-image-layer {
		transition-duration: 0.01ms !important;
	}
}
/* ===== VIDEO SCRUB BACKGROUND ===== */

/* The scrub video wrapper reuses the same base wrapper class;
   the JS sets inline styles for size/position so no extra rules needed there. */

/* Scrub video specific styles - override the default video positioning */
.pretpot-scroll-bg-video-wrapper .pretpot-scroll-bg-video.active {
    top: 0;
    left: 0;
    transform: none;
    min-width: none;
    min-height: none;
    width: 100%;
    height: 100%;
}

/* Fade overlay sits above the video but below section content */
.pretpot-scrub-fade-overlay {
    z-index: 1;
}

/* Keep section content above the fixed video backdrop */
.pretpot-scroll-bg-active > .elementor-container,
.pretpot-scroll-bg-active > .elementor-background-overlay,
.pretpot-scroll-bg-active > .elementor-shape {
    position: relative;
    z-index: 2;
}

/* Section itself needs a stacking context so its children sit above the fixed video */
.pretpot-scroll-bg-active {
    isolation: isolate;
}

/* When scrub is disabled on a device, hide the video wrapper */
@media (max-width: 767px) {
    .pretpot-scrub-mobile-disabled .pretpot-scroll-bg-video-wrapper {
        display: none;
    }
}

/* Reduced motion: freeze scrub video, hide fade overlay transitions */
@media (prefers-reduced-motion: reduce) {
    .pretpot-scrub-fade-overlay {
        transition: none !important;
    }
}

/* Video scrub performance optimizations */
.pretpot-scroll-bg-video-wrapper .pretpot-scroll-bg-video.active {
    will-change: transform;
    backface-visibility: hidden;
    transform: translateZ(0);
}

/* Ensure video container has correct stacking context */
.pretpot-scroll-bg-video-wrapper {
    transform: translateZ(0);
    backface-visibility: hidden;
}

/* Disable transitions on scrub video for smoother seeking */
.pretpot-scroll-bg-video-wrapper .pretpot-scroll-bg-video {
    transition: none !important;
}

/* Fade overlay smoothness */
.pretpot-scrub-fade-overlay {
    will-change: opacity;
    backface-visibility: hidden;
}

/* Force video scrub visibility */
.pretpot-scrub-wrapper {
    display: none; /* default; JS shows it when section is in view */
    visibility: visible !important;
    opacity: 1 !important;
    background: transparent !important;
}

/* Video fills its fixed container */
.pretpot-scrub-wrapper video {
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Remove any hiding on mobile for scrub */
.pretpot-scroll-bg-video {
    display: block !important;
}