/**
 * Simple Cookie Banner – Frontend-Styles (Flat Design).
 */

.scb-banner {
	--scb-primary: #2563eb;
	--scb-primary-text: #ffffff;
	--scb-bg: #ffffff;
	--scb-text: #1f2937;
	--scb-border: #e5e7eb;
	--scb-radius: 14px;

	position: fixed;
	z-index: 999999;
	box-sizing: border-box;
	color: var( --scb-text );
	font-size: 15px;
	line-height: 1.55;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

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

/* Das hidden-Attribut muss die display-Regeln der Positionsklassen schlagen. */
.scb-banner[hidden],
#scb-toggle[hidden],
.scb-overlay[hidden] {
	display: none;
}

/* Abdunkelndes Overlay hinter dem Banner. */
.scb-overlay {
	position: fixed;
	inset: 0;
	z-index: 999998;
	background: rgba( 17, 24, 39, 0.55 );
}

/* Position: untere Leiste */
.scb-pos-bottom {
	left: 50%;
	bottom: 20px;
	transform: translateX( -50% );
	width: calc( 100% - 32px );
	max-width: 880px;
}

.scb-pos-bottom .scb-inner {
	background: var( --scb-bg );
	border: 1px solid var( --scb-border );
	border-radius: var( --scb-radius );
	box-shadow: 0 12px 40px rgba( 0, 0, 0, 0.16 );
	padding: 22px 24px;
}

/* Position: modal */
.scb-pos-modal {
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 16px;
	background: transparent; /* Abdunklung übernimmt .scb-overlay */
}

.scb-pos-modal .scb-inner {
	background: var( --scb-bg );
	border-radius: var( --scb-radius );
	box-shadow: 0 20px 60px rgba( 0, 0, 0, 0.3 );
	padding: 26px 28px;
	width: 100%;
	max-width: 520px;
	max-height: 90vh;
	overflow-y: auto;
}

/* Inhalt */
.scb-title {
	margin: 0 0 8px;
	font-size: 19px;
	font-weight: 700;
	color: var( --scb-text );
}

.scb-message {
	margin: 0 0 12px;
}

.scb-message p {
	margin: 0 0 8px;
}

.scb-links {
	margin: 0 0 14px;
	font-size: 13px;
}

.scb-links a {
	margin-right: 16px;
}

/* Über die ID, damit Theme-Linkfarben sicher überschrieben werden. */
#scb-banner a {
	color: var( --scb-primary );
	text-decoration: underline;
}

#scb-banner a:hover {
	opacity: 0.85;
}

/* Kategorie-Optionen */
.scb-options {
	margin: 4px 0 16px;
	border-top: 1px solid var( --scb-border );
	padding-top: 8px;
}

.scb-option {
	padding: 12px 0;
	border-bottom: 1px solid var( --scb-border );
}

.scb-option:last-child {
	border-bottom: 0;
}

.scb-option-head {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 16px;
}

.scb-option-text {
	display: block;
}

.scb-option-label {
	display: block;
	font-weight: 600;
}

.scb-option-desc {
	display: block;
	font-size: 13px;
	opacity: 0.8;
	margin-top: 2px;
}

/* Dienste/Cookies pro Kategorie */
.scb-services {
	list-style: none;
	margin: 10px 0 0;
	padding: 0;
}

.scb-service-item {
	padding: 6px 0;
	border-top: 1px dashed var( --scb-border );
	font-size: 13px;
	line-height: 1.5;
}

.scb-service-item:first-child {
	border-top: 0;
	padding-top: 0;
}

.scb-service-name {
	font-weight: 600;
}

.scb-service-provider {
	opacity: 0.75;
}

.scb-service-provider::before {
	content: " · ";
}

.scb-service-purpose {
	display: block;
	opacity: 0.85;
	margin-top: 2px;
}

.scb-cookie-list {
	display: block;
	margin-top: 2px;
	font-size: 12px;
	opacity: 0.7;
	word-break: break-word;
}

.scb-service-privacy {
	display: inline-block;
	margin-top: 3px;
	font-size: 12px;
}

