/**
 * Simple Cookie Consent — RTL banner, preferences modal, floating button.
 * Colors are CSS variables so a theme can restyle without touching this file.
 */

#scc-root {
	--scc-bg: #ffffff;
	--scc-fg: #1f2430;
	--scc-muted: #5b6472;
	--scc-border: #e3e6ec;
	--scc-accent: #1f6feb;
	--scc-accent-fg: #ffffff;
	--scc-radius: 10px;
	--scc-shadow: 0 6px 32px rgba(15, 23, 42, .18);

	direction: rtl;
	font-family: inherit;
	line-height: 1.6;
}

#scc-root button {
	font-family: inherit;
}

/* The display rules below would otherwise beat the [hidden] attribute. */
#scc-root [hidden] {
	display: none !important;
}

/* ------------------------------------------------------------------ banner */

#scc-root .scc-banner {
	position: fixed;
	inset-inline: 0;
	bottom: 0;
	z-index: 999999;
	background: var(--scc-bg);
	color: var(--scc-fg);
	border-top: 1px solid var(--scc-border);
	box-shadow: var(--scc-shadow);
	transform: translateY(100%);
	transition: transform .28s ease;
}

#scc-root .scc-banner.scc-in {
	transform: translateY(0);
}

#scc-root .scc-banner-inner {
	max-width: 1180px;
	margin: 0 auto;
	padding: 18px 20px;
	display: flex;
	align-items: center;
	gap: 24px;
	flex-wrap: wrap;
}

#scc-root .scc-banner-text {
	flex: 1 1 380px;
	min-width: 260px;
}

#scc-root .scc-banner-title {
	margin: 0 0 4px;
	font-size: 17px;
	font-weight: 700;
	color: var(--scc-fg);
}

#scc-root .scc-banner-text p {
	margin: 0;
	font-size: 14px;
	color: var(--scc-muted);
}

#scc-root .scc-policy {
	color: var(--scc-accent);
	text-decoration: underline;
	white-space: nowrap;
}

#scc-root .scc-banner-actions {
	display: flex;
	align-items: center;
	gap: 10px;
	flex-wrap: wrap;
}

/* ----------------------------------------------------------------- buttons */

#scc-root .scc-btn {
	appearance: none;
	border: 1px solid transparent;
	border-radius: var(--scc-radius);
	padding: 10px 22px;
	font-size: 14px;
	font-weight: 600;
	cursor: pointer;
	transition: opacity .15s ease, background-color .15s ease;
	white-space: nowrap;
}

#scc-root .scc-btn:hover {
	opacity: .88;
}

#scc-root .scc-btn:focus-visible,
#scc-root .scc-close:focus-visible,
#scc-root .scc-floating:focus-visible {
	outline: 2px solid var(--scc-accent);
	outline-offset: 2px;
}

#scc-root .scc-btn-primary {
	background: var(--scc-accent);
	color: var(--scc-accent-fg);
}

#scc-root .scc-btn-secondary {
	background: transparent;
	color: var(--scc-fg);
	border-color: var(--scc-border);
}

#scc-root .scc-btn-link {
	background: none;
	color: var(--scc-muted);
	text-decoration: underline;
	padding: 10px 6px;
}

/* ------------------------------------------------------------------- modal */

#scc-root .scc-modal-overlay {
	position: fixed;
	inset: 0;
	z-index: 1000000;
	background: rgba(15, 23, 42, .55);
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;
}

#scc-root .scc-modal {
	background: var(--scc-bg);
	color: var(--scc-fg);
	border-radius: 14px;
	box-shadow: var(--scc-shadow);
	width: 100%;
	max-width: 620px;
	max-height: 86vh;
	display: flex;
	flex-direction: column;
}

#scc-root .scc-modal-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 18px 22px;
	border-bottom: 1px solid var(--scc-border);
}

#scc-root .scc-modal-head h2 {
	margin: 0;
	font-size: 18px;
	font-weight: 700;
}

#scc-root .scc-close {
	background: none;
	border: 0;
	font-size: 28px;
	line-height: 1;
	color: var(--scc-muted);
	cursor: pointer;
	padding: 0 4px;
}

