/**
 * Shop filter sidebar
 *
 * Design ref: Figma PLP Frame 75 (1061:2620) — exact Y offsets 2026-07-23
 * Checkbox pitch = 44px top-to-top (34px row + 10px list gap ONLY).
 */

.shop-filters {
	align-self: start;
	width: 100%;
	max-width: var(--shop-sidebar-width);
	box-sizing: border-box;
	padding: var(--shop-filters-pad);
	border: 1px solid var(--color-border-category); /* #FEE7BD */
	border-radius: var(--radius-category-card); /* 6px */
	background: var(--color-white);
}

.shop-filters__form {
	display: flex;
	flex-direction: column;
	gap: 0;
	margin: 0;
}

.shop-filters__section {
	display: flex;
	flex-direction: column;
	gap: var(--shop-filters-section-gap); /* 9px heading → controls */
	padding: var(--shop-filters-section-pad-y) 0 var(--shop-filters-section-pad-bottom);
	border-bottom: 1px solid var(--shop-filter-divider);
}

.shop-filters__section:first-child {
	padding-top: var(--shop-filters-section-pad-top); /* → Categories heading y19 */
}

.shop-filters__section:last-of-type {
	border-bottom: 0;
	padding-bottom: 0;
}

.shop-filters__heading {
	margin: 0;
	font-family: var(--font-heading); /* Tai Heritage Pro */
	font-size: 16px;
	font-weight: 400;
	line-height: 26px;
	letter-spacing: 0;
	text-transform: uppercase;
	color: var(--color-accent); /* #B17915 */
}

/*
 * Checkbox lists — Categories / Sizes
 * SINGLE spacing source: flex gap 10px on the list.
 * Row height locked to 34px. Do not add margin on items/labels.
 * Pitch = 34 + 10 = 44px (Figma y54→98→142…).
 */
.shop-filters__list {
	display: flex;
	flex-direction: column;
	gap: var(--shop-filter-item-gap); /* 10px — only spacing between rows */
	margin: 0;
	padding: 0;
	list-style: none;
}

.shop-filters__item {
	display: block;
	box-sizing: border-box;
	height: var(--shop-filter-checkbox-hit); /* 34px */
	min-height: var(--shop-filter-checkbox-hit);
	max-height: var(--shop-filter-checkbox-hit);
	margin: 0;
	padding: 0;
	list-style: none;
	line-height: 0;
	overflow: hidden;
}

/*
 * Real <input type="checkbox"> (Material 3–style hit + box via ::before).
 * - 34×34 hit area, absolute at left:0
 * - inner box 12.75×12.75, border 1.41667px #000, radius 1.41667px
 * - label text starts at 43px from hit-area left edge
 */
.shop-filters__label {
	position: relative;
	display: flex;
	align-items: center;
	box-sizing: border-box;
	width: 100%;
	height: var(--shop-filter-checkbox-hit);
	min-height: var(--shop-filter-checkbox-hit);
	max-height: var(--shop-filter-checkbox-hit);
	margin: 0;
	padding: 0 0 0 var(--shop-filter-label-inset); /* 43px */
	cursor: pointer;
	font-family: var(--font-body); /* Figtree */
	font-size: 14px;
	font-weight: 400;
	line-height: 20px;
	color: #000000;
}

.shop-filters__checkbox {
	appearance: none;
	-webkit-appearance: none;
	position: absolute;
	left: 0;
	top: 0;
	width: var(--shop-filter-checkbox-hit);
	height: var(--shop-filter-checkbox-hit);
	margin: 0;
	padding: 0;
	border: 0;
	background: transparent;
	cursor: pointer;
}

.shop-filters__checkbox::before {
	content: "";
	position: absolute;
	top: 50%;
	left: 50%;
	box-sizing: border-box;
	width: var(--shop-filter-checkbox-box);
	height: var(--shop-filter-checkbox-box);
	border: var(--shop-filter-checkbox-border) solid #000000;
	border-radius: var(--shop-filter-checkbox-border);
	background: var(--color-white);
	transform: translate(-50%, -50%);
}

.shop-filters__checkbox:checked::before {
	background: #000000;
}

.shop-filters__checkbox:focus-visible {
	outline: none;
}

.shop-filters__checkbox:focus-visible::before {
	outline: 2px solid var(--color-accent);
	outline-offset: 3px;
}

