/* Cookie Consent Banner – DSGVO */

/* Erzwingen der Cookie-Auswahl: Seite abdunkeln und nicht bedienbar (hoher z-index gegen Theme-Overlays) */
body.cookie-consent-pending {
	pointer-events: none !important;
}

body.cookie-consent-pending #cookie-consent-banner,
body.cookie-consent-pending #cookie-consent-modal,
body.cookie-consent-pending .cookie-consent-backdrop {
	pointer-events: auto !important;
}

.cookie-consent-backdrop {
	position: fixed !important;
	top: 0 !important;
	left: 0 !important;
	right: 0 !important;
	bottom: 0 !important;
	width: 100vw !important;
	height: 100vh !important;
	inset: 0;
	z-index: 2147483646;
	background: rgba(0, 0, 0, 0.65) !important;
	pointer-events: auto;
	transition: opacity 0.25s ease;
}

.cookie-consent-backdrop[hidden] {
	display: none !important;
	visibility: hidden !important;
	pointer-events: none !important;
}

@keyframes cookie-consent-slide-in-bottom {
	from {
		opacity: 0;
		transform: translateY(100%);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

@keyframes cookie-consent-slide-in-top {
	from {
		opacity: 0;
		transform: translateY(-100%);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

.cookie-consent {
	position: fixed;
	left: 0;
	right: 0;
	min-width: 100%;
	z-index: 2147483647;
	background: var(--cc-bg, #1a1a1a);
	color: var(--cc-text, #eee);
	box-shadow: 0 -1px 0 var(--cc-border, rgba(0,0,0,0.08));
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, sans-serif;
	font-size: 15px;
	line-height: 1.5;
	animation: cookie-consent-slide-in-bottom 0.3s ease forwards;
}

.cookie-consent--bottom {
	bottom: 0;
}

.cookie-consent--top {
	top: 0;
	box-shadow: 0 4px 20px rgba(0,0,0,0.2);
	animation-name: cookie-consent-slide-in-top;
}

.cookie-consent__inner {
	width: 100%;
	min-width: 100%;
	max-width: 100%;
	margin: 0;
	padding: 1rem 1.5rem;
	display: flex;
	flex-direction: column;
	gap: 0;
	box-sizing: border-box;
}

#cookie-consent-banner .cookie-consent__heading,
.cookie-consent__heading {
	margin: 0;
	font-size: 1.125rem;
	font-weight: 600;
	color: var(--cc-text, #eee);
}

#cookie-consent-banner .cc-notice-text,
.cc-notice-text,
[data-cc-role="message"] {
	display: block !important;
	visibility: visible !important;
	margin: 0 !important;
	opacity: 0.95 !important;
	color: var(--cc-text, #eee) !important;
	font-size: 15px !important;
	line-height: 1.5 !important;
	min-height: 24px !important;
	min-width: 0 !important;
	max-width: 100% !important;
	width: auto !important;
	box-sizing: border-box !important;
}

.cookie-consent__row {
	display: flex;
	flex-wrap: nowrap;
	align-items: flex-start;
	justify-content: space-between;
	gap: 1rem;
	width: 100%;
}

.cookie-consent__content {
	flex: 1 1 0;
	min-width: 0;
	max-width: 100%;
}

.cc-notice-text a,
[data-cc-role="message"] a,
.cc-notice-text a:visited,
[data-cc-role="message"] a:visited {
	color: var(--cc-link, #7dd3fc) !important;
	text-decoration: underline !important;
}

.cc-notice-text a:hover,
[data-cc-role="message"] a:hover,
.cc-notice-text a:focus,
[data-cc-role="message"] a:focus,
.cc-notice-text a:active,
[data-cc-role="message"] a:active {
	color: var(--cc-link-hover, #bae6fd) !important;
}

.cc-notice-text a:focus,
[data-cc-role="message"] a:focus,
.cc-notice-text a:focus-visible,
[data-cc-role="message"] a:focus-visible {
	outline: none !important;
	box-shadow: none !important;
}

.cookie-consent__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem 0.75rem;
	align-items: center;
	justify-content: flex-end;
	flex-shrink: 0;
	margin-left: auto;
}

/* Mobil: Inhalt oben, Buttons darunter (volle Breite nutzen) */
@media (max-width: 768px) {
	.cookie-consent__inner {
		padding: 1rem 1rem;
		gap: 0;
	}

	.cookie-consent__row {
		flex-direction: column;
		align-items: stretch;
		gap: 1rem;
	}

	.cookie-consent__content {
		min-width: 0;
	}

	.cookie-consent__actions {
		width: 100%;
		flex-direction: column;
		align-items: stretch;
		justify-content: flex-start;
		gap: 0.5rem;
	}

	.cookie-consent__btn {
		width: 100%;
		min-width: 0;
		text-align: center;
	}
}

@media (max-width: 480px) {
	.cookie-consent__inner {
		padding: 0.875rem 0.75rem;
	}

	.cookie-consent__heading {
		font-size: 1rem;
	}

	.cc-notice-text,
	[data-cc-role="message"] {
		font-size: 0.9375rem;
	}

	.cookie-consent__btn {
		padding: 0.6rem 1rem;
	}
}

.cookie-consent__btn {
	padding: 0.5rem 1rem;
	border-radius: 4px;
	font-size: 0.9375rem;
	cursor: pointer;
	font-family: inherit;
	border: 1px solid transparent;
}
/* Keine sichtbare Focus-Umrandung (weder gestrichelt noch Ring) */
.cookie-consent__btn:focus,
.cookie-consent__btn:focus-visible {
	outline: none;
	box-shadow: none;
}

/* Einstellungen-Button: nie farbig (immer Outline-Optik) */
.cookie-consent__btn--settings {
	background: var(--cc-btn-outline-bg, #fff) !important;
	color: var(--cc-btn-outline-text, #333) !important;
	border-color: var(--cc-btn-outline-border, #e0e0e0) !important;
}
.cookie-consent__btn--settings:hover {
	background: var(--cc-btn-outline-hover-bg, #f5f5f5) !important;
	border-color: var(--cc-btn-outline-hover-border, #ccc) !important;
	color: var(--cc-btn-outline-hover-text, #333) !important;
}

.cookie-consent__btn--primary {
	background: var(--cc-btn-primary-bg, #0ea5e9);
	color: var(--cc-btn-primary-text, #fff);
	border-color: var(--cc-btn-primary-bg, #0ea5e9);
}

.cookie-consent__btn--primary:hover {
	background: var(--cc-btn-primary-hover, var(--cc-btn-primary-bg));
	border-color: var(--cc-btn-primary-hover, var(--cc-btn-primary-bg));
}

.cookie-consent__btn--outline {
	background: var(--cc-btn-outline-bg, #fff);
	color: var(--cc-btn-outline-text, #333);
	border-color: var(--cc-btn-outline-border, #e0e0e0);
}

.cookie-consent__btn--outline:hover {
	background: var(--cc-btn-outline-hover-bg, #f5f5f5);
	border-color: var(--cc-btn-outline-hover-border, #ccc);
	/* Hover: eigene Variable, damit nie weiße Schrift auf hellem Grund */
	color: var(--cc-btn-outline-hover-text, #333);
}

.cookie-consent__btn--secondary {
	background: var(--cc-btn-secondary-bg, #404040);
	color: var(--cc-btn-secondary-text, #eee);
}

.cookie-consent__btn--secondary:hover {
	background: var(--cc-btn-secondary-hover, #525252);
}

.cookie-consent__btn--text {
	background: transparent;
	color: #94a3b8;
}

.cookie-consent__btn--text:hover {
	color: #cbd5e1;
}

.cookie-consent__btn--no-hover:hover {
	color: #94a3b8;
	background: transparent;
}

/* Modal */
.cookie-consent-modal {
	position: fixed;
	inset: 0;
	z-index: 2147483647;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 1rem;
}

.cookie-consent-modal[hidden] {
	display: none;
}

.cookie-consent-modal__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(0,0,0,0.5);
	cursor: pointer;
}

.cookie-consent-modal__box {
	position: relative;
	background: var(--cc-modal-bg, #1a1a1a);
	color: var(--cc-text, #eee);
	max-width: 640px;
	width: 100%;
	border-radius: 8px;
	padding: 1.5rem;
	box-shadow: 0 20px 40px rgba(0,0,0,0.4);
	max-height: 90vh;
	overflow-y: auto;
}

.cookie-consent-modal__box h2 {
	margin: 0 0 1rem;
	font-size: 1.25rem;
}

.cookie-consent-modal.cookie-consent--dark .cookie-consent-modal__box h2 {
	color: #fff !important;
}

/* iOS/Theme-Overrides im Dark Mode neutralisieren: alle Modal-Texte hell erzwingen */
.cookie-consent-modal.cookie-consent--dark .cookie-consent-modal__box,
.cookie-consent-modal.cookie-consent--dark .cookie-consent-modal__category,
.cookie-consent-modal.cookie-consent--dark .cookie-consent-modal__category-head,
.cookie-consent-modal.cookie-consent--dark .cookie-consent-modal__category-head strong,
.cookie-consent-modal.cookie-consent--dark .cookie-consent-modal__category label,
.cookie-consent-modal.cookie-consent--dark .cookie-consent-modal__category p,
.cookie-consent-modal.cookie-consent--dark .cookie-consent-modal__badge,
.cookie-consent-modal.cookie-consent--dark .cookie-consent-modal__cookie-group > summary,
.cookie-consent-modal.cookie-consent--dark .cookie-consent-modal__cookie-group-count,
.cookie-consent-modal.cookie-consent--dark .cookie-consent-modal__cookie-group-icon,
.cookie-consent-modal.cookie-consent--dark .cookie-consent-modal__cookie-name,
.cookie-consent-modal.cookie-consent--dark .cookie-consent-modal__cookie-desc,
.cookie-consent-modal.cookie-consent--dark .cookie-consent-modal__cookie-empty {
	color: #eee !important;
}

.cookie-consent-modal__notice {
	margin: 0 0 1rem;
	font-size: 0.95rem;
	line-height: 1.5;
	color: var(--cc-text, #eee);
}

.cookie-consent-modal__notice a,
.cookie-consent-modal__notice a:visited {
	color: var(--cc-link, #7dd3fc) !important;
	text-decoration: underline !important;
}

.cookie-consent-modal__notice a:hover,
.cookie-consent-modal__notice a:focus,
.cookie-consent-modal__notice a:active {
	color: var(--cc-link-hover, #bae6fd) !important;
	outline: none !important;
	box-shadow: none !important;
}

.cookie-consent-modal__categories {
	display: flex;
	flex-direction: column;
	gap: 1rem;
	margin-bottom: 1.5rem;
}

.cookie-consent-modal__category {
	padding: 0.75rem;
	background: var(--cc-modal-category-bg, #262626);
	border-radius: 6px;
	position: relative;
}

.cookie-consent-modal__category-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.65rem;
	padding-right: 2.25rem;
}

.cookie-consent-modal__category label {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	cursor: pointer;
	font-weight: 600;
}

.cookie-consent-modal__category input[type="checkbox"] {
	width: 1.125rem;
	height: 1.125rem;
}

.cookie-consent-modal__category p {
	margin: 0.35rem 0 0 1.75rem;
	font-size: 0.875rem;
	opacity: 0.9;
}

.cookie-consent-modal__badge {
	display: inline-block;
	margin-top: 0.35rem;
	margin-left: 1.75rem;
	font-size: 0.75rem;
	opacity: 0.8;
}

.cookie-consent-modal__cookie-accordion {
	margin: 0 0 1rem;
}

.cookie-consent-modal__cookie-accordion-title {
	margin: 0 0 0.5rem;
	font-size: 1rem;
}

.cookie-consent-modal__cookie-group {
	border: 0;
	border-radius: 0;
	margin-bottom: 0;
	background: transparent;
}

.cookie-consent-modal__category .cookie-consent-modal__cookie-group {
	margin-top: 0;
	margin-bottom: 0;
}

.cookie-consent-modal__cookie-group > summary {
	list-style: none;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: flex-end;
	gap: 0.45rem;
	padding: 0;
	font-weight: 500;
	font-size: 0.82rem;
	opacity: 0.92;
	position: absolute;
	top: 0.95rem;
	right: 0.75rem;
	z-index: 2;
}

.cookie-consent-modal__cookie-group > summary::-webkit-details-marker {
	display: none;
}

.cookie-consent-modal__cookie-group-count {
	font-size: 0.8rem;
	opacity: 0.85;
}

.cookie-consent-modal__cookie-group-icon {
	display: inline-block;
	font-size: 0.8rem;
	opacity: 0.9;
	transition: transform 0.2s ease;
}

.cookie-consent-modal__cookie-group[open] > summary .cookie-consent-modal__cookie-group-icon {
	transform: rotate(90deg);
}

.cookie-consent-modal__cookie-list {
	padding: 0 0 0 0.25rem;
	display: flex;
	flex-direction: column;
	gap: 0.35rem;
	margin-top: 0.15rem;
}

.cookie-consent-modal__cookie-group[open] .cookie-consent-modal__cookie-list {
	padding-top: 0.45rem;
	margin-top: 0.25rem;
	border-top: 1px dashed rgba(127, 127, 127, 0.35);
}

/* Einzelne Cookies: [Auswahlfeld] daneben [Name], Zeilenumbruch, dann Beschreibung */
.cookie-consent-modal__cookie-item {
	display: grid;
	grid-template-columns: 18px minmax(0, 1fr);
	gap: 0 0.55rem;
	align-items: start;
	cursor: pointer;
}

.cookie-consent-modal__cookie-item input[type="checkbox"] {
	grid-column: 1;
	align-self: start;
	margin: 0;
	width: 18px;
	height: 18px;
	min-width: 18px;
	min-height: 18px;
	flex-shrink: 0;
	box-sizing: border-box;
}

.cookie-consent-modal__cookie-item .cookie-consent-modal__cookie-text {
	grid-column: 2;
	align-self: start;
	display: flex;
	flex-direction: column;
	gap: 0.35rem;
	min-width: 0;
}

.cookie-consent-modal__cookie-item .cookie-consent-modal__cookie-name {
	display: block;
	font-weight: bold;
	line-height: 18px;
	min-height: 18px;
}

.cookie-consent-modal__cookie-item .cookie-consent-modal__cookie-desc {
	display: block;
	font-size: 0.9rem;
	font-weight: normal;
	opacity: 0.9;
}

/* Dynamisch eingefügte Dienste ohne Checkbox: Name fett, Zeilenumbruch, dann Beschreibung */
.cookie-consent-modal__detected-service {
	display: flex;
	flex-direction: column;
	gap: 0.35rem;
}
.cookie-consent-modal__detected-service .cookie-consent-modal__cookie-name {
	display: block;
	font-weight: bold;
}
.cookie-consent-modal__detected-service .cookie-consent-modal__cookie-desc {
	display: block;
	font-size: 0.9rem;
	opacity: 0.9;
}

.cookie-consent-modal__cookie-name {
	display: block;
	font-weight: bold;
}

.cookie-consent-modal__cookie-desc {
	display: block;
	font-size: 0.9rem;
	font-weight: normal;
	opacity: 0.9;
}

.cookie-consent-modal__cookie-empty {
	margin: 0;
	font-size: 0.85rem;
	opacity: 0.85;
}

.cookie-consent-modal__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
}

.cookie-consent-placeholder {
	padding: 1rem;
	background: #f1f5f9;
	color: #475569;
	border-radius: 4px;
	font-size: 0.875rem;
}

.cookie-consent-placeholder a {
	color: #0ea5e9;
}

/* Schwebender Button: Cookie-Einstellungen erneut öffnen (sichtbar, wenn bereits eingewilligt). Farben aus KUGI-Einstellungen (Button-Farbe). */
.cookie-consent-float {
	position: fixed;
	bottom: 1rem;
	right: 1rem;
	z-index: 2147483645;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 0.5rem 0.75rem;
	font-size: 0.8rem;
	line-height: 1.2;
	font-weight: 500;
	color: var(--cc-btn-primary-text, #fff);
	background: var(--cc-btn-primary-bg, #0ea5e9);
	border: none;
	border-radius: 6px;
	box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
	cursor: pointer;
	transition: background 0.2s, transform 0.15s;
}
.cookie-consent-float:hover {
	background: var(--cc-btn-primary-hover, #0284c7);
}
.cookie-consent-float:focus {
	outline: 2px solid var(--cc-btn-primary-bg, #0ea5e9);
	outline-offset: 2px;
}
.cookie-consent-float[hidden] {
	display: none !important;
}
