/**
 * roilab-consent
 *
 * Dos reglas que no se tocan al personalizar un proyecto:
 *
 *   1. Ningún texto por debajo de 14px (regla transversal de RoiLab).
 *   2. Los botones de Aceptar, Rechazar y Configurar comparten estilo. Destacar uno sobre otro
 *      incumple la Guía de cookies de la AEPD, aunque quede más bonito.
 *
 * Los colores salen de la configuración del proyecto (variables --rlc-*).
 */

.rlc-root {
	--rlc-radius: 8px;
	--rlc-gap: 16px;

	position: relative;
	z-index: 999999;
	font-size: 15px;
	line-height: 1.55;
}

.rlc-root[hidden] {
	display: none;
}

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

/* ------------------------------------------------------------------ overlay */

.rlc-overlay {
	position: fixed;
	/* Las cuatro por separado antes que `inset`: Safari no entiende `inset` hasta la 14.1, y sin
	   ellas la capa se quedaría sin dimensiones y no taparía nada. */
	top: 0;
	right: 0;
	bottom: 0;
	left: 0;
	inset: 0;
	z-index: 999998;
	background: var(--rlc-overlay, rgba(0, 0, 0, 0.45));
}

.rlc-overlay[hidden] {
	display: none;
}

/* ------------------------------------------------------------------- banner */

