/* BG WhatsApp Bubble — front */

.bgwb {
	position: fixed;
	z-index: 999998;
	display: flex;
	align-items: center;
	gap: 12px;
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
	transition: opacity .35s ease, visibility .35s ease;
	font-family: inherit;
}

.bgwb.is-visible {
	opacity: 1;
	visibility: visible;
	pointer-events: auto;
}

/* Horizontal */
.bgwb-h-right {
	right: var(--bgwb-x, 24px);
	flex-direction: row-reverse;
}

.bgwb-h-left {
	left: var(--bgwb-x, 24px);
	flex-direction: row;
}

/* Vertical */
.bgwb-v-top    { top: var(--bgwb-y, 24px); }
.bgwb-v-bottom { bottom: var(--bgwb-y, 24px); }
.bgwb-v-middle { top: 50%; margin-top: calc(var(--bgwb-size, 60px) / -2); }

/* Botón */
.bgwb-btn {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	width: var(--bgwb-size, 60px);
	height: var(--bgwb-size, 60px);
	border-radius: 50%;
	background: var(--bgwb-bg, #25D366);
	box-shadow: 0 6px 18px rgba(0, 0, 0, .22);
	text-decoration: none;
	flex: 0 0 auto;
	transition: transform .2s ease, box-shadow .2s ease;
	-webkit-tap-highlight-color: transparent;
}

.bgwb-btn:hover,
.bgwb-btn:focus-visible {
	transform: scale(1.07);
	box-shadow: 0 10px 26px rgba(0, 0, 0, .3);
}

.bgwb-btn:focus-visible {
	outline: 3px solid #fff;
	outline-offset: 3px;
}

.bgwb-icon {
	width: 58%;
	height: 58%;
	fill: var(--bgwb-icon, #fff);
	display: block;
}

/* Pulso */
.bgwb-pulse .bgwb-btn::before {
	content: "";
	position: absolute;
	inset: 0;
	border-radius: 50%;
	background: var(--bgwb-bg, #25D366);
	opacity: .55;
	z-index: -1;
	animation: bgwb-pulse 2.2s cubic-bezier(.25, .8, .35, 1) infinite;
}

@keyframes bgwb-pulse {
	0%   { transform: scale(1);   opacity: .55; }
	70%  { transform: scale(1.6); opacity: 0; }
	100% { transform: scale(1.6); opacity: 0; }
}

/* Etiqueta */
.bgwb-label {
	background: #fff;
	color: #1c1c1c;
	font-size: 14px;
	line-height: 1.3;
	font-weight: 600;
	padding: 10px 14px;
	border-radius: 8px;
	box-shadow: 0 4px 14px rgba(0, 0, 0, .16);
	white-space: nowrap;
	max-width: 45vw;
	overflow: hidden;
	text-overflow: ellipsis;
	opacity: 0;
	transform: translateX(6px);
	transition: opacity .25s ease, transform .25s ease;
	pointer-events: none;
}

.bgwb-h-left .bgwb-label { transform: translateX(-6px); }

.bgwb:hover .bgwb-label,
.bgwb:focus-within .bgwb-label,
.bgwb.is-open .bgwb-label {
	opacity: 1;
	transform: translateX(0);
}

/* En pantallas táctiles la etiqueta se muestra al aparecer y se retrae sola */
@media (hover: none) {
	.bgwb .bgwb-label { font-size: 13px; padding: 8px 12px; }
}

@media (prefers-reduced-motion: reduce) {
	.bgwb,
	.bgwb-btn,
	.bgwb-label { transition: none; }
	.bgwb-pulse .bgwb-btn::before { animation: none; }
}

/* Evita chocar con la barra de administración en la vista previa */
.admin-bar .bgwb-v-top { top: calc(var(--bgwb-y, 24px) + 32px); }

@media screen and (max-width: 782px) {
	.admin-bar .bgwb-v-top { top: calc(var(--bgwb-y, 24px) + 46px); }
}
