.custom-acf-gallery-wrapper {
    width: 100%;
    max-width: 100%;
    margin-bottom: 2.5rem;
    display: block;
    box-sizing: border-box;
}
.custom-acf-gallery-wrapper .swiper {
    margin-left: auto;
    margin-right: auto;
    position: relative;
    overflow: hidden;
    list-style: none;
    padding: 0;
    z-index: 1;
    display: block;
}
/* FORCES FLEX LAYOUT IMMEDIATELY (Prevents stacking layout errors) */
.custom-acf-gallery-wrapper .swiper-wrapper {
    display: flex !important;
    flex-direction: row !important;
    width: 100%;
    height: 100%;
}
.custom-acf-gallery-wrapper .swiper-slide {
    flex-shrink: 0 !important;
    height: 100%;
    position: relative;
}
.custom-acf-gallery-wrapper .main-gallery-slider {
    width: 100%;
    aspect-ratio: 4 / 3;
    border-radius: 8px;
    margin-bottom: 12px;
    background-color: var(--at-black);
}
.custom-acf-gallery-wrapper .main-slider-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}
.custom-acf-gallery-wrapper .thumb-gallery-slider {
    width: 100%;
    height: 80px;
}
.custom-acf-gallery-wrapper .thumb-gallery-slider .swiper-slide {
    cursor: pointer;
    opacity: 0.4;
    transition: opacity 0.2s ease;
    border-radius: 4px;
    overflow: hidden;
    width: 22%; /* Fallback width for structural stability */
}
.custom-acf-gallery-wrapper .thumb-gallery-slider .swiper-slide-thumb-active {
    opacity: 1;
}
.custom-acf-gallery-wrapper .thumb-slider-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
/* Lightbox Layout Specifics */
.acf-gallery-lightbox-modal {
    border: none;
    background: rgba(0, 0, 0, 0.95);
    width: 100vw;
    height: 100vh;
    max-width: 100vw;
    max-height: 100vh;
    padding: 0;
    margin: 0;
    overflow: hidden;
    box-sizing: border-box;
}
.acf-gallery-lightbox-modal[open] {
    display: flex !important;
    align-items: center;
    justify-content: center;
}
.acf-gallery-lightbox-modal::backdrop {
    background: rgba(0, 0, 0, 0.95);
}
.acf-gallery-lightbox-modal .lightbox-gallery-slider {
    width: 100%;
    height: 100%;
}
.acf-gallery-lightbox-modal .swiper-slide {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100%;
    width: 100% !important;
}
.acf-gallery-lightbox-modal img {
    max-height: 85vh;
    max-width: 90vw;
    object-fit: contain;
}
.acf-gallery-lightbox-modal .lightbox-close-btn {
    position: fixed;
    top: 20px;
    right: 25px;
    background: none;
    border: none;
    color: #fff;
    font-size: 45px;
    cursor: pointer;
    z-index: 1000;
    line-height: 1;
}
/* 1. Establish the relative anchoring context on the sliders */
.custom-acf-gallery-wrapper .swiper {
    position: relative !important;
}

/* 2. Force Absolute Positioning and Layering */
.custom-acf-gallery-wrapper .swiper-button-next,
.custom-acf-gallery-wrapper .swiper-button-prev {
    position: absolute !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    z-index: 10 !important; /* Forces them to sit on top of the images */
    
    /* Layout styling */
    width: 44px;
    height: 44px;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(0, 0, 0, 0.05);
    border-radius: 50%;
    color: #1a1a1a;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transition: all 0.2s ease;
}

/* 3. Keep them safely inside the overflow:hidden boundaries */
.custom-acf-gallery-wrapper .swiper-button-prev {
    left: 15px !important;
    right: auto !important;
}
.custom-acf-gallery-wrapper .swiper-button-next {
    right: 15px !important;
    left: auto !important;
}

/* Hover effects */
.custom-acf-gallery-wrapper .swiper-button-next:hover,
.custom-acf-gallery-wrapper .swiper-button-prev:hover {
    background: #ffffff;
    transform: translateY(-50%) scale(1.05) !important;
    color: #000000;
}

/* Size adjustment for your custom SVG icons */
.custom-acf-gallery-wrapper .swiper-button-next svg,
.custom-acf-gallery-wrapper .swiper-button-prev svg {
    width: 20px;
    height: 20px;
    display: block;
}

/* 4. Lightbox (Dark Mode) Override Positioning */
.acf-gallery-lightbox-modal .swiper-button-next,
.acf-gallery-lightbox-modal .swiper-button-prev {
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #ffffff;
}

.acf-gallery-lightbox-modal .swiper-button-next:hover,
.acf-gallery-lightbox-modal .swiper-button-prev:hover {
    background: rgba(255, 255, 255, 0.3);
    color: #ffffff;
}