.shop-filters__text {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	width: 100%;
	min-width: 0;
	height: 20px;
	line-height: 20px;
}

.shop-filters__text > span:first-child {
	font-family: var(--font-body);
	font-size: 14px;
	font-weight: 400;
	line-height: 20px;
	color: #000000;
}

.shop-filters__count {
	flex-shrink: 0;
	margin-left: auto;
	text-align: right;
	font-family: var(--font-body);
	font-size: 12px;
	font-weight: 400;
	line-height: 20px;
	color: #000000;
}

/*
 * Price range — Figma: labels span the full section content width (306px);
 * only the track/thumbs group is narrower (290px), centered with an 8px
 * gutter each side. Do NOT put the 290px width on the outer wrapper — that
 * squeezes the labels too and left-aligns the whole control.
 */
.shop-filters__price {
	display: flex;
	flex-direction: column;
	gap: 8px;
	width: 100%;
}

.shop-filters__price-labels {
	display: flex;
	justify-content: space-between;
	align-items: center;
	font-family: var(--font-body);
	font-size: 14px;
	font-weight: 400;
	line-height: 20px;
	color: #000000;
}

/*
 * Sized to the *track*, not the 290px Figma bounding box. shop-filters.js
 * positions the handles as a percentage of this element and maps drags onto
 * its bounding rect, so it has to share the track's coordinate space — with a
 * wider box the handle centres land outside the bar and leave a visible gap at
 * each end. The 12px handles are centred on the track ends and overhang by 6px
 * each side, so the control measures 272 + 12 = 284px overall (Figma frame is
 * 290px, `--shop-filter-price-width`).
 */
.shop-filters__price-slider {
	position: relative;
	width: var(--shop-filter-price-track-width); /* 272px */
	max-width: calc(100% - var(--shop-filter-price-thumb)); /* leave room for the overhang */
	height: var(--shop-filter-price-thumb); /* 12px — thumb diameter */
	margin: 0 auto; /* center the track group within the full-width labels row */
}

.shop-filters__price-track {
	position: absolute;
	left: 0;
	right: 0;
	top: 50%;
	height: var(--shop-filter-price-track); /* 6px */
	border-radius: 3px;
	/* Unfilled remainder — light neutral (standard dual-range) */
	background: var(--color-border-input);
	transform: translateY(-50%);
	pointer-events: none;
}

.shop-filters__price-fill {
	position: absolute;
	top: 0;
	bottom: 0;
	border-radius: 3px;
	background: var(--color-accent); /* #B17915 filled portion */
}

/*
 * Plain div "handles" dragged via JS (shop-filters.js), not native
 * <input type="range"> — matches the reference implementation. Avoids the
 * whole class of native range-input cross-browser/appearance-reset problems
 * (style.css's `input[type="range"]` boilerplate, -webkit/-moz-appearance,
 * etc.) entirely, since there's no native form control to fight the styling
 * of. The actual values live on hidden `[data-price-min]`/`[data-price-max]`
 * inputs that the drag/keyboard handlers keep in sync.
 */
.shop-filters__price-handle {
	position: absolute;
	top: 50%;
	width: var(--shop-filter-price-thumb); /* 12px */
	height: var(--shop-filter-price-thumb);
	background: var(--color-accent); /* #B17915 — plain circle, no icon */
	border-radius: 50%;
	transform: translate(-50%, -50%);
	cursor: grab;
	touch-action: none;
	z-index: 2;
}

.shop-filters__price-handle--max {
	z-index: 3;
}

.shop-filters__price-handle:active {
	cursor: grabbing;
}

.shop-filters__price-handle:focus-visible {
	outline: 2px solid var(--color-accent);
	outline-offset: 3px;
}

/* Color swatches — 34px circles, 20px gap */
.shop-filters__swatches {
	display: flex;
	flex-wrap: wrap;
	gap: var(--shop-filter-swatch-gap); /* 20px */
	margin: 0;
	padding: 0;
	list-style: none;
}

.shop-filters__swatch-item {
	margin: 0;
	padding: 0;
	list-style: none;
	line-height: 0;
}

.shop-filters__swatch-label {
	position: relative;
	display: block;
	width: var(--shop-filter-swatch-size);
	height: var(--shop-filter-swatch-size);
	margin: 0;
	cursor: pointer;
}

