/* ================================================================
   Witgoed-Gids — sitebrede zoekfunctie
   Desktop: compacte zoekbalk in de header.
   Mobiel: zoekbalk bovenaan het geopende hamburgermenu.
   Live resultaten: rustige, scrollbare dropdown met aparte apparaatweergave.
   ================================================================ */

.wg-header__navigation {
	gap: 16px;
}

/* Desktop: het logo is de Home-link; de tekstlink Home blijft alleen mobiel zichtbaar.
   De gewonnen ruimte gaat naar een ruimere zoekbalk, waardoor de navigatie als geheel
   subtiel verder naar links begint zonder de Keuzehulp-knop te verplaatsen. */
@media (min-width: 821px) {
	.wg-header__home-link {
		display: none;
	}
}

.wg-site-search {
	position: relative;
	z-index: 20;
	flex: 0 1 320px;
	width: clamp(220px, 22vw, 320px);
	min-width: 0;
}

.wg-site-search__form {
	position: relative;
	display: flex;
	align-items: center;
	width: 100%;
	height: 42px;
	margin: 0;
	background: #f7f9fb;
	border: 1px solid #dce3ea;
	border-radius: 9px;
	transition: background-color .18s ease, border-color .18s ease, box-shadow .18s ease;
}

.wg-site-search__form:focus-within {
	background: #fff;
	border-color: #8bb1c6;
	box-shadow: 0 0 0 3px rgba(11, 79, 113, .09);
}

.wg-site-search__icon {
	position: absolute;
	left: 12px;
	top: 50%;
	display: inline-flex;
	width: 18px;
	height: 18px;
	color: #66788a;
	transform: translateY(-50%);
	pointer-events: none;
}

.wg-site-search__icon svg {
	display: block;
	width: 18px;
	height: 18px;
	fill: none;
	stroke: currentColor;
	stroke-width: 1.8;
	stroke-linecap: round;
	stroke-linejoin: round;
}

.wg-site-search__input {
	width: 100%;
	height: 100%;
	min-width: 0;
	padding: 0 12px 0 39px !important;
	margin: 0 !important;
	color: #23374a !important;
	background: transparent !important;
	border: 0 !important;
	border-radius: 9px !important;
	box-shadow: none !important;
	outline: 0 !important;
	font-family: inherit;
	font-size: 13.5px !important;
	font-weight: 500;
	line-height: 1 !important;
	appearance: none;
	-webkit-appearance: none;
	touch-action: manipulation;
}

.wg-site-search__input::placeholder {
	color: #778797;
	opacity: 1;
}

.wg-site-search__input::-webkit-search-cancel-button {
	margin-left: 5px;
	cursor: pointer;
}

/* Dropdown: visueel bewust eenvoudig en informatief, zoals een echte sitezoeker. */
.wg-site-search__results {
	position: absolute;
	top: calc(100% + 8px);
	right: 0;
	width: min(490px, calc(100vw - 28px));
	max-height: min(610px, calc(100vh - 96px));
	overflow-x: hidden;
	overflow-y: auto;
	overscroll-behavior: contain;
	-webkit-overflow-scrolling: touch;
	padding: 6px;
	color: #213547;
	background: #fff;
	border: 1px solid #d9e2e9;
	border-radius: 12px;
	box-shadow: 0 16px 42px rgba(16, 32, 51, .17);
}

.wg-site-search__results[hidden] {
	display: none !important;
}

.wg-site-search__results::-webkit-scrollbar {
	width: 8px;
}

.wg-site-search__results::-webkit-scrollbar-track {
	background: transparent;
}

.wg-site-search__results::-webkit-scrollbar-thumb {
	background: #a9b4bd;
	border: 2px solid #fff;
	border-radius: 999px;
}

.wg-site-search__loading {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 16px 13px;
	color: #66788a;
	font-size: 13.5px;
	font-weight: 600;
}

.wg-site-search__spinner {
	width: 16px;
	height: 16px;
	border: 2px solid #dbe5ec;
	border-top-color: #0b4f71;
	border-radius: 50%;
	animation: wg-site-search-spin .7s linear infinite;
}

@keyframes wg-site-search-spin {
	to { transform: rotate(360deg); }
}

