/*
 * ALSHOP_UNIFIED_PRODUCT_PURCHASE_FLOW_V1_1_0
 *
 * Keep the gallery at the top, but let its LEFT COLUMN stretch to the
 * full height of the product information/variant column. The sticky gallery
 * can therefore follow the customer down and naturally stop at the end of
 * the product top section.
 */

@media (min-width: 992px) {
    .agm-product-page .agm-product-top-row {
        align-items: stretch !important;
    }

    .agm-product-page .agm-product-top-row > .col-lg-6:first-child {
        position: relative !important;
        align-self: stretch !important;

        height: auto !important;
        min-height: 100% !important;
        max-height: none !important;

        margin-top: 0 !important;
        padding-top: 0 !important;
    }

    .agm-product-page .product-slider-wrapper {
        position: sticky !important;
        top: 104px !important;
        bottom: auto !important;

        display: block !important;

        width: 100% !important;
        height: auto !important;
        min-height: 0 !important;
        max-height: none !important;

        margin-top: 0 !important;
        padding-top: 0 !important;
    }

    .agm-product-page .product-slider-wrapper > .row {
        align-items: flex-start !important;

        height: auto !important;
        min-height: 0 !important;

        margin-top: 0 !important;
        padding-top: 0 !important;
    }

    .agm-product-page .product-slider-wrapper .product-gallery,
    .agm-product-page .product-slider-wrapper .product-gallery > .slick-list,
    .agm-product-page .product-slider-wrapper .product-gallery > .slick-list > .slick-track,
    .agm-product-page .product-slider-wrapper .product-gallery .slick-slide,
    .agm-product-page .product-slider-wrapper .product-gallery .carousel-box {
        height: auto !important;
        min-height: 0 !important;
        margin-top: 0 !important;
        padding-top: 0 !important;
    }

    .agm-product-page .product-slider-wrapper .product-gallery .carousel-box {
        display: flex !important;
        align-items: flex-start !important;
        justify-content: center !important;
    }

    .agm-product-page .product-slider-wrapper .product-gallery img {
        display: block !important;

        width: auto !important;
        max-width: 100% !important;
        height: auto !important;
        max-height: min(560px, calc(100vh - 155px)) !important;

        margin: 0 auto !important;

        object-fit: contain !important;
        object-position: center top !important;
    }

    .agm-product-page .product-slider-wrapper .product-gallery .slick-slide > div,
    .agm-product-page .product-slider-wrapper .product-gallery a,
    .agm-product-page .product-slider-wrapper .product-gallery .zoomWrapper,
    .agm-product-page .product-slider-wrapper .product-gallery .zoomWrapper > div {
        min-height: 0 !important;
        max-height: none !important;
        margin-top: 0 !important;
        padding-top: 0 !important;
    }
}

@media (max-width: 991.98px) {
    .agm-product-page .product-slider-wrapper {
        position: relative !important;
        top: auto !important;
        bottom: auto !important;

        height: auto !important;
        min-height: 0 !important;

        margin-top: 0 !important;
        padding-top: 0 !important;
    }

    .agm-product-page .product-slider-wrapper .product-gallery {
        height: auto !important;
        min-height: 0 !important;
    }
}