/* =====================================================
   QYGlove Display Fixes
   Show the WHOLE glove in product grids - never crop.
   ===================================================== */

/* Product collection / grid images (category, shop, related products, homepage).
   WooCommerce block forces aspect-ratio 1/1 + object-fit cover inline,
   which cuts off portrait (e.g. QY-LDR26015) and landscape (e.g. QY-L10131)
   product photos. contain shows the complete image inside the square cell. */
.wc-block-components-product-image img,
.wc-block-grid__product-image img,
.wp-block-woocommerce-product-image img {
    object-fit: contain !important;
}

/* Related products + front page collections use the same classes, keep uniform square cells */
.wc-block-components-product-image--aspect-ratio-1-1 img {
    object-fit: contain !important;
}

/* Classic WooCommerce loop (ul.products) - home, shop and archive grids.
   WooCommerce used to generate hard square (300x300) crops of portrait/landscape
   originals, which cut off the gloves. Thumbnails are now regenerated with
   uncropped proportions; these rules guarantee full display in every case. */
ul.products li.product a img,
.woocommerce-loop-product__link img,
li.product img.attachment-woocommerce_thumbnail {
    height: auto !important;
    max-height: none !important;
    object-fit: contain !important;
}

/* Single product gallery: keep natural ratio, never stretch */
.woocommerce-product-gallery__image img {
    height: auto !important;
}

/* =====================================================
   v1.2
   ===================================================== */

/* Uniform square product cells in category / shop / collection grids.
   Fixes QY-M10111 (very tall 519x1000 photo) looking oversized next to
   sibling products: every cell is a square, the whole glove is shown
   (contain) centered inside it. */
.wp-block-woocommerce-product-collection .wc-block-components-product-image,
.wp-block-query .wc-block-components-product-image,
.wc-block-grid .wc-block-components-product-image {
    aspect-ratio: 1 / 1 !important;
}
.wp-block-woocommerce-product-collection .wc-block-components-product-image a,
.wp-block-query .wc-block-components-product-image a,
.wc-block-grid .wc-block-components-product-image a {
    display: block !important;
    width: 100% !important;
    height: 100% !important;
}
.wp-block-woocommerce-product-collection .wc-block-components-product-image img,
.wp-block-query .wc-block-components-product-image img,
.wc-block-grid .wc-block-components-product-image img {
    width: 100% !important;
    height: 100% !important;
    object-fit: contain !important;
}

/* About page (id 889): finished-goods.jpg is a 552px source while the other
   factory photos are 1100px; stretch every column photo to fill its column
   so all rows look the same width. */
.page-id-889 .wp-block-columns .wp-block-image img {
    width: 100% !important;
    height: auto !important;
}
