/*
 * Pumpún Cookies — banner, panel y avisos de contenido bloqueado.
 *
 * Este CSS se carga en TODAS las páginas de la web del cliente, así que es el
 * sitio donde más cuidado hay que tener: nada de estilos globales, nada de
 * tocar `body`, y todo colgando de `.pc-`. El color de acento llega como
 * variable desde PHP, que además calcula si el texto encima va en blanco o en
 * negro.
 *
 * Las clases mantienen el prefijo `pc-` de la versión 1: si alguien escribió CSS
 * propio para ajustar el banner a su web, sigue valiendo.
 */

.pc-root {
	--pc-ink: #1D1D1F;
	--pc-body: #424245;
	--pc-muted: #66666B;
	--pc-surface: #FFFFFF;
	--pc-ground: #F5F5F7;
	--pc-line: rgba(0, 0, 0, .1);
	--pc-line-strong: rgba(0, 0, 0, .22);
	--pc-radius: 18px;

	font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	font-size: 15px;
	line-height: 1.55;
	color: var(--pc-ink);
}

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

.pc-root [hidden] { display: none !important; }

/* ===========================================================================
 * Botones
 * ======================================================================== */

.pc-root .pc-btn {
	appearance: none;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 11px 20px;
	border: 1px solid var(--pc-line-strong);
	border-radius: 980px;
	background: var(--pc-surface);
	font: inherit;
	font-size: 15px;
	font-weight: 600;
	color: var(--pc-ink);
	cursor: pointer;
	text-decoration: none;
}

.pc-root .pc-btn:hover { border-color: var(--pc-ink); }

/*
 * Aceptar lleva el color, y rechazar no. Pero los dos tienen el mismo tamaño,
 * el mismo relleno y el mismo número de clics: el color marca cuál es la acción
 * sugerida, no esconde la otra. Enterrar el rechazo en un enlace pequeño es lo
 * que las autoridades europeas señalan como consentimiento no libre.
 */
.pc-root .pc-btn--accent {
	background: var(--pc-accent, #D5313C);
	border-color: var(--pc-accent, #D5313C);
	color: var(--pc-accent-fg, #fff);
}

.pc-root .pc-btn:focus-visible {
	outline: 2px solid var(--pc-accent, #D5313C);
	outline-offset: 2px;
}

/* ===========================================================================
 * Banner
 * ======================================================================== */

.pc-banner {
	position: fixed;
	z-index: 99998;
	left: 16px;
	right: 16px;
	bottom: 16px;
	max-width: 560px;
	margin: 0 auto;
	padding: 22px 24px;
	background: var(--pc-surface);
	border: 1px solid var(--pc-line);
	border-radius: var(--pc-radius);
	box-shadow: 0 18px 48px rgba(0, 0, 0, .16);
}

.pc-root--center .pc-banner {
	top: 50%;
	bottom: auto;
	transform: translateY(-50%);
}

.pc-banner__title { margin: 0 0 8px; font-size: 18px; font-weight: 700; line-height: 1.3; }
.pc-banner__text { margin: 0 0 12px; font-size: 15px; color: var(--pc-body); }

.pc-banner__links { margin: 0 0 18px; font-size: 14px; }
.pc-banner__links a { color: var(--pc-muted); }
.pc-banner__links span { margin: 0 6px; color: var(--pc-muted); }

.pc-banner__actions { display: flex; flex-wrap: wrap; gap: 10px; }
.pc-banner__actions .pc-btn { flex: 1 1 auto; }

@media (max-width: 480px) {
	.pc-banner { left: 10px; right: 10px; bottom: 10px; padding: 20px; }
	.pc-banner__actions .pc-btn { flex: 1 1 100%; }
}

/* ===========================================================================
 * Panel
 * ======================================================================== */

.pc-scrim {
	position: fixed;
	inset: 0;
	z-index: 99998;
	background: rgba(0, 0, 0, .45);
}

.pc-panel {
	position: fixed;
	z-index: 99999;
	left: 50%;
	top: 50%;
	transform: translate(-50%, -50%);
	width: calc(100% - 32px);
	max-width: 620px;
	max-height: calc(100vh - 48px);
	display: flex;
	flex-direction: column;
	background: var(--pc-surface);
	border-radius: var(--pc-radius);
	box-shadow: 0 24px 64px rgba(0, 0, 0, .28);
	overflow: hidden;
}

.pc-panel__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	padding: 20px 24px;
	border-bottom: 1px solid var(--pc-line);
}

.pc-panel__title { margin: 0; font-size: 17px; font-weight: 700; }

.pc-panel__close {
	appearance: none;
	border: 0;
	background: none;
	font-size: 26px;
	line-height: 1;
	color: var(--pc-muted);
	cursor: pointer;
	padding: 0 4px;
}
.pc-panel__close:hover { color: var(--pc-ink); }

.pc-panel__body { padding: 8px 24px; overflow-y: auto; flex: 1; }

.pc-panel__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	padding: 18px 24px;
	border-top: 1px solid var(--pc-line);
	background: var(--pc-ground);
}
.pc-panel__actions .pc-btn { flex: 1 1 auto; }

/* ===========================================================================
 * Categorías
 * ======================================================================== */

.pc-cat { padding: 18px 0; border-bottom: 1px solid var(--pc-line); }
.pc-cat:last-child { border-bottom: 0; }

.pc-cat__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.pc-cat__info { flex: 1; min-width: 0; }
.pc-cat__name { margin: 0; font-size: 15px; font-weight: 700; }

/* Los servicios concretos debajo del nombre: «cookies de marketing» no informa
   de nada; «Meta Pixel · Google Ads» sí. */
.pc-cat__services { margin: 3px 0 0; font-size: 13px; color: var(--pc-muted); }
.pc-cat__summary { margin: 10px 0 0; font-size: 14px; color: var(--pc-body); }

.pc-cat__always {
	flex: none;
	padding: 5px 12px;
	border-radius: 980px;
	background: var(--pc-ground);
	font-size: 12px;
	font-weight: 600;
	color: var(--pc-muted);
	white-space: nowrap;
}

/* Interruptor */
.pc-switch { flex: none; position: relative; display: inline-block; cursor: pointer; }
.pc-switch input {
	position: absolute;
	opacity: 0;
	width: 100%;
	height: 100%;
	margin: 0;
	cursor: pointer;
}

.pc-switch__track {
	display: block;
	width: 46px;
	height: 26px;
	border-radius: 26px;
	background: #C9C9CE;
	transition: background-color .18s ease;
	position: relative;
}

.pc-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, .3);
	transition: transform .18s ease;
}