.rlc-banner {
	position: fixed;
	left: 50%;
	transform: translateX(-50%);
	z-index: 999999;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: var(--rlc-gap);
	width: calc(100% - 32px);
	max-width: 1100px;
	/* Si el texto no cabe —pantalla pequeña, tipografía grande, traducción larga— el banner se
	   desplaza por dentro. Sin esto se sale por arriba de la ventana y, al ser `fixed`, esa parte
	   queda inalcanzable: título cortado y sin forma de leerlo. */
	max-height: calc(100vh - 32px);
	max-height: calc(100dvh - 32px);
	overflow-y: auto;
	padding: 20px 24px;
	background: var(--rlc-background, #fff);
	color: var(--rlc-text, #1a1a1a);
	border: 1px solid var(--rlc-border, #d4d4d4);
	border-radius: var(--rlc-radius);
	box-shadow: 0 8px 32px rgba(0, 0, 0, 0.18);
}

.rlc-banner[hidden] {
	display: none;
}

.rlc-root[data-rlc-position="bottom"] .rlc-banner {
	bottom: 16px;
}

.rlc-root[data-rlc-position="top"] .rlc-banner {
	top: 16px;
}

.rlc-root[data-rlc-position="center"] .rlc-banner {
	top: 50%;
	transform: translate(-50%, -50%);
	max-width: 560px;
}

.rlc-banner__text {
	flex: 1 1 420px;
	min-width: 0;
}

.rlc-banner__title {
	margin: 0 0 6px;
	font-size: 18px;
	line-height: 1.3;
	font-weight: 700;
	color: var(--rlc-text, #1a1a1a);
}

.rlc-banner__body {
	margin: 0;
	font-size: 15px;
	color: var(--rlc-muted, #4a4a4a);
}

.rlc-banner__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	flex: 0 0 auto;
}

/* ------------------------------------------------------------------ botones */

/*
 * Un único estilo de botón, deliberadamente. Mismo tamaño, mismo color, mismo contraste.
 */
.rlc-root .rlc-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 132px;
	min-height: 44px; /* objetivo táctil accesible */
	margin: 0;
	padding: 11px 20px;
	font-family: inherit;
	font-size: 15px;
	font-weight: 600;
	line-height: 1.2;
	text-align: center;
	text-decoration: none;
	color: var(--rlc-button-text, #fff);
	background: var(--rlc-button-bg, #1a1a1a);
	border: 1px solid var(--rlc-button-bg, #1a1a1a);
	border-radius: var(--rlc-radius);
	cursor: pointer;
	transition: opacity 0.15s ease;
}

.rlc-root .rlc-btn:hover {
	opacity: 0.88;
}

/*
 * Indicador de foco.
 *
 * Se marca sobre `:focus` y luego se retira en `:focus:not(:focus-visible)`, en vez de usar
 * `:focus-visible` a secas. El motivo: `:focus-visible` no existe en Safari anterior a la 15.4, y
 * allí la regla entera se descartaría dejando a quien navega con teclado sin saber dónde está.
 *
 * Con este orden, un navegador antiguo ignora la segunda regla por no entender el selector y
 * enseña el foco siempre — incluso al hacer clic con el ratón. Es menos elegante y es lo correcto:
 * ante la duda, que se vea.
 */
.rlc-root .rlc-btn:focus,
.rlc-root .rlc-switch:focus,
.rlc-root .rlc-close:focus,
.rlc-root .rlc-link:focus,
.rlc-root .rlc-tab:focus,
.rlc-root summary:focus {
	outline: 3px solid var(--rlc-accent, #1a1a1a);
	outline-offset: 2px;
}

.rlc-root .rlc-btn:focus:not(:focus-visible),
.rlc-root .rlc-switch:focus:not(:focus-visible),
.rlc-root .rlc-close:focus:not(:focus-visible),
.rlc-root .rlc-link:focus:not(:focus-visible),
.rlc-root .rlc-tab:focus:not(:focus-visible),
.rlc-root summary:focus:not(:focus-visible) {
	outline: none;
}

.rlc-root .rlc-link {
	color: var(--rlc-text, #1a1a1a);
	text-decoration: underline;
	text-underline-offset: 2px;
}

/* -------------------------------------------------------------------- panel */

.rlc-panel {
	position: fixed;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	z-index: 999999;
	display: flex;
	flex-direction: column;
	width: calc(100% - 32px);
	max-width: 640px;
	max-height: calc(100vh - 48px);
	background: var(--rlc-background, #fff);
	color: var(--rlc-text, #1a1a1a);
	border: 1px solid var(--rlc-border, #d4d4d4);
	border-radius: var(--rlc-radius);
	box-shadow: 0 12px 48px rgba(0, 0, 0, 0.28);
}

.rlc-panel[hidden] {
	display: none;
}

.rlc-panel__header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 20px 24px;
	border-bottom: 1px solid var(--rlc-border, #d4d4d4);
}

.rlc-panel__title {
	margin: 0;
	font-size: 19px;
	line-height: 1.3;
	font-weight: 700;
}

.rlc-close {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	padding: 0;
	font-size: 26px;
	line-height: 1;
	color: var(--rlc-text, #1a1a1a);
	background: none;
	border: 0;
	border-radius: var(--rlc-radius);
	cursor: pointer;
}

.rlc-panel__body {
	flex: 1 1 auto;
	overflow-y: auto;
	padding: 20px 24px;
}

.rlc-panel__intro {
	margin: 0 0 20px;
	font-size: 15px;
	color: var(--rlc-muted, #4a4a4a);
}

.rlc-panel__policy {
	margin: 20px 0 0;
	font-size: 15px;
}

.rlc-panel__footer {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	padding: 16px 24px;
	border-top: 1px solid var(--rlc-border, #d4d4d4);
}

.rlc-panel__footer .rlc-btn {
	flex: 1 1 auto;
}

/* --------------------------------------------------------------- categorías */

.rlc-cat {
	padding: 16px 0;
	border-bottom: 1px solid var(--rlc-border, #d4d4d4);
}

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

.rlc-cat__head {
	display: flex;
	align-items: center;
	gap: 12px;
}

.rlc-cat__label {
	flex: 1 1 auto;
	font-size: 16px;
	font-weight: 700;
	cursor: pointer;
}

.rlc-cat__always {
	font-size: 14px;
	color: var(--rlc-muted, #4a4a4a);
}

.rlc-cat__desc {
	margin: 8px 0 0;
	font-size: 15px;
	color: var(--rlc-muted, #4a4a4a);
}

.rlc-cat__detail {
	margin-top: 10px;
	font-size: 14px;
}

.rlc-cat__detail summary {
	padding: 6px 0;
	color: var(--rlc-muted, #4a4a4a);
	cursor: pointer;
}

.rlc-cat__cookies {
	margin: 8px 0 0;
	padding: 0 0 0 18px;
	font-size: 14px;
	color: var(--rlc-muted, #4a4a4a);
}

.rlc-cat__cookies li {
	margin-bottom: 10px;
}

.rlc-cat__cookies code {
	font-size: 14px;
	font-weight: 700;
	color: var(--rlc-text, #1a1a1a);
}

.rlc-cat__cookies span {
	display: block;
}

.rlc-cat__meta {
	font-size: 14px;
	opacity: 0.85;
}

/*
 * Interruptor. Es un checkbox real (accesible por teclado y para lectores de pantalla) al que solo
 * se le cambia la apariencia.
 */
.rlc-root .rlc-switch {
	flex: 0 0 auto;
	appearance: none;
	-webkit-appearance: none;
	position: relative;
	width: 52px;
	height: 30px;
	margin: 0;
	background: var(--rlc-border, #d4d4d4);
	border: 1px solid var(--rlc-border, #d4d4d4);
	border-radius: 999px;
	cursor: pointer;
	transition: background 0.15s ease;
}

.rlc-root .rlc-switch::after {
	content: "";
	position: absolute;
	top: 3px;
	left: 3px;
	width: 22px;
	height: 22px;
	background: #fff;
	border-radius: 50%;
	transition: transform 0.15s ease;
}

.rlc-root .rlc-switch:checked {
	background: var(--rlc-accent, #1a1a1a);
	border-color: var(--rlc-accent, #1a1a1a);
}

.rlc-root .rlc-switch:checked::after {
	transform: translateX(22px);
}

.rlc-root .rlc-switch:disabled {
	cursor: not-allowed;
	opacity: 0.65;
}

/* ---------------------------------------------- pestaña de reapertura */

/*
 * Discreta pero no escondida: se ve siempre el icono, y al pasar por encima o llegar con el
 * teclado se despliega el texto. Nunca se oculta del todo — retirar el consentimiento tiene que
 * ser tan fácil como darlo.
 */
.rlc-tab {
	position: fixed;
	bottom: 24px;
	z-index: 999997;
	display: flex;
	align-items: center;
	gap: 8px;
	min-height: 44px;
	margin: 0;
	padding: 10px 14px;
	font-family: inherit;
	font-size: 14px;
	font-weight: 600;
	line-height: 1.2;
	color: var(--rlc-button-text, #fff);
	background: var(--rlc-button-bg, #1a1a1a);
	border: 1px solid var(--rlc-button-bg, #1a1a1a);
	box-shadow: 0 2px 12px rgba(0, 0, 0, 0.2);
	cursor: pointer;
	opacity: 0.72;
	transition: opacity 0.2s ease;
}

.rlc-tab[hidden] {
	display: none;
}

.rlc-tab:hover,
.rlc-tab:focus {
	opacity: 1;
}

.rlc-root[data-rlc-tab-position="left"] .rlc-tab {
	left: 0;
	border-left: 0;
	border-radius: 0 var(--rlc-radius) var(--rlc-radius) 0;
}

.rlc-root[data-rlc-tab-position="right"] .rlc-tab {
	right: 0;
	flex-direction: row-reverse;
	border-right: 0;
	border-radius: var(--rlc-radius) 0 0 var(--rlc-radius);
}

.rlc-tab__icon {
	display: flex;
	flex: 0 0 auto;
}

.rlc-tab__label {
	max-width: 0;
	overflow: hidden;
	white-space: nowrap;
	opacity: 0;
	transition: max-width 0.2s ease, opacity 0.2s ease;
}

.rlc-tab:hover .rlc-tab__label,
.rlc-tab:focus .rlc-tab__label {
	max-width: 220px;
	opacity: 1;
}

/* ------------------------------------------------------- contenido bloqueado */

.rlc-embed {
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 220px;
	padding: 24px;
	font-size: 15px;
	line-height: 1.55;
	color: var(--rlc-text, #1a1a1a);
	background: var(--rlc-background, #fff);
	border: 1px dashed var(--rlc-border, #d4d4d4);
	border-radius: var(--rlc-radius);
}

.rlc-embed__box {
	max-width: 420px;
	text-align: center;
}

.rlc-embed__title {
	margin: 0 0 8px;
	font-size: 17px;
	font-weight: 700;
}

.rlc-embed__body {
	margin: 0 0 16px;
	font-size: 15px;
	color: var(--rlc-muted, #4a4a4a);
}

.rlc-embed__note {
	margin: 12px 0 0;
	font-size: 14px;
	color: var(--rlc-muted, #4a4a4a);
}

/* ------------------------------------------------------------------- tabla */

.rlc-table-wrap {
	overflow-x: auto;
}

.rlc-table {
	width: 100%;
	border-collapse: collapse;
	font-size: 15px;
}

.rlc-table caption {
	padding-bottom: 10px;
	font-size: 14px;
	text-align: left;
	color: #4a4a4a;
}

.rlc-table th,
.rlc-table td {
	padding: 10px 12px;
	font-size: 15px;
	text-align: left;
	vertical-align: top;
	border-bottom: 1px solid #d4d4d4;
}

.rlc-table th {
	font-weight: 700;
}

.rlc-table code {
	font-size: 14px;
}

/* ------------------------------------------------------------------ móvil */

@media (max-width: 640px) {
	.rlc-banner {
		flex-direction: column;
		/* Imprescindible junto a `max-height`. En columna y con envoltura, un contenido más alto
		   que la caja no desborda hacia abajo: se reparte en una SEGUNDA COLUMNA lateral y los
		   botones acaban fuera de la pantalla. Sin envoltura, desborda hacia abajo y lo recoge el
		   `overflow-y: auto`. */
		flex-wrap: nowrap;
		align-items: stretch;
		width: calc(100% - 16px);
		max-height: calc(100vh - 16px);
		max-height: calc(100dvh - 16px);
		padding: 18px;
	}

	.rlc-panel {
		max-height: calc(100vh - 16px);
		max-height: calc(100dvh - 16px);
	}

	.rlc-root[data-rlc-position="bottom"] .rlc-banner {
		bottom: 8px;
	}

	.rlc-banner__actions {
		flex-direction: column;
	}

	.rlc-root .rlc-btn {
		width: 100%;
	}

	.rlc-panel__footer {
		flex-direction: column;
	}
}

@media (prefers-reduced-motion: reduce) {
	.rlc-root * {
		transition: none !important;
	}
}
