/**
 * El aviso de cookies, con la piel de la tienda.
 *
 * Oscuro y sobrio, sin robarle la pantalla a nadie: barra abajo en escritorio y
 * hoja al pie en móvil. Los tres botones **miden lo mismo y están juntos**, que
 * es lo que exige la Guía de la AEPD: rechazar no puede ser más costoso que
 * aceptar, ni en clics ni a la vista.
 */

.bxg {
	/*
	 * Cuánto sitio hay que dejar abajo. Lo pone el JavaScript con la altura del
	 * dock cuando el dock asoma: sin esto el aviso se le sentaba encima y el
	 * dock dejaba de recibir los clics —comprobado a 375 y a 1440—, que es
	 * justo la clase de estropicio que la norma 10 no perdona.
	 */
	--bxg-dock: 0px;
	--bxg-fondo: #0b1020;
	--bxg-panel: #121a33;
	--bxg-linea: rgba(255, 255, 255, .12);
	--bxg-texto: #ffffff;
	--bxg-texto-2: rgba(255, 255, 255, .76);
	--bxg-texto-3: rgba(255, 255, 255, .55);
	--bxg-cian: #38d6f5;
	--bxg-verde: #34d399;
}

/* ------------------------------------------------------------- El aviso */

.bxg__aviso[hidden],
.bxg__panel[hidden],
.bxg__reabrir[hidden] {
	display: none;
}

.bxg__aviso {
	position: fixed;
	right: 16px;
	bottom: calc(16px + var(--bxg-dock));
	left: 16px;
	z-index: 99998;
	display: flex;
	flex-wrap: wrap;
	gap: 16px;
	align-items: center;
	justify-content: space-between;
	max-width: 1100px;
	margin: 0 auto;
	padding: 20px 22px;
	border: 1px solid var(--bxg-linea);
	border-radius: 16px;
	background: var(--bxg-fondo);
	box-shadow: 0 18px 50px rgba(0, 0, 0, .5);
	color: var(--bxg-texto-2);
	transition: bottom .38s cubic-bezier(.22, .9, .3, 1);
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
	font-size: .92rem;
	line-height: 1.55;
}

.bxg__aviso-texto {
	flex: 1 1 26rem;
	min-width: 0;
}

.bxg .bxg__titulo {
	margin: 0 0 6px;
	padding: 0;
	color: var(--bxg-texto);
	font-size: 1.05rem;
	font-weight: 600;
}

.bxg__aviso p {
	margin: 0 0 6px;
	color: var(--bxg-texto-2);
}

.bxg__enlaces {
	display: flex;
	flex-wrap: wrap;
	gap: 14px;
	margin: 0;
}

.bxg .bxg__enlaces a {
	color: var(--bxg-cian);
	font-size: .86rem;
	text-decoration: underline;
	text-underline-offset: 2px;
}

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

.bxg__botones {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
}

/*
 * Los tres, del mismo tamaño. El de aceptar lleva color porque es el que la
 * gente busca, pero **no es más grande ni está más a mano** que el de rechazar:
 * eso es justo lo que la AEPD llama «patrón engañoso».
 */
.bxg .bxg__boton {
	appearance: none;
	-webkit-appearance: none;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 9.5rem;
	min-height: 44px;
	padding: 11px 20px;
	border: 1px solid var(--bxg-linea);
	border-radius: 999px;
	background: rgba(255, 255, 255, .07);
	box-shadow: none;
	color: var(--bxg-texto);
	font-family: inherit;
	font-size: .88rem;
	font-weight: 600;
	line-height: 1.2;
	text-align: center;
	cursor: pointer;
	transition: background .15s ease, border-color .15s ease;
}

.bxg .bxg__boton:hover,
.bxg .bxg__boton:focus {
	border-color: rgba(255, 255, 255, .3);
	background: rgba(255, 255, 255, .14);
}

.bxg .bxg__boton:focus-visible {
	outline: 2px solid var(--bxg-cian);
	outline-offset: 2px;
}

.bxg .bxg__boton--si {
	border-color: rgba(52, 211, 153, .5);
	background: rgba(52, 211, 153, .16);
	color: #7ef0c4;
}

.bxg .bxg__boton--si:hover,
.bxg .bxg__boton--si:focus {
	background: rgba(52, 211, 153, .26);
}

.bxg .bxg__boton--no {
	border-color: rgba(255, 255, 255, .22);
}

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

.bxg__panel {
	position: fixed;
	inset: 0;
	z-index: 99999;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 16px;
}

.bxg__velo {
	position: absolute;
	inset: 0;
	background: rgba(3, 6, 14, .78);
}

.bxg__caja {
	position: relative;
	display: flex;
	flex-direction: column;
	width: min(680px, 100%);
	max-height: min(86vh, 800px);
	border: 1px solid var(--bxg-linea);
	border-radius: 18px;
	background: var(--bxg-fondo);
	box-shadow: 0 30px 80px rgba(0, 0, 0, .6);
	color: var(--bxg-texto-2);
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
	overflow: hidden;
}

.bxg__caja-cabecera {
	display: flex;
	gap: 12px;
	align-items: center;
	justify-content: space-between;
	padding: 18px 20px;
	border-bottom: 1px solid var(--bxg-linea);
}

