/**
 * Native Woo frame: max height = width × (hw), contain.
 * --as-wpi-*-frame-hw from PHP (1 = 100% = square).
 */

/* -------------------------------------------------------------------------
 * Gallery thumbs (classic Woo flexslider)
 * ------------------------------------------------------------------------- */
body.as-wpi-gallery-frame .woocommerce-product-gallery .flex-control-thumbs > li {
	display: flex;
	align-items: center;
	justify-content: center;
	box-sizing: border-box;
	aspect-ratio: 1 / var(--as-wpi-gallery-frame-hw, 1);
	overflow: hidden;
}

body.as-wpi-gallery-frame .woocommerce-product-gallery .flex-control-thumbs > li img {
	width: 100%;
	height: 100%;
	max-width: 100%;
	max-height: 100%;
	object-fit: contain;
	object-position: center;
	display: block;
}

/* -------------------------------------------------------------------------
 * Catalog / loop (native Woo)
 * ------------------------------------------------------------------------- */
body.as-wpi-listings-frame ul.products li.product a img,
body.as-wpi-listings-frame ul.products li.product .woocommerce-loop-product__link img,
body.as-wpi-listings-frame ul.products li.product .attachment-woocommerce_thumbnail,
body.as-wpi-listings-frame ul.products li.product .wp-post-image {
	width: 100%;
	height: auto;
	aspect-ratio: 1 / var(--as-wpi-listings-frame-hw, 1);
	object-fit: contain;
	object-position: center;
	box-sizing: border-box;
}