/* Switch */
.scb-switch {
	position: relative;
	flex: 0 0 auto;
	width: 46px;
	height: 26px;
	margin-top: 2px;
}

.scb-switch input {
	position: absolute;
	opacity: 0;
	width: 100%;
	height: 100%;
	margin: 0;
	cursor: pointer;
}

.scb-slider {
	position: absolute;
	inset: 0;
	background: var( --scb-border );
	border-radius: 999px;
	transition: background 0.2s ease;
}

.scb-slider::before {
	content: "";
	position: absolute;
	top: 3px;
	left: 3px;
	width: 20px;
	height: 20px;
	background: #ffffff;
	border-radius: 50%;
	box-shadow: 0 1px 3px rgba( 0, 0, 0, 0.25 );
	transition: transform 0.2s ease;
}

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

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

.scb-switch input:disabled {
	cursor: not-allowed;
}

.scb-switch input:disabled + .scb-slider {
	opacity: 0.65;
}

/* Aktionen */
.scb-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	justify-content: flex-end;
	align-items: center;
}

/* Buttons über die ID, damit Theme-Button-Styles nicht durchschlagen. */
#scb-banner .scb-btn {
	appearance: none;
	-webkit-appearance: none;
	cursor: pointer;
	display: inline-block;
	width: auto;
	min-height: 0;
	margin: 0;
	border: 1px solid transparent;
	border-radius: calc( var( --scb-radius ) * 0.6 );
	padding: 11px 18px;
	font-family: inherit;
	font-size: 14px;
	font-weight: 600;
	line-height: 1;
	text-transform: none;
	letter-spacing: normal;
	text-shadow: none;
	box-shadow: none;
	transition: filter 0.15s ease, background 0.15s ease;
}

#scb-banner .scb-btn:hover {
	filter: brightness( 0.96 );
}

#scb-banner .scb-btn-primary {
	background: var( --scb-primary );
	color: var( --scb-primary-text );
	border-color: var( --scb-primary );
}

#scb-banner .scb-btn-secondary,
#scb-banner .scb-btn-save {
	background: transparent;
	color: var( --scb-text );
	border-color: var( --scb-border );
}

#scb-banner .scb-btn-secondary:hover,
#scb-banner .scb-btn-save:hover {
	background: rgba( 0, 0, 0, 0.04 );
}

#scb-banner .scb-btn-ghost {
	background: transparent;
	color: var( --scb-text );
	border-color: transparent;
	margin-right: auto;
	padding-left: 0;
	text-decoration: underline;
	font-weight: 500;
}

#scb-banner .scb-btn-ghost:hover {
	filter: none;
	opacity: 0.75;
}

/* Schwebender Button – über die ID gegen Theme-Button-Styles abgesichert. */
#scb-toggle {
	position: fixed;
	left: 18px;
	bottom: 18px;
	z-index: 999990;
	box-sizing: border-box;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 48px;
	height: 48px;
	min-height: 0;
	padding: 0;
	margin: 0;
	appearance: none;
	-webkit-appearance: none;
	border: 0;
	border-radius: 50%;
	background: var( --scb-primary, #2563eb );
	color: var( --scb-primary-text, #ffffff );
	line-height: 0;
	box-shadow: 0 6px 18px rgba( 0, 0, 0, 0.22 );
	cursor: pointer;
	transition: transform 0.15s ease, filter 0.15s ease;
}

#scb-toggle:hover {
	transform: scale( 1.06 );
	filter: brightness( 0.96 );
}

#scb-toggle svg {
	display: block;
	width: 22px;
	height: 22px;
}

/* Mobil */
@media ( max-width: 600px ) {
	.scb-actions {
		justify-content: stretch;
	}

	#scb-banner .scb-btn-primary,
	#scb-banner .scb-btn-secondary,
	#scb-banner .scb-btn-save {
		flex: 1 1 auto;
		text-align: center;
	}

	#scb-banner .scb-btn-ghost {
		flex-basis: 100%;
		text-align: left;
		margin-bottom: 4px;
	}
}