.wg-site-search__group + .wg-site-search__group {
	margin-top: 4px;
	padding-top: 4px;
	border-top: 1px solid #edf1f4;
}

.wg-site-search__group-title {
	padding: 7px 10px 5px;
	color: #718292;
	font-size: 10.5px;
	font-weight: 750;
	line-height: 1.2;
	letter-spacing: .065em;
	text-transform: uppercase;
}

.wg-site-search__device-list,
.wg-site-search__content-list {
	display: grid;
	gap: 0;
}

.wg-site-search__device,
.wg-site-search__content-result {
	position: relative;
	display: flex;
	align-items: center;
	min-width: 0;
	color: #203448 !important;
	text-decoration: none !important;
	border-radius: 8px;
	transition: background-color .14s ease;
}

.wg-site-search__device {
	gap: 10px;
	min-height: 72px;
	padding: 7px 9px 7px 7px;
}

.wg-site-search__content-result {
	gap: 12px;
	min-height: 76px;
	padding: 9px 10px;
}

.wg-site-search__device + .wg-site-search__device,
.wg-site-search__content-result + .wg-site-search__content-result {
	border-top: 1px solid #f0f3f5;
	border-radius: 0;
}

.wg-site-search__device:hover,
.wg-site-search__device:focus-visible,
.wg-site-search__content-result:hover,
.wg-site-search__content-result:focus-visible {
	background: #f5f8fa;
	outline: 0;
}

.wg-site-search__device:focus-visible,
.wg-site-search__content-result:focus-visible,
.wg-site-search__all:focus-visible {
	box-shadow: inset 0 0 0 2px rgba(11, 79, 113, .28);
}

/* Apparaten blijven herkenbaar als echte productresultaten. */
.wg-site-search__device-media {
	display: grid;
	place-items: center;
	flex: 0 0 54px;
	width: 54px;
	height: 58px;
	padding: 4px;
	background: #fbfcfd;
	border: 1px solid #edf1f4;
	border-radius: 7px;
}

.wg-site-search__device-image {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: contain;
	mix-blend-mode: multiply;
}

.wg-site-search__device-placeholder {
	position: relative;
	display: block;
	width: 31px;
	height: 35px;
	border: 2px solid #b7c6d1;
	border-radius: 5px;
}

.wg-site-search__device-placeholder::before {
	content: '';
	position: absolute;
	left: 5px;
	right: 5px;
	top: 6px;
	height: 2px;
	background: #b7c6d1;
}

.wg-site-search__device-placeholder span {
	position: absolute;
	left: 50%;
	top: 21px;
	width: 14px;
	height: 14px;
	border: 2px solid #b7c6d1;
	border-radius: 50%;
	transform: translate(-50%, -50%);
}

.wg-site-search__device-copy,
.wg-site-search__content-copy {
	display: flex;
	flex: 1 1 auto;
	min-width: 0;
	flex-direction: column;
}

.wg-site-search__device-copy {
	gap: 4px;
}

.wg-site-search__device-title,
.wg-site-search__content-result strong {
	color: #183149;
	font-size: 13.5px;
	font-weight: 700;
	line-height: 1.32;
}

.wg-site-search__device-title {
	display: -webkit-box;
	overflow: hidden;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 2;
}

