/*
 * Consent Manager – Banner, Content Blocker, Cookie-Erklärung.
 * Farben/Abstände wie styles/scss/_variables.scss und _buttons.scss; über die
 * Custom Properties an .cm, .cm-blocker, .cm-declaration anpassbar.
 */

.cm,
.cm-blocker,
.cm-declaration {
	--cm-accent: #0a9678;
	--cm-accent-light: #e1f2ef;
	--cm-text: #1a1a1a;
	--cm-muted: #6b7c75;
	--cm-border: #d4e4de;
	--cm-bg: #ffffff;
	--cm-font: "Poppins", sans-serif;
}

/* --- Dialog ------------------------------------------------------------- */

.cm[hidden] { display: none; }

.cm {
	position: fixed;
	inset: 0;
	z-index: 10000;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 16px;
	font-family: var(--cm-font);
	font-size: 14px;
	line-height: 1.5;
	color: var(--cm-text);
}

.cm *,
.cm *::before,
.cm *::after { box-sizing: border-box; }

.cm__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(10, 42, 94, 0.45);
}

.cm__dialog {
	position: relative;
	width: 100%;
	max-width: 640px;
	max-height: calc(100vh - 32px);
	max-height: calc(100dvh - 32px);
	display: flex;
	flex-direction: column;
	background: var(--cm-bg);
	border-top: 4px solid var(--cm-accent);
	box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
	outline: none;
}

.cm__view {
	display: flex;
	flex-direction: column;
	min-height: 0;
	padding: 24px 24px 16px;
}
.cm__view[hidden] { display: none; }

.cm__title {
	margin: 0 0 12px;
	font-size: 20px;
	font-weight: 600;
	line-height: 1.3;
	color: var(--cm-text);
	outline: none;
}

.cm__body {
	overflow-y: auto;
	min-height: 0;
	margin-right: -8px;
	padding-right: 8px;
}

.cm__text { margin: 0 0 16px; }

.cm__groups {
	display: flex;
	flex-wrap: wrap;
	gap: 8px 20px;
	margin: 0 0 8px;
	padding: 0;
	list-style: none;
}

.cm__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	padding-top: 16px;
	border-top: 1px solid var(--cm-border);
	margin-top: 8px;
}
.cm__actions .cm-btn { flex: 1 1 160px; }

.cm__links {
	display: flex;
	flex-wrap: wrap;
	gap: 4px 16px;
	margin: 12px 0 0;
	font-size: 12px;
}
.cm__links a,
.cm-link {
	color: var(--cm-muted);
	text-decoration: underline;
}
.cm-link {
	padding: 0;
	border: 0;
	background: none;
	font: inherit;
	cursor: pointer;
}
.cm__links a:hover,
.cm-link:hover { color: var(--cm-accent); }

.cm__id {
	margin: 16px 0 0;
	font-size: 12px;
	color: var(--cm-muted);
}
.cm__id code { word-break: break-all; }

/* --- Bedienelemente ----------------------------------------------------- */

.cm-btn {
	display: inline-block;
	padding: 8px 18px;
	border: 2px solid var(--cm-accent);
	border-radius: 0;
	font-family: var(--cm-font);
	font-size: 13px;
	font-weight: 600;
	line-height: 1.4;
	cursor: pointer;
	transition: background 0.2s, color 0.2s;
}
.cm-btn--primary { background: var(--cm-accent); color: #fff; }
.cm-btn--primary:hover { background: transparent; color: var(--cm-accent); }
.cm-btn--outline { background: transparent; color: var(--cm-accent); }
.cm-btn--outline:hover { background: var(--cm-accent); color: #fff; }
.cm-btn:focus-visible,
.cm-link:focus-visible,
.cm summary:focus-visible,
.cm-check input:focus-visible {
	outline: 2px solid var(--cm-text);
	outline-offset: 2px;
}

.cm-check {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	cursor: pointer;
	font-weight: 500;
}
.cm-check input {
	width: 18px;
	height: 18px;
	margin: 0;
	accent-color: var(--cm-accent);
	cursor: pointer;
}
.cm-check input:disabled { cursor: not-allowed; }
.cm-check--group { font-weight: 600; font-size: 15px; }

.cm-badge {
	padding: 1px 8px;
	background: var(--cm-accent-light);
	color: var(--cm-accent);
	font-size: 11px;
	font-weight: 600;
	white-space: nowrap;
}

/* --- Gruppen und Dienste ------------------------------------------------ */

.cm-group {
	padding: 14px 0;
	border-top: 1px solid var(--cm-border);
}
.cm-group__head,
.cm-service__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
}
.cm-group__text {
	margin: 6px 0 0 26px;
	color: var(--cm-muted);
	font-size: 13px;
}
.cm summary {
	cursor: pointer;
	color: var(--cm-accent);
	font-size: 13px;
	font-weight: 500;
}
.cm-group__services { margin: 8px 0 0 26px; }
.cm-service {
	margin-top: 8px;
	padding: 10px 12px;
	background: var(--cm-accent-light);
}
.cm-service__details { margin-top: 6px; }

.cm-table {
	display: grid;
	grid-template-columns: max-content 1fr;
	gap: 4px 12px;
	margin: 8px 0 0;
	font-size: 12px;
}
.cm-table dt { font-weight: 600; }
.cm-table dd { margin: 0; overflow-wrap: anywhere; }
.cm-table a { color: var(--cm-accent); }
.cm-cookies { margin: 0; padding: 0; list-style: none; }
.cm-muted { color: var(--cm-muted); }

@media (max-width: 767px) {
	.cm { padding: 8px; align-items: flex-end; }
	.cm__dialog { max-height: calc(100vh - 16px); max-height: calc(100dvh - 16px); }
	.cm__view { padding: 18px 16px 12px; }
	.cm__title { font-size: 18px; }
	.cm__actions .cm-btn { flex-basis: 100%; }
	.cm-table { grid-template-columns: 1fr; }
	.cm-table dd { margin-bottom: 4px; }
}

/* Seite hinter dem Dialog nicht scrollen. */
html.cm-is-open { overflow: hidden; }

/* --- Content Blocker ---------------------------------------------------- */

.cm-blocker {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	min-height: 220px;
	padding: 16px;
	background: var(--cm-accent-light);
	border: 1px solid var(--cm-border);
	font-family: var(--cm-font);
	font-size: 13px;
	color: var(--cm-text);
	box-sizing: border-box;
}
.cm-blocker__box { max-width: 460px; text-align: center; }
.cm-blocker__title { margin: 0 0 6px; font-weight: 600; font-size: 15px; }
.cm-blocker__text { margin: 0 0 12px; }
.cm-blocker__actions {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 8px;
	margin-bottom: 10px;
}
.cm-blocker__link { color: var(--cm-muted); font-size: 12px; }

/* --- Cookie-Erklärung --------------------------------------------------- */

.cm-declaration .cm-table { font-size: 13px; margin-bottom: 16px; }
.cm-declaration .cm-table a { color: var(--cm-accent); }

@media print {
	.cm, .cm-blocker { display: none !important; }
}
