/* =========================================================================
   Priv Beand — Gestion du consentement (RGPD). Estilos on-brand Solingua.
   Todas las variables CSS se inyectan en #priv-beand-root vía JS (:root scope del widget).
   ========================================================================= */

#priv-beand-root {
	--pb-bg: #0B111F;
	--pb-text: #FFFFFF;
	--pb-muted: #5A626E;
	--pb-primary: #C1EA20;
	--pb-secondary: #6F2DFF;
	--pb-accent: #C1EA20;
	--pb-radius: 18px;
	--pb-font: 'Poppins', 'Inter', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
}

/* Reset acotado al widget para no heredar estilos raros del theme. */
#priv-beand-root *,
#priv-beand-root *::before,
#priv-beand-root *::after {
	box-sizing: border-box;
}

/* ---------- Overlay (modo card / panel modal) ---------- */
.pb-overlay {
	position: fixed;
	inset: 0;
	z-index: 100000;
	background: rgba(11, 17, 31, .55);
	backdrop-filter: saturate(120%) blur(2px);
	opacity: 0;
	visibility: hidden;
	transition: opacity .3s ease;
}
.pb-overlay.pb-show {
	opacity: 1;
	visibility: visible;
}

/* ---------- Banner ---------- */
.pb-banner {
	position: fixed;
	z-index: 100001;
	background: var(--pb-bg);
	color: var(--pb-text);
	border: 1px solid rgba(255, 255, 255, .12);
	border-radius: var(--pb-radius);
	box-shadow: 0 24px 60px -20px rgba(0, 0, 0, .6);
	padding: 22px 24px;
	font-family: var(--pb-font);
	font-size: 15px;
	line-height: 1.5;
	width: calc(100% - 32px);
	max-width: 560px;
	transform: translateY(160%);
	transition: transform .45s cubic-bezier(.2, .8, .2, 1);
}

/* Posición: barra inferior centrada. */
.pb-pos-bar .pb-banner {
	left: 16px;
	right: 16px;
	bottom: 16px;
	margin: 0 auto;
}

/* Posición: tarjeta en la esquina inferior derecha. */
.pb-pos-card .pb-banner {
	right: 16px;
	bottom: 16px;
	left: auto;
	max-width: 400px;
	width: calc(100% - 32px);
}

.pb-banner.pb-open {
	transform: translateY(0);
}

.pb-banner h2 {
	font-family: var(--pb-font);
	font-size: 1.05rem;
	font-weight: 700;
	letter-spacing: -.01em;
	margin: 0 0 8px;
	color: var(--pb-text);
	display: flex;
	align-items: center;
	gap: 9px;
}
.pb-banner h2 svg {
	width: 20px;
	height: 20px;
	color: var(--pb-accent);
	flex: 0 0 auto;
}
.pb-banner p {
	font-size: .9rem;
	line-height: 1.55;
	color: rgba(255, 255, 255, .78);
	margin: 0 0 16px;
}
.pb-banner a.pb-more {
	color: var(--pb-accent);
	font-weight: 600;
	text-decoration: underline;
	text-underline-offset: 2px;
}
.pb-banner a.pb-more:hover {
	opacity: .85;
}