.wg-site-search__device-specs {
	overflow: hidden;
	color: #6b7c8b;
	font-size: 11.5px;
	font-weight: 500;
	line-height: 1.35;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.wg-site-search__content-copy {
	gap: 4px;
}

.wg-site-search__content-result strong {
	display: -webkit-box;
	overflow: hidden;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 2;
}

.wg-site-search__content-summary {
	display: -webkit-box;
	overflow: hidden;
	color: #6b7b89;
	font-size: 12px;
	font-weight: 450;
	line-height: 1.42;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 2;
}

.wg-site-search__result-type {
	align-self: center;
	flex: 0 0 auto;
	max-width: 82px;
	color: #0b5a89;
	font-size: 9.5px;
	font-weight: 750;
	line-height: 1.2;
	letter-spacing: .045em;
	text-align: right;
	text-transform: uppercase;
}

.wg-site-search__all {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	margin-top: 5px;
	padding: 11px 10px;
	color: #0b4f71 !important;
	background: #f4f8fa;
	border-radius: 8px;
	font-size: 12.5px;
	font-weight: 700;
	text-decoration: none !important;
}

.wg-site-search__all:hover {
	background: #eaf2f6;
}

.wg-site-search__empty {
	display: flex;
	flex-direction: column;
	gap: 4px;
	padding: 20px 14px;
}

.wg-site-search__empty strong {
	color: #183149;
	font-size: 14px;
}

.wg-site-search__empty span {
	color: #6a7c8d;
	font-size: 12.5px;
	line-height: 1.45;
}

/* Houd de desktopheader luchtig als de beschikbare breedte kleiner wordt. */
@media (max-width: 1120px) and (min-width: 821px) {
	.wg-header__navigation {
		gap: 13px;
	}

	.wg-site-search {
		width: clamp(175px, 19vw, 220px);
		flex-basis: 220px;
	}

	.wg-site-search__input {
		font-size: 13px !important;
	}

	.wg-header__navigation .wg-header__button {
		padding-inline: 16px;
	}
}

@media (max-width: 930px) and (min-width: 821px) {
	.wg-header__navigation {
		gap: 10px;
	}

	.wg-site-search {
		width: 150px;
		flex-basis: 150px;
	}

	.wg-site-search__input {
		padding-right: 8px !important;
		font-size: 12.5px !important;
	}
}

/* Mobiel: zoekveld is het eerste onderdeel van het geopende menu. */
@media (max-width: 820px) {
	.wg-header__navigation .wg-site-search {
		order: -10;
		width: 100%;
		max-width: none;
		flex: 0 0 auto;
		margin: 0 0 9px;
	}

	.wg-site-search__form {
		height: 46px;
		background: #f7f9fb;
		border-radius: 10px;
	}

	.wg-site-search__icon {
		left: 14px;
		width: 19px;
		height: 19px;
	}

	.wg-site-search__icon svg {
		width: 19px;
		height: 19px;
	}

	.wg-site-search__input {
		padding-left: 43px !important;
		font-size: 16px !important;
		line-height: 1.2 !important;
	}

	/* Resultaten zweven onder de zoekbalk, zodat het menu niet meters lang wordt. */
	.wg-site-search__results {
		position: absolute;
		top: calc(100% + 6px);
		right: 0;
		left: 0;
		width: 100%;
		max-height: min(58vh, 520px);
		margin: 0;
		padding: 5px;
		border-radius: 10px;
		box-shadow: 0 14px 34px rgba(16, 32, 51, .16);
	}

	.wg-site-search__content-result {
		min-height: 72px;
		padding: 8px 9px;
	}

	.wg-site-search__content-summary {
		font-size: 12px;
		-webkit-line-clamp: 2;
	}

	.wg-site-search__result-type {
		max-width: 70px;
		font-size: 9px;
	}
}

/*
 * iPhone/iPad: 16px op een gefocust invoerveld voorkomt Safari's automatische
 * pagina-zoom. Dit geldt ook op apparaten die een desktop viewport rapporteren.
 */
@media (hover: none) and (pointer: coarse) {
	.wg-site-search__input {
		font-size: 16px !important;
		-webkit-text-size-adjust: 100%;
	}
}

@supports (-webkit-touch-callout: none) {
	.wg-site-search__input {
		font-size: 16px !important;
		-webkit-text-size-adjust: 100%;
	}
}

/* 3.2.6 — zoekveld sluit visueel aan op het compacte mobiele menu. */
@media (max-width: 820px) {
	.wg-header__navigation .wg-site-search {
		margin: 0 0 7px;
	}

	.wg-header__navigation .wg-site-search__form {
		height: 46px;
		background: #f8fafc;
		border-color: #d8e4ec;
		border-radius: 11px;
		box-shadow: none;
	}

	.wg-header__navigation .wg-site-search__form:focus-within {
		background: #ffffff;
		border-color: #7ab1cc;
		box-shadow: 0 0 0 3px rgba(11, 95, 132, .10);
	}
}

/* 3.2.8 — mobiel zoekveld sluit compacter aan op de navigatie. */
@media (max-width: 820px) {
	.wg-header__navigation .wg-site-search {
		margin-bottom: 5px;
	}
}
