/**
 * slice-150 (ADR-008): Gutscheinblock (geteiltes Bauteil), host-neutral.
 * Alle Regeln unter .cr-gutschein; Zustandsfarben ueber lokale Variablen, die eine Huelle in ihrem Scope
 * ueberschreibt (Overlay: dialog.cr-cart .cr-gutschein, E-11; Checkout: slice-170a). Keine Pseudoelemente an
 * Fremdklassen (.btn::before/::after sind belegt): Spinner und Icons sind Kindelemente, Fokus per outline.
 * Masse: DS Gutschein E . Ablauf 37163:5301 (Kopf/Zeile/Feld/Knopf je 48, Abstand 8).
 */
.cr-gutschein {
	--cr-gs-strong: rgba(0, 0, 0, 0.9);
	--cr-gs-weak: rgba(0, 0, 0, 0.6);
	--cr-gs-stroke: rgba(0, 0, 0, 0.45);
	--cr-gs-success: #067a57;
	--cr-gs-error: #c73a3a;
	--cr-gs-hover: rgba(0, 0, 0, 0.04);
	--cr-gs-press: rgba(0, 0, 0, 0.1);
	--cr-gs-focus: #000;
	--cr-gs-dur: 200ms;
	display: flex;
	flex-direction: column;
	gap: 8px;
	width: 100%;
	color: var(--cr-gs-strong);
	font-family: 'Grotex-Light', sans-serif;
	font-size: 16px;
	line-height: 22px;
}
.cr-gutschein[hidden], .cr-gutschein [hidden] { display: none !important; }
.cr-gutschein p { margin: 0; }
.cr-gutschein .screen-reader-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* ---------- Koepfe, Entfernen, Rueckgaengig: Knopf-Reset, Zustaende ohne Pseudoelemente ---------- */
.cr-gutschein__head, .cr-gutschein__remove, .cr-gutschein__na-remove, .cr-gutschein__undo {
	-webkit-appearance: none;
	appearance: none;
	display: flex;
	align-items: center;
	margin: 0;
	border: 0;
	background: transparent;
	color: inherit;
	font: inherit;
	text-align: left;
	cursor: pointer;
	transition: background-color var(--cr-gs-dur) ease, box-shadow var(--cr-gs-dur) ease;
}
.cr-gutschein__head { width: 100%; height: 48px; gap: 8px; padding: 0 12px; border-radius: 8px; font: 500 18px/24px 'Grotex-Medium', sans-serif; color: var(--cr-gs-strong); }
.cr-gutschein__title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cr-gutschein__plus, .cr-gutschein__chev { flex: none; width: 24px; height: 24px; }
.cr-gutschein:not(.is-plain) > .cr-gutschein__head .cr-gutschein__plus { display: none; }
.cr-gutschein__chev { transition: transform var(--cr-gs-dur) ease; }
.cr-gutschein__head[aria-expanded="true"] .cr-gutschein__chev { transform: rotate(180deg); }
.cr-gutschein__panel { display: flex; flex-direction: column; gap: 8px; }

