/**
 * Product archive overrides — shop, brand and category listings.
 *
 * Kept in its own file because styles/css/main.css is minified with no build config in
 * the theme, so hand-editing it is not safe to repeat.
 */

/*
 * Product grid: 5 across on desktop, 1 on mobile.
 *
 * The column count is set in the archive-product template as a block attribute
 * (post-template layout columnCount), which WordPress emits as a generated
 * `.wp-container-core-post-template-is-layout-<hash>` rule. That hash changes whenever
 * the block's layout attributes are edited, and the template itself only exists as a
 * Site Editor override in the database — so it can't be relied on or version-controlled.
 *
 * Targeting the template's own `products-block-post-template` class instead: it's stable,
 * it's in the markup, and at four classes it outranks the single-class generated rule
 * without needing !important.
 */
.wp-block-query .products-block-post-template.wp-block-post-template.is-layout-grid {
	grid-template-columns: repeat(5, minmax(0, 1fr));
}

@media (max-width: 781px) {
	.wp-block-query .products-block-post-template.wp-block-post-template.is-layout-grid {
		grid-template-columns: minmax(0, 1fr);
	}
}
