/**
 * NS Filter - Houthandel Jan Sok
 * AJAX productfilter sidebar.
 * Huisstijl: --maincolor #2C4329, --subcolor #ccdc46, accent #006f3b.
 */

.ns-filter {
	font-family: 'Urbanist', sans-serif;
	font-size: 14px;
}

.ns-filter__header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding-bottom: 12px;
	margin-bottom: 12px;
	border-bottom: 2px solid #2C4329;
}

.ns-filter__title {
	font-size: 18px;
	font-weight: 700;
	color: #2C4329;
}

.ns-filter__reset {
	background: none;
	border: none;
	color: #006f3b;
	font-size: 13px;
	font-weight: 600;
	cursor: pointer;
	text-decoration: underline;
	padding: 0;
}

.ns-filter__reset[hidden] {
	display: none;
}

/* Groepen */
.ns-filter__group {
	margin-bottom: 18px;
	padding-bottom: 16px;
	border-bottom: 1px solid #eee;
}

.ns-filter__group:last-child {
	border-bottom: none;
}

.ns-filter__group-title {
	font-size: 14px;
	font-weight: 700;
	color: #2C4329;
	margin-bottom: 10px;
}

.ns-filter__options {
	display: flex;
	flex-direction: column;
	gap: 7px;
	max-height: 260px;
	overflow-y: auto;
}

.ns-filter__option {
	display: flex;
	align-items: center;
	gap: 8px;
	cursor: pointer;
	color: #444;
	line-height: 1.3;
}

.ns-filter__option input {
	width: 16px;
	height: 16px;
	accent-color: #006f3b;
	cursor: pointer;
	flex: 0 0 auto;
}

.ns-filter__option:hover {
	color: #2C4329;
}

.ns-filter__option em {
	color: #9aa39a;
	font-style: normal;
	font-size: 12px;
}

/* Prijs: dual range slider */
.ns-filter__price {
	padding-top: 6px;
}

.ns-filter__slider {
	position: relative;
	height: 30px;
	margin: 0 8px 14px;
}

.ns-filter__slider-track {
	position: absolute;
	top: 13px;
	left: 0;
	right: 0;
	height: 4px;
	background: #e2e2e2;
	border-radius: 2px;
}

.ns-filter__slider-range {
	position: absolute;
	top: 13px;
	height: 4px;
	background: #2C4329;
	border-radius: 2px;
}

.ns-filter__slider input[type=range] {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	margin: 0;
	background: none;
	pointer-events: none;
	-webkit-appearance: none;
	appearance: none;
	height: 30px;
}

.ns-filter__slider input[type=range]::-webkit-slider-thumb {
	-webkit-appearance: none;
	appearance: none;
	pointer-events: auto;
	width: 18px;
	height: 18px;
	border-radius: 50%;
	background: #2C4329;
	border: 2px solid #fff;
	box-shadow: 0 1px 4px rgba(0,0,0,0.3);
	cursor: pointer;
	margin-top: 0;
}

.ns-filter__slider input[type=range]::-moz-range-thumb {
	pointer-events: auto;
	width: 18px;
	height: 18px;
	border-radius: 50%;
	background: #2C4329;
	border: 2px solid #fff;
	box-shadow: 0 1px 4px rgba(0,0,0,0.3);
	cursor: pointer;
}

.ns-filter__slider input[type=range]::-webkit-slider-runnable-track {
	background: none;
	height: 30px;
}

.ns-filter__slider input[type=range]::-moz-range-track {
	background: none;
}

.ns-filter__price-inputs {
	display: flex;
	align-items: center;
	gap: 8px;
}

.ns-filter__price-field {
	display: flex;
	align-items: center;
	flex: 1;
	border: 1px solid #d4d4d4;
	border-radius: 6px;
	padding: 0 8px;
}

.ns-filter__price-euro {
	color: #758470;
	font-size: 13px;
}

.ns-filter__price-inputs input {
	width: 100%;
	padding: 7px 4px;
	border: none;
	font-size: 13px;
	font-family: 'Urbanist', sans-serif;
	background: none;
}

