.product-gallery-wrapper {
    max-width: 100%;
    margin: 0 auto;
    direction: rtl;
}

.gallery-main-layout {
    display: block;
}

.gallery-item {
    margin-right: 0px !important;
    padding: 0px !important;
}

.gallery-slider {
    padding: 0px !important;
}

.featured-image {
    height: unset !important;
}

/* عکس شاخص */
.featured-image {
    width: 100%;
    margin-bottom: 20px;
    cursor: pointer;
    overflow: hidden;
    border-radius: 8px;
    display: flex;
}

.featured-image img {
    width: 100%;
    height: 400px !important;
    object-fit: cover;
    transition: transform 0.3s;
}

.featured-image:hover img {
    transform: scale(1.05);
}

/* کانتینر گالری - در دسکتاپ افقی، در موبایل عمودی */
.gallery-container {
    position: relative;
    display: flex;
    align-items: center;
}

/* گالری - پیش‌فرض افقی برای دسکتاپ */
.gallery-slider {
    display: flex;
    overflow-x: auto;
    scroll-behavior: smooth;
    gap: 10px;
    padding: 5px;
    scrollbar-width: none;
    direction: rtl;
    width: 100%;
}

.gallery-slider::-webkit-scrollbar {
    display: none;
}

.gallery-item {
    flex: 0 0 auto;
    width: 120px;
    height: 120px;
    cursor: pointer;
    overflow: hidden;
    border-radius: 8px;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.gallery-item:hover img {
    transform: scale(1.1);
}

/* دکمه‌های نویگیشن */
.gallery-nav {
    position: absolute;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid #ddd;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s;
    z-index: 10;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    top: 50%;
    transform: translateY(-50%);
}

.gallery-nav:hover {
    background: rgba(255, 255, 255, 1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

.gallery-prev {
    right: 10px;
}

.gallery-next {
    left: 10px;
}

/* مخفی کردن فلش‌ها اگر نیاز نیست */
.gallery-nav.hidden {
    display: none;
}

/* کم رنگ کردن فلش اگر به انتها رسیده */
.gallery-nav.disabled {
    opacity: 0.3;
    cursor: not-allowed;
    pointer-events: none;
}

/* لایت‌باکس */
.lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 99999;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    padding: 20px;
}

.lightbox.active {
    display: flex;
}

.lightbox-content {
    position: relative;
    max-width: 90%;
    max-height: 70vh;
    margin-bottom: 20px;
    cursor: grab;
}

.lightbox-content.dragging {
    cursor: grabbing;
}

.lightbox-image {
    display: none;
    max-width: 100%;
    max-height: 70vh;
    object-fit: contain;
    user-select: none;
    pointer-events: none;
}

.lightbox-image.active {
    display: block;
    animation: fadeIn 0.3s;
}

/* تامبنیل‌های پایین لایت‌باکس */
.lightbox-thumbnails {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    max-width: 90%;
    padding: 10px;
    direction: rtl;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.3) transparent;
}

.lightbox-thumbnails::-webkit-scrollbar {
    height: 6px;
}

.lightbox-thumbnails::-webkit-scrollbar-track {
    background: transparent;
}

.lightbox-thumbnails::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
}

.lightbox-thumbnails::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}

.lightbox-thumbnail {
    flex: 0 0 auto;
    width: 80px;
    height: 80px;
    cursor: pointer;
    border-radius: 4px;
    overflow: hidden;
    border: 2px solid transparent;
    transition: all 0.3s;
    opacity: 0.6;
}

.lightbox-thumbnail:hover {
    opacity: 0.9;
    border-color: rgba(255, 255, 255, 0.3);
}

.lightbox-thumbnail.active {
    opacity: 1;
    border-color: white;
}

.lightbox-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.lightbox-close {
    position: absolute;
    top: 20px;
    left: 20px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    z-index: 100000;
    transition: background 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

.lightbox-nav {
    position: absolute;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    transition: background 0.3s;
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-nav:hover {
    background: rgba(255, 255, 255, 0.2);
}

.lightbox-prev {
    right: 20px;
}

.lightbox-next {
    left: 20px;
}

/* موبایل - لی‌اوت عمودی */
@media (max-width: 1024px) {
    .gallery-main-layout {
        display: flex;
        gap: 10px;
        direction: rtl;
        align-items: flex-start;
    }

    .featured-image {
        /* flex: 1;
        height: auto;
        aspect-ratio: 1 / 1; */
        margin-bottom: 0;
        /* min-height: 200px; */
    }

    .featured-image img {
        height: 264px !important;
    }

    .gallery-item {
        border-radius: 0px 6px 6px 0px !important;
    }

    .gallery-container {
        flex-direction: column;
        width: 80px;
        align-items: stretch;
        position: relative;
    }

    /* تبدیل گالری به عمودی */
    .gallery-slider {
        flex-direction: column;
        overflow-x: hidden;
        overflow-y: auto;
        /* max-height: calc(100vw - 100px); */
        max-height: 264px;
        width: 100%;
    }

    .gallery-item {
        width: 70px;
        height: 70px;
        flex-shrink: 0;
    }

    /* دکمه‌ها برای موبایل */
    .gallery-nav {
        width: 24px;
        height: 24px;
        position: absolute;
        left: 50%;
        transform: translateX(-50%);
        right: auto;
    }

    .gallery-prev {
        top: 5px;
        right: auto;
    }

    .gallery-next {
        bottom: 5px;
        top: auto;
        left: 50%;
    }

    .gallery-nav svg {
        width: 18px;
        height: 18px;
    }

    /* چرخش آیکون‌های فلش برای حالت عمودی */
    .gallery-prev svg {
        transform: rotate(-90deg);
    }

    .gallery-next svg {
        transform: rotate(-90deg);
    }

    /* تنظیمات لایت‌باکس برای موبایل */
    .lightbox-close {
        top: 10px;
        left: 10px;
        width: 40px;
        height: 40px;
    }

    .lightbox-nav {
        width: 40px;
        height: 40px;
    }

    .lightbox-prev {
        right: 10px;
    }

    .lightbox-next {
        left: 10px;
    }
}

/* موبایل کوچکتر */
@media (max-width: 480px) {
    .featured-image {
        min-height: 150px;
    }

    .gallery-container {
        width: 70px;
    }

    .gallery-item {
        width: 60px;
        height: 60px;
    }

    .gallery-slider {
        max-height: 264px;
        gap: 8px;
    }
}

/* تبلت */
/* @media (min-width: 769px) and (max-width: 1024px) {
    .featured-image {
        height: 400px;
    }

    .gallery-item {
        width: 100px;
        height: 100px;
    }
} */