/* Flex container for the sliders */
.gallery-flex-container {
    display: flex;
    flex-direction: column; /* Stack thumbnails and main slider vertically */
    align-items: flex-start; /* Align items to the left */
    max-width: 100%; /* Adjust as needed */
    width: 100%;
    margin: 0 auto; /* Center the container */
    gap: 10px; /* Space between thumbnails and main slider */
    position: relative;
}

/* Thumbnail Slider */
.variation-gallery-slider-thumbnails {
    width: 100%; /* Full width for the thumbnail slider */
    flex-shrink: 0; /* Prevent the thumbnail slider from shrinking */
    order: 1; /* Ensure the thumbnail slider is on top */
}

.variation-gallery-slider-thumbnails .gallery-thumbnail {
    cursor: pointer;
    margin: 5px; /* Space between thumbnails */
    opacity: 0.6; /* Make thumbnails slightly transparent */
    transition: opacity 0.3s ease;
}

.variation-gallery-slider-thumbnails .gallery-thumbnail img {
    width: 46px;
    height: 46px;
    display: block;
}

.variation-gallery-slider-thumbnails .gallery-thumbnail.slick-current {
    opacity: 1; /* Highlight the active thumbnail */
}

/* Main Slider */
.variation-gallery-slider-main {
    flex-grow: 1; /* Allow the main slider to take up remaining space */
    width: 100%; /* Full width for the main slider */
    order: 2; /* Ensure the main slider is below the thumbnails */
}

.variation-gallery-slider-main .gallery-slide img {
    width: 100%;
    height: auto;
    display: block;
    cursor: zoom-in;
}


.variation-gallery-slider-thumbnails .gallery-thumbnail img {
    width: 46px; /* Adjust as needed */
    height: 46px; /* Adjust as needed */
    display: block;
    margin: 0 5px; /* Add horizontal spacing between thumbnails */
}


/* Main Slider Wrapper, Lightbox Container & OnSale Badge Positioning */
.main-slider-wrapper {
    position: relative !important;
    width: 100% !important;
    order: 2;
}

.main-slider-wrapper .lightbox-container,
.gallery-flex-container .lightbox-container {
    position: absolute !important;
    top: 15px !important;
    right: 15px !important;
    z-index: 99 !important;
    margin: 0 !important;
    padding: 0 !important;
}

.single-product div.product .main-slider-wrapper .onsale,
.single-product div.product .main-slider-wrapper span.onsale,
.single-product div.product .main-slider-wrapper .ast-onsale-card,
.ast-single-product-gallery-wrapper .main-slider-wrapper .onsale,
.ast-single-product-gallery-wrapper .main-slider-wrapper span.onsale,
.ast-single-product-gallery-wrapper .main-slider-wrapper .ast-onsale-card,
.woocommerce-product-gallery .main-slider-wrapper .onsale,
.woocommerce-product-gallery .main-slider-wrapper span.onsale,
.woocommerce-product-gallery .main-slider-wrapper .ast-onsale-card,
.main-slider-wrapper .onsale,
.main-slider-wrapper span.onsale,
.main-slider-wrapper .ast-onsale-card {
    position: absolute !important;
    top: 15px !important;
    left: 15px !important;
    right: auto !important;
    bottom: auto !important;
    z-index: 99 !important;
    margin: 0 !important;
}

.main-slider-wrapper div:has(> .onsale),
.woocommerce-product-gallery div:has(> .onsale),
.gallery-flex-container div:has(> .onsale),
.wc-block-components-product-sale-badge {
    background: transparent !important;
    background-color: transparent !important;
    box-shadow: none !important;
    border: none !important;
    padding: 0 !important;
    margin: 0 !important;
}

.lightbox-button {
    height: 2.2em;
    width: 2.2em;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid #ccc;
    color: #333;
    z-index: 99;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    padding: 0;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.15);
    transition: all 0.2s ease;
}

.lightbox-button:hover {
    background-color: #007cba;
    color: #fff;
    border-color: #007cba;
}

.spinner-container {
    display: block !important; /* Force display for debugging */
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1000;
    padding: 20px;
    border-radius: 10px;
}

.spinner-container i {
    font-size: 18px;
    color: #333; /* Spinner color */
}