/* Only WooCommerce product-image elements; never site-wide image rules.
 * Exclude the zoom overlay, whose dimensions are controlled by WooCommerce.
 * No wrapper replacement: retain existing slider, lightbox and variation events.
 */
body.agrooz-square-gallery .woocommerce-product-gallery .woocommerce-product-gallery__image > a,
body.agrooz-square-gallery .woocommerce-product-gallery .woocommerce-product-gallery__image > a > picture {
    display: block;
    background-color: #FFFFFF;
}
body.agrooz-square-gallery .woocommerce-product-gallery .woocommerce-product-gallery__image > a > img:not(.zoomImg),
body.agrooz-square-gallery .woocommerce-product-gallery .woocommerce-product-gallery__image > a > picture > img:not(.zoomImg),
body.agrooz-square-gallery .woocommerce-product-gallery .woocommerce-product-gallery__image--placeholder > img,
body.agrooz-square-gallery .woocommerce-product-gallery .flex-control-thumbs li img,
body.agrooz-square-catalog ul.products li.product a img.attachment-woocommerce_thumbnail,
body.agrooz-square-catalog ul.products li.product a img.woocommerce-placeholder,
body.agrooz-square-catalog .wc-block-grid__product-image img,
body.agrooz-square-catalog .wc-block-components-product-image img {
    display: block;
    box-sizing: border-box;
    width: 100% !important;
    height: auto !important;
    aspect-ratio: 1 / 1 !important;
    object-fit: contain !important;
    object-position: center center !important;
    background-color: #FFFFFF !important;
}

/* Matat gallery: observed #gallery > .single-product-slider > .slide > .img-wrap. */
body.agrooz-square-gallery #gallery.single-product-slider-wrap .single-product-slider .woocommerce-product-gallery__image > .img-wrap {
    position: relative !important;
    display: block !important;
    width: 100% !important;
    height: auto !important;
    min-height: 0 !important;
    padding: 0 !important;
    aspect-ratio: 1 / 1 !important;
    background-color: #FFFFFF !important;
}
body.agrooz-square-gallery #gallery.single-product-slider-wrap .single-product-slider .woocommerce-product-gallery__image > .img-wrap > img:not(.zoomImg) {
    position: absolute !important;
    inset: 0 !important;
    display: block !important;
    width: 100% !important;
    height: 100% !important;
    max-width: 100% !important;
    max-height: 100% !important;
    min-width: 0 !important;
    min-height: 0 !important;
    margin: 0 !important;
    transform: none !important;
    object-fit: contain !important;
    object-position: center center !important;
    background-color: #FFFFFF !important;
}
body.agrooz-square-gallery #gallery.single-product-slider-wrap .pagination-slider .img-wrap-pagination > img {
    width: 100% !important;
    height: auto !important;
    aspect-ratio: 1 / 1 !important;
    object-fit: contain !important;
    background-color: #FFFFFF !important;
}

/* Matat product cards, shared by archive, search suggestions and results.
 * Select only the product-photo layer; stock/contact badges are siblings.
 * Retain the theme's padding-bottom square and hover/slider structure.
 */
body.agrooz-square-catalog .product-item .product-img .normal-image {
    display: block;
    position: relative;
    background-color: #FFFFFF !important;
}
body.agrooz-square-catalog .product-item .product-img .normal-image > img,
body.agrooz-square-catalog .product-item .product-img .normal-image > picture > img {
    position: absolute !important;
    inset: 0 !important;
    display: block !important;
    box-sizing: border-box;
    width: 100% !important;
    height: 100% !important;
    max-width: 100% !important;
    max-height: 100% !important;
    min-width: 0 !important;
    min-height: 0 !important;
    margin: 0 !important;
    object-fit: contain !important;
    object-position: center center !important;
    background-color: #FFFFFF !important;
}
