/*
 * Fanmerch Legacy Product Filters – store product-type buttons.
 * Mirrors the current dxw3 / WooBeWoo look and reuses its per-store colour variables
 * (--button-bg, --button-color, --button-bg-active, --button-color-active from dxw3-customizer-vars).
 * Loaded only when the new filter renders. Every selector is under .fm-legacy-filter.
 */
.fm-legacy-filter {
	padding: 35px 0;
}

.fm-legacy-filter .fm-legacy-filter__title {
	margin: 0 0 10px;
	color: #222;
	font-weight: 600;
}

.fm-legacy-filter .fm-legacy-filter__list {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.fm-legacy-filter .fm-legacy-filter__item {
	flex: 0 0 auto;
	margin: 0;
	padding: 0;
	list-style: none;
}

.fm-legacy-filter .fm-legacy-filter__link {
	display: inline-flex;
	align-items: center;
	min-height: 40px;
	padding: 8px 16px;
	border: 1px solid var(--button-bg, #495b62);
	border-radius: 6px;
	background-color: var(--button-bg, #495b62);
	color: var(--button-color, #fff);
	font-size: 16px;
	font-weight: 700;
	line-height: 1.4;
	text-decoration: none;
	white-space: nowrap;
	transition: opacity 0.15s ease;
}

.fm-legacy-filter .fm-legacy-filter__link:hover {
	opacity: 0.85;
	color: var(--button-color, #fff);
	text-decoration: none;
}

.fm-legacy-filter .fm-legacy-filter__link:focus-visible {
	outline: 2px solid var(--button-bg-active, #111);
	outline-offset: 2px;
}

/* Active state: a server-rendered class – no parent-selector tricks, no JavaScript. */
.fm-legacy-filter .fm-legacy-filter__link--active,
.fm-legacy-filter .fm-legacy-filter__link--active:hover {
	border-color: var(--button-bg-active, var(--button-color, #fff));
	background-color: var(--button-bg-active, var(--button-color, #fff));
	color: var(--button-color-active, var(--button-bg, #495b62));
	opacity: 1;
}

/*
 * "Ale": always the Fanmerch / WooCommerce sale red (#dd3333, as the .onsale badge), whatever the
 * store colours. Active = darker red with an inner white ring + bold label (server-rendered class).
 */
.fm-legacy-filter .fm-legacy-filter__link--sale,
.fm-legacy-filter .fm-legacy-filter__link--sale:hover {
	border-color: #dd3333;
	background-color: #dd3333;
	color: #fff;
}

.fm-legacy-filter .fm-legacy-filter__link--sale:focus-visible {
	outline-color: #dd3333;
}

.fm-legacy-filter .fm-legacy-filter__link--sale.fm-legacy-filter__link--active,
.fm-legacy-filter .fm-legacy-filter__link--sale.fm-legacy-filter__link--active:hover {
	border-color: #8f1d1d;
	background-color: #a61f1f;
	box-shadow: inset 0 0 0 2px #fff;
	color: #fff;
	font-weight: 700;
	opacity: 1;
}

/* Phones / tablets: one horizontally scrolling row, finger-sized, no visible scrollbar. */
@media (max-width: 992px) {
	.fm-legacy-filter {
		padding: 20px 0;
	}

	.fm-legacy-filter .fm-legacy-filter__list {
		flex-wrap: nowrap;
		overflow-x: auto;
		-webkit-overflow-scrolling: touch;
		overscroll-behavior-x: contain;
		scroll-snap-type: x proximity;
		scrollbar-width: none;
		padding-bottom: 2px;
	}

	.fm-legacy-filter .fm-legacy-filter__list::-webkit-scrollbar {
		display: none;
	}

	.fm-legacy-filter .fm-legacy-filter__item {
		scroll-snap-align: start;
	}

	.fm-legacy-filter .fm-legacy-filter__link {
		min-height: 44px;
		font-size: 15px;
	}
}
