/**
 * Desktop-to-mobile collapse uses max-width because the desktop layout is the source and small screens simplify it. Queries are rem; 782px is the admin-bar exception only.
 *
 * Custom Shop section — filter pills + product grid.
 */

.custom-shop {
	width: var(--content-shell);
	margin-inline: auto;
	padding-block: var(--section-pad-block);
}

.custom-shop--archive {
	padding-top: var(--space-xl);
}

.custom-shop__inner {
	display: flex;
	flex-direction: column;
	gap: var(--space-xl);
}

.custom-shop__filters-wrap {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	width: 100%;
	min-width: 0;
}

.custom-shop__filters {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: center;
	gap: 0.8125rem;
}

.custom-shop--archive .custom-shop__filters {
	flex: 1 1 auto;
	flex-wrap: nowrap;
	justify-content: flex-start;
	min-width: 0;
	max-width: 100%;
	overflow-x: auto;
	overflow-y: hidden;
	padding-block: 0.125rem;
	-webkit-overflow-scrolling: touch;
	scrollbar-width: none;
	overscroll-behavior-x: contain;
	scroll-behavior: smooth;
}

.custom-shop--archive .custom-shop__filters::-webkit-scrollbar {
	display: none;
	width: 0;
	height: 0;
}

@media (prefers-reduced-motion: reduce) {
	.custom-shop--archive .custom-shop__filters {
		scroll-behavior: auto;
	}
}

.custom-shop__filters-nav {
	flex: 0 0 auto;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 1.5rem;
	min-height: var(--btn-filter-min-height, 3.3125rem);
	padding: 0;
	border: 0;
	background: transparent;
	cursor: pointer;
}

.custom-shop__filters-nav img {
	display: block;
	width: 0.75rem;
	height: 2.625rem;
	object-fit: contain;
}

.custom-shop__filters-nav:hover,
.custom-shop__filters-nav:focus-visible {
	opacity: 0.7;
	outline: none;
}

.custom-shop__filters-nav:disabled {
	opacity: 0.28;
	cursor: not-allowed;
}

.custom-shop__filters-nav[hidden] {
	display: none;
}

.custom-shop--archive .custom-shop__filter {
	flex: 0 0 auto;
}

.custom-shop__filter {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: var(--btn-filter-min-height);
	padding: var(--btn-filter-padding-block) var(--btn-filter-padding-inline);
	border: var(--btn-filter-border-width) solid var(--btn-filter-border);
	border-radius: var(--btn-filter-radius);
	background: var(--btn-filter-bg);
	color: var(--btn-filter-text);
	cursor: pointer;
	font-family: var(--font-sans);
	font-size: var(--btn-filter-font-size);
	font-weight: var(--btn-filter-font-weight);
	line-height: var(--btn-filter-line-height);
	letter-spacing: var(--btn-filter-letter-spacing);
	text-decoration: none;
	text-transform: uppercase;
	white-space: nowrap;
	transition: var(--btn-filter-transition);
}

a.custom-shop__filter:hover,
a.custom-shop__filter:focus-visible {
	color: var(--btn-filter-text-hover);
}

.custom-shop__filter--show-all {
	padding-inline: var(--btn-filter-padding-inline-show-all);
}

.custom-shop__filter:hover,
.custom-shop__filter:focus-visible {
	outline: none;
	border-color: var(--btn-filter-border-hover);
	background: var(--btn-filter-bg-hover);
	color: var(--btn-filter-text-hover);
}

.custom-shop__filter--active {
	border-color: var(--btn-filter-border-active);
	background: var(--btn-filter-bg-active);
	color: var(--btn-filter-text-active);
}

.custom-shop__filter--active:hover,
.custom-shop__filter--active:focus-visible {
	border-color: var(--btn-filter-border-active);
	background: #9a1c18;
	color: var(--btn-filter-text-active);
}

.custom-shop__filter-label {
	display: block;
}

.custom-shop--archive .woocommerce-pagination {
	display: flex;
	justify-content: center;
	margin: var(--pagination-margin-block-start) 0 0;
	padding: 0;
	list-style: none;
}

