/* Ultimate Newswire Pro Max — marketplace multi-select filter controls.
   Loaded after public.css; reuses its design tokens (--unpm-*). */

/* Sort dropdown keeps the look the old single-select filters had. */
.unpm-mkt-sort {
	padding: 8px 10px;
	border: 1px solid var(--unpm-line);
	border-radius: 8px;
	background: #fff;
	font-size: 14px;
	color: var(--unpm-text);
}

/* Each facet is a <details> dropdown: a button summary + a checkbox panel. */
.unpm-mkt-facet {
	position: relative;
	flex: 0 0 auto;
}

.unpm-mkt-facet-btn {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 8px 12px;
	border: 1px solid var(--unpm-line);
	border-radius: 8px;
	background: #fff;
	font-size: 14px;
	line-height: 1.2;
	color: var(--unpm-text);
	cursor: pointer;
	white-space: nowrap;
	list-style: none;
	user-select: none;
}

/* Hide the native disclosure triangle (Safari/Chrome/Firefox). */
.unpm-mkt-facet-btn::-webkit-details-marker {
	display: none;
}
.unpm-mkt-facet-btn::marker {
	content: "";
}

.unpm-mkt-facet-btn:hover {
	border-color: var(--unpm-accent);
}

.unpm-mkt-facet-btn:focus-visible {
	outline: 2px solid var(--unpm-accent);
	outline-offset: 1px;
}

/* Highlight the button when the facet has active selections. */
.unpm-mkt-facet.is-active .unpm-mkt-facet-btn {
	border-color: var(--unpm-accent);
	background: #eef2ff;
	color: var(--unpm-accent);
	font-weight: 600;
}

.unpm-mkt-facet-caret {
	font-size: 11px;
	color: var(--unpm-muted);
	transition: transform 0.15s ease;
}
.unpm-mkt-facet.is-active .unpm-mkt-facet-caret {
	color: var(--unpm-accent);
}
.unpm-mkt-facet[open] .unpm-mkt-facet-caret {
	transform: rotate(180deg);
}

/* The checkbox panel floats below the button. */
.unpm-mkt-facet-panel {
	position: absolute;
	z-index: 20;
	top: calc(100% + 6px);
	left: 0;
	min-width: 200px;
	max-width: 280px;
	max-height: 300px;
	overflow-y: auto;
	padding: 8px;
	background: #fff;
	border: 1px solid var(--unpm-line);
	border-radius: 10px;
	box-shadow: 0 8px 24px rgba(29, 36, 51, 0.12);
}

.unpm-mkt-facet-opt {
	display: flex;
	align-items: center;
	gap: 9px;
	padding: 7px 10px;
	border-radius: 8px;
	font-size: 14px;
	color: var(--unpm-text);
	cursor: pointer;
}
.unpm-mkt-facet-opt:hover {
	background: #f3f5f9;
}

.unpm-mkt-facet-opt input[type="checkbox"] {
	margin: 0;
	flex: 0 0 auto;
}

.unpm-mkt-facet-opt span {
	flex: 1 1 auto;
}

.unpm-mkt-facet-empty {
	margin: 0;
	padding: 7px 10px;
	font-size: 13px;
}

/* No-JS fallback: the <details> panel still opens; nudge it to behave on
   small screens by letting it span the toolbar width. */
@media (max-width: 600px) {
	.unpm-mkt-facet {
		flex: 1 1 100%;
	}
	.unpm-mkt-facet-btn {
		width: 100%;
		justify-content: space-between;
	}
	.unpm-mkt-facet-panel {
		left: 0;
		right: 0;
		max-width: none;
	}
}
