/* Filter-Modul: Sidebar links, Ergebnisse rechts */
.mm_filter { display: flex; align-items: flex-start; gap: 24px; margin: 20px 0; }
.mm_filter_sidebar { flex: 0 0 320px; max-width: 320px; }
.mm_filter_results { flex: 1 1 auto; min-width: 0; }

/* Filter-Bereich und Maschinenliste: KEINE festen Höhen / Scrollbalken mehr.
   Beide Spalten scrollen mit der Seite; die jeweils KÜRZERE Spalte wird per JS
   (maschinen_markt_filter.js → initStickyColumns) viewport-fixiert und „klebt",
   während die längere weiterscrollt — beim Zurückscrollen löst sie sich wieder.
   Der Ergebnis-Inhalt wird dafür in .mm_filter_results_inner gekapselt. */
.mm_filter_results_inner { min-width: 0; }

/* Sidebar — v4-Karten-Look: jede Filtergruppe = eigene Karte (weiss, abgerundet),
   Chevron rechts, „zuruecksetzen" als Vollbreite-Button unten. Container selbst
   transparent (Karten stehen auf dem Seitenhintergrund). */
.mm_filter_sidebar form { border: 0; border-radius: 0; padding: 0; background: transparent; display: flex; flex-direction: column; gap: 10px; }
.mm_f_head { order: 100; display: block; margin: 2px 0 0; }
.mm_f_head strong { display: none; }
.mm_f_reset { width: 100%; height: 40px; background: transparent; border: 1px solid #d8dce2; border-radius: 8px; padding: 0 14px; cursor: pointer; font-size: 15px; font-weight: 600; color: var(--color-accent, #e85d26); font-family: var(--font-sans);}
.mm_f_reset:hover { border-color: var(--color-accent, #e85d26); background: rgba(232,93,38,.10); }

/* ---- Reddit-artiges Separat-Scrollen der Sidebar --------------------------
   Die Sidebar klebt (position:sticky) und bekommt eine eigene, hoehenbegrenzte
   Scroll-Box (.mm_f_scrollarea) fuer die Filtergruppen. Der Reset-Button
   (.mm_f_head) liegt AUSSERHALB der Scroll-Box und bleibt unten fix sichtbar.
   Der Ergebnisbereich scrollt normal mit der Seite. Loest den fruehereren
   JS-Fix-Hack (initStickyColumns) ab, der das Scroll-Zurueckspringen verursachte. */
.mm_f_scrollarea { display: flex; flex-direction: column; gap: 10px; }
/* Karten behalten ihre natuerliche Hoehe (kein Flex-Shrink) -> der Container
   laeuft ueber und zeigt den Scrollbalken, statt die Karten zu stauchen. */
.mm_f_scrollarea > * { flex: 0 0 auto; }
/* Contao-Clearfix .block{overflow:hidden} wuerde position:sticky sonst brechen. */
.mod_article:has(.mm_filter) { overflow: visible; }

@media (min-width: 821px) {
  .mm_filter_sidebar {
    position: sticky;
    top: 117px;                               /* Header (~105px) + 12px Abstand */
    max-height: calc(100vh - 117px - 16px);
    display: flex;
    flex-direction: column;
  }
  .mm_filter_sidebar form { flex: 1 1 auto; min-height: 0; }
  /* Nur bei Ueberlauf erscheint der Scrollbalken; sonst so hoch wie der Inhalt. */
  .mm_f_scrollarea {
    flex: 1 1 auto; min-height: 0; overflow-y: auto; padding-right: 6px;
    scrollbar-width: thin; scrollbar-color: #c7ccd3 transparent;
  }
  .mm_f_scrollarea::-webkit-scrollbar { width: 8px; }
  .mm_f_scrollarea::-webkit-scrollbar-thumb { background: #c7ccd3; border-radius: 4px; }
  .mm_f_scrollarea::-webkit-scrollbar-track { background: transparent; }
  html.mm-dark .mm_f_scrollarea { scrollbar-color: #4a4b52 transparent; }
  html.mm-dark .mm_f_scrollarea::-webkit-scrollbar-thumb { background: #4a4b52; }
  /* Reset-Button: fix am unteren Rand der Sidebar, ausserhalb der Scroll-Box. */
  .mm_f_head { flex: 0 0 auto; }
}

/* ==========================================================================
   FILTER MOBIL (<= 820px): Sidebar zu, oeffnet als Overlay-Panel

   Mobil stand die komplette Facettenspalte VOR der Trefferliste. Jetzt ist sie
   ausgeblendet und wird ueber einen Button in der Ergebnisleiste eingeblendet.
   Alles haengt an html.mm-filtermobil, das maschinen_markt_filter_mobil.js erst
   nach erfolgreichem Aufbau setzt – ohne JS bleibt die Sidebar sichtbar.
   ========================================================================== */
.mm_filter_mobil_btn,
.mm_filter_mobil_kopf,
.mm_filter_mobil_fuss,
.mm_filter_mobil_overlay { display: none; }

@media (max-width: 820px) {
  /* Zugeklappt: Sidebar aus dem Fluss nehmen (nicht nur visuell verstecken,
     sonst bleibt ihr Platz im Flex-Layout reserviert). */
  html.mm-filtermobil .mm_filter_sidebar { display: none; }

  html.mm-filtermobil .mm_filter_mobil_btn {
    display: inline-flex; align-items: center; gap: 8px; cursor: pointer;
    min-height: 44px; padding: 0 16px; margin: 0 0 12px;
    border: 1px solid #d8dce2; border-radius: 10px;
    background: #fff; color: #16202e;
    font-family: var(--font-sans); font-size: 15px; font-weight: 500;
  }
  html.mm-filtermobil .mm_filter_mobil_btn[aria-expanded="true"] {
    background: var(--color-accent, #e85d26); border-color: var(--color-accent, #e85d26); color: #fff;
  }
  .mm_filter_mobil_zahl {
    min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px;
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--color-accent, #e85d26); color: #fff;
    font-size: 12px; font-weight: 700;
  }
  /* display gewinnt gegen das hidden-Attribut – ohne diese Regel bleibt bei
     null gesetzten Filtern ein leerer oranger Punkt am Button stehen. */
  .mm_filter_mobil_zahl[hidden] { display: none; }
  html.mm-filtermobil .mm_filter_mobil_btn[aria-expanded="true"] .mm_filter_mobil_zahl {
    background: #fff; color: var(--color-accent, #e85d26);
  }

  /* Geoeffnet: Panel von links, eigener Scroll, Kopf fix, Fuss fix. */
  html.mm-filtermobil .mm_filter_sidebar.is-offen {
    display: flex; flex-direction: column;
    position: fixed; z-index: 1200; inset: 0 auto 0 0;
    width: min(90vw, 380px); max-width: none; flex: none;
    padding: 0 14px 0; margin: 0;
    background: #f4f6f9; box-shadow: 0 0 40px rgba(0,0,0,.35);
  }
  html.mm-filtermobil .mm_filter_sidebar.is-offen form {
    flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 2px 2px 8px;
  }

  html.mm-filtermobil .mm_filter_mobil_kopf {
    display: flex; align-items: center; justify-content: space-between;
    flex: 0 0 auto; padding: 12px 2px 10px;
    font-size: 12px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase;
    color: #8b93a5;
  }
  .mm_filter_mobil_zu {
    display: inline-flex; align-items: center; justify-content: center;
    width: 34px; height: 34px; padding: 0; cursor: pointer;
    border: 0; border-radius: 8px; background: transparent; color: #16202e;
  }
  html.mm-filtermobil .mm_filter_mobil_fuss {
    display: block; flex: 0 0 auto; padding: 10px 2px 14px;
    border-top: 1px solid #e2e6ee; background: inherit;
  }
  .mm_filter_mobil_zeige {
    width: 100%; min-height: 46px; cursor: pointer;
    border: 0; border-radius: 10px;
    background: var(--color-accent, #e85d26); color: #fff;
    font-family: var(--font-sans); font-size: 15px; font-weight: 500;
  }
  html.mm-filtermobil .mm_filter_mobil_overlay {
    display: block; position: fixed; inset: 0; z-index: 1150;
    background: rgba(8,14,22,.55);
  }
  html.mm-filtermobil .mm_filter_mobil_overlay[hidden] { display: none; }

  /* Seite hinter dem Panel nicht mitscrollen. */
  html.mm-filter-offen, html.mm-filter-offen body { overflow: hidden; }
}

/* Filter-Button in der mobilen Header-Leiste: erscheint, sobald der Button im
   Inhalt nach oben aus dem Bild gescrollt ist (der Header selbst ist sticky).
   Optik wie Such-Icon/Burger daneben. */
.mm_hdr_filterbtn { display: none; }

@media (max-width: 820px) {
  html.mm-filtermobil .mm_hdr_filterbtn {
    position: relative;
    display: inline-flex; align-items: center; justify-content: center;
    width: 42px; height: 42px; padding: 0; cursor: pointer;
    border: 1px solid var(--hb-border, #e2e6ee); border-radius: 10px;
    background: var(--hb-surface, #fff); color: var(--hb-text, #16202e);
  }
  html.mm-filtermobil .mm_hdr_filterbtn[hidden] { display: none; }
  html.mm-filtermobil .mm_hdr_filterbtn[aria-expanded="true"] {
    background: var(--color-accent, #e85d26); border-color: var(--color-accent, #e85d26); color: #fff;
  }
  .mm_hdr_filterbtn_zahl {
    position: absolute; top: -6px; right: -6px;
    min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--color-accent, #e85d26); color: #fff;
    font-family: var(--font-sans); font-size: 11px; font-weight: 700;
    border: 2px solid var(--hb-surface, #fff);
  }
  .mm_hdr_filterbtn_zahl[hidden] { display: none; }
}

@media (max-width: 560px) {
  html.mm-filtermobil .mm_hdr_filterbtn { width: 40px; height: 40px; }
}

/* Dunkelmodus des Panels */
@media (max-width: 820px) {
  html.mm-dark.mm-filtermobil .mm_filter_mobil_btn { background: #1a2535; border-color: rgba(255,255,255,.16); color: #fff; }
  html.mm-dark.mm-filtermobil .mm_filter_sidebar.is-offen { background: #0f1923; }
  html.mm-dark .mm_filter_mobil_kopf { color: rgba(255,255,255,.45); }
  html.mm-dark .mm_filter_mobil_zu { color: #fff; }
  html.mm-dark.mm-filtermobil .mm_filter_mobil_fuss { border-top-color: rgba(255,255,255,.12); }
}

.mm_f_group { background: #fff; border: 1px solid #e6e9ee; border-radius: 8px; padding: 0; overflow: hidden; }
.mm_f_group > summary { cursor: pointer; font-weight: 600; font-size: 17px; list-style: none; padding: 14px; user-select: none; display: flex; align-items: center; justify-content: space-between; gap: 10px; color: #16202e; }
.mm_f_group > summary::-webkit-details-marker { display: none; }
.mm_f_group > summary::after { content: ''; flex: 0 0 auto; width: 9px; height: 9px; margin-top: -3px; border-right: 2.5px solid #8a94a3; border-bottom: 2.5px solid #8a94a3; transform: rotate(45deg); transition: transform .15s; }
.mm_f_group[open] > summary::after { transform: rotate(-135deg); margin-top: 2px; }
.mm_f_group > :not(summary) { padding-left: 14px; padding-right: 14px; }
.mm_f_group > :not(summary):last-child { padding-bottom: 14px; }

.mm_f_search { width: 100%; box-sizing: border-box; margin: 6px 0; padding: 5px 8px; border: 1px solid #ccc; border-radius: 4px; font-size: 13px; }
.mm_f_options { display: flex; flex-direction: column; gap: 2px; }
.mm_f_scroll { max-height: 220px; overflow-y: auto; padding-right: 4px; }
.mm_f_opt { display: flex; align-items: center; gap: 6px; font-size: 14px; padding: 2px 0; cursor: pointer; }
.mm_f_opt.hidden { display: none; }
.mm_f_lbl { flex: 1 1 auto; }
.mm_f_cnt { color: #999; font-size: 12px; padding: 1px 8px; border-radius: 10px; }
.mm_f_range { display: flex; align-items: center; gap: 8px; padding: 4px 0; }
.mm_f_year { width: 80px; padding: 5px 6px; border: 1px solid #ccc; border-radius: 4px; }

/* Baujahr: Zwei-Griff-Slider (noUiSlider) — schlanke, moderne Optik */
.mm_f_slider { margin: 16px 8px 22px; }
.mm_f_slider.noUi-target { height: 6px; border: none; border-radius: 4px; background: #e2e5ea; box-shadow: none; }
.mm_f_slider .noUi-connect { background: #e85d26; }
.mm_f_slider .noUi-handle { width: 16px; height: 16px; right: -8px; top: -5px; border: 1px solid #cfd4dc; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); cursor: grab; }
.mm_f_slider .noUi-handle::before, .mm_f_slider .noUi-handle::after { display: none; }
.mm_f_slider .noUi-handle:focus { outline: none; }
.mm_f_slider .noUi-handle.noUi-active { cursor: grabbing; box-shadow: 0 0 0 4px rgba(232, 93, 38,.2); }

/* Ergebnis-Kopf */
.mm_filter_bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 12px; padding-bottom: 8px; border-bottom: 2px solid #eee; }
.mm_filter_count { font-size: 16px; font-weight: 600; }

/* Werkzeuge rechts in der Leiste: Sortierung + Ansichts-Buttons */
.mm_filter_tools { display: flex; align-items: center; gap: 14px; }
.mm_filter_sortwrap { display: flex; align-items: center; gap: 6px; font-size: 13px; color: #555; }
.mm_filter_sort { padding: 5px 8px; border: 1px solid #ccc; border-radius: 4px; font-size: 13px; background: #fff; cursor: pointer; }

.mm_filter_views { display: inline-flex; border: 1px solid #ccc; border-radius: 6px; overflow: hidden; }
.mm_view_btn { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 32px; padding: 0; border: none; border-left: 1px solid #ddd; background: #fff; color: #888; cursor: pointer; }
.mm_view_btn:first-child { border-left: none; }
.mm_view_btn svg { fill: currentColor; }
.mm_view_btn:hover { background: #f0f0f0; color: #555; }
.mm_view_btn.is-active { background: #e85d26; color: #fff; }

/* Dunkelmodus-Button */
.mm_dark_toggle { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 32px; padding: 0; border: 1px solid #ccc; border-radius: 6px; background: #fff; color: #888; cursor: pointer; }
.mm_dark_toggle:hover { background: #f0f0f0; color: #555; }
.mm_dark_toggle svg { fill: currentColor; }
.mm_dark_toggle .mm_icon_sun { display: none; }
html.mm-dark .mm_filter .mm_dark_toggle .mm_icon_moon { display: none; }
html.mm-dark .mm_filter .mm_dark_toggle .mm_icon_sun { display: inline; }
/* Leiste mit aktiven Filtern (entfernbare Chips) */
.mm_filter_chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 14px; }
.mm_chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px 4px 7px; border: 1px solid #f6cbb3; border-radius: 16px; background: #fdeee7; color: #c04b1e; font-size: 13px; line-height: 1.5; cursor: pointer; }
.mm_chip:hover { background: #fbe0d3; border-color: #e85d26; }
.mm_chip_x { display: inline-flex; align-items: center; justify-content: center; width: 16px; height: 16px; flex: 0 0 16px; border-radius: 50%; background: #e85d26; color: #fff; font-size: 13px; line-height: 1; }
.mm_chip:hover .mm_chip_x { background: #c04b1e; }
.mm_chip_lbl { white-space: nowrap; }

/* "Zuletzt gesucht"-Button (erscheint beim frischen Aufruf, wenn gespeichert) */
.mm_filter_recent { margin: 0 0 14px; }
.mm_recent_btn { display: inline-flex; align-items: center; gap: 8px; padding: 8px 16px; border: 1px solid #e85d26; border-radius: 8px; background: #fff; color: #e85d26; font-size: 14px; font-weight: 600; cursor: pointer; }
.mm_recent_btn:hover { background: #e85d26; color: #fff; }
.mm_recent_ico { font-size: 17px; line-height: 1; }

.mm_filter_hint { color: #777; padding: 40px 20px; text-align: center; font-size: 15px; background: #fafafa; border: 1px dashed #ddd; border-radius: 8px; }
.mm_filter_loader { padding: 20px; color: #888; }

/* Karten als Flex-Grid (ueberschreibt das Float-Thirds-Layout der Liste) */
/* align-items: stretch → Karten einer Zeile bekommen gleiche Höhe; der Fuß
   (Preis + „Details ansehen") sitzt via margin-top:auto unten bündig. */
.mm_filter_results #maschinen_markt_liste { display: flex; flex-wrap: wrap; gap: 16px; align-items: stretch; }
.mm_filter_results .maschinen_markt_liste_element { float: none !important; width: calc(33.333% - 11px) !important; margin: 0 !important; box-sizing: border-box; }
.mm_filter_results .maschinen_markt_trennlinie { display: none !important; }

/* Hover-Rahmen (2px orange + Schatten) darf nicht von der naechsten Karte
   verdeckt werden — Geschwister werden spaeter gezeichnet. Beim Hover in den
   Vordergrund holen und den kompletten orangen Rahmen erzwingen (sonst
   ueberschreibt z.B. die Listen-Trennlinie den unteren Rand). */
.mm_filter_results .maschinen_markt_liste_element:hover { z-index: 5; border: 2px solid #e85d26 !important; }

/* Bilder: ganzes Bild zeigen (contain), einheitliche Hoehe, keine weissen
   Raender — Fuellflaeche in Kartenfarbe (hell; im Dark-Mode dunkel). */
.mm_filter_results .maschinen_markt_liste_img,
.mm_filter_results .maschinen_markt_liste_img figure { margin: 0 !important; line-height: 0; }
.mm_filter_results .maschinen_markt_liste_img img {
  width: 100% !important;
  height: 230px !important;
  object-fit: contain !important;
  background: #f2f2f2;
  display: block;
}

/* Preis NICHT ueber das Bild legen, sondern als Balken darunter.
   Bild-Container zuerst (order 1), Preis danach (order 2). */
.mm_filter_results .maschinen_markt_liste_daten { display: flex; flex-direction: column; }
.mm_filter_results .maschinen_markt_liste_img { order: 1; }
.mm_filter_results .preis_title {
  position: static !important;
  order: 2;
  width: auto !important;
  bottom: auto !important;
  font-size: 16px;
  padding: 8px 12px !important;
}

/* Fix: In den schmalen Filter-Karten NICHT absolut positionieren, sonst
   ueberlagert die fest bei top:135px liegende .list_deteils den Titel, wenn
   title_2 auf mehrere Zeilen umbricht. Inhalte natuerlich untereinander fliessen. */
.mm_filter_results .maschinen_markt_liste_untertitel { min-height: 0 !important; padding-bottom: 12px; }
.mm_filter_results .maschinen_markt_liste_untertitel .title_wrapper { min-height: 0 !important; }
.mm_filter_results .maschinen_markt_liste_untertitel .list_deteils {
  position: static !important; top: auto !important; min-height: 0 !important; margin-top: 10px;
}
.mm_filter_results .maschinen_markt_liste_untertitel .details_anzeigen_button { position: static !important; margin-top: 8px; padding-left: 15px; }

/* Ansicht: 2 pro Zeile */
.mm_filter_results.view-grid2 .maschinen_markt_liste_element { width: calc(50% - 8px) !important; }

/* Ansicht: Liste (eine Maschine pro Zeile) — Bild links, Text rechts */
.mm_filter_results.view-list #maschinen_markt_liste { display: block; }
.mm_filter_results.view-list .maschinen_markt_liste_element { width: 100% !important; margin-bottom: 26px !important; padding-bottom: 4px; }
/* Bild füllt die Kartenhöhe, Breite folgt dem 4:3-Verhältnis (Vorlage).
   Vorher: feste 280px Breite + img height:210px -> viel leere Fläche unter
   dem Bild. Die Basis-Regeln stehen in maschinen_markt_card.css; hier nur
   die Alt-Wrapper-Klassen, die dieselben Elemente treffen. */
.mm_filter_results.view-list .maschinen_markt_liste_element > a { display: flex; align-items: stretch; gap: 24px; }
.mm_filter_results.view-list .maschinen_markt_liste_daten { flex: 0 0 58%; width: 58%; max-width: min(58%, 600px); aspect-ratio: auto; align-self: stretch; }
.mm_filter_results.view-list .maschinen_markt_liste_untertitel { flex: 1 1 auto; min-width: 0; }
.mm_filter_results.view-list .maschinen_markt_liste_img img { height: 100% !important; }

@media (max-width: 640px) {
  .mm_filter_results.view-list .maschinen_markt_liste_element > a { flex-direction: column; gap: 10px; }
  .mm_filter_results.view-list .maschinen_markt_liste_daten { flex-basis: auto; max-width: none; width: 100%; align-self: auto; aspect-ratio: 4 / 3; }
}

@media (max-width: 1100px) {
  .mm_filter_results .maschinen_markt_liste_element { width: calc(50% - 8px) !important; }
}
@media (max-width: 820px) {
  /* align-items: stretch überschreibt das flex-start aus .mm_filter: in
     Spaltenrichtung ist die Querachse horizontal, flex-start macht die Spalten
     also nur so breit wie ihr INHALT. Die Kartenliste wurde dadurch breiter als
     der Container (383px statt 326px) und rechts abgeschnitten – sichtbar an
     halben Messwerten wie „500 m" statt „500 mm". */
  .mm_filter { flex-direction: column; align-items: stretch; }
  .mm_filter_sidebar { flex-basis: auto; max-width: none; width: 100%; }
  .mm_filter_results { width: 100%; min-width: 0; }
  .mm_filter_results .maschinen_markt_liste_element { width: 100% !important; }
}

/* ============================================================
   Dunkelmodus — nur innerhalb des Filter-Moduls (html.mm-dark .mm_filter)
   ============================================================ */
html.mm-dark .mm_filter { padding: 16px; border-radius: 10px; color: #e6e6e6; }

/* Sidebar */
html.mm-dark .mm_filter .mm_filter_sidebar form { background: transparent; border: 0; }
html.mm-dark .mm_filter .mm_f_reset { border-color: #4a4b52; color: #ff9a6b; }
html.mm-dark .mm_filter .mm_f_reset:hover { background: rgba(232,93,38,.15); border-color: #e85d26; }
html.mm-dark .mm_filter .mm_f_group { background: #1a2535; border-color: #3a3b42; }
html.mm-dark .mm_filter .mm_f_group > summary { color: #e6e6e6; }
html.mm-dark .mm_filter .mm_f_group > summary::after { border-color: #9aa0a6; }
html.mm-dark .mm_filter .mm_f_search { background: #1e1f24; border-color: #4a4b52; color: #e6e6e6; }
html.mm-dark .mm_filter .mm_f_search::placeholder { color: #7c8288; }
html.mm-dark .mm_filter .mm_f_cnt { color: #868b91; }
html.mm-dark .mm_filter .mm_f_year { background: #1e1f24; border-color: #4a4b52; color: #e6e6e6; }
html.mm-dark .mm_filter .mm_f_slider.noUi-target { background: #3a3b42; }
html.mm-dark .mm_filter .mm_f_slider .noUi-connect { background: #e85d26; }
html.mm-dark .mm_filter .mm_f_slider .noUi-handle { background: #e6e6e6; border-color: #5a5b62; box-shadow: 0 1px 3px rgba(0,0,0,.5); }
html.mm-dark .mm_filter .mm_f_slider .noUi-handle.noUi-active { box-shadow: 0 0 0 4px rgba(232, 93, 38,.35); }

/* Ergebnisleiste + Werkzeuge */
html.mm-dark .mm_filter .mm_filter_bar { border-bottom-color: #3a3b42; }
html.mm-dark .mm_filter .mm_filter_count { color: #f2f2f2; }
html.mm-dark .mm_filter .mm_filter_sortwrap { color: #b5b8bd; }
html.mm-dark .mm_filter .mm_filter_sort { background: #1a2535; border-color: #4a4b52; color: #e6e6e6; }
html.mm-dark .mm_filter .mm_filter_views { border-color: #4a4b52; }
html.mm-dark .mm_filter .mm_view_btn { background: #1a2535; color: #9aa0a6; border-left-color: #3a3b42; }
html.mm-dark .mm_filter .mm_view_btn:hover { background: #33343b; color: #d6d6d6; }
html.mm-dark .mm_filter .mm_view_btn.is-active { background: #e85d26; color: #fff; }
html.mm-dark .mm_filter .mm_dark_toggle { background: #1a2535; border-color: #4a4b52; color: #ffd45e; }
html.mm-dark .mm_filter .mm_dark_toggle:hover { background: #33343b; }

/* Hinweise / Loader */
html.mm-dark .mm_filter .mm_filter_hint { background: #1a2535; border-color: #3a3b42; color: #9aa0a6; }
html.mm-dark .mm_filter .mm_filter_loader { color: #9aa0a6; }

/* Aktive-Filter-Chips im Dunkelmodus */
html.mm-dark .mm_filter .mm_chip { background: #3a2b22; border-color: #7a4a2e; color: #ffb28f; }
html.mm-dark .mm_filter .mm_chip:hover { background: #4a3323; border-color: #e85d26; }
html.mm-dark .mm_filter .mm_chip_x { background: #e85d26; color: #fff; }
html.mm-dark .mm_filter .mm_chip:hover .mm_chip_x { background: #ff7a4d; }

/* "Zuletzt gesucht"-Button im Dunkelmodus */
html.mm-dark .mm_filter .mm_recent_btn { background: #1a2535; border-color: #e85d26; color: #ff9a6b; }
html.mm-dark .mm_filter .mm_recent_btn:hover { background: #e85d26; color: #fff; }

/* Ergebnis-Karten: dunkler Kartenhintergrund + weisse Schrift */
html.mm-dark .mm_filter .mm_filter_results .maschinen_markt_liste_element,
html.mm-dark .mm_filter .mm_filter_results .maschinen_markt_liste_element:hover { background: #1a2535 !important; box-shadow: none !important; }

html.mm-dark .mm_filter .mm_filter_results .maschinen_markt_liste_element,
html.mm-dark .mm_filter .mm_filter_results .maschinen_markt_liste_element a,
html.mm-dark .mm_filter .mm_filter_results .title_1,
html.mm-dark .mm_filter .mm_filter_results .title_2,
html.mm-dark .mm_filter .mm_filter_results .title_3,
html.mm-dark .mm_filter .mm_filter_results .kategori_title,
html.mm-dark .mm_filter .mm_filter_results .list_deteils,
html.mm-dark .mm_filter .mm_filter_results .list_deteils *,
html.mm-dark .mm_filter .mm_filter_results .list_deteils_title,
html.mm-dark .mm_filter .mm_filter_results .list_deteils_wert,
html.mm-dark .mm_filter .mm_filter_results .preis_title { color: #f0f0f0 !important; }

/* Detail-Zeilen: abwechselnde Streifen dunkel statt hellgrau */
html.mm-dark .mm_filter .mm_filter_results .maschinen_markt_liste_element ul.list_deteils li.odd { background: #30313a !important; }
html.mm-dark .mm_filter .mm_filter_results .maschinen_markt_liste_element ul.list_deteils li.even { background: transparent !important; }

html.mm-dark .mm_filter .mm_filter_results .maschinen_markt_liste_img img { background: #1e1f24; }
html.mm-dark .mm_filter .mm_filter_results .list_deteils { border-color: #3a3b42 !important; }
html.mm-dark .mm_filter .mm_filter_results .details_anzeigen_button { color: #ff9a6b !important; }
html.mm-dark .mm_filter .mm_filter_results.view-list .maschinen_markt_liste_element { border-bottom-color: #3a3b42; }

/* Checkboxen der Filterseite: Browser-Akzentfarbe auf Orange (statt Blau). */
.mm_filter input[type="checkbox"] { accent-color: #e85d26; }

/* "Kein Treffer" -> E-Mail-Benachrichtigung anbieten. */
.mm_notify {
    margin: 16px auto 0; max-width: 520px; text-align: center;
    padding: 20px; border: 1px dashed #e85d26; border-radius: 10px; background: #fff6f2;
}
.mm_notify_txt { margin: 0 0 14px; color: #7a3b23; font-size: 15px; }
.mm_notify_btn {
    display: inline-block; background: #e85d26; color: #fff; text-decoration: none;
    padding: 11px 22px; border-radius: 6px; font-weight: 500; font-size: 15px;
    transition: background .3s;
}
.mm_notify_btn:hover, .mm_notify_btn:focus { background: #c04b1e; color: #fff; }
html.mm-dark .mm_notify, .mm_filter.mm_dark .mm_notify { background: #23180f; border-color: #6b3a22; }
html.mm-dark .mm_notify_txt, .mm_filter.mm_dark .mm_notify_txt { color: #f0c8b4; }

/* Persistente Benachrichtigen-Leiste unter den Treffern (jede Suche → Benachrichtigung) */
.mm_filter_notify_bar {
    display: flex; align-items: center; justify-content: center; gap: 14px; flex-wrap: wrap;
    margin: 20px 0 0; padding: 14px 18px; border: 1px dashed #e85d26; border-radius: 10px; background: #fff6f2;
}
.mm_filter_notify_bar[hidden] { display: none; }
.mm_filter_notify_lbl { color: #7a3b23; font-size: 14px; }
.mm_filter_notify_btn {
    display: inline-block; background: #e85d26; color: #fff; text-decoration: none;
    padding: 10px 18px; border-radius: 6px; font-weight: 500; font-size: 14px; transition: background .2s;
}
.mm_filter_notify_btn:hover { background: #c04b1e; color: #fff; }
html.mm-dark .mm_filter_notify_bar, .mm_filter.mm_dark .mm_filter_notify_bar { background: #23180f; border-color: #6b3a22; }
html.mm-dark .mm_filter_notify_lbl, .mm_filter.mm_dark .mm_filter_notify_lbl { color: #f0c8b4; }

/* Zweistufiger Kategorie-Baum (Hauptgruppe → Unterkategorien) – Filter + KI-Filter. */
.mm_f_tree .mm_f_l1 { display: flex; align-items: flex-start; gap: 2px; }
.mm_f_toggle {
    flex: 0 0 auto; width: 20px; height: 22px; line-height: 20px; text-align: center;
    border: none; background: transparent; color: #888; cursor: pointer; font-size: 11px; padding: 0;
}
.mm_f_toggle:hover { color: #e85d26; }
.mm_f_toggle_empty { cursor: default; }
.mm_f_tree .mm_f_l1 .mm_f_opt { flex: 1 1 auto; }
/* Auswahl-Markierung bei zugeklappter Unterkategorien-Liste (Anzahl gewählter Arten). */
.mm_f_l1_mark {
    flex: 0 0 auto; align-self: center; margin-left: 4px;
    min-width: 18px; height: 18px; line-height: 18px; padding: 0 6px;
    border-radius: 9px; background: #e85d26; color: #fff;
    font-size: 11px; font-weight: 700; text-align: center; font-variant-numeric: tabular-nums;
}
.mm_f_l1_mark[hidden] { display: none; }
.mm_f_l1_hassel .mm_f_toggle { color: #e85d26; }
.mm_f_children { margin: 2px 0 4px 22px; padding-left: 8px; border-left: 1px solid #e2e2e2; }
.mm_f_opt_l2 .mm_f_lbl { font-size: 13px; color: #555; }
.mm_filter.mm_dark .mm_f_children { border-left-color: #33445f; }
.mm_filter.mm_dark .mm_f_opt_l2 .mm_f_lbl { color: #b9c2d0; }

/* Ober-/Unterkategorie-Buttons über den Treffern. */
.mm_filter_arten { margin: 0 0 16px; }
.mm_kiart_frage { font-weight: 600; color: #333; margin-bottom: 8px; }
.mm_kiart_btns { display: flex; flex-wrap: wrap; gap: 8px; }
.mm_kiart {
    border: 1px solid #ccc; background: #f7f7f7; color: #222;
    border-radius: 16px; padding: 6px 14px; cursor: pointer; font-size: 13px;
    transition: background .2s, border-color .2s, color .2s;
}
.mm_kiart:hover, .mm_kiart:focus { background: #e85d26; border-color: #e85d26; color: #fff; }
.mm_kiart.active { background: #e85d26; border-color: #e85d26; color: #fff; font-weight: 500; }
.mm_filter.mm_dark .mm_kiart_frage { color: #eee; }
.mm_filter.mm_dark .mm_kiart { background: #1a2535; color: #ddd; border-color: #33445f; }
html.mm-dark .mm_filter .mm_kiart_frage { color: #eee; }
html.mm-dark .mm_filter .mm_kiart { background: #1a2535; color: #ddd; border-color: #33445f; }

/* „Im KI-Assistenten fragen" im Hinweistext (Beratungsfrage): sitzt inline
   hinter dem Text, erbt Optik/Dark-Mode von .mm_kiart. */
.mm_kisearch_ask { margin-left: 6px; padding: 3px 12px; font-size: 12px; vertical-align: 1px; }

/* Mehrere Kategorie-Blöcke untereinander: dezente Trennung dazwischen. */
.mm_kiart_block + .mm_kiart_block { margin-top: 14px; padding-top: 14px; border-top: 1px solid #e6e6e6; }
.mm_filter.mm_dark .mm_kiart_block + .mm_kiart_block,
html.mm-dark .mm_filter .mm_kiart_block + .mm_kiart_block { border-top-color: #3a3b42; }

/* Maß-Rückfrage („Was ist mit 700 gemeint?") – nutzt .mm_kiart-Buttons */
.mm_kiklaerung { margin: 0 0 16px; }
.mm_kiklaerung_intro { color: #666; font-size: 13px; margin: 0 0 8px; }
.mm_kiklaerung_none { font-style: italic; opacity: .85; }
.mm_filter.mm_dark .mm_kiklaerung_intro { color: #9fb0c4; }
/* Mehrere Maße in einer Anfrage („x-Weg 500 y-Weg 700") = ein Block je Maß,
   gleiche Trennung wie bei den Kategorie-Blöcken darüber. */
.mm_kiklaerung_block + .mm_kiklaerung_block { margin-top: 14px; padding-top: 14px; border-top: 1px solid #e6e6e6; }
.mm_filter.mm_dark .mm_kiklaerung_block + .mm_kiklaerung_block,
html.mm-dark .mm_filter .mm_kiklaerung_block + .mm_kiklaerung_block { border-top-color: #3a3b42; }

/* Gewählte Bedingung bleibt auch im Dunkelmodus orange: die Theme-Regel für
   .mm_kiart (html.mm-dark .mm_filter .mm_kiart) ist spezifischer als
   .mm_kiart.active und hat den gewählten Zustand sonst überdeckt. Orange ist hier
   ausschließlich „gewählt" – eine zusätzliche Hervorhebung der getippten
   Bedingung sah wie eine Vorauswahl aus und ist deshalb entfallen. */
html.mm-dark .mm_filter .mm_kiart.active,
.mm_filter.mm_dark .mm_kiart.active { background: #e85d26; border-color: #e85d26; color: #fff; }

/* Maß-Angebot als Zeile: Merkmalsname als Text, dahinter =, ≤, ≥ mit
   Trefferzahl. Der Name bekommt eine feste Spalte, damit die Bedingungen
   untereinander stehen und vergleichbar bleiben. */
.mm_kiklaerung_zeilen { display: flex; flex-direction: column; gap: 6px; margin: 8px 0 10px; }
.mm_kiklaerung_zeile { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.mm_kiklaerung_zeile_lbl { flex: 0 0 auto; min-width: 240px; font-size: 13.5px; font-weight: 500; color: #16202e; }
.mm_kiklaerung_zeile_btns { display: flex; flex-wrap: wrap; gap: 6px; }
.mm_kiklaerung_zeile .mm_kiart { padding: 3px 10px; font-size: 12px; }
/* Richtung ohne Treffer: sichtbar, aber nicht anklickbar (wie die Slider-Pfeile). */
.mm_kiklaerung_zeile .mm_kiart[disabled] { opacity: .4; cursor: default; }
.mm_kiklaerung_zeile .mm_kiart[disabled]:hover { background: inherit; border-color: inherit; color: inherit; }
.mm_filter.mm_dark .mm_kiklaerung_zeile_lbl,
html.mm-dark .mm_filter .mm_kiklaerung_zeile_lbl { color: #e8eef6; }
@media (max-width: 700px) {
  .mm_kiklaerung_zeile_lbl { min-width: 0; flex: 1 1 100%; }
}

/* Verwandte Maße zum Umschalten („Durchmesser" → „Tischdurchmesser"). */
.mm_kiklaerung_alt { margin-top: 10px; }
.mm_kiklaerung_alt_lbl { display: block; font-size: 12.5px; color: #666; margin-bottom: 6px; }
.mm_filter.mm_dark .mm_kiklaerung_alt_lbl,
html.mm-dark .mm_filter .mm_kiklaerung_alt_lbl { color: #9fb0c4; }

/* Hinweis, wenn die gewählte Maschinenart ein gesuchtes Maß nicht führt
   („Durchmesser" bei Sägen): kein Filter, dafür eine Erklärung. Steht in der
   Rückfrage-Box und verschwindet mit ihr bei der nächsten Suche. */
.mm_kiklaerung_warn {
  display: flex; gap: 8px; align-items: flex-start;
  margin: 10px 0 0; padding: 10px 12px;
  font-size: 13px; line-height: 1.45; color: #6b4b1a;
  background: #fff8ec; border: 1px solid #f0d9b0; border-radius: 8px;
}
.mm_kiklaerung_warn::before { content: "⚠"; flex: 0 0 auto; font-size: 14px; line-height: 1.3; }
.mm_kiklaerung_block + .mm_kiklaerung_warn { margin-top: 14px; }
.mm_filter.mm_dark .mm_kiklaerung_warn,
html.mm-dark .mm_filter .mm_kiklaerung_warn { color: #f0cf9a; background: #2a2216; border-color: #4a3c22; }

/* === Kompakte Kategorie-Auswahl (Dropdown + dynamische Buttons) =========== */
/* Der Checkbox-Baum bleibt als Datenquelle im DOM, wird aber ausgeblendet. */
.mm_f_tree_hidden { display: none !important; }

.mm_kc_add,
.mm_kc_subadd,
.mm_kc_subreplace {
  width: 100%;
  box-sizing: border-box;
  margin: 6px 0;
  padding: 6px 8px;
  border: 1px solid #ccc;
  border-radius: 6px;
  background: #fff;
  color: #26272e;
  font-size: 13px;
  cursor: pointer;
  font-family: var(--font-sans);
}
.mm_kc_subreplace { margin: 0; }
.mm_kc_add:focus,
.mm_kc_subadd:focus,
.mm_kc_subreplace:focus { outline: none; border-color: #e85d26; }

/* margin-bottom: der letzte Chip (meist eine eingerueckte Unterkategorie)
   stiess sonst direkt an die Unterkante der Kategorie-Karte. */
.mm_kc_chips { display: flex; flex-direction: column; gap: 8px; margin: 4px 0 10px; }
.mm_kc_group { display: flex; flex-direction: column; gap: 6px; }

/* Chip = Button: Löschkreuz links, Label rechts */
.mm_kc_chip { display: flex; align-items: center; gap: 4px; border-radius: 8px; }
.mm_kc_chip_main { width: 100%; box-sizing: border-box; background: #e85d26; }
.mm_kc_chip_sub  { display: inline-flex; max-width: 100%; background: #f1f2f4; border: 1px solid #e0e2e6; }

.mm_kc_lbl {
  border: 0; background: transparent; cursor: pointer;
  flex: 1 1 auto; min-width: 0;
  padding: 7px 12px 7px 2px;
  font-size: 13px; line-height: 1.25; text-align: left;
  color: #26272e; overflow-wrap: anywhere;
}
.mm_kc_chip_main .mm_kc_lbl { color: #fff; font-weight: 500; font-family: var(--font-sans);}
.mm_kc_lbl[disabled] { cursor: default; }
.mm_kc_n { opacity: .82; font-weight: 600; }
.mm_kc_caret { opacity: .85; font-size: 11px; }

.mm_kc_del {
  border: 0; background: transparent; cursor: pointer;
  padding: 7px 2px 7px 10px;
  font-size: 16px; line-height: 1; color: #26272e;
}
.mm_kc_del:hover { color: #c04b1e; }
.mm_kc_chip_main .mm_kc_del { color: #fff; }
.mm_kc_chip_main .mm_kc_del:hover { opacity: .8; }

/* Unterkategorien eingerückt unter der Hauptkategorie */
.mm_kc_subchips { display: flex; flex-wrap: wrap; gap: 6px; padding-left: 14px; }
.mm_kc_subchips:empty { display: none; }
.mm_kc_subwrap { padding-left: 14px; }

/* Dark-Mode */
html.mm-dark .mm_filter .mm_kc_add,
html.mm-dark .mm_filter .mm_kc_subadd,
html.mm-dark .mm_filter .mm_kc_subreplace { background: #1e1f24; border-color: #4a4b52; color: #e6e6e6; }
html.mm-dark .mm_filter .mm_kc_chip_sub { background: #1a2535; border-color: #4a4b52; }
html.mm-dark .mm_filter .mm_kc_chip_sub .mm_kc_lbl,
html.mm-dark .mm_filter .mm_kc_chip_sub .mm_kc_del { color: #e6e6e6; }
