/*
 * Huiswijn Filter: huisstijl, gelijk aan de huidige filters op mijn-huiswijn.nl
 * (live style.css hoofdstuk 6 "Filter en sortering", met dezelfde breekpunten).
 *
 * Kleuren: inkt #1A1416, label #413739, rand #D2CCCD, rood #BA0F30,
 * chip #FDF0F2 / #FBD9DF, honing #E8B43C.
 */

/* Alleen voor schermlezers */
.hwf-sr-only {
	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;
}

/* ---------- Filters ---------- */

/* Ruimte: 16px tussen de filters, niets onder de laatste */
.hwf-filters .hwf-filter {
	margin: 0 0 16px;
}

.hwf-filters .hwf-filter:last-of-type {
	margin-bottom: 0;
}

/* Label boven elk filter */
.hwf-filters .hwf-label {
	display: block;
	margin: 0 0 6px;
	font-family: "Work Sans", sans-serif;
	font-size: 13px;
	font-weight: 600;
	line-height: 1.4;
	color: #413739;
}

/* Keuzelijsten van filter en sortering: volle breedte, witte lijst met rand, chevron rechts */
.hwf-filters select,
.hwf-sort select {
	-webkit-appearance: none;
	appearance: none;
	display: block;
	box-sizing: border-box;
	width: 100%;
	max-width: none;
	min-height: 44px;
	margin: 0;
	padding: 9px 36px 9px 13px;
	background: #FFFFFF url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cg fill='none' stroke='%231A1416' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/g%3E%3C/svg%3E") no-repeat right 12px center / 16px;
	border: 1px solid #D2CCCD;
	border-radius: 10px;
	color: #1A1416;
	font-size: 14px;
	line-height: 1.4;
}

.hwf-filters select:focus,
.hwf-sort select:focus {
	border-color: #BA0F30;
	outline: none;
	box-shadow: none;
}

/* Sortering: 12px eronder */
.hwf-sort {
	margin: 0 0 12px;
}

/* Aanvinkvakjes */
.hwf-filters .hwf-options {
	display: flex;
	flex-wrap: wrap;
	gap: 6px 14px;
}

.hwf-filters .hwf-check {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	min-height: 32px;
	color: #1A1416;
	font-size: 14px;
	line-height: 1.4;
	cursor: pointer;
}

.hwf-filters .hwf-check input[type="checkbox"] {
	width: 18px;
	height: 18px;
	margin: 0;
	accent-color: #BA0F30;
}

.hwf-filters .hwf-check input[type="checkbox"]:focus-visible {
	outline: 2px solid #BA0F30;
	outline-offset: 2px;
}

/* Knopjes */
.hwf-filters .hwf-button {
	display: inline-flex;
	align-items: center;
	box-sizing: border-box;
	min-height: 36px;
	padding: 6px 14px;
	background: #FFFFFF;
	border: 1px solid #D2CCCD;
	border-radius: 50px;
	color: #413739;
	font-size: 13px;
	font-weight: 600;
	line-height: 1.3;
	text-decoration: none;
}

.hwf-filters .hwf-button:hover {
	border-color: #BA0F30;
	color: #BA0F30;
}

.hwf-filters .hwf-button.is-active {
	background: #BA0F30;
	border-color: #BA0F30;
	color: #FFFFFF;
}

.hwf-filters .hwf-button:focus-visible {
	outline: 2px solid #BA0F30;
	outline-offset: 2px;
}

/* Prijsschuif: rode baan tussen de handvatten, honingkleurige handvatten */
.hwf-range {
	position: relative;
	height: 28px;
	margin: 4px 10px 10px;
}

.hwf-range-track {
	position: absolute;
	top: 50%;
	left: 0;
	right: 0;
	height: 4px;
	margin-top: -2px;
	background: #D2CCCD;
	border-radius: 2px;
}

.hwf-range-fill {
	position: absolute;
	top: 0;
	bottom: 0;
	left: var(--hwf-from, 0%);
	right: calc(100% - var(--hwf-to, 100%));
	background: #BA0F30;
	border-radius: 2px;
}

.hwf-range input[type="range"] {
	-webkit-appearance: none;
	appearance: none;
	position: absolute;
	top: 0;
	left: -10px;
	width: calc(100% + 20px);
	height: 28px;
	margin: 0;
	background: transparent;
	pointer-events: none;
}

.hwf-range input[type="range"]::-webkit-slider-runnable-track {
	height: 28px;
	background: transparent;
}

.hwf-range input[type="range"]::-moz-range-track {
	height: 28px;
	background: transparent;
}

.hwf-range input[type="range"]::-webkit-slider-thumb {
	-webkit-appearance: none;
	appearance: none;
	width: 20px;
	height: 20px;
	margin-top: 4px;
	background: #E8B43C;
	border: 2px solid #FFFFFF;
	border-radius: 50%;
	box-shadow: 0 0 0 1px #D2CCCD;
	cursor: pointer;
	pointer-events: auto;
}

