/* Shop archive layout */
.ggn-shop .wc-block-breadcrumbs {
	color: var(--wp--preset--color--muted);
	font-size: 16px !important; /* beats WooCommerce's has-small-font-size preset class (!important) */
}

.ggn-shop .ggn-shop__toolbar {
	align-items: center;
	gap: var(--wp--preset--spacing--card);
}

.ggn-shop .wc-block-catalog-sorting select {
	appearance: none;
	background-image: linear-gradient(45deg, transparent 50%, var(--wp--preset--color--muted) 50%), linear-gradient(135deg, var(--wp--preset--color--muted) 50%, transparent 50%);
	background-position: calc(100% - 1.25em) 50%, calc(100% - 0.875em) 50%;
	background-repeat: no-repeat;
	background-size: 0.375em 0.375em, 0.375em 0.375em;
	background-color: var(--wp--preset--color--surface-2);
	border: 1px solid var(--wp--preset--color--line);
	border-radius: var(--wp--custom--radius--control);
	color: var(--wp--preset--color--text);
	font-family: var(--wp--preset--font-family--body);
	font-size: 16px;
	line-height: 1.25;
	min-height: var(--wp--custom--control--size);
	padding-bottom: var(--wp--preset--spacing--card);
	padding-left: var(--wp--preset--spacing--card);
	padding-right: calc(var(--wp--custom--control--size) + var(--wp--preset--spacing--card));
	padding-top: var(--wp--preset--spacing--card);
	-webkit-appearance: none;
}

/* The test site's reset leaves WooCommerce lookup tables empty, so filter blocks render no options. */
.ggn-shop .ggn-shop__filters:not(:has(.wc-block-product-filter-checkbox-list__item, .wc-block-product-filter-chips__item, .wc-block-product-filter-price-slider__range, .wc-block-product-filter-removable-chips__item)) {
	display: none;
}

.ggn-shop .wc-block-catalog-sorting select {
	font-size: var(--wp--preset--font-size--body) !important;
}

.ggn-shop .ggn-shop__body {
	display: grid;
	gap: var(--wp--preset--spacing--card-lg);
	grid-template-columns: minmax(0, 1fr) minmax(0, 4fr);
}

.ggn-shop .ggn-product-grid {
	margin-block-start: 0;
}

.ggn-shop .ggn-shop__filters {
	background-color: var(--wp--preset--color--surface);
	border: 1px solid var(--wp--preset--color--line);
	border-radius: var(--wp--custom--radius--card);
	height: fit-content;
	padding: var(--wp--preset--spacing--card-lg);
}

.ggn-shop .ggn-shop__filters h2 {
	margin-top: 0;
}

.ggn-shop .wc-block-product-filters,
.ggn-shop .wc-block-components-filter-wrapper {
	color: var(--wp--preset--color--text);
}

.ggn-shop .wc-block-components-filter-wrapper {
	border-color: var(--wp--preset--color--line);
}

.ggn-shop .wc-block-components-filter-wrapper button,
.ggn-shop .wc-block-components-filter-wrapper input {
	color: var(--wp--preset--color--text);
}

.ggn-shop .wc-block-components-filter-wrapper button {
	font-family: var(--wp--preset--font-family--heading);
	min-height: var(--wp--custom--control--size);
}

.ggn-shop .wc-block-product-filter-checkbox-list,
.ggn-shop .wc-block-product-filter-price-slider {
	color: var(--wp--preset--color--text);
}

.ggn-shop .wc-block-product-filter-checkbox-list__item,
.ggn-shop .wc-block-product-filter-price-slider__left,
.ggn-shop .wc-block-product-filter-price-slider__right {
	color: var(--wp--preset--color--muted);
}

.ggn-shop .wc-block-product-filter-checkbox-list__item input[type="checkbox"] {
	accent-color: var(--wp--preset--color--accent);
}

.ggn-shop .wc-block-product-filter-price-slider__range {
	background-color: var(--wp--preset--color--surface-2);
}

.ggn-shop .wc-block-product-filter-price-slider__range::-webkit-slider-thumb {
	background-color: var(--wp--preset--color--accent);
}

.ggn-shop .wc-block-product-filter-price-slider__range::-moz-range-thumb {
	background-color: var(--wp--preset--color--accent);
}

.ggn-shop .wc-block-product-filter-price-slider__content {
	grid-template-areas: "price-slider price-slider" "left-input right-input";
	grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}

.ggn-shop .wc-block-product-filter-price-slider__left,
.ggn-shop .wc-block-product-filter-price-slider__right {
	min-width: 0;
}

.ggn-shop .wc-block-product-filter-price-slider__left input.min,
.ggn-shop .wc-block-product-filter-price-slider__right input.max {
	background-color: var(--wp--preset--color--surface-2);
	border: 1px solid var(--wp--preset--color--line);
	border-radius: var(--wp--custom--radius--control);
	box-sizing: border-box;
	color: var(--wp--preset--color--text);
	font-family: var(--wp--preset--font-family--body);
	font-size: var(--wp--preset--font-size--body);
	max-width: none;
	min-width: 0;
	padding: var(--wp--preset--spacing--card) var(--wp--preset--spacing--10);
	width: 100%;
}

