/* =========================================================
   bantrab/help-widget — Widget flotante de canales de ayuda
   ========================================================= */

.help-widget {
	position: fixed;
	bottom: 32px;
	right: 32px;
	z-index: 9998;
	display: flex;
	flex-direction: column;
	align-items: flex-end;
	gap: 10px;
	/* Hereda pointer-events para no bloquear clics en el resto de la página */
	pointer-events: none;
}

.genesys-mxg-frame {
	bottom: 204px !important;
}
@media (max-width: 768px){
	#genesys-messenger .genesys-mxg-frame {
		bottom: 96px !important;
		max-height: 80% !important;
	}
}

/* ── Panel ─────────────────────────────────────────────── */
.help-widget__panel {
	display: flex;
	flex-direction: column;
	gap: 8px;
	align-items: flex-end;
	opacity: 0;
	visibility: hidden;
	transform: translateY(10px);
	transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
	pointer-events: none;
}

.help-widget.is-open .help-widget__panel {
	opacity: 1;
	visibility: visible;
	transform: translateY(0);
	pointer-events: auto;
}

/* ── Botones de canal ──────────────────────────────────── */
.help-widget__btn {
	display: flex;
	align-items: center;
	gap: 10px;
	background: #fff;
	border: none;
	border-radius: 50px;
	padding: 8px 16px 8px 8px;
	box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
	cursor: pointer;
	font-size: 14px;
	font-weight: 600;
	color: #003b71;
	white-space: nowrap;
	transition: transform 0.15s ease, box-shadow 0.15s ease;
	text-decoration: none;
	font-family: inherit;
	line-height: 1;
	pointer-events: auto;
}

.help-widget__btn:hover,
.help-widget__btn:focus-visible {
	transform: translateY(-2px);
	box-shadow: 0 6px 20px rgba(0, 0, 0, 0.22);
	outline: none;
}

/* Ícono circular de cada canal */
.help-widget__btn-icon {
	width: 36px;
	height: 36px;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	color: #fff;
}

.help-widget__btn-icon--chat      { background: #003b71; }
.help-widget__btn-icon--whatsapp  { background: #25d366; }
.help-widget__btn-icon--call      { background: #e8af30; color: #003b71; }

/* ── Botón toggle FAB ─────────────────────────────────── */
.help-widget__toggle {
	width: 56px;
	height: 56px;
	border-radius: 50%;
	background: #003b71;
	border: none;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	box-shadow: 0 4px 18px rgba(0, 59, 113, 0.45);
	transition: transform 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
	flex-shrink: 0;
	color: #fff;
	pointer-events: auto;
}

.help-widget__toggle:hover,
.help-widget__toggle:focus-visible {
	background: #005ca9;
	transform: scale(1.06);
	outline: none;
}

/* El ícono del toggle rota 45° cuando el panel está abierto o el chat activo (+ → ✕) */
.help-widget__toggle-icon {
	display: flex;
	align-items: center;
	justify-content: center;
	transition: transform 0.2s ease;
}

.help-widget.is-open .help-widget__toggle-icon,
.help-widget.chat-is-open .help-widget__toggle-icon {
	transform: rotate(45deg);
}

/* ── Responsive ───────────────────────────────────────── */
@media (max-width: 767px) {
	.help-widget {
		bottom: 20px;
		right: 16px;
	}

	.help-widget__btn-label {
		display: none; /* Solo ícono en móvil */
	}

	.help-widget__btn {
		padding: 0;
		width: 44px;
		height: 44px;
		border-radius: 50%;
		justify-content: center;
	}

	.help-widget__btn-icon {
		width: 44px;
		height: 44px;
	}
}

/* ── Ocultar launcher nativo de Genesys ───────────────────────────────────── */
/* El SDK inyecta el launcher como un iframe (genesys-mxg-launcher-frame).   */
/* Lo ocultamos porque usamos nuestro propio widget. El iframe del chat       */
/* (genesys-mxg-container-frame) se mantiene visible para cuando se abre.    */
iframe.genesys-mxg-launcher-frame,
#genesys-mxg-frame {
	display: none !important;
	width: 0 !important;
	height: 0 !important;
}
