/**
 * MMV Voeding Filter — frontend styles.
 *
 * Deliberately neutral: the two elements are meant to sit in an Elementor
 * layout, so they inherit the theme's typography and stretch to their column
 * rather than imposing a width or a card of their own. Colour and rounding are
 * overridden per widget from the Style tab.
 */

.mvf-search,
.mvf-filters {
	--mvf-border: #d6dbd8;
	--mvf-bg: #fff;
	--mvf-text: inherit;
	--mvf-muted: #6b7280;

	width: 100%;
}

/* ── Labels ───────────────────────────────────────────────────────────────── */

.mvf-label {
	display: block;
	margin-bottom: 6px;
	font-size: 0.85em;
	font-weight: 600;
	line-height: 1.3;
	color: var(--mvf-text);
}

/* ── Search element ───────────────────────────────────────────────────────── */

.mvf-search-row {
	display: flex;
	gap: 8px;
	align-items: stretch;
}

.mvf-search-wrap {
	position: relative;
	flex: 1 1 auto;
	min-width: 0;
}

.mvf-search-input {
	width: 100%;
	padding: 10px 14px;
	border: 1px solid var(--mvf-border);
	background: var(--mvf-bg);
	color: var(--mvf-text);
	font: inherit;
	line-height: 1.4;
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.mvf-search-input:focus {
	outline: none;
}

/* The native clear affordance duplicates the reset button and sits oddly in a
   flex row, so it is hidden in the browsers that draw one. */
.mvf-search-input::-webkit-search-decoration,
.mvf-search-input::-webkit-search-cancel-button {
	-webkit-appearance: none;
}

.mvf-search-btn {
	flex: 0 0 auto;
	padding: 10px 20px;
	border: none;
	background: #2f6f3e;
	color: #fff;
	font: inherit;
	font-weight: 600;
	line-height: 1.4;
	cursor: pointer;
	transition: filter 0.15s ease;
}

.mvf-search-btn:hover {
	filter: brightness(1.08);
}

/* ── Filter block ─────────────────────────────────────────────────────────── */

.mvf-filters-grid {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 12px;
}

.mvf-field {
	min-width: 0;
}

.mvf-select-wrap {
	position: relative;
}

.mvf-select {
	width: 100%;
	padding: 10px 34px 10px 14px;
	border: 1px solid var(--mvf-border);
	background: var(--mvf-bg);
	color: var(--mvf-text);
	font: inherit;
	line-height: 1.4;
	cursor: pointer;
	appearance: none;
	-webkit-appearance: none;
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.mvf-select:focus {
	outline: none;
}

/* Marks a dropdown that is actively narrowing the results. */
.mvf-select.is-set {
	font-weight: 600;
}

.mvf-select-arrow {
	position: absolute;
	top: 50%;
	right: 12px;
	transform: translateY(-50%);
	color: var(--mvf-muted);
	pointer-events: none;
}

.mvf-filters-footer {
	display: flex;
	justify-content: flex-end;
	margin-top: 10px;
}

.mvf-filters-footer:empty {
	display: none;
}

.mvf-reset-btn {
	padding: 7px 14px;
	border: 1px solid currentColor;
	background: transparent;
	color: #2f6f3e;
	font: inherit;
	font-size: 0.9em;
	cursor: pointer;
	transition: background-color 0.15s ease;
}

.mvf-reset-btn:hover {
	background: rgb(0 0 0 / 5%);
}

.mvf-reset-btn[hidden] {
	display: none;
}

/* ── Loading state ────────────────────────────────────────────────────────── */

.mvf-is-loading .mvf-select,
.mvf-is-loading .mvf-search-input,
.mvf-is-loading .mvf-search-btn {
	opacity: 0.65;
}

.elementor-widget.mvf-loading {
	position: relative;
	transition: opacity 0.15s ease;
	opacity: 0.5;
}

.elementor-widget.mvf-loading::after {
	content: "";
	position: absolute;
	top: 24px;
	left: 50%;
	width: 28px;
	height: 28px;
	margin-left: -14px;
	border: 3px solid rgb(0 0 0 / 15%);
	border-top-color: rgb(0 0 0 / 55%);
	border-radius: 50%;
	animation: mvf-spin 0.7s linear infinite;
}

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

@media (prefers-reduced-motion: reduce) {
	.elementor-widget.mvf-loading::after {
		animation-duration: 2.5s;
	}
}

/* ── Responsive ───────────────────────────────────────────────────────────── */

@media (max-width: 767px) {
	.mvf-search-row {
		flex-wrap: wrap;
	}

	.mvf-search-btn {
		width: 100%;
	}
}
