/* BC Bubble Popup — frontend */

.bcbp {
	--bcbp-bg: #e63946;
	--bcbp-color: #fff;
	--bcbp-size: 64px;
	--bcbp-offset: 24px;
	--bcbp-width: 560px;
	--bcbp-popup-bg: #fff;
	--bcbp-top-extra: 0px;
}

.admin-bar .bcbp { --bcbp-top-extra: 32px; }
@media (max-width: 782px) {
	.admin-bar .bcbp { --bcbp-top-extra: 46px; }
}

/* ---------- Burbuja ---------- */

.bcbp-bubble {
	position: fixed;
	z-index: 2147482000;
	width: var(--bcbp-size);
	height: var(--bcbp-size);
	padding: 0;
	margin: 0;
	border: 0;
	border-radius: 50%;
	background: var(--bcbp-bg);
	color: var(--bcbp-color);
	display: grid;
	place-items: center;
	cursor: pointer;
	box-shadow: 0 10px 24px -6px color-mix(in srgb, var(--bcbp-bg) 70%, transparent), 0 3px 8px rgba(0, 0, 0, .18);
	transition: scale .2s ease, box-shadow .2s ease;
	animation: bcbp-pop-in .5s cubic-bezier(.34, 1.56, .64, 1) .6s backwards;
	-webkit-tap-highlight-color: transparent;
}

.bcbp-bubble:hover { scale: 1.08; }
.bcbp-bubble:active { scale: .96; }
.bcbp-bubble:focus-visible {
	outline: 3px solid var(--bcbp-bg);
	outline-offset: 4px;
}

.bcbp-bubble .bcbp-icon {
	width: 46%;
	height: 46%;
	display: block;
	pointer-events: none;
}

.bcbp-bubble .bcbp-icon--img {
	width: 56%;
	height: 56%;
	object-fit: contain;
}

/* Anillo de pulso */
.bcbp-bubble.has-pulse::before {
	content: "";
	position: absolute;
	inset: 0;
	border-radius: inherit;
	background: var(--bcbp-bg);
	z-index: -1;
	animation: bcbp-pulse 2.2s ease-out 1.4s infinite;
}

.bcbp.is-active .bcbp-bubble.has-pulse::before { animation: none; }

/* Punto de aviso */
.bcbp-badge {
	position: absolute;
	top: 6%;
	right: 6%;
	width: 26%;
	height: 26%;
	min-width: 12px;
	min-height: 12px;
	border-radius: 50%;
	background: #ffd166;
	border: 2px solid var(--bcbp-bg);
	transition: scale .25s ease;
}

.bcbp.is-seen .bcbp-badge { scale: 0; }

/* ---------- Posiciones ---------- */

.bcbp-pos-top-left .bcbp-bubble,
.bcbp-pos-top-center .bcbp-bubble,
.bcbp-pos-top-right .bcbp-bubble {
	top: calc(var(--bcbp-offset) + var(--bcbp-top-extra) + env(safe-area-inset-top, 0px));
}

.bcbp-pos-bottom-left .bcbp-bubble,
.bcbp-pos-bottom-center .bcbp-bubble,
.bcbp-pos-bottom-right .bcbp-bubble {
	bottom: calc(var(--bcbp-offset) + env(safe-area-inset-bottom, 0px));
}

.bcbp-pos-center-left .bcbp-bubble,
.bcbp-pos-center-right .bcbp-bubble {
	top: 50%;
	translate: 0 -50%;
}

.bcbp-pos-top-left .bcbp-bubble,
.bcbp-pos-center-left .bcbp-bubble,
.bcbp-pos-bottom-left .bcbp-bubble {
	left: calc(var(--bcbp-offset) + env(safe-area-inset-left, 0px));
}

.bcbp-pos-top-right .bcbp-bubble,
.bcbp-pos-center-right .bcbp-bubble,
.bcbp-pos-bottom-right .bcbp-bubble {
	right: calc(var(--bcbp-offset) + env(safe-area-inset-right, 0px));
}

.bcbp-pos-top-center .bcbp-bubble,
.bcbp-pos-bottom-center .bcbp-bubble {
	left: 50%;
	translate: -50% 0;
}

/* ---------- Dispositivos ---------- */

@media (max-width: 767px) {
	.bcbp-only-desktop { display: none !important; }
}
@media (min-width: 768px) {
	.bcbp-only-mobile { display: none !important; }
}

/* ---------- Modal ---------- */

.bcbp-modal {
	position: fixed;
	inset: 0;
	z-index: 2147483000;
	display: grid;
	place-items: center;
	padding: 16px;
}

.bcbp-modal[hidden] { display: none; }

.bcbp-overlay {
	position: absolute;
	inset: 0;
	background: rgba(12, 14, 22, .62);
	-webkit-backdrop-filter: blur(3px);
	backdrop-filter: blur(3px);
	opacity: 0;
	transition: opacity .3s ease;
}

.bcbp-overlay[data-bcbp-close] { cursor: pointer; }

.bcbp-dialog {
	position: relative;
	width: min(100%, var(--bcbp-width));
	max-height: calc(100vh - 32px);
	max-height: calc(100dvh - 32px);
	overflow: auto;
	overscroll-behavior: contain;
	background: var(--bcbp-popup-bg);
	border-radius: 20px;
	padding: clamp(28px, 5vw, 44px) clamp(20px, 4vw, 40px);
	box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .45);
	opacity: 0;
	scale: .8;
	translate: 0 24px;
	transition: opacity .25s ease, scale .45s cubic-bezier(.34, 1.56, .64, 1), translate .45s cubic-bezier(.34, 1.56, .64, 1);
}

.bcbp-dialog:focus { outline: none; }

.bcbp-modal.is-open .bcbp-overlay { opacity: 1; }
.bcbp-modal.is-open .bcbp-dialog {
	opacity: 1;
	scale: 1;
	translate: 0 0;
}

.bcbp-close {
	position: absolute;
	top: 10px;
	right: 10px;
	width: 40px;
	height: 40px;
	padding: 8px;
	margin: 0;
	border: 0;
	border-radius: 50%;
	background: rgba(0, 0, 0, .06);
	color: inherit;
	cursor: pointer;
	display: grid;
	place-items: center;
	z-index: 2;
	transition: background .2s ease, rotate .2s ease;
}

.bcbp-close svg { width: 20px; height: 20px; display: block; }
.bcbp-close:hover { background: rgba(0, 0, 0, .12); rotate: 90deg; }
.bcbp-close:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; }

/* Contenido de bloques */
.bcbp-content > :first-child { margin-top: 0; }
.bcbp-content > :last-child { margin-bottom: 0; }

.bcbp-content .alignwide,
.bcbp-content .alignfull {
	width: auto;
	max-width: 100%;
	margin-left: 0;
	margin-right: 0;
}

.bcbp-content img { max-width: 100%; height: auto; }

body.bcbp-lock { overflow: hidden; }

/* ---------- Confeti ---------- */

.bcbp-confetti {
	position: fixed;
	inset: 0;
	width: 100vw;
	height: 100vh;
	z-index: 2147483647;
	pointer-events: none;
}

/* ---------- Animaciones ---------- */

@keyframes bcbp-pop-in {
	from { scale: 0; opacity: 0; }
	to { scale: 1; opacity: 1; }
}

@keyframes bcbp-pulse {
	0% { scale: 1; opacity: .55; }
	70%, 100% { scale: 1.7; opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
	.bcbp-bubble,
	.bcbp-bubble.has-pulse::before,
	.bcbp-dialog,
	.bcbp-overlay,
	.bcbp-close {
		animation: none !important;
		transition: none !important;
	}
}
