/* Banner de cookies con el estilo del tema (negro, Poppins, botones de contorno como el formulario).
   Fijo abajo y fuera del flujo: no mueve el contenido (CLS 0). */

.pel-cookies {
	position: fixed;
	left: 20px;
	right: 20px;
	bottom: 20px;
	z-index: 2147483000;
	display: flex;
	justify-content: center;
	pointer-events: none;
	opacity: 0;
	transform: translateY(20px);
	visibility: hidden;
	transition: opacity 0.4s ease, transform 0.4s ease, visibility 0s linear 0.4s;
}

.pel-cookies--visible {
	opacity: 1;
	transform: none;
	visibility: visible;
	transition: opacity 0.4s ease, transform 0.4s ease, visibility 0s;
}

.pel-cookies__caja {
	pointer-events: auto;
	width: 100%;
	max-width: 760px;
	box-sizing: border-box;
	padding: 28px 32px;
	background: #111;
	border: 1px solid rgba(255, 255, 255, 0.15);
	border-radius: 5px;
	box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
	color: #fff;
	font-family: 'Poppins', sans-serif;
}

.pel-cookies p {
	margin: 0;
	padding: 0;
	font-family: 'Poppins', sans-serif;
}

.pel-cookies__titulo {
	color: #fff !important;
	font-size: 18px;
	font-weight: 500;
	line-height: 1.4;
	margin-bottom: 10px !important;
}

.pel-cookies__texto {
	font-size: 14px;
	line-height: 1.7;
	color: rgba(255, 255, 255, 0.7) !important;
}

.pel-cookies__texto a {
	color: #fff;
	text-decoration: underline;
	text-underline-offset: 3px;
}

/* Ajustes por categoría */
.pel-cookies__ajustes {
	margin-top: 20px;
	border-top: 1px solid rgba(255, 255, 255, 0.15);
}

.pel-cookies__ajustes[hidden] {
	display: none;
}

.pel-cookies__fila {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 20px;
	padding: 16px 0;
	border-bottom: 1px solid rgba(255, 255, 255, 0.15);
}

.pel-cookies__cat {
	color: #fff !important;
	font-size: 14px;
	font-weight: 500;
}

.pel-cookies__desc {
	font-size: 13px;
	line-height: 1.6;
	color: rgba(255, 255, 255, 0.6) !important;
}

.pel-cookies__fijo {
	flex: 0 0 auto;
	font-size: 12px;
	color: rgba(255, 255, 255, 0.5);
}

/* Interruptor */
.pel-cookies__switch {
	position: relative;
	flex: 0 0 auto;
	width: 44px;
	height: 24px;
	cursor: pointer;
}

.pel-cookies__switch input {
	position: absolute;
	opacity: 0;
	width: 100%;
	height: 100%;
	margin: 0;
	cursor: pointer;
}

.pel-cookies__switch span {
	position: absolute;
	inset: 0;
	border: 1px solid rgba(255, 255, 255, 0.5);
	border-radius: 24px;
	transition: background-color 0.25s ease, border-color 0.25s ease;
}

.pel-cookies__switch span::after {
	content: "";
	position: absolute;
	top: 3px;
	left: 3px;
	width: 16px;
	height: 16px;
	border-radius: 50%;
	background: #fff;
	transition: transform 0.25s ease, background-color 0.25s ease;
}

.pel-cookies__switch input:checked + span {
	background: #fff;
	border-color: #fff;
}

.pel-cookies__switch input:checked + span::after {
	background: #000;
	transform: translateX(20px);
}

.pel-cookies__switch input:focus-visible + span {
	outline: 2px solid #fff;
	outline-offset: 3px;
}

/* Botones: mismo lenguaje que el formulario de contacto */
.pel-cookies__botones {
	display: flex;
	flex-wrap: wrap;
	justify-content: flex-end;
	gap: 12px;
	margin-top: 22px;
}

.pel-cookies__btn {
	-webkit-appearance: none;
	appearance: none;
	height: 46px;
	padding: 0 28px;
	background: transparent;
	border: 1px solid rgba(255, 255, 255, 0.4);
	border-radius: 40px;
	color: #fff;
	font-family: 'Poppins', sans-serif;
	font-size: 14px;
	font-weight: 600;
	line-height: 1;
	cursor: pointer;
	transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

.pel-cookies__btn[hidden] {
	display: none;
}

.pel-cookies__btn:hover,
.pel-cookies__btn:focus-visible {
	background: #fff;
	border-color: #fff;
	color: #000;
}

/* Aceptar y Rechazar con el mismo peso visual: rechazar tiene que ser igual de fácil (AEPD) */
.pel-cookies__btn--principal {
	border-color: #fff;
}

.pel-cookies__btn:focus-visible {
	outline: 2px solid #fff;
	outline-offset: 3px;
}

@media (max-width: 600px) {
	.pel-cookies {
		left: 10px;
		right: 10px;
		bottom: 10px;
	}
	.pel-cookies__caja {
		padding: 22px 20px;
		max-height: calc(100vh - 20px);
		overflow-y: auto;
	}
	.pel-cookies__botones {
		display: grid;
		grid-template-columns: 1fr 1fr;
	}
	/* fila 1: Rechazar | Aceptar ; fila 2: Configurar / Guardar ajustes */
	.pel-cookies__btn[data-accion="rechazar"] { grid-column: 1; grid-row: 1; }
	.pel-cookies__btn[data-accion="aceptar"] { grid-column: 2; grid-row: 1; }
	.pel-cookies__btn[data-accion="configurar"],
	.pel-cookies__btn[data-accion="guardar"] { grid-column: 1 / -1; grid-row: 2; }
}

@media (prefers-reduced-motion: reduce) {
	.pel-cookies,
	.pel-cookies--visible {
		transition: none;
	}
}
