/* =============================================================================
   WP Consent Manager – Cookiebot-inspired Design
   ============================================================================= */

:root {
	--wcm-primary:     #1cc88a;
	--wcm-primary-dk:  #17a97a;
	--wcm-text:        #333333;
	--wcm-muted:       #777777;
	--wcm-bg:          #ffffff;
	--wcm-border:      #d8d8d8;
	--wcm-tab-bg:      #f7f7f7;
	--wcm-shadow:      0 -1px 0 rgba(0,0,0,.08), 0 -4px 16px rgba(0,0,0,.10);
	--wcm-z:           999999;
	--wcm-font:        -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* ---------------------------------------------------------------------------
 * Reset & Base
 * ------------------------------------------------------------------------- */
#wcm-banner,
#wcm-banner *,
#wcm-banner *::before,
#wcm-banner *::after {
	box-sizing: border-box;
	margin:     0;
	padding:    0;
}

#wcm-banner {
	font-family: var(--wcm-font);
	font-size:   14px;
	line-height: 1.5;
	color:       var(--wcm-text);
	z-index:     var(--wcm-z);
}

.wcm-hidden {
	display: none !important;
}

/* ---------------------------------------------------------------------------
 * Bottom Banner
 * ------------------------------------------------------------------------- */
#wcm-banner.wcm-pos-bottom {
	position:   fixed;
	bottom:     0;
	left:       0;
	right:      0;
	background: var(--wcm-bg);
	box-shadow: var(--wcm-shadow);
	max-height: 90vh;
	overflow-y: auto;
	overscroll-behavior: contain;
}

/* ---------------------------------------------------------------------------
 * Center Modal
 * ------------------------------------------------------------------------- */
#wcm-banner.wcm-pos-center {
	position:        fixed;
	inset:           0;
	display:         flex;
	align-items:     center;
	justify-content: center;
	padding:         20px;
}

.wcm-overlay {
	position:   absolute;
	inset:      0;
	background: rgba(0, 0, 0, .45);
}

#wcm-banner.wcm-pos-center .wcm-box {
	position:      relative;
	z-index:       1;
	border-radius: 4px;
	box-shadow:    0 8px 40px rgba(0,0,0,.18);
	max-width:     620px;
	width:         100%;
	max-height:    calc(100vh - 40px);
	overflow-y:    auto;
	overscroll-behavior: contain;
}

/* ---------------------------------------------------------------------------
 * Box
 * ------------------------------------------------------------------------- */
.wcm-box {
	background: var(--wcm-bg);
}

/* ---------------------------------------------------------------------------
 * Main row: content left | buttons right
 * ------------------------------------------------------------------------- */
.wcm-main {
	display:     flex;
	align-items: flex-start;
	gap:         24px;
	padding:     32px 40px;
}

.wcm-content {
	flex: 1;
	min-width: 0;
}

.wcm-logo {
	height:        28px;
	width:         auto;
	margin-bottom: 8px;
	display:       block;
}

.wcm-title {
	font-size:     15px;
	font-weight:   700;
	color:         var(--wcm-text);
	margin-bottom: 6px;
	line-height:   1.3;
}

.wcm-desc {
	font-size:     13px;
	color:         var(--wcm-muted);
	margin-bottom: 10px;
	line-height:   1.55;
}

/* Meta row: "Details anzeigen" + links */
.wcm-meta {
	display:     flex;
	align-items: center;
	flex-wrap:   wrap;
	gap:         8px;
	font-size:   12px;
}

.wcm-meta-sep {
	color: var(--wcm-border);
}

.wcm-details-toggle {
	background:  none;
	border:      none;
	padding:     0;
	cursor:      pointer;
	font-size:   12px;
	color:       var(--wcm-muted);
	display:     flex;
	align-items: center;
	gap:         3px;
}

.wcm-details-toggle:hover {
	color: var(--wcm-text);
}

.wcm-arrow {
	font-size:  10px;
	transition: transform .2s;
}

.wcm-details-toggle[aria-expanded="true"] .wcm-arrow {
	transform: rotate(180deg);
}

.wcm-links {
	display:     flex;
	align-items: center;
	flex-wrap:   wrap;
	gap:         6px;
	font-size:   12px;
}

.wcm-links a {
	color:           var(--wcm-muted);
	text-decoration: none;
}

.wcm-links a:hover {
	text-decoration: underline;
	color:           var(--wcm-text);
}

.wcm-links span[aria-hidden] {
	color: var(--wcm-border);
}

/* ---------------------------------------------------------------------------
 * Action buttons (right column)
 * ------------------------------------------------------------------------- */
.wcm-actions {
	display:        flex;
	flex-direction: column;
	gap:            8px;
	flex-shrink:    0;
	width:          180px;
}

.wcm-btn {
	display:       block;
	width:         100%;
	padding:       18px 32px;
	font-size:     15px;
	font-weight:   600;
	font-family:   var(--wcm-font);
	border-radius: 3px;
	cursor:        pointer;
	border:        2px solid transparent;
	text-align:    center;
	line-height:   1;
	white-space:   nowrap;
	transition:    background-color .15s, border-color .15s, color .15s;
}

.wcm-btn:focus-visible {
	outline:        2px solid var(--wcm-primary);
	outline-offset: 2px;
}

/* Alle erlauben – grün gefüllt */
.wcm-btn-allow {
	background:   var(--wcm-primary);
	border-color: var(--wcm-primary);
	color:        #fff;
}

.wcm-btn-allow:hover {
	background:   var(--wcm-primary-dk);
	border-color: var(--wcm-primary-dk);
}

