/* ==========================================================================
   Zoeksuggesties (autocomplete) onder elk .search-form.
   Script: assets/js/search.js. Laden na main.css (tokens, .search-form).
   Het paneel staat absoluut onder het veld: geen layoutverschuiving.
   ========================================================================== */

.lcc-ac-host { position: relative; }

/* ---------- Laden: klein ringetje links van de zoekknop ---------- */
.lcc-ac-host::after {
	content: "";
	position: absolute;
	top: 50%;
	right: 56px;
	width: 16px;
	height: 16px;
	margin-top: -8px;
	border: 2px solid var(--c-border);
	border-top-color: var(--c-navy);
	border-radius: 50%;
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.15s;
	animation: lcc-ac-spin 0.7s linear infinite;
}
.lcc-ac-host.is-ac-loading::after { opacity: 1; transition-delay: 0.2s; }
.search-form--home::after { right: 70px; }
@media (min-width: 1024px) {
	.listing-search::after { right: 62px; }
}

@keyframes lcc-ac-spin { to { transform: rotate(360deg); } }

/* ---------- Paneel ---------- */
.lcc-ac {
	--ac-active: #f3f5f8;
	--ac-muted: #6b7280;

	position: absolute;
	top: calc(100% + 8px);
	left: 0;
	right: 0;
	z-index: 70;
	max-height: 70vh;
	overflow-y: auto;
	overscroll-behavior: contain;
	padding: 8px 0;
	border: 1px solid var(--c-border-light);
	border-radius: 16px;
	background: #fff;
	box-shadow: 0 16px 40px rgba(17, 24, 39, 0.16), 0 2px 6px rgba(17, 24, 39, 0.08);
	font-family: var(--f-sans);
	font-size: 16px;
	line-height: 1.35;
	color: var(--c-ink);
	text-align: left;
	animation: lcc-ac-in 0.12s ease-out;
}
.lcc-ac[hidden] { display: none; }

@keyframes lcc-ac-in {
	from { opacity: 0; transform: translateY(-4px); }
	to { opacity: 1; transform: none; }
}

/* Desktop: breedte van het veld, minimaal 420, maximaal 640. */
@media (min-width: 768px) {
	.lcc-ac {
		right: auto;
		width: 100%;
		min-width: 420px;
		max-width: 640px;
	}
	/* Kopveld staat rechts in de balk: paneel rechts uitlijnen. */
	.search-form--header .lcc-ac { left: auto; right: 0; }
	/* Gecentreerde velden (home, overzicht, 404) zijn al ≥ 420 breed. */
}

/* ---------- Groepen ---------- */
.lcc-ac__group + .lcc-ac__group {
	margin-top: 4px;
	padding-top: 4px;
	border-top: 1px solid var(--c-border-light);
}
.lcc-ac__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 10px 16px 4px;
	font-size: 14px;
	line-height: 20px;
	font-weight: 600;
	color: var(--ac-muted);
}
.lcc-ac__clear {
	min-height: 32px;
	margin: -6px -8px -6px 0;
	padding: 0 8px;
	border: 0;
	border-radius: 8px;
	background: none;
	font-size: 14px;
	font-weight: 600;
	color: var(--c-link);
	cursor: pointer;
}
.lcc-ac__clear:hover { background: var(--ac-active); }

/* ---------- Opties ---------- */
.lcc-ac__opt {
	display: flex;
	align-items: center;
	gap: 12px;
	min-height: 44px;
	padding: 8px 16px;
	color: var(--c-ink);
	text-decoration: none;
	cursor: pointer;
	-webkit-tap-highlight-color: transparent;
}
.lcc-ac__opt:hover,
.lcc-ac__opt.is-active { background: var(--ac-active); }
.lcc-ac__opt.is-active { box-shadow: inset 3px 0 0 var(--c-navy); }

.lcc-ac__icon { flex-shrink: 0; color: var(--ac-muted); }
.lcc-ac__text {
	flex: 1;
	min-width: 0;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	font-weight: 400;
}
.lcc-ac__text b { font-weight: 700; }

/* "Bedoelde je X?" */
.lcc-ac__opt--did { font-size: 16px; }
.lcc-ac__opt--did b { color: var(--c-link); font-weight: 700; }