/* ---------- Botones ---------- */
.pb-actions {
	display: flex;
	gap: 10px;
	flex-wrap: wrap;
	align-items: center;
}
.pb-btn {
	font-family: var(--pb-font);
	font-weight: 600;
	font-size: .9rem;
	padding: 11px 18px;
	border-radius: 999px;
	border: none;
	cursor: pointer;
	transition: transform .15s ease, filter .15s ease, background .15s ease;
	line-height: 1.1;
}
.pb-btn:hover {
	transform: translateY(-1px);
	filter: brightness(1.05);
}
.pb-btn:focus-visible {
	outline: 2px solid var(--pb-accent);
	outline-offset: 2px;
}
.pb-accept {
	background: linear-gradient(100deg, var(--pb-primary) 0%, #5469E9 60%, var(--pb-secondary) 100%);
	color: #fff;
	flex: 1;
	min-width: 150px;
}
.pb-reject {
	background: rgba(255, 255, 255, .1);
	color: var(--pb-text);
	border: 1px solid rgba(255, 255, 255, .22);
}
.pb-customize,
.pb-save {
	background: none;
	color: rgba(255, 255, 255, .8);
	text-decoration: underline;
	text-underline-offset: 2px;
	padding: 11px 6px;
}
.pb-customize:hover,
.pb-save:hover {
	color: #fff;
}

/* ---------- Panel de preferencias ---------- */
.pb-prefs {
	margin: 4px 0 16px;
	display: none;
}
.pb-prefs.pb-visible {
	display: block;
}
.pb-row {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 16px;
	padding: 13px 0;
	border-top: 1px solid rgba(255, 255, 255, .1);
}
.pb-row:first-child {
	border-top: none;
}
.pb-tx b {
	display: block;
	font-family: var(--pb-font);
	font-size: .92rem;
	font-weight: 600;
	color: var(--pb-text);
	margin-bottom: 2px;
}
.pb-tx span {
	display: block;
	font-size: .82rem;
	line-height: 1.45;
	color: rgba(255, 255, 255, .62);
}

/* Toggle switch accesible. */
.pb-sw {
	position: relative;
	flex: 0 0 auto;
	width: 44px;
	height: 26px;
	margin-top: 2px;
}
.pb-sw input {
	position: absolute;
	opacity: 0;
	width: 100%;
	height: 100%;
	margin: 0;
	cursor: pointer;
}
.pb-sl {
	position: absolute;
	inset: 0;
	background: rgba(255, 255, 255, .22);
	border-radius: 999px;
	transition: background .2s ease;
	pointer-events: none;
}
.pb-sl::before {
	content: "";
	position: absolute;
	top: 3px;
	left: 3px;
	width: 20px;
	height: 20px;
	border-radius: 50%;
	background: #fff;
	transition: transform .2s ease;
}
.pb-sw input:checked + .pb-sl {
	background: #5469E9;
}
.pb-sw input:checked + .pb-sl::before {
	transform: translateX(18px);
}
.pb-sw input:focus-visible + .pb-sl {
	outline: 2px solid var(--pb-accent);
	outline-offset: 2px;
}
.pb-sw input:disabled + .pb-sl {
	background: #9FD613;
	cursor: not-allowed;
}
.pb-sw input:disabled {
	cursor: not-allowed;
}

/* ---------- Botón flotante para reabrir ---------- */
.pb-reopen {
	position: fixed;
	left: 16px;
	bottom: 16px;
	z-index: 99999;
	width: 46px;
	height: 46px;
	border-radius: 50%;
	background: var(--pb-bg);
	color: var(--pb-accent);
	border: 1px solid rgba(255, 255, 255, .16);
	box-shadow: 0 12px 26px -10px rgba(0, 0, 0, .5);
	cursor: pointer;
	display: none;
	align-items: center;
	justify-content: center;
	padding: 0;
}
.pb-reopen.pb-show {
	display: flex;
}
.pb-reopen:hover {
	transform: translateY(-1px);
}
.pb-reopen:focus-visible {
	outline: 2px solid var(--pb-accent);
	outline-offset: 2px;
}
.pb-reopen svg {
	width: 23px;
	height: 23px;
}

/* ---------- Trigger inline (shortcode / footer) ---------- */
.priv-beand-trigger {
	cursor: pointer;
}

/* ---------- Responsive ---------- */
@media (max-width: 520px) {
	.pb-accept {
		flex: 1 0 100%;
	}
	.pb-banner {
		padding: 20px 18px;
	}
}

/* ---------- Movimiento reducido ---------- */
@media (prefers-reduced-motion: reduce) {
	.pb-banner,
	.pb-overlay,
	.pb-sl,
	.pb-sl::before,
	.pb-btn,
	.pb-reopen {
		transition: none !important;
	}
}

/* El chrome nuevo (rebrand) YA no tiene la sticky-cta mobile → el FAB de cookies
   vuelve a su posición baja (16px). El offset del chat IA lo maneja su propia opción
   (launcher_offset_mobile en ianagents-chat), no acá. */
@media (max-width: 760px) {
	.pb-reopen { bottom: 16px; }
}
