/**
 * Product Image Gallery Styles
 * استایل گالری تصاویر محصول
 */

.image-gallery-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.image-gallery-modal.active {
    opacity: 1;
    visibility: visible;
}

.gallery-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(5px);
}

.gallery-container {
    position: relative;
    width: 90%;
    max-width: 1200px;
    height: 90vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 1;
}

.gallery-close {
    position: absolute;
    top: -50px;
    right: 0;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    font-size: 40px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    z-index: 10;
}

.gallery-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

.gallery-content {
    position: relative;
    width: 100%;
    height: calc(100% - 120px);
    display: flex;
    align-items: center;
    justify-content: center;
}

.gallery-content img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 10px;
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.5);
    transition: opacity 0.2s ease;
}

.gallery-counter {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 8px 20px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: bold;
    font-family: 'Tahoma', 'Arial', sans-serif;
}

.gallery-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    font-size: 30px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.gallery-nav:hover {
    background: rgba(255, 255, 255, 0.4);
    transform: translateY(-50%) scale(1.1);
}

.gallery-prev {
    right: -80px;
}

.gallery-next {
    left: -80px;
}

.gallery-thumbnails-strip {
    display: flex;
    gap: 10px;
    padding: 20px 0 0 0;
    overflow-x: auto;
    max-width: 100%;
    justify-content: center;
    align-items: center;
}

.gallery-thumbnails-strip::-webkit-scrollbar {
    height: 6px;
}

.gallery-thumbnails-strip::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

.gallery-thumbnails-strip::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
}

.gallery-thumb {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 8px;
    cursor: pointer;
    border: 3px solid transparent;
    transition: all 0.3s ease;
    flex-shrink: 0;
    opacity: 0.6;
}

.gallery-thumb:hover {
    opacity: 1;
    transform: scale(1.05);
}

.gallery-thumb.active {
    border-color: #fff;
    opacity: 1;
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.5);
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .gallery-container {
        width: 95%;
        height: 95vh;
    }
    
    .gallery-close {
        top: -40px;
        width: 40px;
        height: 40px;
        font-size: 30px;
    }
    
    .gallery-nav {
        width: 50px;
        height: 50px;
        font-size: 24px;
    }
    
    .gallery-prev {
        right: 10px;
    }
    
    .gallery-next {
        left: 10px;
    }
    
    .gallery-content {
        height: calc(100% - 150px);
    }
    
    .gallery-thumb {
        width: 60px;
        height: 60px;
    }
    
    .gallery-thumbnails-strip {
        padding: 15px 0 0 0;
        gap: 8px;
    }
}

/* RTL Support */
[dir="rtl"] .gallery-prev {
    right: auto;
    left: -80px;
}

[dir="rtl"] .gallery-next {
    left: auto;
    right: -80px;
}

@media (max-width: 768px) {
    [dir="rtl"] .gallery-prev {
        left: 10px;
    }
    
    [dir="rtl"] .gallery-next {
        right: 10px;
    }
}
