/* Aviso de cookies — material translúcido que emerge desde abajo (mismo camino de entrada y salida). */

.ck-banner {
	--ck-ink: var(--s-ink, #1d1d1f);
	--ck-muted: var(--s-muted, #6e6e73);
	--ck-brand: var(--s-brand, #312783);
	position: fixed;
	z-index: 9990;
	inset: auto 16px 16px 16px;
	display: flex;
	justify-content: flex-start;
	pointer-events: none;
}

.ck-card {
	pointer-events: auto;
	width: min(440px, 100%);
	padding: 20px 20px 16px;
	border-radius: 22px;
	color: var(--ck-ink);
	background: rgba(255, 255, 255, 0.78);
	-webkit-backdrop-filter: blur(24px) saturate(180%);
	backdrop-filter: blur(24px) saturate(180%);
	border: 1px solid rgba(255, 255, 255, 0.6);
	box-shadow: 0 1px 0 rgba(255, 255, 255, 0.8) inset, 0 24px 60px -12px rgba(17, 12, 60, 0.28), 0 2px 8px rgba(17, 12, 60, 0.08);
	opacity: 0;
	transform: translateY(24px) scale(0.98);
	filter: blur(6px);
	transition: opacity 0.35s cubic-bezier(0.32, 0.72, 0, 1), transform 0.45s cubic-bezier(0.32, 0.72, 0, 1), filter 0.35s cubic-bezier(0.32, 0.72, 0, 1);
}
.ck-banner.is-in .ck-card {
	opacity: 1;
	transform: none;
	filter: none;
}

.ck-title {
	margin: 0 0 6px;
	font-size: 1.0625rem;
	font-weight: 650;
	letter-spacing: -0.01em;
}
.ck-text {
	margin: 0 0 16px;
	font-size: 0.875rem;
	line-height: 1.5;
	color: var(--ck-muted);
	letter-spacing: 0.005em;
}
.ck-text a {
	color: var(--ck-brand);
	font-weight: 500;
}

.ck-actions {
	display: flex;
	gap: 8px;
	flex-wrap: wrap;
}
.ck-btn {
	flex: 1 1 auto;
	min-height: 44px;
	padding: 0 16px;
	border: 0;
	border-radius: 999px;
	font: inherit;
	font-size: 0.875rem;
	font-weight: 600;
	cursor: pointer;
	transition: transform 0.1s ease-out, background-color 0.2s ease;
	-webkit-tap-highlight-color: transparent;
}
.ck-btn:active {
	transform: scale(0.97);
}
.ck-btn:focus-visible {
	outline: 2px solid var(--ck-brand);
	outline-offset: 2px;
}
.ck-btn-primary {
	background: var(--ck-brand);
	color: #fff;
}
/* "Rechazar" tiene el mismo peso visual que "Aceptar": la elección tiene que ser libre. */
.ck-btn-soft {
	background: rgba(49, 39, 131, 0.1);
	color: var(--ck-brand);
}
.ck-btn-ghost {
	background: transparent;
	color: var(--ck-ink);
	flex-grow: 0;
	text-decoration: underline;
	text-underline-offset: 3px;
}

@media (hover: hover) and (pointer: fine) {
	.ck-btn-primary:hover { background: #271f6c; }
	.ck-btn-soft:hover { background: rgba(49, 39, 131, 0.16); }
}

/* Diálogo de preferencias */
.ck-dialog {
	--ck-ink: var(--s-ink, #1d1d1f);
	--ck-muted: var(--s-muted, #6e6e73);
	--ck-brand: var(--s-brand, #312783);
	width: min(480px, calc(100% - 32px));
	padding: 0;
	border: 0;
	border-radius: 24px;
	color: var(--ck-ink);
	background: #fff;
	box-shadow: 0 30px 80px -20px rgba(17, 12, 60, 0.45);
}
.ck-dialog::backdrop {
	background: rgba(10, 8, 30, 0.4);
	-webkit-backdrop-filter: blur(4px);
	backdrop-filter: blur(4px);
}
.ck-dialog[open] {
	animation: ck-pop 0.4s cubic-bezier(0.32, 0.72, 0, 1);
}
.ck-dialog[open]::backdrop {
	animation: ck-fade 0.3s ease;
}
@keyframes ck-pop {
	from { opacity: 0; transform: translateY(16px) scale(0.97); }
}
@keyframes ck-fade {
	from { opacity: 0; }
}
.ck-panel {
	padding: 24px;
}
.ck-panel .ck-title {
	font-size: 1.25rem;
}
.ck-option {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	padding: 14px 0;
	border-top: 1px solid rgba(0, 0, 0, 0.08);
}
.ck-option:last-of-type {
	margin-bottom: 16px;
}
.ck-opt-title {
	margin: 0;
	font-weight: 600;
	font-size: 0.9375rem;
}
.ck-opt-text {
	margin: 2px 0 0;
	font-size: 0.8125rem;
	color: var(--ck-muted);
}

/* Interruptor estilo iOS */
.ck-switch {
	position: relative;
	flex: none;
	width: 51px;
	height: 31px;
	cursor: pointer;
}
.ck-switch input {
	position: absolute;
	inset: 0;
	opacity: 0;
	margin: 0;
	cursor: inherit;
}
.ck-switch span {
	position: absolute;
	inset: 0;
	border-radius: 999px;
	background: #e3e3e8;
	transition: background-color 0.25s ease;
}
.ck-switch span::after {
	content: "";
	position: absolute;
	top: 2px;
	left: 2px;
	width: 27px;
	height: 27px;
	border-radius: 50%;
	background: #fff;
	box-shadow: 0 3px 8px rgba(0, 0, 0, 0.15), 0 1px 1px rgba(0, 0, 0, 0.16);
	transition: transform 0.35s cubic-bezier(0.32, 0.72, 0, 1);
}
.ck-switch input:checked + span {
	background: #34c759;
}
.ck-switch input:checked + span::after {
	transform: translateX(20px);
}
.ck-switch input:focus-visible + span {
	outline: 2px solid var(--ck-brand);
	outline-offset: 2px;
}
.ck-switch.is-locked {
	opacity: 0.55;
	cursor: not-allowed;
}

@media (max-width: 600px) {
	.ck-banner {
		inset: auto 8px 8px 8px;
	}
	.ck-card {
		width: 100%;
	}
	.ck-btn-ghost {
		order: 3;
		flex-basis: 100%;
	}
}

@media (prefers-reduced-motion: reduce) {
	.ck-card {
		transform: none;
		filter: none;
		transition: opacity 0.2s ease;
	}
	.ck-dialog[open],
	.ck-dialog[open]::backdrop {
		animation: ck-fade 0.2s ease;
	}
	.ck-switch span::after {
		transition: none;
	}
}

@media (prefers-reduced-transparency: reduce) {
	.ck-card {
		background: #fff;
		-webkit-backdrop-filter: none;
		backdrop-filter: none;
	}
}

@media (prefers-contrast: more) {
	.ck-card {
		background: #fff;
		border: 2px solid var(--ck-ink);
	}
	.ck-text {
		color: var(--ck-ink);
	}
}
