/**
 * Product grid — sharper card images + single-card width cap.
 */

body.tax-product_cat .hh-product-card__media,
body.hh-shop-archive .hh-product-card__media,
body.woocommerce-page .hh-product-card__media {
	aspect-ratio: 4 / 3;
	background: linear-gradient(145deg, #ece7e2 0%, #e2e8ee 100%);
}

body.tax-product_cat .hh-product-card__img,
body.hh-shop-archive .hh-product-card__img,
body.woocommerce-page .hh-product-card__img {
	object-fit: cover !important;
	object-position: center center !important;
	image-rendering: auto;
	filter: contrast(1.03) saturate(1.04);
}

/* Never stretch a lone product card to full row width */
.hh-v2-heating-archive__grid-wrap .products,
.hh-v2-outdoor-archive .hh-v2-heating-archive__grid-wrap .products,
body.tax-product_cat.hh-v2-heating-archive-page .hh-v2-heating-archive__grid-wrap .products,
body.tax-product_cat.hh-v2-outdoor-archive-page .hh-v2-heating-archive__grid-wrap .products {
	grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)) !important;
}

@supports selector(:has(*)) {
	.hh-v2-heating-archive__grid-wrap .products:has(> li.product:only-child),
	body.tax-product_cat ul.products:has(> li.product:only-child),
	body.hh-shop-archive ul.products:has(> li.product:only-child) {
		grid-template-columns: repeat(3, minmax(0, 280px)) !important;
		justify-content: start;
	}

	.hh-v2-heating-archive__grid-wrap .products:has(> li.product:nth-child(2):last-child),
	body.tax-product_cat ul.products:has(> li.product:nth-child(2):last-child) {
		grid-template-columns: repeat(2, minmax(0, 280px)) !important;
		justify-content: start;
	}
}

@media (max-width: 640px) {
	@supports selector(:has(*)) {
		.hh-v2-heating-archive__grid-wrap .products:has(> li.product:only-child),
		body.tax-product_cat ul.products:has(> li.product:only-child) {
			grid-template-columns: 1fr !important;
			max-width: 320px;
		}
	}
}
