/* maschenerina Wieder da – Karte „Sag mir Bescheid“ auf der Produktseite.
   Farben und Schriften kommen aus den theme.json-Variablen des maschenerina-Themes (mit Ersatzwerten für
   andere Themes). Den Nachtmodus stellt das Theme über dieselben Variablen um – hier ist nichts extra nötig. */

.mwd-karte {
	--mwd-flaeche: var(--wp--preset--color--weiss-warm, #FFFCF8);
	--mwd-feld: var(--wp--preset--color--creme, #F7F3EE);
	--mwd-rand: var(--wp--preset--color--sand, #EBE4DB);
	--mwd-rand-stark: var(--wp--preset--color--sand-dunkel, #D8CCBE);
	--mwd-akzent: var(--wp--preset--color--terracotta-dunkel, #A54A33);
	--mwd-akzent-hell: var(--wp--preset--color--terracotta, #C9684D);
	--mwd-gruen: var(--wp--preset--color--salbei-dunkel, #2F5F48);
	--mwd-gruen-hell: var(--wp--preset--color--salbei-hell, #DDE8DF);
	--mwd-fehler: var(--masche-fehler, #B3261E);
	--mwd-titel: var(--wp--preset--font-family--quicksand, inherit);
	position: relative;
	margin: 1.1rem 0 1.4rem;
	padding: 1.1rem 1.2rem 1.15rem;
	border-radius: 22px;
	background: var(--mwd-flaeche);
	border: 1px solid var(--mwd-rand);
	box-shadow: var(--wp--preset--shadow--weich, 0 6px 24px rgba(46, 42, 36, 0.06));
	color: inherit;
	scroll-margin: 6rem;
}
.mwd-karte[hidden] { display: none !important; }
.mwd-karte *, .mwd-karte *::before, .mwd-karte *::after { box-sizing: border-box; }
.mwd-karte [hidden] { display: none !important; }

/* Kopf: Glocke + Überschrift + Text */
.mwd-kopf { display: flex; gap: 0.85rem; align-items: flex-start; }
.mwd-glocke {
	flex: none; display: grid; place-items: center; width: 2.75rem; height: 2.75rem; border-radius: 50%;
	background: color-mix(in srgb, var(--mwd-akzent) 12%, var(--mwd-flaeche)); color: var(--mwd-akzent);
}
.mwd-glocke svg { width: 1.35rem; height: 1.35rem; transform-origin: 50% 14%; }
.mwd-kopf-text { min-width: 0; }
.mwd-karte .mwd-titel {
	margin: 0.15rem 0 0.25rem !important; padding: 0; font-family: var(--mwd-titel); font-size: 1.08rem !important;
	font-weight: 700; line-height: 1.3; letter-spacing: 0; text-transform: none;
}
.mwd-karte .mwd-text { margin: 0 !important; font-size: 0.92rem; line-height: 1.5; opacity: 0.82; }
.mwd-karte .mwd-auswahl { margin: 0.85rem 0 0 !important; font-size: 0.86rem; line-height: 1.4; }
.mwd-auswahl strong {
	display: inline-block; margin-left: 0.2rem; padding: 0.12rem 0.6rem; border-radius: 999px;
	background: var(--mwd-feld); border: 1px solid var(--mwd-rand); font-weight: 700;
}

/* Formular: Feld + Knopf in einer Zeile */
.mwd-karte .mwd-formular { margin: 0.95rem 0 0 !important; padding: 0; }
.mwd-zeile { display: flex; gap: 0.5rem; align-items: stretch; }
.mwd-karte .mwd-email {
	flex: 1 1 auto; min-width: 0; width: 100%; min-height: 3rem; margin: 0; padding: 0.7em 1.15em;
	font: inherit; font-size: 1rem; /* ab 16px zoomt Safari am iPhone nicht hinein */ color: inherit;
	background: var(--mwd-feld); border: 1.5px solid var(--mwd-rand-stark); border-radius: 999px;
	box-shadow: none; transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}
.mwd-karte .mwd-email::placeholder { color: inherit; opacity: 0.55; }
.mwd-karte .mwd-email:focus {
	outline: none; border-color: var(--mwd-akzent); background: var(--mwd-flaeche);
	box-shadow: 0 0 0 4px color-mix(in srgb, var(--mwd-akzent-hell) 22%, transparent);
}
.mwd-karte .mwd-email[aria-invalid="true"] { border-color: var(--mwd-fehler); }
.mwd-karte .mwd-knopf { flex: none; position: relative; min-height: 3rem; margin: 0; cursor: pointer; white-space: nowrap; }
/* Ersatz für Themes ohne Knopf-Stil (Spezifität 0 – der Knopf des Themes gewinnt) */
:where(.mwd-karte .mwd-knopf) {
	padding: 0.7em 1.4em; border: 0; border-radius: 999px; background: var(--mwd-akzent); color: #fff; font: inherit; font-weight: 700;
}
.mwd-knopf span { transition: opacity 0.15s ease; }
.mwd-karte.ist-am-senden .mwd-knopf { pointer-events: none; }
.mwd-karte.ist-am-senden .mwd-knopf span { opacity: 0; }
.mwd-karte.ist-am-senden .mwd-knopf::after {
	content: ""; position: absolute; inset: 0; width: 1.2em; height: 1.2em; margin: auto; border-radius: 50%;
	border: 2px solid currentColor; border-right-color: transparent; animation: mwd-dreh 0.7s linear infinite;
}

.mwd-karte .mwd-hinweis { margin: 0.6rem 0 0 0.4rem !important; font-size: 0.78rem; line-height: 1.45; opacity: 0.72; }
.mwd-hinweis a, .mwd-zustimmung a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.mwd-karte .mwd-zustimmung { margin: 0.7rem 0 0 0.2rem !important; font-size: 0.82rem; line-height: 1.45; }
.mwd-zustimmung label { display: flex; gap: 0.5rem; align-items: flex-start; cursor: pointer; }
.mwd-zustimmung input { flex: none; width: 1.1rem; height: 1.1rem; margin: 0.12rem 0 0; accent-color: var(--mwd-akzent); }
.mwd-karte .mwd-meldung {
	margin: 0.65rem 0 0 !important; padding: 0.55rem 0.95rem; border-radius: 14px; font-size: 0.86rem; font-weight: 600; line-height: 1.4;
	color: var(--mwd-fehler); background: color-mix(in srgb, var(--mwd-fehler) 8%, var(--mwd-flaeche));
	border: 1px solid color-mix(in srgb, var(--mwd-fehler) 30%, transparent);
}
.mwd-karte .mwd-meldung.ist-gut {
	color: var(--mwd-gruen); background: color-mix(in srgb, var(--mwd-gruen) 9%, var(--mwd-flaeche));
	border-color: color-mix(in srgb, var(--mwd-gruen) 28%, transparent);
}

/* Nach dem Eintragen: Haken + Text */
.mwd-zustand {
	display: flex; gap: 0.8rem; align-items: flex-start; margin: 0.95rem 0 0; padding: 0.85rem 0.95rem; border-radius: 18px;
	background: color-mix(in srgb, var(--mwd-gruen-hell) 55%, var(--mwd-flaeche)); outline: none;
}
.mwd-haken {
	flex: none; display: grid; place-items: center; width: 2.25rem; height: 2.25rem; border-radius: 50%;
	background: var(--mwd-gruen); color: var(--mwd-flaeche);
}
.mwd-haken svg { width: 1.2rem; height: 1.2rem; }
.mwd-haken path { stroke-dasharray: 1; stroke-dashoffset: 0; }
.mwd-zustand-text { min-width: 0; font-size: 0.9rem; line-height: 1.5; }
.mwd-karte .mwd-zustand-text p { margin: 0 !important; }
.mwd-karte .mwd-zustand-kopf { margin-bottom: 0.15rem !important; font-family: var(--mwd-titel); font-size: 1rem; font-weight: 700; line-height: 1.35; }
.mwd-zustand-text strong { overflow-wrap: anywhere; }
.mwd-karte .mwd-klein { margin-top: 0.35rem !important; font-size: 0.8rem; opacity: 0.75; }
.mwd-knoepfe { display: flex; flex-wrap: wrap; gap: 0.25rem 1rem; margin-top: 0.45rem; }
.mwd-karte .mwd-austragen-form { display: inline; margin: 0 !important; }
.mwd-karte .mwd-link-knopf {
	appearance: none; min-height: 0; margin: 0; padding: 0.25rem 0; border: 0; border-radius: 0; background: none; box-shadow: none;
	color: inherit; font: inherit; font-size: 0.82rem; font-weight: 600; text-decoration: underline; text-underline-offset: 2px; cursor: pointer; opacity: 0.85;
}
.mwd-karte .mwd-link-knopf:hover { opacity: 1; }
.mwd-karte:not(.ist-bereit) [data-mwd-js] { display: none; }

/* „Schon 4 andere warten darauf“ mit drei kleinen Knäueln */
.mwd-karte .mwd-andere { display: flex; align-items: center; gap: 0.55rem; margin: 0.85rem 0 0 !important; font-size: 0.82rem; line-height: 1.35; opacity: 0.85; }
.mwd-punkte { display: inline-flex; flex: none; }
.mwd-punkte i { display: block; width: 1rem; height: 1rem; margin-left: -0.35rem; border-radius: 50%; border: 2px solid var(--mwd-flaeche); background: var(--mwd-akzent-hell); }
.mwd-punkte i:first-child { margin-left: 0; background: var(--mwd-gruen); }
.mwd-punkte i:nth-child(2) { background: var(--mwd-rand-stark); }

/* Unsichtbares für Menschen */
.mwd-falle { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }
.mwd-unsichtbar {
	position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden;
	clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0;
}

/* Variable Produkte: aufklappbare Karte (details/summary) mit eigener Auswahl */
details.mwd-karte > summary { list-style: none; cursor: pointer; border-radius: 14px; -webkit-tap-highlight-color: transparent; }
details.mwd-karte > summary::-webkit-details-marker { display: none; }
details.mwd-karte > summary::marker { content: ""; }
details.mwd-karte > summary:focus-visible { outline: 2px solid var(--mwd-akzent); outline-offset: 6px; }
details.mwd-karte:not([open]) { padding-block: 0.8rem; }
.mwd-karte--varianten .mwd-kopf { align-items: center; }
.mwd-karte--varianten .mwd-kopf-text { display: flex; flex: 1 1 auto; flex-direction: column; }
.mwd-karte--varianten .mwd-titel { margin: 0 0 0.1rem !important; font-size: 1rem !important; }
.mwd-karte--varianten .mwd-text { font-size: 0.86rem; }
.mwd-pfeil {
	flex: none; display: grid; place-items: center; width: 2rem; height: 2rem; border-radius: 50%;
	background: var(--mwd-feld); transition: rotate 0.25s ease, background-color 0.2s ease;
}
.mwd-pfeil svg { width: 1.1rem; height: 1.1rem; }
details.mwd-karte[open] > summary .mwd-pfeil { rotate: 180deg; }
.mwd-karte--varianten .mwd-inhalt { padding-top: 0.15rem; }
.mwd-karte .mwd-auswahl label { display: block; margin: 0 0 0.35rem 0.4rem; font-family: var(--mwd-titel); font-size: 0.86rem; font-weight: 700; }
.mwd-variante-feld { position: relative; display: block; }
.mwd-variante-feld::after {
	content: ""; position: absolute; top: 50%; right: 1.15rem; width: 0.55rem; height: 0.55rem; pointer-events: none;
	border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; translate: 0 -70%; rotate: 45deg; opacity: 0.7;
}
.mwd-karte .mwd-variante {
	display: block; width: 100%; min-height: 3rem; margin: 0; padding: 0.6em 2.8em 0.6em 1.15em; font: inherit; font-size: 1rem; color: inherit;
	background: var(--mwd-feld); border: 1.5px solid var(--mwd-rand-stark); border-radius: 999px; box-shadow: none;
	appearance: none; -webkit-appearance: none; cursor: pointer; transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.mwd-karte .mwd-variante:focus {
	outline: none; border-color: var(--mwd-akzent);
	box-shadow: 0 0 0 4px color-mix(in srgb, var(--mwd-akzent-hell) 22%, transparent);
}
@media (hover: hover) {
	details.mwd-karte > summary:hover .mwd-pfeil { background: var(--mwd-rand); }
}

/* Variante ausverkauft gewählt: den gesperrten Warenkorb-Knopf ausblenden, die Karte übernimmt */
.variations_form.mwd-ausverkauft .woocommerce-variation-add-to-cart { display: none !important; }

/* Schmale Karte (Handy, aber auch die schmale Produktspalte am Tablet): Knopf unter das Feld, volle Breite.
   Maßgeblich ist die Breite der Karte selbst (Container-Query), der Bildschirm nur als Ersatz für alte Browser. */
.mwd-karte { container: mwd / inline-size; }
@container mwd (max-width: 430px) {
	.mwd-zeile { flex-direction: column; }
	.mwd-karte .mwd-knopf { width: 100%; }
	.mwd-karte .mwd-hinweis { margin-left: 0.2rem !important; }
}
@supports not (container-type: inline-size) {
	@media (max-width: 480px) {
		.mwd-zeile { flex-direction: column; }
		.mwd-karte .mwd-knopf { width: 100%; }
	}
}
@media (max-width: 480px) {
	.mwd-karte { padding: 1rem 1rem 1.05rem; border-radius: 20px; }
}

/* Bewegung */
@keyframes mwd-dreh { to { rotate: 360deg; } }
@keyframes mwd-klingeln {
	0%, 100% { rotate: 0deg; } 12% { rotate: 15deg; } 26% { rotate: -13deg; } 40% { rotate: 9deg; } 54% { rotate: -6deg; } 68% { rotate: 3deg; } 82% { rotate: -1deg; }
}
@keyframes mwd-rein { from { opacity: 0; translate: 0 10px; } to { opacity: 1; translate: 0 0; } }
@keyframes mwd-plopp { 0% { scale: 0.5; opacity: 0; } 60% { scale: 1.1; opacity: 1; } 100% { scale: 1; opacity: 1; } }
@keyframes mwd-haken { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
@media (prefers-reduced-motion: no-preference) {
	.mwd-karte.klingelt .mwd-glocke svg { animation: mwd-klingeln 1.1s ease-in-out 1; }
	details.mwd-karte[open] > .mwd-inhalt { animation: mwd-rein 0.35s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
	.mwd-zustand.ist-neu { animation: mwd-rein 0.4s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
	.mwd-zustand.ist-neu .mwd-haken { animation: mwd-plopp 0.45s 0.05s cubic-bezier(0.2, 0.7, 0.2, 1.2) both; }
	.mwd-zustand.ist-neu .mwd-haken path { animation: mwd-haken 0.5s 0.3s cubic-bezier(0.6, 0, 0.2, 1) both; }
}
@media (prefers-reduced-motion: no-preference) and (hover: hover) {
	.mwd-karte:hover .mwd-glocke svg { animation: mwd-klingeln 1.1s ease-in-out 1; }
}
