/* Keep carousel artwork from setting the height of the purchase panel. */
#product_detail_main:has(> .o_wsale_product_images > #o-carousel-product:not(.oc-package-showcase)) {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: clamp(1rem, 2.5vw, 2rem);
    margin-inline: 0;

    > .o_wsale_product_images,
    > #product_details {
        width: 100%;
        min-width: 0;
        margin-top: 0 !important;
    }

    > .o_wsale_product_images {
        padding-inline: 0;
    }

    > #product_details {
        padding-block: 1.75rem;
    }

    #o-carousel-product {
        display: flex;
        flex-direction: column;
        margin-bottom: 0 !important;
        background: var(--sfx-card-background, #f3f5f8);
        border-radius: 12px;
    }

    .o_carousel_product_outer {
        aspect-ratio: 7 / 5;
        max-height: 32rem;
        min-width: 0;
    }

    .o_carousel_product_indicators {
        padding: 0.5rem !important;
    }

    .carousel-item > div:not(.ratio),
    .carousel-item [name="o_img_with_max_suggested_width"] {
        align-items: center !important;
        height: 100%;
    }

    img.product_detail_img {
        width: auto !important;
        height: auto;
        max-width: 100%;
        max-height: 100% !important;
        object-fit: contain;
    }

    .carousel-item > .ratio {
        position: absolute;
        inset: 0;
    }

    @media (max-width: 991.98px) {
        #o-carousel-product.o_carousel_product_left_indicators {
            flex-direction: column-reverse;
        }
    }

    @media (min-width: 992px) {
        &[data-image_width="50_pc"],
        &[data-image_width="66_pc"] {
            grid-template-columns: minmax(0, var(--oc-gallery-column, 1fr)) minmax(0, 1fr);
            margin-top: 1.5rem;

            > #product_details {
                align-self: stretch !important;
                min-height: clamp(19rem, calc(25vw + 2rem), 25rem);
                padding-block: 2.5rem;
            }

            > .o_wsale_product_images {
                contain: size;
            }

            #o-carousel-product {
                height: 100%;
            }

            .o_carousel_product_outer {
                flex: 1 1 0;
                min-height: 0;
                max-height: none;
                aspect-ratio: auto;
            }
        }

        &[data-image_width="66_pc"] {
            --oc-gallery-column: 2fr;
        }

        #o-carousel-product.o_carousel_product_left_indicators {
            flex-direction: row;
        }

        .o_carousel_product_left_indicators .o_carousel_product_indicators {
            flex-shrink: 0;
        }

        .o_carousel_product_left_indicators .o_carousel_product_outer {
            flex: 1 1 auto;
        }
    }
}
