/* Product category pagination: remove only the full-width frame, not button borders. */
.woocommerce .product-category-page nav.woocommerce-pagination,
.woocommerce-page .product-category-page nav.woocommerce-pagination,
.woocommerce .product-category-page nav.woocommerce-pagination > ul.page-numbers,
.woocommerce-page .product-category-page nav.woocommerce-pagination > ul.page-numbers {
	width: fit-content !important;
	min-width: 0 !important;
	border: none !important;
	border-top: none !important;
	border-bottom: none !important;
	outline: none !important;
	background: transparent !important;
	box-shadow: none !important;
}

.product-category-page .woocommerce-pagination::before,
.product-category-page .woocommerce-pagination::after,
.product-category-page .woocommerce-pagination ul::before,
.product-category-page .woocommerce-pagination ul::after {
	display: none !important;
	content: none !important;
}

/* WooCommerce adds clearing pseudo-elements to product lists. In a CSS grid
   they become invisible cells, shifting the first and last rows by one. */
.woocommerce .product-category-page .product-category-page__products > ul.products,
.woocommerce-page .product-category-page .product-category-page__products > ul.products {
	display: grid !important;
	grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
	grid-auto-flow: row !important;
}

.woocommerce .product-category-page .product-category-page__products > ul.products::before,
.woocommerce .product-category-page .product-category-page__products > ul.products::after,
.woocommerce-page .product-category-page .product-category-page__products > ul.products::before,
.woocommerce-page .product-category-page .product-category-page__products > ul.products::after {
	display: none !important;
	content: none !important;
}

.woocommerce .product-category-page .product-category-page__products > ul.products > li.product,
.woocommerce-page .product-category-page .product-category-page__products > ul.products > li.product {
	grid-column: auto !important;
	grid-row: auto !important;
}

@media (max-width: 600px) {
	.woocommerce .product-category-page .product-category-page__products > ul.products,
	.woocommerce-page .product-category-page .product-category-page__products > ul.products {
		grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
	}
}
