/* Tab sticky stânga-jos — redeschide setările cookie */
.cv-cookie-sticky {
	position: fixed;
	left: max(14px, env(safe-area-inset-left, 0px));
	bottom: max(18px, env(safe-area-inset-bottom, 0px));
	top: auto;
	right: auto;
	transform: none;
	z-index: 99990;
	width: 52px;
	height: 52px;
	padding: 0;
	margin: 0;
	border: 1px solid rgba(255, 255, 255, 0.22);
	border-radius: 14px;
	background: var(--cv-primary);
	color: var(--cv-on-primary);
	box-shadow: 0 4px 18px rgba(0, 0, 0, 0.2);
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease, opacity 0.2s ease, visibility 0.2s ease;
}

.cv-cookie-sticky:hover {
	filter: brightness(1.05);
	transform: translateY(-2px);
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.22);
}

.cv-cookie-sticky:active {
	transform: translateY(0);
}

.cv-cookie-sticky:focus-visible {
	outline: 2px solid var(--cv-link);
	outline-offset: 3px;
}

.cv-cookie-sticky-icon {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 28px;
	height: 28px;
	flex-shrink: 0;
}

.cv-cookie-sticky-icon svg {
	display: block;
	width: 100%;
	height: 100%;
	overflow: visible;
}

.cv-cookie-sticky.cv-sticky-hidden {
	visibility: hidden;
	opacity: 0;
	pointer-events: none;
}

/* Poziție „stânga-jos”: cardul e în stânga — mutăm tab-ul de redeschidere în dreapta jos */
html[data-cv-banner-placement='bottom_left'] .cv-cookie-sticky {
	left: auto;
	right: max(14px, env(safe-area-inset-right, 0px));
}

/* Fundal blur + semiopac peste pagină (sub banner) */
.cv-backdrop {
	position: fixed;
	inset: 0;
	z-index: 99999;
	background: rgba(0, 0, 0, 0.14);
	-webkit-backdrop-filter: blur(3px);
	backdrop-filter: blur(3px);
	pointer-events: auto;
}

@supports not ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
	.cv-backdrop {
		background: rgba(0, 0, 0, 0.22);
	}
}

.cv-banner {
	--cv-bg: #14161c;
	--cv-text: #f4f4f5;
	--cv-muted: #a1a1aa;
	--cv-primary: #2563eb;
	--cv-on-primary: #ffffff;
	--cv-border: #3f3f46;
	--cv-link: #93c5fd;
	--cv-panel: #1c1f26;

	position: fixed;
	z-index: 100000;
	left: 0;
	right: 0;
	bottom: 0;
	padding: 0;
	font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
	font-size: 15px;
	line-height: 1.5;
	color: var(--cv-text);
	background: var(--cv-bg);
	box-shadow: 0 -12px 40px rgba(0, 0, 0, 0.18);
	border-top: 1px solid var(--cv-border);
	max-height: 90vh;
	overflow: hidden;
	display: flex;
	flex-direction: column;
	align-items: stretch;
}

/* Mijloc — dialog centrat */
.cv-banner.cv-placement-center {
	left: 50%;
	right: auto;
	top: 50%;
	bottom: auto;
	transform: translate(-50%, -50%);
	width: min(94vw, 760px);
	max-width: 760px;
	max-height: min(88vh, 720px);
	border-radius: 16px;
	border: 1px solid var(--cv-border);
	box-shadow: 0 24px 80px rgba(0, 0, 0, 0.35);
}

/* Stânga-jos — card compact */
.cv-banner.cv-placement-bottom-left {
	left: max(14px, env(safe-area-inset-left, 0px));
	right: auto;
	top: auto;
	bottom: max(18px, env(safe-area-inset-bottom, 0px));
	transform: none;
	width: min(calc(100vw - 28px), 620px);
	max-width: 620px;
	max-height: min(85vh, 640px);
	border-radius: 16px;
	border: 1px solid var(--cv-border);
	box-shadow: 0 16px 48px rgba(0, 0, 0, 0.28);
}

/* Desktop: centru și stânga-jos — minim 700px lățime, card mai lat */
@media (min-width: 768px) {
	.cv-banner.cv-placement-center {
		width: min(94vw, 960px);
		max-width: 960px;
		min-width: 700px;
	}

	.cv-banner.cv-placement-bottom-left {
		width: min(calc(100vw - 28px), 960px);
		max-width: 960px;
		min-width: 700px;
	}
}

.cv-shell {
	flex: 0 0 auto;
	max-width: 1040px;
	margin: 0 auto;
	padding: 14px 20px 12px;
	width: 100%;
	box-sizing: border-box;
	overflow-y: auto;
	max-height: 90vh;
}

.cv-main-row {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-end;
	justify-content: space-between;
	gap: 16px 24px;
}

