/*
 * CIS Mengenrechner – Karte auf der Produktseite.
 * Entwurf „Karte“ aus design-labor/cis-mengenrechner-rechner.html (27.10.2026).
 * Alles unter .cis-mr; Eingaben und Knöpfe mit Attribut-Selektor, damit Theme-Regeln
 * (WoodMart lädt Teile seines CSS erst im Seitenkörper) nicht durchschlagen.
 * Farbe: eigene aus den Einstellungen, sonst die des Themes.
 */
.cis-mr {
	--mr-akzent: var(--cis-mr-farbe, var(--wd-primary-color, var(--wp--preset--color--primary, #008e95)));
	--mr-akzent-tief: color-mix(in srgb, var(--mr-akzent) 78%, #000);
	--mr-hauch: color-mix(in srgb, var(--mr-akzent) 8%, transparent);
	--mr-hauch-2: color-mix(in srgb, var(--mr-akzent) 16%, transparent);
	--mr-text: #1f2a2b; --mr-leise: #66706f; --mr-schale: #edf2f2; --mr-feld: #f4f7f7; --mr-linie: rgba(18, 52, 54, .09);
	--mr-warn: #8a5a00; --mr-warn-bg: #fff5d9; --mr-knapp: #c98a12;
	--mr-out: cubic-bezier(.23, 1, .32, 1);
	margin: 6px 0 24px; color: var(--mr-text); font-size: 15px; line-height: 1.5; -webkit-font-smoothing: antialiased;
}
.cis-mr[hidden] { display: none; }
.cis-mr *, .cis-mr *::before, .cis-mr *::after { box-sizing: border-box; }
.cis-mr .mr-zahl, .cis-mr input { font-variant-numeric: tabular-nums; }

/* Doppelrand: Schale + Kern */
.cis-mr .mr-schale { padding: 6px; border-radius: 20px; background: var(--mr-schale); box-shadow: 0 0 0 1px rgba(18, 52, 54, .04) inset; }
.cis-mr .mr-kern { padding: 22px 22px 20px; border-radius: 15px; background: #fff; box-shadow: 0 1px 0 rgba(255, 255, 255, .9) inset, 0 1px 2px rgba(18, 52, 54, .05), 0 18px 36px -24px rgba(0, 84, 88, .35); }

/* Kopf */
.cis-mr .mr-kopfzeile { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.cis-mr .mr-marke { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px 0 8px; border-radius: 999px; background: var(--mr-hauch); color: var(--mr-akzent-tief); font-size: 10.5px; font-weight: 700; line-height: 1; letter-spacing: .14em; text-transform: uppercase; }
.cis-mr .mr-marke svg { width: 13px; height: 13px; flex: none; }
.cis-mr .mr-titel { display: block; margin: 12px 0 4px; font-size: 20px; line-height: 1.25; font-weight: 700; letter-spacing: -.01em; color: var(--mr-text); }
.cis-mr .mr-unter { margin: 0 0 18px; color: var(--mr-leise); font-size: 14px; }

/* Umschalter mit gleitendem Daumen */
.cis-mr .mr-seg { position: relative; display: inline-grid; grid-auto-flow: column; grid-auto-columns: 1fr; padding: 3px; border-radius: 999px; background: var(--mr-feld); box-shadow: 0 0 0 1px var(--mr-linie) inset; }
.cis-mr .mr-seg__daumen { position: absolute; top: 3px; bottom: 3px; left: 3px; width: calc((100% - 6px) / var(--n, 2)); border-radius: 999px; background: #fff; box-shadow: 0 1px 2px rgba(18, 52, 54, .12), 0 2px 8px -2px rgba(18, 52, 54, .12); transform: translateX(calc(100% * var(--i, 0))); transition: transform 240ms var(--mr-out); }
.cis-mr .mr-seg button[type] { position: relative; z-index: 1; height: 30px; min-height: 0; margin: 0; padding: 0 13px; border: 0; border-radius: 999px; background: transparent; color: var(--mr-leise); font-family: inherit; font-size: 12.5px; font-weight: 600; line-height: 1; letter-spacing: 0; text-transform: none; white-space: nowrap; box-shadow: none; cursor: pointer; transition: color 160ms ease; }
.cis-mr .mr-seg button[type]:hover { color: var(--mr-text); background: transparent; }
.cis-mr .mr-seg button[aria-pressed="true"] { color: var(--mr-text); }
.cis-mr .mr-seg button[type]:focus-visible { outline: 2px solid var(--mr-akzent); outline-offset: 1px; }

/* Eingabefelder: Beschriftung im Feld, große Ziffern. Einheit mit Klasse – WoodMart setzt i sonst kursiv. */
.cis-mr .mr-felder { display: flex; align-items: center; gap: 10px; }
.cis-mr .mr-feld { position: relative; flex: 1 1 0; min-width: 0; margin: 0; display: block; cursor: text; }
.cis-mr .mr-feld > span { position: absolute; top: 9px; left: 14px; font-size: 11.5px; font-weight: 600; line-height: 1.2; letter-spacing: .02em; color: var(--mr-leise); pointer-events: none; text-transform: none; }
.cis-mr .mr-feld > i.mr-einh { position: absolute; right: 14px; bottom: 12px; font-style: normal; font-size: 15px; font-weight: 500; line-height: 1; color: var(--mr-leise); pointer-events: none; }
.cis-mr .mr-feld input[type] { display: block; width: 100%; height: 60px; min-height: 0; margin: 0; padding: 22px 46px 4px 14px; border: 1px solid transparent; border-radius: 12px; background: var(--mr-feld); color: var(--mr-text); font-family: inherit; font-size: 20px; font-weight: 600; line-height: 1; box-shadow: 0 0 0 1px var(--mr-linie) inset; transition: background-color 160ms ease, box-shadow 160ms ease; }
.cis-mr .mr-feld input[type]::placeholder { color: #a9b2b1; font-weight: 500; opacity: 1; }
.cis-mr .mr-feld input[type]:hover { background: #eef3f3; }
.cis-mr .mr-feld input[type]:focus { outline: none; background: #fff; border-color: transparent; box-shadow: 0 0 0 1px var(--mr-akzent) inset, 0 0 0 4px var(--mr-hauch-2); }
.cis-mr .mr-mal { flex: none; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--mr-feld); color: var(--mr-leise); font-size: 14px; line-height: 1; }

/* Verschnitt mit eigenem Wert */
.cis-mr .mr-zusatz { display: flex; align-items: center; justify-content: space-between; gap: 10px 12px; flex-wrap: wrap; margin: 14px 0 0; }
.cis-mr .mr-zusatz__text { font-size: 13.5px; color: var(--mr-leise); }
.cis-mr .mr-zusatz__text b { color: var(--mr-text); font-weight: 600; }
.cis-mr .mr-zusatz__wahl { display: flex; align-items: center; gap: 8px; }
.cis-mr .mr-eigen { position: relative; display: block; margin: 0; }
.cis-mr .mr-eigen[hidden] { display: none; }
.cis-mr .mr-eigen input[type] { width: 76px; height: 36px; min-height: 0; margin: 0; padding: 0 26px 0 12px; border: 0; border-radius: 999px; background: #fff; color: var(--mr-text); font-family: inherit; font-size: 14px; font-weight: 600; box-shadow: 0 0 0 1px var(--mr-akzent) inset, 0 0 0 4px var(--mr-hauch-2); animation: mr-auf 200ms var(--mr-out); }
.cis-mr .mr-eigen input[type]:focus { outline: none; }
.cis-mr .mr-eigen i.mr-einh { position: absolute; right: 11px; top: 50%; transform: translateY(-50%); font-style: normal; font-size: 13px; color: var(--mr-leise); pointer-events: none; }
@keyframes mr-auf { from { opacity: 0; transform: scale(.94); } }

/* Ergebnis */
.cis-mr .mr-ergebnis { margin: 20px 0 0; padding: 18px 0 0; border-top: 1px dashed rgba(18, 52, 54, .14); }
.cis-mr .mr-leer { display: flex; align-items: center; gap: 12px; color: var(--mr-leise); font-size: 14px; }
.cis-mr .mr-leer svg { flex: none; width: 34px; height: 34px; color: #b9c6c5; }
.cis-mr .mr-summe { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; }
.cis-mr .mr-anzahl .mr-zahl { font-size: 44px; line-height: .95; font-weight: 700; letter-spacing: -.03em; color: var(--mr-akzent); }
.cis-mr .mr-anzahl .mr-einheit { font-size: 17px; font-weight: 600; color: var(--mr-text); }
.cis-mr .mr-anzahl small { display: block; margin-top: 6px; font-size: 13.5px; color: var(--mr-leise); }
.cis-mr .mr-preis { text-align: right; }
.cis-mr .mr-preis .mr-zahl { display: block; font-size: 22px; font-weight: 700; letter-spacing: -.01em; color: var(--mr-text); white-space: nowrap; }
.cis-mr .mr-preis small { font-size: 12.5px; color: var(--mr-leise); }
.cis-mr .mr-hupf { display: inline-block; animation: mr-hupf 220ms var(--mr-out); }
@keyframes mr-hupf { from { opacity: .35; transform: translateY(5px); } }

/* Deckungsbalken: Bedarf + Reserve */
.cis-mr .mr-balken { position: relative; height: 8px; margin: 16px 0 8px; border-radius: 999px; background: var(--mr-feld); overflow: hidden; box-shadow: 0 0 0 1px var(--mr-linie) inset; }
.cis-mr .mr-balken span { position: absolute; top: 0; bottom: 0; left: 0; width: 100%; transform-origin: left; transition: transform 260ms var(--mr-out); }
.cis-mr .mr-balken__bedarf { background: var(--mr-akzent); border-radius: 999px; }
.cis-mr .mr-balken__reserve { background: repeating-linear-gradient(135deg, color-mix(in srgb, var(--mr-akzent) 45%, transparent) 0 4px, color-mix(in srgb, var(--mr-akzent) 20%, transparent) 4px 8px); }
.cis-mr .mr-balken.zu-wenig .mr-balken__bedarf { background: var(--mr-knapp); }
.cis-mr .mr-legende { display: flex; justify-content: space-between; gap: 6px 12px; flex-wrap: wrap; font-size: 12.5px; color: var(--mr-leise); }
.cis-mr .mr-legende b { color: var(--mr-text); font-weight: 600; white-space: nowrap; }
.cis-mr .mr-legende i { display: inline-block; width: 8px; height: 8px; margin-right: 6px; border-radius: 2px; background: var(--mr-akzent); font-style: normal; }
.cis-mr .mr-legende i.res { background: repeating-linear-gradient(135deg, color-mix(in srgb, var(--mr-akzent) 55%, transparent) 0 2px, color-mix(in srgb, var(--mr-akzent) 20%, transparent) 2px 4px); }
.cis-mr .mr-legende i.knapp { background: var(--mr-knapp); }

/* Bestätigung, Warnung, Hand-Menge */
.cis-mr .mr-gesetzt { display: flex; align-items: center; gap: 8px; margin: 14px 0 0; padding: 9px 12px; border-radius: 10px; background: var(--mr-hauch); color: var(--mr-akzent-tief); font-size: 13.5px; font-weight: 500; }
.cis-mr .mr-gesetzt svg { flex: none; width: 16px; height: 16px; }
.cis-mr .mr-warnung { display: flex; gap: 10px; margin: 14px 0 0; padding: 12px 14px; border-radius: 10px; background: var(--mr-warn-bg); color: var(--mr-warn); font-size: 13.5px; line-height: 1.5; }
.cis-mr .mr-warnung svg { flex: none; width: 18px; height: 18px; margin-top: 1px; }
.cis-mr .mr-warnung a { color: inherit; font-weight: 700; text-decoration: underline; text-underline-offset: 2px; }
.cis-mr .mr-hand { margin: 12px 0 0; font-size: 13.5px; color: var(--mr-leise); }
.cis-mr .mr-hand b { color: var(--mr-text); }
.cis-mr .mr-hand button[type] { display: inline; height: auto; min-height: 0; margin: 0; padding: 0; border: 0; background: none; color: var(--mr-akzent-tief); font: inherit; font-weight: 600; text-transform: none; letter-spacing: 0; text-decoration: underline; text-underline-offset: 2px; box-shadow: none; cursor: pointer; }

/* Erscheinen nach der Variantenwahl */
.cis-mr:not([hidden]) { animation: mr-rein 220ms var(--mr-out); }
@keyframes mr-rein { from { opacity: 0; transform: translateY(4px); } }

/* Zugeklappt: eine Zeile, die zum Kopf der Karte wird */
.cis-mr--klapp .mr-kern { padding: 0; }
.cis-mr .mr-auf[type] { display: flex; align-items: center; gap: 14px; width: 100%; min-height: 0; height: auto; margin: 0; padding: 14px 16px; border: 0; border-radius: 15px; background: transparent; color: var(--mr-text); font-family: inherit; text-align: left; text-transform: none; letter-spacing: 0; line-height: 1.3; box-shadow: none; cursor: pointer; transition: background-color 160ms ease; }
.cis-mr .mr-auf[type]:hover { background: #fafcfc; color: var(--mr-text); }
.cis-mr .mr-auf[type]:focus-visible { outline: 2px solid var(--mr-akzent); outline-offset: -2px; }
.cis-mr .mr-auf__symbol { flex: none; width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: var(--mr-hauch); color: var(--mr-akzent-tief); }
.cis-mr .mr-auf__symbol svg { width: 17px; height: 17px; }
.cis-mr .mr-auf__text { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.cis-mr .mr-auf__frage { font-size: 16px; font-weight: 700; letter-spacing: -.005em; }
.cis-mr .mr-auf__unter { font-size: 13px; font-weight: 400; color: var(--mr-leise); }
.cis-mr .mr-auf__kurz { flex: none; display: inline-flex; align-items: center; height: 28px; padding: 0 12px; border-radius: 999px; background: var(--mr-akzent); color: #fff; font-size: 13px; font-weight: 700; white-space: nowrap; font-variant-numeric: tabular-nums; }
.cis-mr .mr-auf__kurz[hidden] { display: none; }
.cis-mr .mr-auf__pfeil { flex: none; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--mr-feld); color: var(--mr-leise); transition: transform 240ms var(--mr-out), background-color 160ms ease; }
.cis-mr .mr-auf__pfeil svg { width: 16px; height: 16px; }
.cis-mr.mr-offen .mr-auf__pfeil { transform: rotate(180deg); }
.cis-mr .mr-klapp { display: grid; grid-template-rows: 0fr; }
.cis-mr.mr-offen .mr-klapp { grid-template-rows: 1fr; }
.cis-mr .mr-klapp__innen { min-height: 0; overflow: hidden; }
.cis-mr .mr-klapp__inhalt { margin: 0 16px; padding: 16px 6px 20px; border-top: 1px solid var(--mr-linie); opacity: 0; }
.cis-mr.mr-offen .mr-klapp__inhalt { opacity: 1; }
.cis-mr.mr-bereit .mr-klapp { transition: grid-template-rows 280ms var(--mr-out); }
.cis-mr.mr-bereit .mr-klapp__inhalt { transition: opacity 200ms ease; }
.cis-mr .mr-kopfzeile--klapp { align-items: center; margin: 0 0 16px; }
.cis-mr .mr-kopfzeile--klapp .mr-unter { flex: 1 1 220px; margin: 0; }

@media (max-width: 520px) {
	.cis-mr .mr-auf[type] { padding: 12px; gap: 10px; }
	.cis-mr .mr-auf__symbol { display: none; }
	.cis-mr .mr-klapp__inhalt { margin: 0 12px; padding: 14px 0 16px; }
	.cis-mr .mr-kern { padding: 18px 16px 16px; }
	.cis-mr .mr-kopfzeile { flex-direction: column; }
	.cis-mr .mr-felder { flex-wrap: wrap; }
	.cis-mr .mr-anzahl .mr-zahl { font-size: 38px; }
	.cis-mr .mr-summe { align-items: flex-start; }
}
@media (prefers-reduced-motion: reduce) {
	.cis-mr:not([hidden]), .cis-mr .mr-hupf, .cis-mr .mr-eigen input[type] { animation: none; }
	.cis-mr .mr-seg__daumen, .cis-mr .mr-balken span, .cis-mr.mr-bereit .mr-klapp, .cis-mr.mr-bereit .mr-klapp__inhalt, .cis-mr .mr-auf__pfeil { transition: none; }
}
