/* SmartWay Cookies — banner y panel de preferencias. */

.swc {
	--swc-shadow: 0 18px 50px -18px rgba(0, 0, 0, 0.35);
	--swc-line: color-mix(in srgb, var(--swc-text) 14%, transparent);
	--swc-muted: color-mix(in srgb, var(--swc-text) 72%, transparent);
	box-sizing: border-box;
	font-family: inherit;
	font-size: 15px;
	line-height: 1.5;
	color: var(--swc-text);
}

.swc *,
.swc *::before,
.swc *::after {
	box-sizing: border-box;
}

.swc [hidden],
.swc[hidden] {
	display: none !important;
}

/* Botones: Aceptar y Rechazar con el mismo peso visual (criterio de la AEPD). */
.swc-btn {
	appearance: none;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 44px;
	padding: 0.65rem 1.15rem;
	border: 2px solid var(--swc-primary);
	border-radius: calc(var(--swc-radius) * 0.6);
	font: inherit;
	font-weight: 700;
	line-height: 1.2;
	cursor: pointer;
	text-decoration: none;
	transition: filter 0.15s, background-color 0.15s, color 0.15s;
}

.swc-btn--primary {
	background: var(--swc-primary);
	color: var(--swc-primary-text);
}

.swc-btn--primary:hover {
	filter: brightness(1.1);
}

.swc-btn--outline {
	background: transparent;
	color: var(--swc-primary);
}

.swc-btn--outline:hover {
	background: var(--swc-primary);
	color: var(--swc-primary-text);
}

.swc-btn--link {
	background: transparent;
	border-color: transparent;
	color: var(--swc-text);
	text-decoration: underline;
	text-underline-offset: 3px;
}

.swc-btn:focus-visible,
.swc-modal__close:focus-visible,
.swc-floating:focus-visible,
.swc a:focus-visible,
.swc summary:focus-visible {
	outline: 3px solid var(--swc-primary);
	outline-offset: 2px;
}

.swc a {
	color: inherit;
	text-decoration: underline;
	text-underline-offset: 3px;
}

/* ------------------------------------------------------------------ Banner */
.swc-banner {
	position: fixed;
	z-index: 99998;
	background: var(--swc-bg);
	box-shadow: var(--swc-shadow);
	animation: swc-in 0.25s ease-out;
}

.swc-banner__title {
	margin: 0 0 0.35rem;
	font-size: 1.05rem;
	font-weight: 700;
}

.swc-banner__text {
	margin: 0 0 1rem;
	color: var(--swc-muted);
	font-size: 0.9rem;
}

.swc-banner__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
}

.swc-banner__actions .swc-btn--primary {
	flex: 1 1 8rem;
}

/* Caja en una esquina. */
.swc-banner--box {
	bottom: 1rem;
	width: min(420px, calc(100vw - 2rem));
	padding: 1.25rem;
	border-radius: var(--swc-radius);
}

.swc-banner--box.swc-banner--left {
	left: 1rem;
}

.swc-banner--box.swc-banner--right {
	right: 1rem;
}

/* Barra inferior a todo el ancho. */
.swc-banner--bar {
	left: 0;
	right: 0;
	bottom: 0;
	padding: 1rem clamp(1rem, 4vw, 3rem);
}

.swc-banner--bar .swc-banner__inner {
	display: grid;
	grid-template-columns: 1fr auto;
	gap: 0.5rem 2rem;
	align-items: center;
	max-width: 1240px;
	margin: 0 auto;
}

.swc-banner--bar .swc-banner__title {
	grid-column: 1 / -1;
	margin: 0;
}

.swc-banner--bar .swc-banner__text {
	margin: 0;
}

@media (max-width: 782px) {
	.swc-banner--bar .swc-banner__inner {
		grid-template-columns: 1fr;
	}
}

/* Ventana centrada con fondo oscurecido. */
.swc-banner--modal {
	top: 50%;
	left: 50%;
	width: min(520px, calc(100vw - 2rem));
	padding: 1.5rem;
	border-radius: var(--swc-radius);
	transform: translate(-50%, -50%);
}

html.swc-has-banner:has(.swc-banner--modal:not([hidden]))::after {
	content: "";
	position: fixed;
	inset: 0;
	z-index: 99997;
	background: rgba(0, 0, 0, 0.45);
}

/* --------------------------------------------------------- Panel de ajustes */
.swc-modal {
	position: fixed;
	inset: 0;
	z-index: 99999;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 1rem;
	background: rgba(0, 0, 0, 0.5);
}

.swc-modal__box {
	display: flex;
	flex-direction: column;
	width: min(640px, 100%);
	max-height: min(88vh, 760px);
	background: var(--swc-bg);
	border-radius: var(--swc-radius);
	box-shadow: var(--swc-shadow);
	animation: swc-in 0.2s ease-out;
}

.swc-modal__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	padding: 1.1rem 1.25rem;
	border-bottom: 1px solid var(--swc-line);
}