.ggn-shop .wc-block-product-filter-checkbox-list__item + .wc-block-product-filter-checkbox-list__item {
	border-color: var(--wp--preset--color--line);
}

.ggn-shop .wp-block-query-pagination {
	margin-top: var(--wp--preset--spacing--section);
}

.ggn-shop .wp-block-query-pagination a,
.ggn-shop .wp-block-query-pagination .page-numbers.current {
	align-items: center;
	border-radius: var(--wp--custom--radius--control);
	display: inline-flex;
	justify-content: center;
	min-height: var(--wp--custom--control--size);
	min-width: var(--wp--custom--control--size);
}

@media (max-width: 781px) {
	.ggn-shop .ggn-shop__breadcrumbs,
	.ggn-single-product .ggn-single-product__breadcrumbs,
	.ggn-topup .ggn-topup__breadcrumbs {
		display: none;
		margin: 0;
	}

	.ggn-shop .ggn-shop__breadcrumbs + *,
	.ggn-single-product .ggn-single-product__breadcrumbs + *,
	.ggn-topup .ggn-topup__breadcrumbs + * {
		margin-block-start: 0;
	}

	.ggn-shop .wc-block-product-filters__open-button,
	.ggn-shop .wc-block-product-filters button.wc-block-product-filters__open-button {
		justify-content: flex-start;
		padding-left: var(--wp--preset--spacing--card);
		text-align: left;
	}

	.ggn-shop .wc-block-product-filters__open-button > span {
		justify-content: flex-start;
		text-align: left;
	}

	.ggn-shop .ggn-shop__toolbar {
		align-items: stretch;
	}

	.ggn-shop .wc-block-catalog-sorting,
	.ggn-shop .wc-block-catalog-sorting select {
		width: 100%;
	}

	.ggn-shop .ggn-shop__body {
		display: block;
	}

	.ggn-shop .ggn-shop__filters {
		background-color: transparent;
		border: 0;
		border-radius: 0;
		padding: 0;
	}

	.ggn-shop .ggn-shop__filters > h2 {
		display: none;
	}

	.ggn-shop .wc-block-product-filters__open-button,
	.ggn-shop .wc-block-product-filters button.wc-block-product-filters__open-button {
		background-color: transparent;
		border: 1px solid var(--wp--preset--color--line);
		border-radius: var(--wp--custom--radius--control);
		color: var(--wp--preset--color--text);
		font-family: var(--wp--preset--font-family--heading);
		font-weight: 600;
		min-height: var(--wp--custom--control--size);
		width: 100%;
	}

	.ggn-shop .wc-block-product-filters__overlay {
		background-color: var(--wp--preset--color--surface);
		border-radius: var(--wp--custom--radius--sheet) var(--wp--custom--radius--sheet) 0 0;
		bottom: 0;
		box-sizing: border-box;
		left: 0;
		max-height: 100vh;
		max-height: 100dvh;
		overflow: hidden;
		position: fixed;
		right: 0;
		top: auto;
		z-index: 70;
	}

	.ggn-shop .wc-block-product-filters__overlay-content {
		max-height: 100vh;
		max-height: 100dvh;
		overflow-x: hidden;
		overflow-y: auto;
		overscroll-behavior: contain;
		-webkit-overflow-scrolling: touch;
	}

	.ggn-shop .wc-block-product-filters__overlay-header,
	.ggn-shop .wc-block-product-filters__overlay-footer {
		background-color: var(--wp--preset--color--surface);
		position: sticky;
		z-index: 1;
	}

	.ggn-shop .wc-block-product-filters__overlay-header {
		top: 0;
	}

	.ggn-shop .wc-block-product-filters__overlay-footer {
		bottom: 0;
	}

	.ggn-shop .ggn-product-grid {
		margin-top: var(--wp--preset--spacing--card-lg);
	}
}

/* Mobile filter button: icon and label left-aligned (#115). */
.ggn-shop .wc-block-product-filters .wc-block-product-filters__open-overlay {
	justify-content: flex-start;
	text-align: left;
}

/* Keep the collection in the full-width column when the empty filter card is hidden. */
@media (min-width: 782px) {
	.ggn-shop .ggn-shop__body:not(:has(> .ggn-shop__filters .wc-block-product-filter-checkbox-list__item, > .ggn-shop__filters .wc-block-product-filter-chips__item, > .ggn-shop__filters .wc-block-product-filter-price-slider__range, > .ggn-shop__filters .wc-block-product-filter-removable-chips__item)) {
		grid-template-columns: minmax(0, 1fr);
	}
}


/* #151: the filter "Clear filters" button spans the sidebar (kept out of the block attributes so the saved markup stays valid). */
.ggn-shop__filters .wc-block-product-filter-clear-button {
	width: 100%;
}

.ggn-shop__filters .wc-block-product-filter-clear-button .wp-block-button__link {
	text-align: center;
	width: 100%;
}
