/**
 * Merchado Flow — zoek-modal styling.
 * Volgt het Paper-ontwerp ("Search modal"): crème/ink palet, Inter, rust-accent.
 * States: idle / resultaten / laden (skeleton) / leeg. Mobiel = full-screen sheet.
 */

:root {
	--mfs-ink: #1D1D1B;
	--mfs-rust: #9E491D;
	--mfs-divider: #EFEEE5;
	--mfs-pill-border: #ECE7D8;
	--mfs-panel: #F7F5F0;
	--mfs-panel-2: #F4F2EB;
	--mfs-foot-bg: #FBFAF7;
	--mfs-muted: #8A8A86;
	--mfs-muted-2: #A8A39A;
	--mfs-icon: #9E948A;
	--mfs-initials: #B7AE9F;
	--mfs-card-initials: #C3BBAD;
	--mfs-font: 'Inter', system-ui, -apple-system, sans-serif;
}

html.mfs-lock {
	overflow: hidden;
}

/* ----------------------------------------------------------- overlay/modal */

.mfs-overlay {
	position: fixed;
	inset: 0;
	z-index: 100000;
	display: flex;
	align-items: flex-start;
	justify-content: center;
	padding: 10vh 20px 20px;
	background: rgba(24, 22, 20, 0.55);
	opacity: 0;
	transition: opacity 0.18s ease;
	-webkit-overflow-scrolling: touch;
}

.mfs-overlay[hidden] {
	display: none;
}

.mfs-overlay.is-open {
	opacity: 1;
}

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

/* Reset tegen theme-button/-link bleed binnen de modal. */
.mfs-overlay button {
	-webkit-appearance: none;
	appearance: none;
	box-shadow: none;
	text-transform: none;
	letter-spacing: normal;
	min-height: 0;
	margin: 0;
	font-family: var(--mfs-font);
}

.mfs-overlay a {
	box-shadow: none;
	text-decoration: none;
}

.mfs-modal {
	width: 760px;
	max-width: 100%;
	max-height: 80vh;
	display: flex;
	flex-direction: column;
	background: #fff;
	border-radius: 20px;
	overflow: hidden;
	box-shadow: 0 30px 90px rgba(0, 0, 0, 0.38);
	font-family: var(--mfs-font);
	color: var(--mfs-ink);
	transform: translateY(-8px);
	transition: transform 0.18s ease;
	-webkit-font-smoothing: antialiased;
}

.mfs-overlay.is-open .mfs-modal {
	transform: translateY(0);
}

/* ----------------------------------------------------------------- input */

.mfs-input {
	display: flex;
	align-items: center;
	gap: 14px;
	height: 68px;
	padding: 0 22px;
	flex-shrink: 0;
	border-bottom: 1px solid var(--mfs-divider);
}

.mfs-input__icon {
	display: flex;
	flex-shrink: 0;
}

.mfs-input__icon svg {
	width: 22px;
	height: 22px;
}

.mfs-input__field,
.mfs-input__field:focus,
.mfs-input__field:focus-visible,
.mfs-input__field:hover {
	flex: 1;
	min-width: 0;
	border: 0 !important;
	outline: 0 !important;
	box-shadow: none !important;
	background: transparent !important;
	border-radius: 0 !important;
	-webkit-appearance: none;
	appearance: none;
	font-family: var(--mfs-font);
	font-weight: 500;
	font-size: 18px;
	line-height: 22px;
	color: var(--mfs-ink);
	padding: 0;
}

.mfs-input__field::placeholder {
	color: var(--mfs-icon);
	font-weight: 400;
}

.mfs-input__spinner {
	display: none;
	flex-shrink: 0;
	width: 20px;
	height: 20px;
}

.mfs-input__spinner svg {
	width: 20px;
	height: 20px;
	animation: mfs-spin 0.7s linear infinite;
}

.mfs-modal.is-loading .mfs-input__spinner {
	display: block;
}

.mfs-modal.is-loading .mfs-input__clear {
	display: none;
}

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

.mfs-input__clear {
	display: none;
	align-items: center;
	justify-content: center;
	width: 24px;
	height: 24px;
	flex-shrink: 0;
	padding: 0 !important;
	border: 0 !important;
	border-radius: 50% !important;
	background: #DFDCD2 !important;
	color: #6B6A62;
	cursor: pointer;
}

.mfs-input__clear svg {
	width: 11px;
	height: 11px;
}

.mfs-input__cancel {
	display: none;
	flex-shrink: 0;
	border: 0 !important;
	background: transparent !important;
	border-radius: 0 !important;
	font-family: var(--mfs-font);
	font-weight: 500;
	font-size: 15px;
	line-height: 1.2;
	color: var(--mfs-rust) !important;
	cursor: pointer;
	padding: 0 !important;
	height: auto !important;
	width: auto !important;
}

/* ------------------------------------------------------------------ body */

.mfs-body {
	flex: 1;
	min-height: 0;
	overflow-y: auto;
	padding: 18px 14px 10px;
}

