/* =========================================================
 *  HOV Shop Filters — Styles
 *  House of Vinterberg · Copenhagen
 * ========================================================= */

:root {
	--hov-f-primary: #1a1a2e;
	--hov-f-accent: #c9a96e;
	--hov-f-border: #e0ddd8;
	--hov-f-text: #333;
	--hov-f-light: #faf9f7;
	--hov-f-muted: #999;
	--hov-f-white: #fff;
	--hov-f-radius: 6px;
	--hov-f-transition: cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* ----- Base filter block ----- */
.hov-filter {
	margin-bottom: 24px;
}

.hov-filter__header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 12px;
}

.hov-filter__header--collapsible {
	cursor: pointer;
}

.hov-filter__label {
	font-size: 11px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.1em;
	color: var(--hov-f-primary);
}

.hov-filter__toggle {
	background: none;
	border: none;
	padding: 4px;
	cursor: pointer;
	color: var(--hov-f-muted);
	transition: transform 0.2s var(--hov-f-transition);
	line-height: 1;
}

.hov-filter__toggle--collapsed {
	transform: rotate(-90deg);
}

/* ----- Checkbox filter ----- */
.hov-filter__list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.hov-filter__item {
	display: block;
}

.hov-filter__item--overflow {
	display: none;
}

.hov-filter__item--empty {
	opacity: 0.35;
	pointer-events: none;
}

.hov-filter__item-inner {
	display: flex;
	align-items: center;
	gap: 8px;
	cursor: pointer;
	padding: 4px 0;
	font-size: 13px;
	color: var(--hov-f-text);
	transition: color 0.15s ease;
}

.hov-filter__item-inner:hover {
	color: var(--hov-f-primary);
}

.hov-filter__checkbox,
.hov-filter__radio {
	width: 16px;
	height: 16px;
	accent-color: var(--hov-f-primary);
	cursor: pointer;
	margin: 0;
	flex-shrink: 0;
}

.hov-filter__item-label {
	flex: 1;
}

.hov-filter__count {
	font-size: 11px;
	color: var(--hov-f-muted);
	font-variant-numeric: tabular-nums;
	min-width: 20px;
	text-align: right;
}

/* Radio / checkbox focus outline for accessibility */
.hov-filter__checkbox:focus-visible,
.hov-filter__radio:focus-visible {
	outline: 2px solid var(--hov-f-primary);
	outline-offset: 2px;
}

.hov-filter__show-more {
	background: none;
	border: none;
	padding: 8px 0 0;
	font-size: 11px;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	color: var(--hov-f-muted);
	cursor: pointer;
	text-decoration: none;
	transition: color 0.15s ease;
}

.hov-filter__show-more:hover {
	color: var(--hov-f-primary);
	text-decoration: underline;
}

