/**
 * استایل‌های بهبود یافته گالری محصول به سبک دیجی‌کالا
 */

/* استایل گالری در حالت دسکتاپ */
@media screen and (min-width: 992px) {
    /* کانتینر اصلی گالری */
    .product-gallery {
        display: flex !important;
        flex-direction: column !important;
        height: 100% !important;
        background-color: #fff !important;
        position: relative !important;
    }
    
    /* تصویر اصلی */
    .main-image {
        height: 400px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        padding: 20px !important;
        position: relative !important;
        background-color: #fff !important;
    }
    
    .main-image img {
        max-width: 90% !important;
        max-height: 350px !important;
        object-fit: contain !important;
        transition: all 0.4s ease !important;
    }
    
    .main-image:hover img {
        transform: scale(1.05) !important;
    }
    
    /* دکمه بزرگنمایی */
    .zoom-icon {
        position: absolute !important;
        bottom: 20px !important;
        right: 20px !important;
        width: 40px !important;
        height: 40px !important;
        border-radius: 50% !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        background-color: rgba(255, 255, 255, 0.9) !important;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1) !important;
        color: #666 !important;
        cursor: pointer !important;
        transition: all 0.3s ease !important;
        z-index: 5 !important;
    }
    
    .zoom-icon:hover {
        background-color: #2e7d32 !important;
        color: #fff !important;
        transform: scale(1.1) !important;
    }
    
    /* بخش تامبنیل‌ها */
    .gallery-thumbnails {
        display: flex !important;
        gap: 8px !important;
        padding: 15px 20px !important;
        overflow-x: auto !important;
        scrollbar-width: thin !important;
        position: relative !important;
        border-top: 1px solid #f0f0f0 !important;
        justify-content: center !important;
    }
    
    /* استایل اسکرول‌بار در بخش تامبنیل‌ها */
    .gallery-thumbnails::-webkit-scrollbar {
        height: 6px !important;
    }
    
    .gallery-thumbnails::-webkit-scrollbar-track {
        background: #f0f0f0 !important;
        border-radius: 10px !important;
    }
    
    .gallery-thumbnails::-webkit-scrollbar-thumb {
        background: #ddd !important;
        border-radius: 10px !important;
    }
    
    .gallery-thumbnails::-webkit-scrollbar-thumb:hover {
        background: #ccc !important;
    }
    
    /* استایل تامبنیل‌ها */
    .gallery-thumbnails img {
        width: 70px !important;
        height: 70px !important;
        object-fit: cover !important;
        border-radius: 8px !important;
        border: 1px solid #e0e0e0 !important;
        cursor: pointer !important;
        transition: all 0.3s ease !important;
    }
    
    .gallery-thumbnails img:hover {
        transform: translateY(-3px) !important;
        box-shadow: 0 5px 10px rgba(0, 0, 0, 0.1) !important;
    }
    
    .gallery-thumbnails img.active {
        border: 2px solid #2e7d32 !important;
        box-shadow: 0 3px 8px rgba(0, 0, 0, 0.1) !important;
    }
    
    /* دکمه‌های جهت‌دار برای تامبنیل‌ها */
    .gallery-nav-btn {
        position: absolute !important;
        top: 50% !important;
        transform: translateY(-50%) !important;
        width: 25px !important;
        height: 25px !important;
        border-radius: 50% !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        background-color: #fff !important;
        box-shadow: 0 2px 5px rgba(0, 0, 0, 0.15) !important;
        color: #555 !important;
        font-size: 12px !important;
        cursor: pointer !important;
        z-index: 2 !important;
        transition: all 0.3s ease !important;
        opacity: 0.8 !important;
    }
    
    .gallery-nav-btn:hover {
        opacity: 1 !important;
        background-color: #f5f5f5 !important;
    }
    
    .gallery-nav-btn.prev {
        left: 5px !important;
    }
    
    .gallery-nav-btn.next {
        right: 5px !important;
    }
}

/* استایل گالری در حالت موبایل */
@media screen and (max-width: 991px) {
    /* کانتینر اصلی گالری */
    .product-gallery {
        background: #fff !important;
        padding: 0 !important;
        position: relative !important;
        margin-bottom: 10px !important;
    }
    
    /* تصویر اصلی */
    .main-image {
        height: 300px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        padding: 15px !important;
        position: relative !important;
    }
    
    .main-image img {
        max-width: 90% !important;
        max-height: 280px !important;
        object-fit: contain !important;
        transition: all 0.3s ease !important;
    }
    
    /* بخش تامبنیل‌ها */
    .gallery-thumbnails {
        padding: 10px 15px !important;
        display: flex !important;
        gap: 8px !important;
        overflow-x: auto !important;
        position: relative !important;
        justify-content: flex-start !important;
        scrollbar-width: none !important;  /* Firefox */
    }
    
    /* مخفی کردن اسکرول‌بار در بخش تامبنیل‌ها - کروم و سافاری */
    .gallery-thumbnails::-webkit-scrollbar {
        display: none !important;
    }
    
    /* استایل تامبنیل‌ها */
    .gallery-thumbnails img {
        width: 60px !important;
        height: 60px !important;
        object-fit: cover !important;
        border-radius: 6px !important;
        border: 1px solid #e0e0e0 !important;
        flex-shrink: 0 !important;
    }
    
    .gallery-thumbnails img.active {
        border: 2px solid #2e7d32 !important;
    }
    
    /* نشانگر اسلایدر */
    .gallery-indicator {
        display: flex !important;
        gap: 5px !important;
        justify-content: center !important;
        padding: 10px 0 !important;
    }
    
    .indicator-dot {
        width: 6px !important;
        height: 6px !important;
        border-radius: 50% !important;
        background-color: #ddd !important;
        transition: all 0.3s ease !important;
    }
    
    .indicator-dot.active {
        width: 20px !important;
        border-radius: 10px !important;
        background-color: #2e7d32 !important;
    }
}

/* مدال نمایش تصویر بزرگ */
.image-modal {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    background-color: rgba(0, 0, 0, 0.9) !important;
    z-index: 9999 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    opacity: 0 !important;
    visibility: hidden !important;
    transition: all 0.3s ease !important;
}

.image-modal.show {
    opacity: 1 !important;
    visibility: visible !important;
}

.modal-content {
    max-width: 90% !important;
    max-height: 90% !important;
    animation: zoom 0.3s !important;
    position: relative !important;
}

.modal-content img {
    max-width: 100% !important;
    max-height: 90vh !important;
    object-fit: contain !important;
}

.close-modal {
    position: absolute !important;
    top: -40px !important;
    right: 0 !important;
    color: white !important;
    font-size: 30px !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
}

.close-modal:hover {
    transform: rotate(90deg) !important;
}

@keyframes zoom {
    from {transform: scale(0.8); opacity: 0;}
    to {transform: scale(1); opacity: 1;}
} 