/* The white margin is part of the source file on all catalog surfaces. */
body main#main .products li.product figure a.ct-media-container > img:not(.zoomImg),
body.single-product main#main .woocommerce-product-gallery .ct-product-gallery-container figure.ct-media-container > img:not(.zoomImg) {
    padding: 0 !important;
    object-fit: contain !important;
    background-color: #fff !important;
    mix-blend-mode: normal !important;
}

/* Homepage product photos already include their final white margins. */
body.home main#main section.ba-products:is([aria-labelledby="ba-best-title"], [aria-labelledby="ba-new-title"], [aria-labelledby="ba-store-title"], :has(> .ba-heading > :is(#ba-store-title, #ba-best-title, #ba-new-title))) .woocommerce ul.products li.product > figure > a.ct-media-container > img.wp-post-image:not(.zoomImg) {
    position: absolute !important;
    inset: 0 !important;
    width: 100% !important;
    height: 100% !important;
    max-width: none !important;
    max-height: none !important;
    margin: 0 !important;
    padding: 0 !important;
    object-fit: contain !important;
    object-position: center !important;
    transform: none !important;
    visibility: visible !important;
}

/* A legacy homepage rule shrinks the entire link when bounds are registered. */
body.home #main#main .ba-products ul.products li.product > figure > a.ct-media-container {
    transform: none !important;
}

body #main#main .products li.product > figure > a.ct-media-container > img:not(.zoomImg),
body.single-product #main#main .woocommerce-product-gallery .ct-media-container > img:not(.zoomImg) {
    /* A replacement thumbnail can have less whitespace than its attachment. */
    scale: min(var(--bleiz-subject-scale, .90), 1) !important;
    transform-origin: center !important;
}

body #main .products li.product > figure > a.ct-media-container,
body.single-product #main .woocommerce-product-gallery .ct-media-container {
    overflow: hidden !important;
}

/* Performance previews are separately cropped files. Leave room for their full canvas. */
body #main#main .products li.product > figure > a.ct-media-container > img:is([src*="/bleiz-performance-"], [srcset*="/bleiz-performance-"]),
body.single-product #main#main .woocommerce-product-gallery .ct-media-container > img:is([src*="/bleiz-performance-"], [srcset*="/bleiz-performance-"]) {
    scale: .75 !important;
}
