/**
 * SDA Bundle — Cookie Consent banner styles.
 *
 * Scoped under #sda-cc-banner, #sda-cc-recall and .sda-cc-* only.
 * The accent colour comes from the --sda-cc-primary custom property,
 * which the JS sets on #sda-cc-banner / #sda-cc-recall from config.primaryColor.
 *
 * Two layouts: position "bottom" (full-width bar) and "box" (corner card).
 * Accept-all and Reject-all share one button style so they are EQUAL in size
 * and weight (legal requirement: no nudging toward acceptance).
 */

#sda-cc-banner {
	--sda-cc-primary: #2563eb;
	position: fixed;
	z-index: 2147483600;
	box-sizing: border-box;
	background: #1a1a1a;
	color: #fff;
	font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
	font-size: 14px;
	line-height: 1.5;
	box-shadow: 0 -4px 24px rgba( 0, 0, 0, 0.35 );
}

#sda-cc-banner *,
#sda-cc-recall {
	box-sizing: border-box;
}

/* --- position: bottom (full-width bar) --- */
#sda-cc-banner.sda-cc-pos-bottom {
	left: 0;
	right: 0;
	bottom: 0;
	padding: 18px 20px;
	border-top: 3px solid var( --sda-cc-primary );
}

#sda-cc-banner.sda-cc-pos-bottom .sda-cc-inner {
	max-width: 1200px;
	margin: 0 auto;
	display: flex;
	flex-direction: column;
	gap: 12px;
}

/* --- position: box (corner card) --- */
#sda-cc-banner.sda-cc-pos-box {
	bottom: 20px;
	max-width: 380px;
	width: calc( 100% - 40px );
	padding: 20px;
	border-radius: 14px;
	border: 1px solid rgba( 255, 255, 255, 0.08 );
	box-shadow: 0 10px 40px rgba( 0, 0, 0, 0.45 );
}

#sda-cc-banner.sda-cc-pos-box {
	left: 20px;
}

#sda-cc-banner.sda-cc-pos-box .sda-cc-inner {
	display: flex;
	flex-direction: column;
	gap: 12px;
}

/* --- text content --- */
#sda-cc-banner .sda-cc-title {
	font-size: 16px;
	font-weight: 700;
	margin: 0;
}

#sda-cc-banner .sda-cc-text {
	margin: 0;
	font-size: 13px;
	opacity: 0.92;
}

#sda-cc-banner .sda-cc-privacy {
	color: var( --sda-cc-primary );
	text-decoration: underline;
	font-weight: 600;
	font-size: 13px;
	display: inline-block;
	margin-top: 2px;
}

/* --- actions --- */
#sda-cc-banner .sda-cc-actions {
	display: flex;
	gap: 10px;
	flex-wrap: wrap;
	align-items: center;
}

#sda-cc-banner .sda-cc-btn {
	-webkit-appearance: none;
	appearance: none;
	font: inherit;
	font-size: 13px;
	font-weight: 700;
	padding: 10px 20px;
	border-radius: 8px;
	border: 2px solid transparent;
	cursor: pointer;
	min-width: 130px;
	flex: 1 1 auto;
	text-align: center;
	transition: filter 0.15s ease, background 0.15s ease, color 0.15s ease;
}

/* Accept-all & Reject-all: identical footprint (equal prominence). */
#sda-cc-banner .sda-cc-btn-primary,
#sda-cc-banner .sda-cc-btn-reject {
	background: var( --sda-cc-primary );
	color: #fff;
	border-color: var( --sda-cc-primary );
}

#sda-cc-banner .sda-cc-btn-primary:hover,
#sda-cc-banner .sda-cc-btn-reject:hover {
	filter: brightness( 1.08 );
}

/* Secondary actions (manage, save) — visually subordinate, never the consent buttons. */
#sda-cc-banner .sda-cc-btn-secondary {
	background: transparent;
	color: #fff;
	border-color: #555;
	font-weight: 600;
}

#sda-cc-banner .sda-cc-btn-secondary:hover {
	border-color: #888;
}

#sda-cc-banner .sda-cc-btn:focus-visible {
	outline: 2px solid #fff;
	outline-offset: 2px;
}

/* --- category toggles (manage mode) --- */
#sda-cc-banner .sda-cc-categories {
	display: none;
	flex-direction: column;
	gap: 6px;
	margin: 4px 0;
	padding: 12px;
	background: rgba( 255, 255, 255, 0.05 );
	border-radius: 10px;
}

#sda-cc-banner.sda-cc-managing .sda-cc-categories {
	display: flex;
}

#sda-cc-banner .sda-cc-cat {
	display: flex;
	align-items: center;
	gap: 10px;
	font-size: 13px;
	padding: 6px 4px;
}

#sda-cc-banner .sda-cc-cat input[type="checkbox"] {
	width: 18px;
	height: 18px;
	margin: 0;
	accent-color: var( --sda-cc-primary );
	cursor: pointer;
	flex: 0 0 auto;
}

#sda-cc-banner .sda-cc-cat input[disabled] {
	cursor: not-allowed;
	opacity: 0.7;
}

#sda-cc-banner .sda-cc-cat label {
	cursor: pointer;
}

/* --- recall button --- */
#sda-cc-recall {
	--sda-cc-primary: #2563eb;
	position: fixed;
	bottom: 16px;
	right: 16px;
	left: auto;
	z-index: 2147483000;
	-webkit-appearance: none;
	appearance: none;
	font: inherit;
	font-size: 12px;
	font-weight: 600;
	padding: 8px 14px;
	border-radius: 999px;
	border: none;
	background: var( --sda-cc-primary );
	color: #fff;
	cursor: pointer;
	box-shadow: 0 3px 12px rgba( 0, 0, 0, 0.3 );
}

#sda-cc-recall:hover {
	filter: brightness( 1.08 );
}

#sda-cc-recall:focus-visible {
	outline: 2px solid #fff;
	outline-offset: 2px;
}

/* --- RTL overrides --- */
[dir="rtl"]#sda-cc-banner,
#sda-cc-banner[dir="rtl"] {
	text-align: right;
}

#sda-cc-banner[dir="rtl"].sda-cc-pos-box {
	left: auto;
	right: 20px;
}

#sda-cc-recall[dir="rtl"] {
	right: auto;
	left: 16px;
}

/* --- responsive --- */
@media ( max-width: 600px ) {
	#sda-cc-banner.sda-cc-pos-box {
		left: 10px;
		right: 10px;
		bottom: 10px;
		max-width: none;
		width: auto;
	}

	#sda-cc-banner[dir="rtl"].sda-cc-pos-box {
		right: 10px;
	}

	#sda-cc-banner .sda-cc-btn {
		min-width: 0;
		flex: 1 1 100%;
	}
}

/* ---------------------------------------------------------------------------
 * Overlay contract
 *
 * `body.sda-overlay-open` means the page has a full-screen overlay of its own
 * (a gallery lightbox, a video player). The banner sits at the top of the
 * stacking order by design, which over an overlay means covering its controls.
 * It slides out for the duration and returns on close, so consent is deferred,
 * never skipped: nothing is stored and no script is unblocked in the meantime.
 * ------------------------------------------------------------------------- */
body.sda-overlay-open #sda-cc-banner {
	transform: translateY(110%);
	opacity: 0;
	pointer-events: none;
	transition: transform 0.28s ease, opacity 0.28s ease;
}

body.sda-overlay-open #sda-cc-recall {
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
	transition: opacity 0.2s ease, visibility 0.2s ease;
}

@media (prefers-reduced-motion: reduce) {
	body.sda-overlay-open #sda-cc-banner {
		transition: none;
	}
}
