/* The custom catalogue and the native WooCommerce loop use different image wrappers. */
body.philatelyhub-original-theme .ph-live-product > .product-image,
:is(body.woocommerce, body.woocommerce-page) ul.products li.product .astra-shop-thumbnail-wrap {
    display: block;
    box-sizing: border-box;
    width: 100%;
    height: auto;
    aspect-ratio: 1;
    margin: 0;
    padding: 0 !important;
    overflow: hidden;
    border: 0;
    background: #fff !important;
    box-shadow: none;
}

:is(body.woocommerce, body.woocommerce-page) ul.products li.product {
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
}

:is(body.woocommerce, body.woocommerce-page) ul.products li.product .astra-shop-thumbnail-wrap > a {
    display: block;
    width: 100%;
    height: 100%;
    margin: 0;
    background: #fff;
}

body.philatelyhub-original-theme .ph-live-product > .product-image > img,
:is(body.woocommerce, body.woocommerce-page) ul.products li.product .astra-shop-thumbnail-wrap img {
    display: block;
    width: 100%;
    height: 100%;
    margin: 0;
    object-fit: contain;
    object-position: center;
    border: 0;
    background: #fff;
    box-shadow: none;
}

/* Reduce extra whitespace around the existing 2017 cover without losing the roll. */
body.philatelyhub-original-theme .ph-live-product > .product-image > img[src*="2017-us-flag-forever-stamps-roll-square"],
:is(body.woocommerce, body.woocommerce-page) ul.products li.product .astra-shop-thumbnail-wrap img[src*="2017-us-flag-forever-stamps-roll-square"],
body.single-product.postid-9558 .woocommerce-product-gallery__image img.wp-post-image[src*="2017-us-flag-forever-stamps-roll-square"] {
    transform: scale(1.10);
    transform-origin: 50% 60%;
}

/* Align the visible cover with the thumbnails without moving the square stage. */
body.single-product.postid-9558 .woocommerce-product-gallery__image img.wp-post-image[src*="2017-us-flag-forever-stamps-roll-square"] {
    transform: translateY(-7.5%) scale(1.10);
}

/* Limit the frame reset to image layers so the gallery controls keep their icons. */
body.single-product div.product .woocommerce-product-gallery,
body.single-product div.product .woocommerce-product-gallery :is(.flex-viewport, .woocommerce-product-gallery__wrapper, .woocommerce-product-gallery__image, .woocommerce-product-gallery__image > a, .woocommerce-product-gallery__image img) {
    border: 0 !important;
    border-radius: 0;
    background: #fff;
    box-shadow: none !important;
}

body.single-product div.product .woocommerce-product-gallery .woocommerce-product-gallery__image img {
    display: block;
    object-fit: contain;
    object-position: center;
}

body.single-product div.product .woocommerce-product-gallery .flex-viewport::after {
    content: none !important;
}

body.single-product div.product .woocommerce-product-gallery .flex-control-thumbs img {
    border: 0 !important;
    box-shadow: none !important;
    background: #fff;
    opacity: 0.62;
}

body.single-product div.product .woocommerce-product-gallery .flex-control-thumbs img.flex-active,
body.single-product div.product .woocommerce-product-gallery .flex-control-thumbs img:hover {
    opacity: 1;
}

body.single-product div.product .woocommerce-product-gallery .flex-control-thumbs img:focus-visible,
body.philatelyhub-original-theme .ph-live-product > .product-image:focus-visible {
    outline: 2px solid #1677b2;
    outline-offset: -3px;
}