#scc-root .scc-modal-body {
	padding: 6px 22px 18px;
	overflow-y: auto;
}

#scc-root .scc-modal-intro {
	font-size: 14px;
	color: var(--scc-muted);
	margin: 14px 0 4px;
}

#scc-root .scc-cat {
	padding: 14px 0;
	border-bottom: 1px solid var(--scc-border);
}

#scc-root .scc-cat:last-child {
	border-bottom: 0;
}

#scc-root .scc-cat-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 14px;
}

#scc-root .scc-cat-name {
	font-size: 15px;
	font-weight: 600;
	margin: 0;
	cursor: pointer;
}

#scc-root .scc-cat-desc {
	margin: 6px 0 0;
	font-size: 13.5px;
	color: var(--scc-muted);
}

#scc-root .scc-always {
	font-size: 13px;
	color: var(--scc-muted);
	white-space: nowrap;
}

#scc-root .scc-modal-foot {
	display: flex;
	gap: 10px;
	flex-wrap: wrap;
	padding: 16px 22px;
	border-top: 1px solid var(--scc-border);
}

/* ------------------------------------------------------------------ switch */

#scc-root .scc-switch {
	position: relative;
	display: inline-block;
	width: 46px;
	height: 26px;
	flex: none;
}

#scc-root .scc-switch input {
	position: absolute;
	opacity: 0;
	width: 100%;
	height: 100%;
	margin: 0;
	cursor: pointer;
	z-index: 1;
}

#scc-root .scc-slider {
	position: absolute;
	inset: 0;
	background: #c9ced8;
	border-radius: 26px;
	transition: background-color .2s ease;
	pointer-events: none;
}

#scc-root .scc-slider::before {
	content: "";
	position: absolute;
	top: 3px;
	right: 3px;
	width: 20px;
	height: 20px;
	background: #fff;
	border-radius: 50%;
	transition: transform .2s ease;
}

#scc-root .scc-switch input:checked + .scc-slider {
	background: var(--scc-accent);
}

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

#scc-root .scc-switch input:focus-visible + .scc-slider {
	outline: 2px solid var(--scc-accent);
	outline-offset: 2px;
}

/* -------------------------------------------------------- floating trigger */

#scc-root .scc-floating {
	position: fixed;
	bottom: 18px;
	inset-inline-start: 18px;
	z-index: 999998;
	width: 46px;
	height: 46px;
	border-radius: 50%;
	border: 1px solid var(--scc-border);
	background: var(--scc-bg);
	box-shadow: var(--scc-shadow);
	font-size: 22px;
	line-height: 1;
	cursor: pointer;
}

.scc-inline-link {
	background: none;
	border: 0;
	padding: 0;
	color: inherit;
	text-decoration: underline;
	cursor: pointer;
	font: inherit;
}

body.scc-noscroll {
	overflow: hidden;
}

/* ------------------------------------------------------------------ mobile */

@media (max-width: 640px) {
	#scc-root .scc-banner-inner {
		padding: 16px;
		gap: 14px;
	}

	#scc-root .scc-banner-actions {
		width: 100%;
	}

	#scc-root .scc-banner-actions .scc-btn {
		flex: 1 1 auto;
		text-align: center;
	}

	#scc-root .scc-modal-foot .scc-btn {
		flex: 1 1 100%;
	}

	#scc-root .scc-floating {
		bottom: 12px;
		inset-inline-start: 12px;
	}
}

@media (prefers-reduced-motion: reduce) {
	#scc-root .scc-banner {
		transition: none;
	}
}

/* ------------------------------------------------------------------- dark */

@media (prefers-color-scheme: dark) {
	#scc-root {
		--scc-bg: #171a21;
		--scc-fg: #e8ebf0;
		--scc-muted: #a2abba;
		--scc-border: #2c313b;
		--scc-accent: #4c8dff;
		--scc-accent-fg: #0d1017;
	}

	#scc-root .scc-slider {
		background: #414855;
	}
}
