/* Cookie Banner & Content Blocker – Frontend Styles
   Version: 1.4.2
   Farben via CSS Custom Properties aus wp_head (inline-style)
*/

/* ============================================================
   Custom Properties Fallbacks
   (Echte Werte kommen per inline-style aus PHP/wp_head)
   ============================================================ */
:root {
	/* Banner */
	--cb-bg:                 #ffffff;
	--cb-text:               #1e293b;
	--cb-overlay:            rgba(0,0,0,0.45);
	/* Button: Akzeptieren */
	--cb-btn-accept-bg:      #1d4ed8;
	--cb-btn-accept-text:    #ffffff;
	--cb-btn-accept-border:  #1d4ed8;
	--cb-btn-accept-radius:  8px;
	/* Button: Ablehnen */
	--cb-btn-reject-bg:      #1d4ed8;
	--cb-btn-reject-text:    #ffffff;
	--cb-btn-reject-border:  #1d4ed8;
	--cb-btn-reject-radius:  8px;
	/* Button: Details */
	--cb-btn-details-bg:     transparent;
	--cb-btn-details-text:   #1d4ed8;
	--cb-btn-details-border: #1d4ed8;
	--cb-btn-details-radius: 8px;
	/* Platzhalter-Button */
	--cb-btn-ph-bg:          #1d4ed8;
	--cb-btn-ph-text:        #ffffff;
	--cb-btn-ph-radius:      8px;
	/* Reopen-Button */
	--cb-reopen-bg:   #1d4ed8;
	--cb-reopen-icon: #ffffff;
	/* Interne Hilfsvariablen */
	--cb-shadow:    0 4px 32px rgba(0,0,0,.15);
	--cb-radius:    12px;
	--cb-font:      -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* ============================================================
   Cookie Banner
   ============================================================ */
.cb-banner {
	position: fixed;
	z-index: 999999;
	font-family: var(--cb-font);
	font-size: 15px;
	line-height: 1.55;
	color: var(--cb-text);
}

/* Positionen */
.cb-banner--bottom {
	bottom: 0;
	left: 0;
	right: 0;
	padding: 16px;
}

.cb-banner--top {
	top: 0;
	left: 0;
	right: 0;
	padding: 16px;
}

.cb-banner--center {
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 16px;
}

.cb-banner__backdrop {
	position: absolute;
	inset: 0;
	background: var(--cb-overlay);
}

/* Banner-Box: immer Spalten-Layout – Text oben, Buttons unten */
.cb-banner__box {
	background: var(--cb-bg);
	border-radius: var(--cb-radius);
	box-shadow: var(--cb-shadow);
	padding: 24px 28px;
	max-width: 560px;
	margin: 0 auto;
	position: relative;
	z-index: 1;
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.cb-banner__header {
	display: flex;
	align-items: center;
	gap: 12px;
}

.cb-banner__icon {
	color: var(--cb-btn-accept-bg);
	flex-shrink: 0;
	line-height: 0;
}

.cb-banner__title {
	font-size: 17px;
	font-weight: 700;
	margin: 0;
	padding: 0;
	color: var(--cb-text);
	border: none;
}

.cb-banner__text {
	margin: 0;
	color: #475569;
	font-size: 14px;
	line-height: 1.6;
}

.cb-banner__links {
	margin: 0;
	font-size: 13px;
	color: #94a3b8;
}

.cb-banner__links a {
	color: var(--cb-btn-accept-bg);
	text-decoration: underline;
}

/* Details */
.cb-banner__details {
	margin-top: 4px;
	border-top: 1px solid #e2e8f0;
	padding-top: 12px;
}

.cb-service-list {
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.cb-service-list__item {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	padding: 8px 12px;
	background: #f8fafc;
	border-radius: var(--cb-radius-sm, 8px);
}

.cb-service-list__label {
	display: flex;
	align-items: center;
	gap: 10px;
	cursor: pointer;
	flex: 1;
}

.cb-service-list__name {
	font-size: 14px;
	color: var(--cb-text);
}

.cb-service-list__badge--required {
	font-size: 12px;
	color: #059669;
	font-weight: 600;
	background: #d1fae5;
	padding: 2px 8px;
	border-radius: 20px;
	white-space: nowrap;
}

.cb-service-checkbox {
	width: 18px;
	height: 18px;
	accent-color: var(--cb-btn-accept-bg);
	cursor: pointer;
	flex-shrink: 0;
}

/* Details-Zeile (optional, oberhalb der Haupt-Actions) */
.cb-banner__actions--details-row {
	display: flex;
	justify-content: center;
	margin-top: 4px;
	margin-bottom: 0;
}

.cb-banner__actions--details-row .cb-banner__btn {
	flex: none;
}

/* Actions – Ablehnen und Akzeptieren gleichwertig nebeneinander */
.cb-banner__actions {
	display: flex;
	gap: 10px;
	align-items: stretch;
	margin-top: 8px;
}

.cb-banner__actions .cb-banner__btn {
	flex: 1;
	justify-content: center;
}

.cb-banner__btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 10px 22px;
	border-radius: var(--cb-radius-sm);
	font-size: 14px;
	font-weight: 600;
	font-family: var(--cb-font);
	cursor: pointer;
	border: 2px solid transparent;
	transition: background 0.18s, color 0.18s, border-color 0.18s, transform 0.1s;
	line-height: 1.2;
	white-space: nowrap;
}

.cb-banner__btn:active {
	transform: scale(0.97);
}

.cb-banner__btn--accept {
	background:    var(--cb-btn-accept-bg);
	color:         var(--cb-btn-accept-text);
	border-color:  var(--cb-btn-accept-border);
	border-radius: var(--cb-btn-accept-radius);
}

.cb-banner__btn--accept:hover {
	filter: brightness(0.9);
}

.cb-banner__btn--reject {
	background:    var(--cb-btn-reject-bg);
	color:         var(--cb-btn-reject-text);
	border-color:  var(--cb-btn-reject-border);
	border-radius: var(--cb-btn-reject-radius);
}

.cb-banner__btn--reject:hover {
	filter: brightness(0.9);
}

.cb-banner__btn--details {
	background:    var(--cb-btn-details-bg);
	color:         var(--cb-btn-details-text);
	border-color:  var(--cb-btn-details-border);
	border-radius: var(--cb-btn-details-radius);
}

.cb-banner__btn--details:hover {
	filter: brightness(0.92);
	background: color-mix(in srgb, var(--cb-btn-details-bg, transparent) 85%, var(--cb-btn-details-text) 15%);
}

/* ============================================================
   Reopen Button (Datenschutz-Icon zum Togglen)
   ============================================================ */
.cb-reopen-btn {
	position: fixed;
	z-index: 999998;
	width: 44px;
	height: 44px;
	border-radius: 50%;
	background: var(--cb-reopen-bg);
	color:       var(--cb-reopen-icon);
	border: none;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	box-shadow: 0 2px 12px rgba(0,0,0,.25);
	transition: filter 0.18s, transform 0.1s;
	line-height: 0;
}

/* Position: unten links (Standard) */
.cb-reopen-btn--bottom-left {
	bottom: 20px;
	left: 20px;
}

/* Position: unten rechts */
.cb-reopen-btn--bottom-right {
	bottom: 20px;
	right: 20px;
}

.cb-reopen-btn:hover {
	filter: brightness(0.88);
	transform: scale(1.08);
}

/* Wenn Banner offen ist: visuelles Feedback */
.cb-reopen-btn[aria-expanded="true"] {
	box-shadow: 0 2px 16px rgba(0,0,0,.35);
}

.cb-reopen-btn[aria-expanded="true"] svg {
	transform: scale(0.9);
	opacity: 0.8;
}

/* ============================================================
   Inline-Footer-Variante – zieht sich per negativem Margin
   in den Footer, nimmt selbst keinen Platz weg (height: 0)
   ============================================================ */
.cb-reopen-bar {
	height: 0;
	overflow: visible;
	margin-top: -80px;
	display: flex;
	align-items: flex-start;
	padding: 0 0 0 20px;
	pointer-events: none;
	position: relative;
	z-index: 9000;
}

.cb-reopen-btn--inline {
	pointer-events: all;
	position: static !important;
	/* Kreis – identisch mit den festen Reopen-Buttons */
	width: 44px;
	height: 44px;
	border-radius: 50%;
	padding: 0;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	box-shadow: 0 2px 12px rgba(0,0,0,.25);
}

/* Text ausblenden – nur Icon sichtbar (aria-label bleibt) */
.cb-reopen-btn--inline span {
	display: none;
}

.cb-reopen-btn--inline:hover {
	filter: brightness(0.88);
	transform: scale(1.08);
}

/* ============================================================
   Platzhalter (YouTube / Maps / Custom)
   ============================================================ */
.cb-placeholder {
	display: flex;
	align-items: center;
	justify-content: center;
	text-align: center;
	background: #f1f5f9;
	border: 2px dashed #cbd5e1;
	border-radius: var(--cb-radius-sm);
	overflow: hidden;
	font-family: var(--cb-font);
	min-height: 200px;
}

.cb-placeholder--youtube {
	background: #0f0f0f;
	border-color: #272727;
}

.cb-placeholder--maps {
	background: #e8eaed;
	border-color: #bdc1c6;
}

.cb-placeholder__inner {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	padding: 32px 24px;
	text-align: center;
	gap: 16px;
	max-width: 480px;
	margin: 0 auto;
	width: 100%;
}

.cb-placeholder__icon {
	opacity: 0.7;
	line-height: 0;
}

.cb-placeholder--youtube .cb-placeholder__icon {
	opacity: 0.9;
}

.cb-placeholder__text {
	margin: 0;
	font-size: 14px;
	line-height: 1.5;
	color: #64748b;
}

.cb-placeholder--youtube .cb-placeholder__text {
	color: #a8a8a8;
}

.cb-placeholder--maps .cb-placeholder__text {
	color: #5f6368;
}

.cb-placeholder__btn {
	display: inline-flex;
	align-items: center;
	padding: 10px 24px;
	background:    var(--cb-btn-ph-bg);
	color:         var(--cb-btn-ph-text);
	border:        none;
	border-radius: var(--cb-btn-ph-radius);
	font-size: 14px;
	font-weight: 600;
	font-family: var(--cb-font);
	cursor: pointer;
	transition: filter 0.18s, transform 0.1s;
	white-space: nowrap;
}

.cb-placeholder__btn:hover {
	filter: brightness(0.9);
}

.cb-placeholder__btn:active {
	transform: scale(0.97);
}

.cb-placeholder__privacy {
	margin: 0;
	font-size: 12px;
	color: #94a3b8;
}

.cb-placeholder--youtube .cb-placeholder__privacy {
	color: #6b6b6b;
}

.cb-placeholder__privacy a {
	color: var(--cb-btn-ph-bg);
	text-decoration: underline;
}

/* ============================================================
   Custom-Overlay (für benutzerdefinierte Bereiche via ID/Klasse)
   ============================================================ */
.cb-custom-overlay-wrapper {
	position: relative;
}

.cb-custom-overlay {
	position: absolute;
	inset: 0;
	z-index: 10;
	background: rgba(241, 245, 249, 0.95);
	backdrop-filter: blur(4px);
	-webkit-backdrop-filter: blur(4px);
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: inherit;
	font-family: var(--cb-font);
}

/* Standalone custom overlay (vom PHP direkt eingefügt) */
.cb-custom-overlay:not(.cb-custom-overlay--absolute) {
	position: relative;
	min-height: 180px;
	background: #f1f5f9;
	border: 2px dashed #cbd5e1;
	border-radius: var(--cb-radius-sm);
}

.cb-custom-overlay__inner {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	padding: 32px 24px;
	text-align: center;
	gap: 16px;
	max-width: 480px;
}

/* ============================================================
   Animationen (nur wenn JS geladen ist → .js-ready)
   ============================================================ */
.js-ready .cb-banner {
	animation: cb-slide-in 0.3s ease-out both;
}

.js-ready .cb-banner--top {
	animation-name: cb-slide-in-top;
}

@keyframes cb-slide-in {
	from { transform: translateY(30px); opacity: 0; }
	to   { transform: translateY(0);    opacity: 1; }
}

@keyframes cb-slide-in-top {
	from { transform: translateY(-30px); opacity: 0; }
	to   { transform: translateY(0);     opacity: 1; }
}

/* ============================================================
   Versteckt-Klasse (von JS genutzt)
   ============================================================ */
.cb-hidden {
	display: none !important;
}

/* Stellt sicher dass [hidden] nicht durch display:flex überschrieben wird */
.cb-banner[hidden],
.cb-reopen-bar[hidden] {
	display: none !important;
}

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 540px) {
	.cb-banner__box {
		padding: 20px 18px;
	}

	.cb-banner__actions {
		flex-direction: column-reverse;
	}

	.cb-reopen-btn--bottom-left {
		bottom: 14px;
		left: 14px;
	}

	.cb-reopen-btn--bottom-right {
		bottom: 14px;
		right: 14px;
	}
}
