/* Product Template's Block spacing, written as vars by product-gap.php;
   1.25em is WooCommerce's own gap, kept when nothing is set. */
.wc-block-product-template:is(.is-flex-container, .wc-block-product-template__responsive):not(.carousel) {
	--product-gap: var(--product-gap-base, 1.25em);
	gap: var(--product-gap);
}

@media (48rem < width <= 64rem) {
	.wc-block-product-template:is(.is-flex-container, .wc-block-product-template__responsive):not(.carousel) {
		--product-gap: var(--product-gap-tablet, var(--product-gap-base, 1.25em));
	}
}

@media (width <= 48rem) {
	.wc-block-product-template:is(.is-flex-container, .wc-block-product-template__responsive):not(.carousel) {
		--product-gap: var(--product-gap-mobile, var(--product-gap-base, 1.25em));
	}
}

/* WooCommerce's flex widths with its 1.25em swapped for the set gap. */
@media (min-width: 600px) {
	.wc-block-product-template.is-flex-container.is-flex-container.columns-2:not(.carousel) > li { width: calc((100% - var(--product-gap)) / 2); }
	.wc-block-product-template.is-flex-container.is-flex-container.columns-3:not(.carousel) > li { width: calc((100% - 2 * var(--product-gap)) / 3); }
	.wc-block-product-template.is-flex-container.is-flex-container.columns-4:not(.carousel) > li { width: calc((100% - 3 * var(--product-gap)) / 4); }
	.wc-block-product-template.is-flex-container.is-flex-container.columns-5:not(.carousel) > li { width: calc((100% - 4 * var(--product-gap)) / 5); }
	.wc-block-product-template.is-flex-container.is-flex-container.columns-6:not(.carousel) > li { width: calc((100% - 5 * var(--product-gap)) / 6); }
}