.ns-filter__price-inputs input:focus {
	outline: none;
}

.ns-filter__price-inputs > span {
	color: #758470;
	font-size: 13px;
}

/* ===== Mobiele toggle + paneel ===== */
.ns-filter-toggle {
	display: none;
	align-items: center;
	justify-content: center;
	gap: 8px;
	width: 100%;
	padding: 12px;
	margin-bottom: 16px;
	background: #2C4329;
	color: #fff;
	border: none;
	border-radius: 8px;
	font-family: 'Urbanist', sans-serif;
	font-weight: 700;
	font-size: 15px;
	cursor: pointer;
}

.ns-filter__close,
.ns-filter__apply-bar {
	display: none;
}

@media (max-width: 1024px) {
	.ns-filter-toggle {
		display: flex;
	}

	/* Filter als off-canvas paneel */
	.ns-filter {
		position: fixed;
		top: 0;
		left: 0;
		bottom: 0;
		width: 86%;
		max-width: 360px;
		background: #fff;
		z-index: 100000;
		transform: translateX(-100%);
		transition: transform 0.28s ease;
		box-shadow: 2px 0 24px rgba(0,0,0,0.2);
		display: flex;
		flex-direction: column;
		margin: 0;
		padding: 18px 18px 0;
		overflow: hidden;
	}

	.ns-filter--open {
		transform: translateX(0);
	}

	.ns-filter__header {
		flex: 0 0 auto;
	}

	.ns-filter__close {
		display: block;
		background: none;
		border: none;
		font-size: 28px;
		line-height: 1;
		color: #2C4329;
		cursor: pointer;
		padding: 0 4px;
	}

	.ns-filter__body {
		flex: 1 1 auto;
		overflow-y: auto;
		-webkit-overflow-scrolling: touch;
		padding-bottom: 16px;
	}

	.ns-filter__apply-bar {
		display: block;
		flex: 0 0 auto;
		padding: 14px 0;
		border-top: 1px solid #eee;
		background: #fff;
	}

	.ns-filter__show-results {
		width: 100%;
		padding: 14px;
		background: #2C4329;
		color: #fff;
		border: none;
		border-radius: 8px;
		font-family: 'Urbanist', sans-serif;
		font-weight: 700;
		font-size: 16px;
		cursor: pointer;
	}

	.ns-filter__show-results:hover {
		background: #006f3b;
	}

	body.ns-filter-noscroll {
		overflow: hidden;
	}

	/* Donkere overlay achter het paneel */
	.ns-filter--open::before {
		content: '';
		position: fixed;
		top: 0;
		left: 100%;
		width: 100vw;
		height: 100%;
		background: rgba(0,0,0,0.45);
	}
}

/* Loading-state op de grid */
.ns-filter-loading {
	position: relative;
	opacity: 0.5;
	pointer-events: none;
	transition: opacity 0.2s ease;
}

/* Geen resultaten */
.ns-filter__empty {
	padding: 30px 16px;
	text-align: center;
	color: #758470;
	font-size: 15px;
}

.ns-filter__reset-inline {
	background: none;
	border: none;
	color: #006f3b;
	font-weight: 600;
	cursor: pointer;
	text-decoration: underline;
	padding: 0;
	font-size: 15px;
}

/* Paginering */
.ns-filter__pagination {
	width: 100%;
	margin-top: 20px;
}

.ns-filter__pagination ul {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	list-style: none;
	margin: 0;
	padding: 0;
	justify-content: center;
}

.ns-filter__pagination a,
.ns-filter__pagination span {
	display: inline-block;
	padding: 8px 13px;
	border: 1px solid #d4d4d4;
	border-radius: 6px;
	color: #2C4329;
	text-decoration: none;
	font-size: 14px;
}

.ns-filter__pagination .current {
	background: #2C4329;
	color: #fff;
	border-color: #2C4329;
}

.ns-filter__pagination a:hover {
	border-color: #2C4329;
}