.mfs-sect {
	display: flex;
	flex-direction: column;
	margin-bottom: 18px;
}

.mfs-sect:last-child {
	margin-bottom: 0;
}

.mfs-sect__label {
	font-size: 11px;
	font-weight: 600;
	line-height: 14px;
	letter-spacing: 0.09em;
	text-transform: uppercase;
	color: var(--mfs-muted-2);
	padding: 0 10px;
	margin-bottom: 9px;
}

/* pills */

.mfs-pills {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	padding: 0 10px;
}

.mfs-pills--center {
	justify-content: center;
	padding: 0;
}

.mfs-pill {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	padding: 7px 14px;
	border-radius: 999px;
	background: var(--mfs-panel);
	border: 1px solid var(--mfs-pill-border);
	text-decoration: none;
	transition: border-color 0.12s ease, background 0.12s ease;
}

.mfs-pill__name {
	font-size: 13px;
	font-weight: 600;
	line-height: 16px;
	color: var(--mfs-ink);
}

.mfs-pill__count {
	font-size: 12px;
	line-height: 16px;
	color: var(--mfs-muted-2);
}

.mfs-pill:hover,
.mfs-pill.is-active {
	background: var(--mfs-panel-2);
	border-color: #DDD6C5;
}

/* rows (producten) */

.mfs-list {
	display: flex;
	flex-direction: column;
}

.mfs-row {
	display: flex;
	align-items: center;
	gap: 14px;
	padding: 9px 12px;
	border-radius: 13px;
	text-decoration: none;
	transition: background 0.12s ease;
}

.mfs-row:hover,
.mfs-row.is-active {
	background: var(--mfs-panel-2);
}

.mfs-thumb {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 46px;
	height: 46px;
	flex-shrink: 0;
	border-radius: 10px;
	background: var(--mfs-panel-2);
	border: 1px solid var(--mfs-pill-border);
	overflow: hidden;
}

.mfs-row:hover .mfs-thumb,
.mfs-row.is-active .mfs-thumb {
	background: #fff;
}

.mfs-thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.mfs-thumb__txt {
	font-size: 11px;
	font-weight: 700;
	color: var(--mfs-initials);
}

.mfs-row__mid {
	display: flex;
	flex-direction: column;
	gap: 2px;
	flex: 1;
	min-width: 0;
}

