ul.products {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 15px;
	margin: 0;
	padding: 0;
	list-style: none;
}

ul.products.columns-5 {
	grid-template-columns: repeat(5, minmax(0, 1fr));
}

ul.products.products--selected {
	grid-template-columns: repeat(3, minmax(0, 1fr));
}

@media (max-width: 991px) {
	ul.products.columns-5 {
		grid-template-columns: repeat(4, minmax(0, 1fr));
	}
}

@media (max-width: 767px) {
	ul.products,
	ul.products.columns-5 {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}

	ul.products.products--selected {
		grid-template-columns: repeat(4, minmax(0, 1fr));
	}
}

@media (max-width: 478px) {
	ul.products,
	ul.products.columns-5,
	ul.products.products--selected {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

/* An empty Woo notices wrapper would otherwise take a flex gap. */
.shop-archive > .woocommerce-notices-wrapper:not(:has(*)) {
	display: none;
}

.shop-archive__categories {
	padding: 15px 0;
	border-top: 1px solid var(--wp--preset--color--mid-grey);
	color: var(--wp--preset--color--text);
	font-size: var(--wp--preset--font-size--sm);
	line-height: 30px;
}

.shop-archive__categories-title {
	margin: 0 0 8px;
	color: var(--wp--preset--color--black);
	font-size: inherit;
	font-weight: 500;
	line-height: normal;
	letter-spacing: 0.5px;
	text-transform: uppercase;
}

.shop-archive__categories .children {
	padding-left: 20px;
}

.shop-archive__categories .cat-item:not(.current-cat, .current-cat-ancestor) > .children {
	display: none;
}

.shop-archive__categories a {
	color: inherit;
	text-decoration: none;
}

.shop-archive__categories a:hover {
	text-decoration: underline;
}

.shop-archive__categories .current-cat > a {
	font-weight: 500;
}

.shop-filters {
	color: var(--wp--preset--color--text);
	font-size: var(--wp--preset--font-size--sm);
}

.shop-filters[open] {
	--panel-ease: cubic-bezier(0.77, 0, 0.175, 1);
	position: fixed;
	inset: 0 0 0 auto;
	display: flex;
	flex-direction: column;
	width: min(100%, 420px);
	max-width: 100%;
	height: 100dvh;
	max-height: none;
	margin: 0;
	padding: 0;
	border: 0;
	background: var(--wp--preset--color--white);
	transition: transform 0.3s var(--panel-ease), overlay 0.3s allow-discrete, display 0.3s allow-discrete;
}

.shop-filters::backdrop {
	background: rgb(0 0 0 / 50%);
}

@starting-style {
	.shop-filters[open] {
		transform: translateX(100%);
	}
}

.shop-filters__header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 10px 10px 10px 20px;
	border-bottom: 1px solid var(--wp--preset--color--mid-grey);
}

.shop-filters__title {
	margin: 0;
	color: var(--wp--preset--color--black);
	font-size: var(--wp--preset--font-size--md);
	font-weight: 500;
	letter-spacing: 0.5px;
	text-transform: uppercase;
}

.shop-filters__close {
	display: grid;
	place-items: center;
	width: 44px;
	height: 44px;
	cursor: pointer;
}

.shop-filters__close svg {
	width: 16px;
	height: 16px;
}

.shop-filters[open] .shop-filters__body {
	flex: 1;
	padding: 15px 20px;
	overflow-y: auto;
	overscroll-behavior: contain;
}

.shop-filters__footer {
	padding: 15px 20px;
	border-top: 1px solid var(--wp--preset--color--mid-grey);
}

.shop-filters-open {
	display: flex;
	flex: 1;
	gap: 6px;
	align-items: center;
	justify-content: center;
	min-height: 42px;
	border: 1px solid var(--wp--preset--color--black);
	background: var(--wp--preset--color--white);
	color: var(--wp--preset--color--black);
	font-size: var(--wp--preset--font-size--sm);
	font-weight: 500;
	letter-spacing: 0.5px;
	text-transform: uppercase;
	cursor: pointer;
}

@media (min-width: 992px) {
	/* The dialog only exists for the mobile panel; on desktop its body sits in the sidebar. */
	.shop-filters:not([open]) {
		position: static;
		display: block;
		width: auto;
		max-width: none;
		height: auto;
		margin: 0;
		padding: 0;
		border: 0;
		background: none;
	}

	.shop-filters__header,
	.shop-filters__footer,
	.shop-filters-open {
		display: none;
	}
}

@media (max-width: 991px) {
	.shop-archive .woocommerce-ordering select {
		width: 100%;
	}

	.shop-filters[open] .nwcp-filter:first-child {
		border-top: 0;
	}

	/* Mobile panel sections collapse to their heading. */
	.shop-filters[open] .nwcp-filter.is-collapsed > :not(.nwcp-filter__label) {
		display: none;
	}
}

.nwcp-filter__toggle {
	display: flex;
	width: 100%;
	align-items: center;
	justify-content: space-between;
	font: inherit;
	letter-spacing: inherit;
	text-transform: inherit;
	cursor: pointer;
}

.nwcp-filter__toggle svg {
	width: 12px;
	height: 12px;
	transition: transform 0.2s;
}

.nwcp-filter__toggle[aria-expanded="true"] svg {
	transform: rotate(180deg);
}

.category-chips ul {
	display: flex;
	gap: 6px;
	margin: 0 calc(-1 * var(--wp--style--root--padding-right, 20px)) 0 0;
	padding: 0 var(--wp--style--root--padding-right, 20px) 4px 0;
	overflow-x: auto;
	list-style: none;
	scrollbar-width: none;
}

.category-chips a {
	display: block;
	padding: 6px 14px;
	border: 1px solid var(--wp--preset--color--mid-grey);
	color: var(--wp--preset--color--black);
	font-size: var(--wp--preset--font-size--xs);
	text-decoration: none;
	white-space: nowrap;
}

.category-chips .category-chips__back {
	display: flex;
	gap: 8px;
	align-items: center;
}

.category-chips__back svg {
	width: 14px;
	height: auto;
	rotate: 180deg;
}

.category-chips a[aria-current="page"] {
	border-color: var(--wp--preset--color--black);
	background: var(--wp--preset--color--black);
	color: var(--wp--preset--color--white);
}

.nwcp-filters {
	display: flex;
	flex-direction: column;
}

.nwcp-filters .nwcp-filter {
	min-width: 0;
	margin: 0;
	padding: 15px 0;
	border: 0;
	border-top: 1px solid var(--wp--preset--color--mid-grey);
}

.nwcp-filters legend.nwcp-filter__label {
	float: left;
	width: 100%;
	margin-bottom: 8px;
	padding: 0;
	color: var(--wp--preset--color--black);
	font-weight: 500;
	letter-spacing: 0.5px;
	text-transform: uppercase;
}

.nwcp-filter__options {
	clear: both;
	margin: 0;
	padding: 0;
	list-style: none;
}

.nwcp-filter__option label {
	display: flex;
	gap: 10px;
	align-items: center;
	line-height: 30px;
	cursor: pointer;
}

.nwcp-filter__option input {
	flex: none;
	width: 16px;
	height: 16px;
	margin: 0;
	accent-color: var(--wp--preset--color--black);
}

.nwcp-filter__name {
	min-width: 0;
	overflow-wrap: anywhere;
}

.nwcp-filter__count {
	margin-left: auto;
	color: var(--wp--preset--color--grey);
	font-size: var(--wp--preset--font-size--xs);
}

.nwcp-filter__option label:hover .nwcp-filter__name {
	text-decoration: underline;
}

.nwcp-filter__option--active .nwcp-filter__name {
	font-weight: 500;
}

.nwcp-filter__option--more:not(.is-shown) {
	display: none;
}

.nwcp-filter__more,
.nwcp-filter__clear,
.nwcp-active-filters__clear {
	padding: 0;
	color: var(--wp--preset--color--black);
	font-size: var(--wp--preset--font-size--xs);
	text-decoration: underline;
	cursor: pointer;
}

.nwcp-filter__more {
	display: block;
	margin-top: 8px;
}

.nwcp-filter__clear {
	display: inline-block;
	margin-top: 8px;
}

.nwcp-filter--buttons .nwcp-filter__options {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
}

.nwcp-filter--buttons .nwcp-filter__option label {
	position: relative;
	justify-content: center;
	min-width: 44px;
	min-height: 36px;
	padding: 0 10px;
	border: 1px solid var(--wp--preset--color--mid-grey);
	line-height: 1.2;
	transition: border-color 0.2s, background-color 0.2s, color 0.2s;
}

.nwcp-filter--buttons .nwcp-filter__option input {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	opacity: 0;
	cursor: pointer;
}

.nwcp-filter--buttons .nwcp-filter__count {
	display: none;
}

.nwcp-filter--buttons .nwcp-filter__option label:hover {
	border-color: var(--wp--preset--color--black);
}

.nwcp-filter--buttons .nwcp-filter__option label:hover .nwcp-filter__name {
	text-decoration: none;
}

.nwcp-filter--buttons .nwcp-filter__option label:has(:checked) {
	border-color: var(--wp--preset--color--black);
	background: var(--wp--preset--color--black);
	color: var(--wp--preset--color--white);
}

.nwcp-filter--buttons .nwcp-filter__option label:has(:focus-visible) {
	outline: 2px solid var(--wp--preset--color--black);
	outline-offset: 2px;
}

.nwcp-filter--range {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	align-items: flex-end;
}

.nwcp-filter--range .nwcp-filter__label {
	margin-bottom: 0;
}

.nwcp-filter__field {
	display: flex;
	flex: 1 1 0;
	flex-direction: column;
	gap: 4px;
	min-width: 0;
	font-size: var(--wp--preset--font-size--xs);
}

.nwcp-filter__unit {
	line-height: 42px;
}

.nwcp-filter--toggle label {
	display: flex;
	gap: 10px;
	align-items: center;
	line-height: 30px;
	cursor: pointer;
}

.nwcp-filter--toggle input {
	width: 16px;
	height: 16px;
	margin: 0;
	accent-color: var(--wp--preset--color--black);
}

.nwcp-filter__swatch {
	flex: none;
	width: 16px;
	height: 16px;
	border: 1px solid var(--wp--preset--color--mid-grey);
}

.nwcp-filters__submit {
	margin-top: 15px;
	padding: 9px 18px;
	background: var(--wp--preset--color--black);
	color: var(--wp--preset--color--white);
	font-weight: 500;
	letter-spacing: 0.5px;
	cursor: pointer;
}

@media (scripting: enabled) {
	.nwcp-filters__submit {
		display: none;
	}
}

.nwcp-active-filters:not(:has(li)) {
	display: none;
}

.nwcp-active-filters {
	display: flex;
	flex-wrap: wrap;
	gap: 6px 12px;
	align-items: center;
	margin-bottom: 15px;
}

.nwcp-active-filters__list {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.nwcp-active-filters__remove {
	display: inline-flex;
	gap: 8px;
	align-items: center;
	padding: 4px 10px;
	background: var(--wp--preset--color--sand);
	color: var(--wp--preset--color--black);
	font-size: var(--wp--preset--font-size--xs);
	text-decoration: none;
	transition: background-color 0.2s;
}

.nwcp-active-filters__remove::after {
	content: "×" / "";
	font-size: 1.2em;
	line-height: 1;
}

.nwcp-active-filters__remove:hover {
	background: var(--wp--preset--color--dark-sand);
}

html.nwcp-filters-loading [data-nwcp-filters-region="products"] {
	opacity: 0.5;
	transition: opacity 0.2s;
}

.woocommerce-ordering {
	position: relative;
}

.woocommerce-ordering::after {
	position: absolute;
	top: 50%;
	right: 14px;
	width: 12px;
	height: 12px;
	margin-top: -6px;
	background-color: currentColor;
	mask: url("../icons/chevron.svg") center / contain no-repeat;
	content: "";
	pointer-events: none;
}

.woocommerce-ordering select {
	width: 211px;
	padding-right: 36px;
	font-size: var(--wp--preset--font-size--sm);
	appearance: none;
	border-radius: 0;
}

.woocommerce-pagination ul {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	margin-block: var(--wp--preset--spacing--l);
	padding: 0;
	list-style: none;
}

.woocommerce-pagination .page-numbers:is(a, span) {
	display: inline-block;
	min-width: 3.3em;
	padding: 10px;
	color: var(--wp--preset--color--black);
	text-align: center;
}

.woocommerce-pagination .current {
	font-weight: 500;
}

.woocommerce-no-products-found {
	font-size: var(--wp--preset--font-size--sm);
}

.category-description iframe {
	width: 560px;
	max-width: 100%;
	height: auto;
	aspect-ratio: 16 / 9;
}

.infinite-scroll-loader {
	display: flex;
	justify-content: center;
	gap: 6px;
}

.infinite-scroll-loader.is-loading {
	margin-top: var(--wp--preset--spacing--l);
}

.infinite-scroll-loader:not(.is-loading) > span {
	display: none;
}

.infinite-scroll-loader > span {
	width: 10px;
	height: 10px;
	background: var(--wp--preset--color--black);
	animation: infinite-scroll-dot 0.9s infinite ease-in-out both;
}

.infinite-scroll-loader > span:nth-child(2) {
	animation-delay: 0.15s;
}

.infinite-scroll-loader > span:nth-child(3) {
	animation-delay: 0.3s;
}

@keyframes infinite-scroll-dot {
	0%, 80%, 100% { opacity: 0.2; }
	40% { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
	.infinite-scroll-loader > span {
		animation: none;
	}
}
