/* WooCommerce Product Gallery Styles */
.wc-product-gallery-container {
    max-width: 100%;
    margin: 0 auto 40px;
}

/* Main product image */
.wc-product-main-image {
    width: 100%;
    margin-bottom: 15px;
    background: #fff;
    border-radius: 20px;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    position: relative;
    /* Fixed aspect ratio to prevent jumping */
    aspect-ratio: 1 / 1;
    min-height: 300px;
	border: 2px dashed #f9c824;
}

.wc-product-main-image a {
    display: block;
    width: 100%;
    height: 100%;
    position: relative;
    pointer-events: none; /* Disable click on the entire link */
}

.wc-product-main-image img {
    /* Animation for smooth image change */
    transition: opacity 0.3s ease;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    margin: auto;
	border-radius: 20px !important;
}

/* Add fade-in animation class */
.wc-product-main-image img.fade-in {
    opacity: 0;
    animation: fadeIn 0.4s ease forwards;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Zoom icon style */
.wc-gallery-zoom-icon {
    position: absolute;
    top: 10px;
    right: 10px;
    color: #333;
    width: 40px;
    height: 40px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    opacity: 1; 
    transition: background-color 0.3s ease;
    z-index: 10;
    pointer-events: auto; 
	background: #fff;
    border-radius: 50%;
}

/* Hover effect for zoom icon */
.wc-gallery-zoom-icon:hover {
    background-color: rgba(255, 255, 255, 1);
}

/* Use Font Awesome icon as fallback */
.wc-gallery-zoom-icon i {
    font-size: 18px;
}

/* If Font Awesome is not available, use a simple + character */


/* RTL support for zoom icon */
.rtl .wc-gallery-zoom-icon {
    left: auto;
    right: 10px;
}

/* Gallery thumbnails slider */
.wc-product-gallery-thumbs {
    width: 100%;
    padding: 10px 0;
}

.wc-product-gallery-thumbs .swiper-slide {
    height: auto;
    border-radius: 20px;
    overflow: hidden;
    opacity: 0.6;
    cursor: pointer;
    transition: all 0.3s ease;
    box-sizing: border-box;
    border: 2px solid #ddd;
}

.wc-product-gallery-thumbs .swiper-slide-thumb-active {
    opacity: 1;
    border-color: #f9c824;
}

.wc-product-gallery-thumb-image {
    width: 100% !important;
    height: 100% !important;
}

/* Navigation arrows */
.wc-product-gallery-thumbs .swiper-button-next,
.wc-product-gallery-thumbs .swiper-button-prev {
    color: #666;
    background: rgba(255, 255, 255, 0.7);
    width: 30px;
    height: 30px;
    border-radius: 50%;
    transition: background 0.3s;
}

.wc-product-gallery-thumbs .swiper-button-next:hover,
.wc-product-gallery-thumbs .swiper-button-prev:hover {
    background: rgba(255, 255, 255, 0.9);
}

.wc-product-gallery-thumbs .swiper-button-next:after,
.wc-product-gallery-thumbs .swiper-button-prev:after {
    font-size: 14px;
}

/* Ensure compatibility with WooCommerce photoswipe */
.pswp__bg {
    background-color: rgba(0, 0, 0, 0.85);
}

.pswp__ui--fit .pswp__top-bar, 
.pswp__ui--fit .pswp__caption {
    background-color: rgba(0, 0, 0, 0.5);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .wc-product-main-image {
        min-height: 250px;
    }
    
    .wc-gallery-zoom-icon {
        width: 35px;
        height: 35px;
    }
    
    .wc-gallery-zoom-icon i {
        font-size: 16px;
    }
    
    .wc-product-gallery-thumbs .swiper-slide {
        height: 60px;
    }
    
    .wc-product-gallery-thumbs .swiper-button-next,
    .wc-product-gallery-thumbs .swiper-button-prev {
        width: 25px;
        height: 25px;
    }
    
    .wc-product-gallery-thumbs .swiper-button-next:after,
    .wc-product-gallery-thumbs .swiper-button-prev:after {
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    .wc-product-main-image {
        min-height: 200px;
    }
    
    .wc-gallery-zoom-icon {
        width: 30px;
        height: 30px;
    }
    
    .wc-gallery-zoom-icon i {
        font-size: 14px;
    }
}

/* RTL support for Persian language sites */
.rtl .wc-product-gallery-thumbs .swiper-slide {
    margin-right: 0;
    margin-left: 10px;
} 