.custom-shop--archive .woocommerce-pagination ul {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: center;
	/* gap: var(--pagination-gap); */
	margin: 0;
	padding: 0;
	list-style: none;
}

.custom-shop--archive .woocommerce-pagination li {
	margin: 0;
	padding: 0;
	list-style: none;
}

.custom-shop--archive .woocommerce-pagination .page-numbers {
	box-sizing: border-box;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: var(--pagination-size);
	min-height: var(--pagination-size);
	/* padding: 0 0.75rem;
	border: 1px solid var(--pagination-border); */
	/* border-radius: var(--pagination-radius); */
	background: var(--pagination-bg);
	color: var(--pagination-color);
	cursor: pointer;
	font-family: var(--font-sans);
	font-size: var(--pagination-font-size);
	font-weight: var(--pagination-font-weight);
	letter-spacing: var(--pagination-letter-spacing);
	line-height: 1;
	text-decoration: none;
	text-transform: uppercase;
	transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.custom-shop--archive .woocommerce-pagination a.page-numbers:hover,
.custom-shop--archive .woocommerce-pagination a.page-numbers:focus-visible {
	outline: none;
	border-color: var(--pagination-border-hover);
	background: var(--pagination-bg-hover);
	color: var(--pagination-color-hover);
}

.custom-shop--archive .woocommerce-pagination .page-numbers.current {
	border-color: var(--pagination-border-current);
	background: var(--pagination-bg-current);
	color: var(--pagination-color-current);
	cursor: default;
	pointer-events: none;
}

.custom-shop--archive .woocommerce-pagination .page-numbers.dots {
	min-width: auto;
	padding-inline: 0.25rem;
	border-color: transparent;
	background: transparent;
	color: var(--pagination-dots-color);
	cursor: default;
	letter-spacing: 0.15em;
	pointer-events: none;
}

.custom-shop--archive .woocommerce-pagination .page-numbers.prev,
.custom-shop--archive .woocommerce-pagination .page-numbers.next {
	min-width: var(--pagination-nav-min-width);
	padding-inline: 0.75rem;
	font-size: 1.125rem;
	font-weight: 500;
	letter-spacing: 0;
	line-height: 1;
	text-transform: none;
}

.custom-shop__grid {
	display: grid;
	gap: 1.5rem;
	grid-template-columns: repeat(1, minmax(0, 1fr));
}

/* Mobile-first: 1 col base. Multi-col kicks in from 40rem. */
.custom-shop__grid--cols-2,
.custom-shop__grid--cols-3,
.custom-shop__grid--cols-4,
.custom-shop__grid--cols-5,
.custom-shop__grid--cols-6 {
	grid-template-columns: repeat(1, minmax(0, 1fr));
}

@media (min-width: 40rem) {
	.custom-shop__grid--cols-2,
	.custom-shop__grid--cols-3,
	.custom-shop__grid--cols-4,
	.custom-shop__grid--cols-5,
	.custom-shop__grid--cols-6 {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

/* Card visuals live in assets/css/components/product-card.css. */
.custom-shop__card.is-filtered-out {
	display: none;
}

.custom-shop__empty {
	margin: 0;
	grid-column: 1 / -1;
	padding: var(--space-xl);
	color: var(--color-text-muted);
	text-align: center;
}

@media (min-width: 62rem) {
	.custom-shop__grid--cols-3 {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}

	.custom-shop__grid--cols-4 {
		grid-template-columns: repeat(4, minmax(0, 1fr));
	}

	.custom-shop__grid--cols-5 {
		grid-template-columns: repeat(5, minmax(0, 1fr));
	}

	.custom-shop__grid--cols-6 {
		grid-template-columns: repeat(6, minmax(0, 1fr));
	}
}

@media (max-width: 39.9375rem) {
	.custom-shop {
		width: var(--content-shell);
	}

	/*
	 * Must live here (not only global.css): this file loads after global and
	 * sets display:flex on the wrap/filters, which otherwise wins over the
	 * mobile hide and shows dropdown + pill slider together.
	 */
	.custom-shop__filters,
	.custom-shop__filters-wrap {
		display: none;
	}
}
