/* Custom Product Gallery Styles */

/* Thumbnails Slider Container */
.product-thumbs-slider {
    display: flex !important;
    gap: 15px !important;
}

/* Thumbnail Swiper Container */
.tf-product-media-thumbs {
    margin: 0 !important;
    width: 126px !important;
    height: 550px !important; /* Fixed height to match main image */
    overflow: hidden !important;
    position: relative !important;
}

/* Thumbnail Navigation Arrows */
.tf-product-media-thumbs .swiper-button-next,
.tf-product-media-thumbs .swiper-button-prev {
    width: 28px !important;
    height: 28px !important;
    background: #fff;
    color: #000;
    border-radius: 50%;
    border: 1px solid #ddd;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    z-index: 10;
}

.tf-product-media-thumbs .swiper-button-next::after,
.tf-product-media-thumbs .swiper-button-prev::after {
    font-size: 12px !important;
    font-weight: bold;
}

.tf-product-media-thumbs .swiper-button-next {
    bottom: -10px !important;
    left: 50% !important;
    transform: translateX(-50%) rotate(90deg) !important;
    top: auto !important;
}

.tf-product-media-thumbs .swiper-button-prev {
    top: -10px !important;
    left: 50% !important;
    transform: translateX(-50%) rotate(90deg) !important;
    bottom: auto !important;
}

.tf-product-media-thumbs:hover .swiper-button-next { bottom: 10px !important; }
.tf-product-media-thumbs:hover .swiper-button-prev { top: 10px !important; }

/* Individual Thumbnail Slide */
.tf-product-media-thumbs .swiper-slide {
    width: 126px !important;
    height: 126px !important;
    margin-bottom: 12px !important; /* This will be handled by Swiper spaceBetween mostly */
    transform: none !important; /* Fix Tilt/Rotation */
    opacity: 1 !important;
    visibility: visible !important;
}

/* Thumbnail Item Wrapper */
.tf-product-media-thumbs .item {
    width: 126px !important;
    height: 126px !important;
    border-radius: 0 !important;
    border: 1px solid #ddd !important;
    overflow: hidden !important;
    cursor: pointer !important;
    transition: all 0.2s ease-in-out !important;
    background: #fff !important;
    padding: 2px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

/* Thumbnail Image */
.tf-product-media-thumbs .item img {
    width: 100% !important;
    height: 100% !important;
    object-fit: contain !important;
    border-radius: 0 !important;
    transform: none !important; /* Ensure image itself isn't rotated */
}

/* Active Thumbnail State */
.tf-product-media-thumbs .swiper-slide-thumb-active .item {
    border-color: #000 !important;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1) !important;
}

/* Hover Effect */
.tf-product-media-thumbs .item:hover {
    border-color: #999 !important;
}

/* Main Image Gallery */
.tf-product-media-main {
    height: 550px !important;
    border-radius: 4px !important;
    overflow: hidden !important;
}

.tf-product-media-main .item {
    height: 550px !important;
}

.tf-product-media-main .item img {
    object-fit: contain !important;
    width: 100% !important;
    height: 100% !important;
}

/* Disable default zoom styles/cursors */
.tf-image-zoom {
    cursor: default !important;
    pointer-events: none !important; /* Prevent drift from firing */
}

/* Mobile Responisve Logic */
@media (max-width: 1199px) {
    .product-thumbs-slider {
        display: flex !important;
        flex-direction: column !important;
        gap: 15px !important;
        width: 100% !important;
    }

    /* Move Main Image to Top */
    .flat-wrap-media-product {
        order: 1 !important;
        width: 100% !important;
    }

    /* Move Thumbs to Bottom */
    .tf-product-media-thumbs {
        order: 2 !important;
        width: 100% !important;
        height: 85px !important; /* Shorter on mobile */
        margin-top: 10px !important;
        overflow: hidden !important;
    }

    /* Thumbs slide on mobile */
    .tf-product-media-thumbs .swiper-slide {
        width: 80px !important;
        height: 80px !important;
        margin-bottom: 0 !important;
        margin-right: 10px !important;
    }

    .tf-product-media-thumbs .item {
        width: 80px !important;
        height: 80px !important;
    }

    /* Main image on mobile */
    .tf-product-media-main,
    .tf-product-media-main .item {
        height: 400px !important; /* Smaller on mobile */
    }

    /* Mobile arrows for thumbnails (horizontal) */
    .tf-product-media-thumbs .swiper-button-next,
    .tf-product-media-thumbs .swiper-button-prev {
        display: none !important; /* Swipe is better on mobile */
    }
}

/* For Lightbox compatibility - DISABLED */
#gallery-swiper-started div.item,
#gallery-swiper-started div.item img {
    cursor: default !important;
    pointer-events: none !important;
}

/* Main Preview Next/Prev Buttons */
.tf-product-media-main .button-style-arrow {
    background: rgba(255,255,255,0.7) !important;
    border: 1px solid #ddd !important;
    color: #222 !important;
    width: 44px !important;
    height: 44px !important;
    border-radius: 50% !important;
    transition: all 0.3s ease !important;
}

.tf-product-media-main .button-style-arrow:hover {
    background: #fff !important;
    box-shadow: 0 4px 15px rgba(0,0,0,0.15) !important;
}

.tf-product-media-main .button-style-arrow::after {
    font-size: 16px !important;
    font-weight: 800 !important;
}
