/* Modul- und Landeseiten in zwei Spalten (DISPO-1588, includes/zweispaltig.php). Farben aus theme.json "5meter". */
.fm-ms-neu { --fm-ms-gruen: var(--wp--preset--color--secondary, #0D7F03); --fm-ms-text: var(--wp--preset--color--foreground, #104124); --fm-ms-hell: var(--wp--preset--color--fuenfm-tara, #F2FCE8); --fm-ms-rand: var(--wp--preset--color--fuenfm-celadon, #C6E6B8); }

/* Dunkelgruener Streifen rechts (Theme: body.product-template-single-product-mietomat::after), Rest des alten Mietomat */
body.fm-ms-neu::after { display: none !important; }

/* Kategorien-Leiste statt Seitenmenue (DISPO-1596): alle Kategorien als gleich breite Kacheln mit Symbol, ohne
   Scrollen; Desktop eine Reihe plus Kachel "Suchen" (blendet das Feld ein), Handy Suchfeld oben + 3er-Raster. */
.fm-ms-leiste { background: #fff; border-top: 1px solid rgba(16, 65, 36, .08); border-bottom: 1px solid rgba(16, 65, 36, .08); }
.fm-ms-leiste-innen { max-width: var(--child-max-wide-size, 1140px); margin: 0 auto; padding: 0 var(--wp--style--root--padding-right, 20px) 0 var(--wp--style--root--padding-left, 20px); }
.fm-ms-chips { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(min-content, 1fr); gap: 2px; } /* gleich breit, Wort nie zerbrochen */
.fm-ms-chip { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: 7px; margin: 0; padding: 14px 8px 14px; border: 0; background: none; font: inherit; color: #5f7a69; color: color-mix(in srgb, var(--fm-ms-text) 68%, #fff); text-decoration: none; font-weight: 600; font-size: 14px; line-height: 1.2; letter-spacing: .01em; text-align: center; cursor: pointer; transition: color .15s ease; }
.fm-ms-chip-text { display: block; text-wrap: balance; hyphens: manual; }
.fm-ms-chip::after { content: ""; position: absolute; left: 14%; right: 14%; bottom: 0; height: 3px; border-radius: 3px 3px 0 0; background: transparent; transition: background-color .15s ease; }
.fm-ms-symbol { display: block; flex: 0 0 auto; width: 26px; height: 26px; transition: transform .2s ease; }
.fm-ms-chip:hover, .fm-ms-chip:focus-visible { color: var(--fm-ms-text); }
.fm-ms-chip:hover::after { background: var(--fm-ms-rand); }
.fm-ms-chip:hover .fm-ms-symbol { transform: translateY(-2px); }
.fm-ms-chip:focus-visible { outline: 2px solid var(--fm-ms-gruen); outline-offset: -4px; border-radius: 10px; }
.fm-ms-chip:focus:not(:focus-visible) { outline: none; }
.fm-ms-chip.ist-aktiv, .fm-ms-chip.ist-aktiv:hover { color: var(--fm-ms-gruen); }
.fm-ms-chip.ist-aktiv::after { background: var(--fm-ms-gruen); }
.fm-ms-chip.ist-aktiv .fm-ms-symbol { stroke-width: 2; }
.fm-ms-kat { position: relative; display: flex; }
.fm-ms-kat > .fm-ms-chip { flex: 1 1 auto; }
.fm-ms-suchreiter[hidden], .fm-ms-suche-zu[hidden] { display: none; }

/* Aufklappmenue je Kategorie: alle Module mit Bild und Preis (Ben 16.10.). Desktop per Hover/Tastatur, Touch per
   Klasse "offen" (assets/js/leiste.js: erster Tipp oeffnet, zweiter Tipp geht auf die Kategorie). */
.fm-ms-dd { --fm-ms-dd-x: -50%; position: absolute; top: 100%; left: 50%; z-index: 5; box-sizing: border-box; width: 310px; max-width: calc(100vw - 32px); max-height: calc(100vh - var(--fm-ms-leiste-h, 100px) - 40px); overflow-y: auto; overscroll-behavior: contain; padding: 8px; background: #fff; border: 1px solid rgba(16, 65, 36, .1); border-radius: 16px; box-shadow: 0 18px 40px rgba(16, 65, 36, .16), 0 2px 6px rgba(16, 65, 36, .06); text-align: left; opacity: 0; visibility: hidden; transform: translate(var(--fm-ms-dd-x), 6px); transition: opacity .15s ease, transform .15s ease, visibility 0s linear .15s; }
.fm-ms-dd.ist-breit { width: 540px; }
.fm-ms-kat.offen > .fm-ms-dd, .fm-ms-kat:has(:focus-visible) > .fm-ms-dd { opacity: 1; visibility: visible; transform: translate(var(--fm-ms-dd-x), 0); transition: opacity .15s ease .05s, transform .15s ease .05s, visibility 0s linear .05s; }
@media (hover: hover) and (pointer: fine) {
	.fm-ms-kat:hover > .fm-ms-dd { opacity: 1; visibility: visible; transform: translate(var(--fm-ms-dd-x), 0); transition: opacity .15s ease .08s, transform .15s ease .08s, visibility 0s linear .08s; }
}
.fm-ms-kat:nth-child(-n+2) > .fm-ms-dd { left: 0; --fm-ms-dd-x: 0; }
.fm-ms-kat:nth-last-child(-n+4) > .fm-ms-dd { left: auto; right: 0; --fm-ms-dd-x: 0; }
.fm-ms-dd-liste { display: grid; gap: 2px; margin: 0; padding: 0; list-style: none; }
.fm-ms-dd.ist-breit .fm-ms-dd-liste { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.fm-ms-dd-liste li { margin: 0; padding: 0; }
.fm-ms-dd-modul { display: flex; align-items: center; gap: 12px; padding: 6px 8px; border-radius: 10px; color: var(--fm-ms-text); text-decoration: none; transition: background-color .12s ease; }
.fm-ms-dd-modul:hover, .fm-ms-dd-modul:focus-visible { background: var(--fm-ms-hell); color: var(--fm-ms-text); }
.fm-ms-dd-modul:focus-visible { outline: 2px solid var(--fm-ms-gruen); outline-offset: -2px; }
.fm-ms-dd-modul.ist-aktiv { background: var(--fm-ms-hell); box-shadow: inset 0 0 0 1px var(--fm-ms-rand); }
.fm-ms-dd-modul img, .fm-ms-dd-ohnebild { flex: 0 0 44px; width: 44px; height: 44px; margin: 0; border-radius: 8px; object-fit: cover; background: var(--fm-ms-hell); }
.fm-ms-dd-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.fm-ms-dd-name { font-weight: 600; font-size: 15px; line-height: 1.2; }
.fm-ms-dd-preis { font-size: 13px; line-height: 1.2; color: #6f8a78; }
.fm-ms-dd-alle { position: sticky; bottom: -8px; display: block; margin: 6px -8px -8px; padding: 10px 16px 12px; border-top: 1px solid rgba(16, 65, 36, .08); background: #fff; font-weight: 700; font-size: 14px; color: var(--fm-ms-gruen); text-decoration: none; }
.fm-ms-dd-alle:hover, .fm-ms-dd-alle:focus-visible { color: var(--fm-ms-gruen); text-decoration: underline; }
/* Lupe abgesetzt: weiss auf gruenem Kreis (Ben 16.10.), Kreis 32 px, ragt oben/unten 3 px ueber die 26-px-Symbolzeile */
.fm-ms-suchreiter .fm-ms-symbol { box-sizing: content-box; width: 18px; height: 18px; padding: 7px; margin: -3px 0; border-radius: 50%; background: var(--fm-ms-gruen); color: #fff; stroke-width: 2.2; transition: transform .2s ease, background-color .15s ease; }
.fm-ms-suchreiter, .fm-ms-suchreiter:hover { color: var(--fm-ms-gruen); }
.fm-ms-suchreiter:hover .fm-ms-symbol { background: var(--fm-ms-text); }

/* Desktop: Leiste bleibt beim Scrollen oben stehen (Ben 16.10.); Header-Untermenues bleiben darueber, Preis-Kasten
   klebt darunter. Hoehe kommt als --fm-ms-leiste-h aus assets/js/leiste.js. */
@media (min-width: 782px) {
	.fm-ms-leiste { position: sticky; top: var(--wp-admin--admin-bar--height, 0px); z-index: 40; transition: box-shadow .2s ease; }
	.fm-ms-leiste.klebt { box-shadow: 0 6px 18px rgba(16, 65, 36, .1); }
	body.fm-ms-neu header.wp-block-template-part { position: relative; z-index: 45; }
	.fm-ms-neu .fm-ms-kasten, .fm-ms-neu .fm-lp-kasten { top: calc(var(--fm-ms-leiste-h, 100px) + var(--wp-admin--admin-bar--height, 0px) + 20px); }
}

/* Schmaler Desktop/Tablet: zwei Reihen zu fuenf statt einer gedraengten Reihe */
@media (min-width: 782px) and (max-width: 1000px) {
	.fm-ms-chips { grid-auto-flow: row; grid-template-columns: repeat(5, minmax(min-content, 1fr)); }
	.fm-ms-chip { padding: 11px 6px; }
	.fm-ms-chip::after { display: none; }
	.fm-ms-chip.ist-aktiv { background: var(--fm-ms-hell); box-shadow: inset 0 0 0 1px var(--fm-ms-rand); border-radius: 12px; }
	.fm-ms-kat:nth-child(n) > .fm-ms-dd { left: 50%; right: auto; --fm-ms-dd-x: -50%; }
	.fm-ms-kat:nth-child(5n+1) > .fm-ms-dd { left: 0; --fm-ms-dd-x: 0; }
	.fm-ms-kat:nth-child(5n+4) > .fm-ms-dd, .fm-ms-kat:nth-child(5n) > .fm-ms-dd { left: auto; right: 0; --fm-ms-dd-x: 0; }
}

/* Suche: ohne JS unter den Kacheln, mit JS (Desktop) erst nach Klick auf "Suchen" anstelle der Kacheln */
.fm-ms-suche { display: flex; align-items: center; gap: 10px; max-width: 640px; margin: 0 auto; padding: 12px 0; }
.fm-ms-leiste.hat-js .fm-ms-suche { display: none; }
.fm-ms-leiste.hat-js.sucht .fm-ms-chips { display: none; }
.fm-ms-leiste.hat-js.sucht .fm-ms-suche { display: flex; min-height: var(--fm-ms-reihe, 92px); padding: 0; }
.fm-ms-suche .wc-search-form { flex: 1; margin: 0; }
.fm-ms-suche .wc-search-wrapper { position: relative; display: block; max-width: none; }
.fm-ms-suche .wc-search-form .wc-search-input { width: 100%; height: 48px; max-height: 48px; margin: 0; padding: 0 54px 0 20px; border: 1px solid transparent; border-radius: 999px; background: var(--fm-ms-hell); color: var(--fm-ms-text); font-size: 16px; box-shadow: none; transition: background-color .15s ease, border-color .15s ease, box-shadow .15s ease; }
.fm-ms-suche .wc-search-form .wc-search-input::placeholder { color: #6f8a78; opacity: 1; }
.fm-ms-suche .wc-search-form .wc-search-input:hover { border-color: var(--fm-ms-rand); }
.fm-ms-suche .wc-search-form .wc-search-input:focus { outline: none; background: #fff; border-color: var(--fm-ms-gruen); box-shadow: 0 0 0 4px rgba(13, 127, 3, .12); }
.fm-ms-suche .wc-search-form .wc-search-button { position: absolute; top: 6px; right: 6px; width: 36px; height: 36px; min-width: 0; padding: 0; border: 0; border-radius: 50%; font-size: 0; color: transparent; background: var(--fm-ms-gruen) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='2.4' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='6.5'/%3E%3Cpath d='M16 16l4 4'/%3E%3C/svg%3E") center / 18px no-repeat; transition: background-color .15s ease, transform .15s ease; }
.fm-ms-suche .wc-search-form .wc-search-button:hover, .fm-ms-suche .wc-search-form .wc-search-button:focus-visible { background-color: var(--fm-ms-text); transform: scale(1.05); }
.fm-ms-suche-zu { flex: 0 0 auto; display: grid; place-items: center; width: 40px; height: 40px; padding: 0; border: 0; border-radius: 50%; background: none; color: var(--fm-ms-text); cursor: pointer; }
.fm-ms-suche-zu:hover, .fm-ms-suche-zu:focus-visible { background: var(--fm-ms-hell); }

/* Zwei Spalten: Inhalt 2/3, Preis-Kasten 1/3 */
.fm-ms-kasten { position: sticky; top: 20px; margin-top: 15px; }
.fm-ms-kasten .mietomat-cta-box { max-width: none; }

/* Karten senkrecht: Landeseiten-Raster (zwei nebeneinander) und "Mehr aus ..." (vier nebeneinander) */
.fm-ms-neu .fm-lp-raster .fm-lp-karte { flex-direction: column; }
.fm-ms-neu .fm-lp-raster .fm-lp-bild { flex: 0 0 auto; max-width: none; min-height: 0; aspect-ratio: 4 / 3; }
.fm-ms-neu .fm-lp > .fm-lp-raster { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.fm-ms-weitere { margin-top: var(--wp--preset--spacing--80, 48px); }
.fm-ms-neu .fm-ms-weitere .fm-lp-raster { grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: 1em; }
.fm-ms-weitere .fm-lp-anriss { display: none; }
.fm-ms-weitere .fm-lp-name { font-size: 17px; }
.fm-ms-alle { font-weight: 700; margin: 0; }
.fm-ms-alle a { color: var(--fm-ms-gruen); text-decoration: none; }
.fm-ms-alle a:hover { text-decoration: underline; }

/* Handy: feste Leiste mit Preis und Knopf */
.fm-ms-handyleiste { display: none; }
@media (max-width: 781px) {
	/* Handy: Suchfeld immer oben, darunter alle Kacheln im 3er-Raster, aktive Kachel hell hinterlegt */
	.fm-ms-leiste-innen { display: flex; flex-direction: column; padding-top: 12px; padding-bottom: 12px; }
	.fm-ms-leiste.hat-js .fm-ms-suche, .fm-ms-leiste.hat-js.sucht .fm-ms-suche { display: flex; order: 1; min-height: 0; max-width: none; width: 100%; padding: 0 0 10px; }
	.fm-ms-suche { order: 1; max-width: none; width: 100%; padding: 0 0 10px; }
	.fm-ms-leiste.hat-js.sucht .fm-ms-chips, .fm-ms-chips { display: grid; order: 2; grid-auto-flow: row; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; }
	.fm-ms-suchreiter, .fm-ms-suche-zu { display: none !important; }
	.fm-ms-chip { min-width: 0; gap: 4px; padding: 9px 4px; border-radius: 12px; font-size: 13px; line-height: 1.15; }
	.fm-ms-chip::after { display: none; }
	.fm-ms-chip.ist-aktiv { background: var(--fm-ms-hell); box-shadow: inset 0 0 0 1px var(--fm-ms-rand); }
	.fm-ms-symbol { width: 22px; height: 22px; }
	/* Aufklappmenue ueber die ganze Breite direkt unter der getippten Kachel (statische Lage, Kachel ist Block) */
	.fm-ms-chips { position: relative; }
	.fm-ms-kat { position: static; display: block; }
	.fm-ms-kat > .fm-ms-chip { height: 100%; box-sizing: border-box; }
	.fm-ms-kat:nth-child(n) > .fm-ms-dd, .fm-ms-dd { top: auto; left: 0; right: 0; --fm-ms-dd-x: 0; width: auto; max-width: none; max-height: 62vh; margin-top: 6px; z-index: 60; }
	.fm-ms-dd.ist-breit .fm-ms-dd-liste { grid-template-columns: minmax(0, 1fr); }
	.fm-ms-kat.offen > .fm-ms-chip { background: var(--fm-ms-hell); color: var(--fm-ms-text); }
	.fm-ms-neu .fm-lp > .fm-lp-raster { grid-template-columns: minmax(0, 1fr); }
	.fm-ms-neu .fm-ms-weitere .fm-lp-raster { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
	.fm-ms-weitere .fm-lp-fakten, .fm-ms-weitere .fm-lp-mehr { display: none; }
	.fm-ms-weitere .fm-lp-inhalt { padding: 10px 12px 12px; }
	.fm-ms-handyleiste { display: flex; position: sticky; bottom: 0; z-index: 50; margin-block-start: 0 !important; align-items: center; gap: 12px; background: #fff; border-top: 1px solid var(--fm-ms-rand); padding: 10px var(--wp--style--root--padding-right, 16px) calc(10px + env(safe-area-inset-bottom, 0px)) var(--wp--style--root--padding-left, 16px); box-shadow: 0 -4px 14px rgba(16, 65, 36, .08); color: var(--fm-ms-text); }
	.fm-ms-handypreis { font-weight: 700; font-size: 19px; line-height: 1.1; }
	.fm-ms-handypreis small { display: block; font-weight: 400; font-size: 12px; opacity: .8; }
	.fm-ms-handyknopf { flex: 1; text-align: center; background: var(--wp--preset--color--links, #08A709); color: #fff; font-weight: 700; padding: 11px 10px; border-radius: 10px; text-decoration: none; }
	.fm-ms-handyknopf:hover, .fm-ms-handyknopf:focus-visible { background: var(--fm-ms-gruen); color: #fff; }
	body.fm-ms-neu .cky-btn-revisit-wrapper { bottom: calc(80px + env(safe-area-inset-bottom, 0px)) !important; } /* Cookie-Knopf ueber die Leiste */
}
