/* ==========================================================================
   Luna y el Tarot · Consentimiento de cookies
   ========================================================================== */

.luna-cc {
	--cc-bg: #1a1625;
	--cc-text: #faf9f6;
	--cc-muted: rgba(250, 249, 246, 0.72);
	--cc-accent: #957bea;
	--cc-accent-hover: #a893f0;
	--cc-line: rgba(250, 249, 246, 0.12);

	position: fixed;
	left: 24px;
	bottom: 24px;
	z-index: 99999;
	width: calc(100% - 48px);
	max-width: 520px;
	font-family: 'Nunito', system-ui, sans-serif;
	color: var(--cc-text);
	opacity: 0;
	transform: translateY(16px);
	transition: opacity 0.25s ease, transform 0.25s ease;
}

.luna-cc[hidden] { display: none; }

.luna-cc.is-visible {
	opacity: 1;
	transform: none;
}

.luna-cc__box {
	background: var(--cc-bg);
	border: 1px solid var(--cc-line);
	border-radius: 18px;
	padding: 22px 24px;
	box-shadow: 0 18px 48px rgba(26, 22, 37, 0.35);
	max-height: calc(100vh - 48px);
	overflow-y: auto;
}

.luna-cc__title {
	margin: 0 0 8px;
	font-family: 'Bricolage Grotesque', 'Nunito', sans-serif;
	font-size: 19px;
	font-weight: 700;
	line-height: 1.25;
	color: var(--cc-text);
}

.luna-cc__text {
	margin: 0;
	font-size: 14.5px;
	line-height: 1.55;
	color: var(--cc-muted);
}

.luna-cc__link {
	color: var(--cc-accent);
	text-decoration: underline;
	text-underline-offset: 2px;
	white-space: nowrap;
}

.luna-cc__link:hover { color: var(--cc-accent-hover); }

/* ---------- Panel de preferencias ---------- */

.luna-cc__cat {
	padding: 14px 0;
	border-top: 1px solid var(--cc-line);
}

.luna-cc__cat:first-of-type { border-top: 0; padding-top: 6px; }

.luna-cc__cat-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
}

.luna-cc__cat-label {
	font-weight: 700;
	font-size: 15px;
}

.luna-cc__cat-desc {
	margin: 6px 0 0;
	font-size: 13.5px;
	line-height: 1.5;
	color: var(--cc-muted);
}

.luna-cc__always {
	font-size: 12.5px;
	font-weight: 700;
	color: var(--cc-accent);
}

.luna-cc__switch {
	position: relative;
	display: inline-block;
	flex-shrink: 0;
	width: 44px;
	height: 24px;
	cursor: pointer;
}

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

.luna-cc__slider {
	position: absolute;
	inset: 0;
	border-radius: 999px;
	background: rgba(250, 249, 246, 0.22);
	transition: background 0.2s ease;
	pointer-events: none;
}

.luna-cc__slider::before {
	content: '';
	position: absolute;
	top: 3px;
	left: 3px;
	width: 18px;
	height: 18px;
	border-radius: 50%;
	background: var(--cc-text);
	transition: transform 0.2s ease;
}

.luna-cc__switch input:checked + .luna-cc__slider { background: var(--cc-accent); }
.luna-cc__switch input:checked + .luna-cc__slider::before { transform: translateX(20px); }
.luna-cc__switch input:focus-visible + .luna-cc__slider {
	outline: 2px solid var(--cc-accent);
	outline-offset: 2px;
}

.luna-cc__panel .luna-cc__text { margin-top: 10px; }

.luna-cc__id {
	margin: 12px 0 0;
	font-size: 12px;
	color: var(--cc-muted);
	word-break: break-all;
}

.luna-cc__id[hidden] { display: none; }

.luna-cc__id code {
	font-size: 11.5px;
	background: rgba(250, 249, 246, 0.08);
	color: var(--cc-text);
	padding: 2px 6px;
	border-radius: 6px;
}

/* ---------- Botones ---------- */

.luna-cc__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	margin-top: 18px;
}

/* Aceptar y Rechazar con el mismo peso visual (Guía AEPD). */
.luna-cc__btn {
	flex: 1 1 0;
	min-width: 120px;
	padding: 11px 16px;
	border: 1.5px solid var(--cc-accent);
	border-radius: 999px;
	background: var(--cc-accent);
	color: #fff;
	font-family: inherit;
	font-size: 14.5px;
	font-weight: 700;
	line-height: 1.2;
	cursor: pointer;
	transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.luna-cc__btn:hover {
	background: var(--cc-accent-hover);
	border-color: var(--cc-accent-hover);
}

.luna-cc__btn--ghost {
	flex-basis: 100%;
	background: transparent;
	border-color: var(--cc-line);
	color: var(--cc-text);
}

.luna-cc__btn--ghost:hover {
	background: rgba(250, 249, 246, 0.06);
	border-color: var(--cc-accent);
}

.luna-cc__btn[hidden] { display: none; }

.luna-cc__btn:focus-visible,
.luna-cc__link:focus-visible {
	outline: 2px solid var(--cc-accent);
	outline-offset: 3px;
}

/* ---------- Móvil ---------- */

@media (max-width: 600px) {
	.luna-cc {
		left: 12px;
		bottom: 12px;
		width: calc(100% - 24px);
	}

	.luna-cc__box { padding: 18px; border-radius: 16px; }
	.luna-cc__title { font-size: 17px; }
	.luna-cc__text { font-size: 14px; }
	.luna-cc__btn { min-width: 0; }
}

@media (prefers-reduced-motion: reduce) {
	.luna-cc,
	.luna-cc__slider,
	.luna-cc__slider::before { transition: none; }
}
