/**
 * NS Search - Houthandel Jan Sok
 * Live AJAX mega-paneel (full width) ter vervanging van Doofinder.
 * Huisstijl: --maincolor #2C4329, --subcolor #ccdc46, accent #006f3b.
 */

.ns-search {
	position: relative;
	width: 100%;
	max-width: 520px;
	font-family: 'Urbanist', sans-serif;
	z-index: 100000000000; /* boven de mega-menu nav */
}

/* ===== Zoekform ===== */
.ns-search__form {
	display: flex;
	align-items: stretch;
	border: 2px solid #2C4329;
	border-radius: 8px;
	overflow: hidden;
	background: #fff;
}

.ns-search__input {
	flex: 1 1 auto;
	border: none;
	outline: none;
	padding: 10px 14px;
	font-size: 15px;
	font-family: 'Urbanist', sans-serif;
	color: #2C4329;
	background: transparent;
	min-width: 0;
}

.ns-search__input::placeholder {
	color: #9aa39a;
}

.ns-search__submit {
	flex: 0 0 auto;
	border: none;
	background: #2C4329;
	color: #fff;
	padding: 0 16px;
	cursor: pointer;
	font-size: 16px;
	transition: background 0.15s ease;
}

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

/* ===== Overlay ===== */
.ns-search__overlay {
	position: fixed;
	inset: 0;
	background: rgba(44, 67, 41, 0.35);
	z-index: 99990; /* onder de zoekbalk en het paneel, boven de pagina */
}

.ns-search__overlay[hidden] {
	display: none !important;
}

/* ===== Full-width paneel ===== */
.ns-search__panel {
	position: fixed;
	left: 0;
	right: 0;
	top: 0; /* via JS gezet op header-bottom */
	background: #fff;
	box-shadow: 0 12px 32px rgba(0, 0, 0, 0.18);
	z-index: 100000000050;
	max-height: 75vh;
	overflow-y: auto;
	border-top: 1px solid #e6e6e6;
}

.ns-search__panel[hidden] {
	display: none !important;
}

.ns-search__panel-inner {
	max-width: 1400px;
	margin: 0 auto;
	padding: 20px 24px;
}

/* ===== Twee kolommen ===== */
.ns-search__cols {
	display: grid;
	grid-template-columns: 280px 1fr;
	gap: 28px;
}

.ns-search__section-title {
	font-size: 12px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	color: #758470;
	margin-bottom: 12px;
}

/* Linkerkolom: categorieen */
.ns-search__col-cats {
	border-right: 1px solid #eee;
	padding-right: 24px;
}

.ns-search__cats {
	display: flex;
	flex-direction: column;
	gap: 4px;
}

.ns-search__cat {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	padding: 8px 12px;
	border-radius: 6px;
	font-size: 13px;
	color: #2C4329;
	text-decoration: none;
	transition: background 0.12s ease;
}

.ns-search__cat:hover {
	background: #f3f5ed;
}

.ns-search__cat-name {
	line-height: 1.3;
}

.ns-search__cat-count {
	flex: 0 0 auto;
	font-size: 11px;
	font-weight: 700;
	color: #fff;
	background: #006f3b;
	border-radius: 10px;
	padding: 1px 8px;
}

.ns-search__cats-empty {
	font-size: 13px;
	color: #9aa39a;
}

/* Rechterkolom: productgrid */
.ns-search__grid {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 16px;
}

.ns-search__card {
	display: flex;
	flex-direction: column;
	text-decoration: none;
	border: 1px solid #eee;
	border-radius: 8px;
	padding: 12px;
	transition: border-color 0.12s ease, box-shadow 0.12s ease;
}

.ns-search__card:hover {
	border-color: #ccdc46;
	box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
}

.ns-search__card-img {
	display: block;
	width: 100%;
	aspect-ratio: 1 / 1;
	margin-bottom: 10px;
}

.ns-search__card-img img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	border-radius: 6px;
}

.ns-search__card-title {
	font-size: 13px;
	font-weight: 600;
	color: #2C4329;
	line-height: 1.35;
	margin-bottom: 4px;
}

.ns-search__card-sku {
	font-size: 11px;
	color: #9aa39a;
	margin-bottom: 6px;
}

.ns-search__card-price {
	font-size: 14px;
	font-weight: 700;
	color: #006f3b;
	margin-top: auto;
}

.ns-search__card-price del {
	color: #b0b0b0;
	font-weight: 400;
	margin-right: 4px;
}

/* Alle resultaten knop */
.ns-search__all {
	display: block;
	text-align: center;
	margin-top: 18px;
	padding: 14px;
	background: #2C4329;
	color: #fff;
	font-weight: 700;
	font-size: 14px;
	text-decoration: none;
	border-radius: 8px;
	transition: background 0.15s ease;
}

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

/* Loading + leeg */
.ns-search__loading,
.ns-search__empty {
	padding: 24px 16px;
	text-align: center;
	color: #758470;
	font-size: 14px;
}

/* ===== Skeleton loader ===== */
.ns-sk {
	pointer-events: none;
}

.ns-sk-line,
.ns-sk-box {
	display: block;
	background: linear-gradient(90deg, #eef0ea 25%, #e2e6da 37%, #eef0ea 63%);
	background-size: 400% 100%;
	border-radius: 4px;
	animation: ns-sk-shimmer 1.2s ease-in-out infinite;
}

.ns-sk-line {
	height: 11px;
	margin-bottom: 7px;
}

.ns-search__cat.ns-sk {
	background: transparent;
}

.ns-search__cat.ns-sk .ns-sk-line {
	height: 13px;
	margin: 4px 0;
}

.ns-sk-box {
	width: 100%;
	aspect-ratio: 1 / 1;
	margin-bottom: 10px;
	border-radius: 6px;
}

.ns-sk-price {
	height: 14px;
	margin-top: 6px;
}

@keyframes ns-sk-shimmer {
	0% {
		background-position: 100% 50%;
	}
	100% {
		background-position: 0 50%;
	}
}

/* ===== Responsive ===== */
@media screen and (max-width: 1100px) {
	.ns-search__grid {
		grid-template-columns: repeat(3, 1fr);
	}
}

@media screen and (max-width: 900px) {
	.ns-search__cols {
		grid-template-columns: 220px 1fr;
		gap: 18px;
	}
	.ns-search__grid {
		grid-template-columns: repeat(2, 1fr);
	}
}

@media screen and (max-width: 800px) {
	.ns-search {
		max-width: 100%;
	}
	.ns-search__panel {
		max-height: calc(100vh - 60px);
	}
	.ns-search__panel-inner {
		padding: 16px;
	}
	.ns-search__cols {
		grid-template-columns: 1fr;
		gap: 16px;
	}
	.ns-search__col-cats {
		border-right: none;
		border-bottom: 1px solid #eee;
		padding-right: 0;
		padding-bottom: 14px;
	}
	.ns-search__cats {
		flex-direction: row;
		flex-wrap: wrap;
	}
	.ns-search__cat {
		background: #f3f5ed;
	}
}

@media screen and (max-width: 480px) {
	.ns-search__grid {
		grid-template-columns: 1fr 1fr;
		gap: 10px;
	}
}