/* Recent: kruisje om te verwijderen (aanraakvlak 44 px). */
.lcc-ac__remove {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	margin: -8px -12px -8px 0;
	border-radius: 50%;
	color: var(--ac-muted);
}
.lcc-ac__remove .lcc-ac__icon { color: inherit; }
.lcc-ac__remove:hover { color: var(--c-ink); background: rgba(0, 0, 0, 0.05); }

/* ---------- Recepten ---------- */
.lcc-ac__opt--recipe { gap: 14px; padding-block: 8px; }
.lcc-ac__thumb {
	flex-shrink: 0;
	width: 48px;
	height: 48px;
	overflow: hidden;
	border-radius: 8px;
	background: var(--c-placeholder);
}
.lcc-ac__thumb img { width: 48px; height: 48px; object-fit: cover; }
.lcc-ac__body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.lcc-ac__title {
	display: -webkit-box;
	overflow: hidden;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 2;
	font-size: 16px;
	line-height: 21px;
	font-weight: 500;
	color: var(--c-ink);
}
.lcc-ac__title mark { background: none; color: inherit; font-weight: 700; }
.lcc-ac__meta { font-size: 14px; line-height: 19px; color: var(--ac-muted); }

/* ---------- Categorieën als chips ---------- */
.lcc-ac__chips {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	padding: 6px 16px 8px;
}
.lcc-ac__opt.lcc-ac__chip {
	gap: 6px;
	min-height: 40px;
	padding: 6px 14px;
	border: 1px solid var(--c-border);
	border-radius: var(--r-pill);
	font-size: 15px;
	font-weight: 600;
	color: var(--c-navy);
}
.lcc-ac__opt.lcc-ac__chip:hover,
.lcc-ac__opt.lcc-ac__chip.is-active {
	border-color: var(--c-navy);
	background: var(--ac-active);
	box-shadow: none;
}
.lcc-ac__opt.lcc-ac__chip.is-active { box-shadow: 0 0 0 1px var(--c-navy); }
.lcc-ac__count { font-size: 14px; font-weight: 400; color: var(--ac-muted); }

/* ---------- Toon alle resultaten ---------- */
.lcc-ac__opt.lcc-ac__all {
	font-size: 16px;
	font-weight: 600;
	color: var(--c-link);
}

/* ---------- Mobiel: volle breedte, grotere aanraakvlakken ---------- */
@media (max-width: 767px) {
	.lcc-ac { max-height: min(70vh, 70dvh); }
	.lcc-ac__opt { min-height: 48px; }
	.lcc-ac__opt.lcc-ac__chip { min-height: 44px; }
	.lcc-ac__clear { min-height: 44px; margin-block: -12px; }
}

/* ---------- Weekmenu-kaartje bovenaan de suggesties (review Quint B4c) ----------
   Stijl van "Menu van de week" (.wm-hero in weekmenu.css, hier gekopieerd):
   lichtblauw vlak #E1EAF3, navy #384353, witte knop met navy tekst. */