/* Auswahl erlauben – grüner Rahmen */
.wcm-btn-selection {
	background:   transparent;
	border-color: var(--wcm-primary);
	color:        var(--wcm-primary);
}

.wcm-btn-selection:hover {
	background: color-mix(in srgb, var(--wcm-primary) 8%, transparent);
}

/* Alle ablehnen – grauer Rahmen */
.wcm-btn-deny {
	background:   transparent;
	border-color: var(--wcm-border);
	color:        var(--wcm-muted);
}

.wcm-btn-deny:hover {
	border-color: #aaaaaa;
	color:        var(--wcm-text);
}

/* ---------------------------------------------------------------------------
 * Details section (ausklappbar)
 * ------------------------------------------------------------------------- */
.wcm-details {
	border-top: 1px solid var(--wcm-border);
}

/* Tab-Navigation */
.wcm-tab-nav {
	display:          flex;
	border-bottom:    1px solid var(--wcm-border);
	background:       var(--wcm-tab-bg);
	padding:          0 40px;
	overflow-x:       auto;
	scrollbar-width:  none;
}

.wcm-tab-nav::-webkit-scrollbar {
	display: none;
}

.wcm-tab-btn {
	background:      none;
	border:          none;
	border-bottom:   3px solid transparent;
	padding:         10px 14px;
	font-size:       13px;
	font-family:     var(--wcm-font);
	color:           var(--wcm-muted);
	cursor:          pointer;
	white-space:     nowrap;
	margin-bottom:   -1px;
	transition:      color .15s, border-color .15s;
}

.wcm-tab-btn:hover {
	color: var(--wcm-text);
}

.wcm-tab-active {
	color:        var(--wcm-primary) !important;
	border-bottom-color: var(--wcm-primary) !important;
	font-weight:  600;
}

/* Tab-Panels */
.wcm-tab-panel {
	padding: 20px 40px;
}

.wcm-panel-inner {
	display:     flex;
	align-items: center;
	gap:         20px;
}

.wcm-panel-desc {
	flex:      1;
	font-size: 13px;
	color:     var(--wcm-muted);
	min-width: 0;
}

/* Immer-aktiv-Badge */
.wcm-always-on {
	font-size:     11px;
	font-weight:   600;
	color:         #059669;
	background:    #d1fae5;
	padding:       4px 10px;
	border-radius: 20px;
	white-space:   nowrap;
	flex-shrink:   0;
}

/* ---------------------------------------------------------------------------
 * Toggle-Switch
 * ------------------------------------------------------------------------- */
.wcm-switch {
	position:    relative;
	display:     inline-block;
	width:       44px;
	height:      24px;
	flex-shrink: 0;
	cursor:      pointer;
}

.wcm-switch input {
	opacity:  0;
	width:    0;
	height:   0;
	position: absolute;
}

.wcm-slider {
	position:         absolute;
	inset:            0;
	background-color: #cccccc;
	border-radius:    24px;
	transition:       background-color .2s;
}

.wcm-slider::before {
	content:       '';
	position:      absolute;
	height:        18px;
	width:         18px;
	left:          3px;
	top:           3px;
	background:    #fff;
	border-radius: 50%;
	transition:    transform .2s;
	box-shadow:    0 1px 3px rgba(0,0,0,.25);
}

.wcm-switch input:checked + .wcm-slider {
	background-color: var(--wcm-primary);
}

.wcm-switch input:checked + .wcm-slider::before {
	transform: translateX(20px);
}

.wcm-switch input:focus-visible + .wcm-slider {
	outline:        2px solid var(--wcm-primary);
	outline-offset: 2px;
}

/* ---------------------------------------------------------------------------
 * Re-open button (unten links, nach Einwilligung)
 * ------------------------------------------------------------------------- */
.wcm-reopen {
	position:        fixed;
	bottom:          20px;
	left:            20px;
	z-index:         calc(var(--wcm-z) - 1);
	width:           40px;
	height:          40px;
	border-radius:   50%;
	background:      var(--wcm-primary);
	color:           #fff;
	border:          none;
	cursor:          pointer;
	display:         flex;
	align-items:     center;
	justify-content: center;
	box-shadow:      0 2px 10px rgba(0,0,0,.20);
	transition:      transform .15s, box-shadow .15s;
	padding:         0;
}

.wcm-reopen:hover {
	transform:  scale(1.1);
	box-shadow: 0 4px 16px rgba(0,0,0,.25);
}

.wcm-reopen:focus-visible {
	outline:        2px solid var(--wcm-primary);
	outline-offset: 3px;
}

/* ---------------------------------------------------------------------------
 * Responsive
 * ------------------------------------------------------------------------- */
@media (max-width: 680px) {
	.wcm-main {
		flex-direction: column;
		padding:        24px 20px;
		gap:            16px;
	}

	.wcm-actions {
		width:          100%;
		flex-direction: row;
		flex-wrap:      wrap;
	}

	.wcm-btn {
		flex: 1;
		min-width: 100px;
	}

	.wcm-tab-nav {
		padding: 0 20px;
	}

	.wcm-tab-panel {
		padding: 16px 20px;
	}

	.wcm-panel-inner {
		flex-wrap: wrap;
	}

	#wcm-banner.wcm-pos-center {
		padding:     12px;
		align-items: flex-end;
	}
}

/* Scrollbar */
#wcm-banner::-webkit-scrollbar,
.wcm-box::-webkit-scrollbar { width: 4px; }
#wcm-banner::-webkit-scrollbar-thumb,
.wcm-box::-webkit-scrollbar-thumb { background: var(--wcm-border); border-radius: 4px; }