.pc-switch input:checked + .pc-switch__track { background: var(--pc-accent, #D5313C); }
.pc-switch input:checked + .pc-switch__track::after { transform: translateX(20px); }

/* El foco del teclado tiene que verse: el input real es invisible, así que el
   anillo se pinta sobre la pista. */
.pc-switch input:focus-visible + .pc-switch__track {
	outline: 2px solid var(--pc-accent, #D5313C);
	outline-offset: 2px;
}

/* ===========================================================================
 * Botón flotante
 * ======================================================================== */

.pc-fab {
	position: fixed;
	z-index: 99997;
	left: 16px;
	bottom: 16px;
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 9px 16px;
	border: 1px solid var(--pc-line-strong);
	border-radius: 980px;
	background: var(--pc-surface);
	font: inherit;
	font-size: 13px;
	font-weight: 600;
	color: var(--pc-ink);
	cursor: pointer;
	box-shadow: 0 6px 20px rgba(0, 0, 0, .12);
}

/* A la izquierda a propósito: la esquina inferior derecha es donde casi todos
   los temas ponen el chat y el «volver arriba», y taparlos es peor que mover
   este botón. */
.pc-fab:hover { border-color: var(--pc-ink); }
.pc-fab__dot { width: 8px; height: 8px; border-radius: 50%; background: var(--pc-accent, #D5313C); }

/* ===========================================================================
 * Contenido bloqueado
 * ======================================================================== */

.pc-embed {
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 220px;
	padding: 24px;
	border: 1px dashed var(--pc-line-strong, rgba(0, 0, 0, .22));
	border-radius: 14px;
	background: #F5F5F7;
	font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, Arial, sans-serif;
	color: #1D1D1F;
}

.pc-embed__box { max-width: 420px; text-align: center; }
.pc-embed__title { margin: 0 0 8px; font-size: 16px; font-weight: 700; }
.pc-embed__text { margin: 0 0 16px; font-size: 14px; line-height: 1.55; color: #424245; }

.pc-embed__btn {
	appearance: none;
	padding: 11px 22px;
	border: 0;
	border-radius: 980px;
	background: var(--pc-accent, #D5313C);
	color: var(--pc-accent-fg, #fff);
	font: inherit;
	font-size: 15px;
	font-weight: 600;
	cursor: pointer;
}

.pc-embed__link {
	appearance: none;
	display: block;
	margin: 10px auto 0;
	border: 0;
	background: none;
	font: inherit;
	font-size: 13px;
	color: #66666B;
	text-decoration: underline;
	cursor: pointer;
}

.pc-embed__host { margin: 14px 0 0; font-size: 12px; color: #66666B; }

/* ===========================================================================
 * Declaración de cookies
 * ======================================================================== */

.pc-declaration__group { margin: 0 0 32px; }
.pc-declaration__group h3 { margin: 0 0 6px; }
.pc-declaration__summary { margin: 0 0 14px; color: #424245; }

/* La tabla se desplaza dentro de su caja: cuatro columnas no caben en un móvil
   y sin esto la página entera se va de ancho. */
.pc-declaration__scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }

.pc-declaration__table { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 520px; }
.pc-declaration__table th,
.pc-declaration__table td { padding: 10px 12px; text-align: left; border-bottom: 1px solid rgba(0, 0, 0, .1); vertical-align: top; }
.pc-declaration__table th { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: #66666B; }
.pc-declaration__table code { font-size: 13px; }

.pc-declaration__note { margin: 8px 0 0; font-size: 13px; color: #66666B; }

.pc-revoke {
	appearance: none;
	padding: 11px 20px;
	border: 1px solid rgba(0, 0, 0, .22);
	border-radius: 980px;
	background: #fff;
	font: inherit;
	font-size: 15px;
	font-weight: 600;
	cursor: pointer;
}

/* ===========================================================================
 * Movimiento
 * ======================================================================== */

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