.lcc-ac__group--wm { padding: 4px 12px 8px; }
.lcc-ac-wm {
	display: grid;
	grid-template-columns: auto minmax(0, 1fr);
	align-items: center;
	gap: 10px 12px;
	padding: 14px;
	border-radius: 16px;
	background: #E1EAF3;
}
.lcc-ac-wm__icon {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	border-radius: 50%;
	background: #384353;
	color: #FFFFFF;
}
.lcc-ac-wm__icon .lcc-ac__icon { color: inherit; }
.lcc-ac-wm__title { font-size: 16px; line-height: 21px; font-weight: 700; color: #000000; }
.lcc-ac-wm__actions {
	grid-column: 1 / -1;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 4px 16px;
}
.lcc-ac__opt.lcc-ac-wm__btn {
	justify-content: center;
	min-height: 44px;
	padding: 0 22px;
	border-radius: var(--r-pill);
	background: #FFFFFF;
	color: #384353;
	font-size: 15px;
	font-weight: 600;
	text-align: center;
}
.lcc-ac__opt.lcc-ac-wm__btn:hover,
.lcc-ac__opt.lcc-ac-wm__btn.is-active { background: var(--c-soft); box-shadow: 0 0 0 2px #384353; }
.lcc-ac__opt.lcc-ac-wm__all {
	min-height: 44px;
	padding: 0 4px;
	border-radius: 8px;
	background: none;
	color: #384353;
	font-size: 15px;
	font-weight: 600;
	text-decoration: underline;
	text-underline-offset: 3px;
}
.lcc-ac__opt.lcc-ac-wm__all:hover,
.lcc-ac__opt.lcc-ac-wm__all.is-active { background: rgba(255, 255, 255, 0.6); box-shadow: inset 0 0 0 2px #384353; }
@media (max-width: 767px) {
	.lcc-ac__opt.lcc-ac-wm__btn { flex: 1 1 100%; min-height: 48px; }
	.lcc-ac__opt.lcc-ac-wm__all { margin: 0 auto; }
}
.lcc-sl .lcc-ac__group--wm { padding: 12px 16px 8px; }
.lcc-sl .lcc-ac__opt.lcc-ac-wm__btn { min-height: 48px; padding: 0 22px; }
.lcc-sl .lcc-ac__opt.lcc-ac-wm__all { min-height: 44px; padding: 0 4px; }

/* ==========================================================================
   Weekmenu-kaartje boven de zoekresultaten (/?s=weekmenu, review Quint B4b).
   Markup: lcc_search_weekmenu_card() in inc/search.php, vlak voor de balk
   "N recepten". Regels overgenomen van "Menu van de week" (.wm-hero,
   weekmenu.css): kleur, radius, navy pill-kleur, witte knop.
   ========================================================================== */
.search-wm {
	display: grid;
	grid-template-columns: auto minmax(0, 1fr);
	align-items: center;
	gap: 14px 12px;
	margin: 0 0 20px;
	padding: 16px 16px 18px;
	border-radius: 20px;
	background: #E1EAF3;
}
.search-wm__icon {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	border-radius: 50%;
	background: #384353;
	color: #FFFFFF;
}
.search-wm__icon svg { flex-shrink: 0; }
.search-wm__title {
	margin: 0;
	font-family: var(--f-sans);
	font-size: 20px;
	line-height: 1.2;
	font-weight: 700;
	text-transform: none;
	letter-spacing: normal;
	color: #000000;
}
.search-wm__actions {
	grid-column: 1 / -1;
	display: flex;
	flex-direction: column;
	align-items: stretch;
	gap: 6px;
}
.search-wm__btn.btn {
	align-self: stretch;
	min-height: 44px;
	background: #FFFFFF;
	color: var(--c-navy);
	font-size: 15px;
	font-weight: 600;
	text-align: center;
}
.search-wm__btn.btn:hover { background: var(--c-soft); }
.search-wm__all {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	align-self: center;
	min-height: 44px;
	padding: 0 8px;
	color: #384353;
	font-size: 15px;
	font-weight: 600;
	text-decoration: underline;
	text-underline-offset: 3px;
}
.search-wm__all:hover { color: #000000; }

/* Tablet en smalle desktop: titel naast het icoon, knop + link eronder op één rij. */
@media (min-width: 768px) {
	.search-wm {
		gap: 16px 20px;
		margin-bottom: 28px;
		padding: 24px 28px;
		border-radius: 22px;
	}
	.search-wm__icon { width: 48px; height: 48px; }
	.search-wm__title { font-size: 22px; }
	.search-wm__actions { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 8px 20px; padding-left: 68px; }
	.search-wm__btn.btn { align-self: auto; padding: 0 28px; }
}
/* Brede desktop (kolom ≥ ± 900 px): alles op één rij. */
@media (min-width: 1360px) {
	.search-wm { grid-template-columns: auto minmax(0, 1fr) auto; }
	.search-wm__actions { grid-column: auto; justify-content: flex-end; padding-left: 0; }
}

/* ==========================================================================
   Mobiele zoeklaag (#zoeklaag, < 768 px): schermvullend, veld vast bovenaan,
   suggesties als gewone lijst tot aan het toetsenbord (--vvh uit
   visualViewport, anders 100dvh). Gebouwd door search.js.
   ========================================================================== */
html.lcc-search-lock,
html.lcc-search-lock body { overflow: hidden; overscroll-behavior: none; }

.lcc-sl {
	position: fixed;
	inset: 0 auto auto 0;
	z-index: 1000;
	width: 100%;
	max-width: none;
	height: 100vh;
	height: 100dvh;
	height: var(--vvh, 100dvh);
	max-height: none;
	margin: 0;
	padding: 0;
	border: 0;
	background: #fff;
	color: var(--c-ink);
	font-family: var(--f-sans);
	flex-direction: column;
	overflow: hidden;
	/* iOS schuift met het toetsenbord open soms de pagina omhoog: laag mee. */
	transform: translateY(var(--vvt, 0px));
}
.lcc-sl[open] { display: flex; }
.lcc-sl::backdrop { background: #fff; }

/* ---------- Balk: terug + zoekveld ---------- */
.lcc-sl__bar {
	display: flex;
	align-items: center;
	gap: 4px;
	flex-shrink: 0;
	padding: calc(8px + env(safe-area-inset-top)) 12px 8px 4px;
	border-bottom: 1px solid var(--c-border-light);
	background: #fff;
}
.lcc-sl__back { flex-shrink: 0; color: var(--c-ink); }
.lcc-sl__back .lcc-ac__icon { color: inherit; }

.search-form--layer {
	flex: 1;
	min-width: 0;
	height: 46px;
	padding: 0 4px 0 16px;
	border-color: var(--c-border);
	background: #fff;
}
.search-form--layer .search-form__input { font-size: 16px; } /* ≥ 16px: iOS zoomt niet in */
.search-form--layer .search-form__input::-webkit-search-decoration { -webkit-appearance: none; }
.search-form--layer.lcc-ac-host::after { right: 48px; }

.lcc-sl__clear {
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	width: 38px;
	height: 38px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: var(--c-placeholder);
	color: var(--c-nav);
	cursor: pointer;
	-webkit-tap-highlight-color: transparent;
}
.lcc-sl__clear[hidden] { display: none; }
.lcc-sl__clear .lcc-ac__icon { color: inherit; }

/* ---------- Lijst: vult de rest, scrolt zelf ---------- */
.lcc-sl__results {
	display: flex;
	flex-direction: column;
	flex: 1 1 auto;
	min-height: 0;
}
.lcc-sl .lcc-ac {
	position: static;
	flex: 1 1 auto;
	min-height: 0;
	width: auto;
	min-width: 0;
	max-width: none;
	max-height: none;
	padding: 0;
	overflow-y: auto;
	overscroll-behavior: contain;
	-webkit-overflow-scrolling: touch;
	border: 0;
	border-radius: 0;
	background: #fff;
	box-shadow: none;
	animation: none;
}
.lcc-sl__hint {
	margin: 0;
	padding: 20px 16px;
	font-size: 15px;
	line-height: 22px;
	color: var(--c-muted);
}
.lcc-sl .lcc-ac:not([hidden]) ~ .lcc-sl__hint { display: none; }

/* Compacte rijen, aanraakvlak ≥ 48 px. */
.lcc-sl .lcc-ac__opt { min-height: 48px; padding: 4px 16px; }
.lcc-sl .lcc-ac__opt--recipe { min-height: 64px; padding-block: 8px; }
.lcc-sl .lcc-ac__opt.lcc-ac__chip { min-height: 44px; padding: 6px 14px; }
.lcc-sl .lcc-ac__head { padding: 14px 16px 2px; }
.lcc-sl .lcc-ac__clear { min-height: 44px; margin-block: -12px; }
.lcc-sl .lcc-ac__group + .lcc-ac__group { margin-top: 6px; padding-top: 2px; }

/* "Toon alle resultaten" blijft onderaan in beeld, net boven het toetsenbord. */
.lcc-sl .lcc-ac__group--all {
	position: sticky;
	bottom: 0;
	z-index: 1;
	margin-top: 8px;
	padding-bottom: env(safe-area-inset-bottom);
	border-top: 1px solid var(--c-border-light);
	background: #fff;
}
.lcc-sl .lcc-ac__all { min-height: 52px; }

@media (prefers-reduced-motion: reduce) {
	.lcc-ac { animation: none; }
	.lcc-ac-host::after { animation: none; border-top-color: var(--c-border); border-right-color: var(--c-navy); }
	.lcc-ac-host.is-ac-loading::after { transition: none; }
}