.swc-modal__title {
	margin: 0;
	font-size: 1.15rem;
	line-height: 1.3;
	color: var(--swc-text);
	text-transform: none;
	letter-spacing: normal;
}

.swc-modal__close {
	width: 40px;
	height: 40px;
	border: 0;
	border-radius: 50%;
	background: transparent;
	color: var(--swc-text);
	font-size: 1.6rem;
	line-height: 1;
	cursor: pointer;
}

.swc-modal__close:hover {
	background: var(--swc-line);
}

.swc-modal__body {
	overflow-y: auto;
	padding: 1rem 1.25rem;
}

.swc-modal__intro {
	margin: 0 0 1rem;
	color: var(--swc-muted);
	font-size: 0.9rem;
}

.swc-modal__foot {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	padding: 1rem 1.25rem;
	border-top: 1px solid var(--swc-line);
}

.swc-modal__foot .swc-btn {
	flex: 1 1 9rem;
}

.swc-cat {
	padding: 0.9rem 0;
	border-bottom: 1px solid var(--swc-line);
}

.swc-cat:last-child {
	border-bottom: 0;
}

.swc-cat__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
}

.swc-cat__label {
	font-weight: 700;
	cursor: pointer;
}

.swc-cat__desc {
	margin: 0.3rem 0 0;
	color: var(--swc-muted);
	font-size: 0.875rem;
}

.swc-cat__details {
	margin-top: 0.5rem;
	font-size: 0.85rem;
}

.swc-cat__details summary {
	cursor: pointer;
	color: var(--swc-primary);
	font-weight: 600;
}

.swc-cat__list {
	margin: 0.5rem 0 0;
	padding-left: 1.1rem;
	color: var(--swc-muted);
}

.swc-cat__list li {
	margin-bottom: 0.4rem;
}

/* Interruptor accesible (checkbox con role="switch"). */
.swc-switch {
	position: relative;
	flex: 0 0 auto;
	width: 46px;
	height: 26px;
}

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

.swc-switch__track {
	position: absolute;
	inset: 0;
	border-radius: 999px;
	background: color-mix(in srgb, var(--swc-text) 25%, transparent);
	transition: background-color 0.2s;
}

.swc-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, 0.3);
	transition: transform 0.2s;
}

.swc-switch input:checked + .swc-switch__track {
	background: var(--swc-primary);
}

.swc-switch input:checked + .swc-switch__track::after {
	transform: translateX(20px);
}

.swc-switch input:disabled {
	cursor: not-allowed;
}

.swc-switch input:disabled + .swc-switch__track {
	opacity: 0.6;
}

.swc-switch input:focus-visible + .swc-switch__track {
	outline: 3px solid var(--swc-primary);
	outline-offset: 2px;
}

/* --------------------------------------------------------- Botón flotante */
.swc-floating {
	position: fixed;
	bottom: 1rem;
	z-index: 99990;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 46px;
	height: 46px;
	border: 0;
	border-radius: 50%;
	background: var(--swc-primary);
	color: var(--swc-primary-text);
	/* Anillo claro + sombra: se distingue también sobre fondos oscuros. */
	box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.9), 0 4px 14px rgba(0, 0, 0, 0.35);
	cursor: pointer;
	opacity: 0.85;
	transition: opacity 0.2s, transform 0.2s;
}

.swc-floating:hover {
	opacity: 1;
	box-shadow: 0 0 0 2px #fff, 0 6px 20px rgba(0, 0, 0, 0.45);
	transform: scale(1.06);
}

.swc-floating--left {
	left: 1rem;
}

.swc-floating--right {
	right: 1rem;
}

/* ------------------------------------- Contenido bloqueado (vídeos, mapas) */
.swc-blocked {
	display: none !important;
}

.swc-placeholder {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 0.75rem;
	width: 100%;
	min-height: 200px;
	aspect-ratio: 16 / 9;
	padding: 1.5rem;
	border-radius: var(--swc-radius);
	background: color-mix(in srgb, var(--swc-text) 6%, var(--swc-bg));
	text-align: center;
}

.swc-placeholder p {
	max-width: 32rem;
	margin: 0;
}

/* ---------------------------------------------------- Tabla de la política */
.swc-table__updated {
	font-size: 0.85em;
	opacity: 0.75;
}

.swc-table code {
	white-space: nowrap;
}

@keyframes swc-in {
	from {
		opacity: 0;
		transform: translateY(12px);
	}
}

.swc-banner--modal {
	animation-name: swc-in-center;
}

@keyframes swc-in-center {
	from {
		opacity: 0;
		transform: translate(-50%, -46%);
	}
}

@media (prefers-reduced-motion: reduce) {
	.swc-banner,
	.swc-modal__box {
		animation: none;
	}
}

@media print {
	.swc-banner,
	.swc-floating,
	.swc-modal {
		display: none !important;
	}
}
