/* ──────────────────────────────────────────────────────────────
   Nomadmenu Review Filter
   ────────────────────────────────────────────────────────────── */

/* ── CSS custom property fallbacks ───────────────────────────── */
:root {
	--nmrf-accent:        var(--once-color-primary, #1e73be);
	--nmrf-accent-light:  #e8f2fb;
	--nmrf-accent-border: #b3d4f0;
	--nmrf-text:          #333;
	--nmrf-muted:         #777;
	--nmrf-border:        #d1d5db;
	--nmrf-bg:            #fff;
	--nmrf-hover-bg:      #f5f5f5;
	--nmrf-radius:        6px;
	--nmrf-shadow:        0 4px 18px rgba(0, 0, 0, .13);
}

/* ── Form wrapper ─────────────────────────────────────────────── */
.nm-rf-form {
	margin: 0 0 24px;
}

/* ── Inner flex row ───────────────────────────────────────────── */
.nm-rf-inner {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 10px 14px;
}

/* ── Dropdowns container ──────────────────────────────────────── */
.nm-rf-dropdowns {
	display: flex;
	gap: 8px;
	flex-shrink: 0;
}

/* ── Single dropdown wrapper ──────────────────────────────────── */
.nm-rf-dd {
	position: relative;
}

/* ── Trigger button ───────────────────────────────────────────── */
.nm-rf-dd__btn {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	padding: 8px 14px;
	border: 1px solid var(--nmrf-border);
	border-radius: var(--nmrf-radius);
	background: var(--nmrf-bg);
	color: var(--nmrf-text);
	font-size: 14px;
	font-weight: 500;
	line-height: 1.4;
	cursor: pointer;
	white-space: nowrap;
	transition: border-color 0.15s, background 0.15s, color 0.15s;
	/* reset browser styles */
	font-family: inherit;
	-webkit-appearance: none;
	appearance: none;
}

.nm-rf-dd__btn:hover {
	border-color: #999;
	background: var(--nmrf-hover-bg);
}

.nm-rf-dd__btn--active {
	border-color: var(--nmrf-accent);
	color: var(--nmrf-accent);
}

.nm-rf-dd__btn[aria-expanded="true"] {
	border-color: var(--nmrf-accent);
	background: var(--nmrf-accent-light);
	color: var(--nmrf-accent);
}

/* ── Chevron icon ─────────────────────────────────────────────── */
.nm-rf-dd__arrow {
	width: 10px;
	height: 6px;
	fill: currentColor;
	flex-shrink: 0;
	transition: transform 0.2s;
}

.nm-rf-dd__btn[aria-expanded="true"] .nm-rf-dd__arrow {
	transform: rotate(180deg);
}

/* ── Dropdown panel ───────────────────────────────────────────── */
.nm-rf-dd__panel {
	position: absolute;
	top: calc(100% + 4px);
	left: 0;
	z-index: 1000;
	min-width: 230px;
	background: var(--nmrf-bg);
	border: 1px solid #e0e0e0;
	border-radius: 8px;
	box-shadow: var(--nmrf-shadow);
	overflow: hidden;
}

.nm-rf-dd__panel[hidden] {
	display: none;
}

/* ── Search field ─────────────────────────────────────────────── */
.nm-rf-dd__search-wrap {
	padding: 8px 8px 6px;
	border-bottom: 1px solid #f0f0f0;
}

.nm-rf-dd__search {
	display: block;
	width: 100%;
	padding: 6px 10px;
	border: 1px solid var(--nmrf-border);
	border-radius: 5px;
	font-size: 13px;
	font-family: inherit;
	color: var(--nmrf-text);
	background: #fff;
	outline: none;
	box-sizing: border-box;
	transition: border-color 0.15s;
}

.nm-rf-dd__search:focus {
	border-color: var(--nmrf-accent);
}

/* ── Term list ────────────────────────────────────────────────── */
.nm-rf-dd__list {
	list-style: none;
	margin: 0;
	padding: 4px 0;
	max-height: 220px;
	overflow-y: auto;
	/* smooth scroll on iOS */
	-webkit-overflow-scrolling: touch;
}

.nm-rf-dd__item {
	margin: 0;
	padding: 0;
}

.nm-rf-dd__item label {
	display: flex;
	align-items: center;
	gap: 9px;
	padding: 8px 14px;
	cursor: pointer;
	font-size: 14px;
	font-weight: normal;
	color: var(--nmrf-text);
	transition: background 0.1s;
	margin: 0;
}

.nm-rf-dd__item label:hover {
	background: var(--nmrf-hover-bg);
}

.nm-rf-dd__item input[type="checkbox"] {
	flex-shrink: 0;
	width: 15px;
	height: 15px;
	margin: 0;
	cursor: pointer;
	accent-color: var(--nmrf-accent);
}

.nm-rf-dd__item--checked label {
	color: var(--nmrf-accent);
	font-weight: 500;
}

.nm-rf-dd__item--hidden {
	display: none;
}

/* ── No-results notice ────────────────────────────────────────── */
.nm-rf-dd__no-results {
	padding: 9px 14px;
	font-size: 13px;
	color: var(--nmrf-muted);
	font-style: italic;
	display: none;
	margin: 0;
}


/* ── Chips area ───────────────────────────────────────────────── */
.nm-rf-chips {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 6px;
}

/* ── Single chip ──────────────────────────────────────────────── */
.nm-rf-chip {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	padding: 4px 8px 4px 11px;
	background: var(--nmrf-accent-light);
	border: 1px solid var(--nmrf-accent-border);
	border-radius: 20px;
	font-size: 13px;
	color: var(--nmrf-accent);
	font-weight: 500;
	line-height: 1.3;
}

.nm-rf-chip__label {
	/* ensures the text portion doesn't wrap */
	white-space: nowrap;
}

.nm-rf-chip__remove {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 16px;
	height: 16px;
	padding: 0;
	background: none;
	border: none;
	border-radius: 50%;
	font-size: 14px;
	line-height: 1;
	cursor: pointer;
	color: var(--nmrf-accent);
	opacity: 0.7;
	transition: opacity 0.1s, background 0.1s;
	font-family: inherit;
}

.nm-rf-chip__remove:hover {
	opacity: 1;
	background: rgba(0, 0, 0, .08);
}

/* ── Clear all link ───────────────────────────────────────────── */
.nm-rf-clear {
	font-size: 13px;
	color: var(--nmrf-muted);
	text-decoration: none;
	padding: 2px 0;
	border-bottom: 1px dashed currentColor;
	line-height: 1.4;
	white-space: nowrap;
	transition: color 0.15s;
}

.nm-rf-clear:hover {
	color: #c0392b;
}

/* ── Zoekbalk ─────────────────────────────────────────────────── */
.nm-rf-search-wrap {
	position: relative;
	flex-shrink: 0;
}

.nm-rf-search {
	display: block;
	box-sizing: border-box;
	width: 130px;
	padding: 8px 32px 8px 12px;
	border: 1px solid var(--nmrf-border);
	border-radius: 20px;
	background: var(--nmrf-bg);
	color: var(--nmrf-text);
	font-size: 14px;
	font-family: inherit;
	font-weight: 500;
	line-height: 1.4;
	outline: none;
	transition: width 0.35s ease, border-color 0.2s ease, padding-right 0.2s ease;
	-webkit-appearance: none;
	appearance: none;
}

.nm-rf-search::placeholder {
	color: var(--nmrf-muted);
	font-weight: normal;
}

/* Breder + accent border bij focus of gevuld; minder rechter-padding want icon verdwijnt */
.nm-rf-search:focus,
.nm-rf-search:not(:placeholder-shown) {
	width: 230px;
	padding-right: 12px;
	border-color: var(--nmrf-accent);
}

/* Icoon rechts — overlapt nooit met tekst die vanaf links loopt */
.nm-rf-search-icon {
	position: absolute;
	right: 10px;
	top: 50%;
	transform: translateY(-50%);
	width: 14px;
	height: 14px;
	fill: none;
	stroke: #aaa;
	stroke-width: 2.2;
	stroke-linecap: round;
	stroke-linejoin: round;
	pointer-events: none;
	transition: opacity 0.15s;
}

/* Verberg icoon zodra de input focus heeft of een waarde bevat */
.nm-rf-search:focus ~ .nm-rf-search-icon,
.nm-rf-search:not(:placeholder-shown) ~ .nm-rf-search-icon {
	opacity: 0;
}

/* ── Mobile: stack on narrow screens ─────────────────────────── */
@media (max-width: 600px) {
	.nm-rf-dropdowns {
		width: 100%;
	}
	.nm-rf-dd {
		flex: 1;
	}
	.nm-rf-dd__btn {
		width: 100%;
		justify-content: space-between;
	}
	.nm-rf-dd__panel {
		min-width: 0;
		width: 100%;
		left: 0;
		right: 0;
	}
	.nm-rf-search-wrap {
		width: 100%;
	}
	.nm-rf-search,
	.nm-rf-search:focus,
	.nm-rf-search:not(:placeholder-shown) {
		width: 100%;
		border-radius: var(--nmrf-radius);
	}
}
