/* BMF Productzoeker */

.bmfz {
	--bmfz-accent: #1397d5;
	--bmfz-text: #1b3a52;
	--bmfz-muted: #5f7488;
	--bmfz-bg: #f3f8fc;
	--bmfz-border: #d6e5f0;
	--bmfz-radius: 6px;
	--bmfz-width: 240px;
	--bmfz-shadow: 0 18px 48px rgba(16, 64, 104, 0.18), 0 2px 6px rgba(16, 64, 104, 0.08);

	position: relative;
	display: inline-block;
	max-width: 100%;
	vertical-align: middle;
	color: var(--bmfz-text);
	font-family: inherit;
	line-height: 1.4;
	text-align: left;
}

.bmfz *,
.bmfz *::before,
.bmfz *::after {
	box-sizing: border-box;
}

.bmfz__sr {
	position: absolute !important;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
	border: 0;
}

.bmfz__svg {
	display: block;
	flex: none;
}

/* ---- Icoonknop ------------------------------------------------------- */

.bmfz .bmfz__toggle,
.bmfz .bmfz__close {
	display: none;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: var(--bmfz-radius);
	background: transparent;
	color: var(--bmfz-accent);
	box-shadow: none;
	cursor: pointer;
	transition: background-color 0.15s ease, color 0.15s ease;
}

.bmfz .bmfz__toggle:hover,
.bmfz .bmfz__toggle:focus-visible,
.bmfz.is-open .bmfz__toggle {
	background: var(--bmfz-bg);
	color: var(--bmfz-accent);
}

.bmfz .bmfz__close {
	width: 40px;
	height: 40px;
	color: var(--bmfz-muted);
}

.bmfz .bmfz__close:hover,
.bmfz .bmfz__close:focus-visible {
	background: var(--bmfz-bg);
	color: var(--bmfz-text);
}

.bmfz :focus-visible {
	outline: 2px solid var(--bmfz-accent);
	outline-offset: 2px;
}

/* ---- Zoekveld -------------------------------------------------------- */

.bmfz__form {
	position: relative;
	display: flex;
	align-items: center;
	gap: 4px;
	/* Vaste breedte op het formulier zelf, zodat Elementor het blok niet smaller
	   perst dan het veld (anders schuift het veld over naastgelegen knoppen). */
	width: var(--bmfz-width);
	max-width: 100%;
	margin: 0;
}

.bmfz__icon {
	position: absolute;
	top: 50%;
	left: 12px;
	color: var(--bmfz-muted);
	transform: translateY(-50%);
	pointer-events: none;
	transition: color 0.15s ease;
}

.bmfz__icon .bmfz__svg {
	width: 18px;
	height: 18px;
}

.bmfz.is-loading .bmfz__icon {
	animation: bmfz-pulse 0.9s ease-in-out infinite;
}

@keyframes bmfz-pulse {
	50% { opacity: 0.35; }
}

.bmfz .bmfz__input {
	flex: 1 1 auto;
	width: 100%;
	min-width: 0;
	height: 44px;
	margin: 0;
	padding: 0 14px 0 40px;
	border: 1px solid var(--bmfz-border);
	border-radius: var(--bmfz-radius);
	background: var(--bmfz-bg);
	color: var(--bmfz-text);
	font: inherit;
	font-size: 15px;
	box-shadow: none;
	-webkit-appearance: none;
	appearance: none;
	transition: border-color 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease;
}

.bmfz .bmfz__input::placeholder {
	color: var(--bmfz-muted);
	opacity: 1;
}

.bmfz .bmfz__input::-webkit-search-decoration,
.bmfz .bmfz__input::-webkit-search-cancel-button {
	-webkit-appearance: none;
	appearance: none;
}

.bmfz .bmfz__input:hover {
	border-color: var(--bmfz-accent);
}

.bmfz .bmfz__input:focus {
	border-color: var(--bmfz-accent);
	background: #fff;
	outline: none;
	box-shadow: 0 0 0 3px rgba(19, 151, 213, 0.18);
}

.bmfz__form:focus-within .bmfz__icon {
	color: var(--bmfz-accent);
}

