/* Gallery Carousel Styling */
.alpha-carousel-container {
    padding-top: 20px;
    padding-bottom: 20px;
    position: relative;
    overflow: visible; /* Prevent clipping of borders and lift effect */
}

/* Hide hover zoom but keep the layout structure */
.zoomImg {
    visibility: hidden !important;
    display: none !important;
}

/* Ensure the main slider uses Ease-In-Out motion for a smooth start and slower end */
.flex-viewport, 
.flex-viewport .slides, 
.flex-viewport ul.slides li,
.woocommerce-product-gallery__wrapper,
.woocommerce-product-gallery__image {
    transition-timing-function: ease-in-out !important;
    transition-duration: 800ms !important;
    animation-timing-function: ease-in-out !important;
   
}

.woocommerce-product-gallery .flex-viewport{
    
    border: 1px solid #999 !important;
}
.alpha-swiper-thumbs {
    padding: 15px 0; /* Plenty of space for borders and lift */
    margin: 10px 0;
}

.alpha-swiper-thumbs .swiper-slide {
    width: auto !important;
    height: var(--alpha-thumb-height) !important;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden; /* Contains the zoom effect inside the border */
    border: 1px solid #999 !important; /* Static outer border */
    border-radius: 4px;
    background: #fff;
    box-sizing: border-box;
}

/* Hover: Tiny Zoom the image ONLY, keep border steady */
.alpha-swiper-thumbs .swiper-slide:hover img {
    transform: scale(1.15);
}

/* Base style for the actual image */
.alpha-swiper-thumbs .swiper-slide img {
    max-width: 96%; /* Leave a small margin for the zoom */
    max-height: 96%;
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
    transition: transform 0.3s ease;
}

/* Active Highlight: Minimalist 1px blue border on the container */
.alpha-swiper-thumbs .swiper-slide.alpha-active-thumb {
    border-color: #007cba !important;
    box-shadow: 0 2px 8px rgba(0,124,186,0.2) !important;
}

/* Hide default thumbnails if our carousel/grid is active */
.alpha-carousel-active .flex-control-thumbs,
.alpha-grid-active .flex-control-thumbs,
.alpha-carousel-active ol.flex-control-nav,
.alpha-grid-active ol.flex-control-nav {
    display: none !important;
    opacity: 0 !important;
    visibility: hidden !important;
    height: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
}

/* Swiper navigation adjustments */
.alpha-swiper-thumbs .swiper-button-next,
.alpha-swiper-thumbs .swiper-button-prev {
    color: #ffffff !important;
    background: #007cba !important;
    width: 44px !important;
    height: 44px !important;
    border-radius: 50% !important;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    transition: all 0.3s ease;
    border: 2px solid #ffffff;
}

.alpha-swiper-thumbs .swiper-button-next:hover,
.alpha-swiper-thumbs .swiper-button-prev:hover {
    background: #006799 !important;
    transform: scale(1.1);
}

.alpha-swiper-thumbs .swiper-button-next::after,
.alpha-swiper-thumbs .swiper-button-prev::after {
    font-size: 18px !important;
    font-weight: 900 !important;
}

/* Adjust button positions to center on thumbnails */
.alpha-swiper-thumbs .swiper-button-prev {
    left: 5px !important;
}
.alpha-swiper-thumbs .swiper-button-next {
    right: 5px !important;
}

/* Download Button Styling */
.alpha-download-btn {
    display: inline-block;
    transition: all 0.3s ease;
}

.alpha-download-btn:hover {
    opacity: 0.9;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

/* Main Gallery Minimal Arrows */
.woocommerce-product-gallery .flex-direction-nav {
    list-style: none;
    margin: 0;
    padding: 0;
}

.woocommerce-product-gallery .flex-direction-nav a {
    position: absolute;
    top: 35%; /* Precisely centered on the slide area */
    transform: translateY(-50%);
    z-index: 10;
    width: 40px;
    height: 40px;
    background: rgba(0,0,0,0.1);
    color: #fff !important;
    text-decoration: none !important;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: all 0.3s ease;
    border-radius: 50%;
    font-size: 0; /* Hide default text */
}

/* Only show arrows when hovering the main image viewport or the arrows themselves */
.woocommerce-product-gallery .flex-viewport:hover ~ .flex-direction-nav a,
.woocommerce-product-gallery .flex-direction-nav:hover a {
    opacity: 1;
    background: rgba(0,0,0,0.4);
}

.woocommerce-product-gallery .flex-direction-nav a:hover {
    background: rgba(0,0,0,0.7);
    transform: translateY(-50%) scale(1.1);
}

.woocommerce-product-gallery .flex-direction-nav a.flex-prev {
    left: 20px;
}

.woocommerce-product-gallery .flex-direction-nav a.flex-next {
    right: 20px;
}

/* Custom Minimal Arrow Heads */
.woocommerce-product-gallery .flex-direction-nav a::before {
    content: '';
    display: block;
    width: 12px;
    height: 12px;
    border-top: 2px solid #fff;
    border-left: 2px solid #fff;
    position: absolute;
    top: 50%;
    left: 50%;
}

.woocommerce-product-gallery .flex-direction-nav a.flex-prev::before {
    transform: translate(-35%, -50%) rotate(-45deg);
}

.woocommerce-product-gallery .flex-direction-nav a.flex-next::before {
    transform: translate(-65%, -50%) rotate(135deg);
}

/* Grid Mode Styling */
.alpha-thumbnails-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(var(--alpha-thumb-width), 1fr));
    gap: 10px;
    margin: 15px 0;
}

.alpha-grid-thumb {
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border: 1px solid #999 !important;
    border-radius: 4px;
    background: #fff;
    box-sizing: border-box;
    aspect-ratio: var(--alpha-thumb-width) / var(--alpha-thumb-height);
    height: auto !important;
}

.alpha-grid-thumb:hover img {
    transform: scale(1.15);
}

.alpha-grid-thumb img {
    max-width: 96%;
    max-height: 96%;
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
    transition: transform 0.3s ease;
}

.alpha-grid-thumb.alpha-active-thumb {
    border-color: #007cba !important;
    box-shadow: 0 2px 8px rgba(0,124,186,0.2) !important;
}
