/*
 * CM Product Filter — kompakte Grundoptik.
 * Farben/Akzente via CSS-Variablen themebar (Defaults neutral):
 *   --cmf-ink        Textfarbe
 *   --cmf-muted      gedaempfter Text (Count)
 *   --cmf-accent     Akzent (Checkbox checked, Links)
 *   --cmf-line       Rahmenlinien
 */
.cmf {
	--cmf-ink: #222;
	--cmf-muted: #777;
	--cmf-accent: #2271b1;
	--cmf-line: #d5d5d5;
	color: var(--cmf-ink);
	font-size: 13px;
	line-height: 1.45;
}

.cmf__search input[type="text"] {
	width: 100%;
	padding: 7px 10px;
	font-size: 13px;
	border: 1px solid var(--cmf-line);
	border-radius: 0;
	background: #fff;
	color: var(--cmf-ink);
	box-sizing: border-box;
}

.cmf__orderby {
	width: 100%;
	margin-top: 8px;
	padding: 6px 8px;
	font-size: 13px;
	border: 1px solid var(--cmf-line);
	border-radius: 0;
	background: #fff;
	color: var(--cmf-ink);
	box-sizing: border-box;
}

.cmf__count {
	margin: 6px 0 0;
	font-size: 12px;
	color: var(--cmf-muted);
}

.cmf__section-title {
	margin: 14px 0 8px;
	font-weight: 600;
	color: var(--cmf-ink);
}

.cmf__list {
	list-style: none;
	margin: 0;
	padding: 0;
}
.cmf__list .cmf__list {
	padding-left: 20px;
}

.cmf__item {
	display: grid;
	grid-template-columns: auto 1fr auto;
	column-gap: 8px;
	align-items: start;
	margin: 0 0 4px;
}
.cmf__item > input[type="checkbox"],
.cmf__item > input[type="radio"] {
	appearance: none;
	-webkit-appearance: none;
	width: 14px;
	height: 14px;
	margin: 2px 0 0;
	border: 1px solid var(--cmf-line);
	border-radius: 50%;
	background: #fff;
	cursor: pointer;
	flex-shrink: 0;
}
.cmf__item > input[type="checkbox"]:checked,
.cmf__item > input[type="radio"]:checked {
	background: var(--cmf-accent);
	border-color: var(--cmf-accent);
	box-shadow: inset 0 0 0 2.5px #fff;
}
.cmf__item > label {
	grid-column: 2;
	grid-row: 1;
	cursor: pointer;
}
.cmf__item > label:hover {
	color: var(--cmf-accent);
}

/* Chevron-Toggle */
.cmf__toggle {
	grid-column: 3;
	grid-row: 1;
	width: 20px;
	height: 20px;
	display: flex;
	align-items: center;
	justify-content: center;
	background: none;
	border: 0;
	padding: 0;
	cursor: pointer;
}
.cmf__toggle::before {
	content: '';
	border: solid var(--cmf-ink);
	border-width: 0 2px 2px 0;
	padding: 3px;
	transform: rotate(45deg) translate(-1px, -1px);
	transition: transform .2s ease;
}
.cmf__item.is-open > .cmf__toggle::before {
	transform: rotate(225deg) translate(-2px, -2px);
}

/* Unterlisten: zu, bis aufgeklappt */
.cmf__item--parent > .cmf__list {
	display: none;
}
.cmf__item--parent.is-open > .cmf__list {
	display: block;
	grid-column: 2 / 4;
	grid-row: 2;
	margin-top: 4px;
}

.cmf__submit {
	margin-top: 10px;
	padding: 8px 14px;
	cursor: pointer;
}

.cmf__reset {
	display: inline-block;
	margin-top: 12px;
	font-size: 12px;
	color: var(--cmf-accent);
	text-decoration: underline;
}

/* nav-Modus: Kategorien als Links in Radio-Optik */
.cmf__item--nav {
	grid-template-columns: 1fr auto;
}
.cmf__navlink {
	grid-column: 1;
	grid-row: 1;
	display: flex;
	align-items: flex-start;
	gap: 8px;
	color: var(--cmf-ink);
	text-decoration: none;
	cursor: pointer;
}
.cmf__navlink:hover {
	color: var(--cmf-accent);
}
.cmf__item--nav > .cmf__toggle {
	grid-column: 2;
	grid-row: 1;
}
.cmf__item--nav.cmf__item--parent.is-open > .cmf__list {
	grid-column: 1 / 3;
	grid-row: 2;
}
.cmf__dot {
	width: 14px;
	height: 14px;
	margin-top: 2px;
	border: 1px solid var(--cmf-line);
	border-radius: 50%;
	background: #fff;
	flex-shrink: 0;
}
.cmf__navlink.is-active .cmf__dot {
	background: var(--cmf-accent);
	border-color: var(--cmf-accent);
	box-shadow: inset 0 0 0 2.5px #fff;
}
.cmf__navlink.is-active {
	font-weight: 600;
}

/* Theme-Link-Farben (z. B. Divi-Content-Links) nicht durchschlagen lassen */
.cmf a.cmf__navlink {
	color: var(--cmf-ink);
}
.cmf a.cmf__navlink:hover,
.cmf a.cmf__navlink.is-active {
	color: var(--cmf-accent);
}

/* -------------------------------------------------------------------------
 * Hervorgehobene Kategorien (Sale/Abverkauf)
 * Stehen am Ende der Liste (siehe CMF_Render::sort_highlighted_last) und
 * werden farblich abgesetzt. Farbe ueber --cmf-highlight themebar.
 * ---------------------------------------------------------------------- */
.cmf {
	--cmf-highlight: #b3261e;
}
.cmf__item--highlight {
	margin-top: 10px;
	padding-top: 9px;
	border-top: 1px solid var(--cmf-line);
}
.cmf__item--highlight > label,
.cmf .cmf__item--highlight > a.cmf__navlink {
	color: var(--cmf-highlight);
	font-weight: 600;
	letter-spacing: .01em;
}
.cmf__item--highlight > label:hover,
.cmf .cmf__item--highlight > a.cmf__navlink:hover,
.cmf .cmf__item--highlight > a.cmf__navlink.is-active {
	color: var(--cmf-highlight);
	text-decoration: underline;
}
.cmf__item--highlight > .cmf__navlink .cmf__dot {
	border-color: var(--cmf-highlight);
}
.cmf__item--highlight > .cmf__navlink.is-active .cmf__dot {
	background: var(--cmf-highlight);
	border-color: var(--cmf-highlight);
}
.cmf__item--highlight > input[type="checkbox"]:checked,
.cmf__item--highlight > input[type="radio"]:checked {
	background: var(--cmf-highlight);
	border-color: var(--cmf-highlight);
}