/* ---- Resultaten ------------------------------------------------------ */

.bmfz__results {
	position: absolute;
	z-index: 9999;
	top: calc(100% + 8px);
	right: 0;
	width: min(440px, calc(100vw - 32px));
	min-width: 100%;
	overflow: hidden;
	border: 1px solid var(--bmfz-border);
	border-radius: calc(var(--bmfz-radius) + 4px);
	background: #fff;
	box-shadow: var(--bmfz-shadow);
	animation: bmfz-in 0.14s ease-out;
}

.bmfz__results[hidden] {
	display: none;
}

@keyframes bmfz-in {
	from { opacity: 0; transform: translateY(-4px); }
}

.bmfz .bmfz__list {
	max-height: min(420px, 60vh);
	margin: 0;
	padding: 6px;
	overflow-y: auto;
	overscroll-behavior: contain;
	list-style: none;
}

.bmfz .bmfz__list:empty {
	display: none;
}

.bmfz__option {
	margin: 0;
	padding: 0;
}

.bmfz .bmfz__item {
	display: block;
	padding: 10px 12px;
	border-radius: var(--bmfz-radius);
	color: var(--bmfz-text);
	text-decoration: none;
}

.bmfz__option[aria-selected="true"] .bmfz__item {
	background: var(--bmfz-bg);
	box-shadow: inset 3px 0 0 var(--bmfz-accent);
}

.bmfz__meta {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 6px;
	margin-bottom: 2px;
}

.bmfz__context {
	color: var(--bmfz-accent);
	font-size: 11px;
	font-weight: 600;
	letter-spacing: 0.06em;
	text-transform: uppercase;
}

.bmfz__chip {
	padding: 1px 7px;
	border-radius: 999px;
	background: #eaf6dc;
	color: #3f7a10;
	font-size: 11px;
	font-weight: 600;
}

.bmfz__title {
	display: block;
	font-size: 15px;
	font-weight: 600;
}

.bmfz__title mark,
.bmfz__chip mark {
	padding: 0;
	background: transparent;
	color: inherit;
	text-decoration: underline;
	text-decoration-color: var(--bmfz-accent);
	text-decoration-thickness: 2px;
	text-underline-offset: 3px;
}

.bmfz__excerpt {
	display: -webkit-box;
	margin-top: 2px;
	overflow: hidden;
	color: var(--bmfz-muted);
	font-size: 13px;
	-webkit-line-clamp: 1;
	-webkit-box-orient: vertical;
}

.bmfz__footer:empty {
	display: none;
}

.bmfz__footer {
	border-top: 1px solid var(--bmfz-border);
	background: #fafcfe;
}

.bmfz .bmfz__all,
.bmfz .bmfz__cta {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	padding: 12px 18px;
	color: var(--bmfz-accent);
	font-size: 14px;
	font-weight: 600;
	text-decoration: none;
}

.bmfz .bmfz__all:hover,
.bmfz .bmfz__cta:hover {
	background: var(--bmfz-bg);
}

.bmfz__empty {
	padding: 16px 18px 4px;
	font-size: 14px;
}

.bmfz__empty strong {
	display: block;
	margin-bottom: 2px;
}

.bmfz__empty span {
	color: var(--bmfz-muted);
}

.bmfz__empty + .bmfz__cta {
	padding-top: 8px;
}

/* ---- Inklapbare weergave (icoon) ------------------------------------- */

.bmfz--icon .bmfz__toggle {
	display: inline-flex;
}

.bmfz--icon .bmfz__panel {
	display: none;
}

.bmfz--icon.is-open .bmfz__panel {
	position: absolute;
	z-index: 9999;
	top: calc(100% + 12px);
	right: 0;
	display: block;
	width: min(440px, calc(100vw - 32px));
	padding: 10px;
	border: 1px solid var(--bmfz-border);
	border-radius: calc(var(--bmfz-radius) + 4px);
	background: #fff;
	box-shadow: var(--bmfz-shadow);
	animation: bmfz-in 0.14s ease-out;
}

.bmfz--icon .bmfz__form {
	width: auto;
}

