/* ==========================================================================
   WooCommerce Custom Gallery Slider Stylesheet
   ========================================================================== */

/* متغیرهای پایه هماهنگ با متغیرهای عمومی المنتور و استایل‌های Hello Elementor */
:root {
    --wc-slider-border-radius: var(--g-border-radius, 8px);
    --wc-slider-primary-color: var(--e-global-color-primary, #232323);
    --wc-slider-accent-color: var(--e-global-color-accent, #a10000);
    --wc-slider-bg-light: #f9f9f9;
    --wc-slider-border-color: #e5e5e5;
    --wc-slider-transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.wc-custom-gallery-container {
    width: 100%;
    margin: 0 auto;
    position: relative;
    font-family: inherit;
}

/* بخش اسلایدر اصلی */
.wc-gallery-main-wrapper {
    position: relative;
    width: 100%;
    overflow: hidden;
    background-color: var(--wc-slider-bg-light);
    border-radius: var(--wc-slider-border-radius);
    border: 1px solid var(--wc-slider-border-color);
}

.wc-gallery-slides {
    display: flex;
    transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    width: 100%;
}

.wc-gallery-slide {
    min-width: 100%;
    box-sizing: border-box;
    display: flex;
    justify-content: center;
    align-items: center;
}

.wc-gallery-slide img {
    width: 100%;
    height: auto;
    object-fit: cover;
    display: block;
    max-height: 500px;
}

/* دکمه‌های ناوبری (Prev & Next) */
.wc-gallery-prev, 
.wc-gallery-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(255, 255, 255, 0.9);
    color: var(--wc-slider-primary-color);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    transition: var(--wc-slider-transition);
    z-index: 10;
}

.wc-gallery-prev:hover, 
.wc-gallery-next:hover {
    background-color: var(--wc-slider-primary-color);
    color: #fff;
}

/* جهت‌یابی دکمه‌ها بر اساس جهت صفحه (RTL & LTR) */
.direction-ltr .wc-gallery-prev { left: 15px; }
.direction-ltr .wc-gallery-next { right: 15px; }

.direction-rtl .wc-gallery-prev { right: 15px; transform: translateY(-50%) rotate(180deg); }
.direction-rtl .wc-gallery-next { left: 15px; transform: translateY(-50%) rotate(180deg); }

/* بخش تامبنیل‌ها (تصاویر کوچک) */
.wc-gallery-thumbnails-wrapper {
    margin-top: 12px;
    width: 100%;
    overflow: hidden;
}

.wc-gallery-thumbnails {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch; /* اسکرول نرم در دستگاه‌های iOS */
    padding-bottom: 5px;
}

/* مخفی کردن اسکرولبار مرورگرها جهت حفظ زیبایی در حالت دسکتاپ */
.wc-gallery-thumbnails::-webkit-scrollbar {
    height: 4px;
}
.wc-gallery-thumbnails::-webkit-scrollbar-thumb {
    background-color: var(--wc-slider-border-color);
    border-radius: 4px;
}

.wc-gallery-thumb {
    flex: 0 0 75px; /* اندازه ثابت برای تامبنیل‌ها */
    aspect-ratio: 1 / 1;
    border-radius: calc(var(--wc-slider-border-radius) / 2);
    overflow: hidden;
    border: 2px solid transparent;
    cursor: pointer;
    transition: var(--wc-slider-transition);
    opacity: 0.6;
}

.wc-gallery-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.wc-gallery-thumb.active {
    border-color: var(--wc-slider-accent-color);
    opacity: 1;
}

/* بهینه‌سازی ریسپانسیو و لمسی در موبایل */
@media (max-width: 768px) {
    .wc-gallery-prev, 
    .wc-gallery-next {
        width: 32px;
        height: 32px;
        font-size: 14px;
    }
    
    .wc-gallery-thumb {
        flex: 0 0 60px;
    }
}


/* ==========================================================================
   اضافات مربوط به Zoom و Lightbox
   ========================================================================== */

/* استایل زوم برای دسکتاپ */
@media (min-width: 769px) {
    .wc-gallery-slide {
        overflow: hidden;
        cursor: zoom-in;
        position: relative;
    }
    
    .wc-gallery-slide img {
        transition: transform 0.1s ease-out;
        transform-origin: center center;
        width: 100%;
        height: auto;
        display: block;
    }
}

/* استایل‌های لایت‌باکس برای موبایل */
.wc-slider-lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    z-index: 999999;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.wc-slider-lightbox.active {
    opacity: 1;
    pointer-events: auto;
}

.wc-slider-lightbox-content {
    max-width: 90%;
    max-height: 80%;
    position: relative;
}

.wc-slider-lightbox-content img {
    width: 100%;
    height: auto;
    max-height: 80vh;
    object-fit: contain;
    border-radius: 4px;
    box-shadow: 0 5px 25px rgba(0,0,0,0.5);
}

/* دکمه بستن لایت‌باکس */
.wc-slider-lightbox-close {
    position: absolute;
    top: -40px;
    right: 0;
    color: #fff;
    font-size: 30px;
    background: none;
    border: none;
    cursor: pointer;
    line-height: 1;
    padding: 5px;
}

.direction-rtl .wc-slider-lightbox-close {
    right: auto;
    left: 0;
}