.bxg .bxg__cerrar {
	appearance: none;
	-webkit-appearance: none;
	width: 34px;
	height: 34px;
	padding: 0;
	border: 1px solid var(--bxg-linea);
	border-radius: 50%;
	background: rgba(255, 255, 255, .06);
	color: var(--bxg-texto);
	font-size: 1.2rem;
	line-height: 1;
	cursor: pointer;
}

.bxg__caja-cuerpo {
	padding: 6px 20px 12px;
	overflow-y: auto;
}

.bxg__categoria {
	padding: 16px 0;
	border-bottom: 1px solid var(--bxg-linea);
}

.bxg__categoria:last-child {
	border-bottom: 0;
}

.bxg__categoria-fila {
	display: flex;
	gap: 12px;
	align-items: center;
	justify-content: space-between;
}

.bxg .bxg__categoria-titulo {
	margin: 0;
	padding: 0;
	color: var(--bxg-texto);
	font-size: .98rem;
	font-weight: 600;
}

.bxg__categoria-texto {
	margin: 8px 0 0;
	font-size: .88rem;
	line-height: 1.55;
}

/* El interruptor. Un `checkbox` de verdad debajo, para que funcione con
   teclado y lo anuncien los lectores de pantalla. */
.bxg__interruptor {
	position: relative;
	flex: none;
	cursor: pointer;
}

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

.bxg__palanca {
	display: block;
	width: 48px;
	height: 28px;
	border: 1px solid var(--bxg-linea);
	border-radius: 999px;
	background: rgba(255, 255, 255, .08);
	transition: background .15s ease, border-color .15s ease;
}

.bxg__palanca::after {
	content: "";
	display: block;
	width: 20px;
	height: 20px;
	margin: 3px;
	border-radius: 50%;
	background: var(--bxg-texto-3);
	transition: transform .15s ease, background .15s ease;
}

.bxg__interruptor input:checked + .bxg__palanca {
	border-color: rgba(52, 211, 153, .6);
	background: rgba(52, 211, 153, .28);
}

.bxg__interruptor input:checked + .bxg__palanca::after {
	transform: translateX(20px);
	background: var(--bxg-verde);
}

/* Las necesarias se ven encendidas y bloqueadas: se dice que no se pueden
   apagar y se demuestra. */
.bxg__interruptor input:disabled + .bxg__palanca {
	opacity: .55;
	cursor: not-allowed;
}

.bxg__interruptor input:focus-visible + .bxg__palanca {
	outline: 2px solid var(--bxg-cian);
	outline-offset: 2px;
}

.bxg__servicios {
	margin-top: 10px;
	font-size: .84rem;
}

.bxg__servicios summary {
	color: var(--bxg-cian);
	cursor: pointer;
}

.bxg__servicios ul {
	margin: 10px 0 0;
	padding: 0;
	list-style: none;
}

.bxg__servicios li {
	display: grid;
	gap: 2px;
	margin: 0 0 10px;
	padding: 10px 12px;
	border-radius: 10px;
	background: var(--bxg-panel);
}

.bxg__servicios strong {
	color: var(--bxg-texto);
}

.bxg__servicios em {
	color: var(--bxg-texto-3);
	font-style: normal;
	font-size: .8rem;
}

.bxg__caja-pie {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	justify-content: flex-end;
	padding: 16px 20px;
	border-top: 1px solid var(--bxg-linea);
	background: rgba(0, 0, 0, .2);
}

/* --------------------------------------------------------- Volver a abrir */

/* Discreto, abajo a la izquierda para no taparse con el dock de la tienda. */
.bxg .bxg__reabrir {
	position: fixed;
	bottom: calc(16px + var(--bxg-dock));
	left: 16px;
	z-index: 99997;
	width: 42px;
	height: 42px;
	padding: 0;
	border: 1px solid var(--bxg-linea);
	border-radius: 50%;
	background: var(--bxg-fondo);
	box-shadow: 0 8px 22px rgba(0, 0, 0, .45);
	font-size: 1.1rem;
	line-height: 1;
	cursor: pointer;
	opacity: .55;
	transition: opacity .15s ease, transform .15s ease;
}

.bxg .bxg__reabrir:hover,
.bxg .bxg__reabrir:focus {
	opacity: 1;
	transform: translateY(-2px);
}

body.bxg-abierto {
	overflow: hidden;
}

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

@media (max-width: 700px) {
	.bxg__aviso {
		right: 8px;
		bottom: calc(8px + var(--bxg-dock));
		left: 8px;
		padding: 16px;
		font-size: .88rem;
	}

	/* Los botones, uno debajo de otro y del mismo ancho: en un móvil es la
	   única manera de que rechazar no quede en segunda fila. */
	.bxg__botones {
		width: 100%;
	}

	.bxg .bxg__boton {
		flex: 1 1 100%;
		min-width: 0;
	}

	.bxg__caja-pie {
		justify-content: stretch;
	}

	.bxg .bxg__reabrir {
		bottom: calc(12px + var(--bxg-dock));
	}
}

@media (prefers-reduced-motion: reduce) {
	.bxg__aviso,
	.bxg .bxg__boton,
	.bxg .bxg__reabrir,
	.bxg__palanca,
	.bxg__palanca::after {
		transition: none;
	}
}
