/* استایل اصلی گالری */
.woocommerce-like-gallery {
    direction: rtl;
    max-width: 100%;
    position: relative;
}

.wlg-main-image {
    margin-bottom: 15px;
    text-align: center;
    position: relative;
    overflow: hidden;
    max-height: 500px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8f9fa;
    border-radius: 8px;
    padding: 10px;
}

.wlg-main-image img {
    max-width: 100%;
    max-height: 480px;
    width: auto;
    height: auto;
    display: block;
    margin: 0 auto;
    cursor: pointer;
    transition: all 0.3s ease;
    border-radius: 8px;
    object-fit: contain;
}

.wlg-main-image img:hover {
    opacity: 1;
}

.wlg-thumbnails {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    margin-top: 15px;
    gap: 8px;
}

.wlg-thumbnail {
    cursor: pointer;
    border: 3px solid transparent;
    border-radius: 8px;
    transition: all 0.3s ease;
    padding: 0;
    background: #fff;
    width: 70px;
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    box-sizing: border-box;
}

.wlg-thumbnail.active {
    border-color: #007cba;
}

.wlg-thumbnail:hover {
    border-color: #007cba;
    transform: translateY(-2px);
}

.wlg-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 5px;
    display: block;
    margin: 0;
    padding: 0;
}

/* دکمه‌های ناوبری */
.wlg-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.9);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    color: #333;
    transition: all 0.3s ease;
    z-index: 10;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    opacity: 0.8;
}

.wlg-nav-btn:hover {
    background: rgba(255, 255, 255, 1);
    color: #007cba;
    opacity: 1;
    transform: translateY(-50%) scale(1.1);
}

.wlg-prev-btn {
    right: 15px;
}

.wlg-next-btn {
    left: 15px;
}

.wlg-nav-btn i {
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* مخفی کردن دکمه‌ها وقتی فقط یک تصویر وجود دارد */
.woocommerce-like-gallery[data-image-count="1"] .wlg-nav-btn {
    display: none !important;
}

/* استایل‌های lightbox */
.mfp-figure:after {
    box-shadow: none !important;
}

.mfp-image-holder .mfp-close {
    color: #fff !important;
    background: rgba(0, 0, 0, 0.5) !important;
    width: 40px !important;
    height: 40px !important;
    line-height: 40px !important;
    border-radius: 50% !important;
    font-size: 24px !important;
}

/* دکبه‌های ناوبری در lightbox */
.mfp-container .mfp-arrow {
    background: rgba(0, 0, 0, 0.5) !important;
    width: 60px !important;
    height: 60px !important;
    margin-top: -30px !important;
}

.mfp-container .mfp-arrow:after {
    border-top-width: 12px !important;
    border-bottom-width: 12px !important;
    margin-top: -6px !important;
}

.mfp-container .mfp-arrow-left:after {
    border-right-width: 12px !important;
    margin-left: -6px !important;
}

.mfp-container .mfp-arrow-right:after {
    border-left-width: 12px !important;
    margin-left: 18px !important;
}

/* استایل برای حالت بدون تصویر */
.wlg-no-images {
    text-align: center;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px dashed #6c757d;
}

.wlg-no-images p {
    margin: 5px 0;
    color: #6c757d;
}

/* انیمیشن برای تغییر تصاویر */
.wlg-main-image img {
    transition: opacity 0.3s ease;
}

.wlg-main-image img.fade-out {
    opacity: 0;
}

.wlg-main-image img.fade-in {
    opacity: 1;
}

/* واکنش‌گرایی */
@media (max-width: 768px) {
    .wlg-main-image {
        max-height: 400px;
        padding: 8px;
    }
    
    .wlg-main-image img {
        max-height: 380px;
    }
    
    .wlg-thumbnails {
        gap: 6px;
    }
    
    .wlg-thumbnail {
        width: 60px;
        height: 60px;
        border-radius: 6px;
    }
    
    /* حذف دکمه‌های ناوبری در تبلت و موبایل */
    .wlg-nav-btn {
        display: none !important;
    }
}

@media (max-width: 480px) {
    .wlg-main-image {
        max-height: 300px;
        padding: 5px;
    }
    
    .wlg-main-image img {
        max-height: 280px;
    }
    
    .wlg-thumbnails {
        gap: 4px;
    }
    
    .wlg-thumbnail {
        width: 50px;
        height: 50px;
        border-radius: 5px;
    }
    
    .wlg-thumbnail img {
        border-radius: 3px;
    }
    
    /* حذف دکمه‌های ناوبری در موبایل */
    .wlg-nav-btn {
        display: none !important;
    }
}