.bmfz--icon .bmfz__close {
	display: inline-flex;
}

.bmfz--icon .bmfz__results {
	position: static;
	width: auto;
	margin: 10px -10px -10px;
	border-width: 1px 0 0;
	border-radius: 0;
	box-shadow: none;
	animation: none;
}

/* Automatisch: zoekveld op desktop, icoon daaronder (Elementor-breakpoint tablet). */
@media (max-width: 1024px) {
	.bmfz--auto .bmfz__toggle { display: inline-flex; }
	.bmfz--auto .bmfz__panel { display: none; }
	.bmfz--auto.is-open .bmfz__panel {
		position: absolute;
		z-index: 9999;
		top: calc(100% + 12px);
		right: 0;
		display: block;
		width: min(440px, calc(100vw - 32px));
		padding: 10px;
		border: 1px solid var(--bmfz-border);
		border-radius: calc(var(--bmfz-radius) + 4px);
		background: #fff;
		box-shadow: var(--bmfz-shadow);
		animation: bmfz-in 0.14s ease-out;
	}
	.bmfz--auto .bmfz__form { width: auto; }
	.bmfz--auto .bmfz__close { display: inline-flex; }
	.bmfz--auto .bmfz__results {
		position: static;
		width: auto;
		margin: 10px -10px -10px;
		border-width: 1px 0 0;
		border-radius: 0;
		box-shadow: none;
		animation: none;
	}
}

/* Mobiel: zoekpaneel over de volle breedte bovenaan het scherm. */
@media (max-width: 767px) {
	.bmfz--icon.is-open .bmfz__panel,
	.bmfz--auto.is-open .bmfz__panel {
		position: fixed;
		top: 0;
		right: 0;
		left: 0;
		width: auto;
		padding: 12px 16px;
		border: 0;
		border-radius: 0;
		box-shadow: 0 0 0 100vmax rgba(12, 36, 58, 0.45);
	}

	.bmfz--icon .bmfz__results,
	.bmfz--auto .bmfz__results {
		margin: 12px -16px -12px;
	}

	.bmfz--icon .bmfz__list,
	.bmfz--auto .bmfz__list {
		max-height: calc(100vh - 160px);
		max-height: calc(100dvh - 160px);
	}

	/* 16px voorkomt dat iOS inzoomt bij focus. */
	.bmfz .bmfz__input {
		font-size: 16px;
	}

	.bmfz--inline,
	.bmfz--inline .bmfz__form {
		width: 100%;
	}
}

/* ---- Zoekresultatenpagina ------------------------------------------- */