.shop-filters__swatch-input {
	position: absolute;
	inset: 0;
	z-index: 1;
	width: 100%;
	height: 100%;
	margin: 0;
	padding: 0;
	opacity: 0;
	cursor: pointer;
}

.shop-filters__swatch {
	display: block;
	width: var(--shop-filter-swatch-size);
	height: var(--shop-filter-swatch-size);
	border-radius: 50%;
	border: 1px solid rgba(11, 11, 11, 0.12);
	box-sizing: border-box;
}

.shop-filters__swatch-input:focus-visible + .shop-filters__swatch {
	outline: 2px solid var(--color-accent);
	outline-offset: 2px;
}

.shop-filters__swatch-input:checked + .shop-filters__swatch {
	box-shadow: 0 0 0 2px var(--color-white), 0 0 0 4px var(--color-accent);
}

/* Actions */
.shop-filters__actions {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 18px;
	padding-top: 20px;
	padding-bottom: 4px;
}

/* Beat Underscores `button { background: #e6e6e6 }` — solid gold, weight 600. */
button.shop-filters__apply,
.shop-filters__apply {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	box-sizing: border-box;
	width: var(--shop-filter-apply-width); /* 311px */
	max-width: 100%;
	height: var(--shop-filter-apply-height); /* 50px */
	padding: 10px;
	gap: 10px;
	border: none;
	border-radius: var(--radius-category-card); /* 6px */
	background-color: var(--color-accent); /* #B17915 — no opacity/overlay */
	background-image: none;
	box-shadow: none;
	opacity: 1;
	filter: none;
	font-family: var(--font-body);
	font-size: 14px;
	font-weight: 600;
	line-height: 1;
	letter-spacing: 0.03em;
	text-transform: uppercase;
	color: var(--color-white);
	-webkit-font-smoothing: antialiased;
	cursor: pointer;
}

button.shop-filters__apply:hover,
button.shop-filters__apply:focus,
.shop-filters__apply:hover,
.shop-filters__apply:focus {
	background-color: var(--color-accent);
	background-image: none;
	opacity: 1;
	filter: none;
	outline: none;
}

button.shop-filters__apply:disabled,
.shop-filters__apply:disabled {
	opacity: 0.7;
	cursor: wait;
}

.shop-filters__clear,
.shop-filters__clear:link,
.shop-filters__clear:visited {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	font-family: var(--font-body);
	font-size: 12px;
	font-weight: 600;
	line-height: 20px;
	color: var(--color-accent); /* #B17915 */
	text-decoration: none;
	text-align: center;
}

.shop-filters__clear:hover,
.shop-filters__clear:focus {
	color: var(--color-accent-hover);
	outline: none;
}

/* Mobile drawer chrome */
.shop-filters-toggle {
	display: none;
	align-items: center;
	justify-content: center;
	gap: 8px;
	width: 100%;
	min-height: 44px;
	margin-bottom: 16px;
	padding: 10px 16px;
	border: 1px solid var(--color-border-category);
	border-radius: var(--radius-button);
	background: var(--color-white);
	font-family: var(--font-body);
	font-size: 14px;
	font-weight: 600;
	color: var(--color-accent);
	cursor: pointer;
}

.shop-filters-drawer__backdrop {
	display: none;
}

@media (max-width: 991px) {
	.shop-filters-toggle {
		display: inline-flex;
	}

	.shop-filters {
		position: fixed;
		top: 0;
		left: 0;
		z-index: 1000;
		width: min(var(--shop-sidebar-width), 88vw);
		max-width: none;
		height: 100%;
		max-height: 100vh;
		overflow-y: auto;
		border-radius: 0;
		border-left: 0;
		border-top: 0;
		border-bottom: 0;
		transform: translateX(-105%);
		transition: transform 0.25s ease;
	}

	.shop-filters.is-open {
		transform: translateX(0);
	}

	.shop-filters-drawer__backdrop {
		display: block;
		position: fixed;
		inset: 0;
		z-index: 999;
		background: rgba(11, 11, 11, 0.4);
		opacity: 0;
		visibility: hidden;
		transition: opacity 0.25s ease, visibility 0.25s ease;
	}

	.shop-filters-drawer__backdrop.is-open {
		opacity: 1;
		visibility: visible;
	}
}
