/* Aggressive Fancybox 5 Fix */

/* Override Fancybox CSS Variables */
:root {
    --f-zIndex: 100000;
}

/* Main Container */
.fancybox__container {
    z-index: 100000 !important;
    position: fixed !important;
}

/* Backdrop (Dark Background) */
.fancybox__backdrop {
    z-index: 100001 !important; /* Base layer */
    background: rgba(0, 0, 0, 0.85) !important;
    opacity: 1 !important;
}

/* The Content Wrapper (Carousel/Slide) */
.fancybox__carousel {
    z-index: 100002 !important; /* Above backdrop */
}

/* The Slide Itself */
.fancybox__slide {
    z-index: 100003 !important;
}

/* The Content (Image Wrapper) */
.fancybox__content {
    z-index: 100004 !important;
    opacity: 1 !important;
    visibility: visible !important;
}

/* The Actual Image */
.fancybox__image {
    z-index: 100005 !important;
    opacity: 1 !important;
    transform: none !important; /* Prevent transform issues hiding it */
}

/* Interface Elements (Toolbar, Arrows) */
.fancybox__toolbar,
.fancybox__nav {
    z-index: 100010 !important; /* Topmost */
}

/* Fix for Bootstrap/Theme Header Conflicts */
.site-header, 
.navbar,
.sticky-top {
    z-index: 100 !important; /* Force theme elements lower */
}

/* Force body overflow logic if needed */
body.fancybox-active {
    overflow: hidden !important;
}