.bmfz-page {
	--bmfz-accent: #1397d5;
	--bmfz-text: #1b3a52;
	--bmfz-muted: #5f7488;
	--bmfz-bg: #f3f8fc;
	--bmfz-border: #d6e5f0;
	--bmfz-cta: #76bc21;

	padding: 56px 16px 88px;
	background: linear-gradient(180deg, var(--bmfz-bg) 0, #fff 340px);
	color: var(--bmfz-text);
}

.bmfz-page *,
.bmfz-page *::before,
.bmfz-page *::after {
	box-sizing: border-box;
}

.bmfz-page__inner {
	max-width: 880px;
	margin: 0 auto;
}

.bmfz-page .bmfz-page__eyebrow {
	margin: 0 0 8px;
	color: var(--bmfz-accent);
	font-size: 13px;
	font-weight: 600;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

.bmfz-page .bmfz-page__title {
	margin: 0;
	color: var(--bmfz-text);
	font-size: clamp(28px, 4vw, 40px);
	font-weight: 700;
	line-height: 1.15;
	overflow-wrap: anywhere;
}

.bmfz-page .bmfz-page__count {
	margin: 8px 0 0;
	color: var(--bmfz-muted);
}

.bmfz-page__search {
	margin-top: 24px;
}

.bmfz-page__search .bmfz {
	--bmfz-width: 100%;
	display: block;
}

.bmfz-page__search .bmfz .bmfz__input {
	height: 56px;
	padding-left: 48px;
	background: #fff;
	font-size: 17px;
}

.bmfz-page__search .bmfz__icon {
	left: 16px;
}

.bmfz-page .bmfz-page__list {
	display: grid;
	gap: 12px;
	margin: 36px 0 0;
	padding: 0;
	list-style: none;
}

.bmfz-page .bmfz-page__list > li {
	margin: 0;
	padding: 0;
}

.bmfz-page .bmfz-card {
	display: block;
	padding: 20px 24px;
	border: 1px solid var(--bmfz-border);
	border-radius: 10px;
	background: #fff;
	color: var(--bmfz-text);
	text-decoration: none;
	transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.bmfz-page .bmfz-card:hover,
.bmfz-page .bmfz-card:focus-visible {
	border-color: var(--bmfz-accent);
	box-shadow: 0 12px 32px rgba(16, 64, 104, 0.1);
	transform: translateY(-1px);
}

.bmfz-page .bmfz-card__title {
	margin: 4px 0 6px;
	color: var(--bmfz-text);
	font-size: 20px;
	font-weight: 600;
	line-height: 1.3;
}

.bmfz-page .bmfz-card:hover .bmfz-card__title {
	color: var(--bmfz-accent);
}

.bmfz-page .bmfz-card__excerpt {
	margin: 0;
	color: var(--bmfz-muted);
	font-size: 15px;
	line-height: 1.6;
}

.bmfz-page .bmfz-card__more {
	display: inline-block;
	margin-top: 10px;
	color: var(--bmfz-accent);
	font-size: 14px;
	font-weight: 600;
}

.bmfz-card mark {
	padding: 0;
	background: transparent;
	color: inherit;
	text-decoration: underline;
	text-decoration-color: var(--bmfz-accent);
	text-decoration-thickness: 2px;
	text-underline-offset: 3px;
}

.bmfz-page .bmfz-page__empty {
	margin-top: 36px;
	padding: 28px;
	border: 1px dashed var(--bmfz-border);
	border-radius: 10px;
	background: #fff;
}

.bmfz-page .bmfz-page__empty h2,
.bmfz-page .bmfz-page__cta h2 {
	margin: 0 0 6px;
	color: inherit;
	font-size: 20px;
	font-weight: 600;
	line-height: 1.3;
}

.bmfz-page .bmfz-page__empty p,
.bmfz-page .bmfz-page__cta p {
	margin: 0;
	line-height: 1.6;
}

.bmfz-page .bmfz-page__empty p {
	color: var(--bmfz-muted);
}

.bmfz-page__cats {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-top: 18px;
}

.bmfz-page .bmfz-page__cats a {
	padding: 8px 16px;
	border-radius: 999px;
	background: var(--bmfz-bg);
	color: var(--bmfz-accent);
	font-size: 14px;
	font-weight: 600;
	text-decoration: none;
}

.bmfz-page .bmfz-page__cats a:hover {
	background: var(--bmfz-accent);
	color: #fff;
}

.bmfz-page .bmfz-page__cta {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 24px;
	margin-top: 40px;
	padding: 28px 32px;
	border-radius: 10px;
	background: var(--bmfz-text);
	color: #fff;
}

.bmfz-page .bmfz-page__cta p {
	opacity: 0.8;
}

.bmfz-page .bmfz-page__button {
	flex: none;
	padding: 12px 26px;
	border-radius: 3px;
	background: var(--bmfz-cta);
	color: #fff;
	font-weight: 600;
	text-decoration: none;
	white-space: nowrap;
	transition: filter 0.15s ease;
}

.bmfz-page .bmfz-page__button:hover {
	color: #fff;
	filter: brightness(1.08);
}

@media (max-width: 767px) {
	.bmfz-page {
		padding: 32px 16px 56px;
	}

	.bmfz-page .bmfz-card {
		padding: 16px 18px;
	}

	.bmfz-page .bmfz-card__title {
		font-size: 18px;
	}

	.bmfz-page .bmfz-page__cta {
		flex-direction: column;
		align-items: flex-start;
		padding: 24px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.bmfz *,
	.bmfz__results,
	.bmfz__panel {
		animation: none !important;
		transition: none !important;
	}
}