.cr-gutschein__applied, .cr-gutschein__removed { display: flex; align-items: center; gap: 8px; min-height: 48px; }
.cr-gutschein__tick { flex: none; display: flex; align-items: center; justify-content: center; width: 24px; height: 24px; margin-left: 12px; border-radius: 4px; background: var(--cr-gs-success); }
.cr-gutschein__tick-svg { display: block; width: 18px; height: 18px; }
.cr-gutschein__code { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.cr-gutschein__amount { flex: none; font: 500 16px/22px 'Grotex-Medium', sans-serif; color: var(--cr-gs-success); white-space: nowrap; }
.cr-gutschein__remove, .cr-gutschein__na-remove { flex: none; justify-content: center; width: 48px; height: 48px; padding: 0; border-radius: 8px; }
.cr-gutschein__trash { display: block; width: 24px; height: 24px; }
.cr-gutschein .cr-gutschein__removed-text { flex: 1; min-width: 0; margin-left: 12px; color: var(--cr-gs-weak); overflow-wrap: anywhere; }
.cr-gutschein__undo { flex: none; height: 48px; padding: 0 16px; border-radius: 8px; font: 500 16px/24px 'Grotex-Medium', sans-serif; text-decoration: underline; text-decoration-thickness: 7%; text-underline-offset: 20%; }
.cr-gutschein__head:active, .cr-gutschein__remove:active, .cr-gutschein__na-remove:active, .cr-gutschein__undo:active { background: var(--cr-gs-press); box-shadow: none; transition: none; }
.cr-gutschein__head:focus-visible, .cr-gutschein__remove:focus-visible, .cr-gutschein__na-remove:focus-visible, .cr-gutschein__undo:focus-visible { outline: 2px solid var(--cr-gs-focus); outline-offset: 2px; }
.cr-gutschein [aria-disabled="true"] { cursor: progress; }
@media (hover: hover) {
	.cr-gutschein__head:hover, .cr-gutschein__remove:hover, .cr-gutschein__na-remove:hover, .cr-gutschein__undo:hover { background: var(--cr-gs-hover); box-shadow: var(--shadow-raised, 0 1px 2px rgba(0, 0, 0, 0.08)); }
	.cr-gutschein__head:active:hover, .cr-gutschein__remove:active:hover, .cr-gutschein__na-remove:active:hover, .cr-gutschein__undo:active:hover { background: var(--cr-gs-press); box-shadow: none; }
}

/* ---------- Eingabe: Fehlerzeile ueber dem Feld, Feld, Knopf ---------- */
.cr-gutschein__entry { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; }
.cr-gutschein__error { flex: 0 0 100%; display: flex; align-items: flex-start; gap: 8px; font: 400 14px/24px 'Grotex-Light', sans-serif; color: var(--cr-gs-error); }
.cr-gutschein__warn { flex: none; width: 20px; height: 20px; margin-top: 2px; }
.cr-gutschein .cr-gutschein__input {
	-webkit-appearance: none;
	appearance: none;
	flex: 1 1 0;
	min-width: 0;
	box-sizing: border-box;
	height: 48px;
	margin: 0;
	padding: 0 12px;
	border: 1px solid var(--cr-gs-stroke);
	border-radius: 8px;
	background: #fff;
	box-shadow: none;
	color: var(--cr-gs-strong);
	font: 400 16px/20px 'Grotex-Light', sans-serif; /* 16 px: kein iOS-Zoom beim Fokus */
}
.cr-gutschein .cr-gutschein__input.is-error { background: rgba(255, 74, 74, 0.05); border-color: rgba(199, 58, 58, 0.8); }
.cr-gutschein .cr-gutschein__input:focus-visible { outline: 2px solid var(--cr-gs-focus); outline-offset: 2px; }
.cr-gutschein .cr-gutschein__input[readonly] { color: var(--cr-gs-weak); }
.cr-gutschein .cr-gutschein__submit { position: relative; flex: none; }
/* D-1 (V-4, DS 37163:5311): 45-%-Kontur + Shadow/Raised statt globalem schwarzem .btn-secondary-Rand; nur im Bauteil */
.cr-gutschein .btn.cr-gutschein__submit, .cr-gutschein .btn.cr-gutschein__submit:focus { border-color: var(--cr-gs-stroke); box-shadow: var(--shadow-raised, 0 1px 2px rgba(0, 0, 0, 0.08)); }
/* slice-190: Ladezustand des Einloesen-Knopfs liefert crLoader (cr-loader.css), kein eigener Spinner mehr */
@media (prefers-reduced-motion: reduce) {
	.cr-gutschein__chev { transition: none; }
}

/* ---------- Hinweise (DS Notice Information; Werte wie .cr-cart__notice) ---------- */
.cr-gutschein__notes { display: flex; flex-direction: column; gap: 8px; }
.cr-gutschein__notes:empty { display: none; }
.cr-gutschein__notice { padding: 16px; border-radius: 12px; background: rgba(247, 247, 247, 0.9); font: 500 16px/24px 'Grotex-Medium', sans-serif; overflow-wrap: anywhere; }
/* slice-251 DE-251-1: Hinweis mit Entfernen-Knopf, einzeilig 56 px wie der Bestandshinweis (4+12+24+12+4) */
.cr-gutschein__notice--action { display: flex; align-items: center; gap: 8px; padding: 4px 4px 4px 16px; }
.cr-gutschein__notice-text { flex: 1; min-width: 0; padding: 12px 0; overflow-wrap: anywhere; }
