/* Aviso y panel de cookies + iframes con permiso (inc/consent.php). */

.cc-consent {
	position: fixed;
	left: 16px;
	bottom: 16px;
	z-index: 10000;
	width: min(440px, calc(100vw - 32px));
	opacity: 0;
	transform: translateY(12px);
	transition: opacity .25s ease, transform .25s ease;
}
.cc-consent.is-visible { opacity: 1; transform: none; }
.cc-consent[hidden] { display: none; }
.cc-consent__card {
	padding: 24px;
	border: 1px solid var(--ds-line);
	border-radius: var(--ds-radius-card);
	background: var(--ds-white);
	box-shadow: var(--cc-shadow-xl);
	color: var(--ds-ink);
	font-family: var(--cc-font-body);
}
.cc-consent__title {
	margin: 0 0 8px;
	font-family: var(--cc-font-heading);
	font-size: 19px;
	font-weight: var(--ds-fw-heading);
	line-height: 1.3;
	color: var(--ds-ink);
}
.cc-consent__text { margin: 0 0 18px; font-size: 14.5px; line-height: 1.55; color: var(--ds-ink-2); }
.cc-consent__text a,
.cc-prefs a { color: var(--ds-ink); text-decoration: underline; text-underline-offset: 3px; }
.cc-consent__actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.cc-consent__btn.ds-btn { min-height: 44px; padding: 0 16px; font-size: 14.5px; white-space: normal; }
.cc-consent__link {
	grid-column: 1 / -1;
	justify-self: center;
	padding: 6px 8px;
	border: 0;
	background: none;
	font: 600 14.5px/1.3 var(--cc-font-body);
	color: var(--ds-ink);
	text-decoration: underline;
	text-underline-offset: 3px;
	cursor: pointer;
}
.cc-consent__link:hover,
.cc-embed__always:hover { color: var(--ds-accent); }

/* Panel de configuración */
.cc-prefs {
	position: fixed;
	inset: 0;
	width: min(620px, calc(100vw - 32px));
	height: fit-content;
	max-height: calc(100vh - 48px);
	margin: auto;
	padding: 0;
	border: 0;
	border-radius: var(--ds-radius-panel);
	background: var(--ds-white);
	color: var(--ds-ink);
	box-shadow: var(--cc-shadow-xl);
	font-family: var(--cc-font-body);
}
.cc-prefs::backdrop { background: rgba(24, 24, 24, .55); }
.cc-prefs__form { display: flex; flex-direction: column; max-height: calc(100vh - 48px); margin: 0; }
.cc-prefs__head { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 22px 24px 14px; border-bottom: 1px solid var(--ds-line); }
.cc-prefs__title { margin: 0; font-family: var(--cc-font-heading); font-size: 22px; font-weight: var(--ds-fw-heading); color: var(--ds-ink); }
.cc-prefs__close { display: grid; place-items: center; width: 40px; height: 40px; border: 0; border-radius: 50%; background: var(--ds-surface); color: var(--ds-ink); cursor: pointer; }
.cc-prefs__close:hover { background: var(--ds-surface-2); }
.cc-prefs__body { overflow-y: auto; padding: 18px 24px; }
.cc-prefs__intro { margin: 0 0 8px; font-size: 14.5px; line-height: 1.55; color: var(--ds-ink-2); }
.cc-prefs__cat { padding: 16px 0; border-bottom: 1px solid var(--ds-line); }
.cc-prefs__cat:last-child { border-bottom: 0; }
.cc-prefs__row { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.cc-prefs__label { font-size: 16px; font-weight: 600; color: var(--ds-ink); cursor: pointer; }
.cc-prefs__always { font-size: 13.5px; font-weight: 600; color: var(--ds-muted); }
.cc-prefs__desc { margin: 6px 0 4px; font-size: 14.5px; line-height: 1.55; color: var(--ds-ink-2); }
.cc-prefs__providers { margin: 0; font-size: 13.5px; line-height: 1.5; color: var(--ds-muted); }
.cc-prefs__foot { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; padding: 16px 24px 22px; border-top: 1px solid var(--ds-line); }

/* Interruptor */
.cc-switch { position: relative; display: inline-flex; flex: none; width: 46px; height: 26px; }
.cc-switch input { position: absolute; inset: 0; z-index: 1; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.cc-switch__track { position: absolute; inset: 0; border-radius: 999px; background: var(--ds-line-2); transition: background .2s ease; }
.cc-switch__track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .2); transition: transform .2s ease; }
.cc-switch input:checked + .cc-switch__track { background: var(--ds-ink); }
.cc-switch input:checked + .cc-switch__track::after { transform: translateX(20px); }
.cc-switch input:focus-visible + .cc-switch__track { outline: 2px solid var(--ds-accent); outline-offset: 2px; }

/* Iframes de terceros con permiso */
.cc-embed { position: relative; width: 100%; height: 100%; min-height: 240px; }
.cc-embed iframe { display: block; width: 100%; height: 100%; min-height: inherit; border: 0; }
.cc-embed:not(.is-loaded) iframe { visibility: hidden; }
.cc-embed.is-loaded .cc-embed__gate { display: none; }
.cc-embed__gate {
	position: absolute;
	inset: 0;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 14px;
	padding: 24px;
	background: var(--ds-surface);
	text-align: center;
}
.cc-embed__gate--inline { position: static; margin: 0 0 8px; border-radius: var(--ds-radius-card); }
.cc-embed__text { display: grid; gap: 4px; max-width: 420px; margin: 0; font-size: 14.5px; line-height: 1.5; color: var(--ds-ink-2); }
.cc-embed__text strong { font-size: 16px; color: var(--ds-ink); }
.cc-embed__actions { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.cc-embed__btn.ds-btn { min-height: 44px; }
.cc-embed__always { padding: 4px 6px; border: 0; background: none; font: 600 13.5px/1.3 var(--cc-font-body); color: var(--ds-ink-2); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }

@media (max-width: 640px) {
	.cc-consent { left: 12px; right: 12px; bottom: 12px; width: auto; }
	.cc-consent__card { padding: 20px; }
	.cc-prefs__foot { grid-template-columns: 1fr; }
	.cc-prefs__head,
	.cc-prefs__body,
	.cc-prefs__foot { padding-left: 18px; padding-right: 18px; }
}

@media (prefers-reduced-motion: reduce) {
	.cc-consent,
	.cc-switch__track,
	.cc-switch__track::after { transition: none; }
}

/* Mientras el aviso está abierto, el botón de aniversario no lo tapa. */
body:has(.cc-consent.is-visible) .cc-anniversary-floating-btn { visibility: hidden; }
