/* Armeria 3S Toolkit - F1 product filters. Reads theme tokens (--a3s-*) with own fallbacks. */

.a3s-sr {
	position: absolute !important;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0 0 0 0);
	clip-path: inset(50%);
	white-space: nowrap;
	border: 0;
}

.a3s-filters,
.a3s-chips-bar {
	--a3s-f-primary: var(--a3s-color-primary, #e95e1b);
	--a3s-f-on-primary: var(--a3s-color-primary-contrast, #231f20);
	--a3s-f-active: var(--a3s-filter-active, var(--a3s-color-price, #b84a0e));
	--a3s-f-text: var(--a3s-color-text, #231f20);
	--a3s-f-muted: var(--a3s-color-muted, #5f5859);
	--a3s-f-bg: var(--a3s-color-bg, #fff);
	--a3s-f-surface: var(--a3s-color-surface, #f3f2f0);
	--a3s-f-border: var(--a3s-color-border, #dcd9d5);
	--a3s-f-box: #8a8586;
	--a3s-f-speed: .2s;
	font-family: var(--a3s-font-body, inherit);
	color: var(--a3s-f-text);
}

.a3s-filters :focus-visible,
.a3s-chips-bar :focus-visible {
	outline: 2px solid var(--a3s-f-primary);
	outline-offset: 2px;
}

.a3s-filters summary {
	list-style: none;
	cursor: pointer;
}

.a3s-filters summary::-webkit-details-marker {
	display: none;
}

/* Facet header --------------------------------------------------------------------------------- */
.a3s-facet__trigger {
	display: flex;
	align-items: center;
	gap: 8px;
	font-size: 16px;
	line-height: 1.2;
	font-weight: 500;
	text-transform: uppercase;
	user-select: none;
}

.a3s-facet__chevron {
	flex: none;
	width: 7px;
	height: 7px;
	margin-top: -4px;
	border-right: 2px solid currentColor;
	border-bottom: 2px solid currentColor;
	transform: rotate(45deg);
	transition: transform var(--a3s-f-speed) ease;
}

.a3s-facet[open] > .a3s-facet__trigger .a3s-facet__chevron {
	margin-top: 4px;
	transform: rotate(-135deg);
}

.a3s-facet.is-active > .a3s-facet__trigger {
	color: var(--a3s-f-active);
}

/* Options -------------------------------------------------------------------------------------- */
.a3s-opts {
	margin: 0;
	padding: 0;
	list-style: none;
}

.a3s-opt {
	position: relative;
	margin: 0;
}

.a3s-opt__link {
	display: flex;
	align-items: center;
	gap: 8px;
	min-height: 32px;
	padding: 3px 0;
	color: inherit;
	font-size: 16px;
	line-height: 1.2;
	text-decoration: none;
}

.a3s-opt__link:hover .a3s-opt__name {
	text-decoration: underline;
}

.a3s-opt__count {
	color: var(--a3s-f-muted);
	font-size: .875em;
}

.a3s-opt__box {
	position: relative;
	flex: none;
	width: 16px;
	height: 16px;
	background: var(--a3s-f-bg);
	border: 1px solid var(--a3s-f-box);
}

.a3s-opt.is-active > .a3s-opt__link .a3s-opt__box,
.a3s-facet--toggle.is-active .a3s-opt__box {
	background: var(--a3s-f-primary);
	border-color: var(--a3s-f-primary);
}

.a3s-opt.is-active > .a3s-opt__link .a3s-opt__box::after,
.a3s-facet--toggle.is-active .a3s-opt__box::after {
	content: "";
	position: absolute;
	left: 4px;
	top: 0;
	width: 5px;
	height: 10px;
	border-right: 2px solid var(--a3s-f-on-primary);
	border-bottom: 2px solid var(--a3s-f-on-primary);
	transform: rotate(45deg);
}

.a3s-facet--radio .a3s-opt__box {
	border-radius: 50%;
}

.a3s-facet--radio .a3s-opt.is-active > .a3s-opt__link .a3s-opt__box::after {
	left: 3px;
	top: 3px;
	width: 8px;
	height: 8px;
	border: 0;
	border-radius: 50%;
	background: var(--a3s-f-on-primary);
	transform: none;
}

.a3s-opt.is-active > .a3s-opt__link .a3s-opt__name {
	font-weight: 600;
}

/* Swatches */
.a3s-facet--swatch .a3s-opts {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	padding: 6px 0;
}

.a3s-facet--swatch .a3s-opt__link {
	min-height: 34px;
	padding: 4px 10px 4px 6px;
	border: 1px solid var(--a3s-f-border);
	font-size: 14px;
}

.a3s-facet--swatch .a3s-opt.is-active > .a3s-opt__link {
	border-color: var(--a3s-f-primary);
	box-shadow: inset 0 0 0 1px var(--a3s-f-primary);
}

.a3s-opt__swatch {
	flex: none;
	width: 20px;
	height: 20px;
	border-radius: 50%;
	background: var(--a3s-swatch, transparent);
	box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .25);
}

/* Category tree "+" */
.a3s-tree > .a3s-tree__toggle {
	position: absolute;
	top: 2px;
	right: 0;
	display: grid;
	place-items: center;
	width: 28px;
	height: 28px;
}

.a3s-tree > .a3s-tree__toggle::before {
	content: "+";
	font-size: 20px;
	line-height: 1;
}

.a3s-tree[open] > .a3s-tree__toggle::before {
	content: "\2212";
}

.a3s-opt:has(> .a3s-tree) > .a3s-opt__link {
	padding-right: 32px;
}

.a3s-tree > .a3s-opts {
	padding-left: 24px;
}

/* Show more */
.a3s-more > .a3s-more__toggle {
	display: inline-block;
	padding: 6px 0;
	font-size: 14px;
	text-decoration: underline;
}

.a3s-more[open] > .a3s-more__toggle .a3s-more__show,
.a3s-more:not([open]) > .a3s-more__toggle .a3s-more__less {
	display: none;
}

/* Dropdown + buttons */
.a3s-select {
	width: 100%;
	min-height: 40px;
	padding: 6px 8px;
	font: inherit;
	color: inherit;
	background: var(--a3s-f-bg);
	border: 1px solid var(--a3s-f-box);
	border-radius: var(--a3s-radius, 0);
}

.a3s-facet__form {
	padding: 8px 0;
}

.a3s-btn {
	display: inline-block;
	margin-top: 8px;
	padding: 8px 16px;
	font: inherit;
	font-size: 14px;
	font-weight: 500;
	text-transform: uppercase;
	color: var(--a3s-f-on-primary);
	background: var(--a3s-f-primary);
	border: 0;
	border-radius: var(--a3s-radius, 0);
	cursor: pointer;
}

.a3s-btn:hover {
	color: #fff;
	background: var(--a3s-color-secondary, #231f20);
}

/* Toggle facet (in stock / on sale) */
.a3s-facet--toggle .a3s-facet__toggle {
	font-size: 16px;
}

/* Price ---------------------------------------------------------------------------------------- */
.a3s-price {
	padding: 10px 2px;
}

.a3s-price__range {
	position: relative;
	height: 16px;
	margin: 6px 8px 16px;
}

.a3s-price__track,
.a3s-price__fill {
	position: absolute;
	top: 4.5px;
	height: 7px;
	border-radius: 5px;
}

.a3s-price__track {
	left: 0;
	right: 0;
	background: #e7e5e2;
}

.a3s-price__fill {
	left: var(--a3s-lo, 0%);
	right: calc(100% - var(--a3s-hi, 100%));
	background: var(--a3s-f-primary);
}

.a3s-price__range input[type="range"] {
	position: absolute;
	inset: 0 -8px;
	width: calc(100% + 16px);
	height: 16px;
	margin: 0;
	background: none;
	pointer-events: none;
	appearance: none;
	-webkit-appearance: none;
}

.a3s-price__range input[type="range"]::-webkit-slider-runnable-track {
	background: none;
	border: 0;
}

.a3s-price__range input[type="range"]::-moz-range-track {
	background: none;
	border: 0;
}

.a3s-price__range input[type="range"]::-webkit-slider-thumb {
	width: 18px;
	height: 18px;
	pointer-events: auto;
	cursor: grab;
	background: var(--a3s-f-bg);
	border: 5px solid var(--a3s-color-secondary, #231f20);
	border-radius: 50%;
	-webkit-appearance: none;
	appearance: none;
}

.a3s-price__range input[type="range"]::-moz-range-thumb {
	width: 8px;
	height: 8px;
	pointer-events: auto;
	cursor: grab;
	background: var(--a3s-f-bg);
	border: 5px solid var(--a3s-color-secondary, #231f20);
	border-radius: 50%;
}

.a3s-price__range input[type="range"]:focus-visible {
	outline: none;
}

.a3s-price__range input[type="range"]:focus-visible::-webkit-slider-thumb {
	box-shadow: 0 0 0 3px rgba(233, 94, 27, .45);
}

.a3s-price__range input[type="range"]:focus-visible::-moz-range-thumb {
	box-shadow: 0 0 0 3px rgba(233, 94, 27, .45);
}

.a3s-price__inputs {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
}

.a3s-price__field {
	display: inline-flex;
	align-items: center;
	gap: 2px;
	padding: 0 6px;
	border: 1px solid var(--a3s-f-box);
	background: var(--a3s-f-bg);
}

.a3s-price__field input {
	width: 7ch;
	padding: 5px 2px;
	font: inherit;
	color: inherit;
	background: transparent;
	border: 0;
	-moz-appearance: textfield;
	appearance: textfield;
}

.a3s-price__field input::-webkit-outer-spin-button,
.a3s-price__field input::-webkit-inner-spin-button {
	margin: 0;
	-webkit-appearance: none;
}

.a3s-price.is-enhanced .a3s-price__go {
	display: none;
}

/* Chips ---------------------------------------------------------------------------------------- */
.a3s-chips {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 10px;
}

.a3s-chips-bar .a3s-chips {
	margin: 15px 0 5px;
}

.a3s-chips__label {
	font-size: 16px;
}

.a3s-chips__list {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.a3s-chip {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	min-height: 32px;
	padding: 6px 8px 6px 10px;
	font-size: 16px;
	line-height: 1.2;
	color: var(--a3s-f-text);
	text-decoration: none;
	background: var(--a3s-f-surface);
}

.a3s-chip__x {
	font-weight: 700;
	opacity: .45;
	transition: opacity var(--a3s-f-speed);
}

.a3s-chip:hover .a3s-chip__x,
.a3s-chip:focus-visible .a3s-chip__x {
	opacity: 1;
}

.a3s-chips__clear {
	margin-left: auto;
	padding: 8px 10px;
	font-size: 12px;
	line-height: 1.2;
	text-transform: uppercase;
	color: var(--a3s-f-text);
	text-decoration: none;
	background: var(--a3s-f-border);
}

.a3s-chips__clear:hover {
	color: #fff;
	background: var(--a3s-color-secondary, #231f20);
}

/* Empty results */
.a3s-filters-empty__text {
	margin: 20px 0;
	font-size: 16px;
}

.a3s-filters-empty__clear {
	font-weight: 600;
	color: var(--a3s-color-price, #b84a0e);
}

/* Products region (AJAX target): leave room for a sticky header when scrolled into view. */
[data-a3s-products] {
	scroll-margin-top: 100px;
}

.a3s-filters-placeholder {
	padding: 12px;
	font-size: 14px;
	border: 1px dashed #8a8586;
}

/* Loading state of the products region (AJAX). */
.a3s-loading :is(ul.products, .products) {
	opacity: .3;
	pointer-events: none;
	transition: opacity .3s ease-in-out;
}

/* Mobile tab + drawer (< 768) ------------------------------------------------------------------ */
.a3s-filters__tab,
.a3s-filters__close {
	font: inherit;
	cursor: pointer;
}

.a3s-filters__badge {
	display: inline-grid;
	place-items: center;
	min-width: 18px;
	height: 18px;
	padding: 0 4px;
	font-size: 11px;
	font-weight: 700;
	writing-mode: horizontal-tb;
	color: #fff;
	background: var(--a3s-color-secondary, #231f20);
	border-radius: 9px;
}

@media (max-width: 767.98px) {
	.a3s-chips-bar {
		display: none;
	}

	.a3s-filters__tab {
		position: fixed;
		top: 50%;
		right: 0;
		z-index: 4990;
		display: flex;
		align-items: center;
		gap: 8px;
		padding: 14px 6px;
		font-size: 13px;
		font-weight: 600;
		letter-spacing: .12em;
		text-transform: uppercase;
		writing-mode: vertical-rl;
		color: var(--a3s-f-on-primary);
		background: var(--a3s-f-primary);
		border: 0;
		box-shadow: 0 0 6px rgba(0, 0, 0, .25);
		transform: translateY(-50%);
	}

	.a3s-filters__tab-icon {
		transform: rotate(90deg);
	}

	.a3s-filters__panel {
		position: fixed;
		inset: 0 0 0 auto;
		flex-direction: column;
		width: min(360px, calc(100vw - 32px));
		height: 100vh;
		height: 100dvh;
		max-width: none;
		max-height: none;
		margin: 0;
		padding: 0;
		overflow: hidden;
		color: var(--a3s-f-text);
		background: var(--a3s-f-bg);
		border: 0;
		box-shadow: 0 0 10px 3px rgba(0, 0, 0, .3);
		transition: translate .4s cubic-bezier(.7, 0, .3, 1), display .4s allow-discrete, overlay .4s allow-discrete;
		translate: 100% 0;
	}

	/* Separate rules: an unknown :popover-open must not drop the fallback selector. */
	.a3s-filters__panel:popover-open {
		display: flex;
		translate: 0 0;
	}

	.a3s-filters__panel.is-open {
		display: flex;
		translate: 0 0;
	}

	.a3s-no-popover .a3s-filters__panel:not(.is-open) {
		display: none;
	}

	@starting-style {
		.a3s-filters__panel:popover-open {
			translate: 100% 0;
		}
	}

	.a3s-filters__panel.is-open {
		z-index: 5005;
	}

	.a3s-filters__panel::backdrop {
		background: rgba(35, 31, 32, .3);
	}

	.a3s-no-anim .a3s-filters__panel {
		transition: none;
	}

	.a3s-filters__head {
		display: flex;
		align-items: center;
		justify-content: space-between;
		gap: 10px;
		padding: 8px 8px 8px 16px;
		border-bottom: 1px solid var(--a3s-f-border);
	}

	.a3s-filters__title {
		margin: 0;
		font-size: 16px;
		font-weight: 700;
		text-transform: uppercase;
	}

	.a3s-filters__close {
		width: 44px;
		height: 44px;
		font-size: 28px;
		line-height: 1;
		color: inherit;
		background: none;
		border: 0;
	}

	.a3s-filters__panel > .a3s-chips {
		padding: 10px 16px;
		background: var(--a3s-f-surface);
	}

	.a3s-filters__panel > .a3s-chips .a3s-chips__label {
		display: none;
	}

	.a3s-filters__panel .a3s-chips__clear {
		order: -1;
		margin-left: auto;
		flex-basis: auto;
	}

	.a3s-filters__blocks {
		flex: 1 1 auto;
		overflow-y: auto;
		overscroll-behavior: contain;
		padding: 0 16px;
	}

	.a3s-filters__blocks > .a3s-facet {
		border-bottom: 1px solid var(--a3s-f-border);
	}

	.a3s-filters__blocks .a3s-facet__trigger,
	.a3s-filters__blocks .a3s-facet--toggle .a3s-opt__link {
		justify-content: space-between;
		min-height: 48px;
		font-size: 14px;
		font-weight: 700;
	}

	.a3s-filters__blocks .a3s-facet--toggle .a3s-opt__link {
		justify-content: flex-start;
	}

	.a3s-filters__blocks .a3s-facet__body {
		padding-bottom: 12px;
	}

	.a3s-filters__blocks .a3s-opt__link {
		min-height: 44px;
	}

	.a3s-filters__foot {
		padding: 15px 10px;
		background: var(--a3s-f-surface);
	}

	.a3s-filters__apply {
		width: 100%;
		min-height: 48px;
		padding: 10px;
		font: inherit;
		font-size: 14px;
		font-weight: 600;
		text-transform: uppercase;
		color: var(--a3s-f-on-primary);
		background: var(--a3s-f-primary);
		border: 0;
		cursor: pointer;
	}

	html:has(.a3s-filters__panel:popover-open) {
		overflow: hidden;
	}

	html.a3s-drawer-open {
		overflow: hidden;
	}
}

/* Desktop (>= 768): the panel is shown inline (author styles override the [popover] UA styles). ----- */
@media (min-width: 768px) {
	.a3s-filters__tab,
	.a3s-filters__close,
	.a3s-filters__foot {
		display: none;
	}

	.a3s-filters .a3s-filters__panel {
		position: static;
		display: block;
		width: auto;
		height: auto;
		max-width: none;
		max-height: none;
		margin: 0;
		padding: 0;
		overflow: visible;
		color: inherit;
		background: transparent;
		border: 0;
		inset: auto;
		translate: none;
	}

	/* Bar: triggers centred in the toolbar, one drop-down panel each. */
	.a3s-filters--bar {
		flex: 1 1 auto;
		min-width: 0;
	}

	.a3s-filters--bar .a3s-filters__head,
	.a3s-filters--bar .a3s-filters__panel > .a3s-chips {
		display: none;
	}

	.a3s-filters--bar .a3s-filters__blocks {
		display: flex;
		flex-wrap: wrap;
		align-items: center;
		justify-content: center;
		gap: 2px 4px; /* Many facets: wrapped rows stay tight. */
	}

	.a3s-filters--bar .a3s-facet {
		position: relative;
	}

	.a3s-filters--bar .a3s-facet__trigger {
		padding: 5px 8px;
		white-space: nowrap;
	}

	.a3s-filters--bar .a3s-facet__trigger:hover {
		color: var(--a3s-f-active);
	}

	.a3s-filters--bar .a3s-facet__body {
		position: absolute;
		top: calc(100% + 8px);
		left: 50%;
		z-index: 30;
		width: 295px;
		max-width: calc(100vw - 24px); /* filters.js shifts it inside the viewport (triggers near an edge). */
		max-height: min(60vh, 480px);
		padding: 6px 12px;
		overflow-y: auto;
		background: var(--a3s-f-bg);
		border-radius: 0 0 6px 6px;
		box-shadow: 0 11px 10px rgba(0, 0, 0, .32);
		transform: translateX(-50%);
	}

	.a3s-filters--bar .a3s-facet.is-active .a3s-facet__body {
		outline: 1px solid var(--a3s-f-primary);
	}

	.a3s-filters--bar .a3s-facet--toggle {
		padding: 0 8px;
	}

	.a3s-filters--bar .a3s-facet--toggle .a3s-opt__name {
		font-weight: 500;
		text-transform: uppercase;
	}

	/* Sidebar: stacked accordions. */
	.a3s-filters--sidebar .a3s-filters__head {
		margin-bottom: 10px;
	}

	.a3s-filters--sidebar .a3s-filters__title {
		margin: 0;
		font-size: 18px;
		font-weight: 700;
		text-transform: uppercase;
	}

	.a3s-filters--sidebar .a3s-filters__panel > .a3s-chips {
		margin-bottom: 12px;
	}

	.a3s-filters--sidebar .a3s-chips__clear {
		margin-left: 0;
	}

	.a3s-filters--sidebar .a3s-facet {
		border-bottom: 1px solid var(--a3s-f-border);
	}

	.a3s-filters--sidebar .a3s-facet__trigger {
		justify-content: space-between;
		padding: 12px 0;
	}

	.a3s-filters--sidebar .a3s-facet__body {
		padding-bottom: 12px;
	}

	.a3s-filters--sidebar .a3s-facet--toggle {
		padding: 6px 0;
	}
}

@media (prefers-reduced-motion: reduce) {
	.a3s-filters *,
	.a3s-filters__panel,
	.a3s-loading :is(ul.products, .products) {
		transition: none !important;
	}
}

/* Touch: 44 px targets for the bar triggers and the category tree toggle (pointer: fine unchanged). */
@media (pointer: coarse) {
	.a3s-filters--bar .a3s-facet__trigger {
		min-height: 44px;
	}

	.a3s-tree > .a3s-tree__toggle {
		top: -6px;
		width: 44px;
		height: 44px;
	}

	.a3s-opt:has(> .a3s-tree) > .a3s-opt__link {
		padding-right: 48px;
	}
}