.hwf-range input[type="range"]::-moz-range-thumb {
	width: 16px;
	height: 16px;
	background: #E8B43C;
	border: 2px solid #FFFFFF;
	border-radius: 50%;
	box-shadow: 0 0 0 1px #D2CCCD;
	cursor: pointer;
	pointer-events: auto;
}

.hwf-range input[type="range"]:focus {
	outline: none;
}

.hwf-range input[type="range"]:focus-visible::-webkit-slider-thumb {
	box-shadow: 0 0 0 2px #BA0F30;
}

.hwf-range input[type="range"]:focus-visible::-moz-range-thumb {
	box-shadow: 0 0 0 2px #BA0F30;
}

.hwf-range-inputs {
	display: flex;
	align-items: center;
	gap: 8px;
}

.hwf-range-box {
	display: flex;
	flex: 1 1 0;
	align-items: center;
	gap: 4px;
	box-sizing: border-box;
	min-height: 44px;
	padding: 0 10px;
	background: #FFFFFF;
	border: 1px solid #D2CCCD;
	border-radius: 10px;
	color: #413739;
	font-size: 14px;
}

.hwf-range-box:focus-within {
	border-color: #BA0F30;
}

.hwf-range-box input[type="number"] {
	width: 100%;
	min-width: 0;
	padding: 0;
	background: transparent;
	border: 0;
	color: #1A1416;
	font-size: 14px;
	-moz-appearance: textfield;
}

.hwf-range-box input[type="number"]:focus {
	outline: none;
	box-shadow: none;
}

.hwf-range-sep {
	color: #413739;
}

/* ---------- Chips ---------- */

.hwf-chips {
	display: flex;
	flex-wrap: wrap;
	gap: 0 7px;
}

.hwf-chips .hwf-chip {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	box-sizing: border-box;
	margin: 0 0 11px;
	padding: 5px 12px;
	background-color: #FDF0F2;
	border: 1px solid #FBD9DF;
	border-radius: 50px;
	color: #BA0F30;
	font-size: 12px;
	font-weight: 700;
	line-height: 1.4;
	text-decoration: none;
}

.hwf-chips .hwf-chip-x {
	font-size: 1.25em;
	line-height: 1;
}

.hwf-chips .hwf-chip--reset {
	background-color: #FFFFFF;
	border-color: #D2CCCD;
	color: #413739;
	font-weight: 600;
}

.hwf-chips .hwf-chip:active {
	opacity: 0.75;
}

.hwf-chips .hwf-chip:focus-visible {
	outline: 2px solid #BA0F30;
	outline-offset: 2px;
}

/* ---------- Laden ---------- */

.hwf-busy-region {
	position: relative;
	pointer-events: none;
}

.hwf-loading {
	position: relative;
	min-height: 80px;
}

.hwf-loading::after {
	content: "";
	position: absolute;
	inset: 0;
	z-index: 5;
	background: rgba(255, 255, 255, 0.6);
}

.hwf-loading::before {
	content: "";
	position: absolute;
	top: 40px;
	left: 50%;
	z-index: 6;
	width: 32px;
	height: 32px;
	margin-left: -16px;
	border: 3px solid #FBD9DF;
	border-top-color: #BA0F30;
	border-radius: 50%;
	animation: hwf-spin 0.8s linear infinite;
}

@keyframes hwf-spin {
	to {
		transform: rotate(360deg);
	}
}

@media (prefers-reduced-motion: reduce) {
	.hwf-loading::before {
		animation-duration: 2s;
	}
}

/* ---------- Telefoon en tablet ---------- */

@media (max-width: 1024px) {
	/* 16px tekst, zodat een iPhone of iPad niet inzoomt bij het kiezen */
	.hwf-filters select,
	.hwf-sort select,
	.hwf-range-box input[type="number"] {
		font-size: 16px;
	}

	/* Chips 44px hoog om goed aan te tikken */
	.hwf-chips .hwf-chip {
		min-height: 44px;
	}
}

@media (min-width: 768px) and (max-width: 1024px) {
	/* Tablet: iets minder binnenruimte, zodat "Selecteer Druivenras" in de smalle filterkolom past */
	.hwf-filters select {
		padding-left: 10px;
		padding-right: 30px;
		background-position: right 9px center;
	}
}

@media (max-width: 767px) {
	/* Telefoon: compacter. Labels van keuzelijsten alleen voor schermlezers ("– Selecteer {naam} –" is de zichtbare uitleg);
	   bij vinkjes, knopjes en de prijsschuif blijft het label zichtbaar. */
	.hwf-filters .hwf-filter {
		margin-bottom: 8px;
	}

	.hwf-filters .hwf-filter--select .hwf-label {
		position: absolute;
		width: 1px;
		height: 1px;
		margin: -1px;
		padding: 0;
		overflow: hidden;
		clip: rect(0, 0, 0, 0);
		clip-path: inset(50%);
		white-space: nowrap;
	}

	.hwf-chips:not([hidden]) {
		margin-top: 8px;
	}
}