.cv-intro {
	flex: 1 1 260px;
	font-size: 15px;
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.cv-intro-text :first-child {
	margin-top: 0;
}

.cv-intro-text > *:last-child {
	margin-bottom: 0;
}

.cv-intro-policy {
	margin: 0;
	font-size: 14px;
	line-height: 1.4;
}

.cv-intro a {
	color: var(--cv-link);
	text-decoration: underline;
	text-underline-offset: 2px;
}

.cv-policy-link {
	color: var(--cv-link);
	text-decoration: none;
	font-weight: 600;
	padding: 0;
	display: inline;
	border-bottom: none;
}

.cv-actions-short {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: flex-end;
	gap: 10px;
}

.cv-btn {
	cursor: pointer;
	border: 1px solid var(--cv-border);
	background: transparent;
	color: var(--cv-text);
	padding: 10px 16px;
	border-radius: 999px;
	font-size: 14px;
	font-weight: 600;
	transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
}

.cv-btn:hover {
	border-color: var(--cv-muted);
}

.cv-btn:active {
	transform: scale(0.98);
}

.cv-btn-primary {
	background: var(--cv-primary);
	border-color: var(--cv-primary);
	color: var(--cv-on-primary);
}

.cv-btn-primary:hover {
	filter: brightness(1.08);
	border-color: var(--cv-primary);
}

.cv-btn-outline {
	border-color: var(--cv-border);
}

.cv-btn-ghost {
	border-color: transparent;
	background: rgba(255, 255, 255, 0.06);
}

.cv-btn-ghost:hover {
	background: rgba(255, 255, 255, 0.1);
}

.cv-link {
	color: var(--cv-link);
	font-size: 14px;
	font-weight: 600;
	text-decoration: none;
	border-bottom: 1px solid transparent;
	padding: 10px 4px;
}

.cv-link:hover {
	border-bottom-color: var(--cv-link);
}

.cv-intro-text .cv-policy-link {
	padding: 0;
	border-bottom: none;
	text-decoration: none;
}

.cv-intro-text .cv-policy-link:hover,
.cv-intro-text .cv-policy-link:focus {
	border-bottom: none;
	text-decoration: none;
}

/* Panou: fără rezervă de înălțime când e închis (evită bandă goală sub butoane) */
.cv-banner:not(.cv-panel-open) .cv-custom-wrap {
	display: none;
}

.cv-banner.cv-panel-open .cv-custom-wrap {
	display: grid;
	grid-template-rows: 1fr;
	margin-top: 14px;
	animation: cv-panel-in 0.28s ease-out;
}

@keyframes cv-panel-in {
	from {
		opacity: 0;
		transform: translateY(6px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

.cv-custom-wrap > * {
	min-height: 0;
}

.cv-custom-inner {
	border-radius: 14px;
	background: var(--cv-panel);
	border: 1px solid var(--cv-border);
	padding: 16px 18px 14px;
	box-sizing: border-box;
	overflow: hidden;
}

.cv-banner.cv-panel-open .cv-custom-inner {
	max-height: min(60vh, 560px);
	overflow-y: auto;
}

.cv-toggle-list {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	column-gap: 20px;
	row-gap: 10px;
	align-items: stretch;
	padding: 2px 0 6px;
}

.cv-cat-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 10px 6px;
	border-radius: 8px;
	background: rgba(255, 255, 255, 0.04);
	border: 1px solid var(--cv-border);
	min-width: 0;
}

@media (max-width: 520px) {
	.cv-toggle-list {
		grid-template-columns: 1fr;
	}
}

.cv-cat-copy {
	display: flex;
	flex-direction: column;
	gap: 3px;
	min-width: 0;
	flex: 1;
}

.cv-cat-copy strong {
	font-weight: 600;
	font-size: 14px;
}

.cv-cat-desc {
	font-size: 13px;
	color: var(--cv-muted);
	line-height: 1.35;
}

.cv-cat-meta {
	font-size: 12px;
	color: var(--cv-muted);
	line-height: 1.35;
	opacity: 0.92;
}

/* Toggle (vizual) — input real pentru accesibilitate */
.cv-toggle {
	position: relative;
	display: inline-flex;
	align-items: center;
	cursor: pointer;
	flex-shrink: 0;
	width: 48px;
	height: 28px;
}

.cv-toggle-input {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	margin: 0;
	opacity: 0;
	z-index: 2;
	cursor: pointer;
}

.cv-toggle-track {
	width: 48px;
	height: 28px;
	border-radius: 999px;
	background: rgba(255, 255, 255, 0.12);
	border: 1px solid var(--cv-border);
	box-sizing: border-box;
	transition: background 0.2s ease, border-color 0.2s ease;
	position: relative;
}

.cv-toggle-thumb {
	position: absolute;
	top: 3px;
	left: 3px;
	width: 20px;
	height: 20px;
	border-radius: 50%;
	background: #fff;
	box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
	transition: transform 0.22s cubic-bezier(0.4, 0, 0.2, 1), background 0.2s ease;
}

.cv-toggle-input:checked + .cv-toggle-track {
	background: var(--cv-primary);
	border-color: var(--cv-primary);
}

.cv-toggle-input:checked + .cv-toggle-track .cv-toggle-thumb {
	transform: translateX(20px);
	background: var(--cv-on-primary);
}

.cv-toggle-input:focus-visible + .cv-toggle-track {
	outline: 2px solid var(--cv-link);
	outline-offset: 3px;
}

.cv-panel-actions {
	display: flex;
	justify-content: flex-end;
	margin-top: 14px;
	padding-top: 4px;
}

@media (max-width: 600px) {
	.cv-shell {
		padding: 12px 14px 10px;
	}

	.cv-actions-short {
		justify-content: stretch;
		width: 100%;
	}

	.cv-actions-short .cv-btn {
		flex: 1 1 auto;
		text-align: center;
		justify-content: center;
	}
}