.mfs-row__name {
	font-size: 15px;
	font-weight: 600;
	line-height: 19px;
	color: var(--mfs-ink);
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.mfs-row__cat {
	font-size: 12.5px;
	line-height: 16px;
	color: var(--mfs-muted);
}

.mfs-row__end {
	display: flex;
	flex-direction: column;
	align-items: flex-end;
	gap: 1px;
	flex-shrink: 0;
	text-align: right;
}

.mfs-row__price {
	font-size: 15px;
	font-weight: 600;
	line-height: 19px;
	color: var(--mfs-ink);
	white-space: nowrap;
}

.mfs-row__unit {
	font-size: 11px;
	line-height: 14px;
	color: var(--mfs-muted-2);
	white-space: nowrap;
}

/* recent bekeken cards */

.mfs-recent {
	display: flex;
	gap: 12px;
	padding: 0 10px 2px;
	overflow-x: auto;
	scrollbar-width: thin;
}

.mfs-card {
	display: flex;
	flex-direction: column;
	gap: 8px;
	width: 166px;
	flex-shrink: 0;
	text-decoration: none;
}

.mfs-card .mfs-thumb {
	width: 100%;
	height: 100px;
	border-radius: 12px;
}

.mfs-card .mfs-thumb__txt {
	font-size: 15px;
}

.mfs-card__meta {
	display: flex;
	flex-direction: column;
	gap: 2px;
	padding: 0 2px;
}

.mfs-card__name {
	font-size: 13px;
	font-weight: 600;
	line-height: 16px;
	color: var(--mfs-ink);
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.mfs-card__price {
	font-size: 12px;
	line-height: 16px;
	color: var(--mfs-muted);
}

/* idle hint (geen recent/populair) */

.mfs-hint {
	padding: 40px 10px;
	text-align: center;
	font-size: 14px;
	color: var(--mfs-muted);
}

/* ----------------------------------------------------------------- footer */

.mfs-foot {
	display: flex;
	align-items: center;
	justify-content: flex-end;
	flex-shrink: 0;
	padding: 12px 22px;
	background: var(--mfs-foot-bg);
	border-top: 1px solid var(--mfs-divider);
}

.mfs-foot[hidden] {
	display: none;
}

.mfs-foot__link {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	text-decoration: none;
	font-size: 13px;
	font-weight: 600;
	color: var(--mfs-rust);
}

.mfs-foot__arrow {
	display: flex;
}

.mfs-foot__arrow svg {
	width: 15px;
	height: 15px;
}

/* ------------------------------------------------------------------ empty */

.mfs-empty {
	display: flex;
	flex-direction: column;
	align-items: center;
	padding: 44px 40px 40px;
}

.mfs-empty__icon {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 64px;
	height: 64px;
	border-radius: 50%;
	background: var(--mfs-panel);
	margin-bottom: 18px;
}

.mfs-empty__icon svg {
	width: 28px;
	height: 28px;
}

.mfs-empty__title {
	font-size: 19px;
	font-weight: 600;
	line-height: 24px;
	color: var(--mfs-ink);
	text-align: center;
}

.mfs-empty__help {
	font-size: 14px;
	line-height: 21px;
	color: #8A887E;
	text-align: center;
	max-width: 360px;
	margin-top: 7px;
}

.mfs-empty__sub {
	font-size: 11px;
	font-weight: 600;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--mfs-muted-2);
	margin-top: 30px;
	margin-bottom: 14px;
}

/* --------------------------------------------------------------- skeleton */

.mfs-skel__sect {
	margin-bottom: 24px;
}

.mfs-skel__sect:last-child {
	margin-bottom: 0;
}

.mfs-skel__label {
	display: block;
	width: 104px;
	height: 9px;
	border-radius: 5px;
	background: #ECEAE1;
	margin: 0 12px 12px;
}

.mfs-skel__label--sm {
	width: 80px;
}

.mfs-skel__pills {
	display: flex;
	gap: 10px;
	padding: 0 12px;
}

.mfs-skel__pills span {
	height: 36px;
	border-radius: 999px;
	background: #F1EFE8;
}

.mfs-skel__pills span:nth-child(1) { width: 118px; }
.mfs-skel__pills span:nth-child(2) { width: 96px; }
.mfs-skel__pills span:nth-child(3) { width: 108px; }

.mfs-skel__rows {
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.mfs-skel__row {
	display: flex;
	align-items: center;
	gap: 14px;
	padding: 9px 12px;
}

.mfs-skel__thumb {
	width: 46px;
	height: 46px;
	border-radius: 10px;
	background: #F1EFE8;
	flex-shrink: 0;
}

.mfs-skel__lines {
	display: flex;
	flex-direction: column;
	gap: 8px;
	flex: 1;
}

.mfs-skel__lines i {
	display: block;
	height: 11px;
	width: 60%;
	border-radius: 6px;
	background: #ECEAE1;
}

.mfs-skel__lines i.sm {
	height: 9px;
	width: 34%;
	background: #F1EFE8;
}

.mfs-skel__price {
	width: 58px;
	height: 11px;
	border-radius: 6px;
	background: #ECEAE1;
	flex-shrink: 0;
}

.mfs-skel__label,
.mfs-skel__pills span,
.mfs-skel__thumb,
.mfs-skel__lines i,
.mfs-skel__price {
	background-image: linear-gradient(90deg, rgba(255,255,255,0) 0%, rgba(255,255,255,0.55) 50%, rgba(255,255,255,0) 100%);
	background-repeat: no-repeat;
	background-size: 180px 100%;
	background-position: -180px 0;
	animation: mfs-shimmer 1.25s ease-in-out infinite;
}

@keyframes mfs-shimmer {
	to { background-position: calc(100% + 180px) 0; }
}

/* -------------------------------------------------------- header trigger */

/* Icoon-knop in de header, passend bij de cart-/account-iconen. */
.mfs-trigger {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	padding: 0 !important;
	margin: 0;
	border: 0 !important;
	border-radius: 50% !important;
	background: transparent !important;
	color: inherit !important;
	box-shadow: none !important;
	-webkit-appearance: none;
	appearance: none;
	cursor: pointer;
	line-height: 0;
	min-height: 0;
	margin: 0 12px 0 0 !important;
	transition: opacity 0.12s ease;
}

.mfs-trigger svg {
	width: 23px;
	height: 23px;
	display: block;
}

.mfs-trigger:hover {
	opacity: 0.6;
}

/* ---------------------------------------------------------------- mobile */

@media (max-width: 600px) {
	.mfs-overlay {
		padding: 0;
		background: #fff;
	}

	.mfs-modal {
		width: 100%;
		max-width: 100%;
		height: 100%;
		max-height: 100%;
		border-radius: 0;
		box-shadow: none;
		transform: none;
	}

	.mfs-input {
		height: auto;
		padding: max(14px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) 14px max(16px, env(safe-area-inset-left));
		gap: 12px;
	}

	.mfs-input__field {
		font-size: 16px; /* voorkomt iOS-zoom */
	}

	.mfs-input__cancel {
		display: inline-block;
		order: 5;
		flex-shrink: 0;
		max-width: 96px;
		white-space: nowrap;
		overflow: hidden;
		text-overflow: ellipsis;
	}

	.mfs-input__clear {
		order: 4;
	}

	.mfs-body {
		padding: 16px 8px 8px;
	}

	.mfs-foot {
		justify-content: center;
		padding: 16px;
		padding-bottom: max(16px, env(safe-area-inset-bottom));
	}

	.mfs-foot__link {
		font-size: 15px;
	}

	.mfs-card {
		width: 150px;
	}
}
