/**
 * صفحه محصول - گالری محصول
 * فقط تنظیمات تکمیلی گالری و غیرفعال‌سازی sticky موبایل.
 */

/* گالری موبایل نباید sticky/fixed باشد. */
@media (max-width: 900px) {
    html body.single-product,
    html body.single-product.rp-mobile-product-sticky-gallery-ready {
        --rp-mobile-service-strip-height: 0px !important;
    }

    html body.single-product .rp-single-product-page .rp-product-top,
    html body.single-product .rp-single-product-page .rp-single-desktop-layout,
    html body.single-product .rp-single-product-page .rp-product-gallery-col,
    html body.single-product .rp-single-product-page .rp-product-gallery,
    html body.single-product .rp-single-product-page .rp-product-custom-gallery,
    html body.single-product .rp-single-product-page .woocommerce-product-gallery,
    html body.single-product .rp-single-product-page .woocommerce-product-gallery__wrapper,
    html body.single-product .rp-single-product-page .rp-product-gallery-stage,
    html body.single-product .rp-product-gallery-col,
    html body.single-product .rp-product-gallery,
    html body.single-product .rp-product-custom-gallery,
    html body.single-product .woocommerce-product-gallery {
        position: relative !important;
        top: auto !important;
        right: auto !important;
        bottom: auto !important;
        left: auto !important;
        z-index: auto !important;
        transform: none !important;
        -webkit-transform: none !important;
        will-change: auto !important;
        contain: none !important;
        isolation: auto !important;
    }

    html body.single-product .rp-single-product-page .rp-product-gallery-col,
    html body.single-product .rp-product-gallery-col {
        order: 1 !important;
        padding-bottom: 0 !important;
        overflow: visible !important;
        background: transparent !important;
    }

    html body.single-product .rp-single-product-page .rp-product-custom-gallery,
    html body.single-product .rp-product-custom-gallery {
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 auto !important;
        background: #fff !important;
    }

    html body.single-product .rp-single-product-page .rp-product-gallery-stage,
    html body.single-product .rp-product-gallery-stage {
        height: auto !important;
        min-height: 0 !important;
        max-height: none !important;
        margin-bottom: 0 !important;
        overflow: hidden !important;
    }

    html body.single-product .rp-single-product-page .rp-product-summary-col {
        margin-top: 14px !important;
    }
}

/* v0.1.389: mobile gallery must be normal document flow, never sticky/fixed, and always visible. */
@media (max-width: 900px) {
    html body.single-product .rp-single-product-page .rp-product-gallery-col,
    html body.single-product .rp-single-product-page .rp-product-custom-gallery,
    html body.single-product .rp-single-product-page .rp-product-gallery-stage {
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
        position: relative !important;
        top: auto !important;
        right: auto !important;
        bottom: auto !important;
        left: auto !important;
        transform: none !important;
        -webkit-transform: none !important;
        will-change: auto !important;
        z-index: auto !important;
    }

    html body.single-product .rp-single-product-page .rp-product-gallery-col {
        order: 1 !important;
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        align-self: stretch !important;
        padding: 0 !important;
        margin: 0 0 14px !important;
        overflow: visible !important;
    }

    html body.single-product .rp-single-product-page .rp-product-custom-gallery {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        margin: 0 !important;
        padding: 0 !important;
        border-radius: 18px !important;
        overflow: visible !important;
        background: #fff !important;
    }

    html body.single-product .rp-single-product-page .rp-product-gallery-stage {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        height: auto !important;
        min-height: 1px !important;
        aspect-ratio: var(--rp-product-gallery-ratio, 1 / 1) !important;
        margin: 0 !important;
        padding: 0 !important;
        overflow: hidden !important;
        border-radius: 18px !important;
        background: #f3f6f7 !important;
    }

    html body.single-product .rp-single-product-page .rp-product-gallery-slide {
        display: block !important;
        position: absolute !important;
        inset: 0 !important;
        width: 100% !important;
        height: 100% !important;
        opacity: 0 !important;
        visibility: hidden !important;
        pointer-events: none !important;
        transform: none !important;
        -webkit-transform: none !important;
        z-index: 1 !important;
    }

    html body.single-product .rp-single-product-page .rp-product-gallery-slide.is-active {
        opacity: 1 !important;
        visibility: visible !important;
        pointer-events: auto !important;
        z-index: 2 !important;
    }

    html body.single-product .rp-single-product-page .rp-product-gallery-slide img {
        display: block !important;
        position: absolute !important;
        inset: 0 !important;
        width: 100% !important;
        height: 100% !important;
        max-width: none !important;
        max-height: none !important;
        object-fit: cover !important;
        object-position: center center !important;
        opacity: 1 !important;
        visibility: visible !important;
    }
}