/* ----- Color swatch filter ----- */
.hov-filter__swatches {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.hov-filter__color-swatch {
	width: 32px;
	height: 32px;
	border-radius: 50%;
	border: 2px solid var(--hov-f-border);
	cursor: pointer;
	position: relative;
	transition: all 0.2s var(--hov-f-transition);
	padding: 0;
	outline: none;
}

.hov-filter__color-swatch:hover {
	transform: translateY(-2px);
	box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.hov-filter__color-swatch.active {
	border-color: var(--hov-f-primary);
	box-shadow: 0 0 0 2px var(--hov-f-light), 0 0 0 4px var(--hov-f-primary);
}

.hov-filter__color-swatch:focus-visible {
	outline: 2px solid var(--hov-f-accent);
	outline-offset: 2px;
}

.hov-filter__color-swatch--empty {
	opacity: 0.3;
	pointer-events: none;
}

.hov-filter__swatch-count {
	position: absolute;
	top: -6px;
	right: -6px;
	background: var(--hov-f-primary);
	color: var(--hov-f-white);
	font-size: 9px;
	min-width: 16px;
	height: 16px;
	border-radius: 8px;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 0 3px;
	line-height: 1;
}

.hov-filter__swatch-count:empty {
	display: none;
}

/* ----- Range slider ----- */
.hov-filter__range-values {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 12px;
	gap: 8px;
}

.hov-filter__range-value {
	font-size: 13px;
	font-weight: 500;
	color: var(--hov-f-text);
	font-variant-numeric: tabular-nums;
}

.hov-filter__range-sep {
	color: var(--hov-f-muted);
}

.hov-filter__range-slider {
	position: relative;
	height: 32px;
}

.hov-filter__range-track {
	position: absolute;
	top: 50%;
	left: 0;
	right: 0;
	height: 4px;
	background: var(--hov-f-border);
	border-radius: 2px;
	transform: translateY(-50%);
}

.hov-filter__range-fill {
	position: absolute;
	top: 0;
	height: 100%;
	background: var(--hov-f-primary);
	border-radius: 2px;
}

.hov-filter__range-input {
	position: absolute;
	top: 50%;
	left: 0;
	width: 100%;
	transform: translateY(-50%);
	-webkit-appearance: none;
	appearance: none;
	background: transparent;
	pointer-events: none;
	margin: 0;
	height: 32px;
}

.hov-filter__range-input::-webkit-slider-thumb {
	-webkit-appearance: none;
	width: 20px;
	height: 20px;
	border-radius: 50%;
	background: var(--hov-f-white);
	border: 2px solid var(--hov-f-primary);
	box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
	cursor: pointer;
	pointer-events: all;
	transition: box-shadow 0.15s ease;
}

.hov-filter__range-input::-webkit-slider-thumb:hover {
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

.hov-filter__range-input::-moz-range-thumb {
	width: 20px;
	height: 20px;
	border-radius: 50%;
	background: var(--hov-f-white);
	border: 2px solid var(--hov-f-primary);
	box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
	cursor: pointer;
	pointer-events: all;
	transition: box-shadow 0.15s ease;
}

.hov-filter__range-input::-moz-range-thumb:hover {
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

.hov-filter__range-input::-moz-range-track {
	background: transparent;
	border: none;
	height: 4px;
}

/* ----- Search filter ----- */
.hov-filter__search-wrap {
	position: relative;
	display: flex;
	align-items: center;
}

.hov-filter__search-icon {
	position: absolute;
	left: 12px;
	color: var(--hov-f-muted);
	pointer-events: none;
}

.hov-filter__search-input {
	width: 100%;
	padding: 10px 36px 10px 36px;
	border: 1px solid var(--hov-f-border);
	border-radius: var(--hov-f-radius);
	font-size: 13px;
	color: var(--hov-f-text);
	background: var(--hov-f-white);
	outline: none;
	transition: border-color 0.2s ease;
}

.hov-filter__search-input:focus {
	border-color: var(--hov-f-primary);
}

.hov-filter__search-input::placeholder {
	color: var(--hov-f-muted);
}

.hov-filter__search-clear {
	position: absolute;
	right: 8px;
	background: none;
	border: none;
	font-size: 18px;
	color: var(--hov-f-muted);
	cursor: pointer;
	padding: 4px 8px;
	line-height: 1;
}

.hov-filter__search-clear:hover {
	color: var(--hov-f-primary);
}

.hov-filter__search-clear:focus-visible {
	outline: 2px solid var(--hov-f-primary);
	outline-offset: 2px;
}

/* ----- Quick pills ----- */
.hov-filter__pills {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.hov-filter__pill {
	display: inline-flex;
	align-items: center;
	padding: 8px 18px;
	border: 1px solid var(--hov-f-border);
	border-radius: 100px;
	background: var(--hov-f-white);
	font-size: 12px;
	font-weight: 500;
	letter-spacing: 0.02em;
	color: var(--hov-f-text);
	cursor: pointer;
	transition: all 0.2s var(--hov-f-transition);
	white-space: nowrap;
}

.hov-filter__pill:hover {
	border-color: var(--hov-f-primary);
	color: var(--hov-f-primary);
}

.hov-filter__pill.active {
	background: var(--hov-f-primary);
	border-color: var(--hov-f-primary);
	color: var(--hov-f-white);
}

.hov-filter__pill:focus-visible {
	outline: 2px solid var(--hov-f-primary);
	outline-offset: 2px;
}

/* ----- Active filters ----- */
.hov-filter__active-bar {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 8px;
}

.hov-filter__result-count {
	font-size: 13px;
	color: var(--hov-f-muted);
	font-variant-numeric: tabular-nums;
	white-space: nowrap;
}

.hov-filter__active-tags {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	flex: 1;
}

.hov-filter__active-tag {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	padding: 4px 10px;
	background: var(--hov-f-light);
	border: 1px solid var(--hov-f-border);
	border-radius: 100px;
	font-size: 11px;
	color: var(--hov-f-text);
}

.hov-filter__tag-remove {
	background: none;
	border: none;
	font-size: 14px;
	color: var(--hov-f-muted);
	cursor: pointer;
	padding: 0 2px;
	line-height: 1;
	transition: color 0.15s ease;
}

.hov-filter__tag-remove:hover {
	color: var(--hov-f-primary);
}

.hov-filter__clear-all {
	background: none;
	border: none;
	font-size: 11px;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	color: var(--hov-f-muted);
	cursor: pointer;
	white-space: nowrap;
	text-decoration: none;
	transition: color 0.15s ease;
}

.hov-filter__clear-all:hover {
	color: var(--hov-f-primary);
	text-decoration: underline;
}

/* ----- Sort widget ----- */
.hov-filter__sort-bar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
}

.hov-filter__sort-wrap {
	display: flex;
	align-items: center;
	gap: 8px;
}

.hov-filter__sort-label {
	font-size: 12px;
	color: var(--hov-f-muted);
	white-space: nowrap;
}

.hov-filter__sort-select {
	padding: 8px 32px 8px 12px;
	border: 1px solid var(--hov-f-border);
	border-radius: var(--hov-f-radius);
	font-size: 13px;
	color: var(--hov-f-text);
	background: var(--hov-f-white) url("data:image/svg+xml,%3Csvg width='12' height='12' viewBox='0 0 12 12' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M2 4l4 4 4-4' stroke='%23999' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat right 10px center;
	-webkit-appearance: none;
	appearance: none;
	cursor: pointer;
	outline: none;
	transition: border-color 0.2s ease;
}

.hov-filter__sort-select:focus {
	border-color: var(--hov-f-primary);
}

/* ----- Loading state ----- */
.hov-filter--loading {
	opacity: 0.3;
	pointer-events: none;
	transition: opacity 0.2s ease;
}

/* ----- No results ----- */
.hov-filter__no-results {
	grid-column: 1 / -1;
	text-align: center;
	padding: 60px 20px;
	list-style: none;
}

.hov-filter__no-results p {
	font-size: 15px;
	color: var(--hov-f-muted);
}

/* ----- Mobile trigger ----- */
.hov-filter__mobile-trigger {
	display: none;
	align-items: center;
	gap: 6px;
	padding: 10px 18px;
	border: 1px solid var(--hov-f-border);
	border-radius: var(--hov-f-radius);
	background: var(--hov-f-white);
	font-size: 13px;
	font-weight: 500;
	color: var(--hov-f-text);
	cursor: pointer;
	transition: border-color 0.2s ease;
}

.hov-filter__mobile-trigger:hover {
	border-color: var(--hov-f-primary);
}

.hov-filter__mobile-trigger-count {
	font-size: 12px;
	color: var(--hov-f-accent);
	font-weight: 600;
}

/* =========================================================
 *  Mobile Drawer
 * ========================================================= */
.hov-filter-drawer {
	position: fixed;
	inset: 0;
	z-index: 99999;
}

.hov-filter-drawer__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0);
	transition: background 0.3s ease;
}

body.hov-filter-drawer--open .hov-filter-drawer__backdrop {
	background: rgba(0, 0, 0, 0.5);
}

.hov-filter-drawer__panel {
	position: absolute;
	bottom: 0;
	left: 0;
	right: 0;
	max-height: 90vh;
	background: var(--hov-f-white);
	border-radius: 16px 16px 0 0;
	display: flex;
	flex-direction: column;
	transform: translateY(100%);
	transition: transform 0.3s var(--hov-f-transition);
}

body.hov-filter-drawer--open .hov-filter-drawer__panel {
	transform: translateY(0);
}

.hov-filter-drawer__header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 20px 24px 16px;
	border-bottom: 1px solid var(--hov-f-border);
}

.hov-filter-drawer__title {
	font-size: 15px;
	font-weight: 600;
	color: var(--hov-f-primary);
	text-transform: uppercase;
	letter-spacing: 0.08em;
}

.hov-filter-drawer__close {
	background: none;
	border: none;
	font-size: 24px;
	color: var(--hov-f-muted);
	cursor: pointer;
	padding: 4px 8px;
	line-height: 1;
}

.hov-filter-drawer__body {
	flex: 1;
	overflow-y: auto;
	padding: 24px;
	-webkit-overflow-scrolling: touch;
}

.hov-filter-drawer__footer {
	padding: 16px 24px;
	border-top: 1px solid var(--hov-f-border);
}

.hov-filter-drawer__apply {
	display: block;
	width: 100%;
	padding: 14px;
	background: var(--hov-f-primary);
	color: var(--hov-f-white);
	border: none;
	border-radius: var(--hov-f-radius);
	font-size: 13px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.1em;
	cursor: pointer;
	transition: background 0.2s ease;
}

.hov-filter-drawer__apply:hover {
	background: #2a2a4e;
}

/* Body scroll lock when drawer is open */
body.hov-filter-drawer--open {
	overflow: hidden;
}

/* =========================================================
 *  Responsive — Mobile
 * ========================================================= */
@media (max-width: 767px) {
	/* Hide sidebar filters on mobile */
	.hov-filter--checkbox,
	.hov-filter--color,
	.hov-filter--range,
	.hov-filter--radio,
	.hov-filter--search {
		display: none;
	}

	/* Show mobile trigger */
	.hov-filter__mobile-trigger {
		display: inline-flex !important;
	}

	/* Adjust sort bar for mobile */
	.hov-filter__sort-bar {
		flex-wrap: wrap;
		gap: 8px;
	}

	/* Active filters: stack vertically */
	.hov-filter__active-bar {
		flex-direction: column;
		align-items: flex-start;
	}

	/* Pills: scroll horizontally */
	.hov-filter__pills {
		flex-wrap: nowrap;
		overflow-x: auto;
		-webkit-overflow-scrolling: touch;
		scrollbar-width: none;
		padding-bottom: 4px;
	}

	.hov-filter__pills::-webkit-scrollbar {
		display: none;
	}
}

/* =========================================================
 *  Filter level: technical (hidden by default)
 * ========================================================= */
.hov-filter--technical {
	display: none;
}

.hov-filter--technical.hov-filter--expanded {
	display: block;
}
