/**
 * HST WhatsApp floating button (Marketing Center link)
 */

/* 已用子主题 WhatsApp 按钮替代，隐藏营销中心整条侧边栏（含重复 WhatsApp / 返回顶部） */
body.hst-has-wa-float .mc-floating-contact {
	display: none !important;
}

.hst-wa-float {
	position: fixed;
	bottom: 1.5rem;
	right: 1rem;
	z-index: 99990;
	width: 3.5rem;
	height: 3.5rem;
	font-family: "DM Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

@media (min-width: 768px) {
	.hst-wa-float {
		right: 1.5rem;
	}
}

.hst-wa-float--left {
	right: auto;
	left: 1rem;
}

@media (min-width: 768px) {
	.hst-wa-float--left {
		left: 1.5rem;
	}
}

.hst-wa-float.is-dismissed {
	display: none !important;
}

/* Tooltip */
.hst-wa-float__tooltip {
	position: absolute;
	right: 0;
	bottom: calc(100% + 0.75rem);
	width: min(280px, calc(100vw - 2rem));
	padding: 1rem 1rem 0.875rem;
	background: #fff;
	border: 1px solid #e8e6e2;
	border-radius: 0.75rem;
	box-shadow: 0 12px 40px rgba(15, 31, 61, 0.15);
	opacity: 0;
	visibility: hidden;
	transform: translateY(8px);
	transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
	pointer-events: none;
}

/* 按钮与 tooltip 之间的 hover 桥梁，避免移入提示框时闪烁消失 */
.hst-wa-float__tooltip::before {
	content: "";
	position: absolute;
	left: 0;
	right: 0;
	bottom: -0.75rem;
	height: 0.75rem;
}

.hst-wa-float__tooltip::after {
	content: "";
	position: absolute;
	right: 1.75rem;
	bottom: -8px;
	width: 14px;
	height: 14px;
	background: #fff;
	border-right: 1px solid #e8e6e2;
	border-bottom: 1px solid #e8e6e2;
	transform: rotate(45deg);
}

.hst-wa-float--left .hst-wa-float__tooltip {
	right: auto;
	left: 0;
}

.hst-wa-float--left .hst-wa-float__tooltip::after {
	right: auto;
	left: 1.75rem;
}

.hst-wa-float.is-tooltip-visible .hst-wa-float__tooltip {
	opacity: 1;
	visibility: visible;
	transform: translateY(0);
	pointer-events: auto;
	transition-delay: 0s;
}

.hst-wa-float:not(.is-tooltip-visible) .hst-wa-float__tooltip {
	transition-delay: 0.15s;
}

.hst-wa-float__close {
	position: absolute;
	top: -0.5rem;
	right: -0.5rem;
	width: 1.25rem;
	height: 1.25rem;
	border: 0;
	border-radius: 999px;
	background: #6b7380;
	color: #fff;
	font-size: 0.875rem;
	line-height: 1;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 0;
}

.hst-wa-float__close:hover {
	background: #0f1f3d;
}

.hst-wa-float__tooltip-title {
	margin: 0 0 0.375rem;
	font-size: 0.9375rem;
	font-weight: 700;
	color: #0f1f3d;
	line-height: 1.35;
}

.hst-wa-float__tooltip-body {
	margin: 0 0 0.875rem;
	font-size: 0.8125rem;
	line-height: 1.55;
	color: #2a3a4f;
}

.hst-wa-float__tooltip-cta {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 0.5rem;
	width: 100%;
	padding: 0.625rem 0.75rem;
	border-radius: 0.5rem;
	background: #25d366;
	color: #fff !important;
	font-size: 0.75rem;
	font-weight: 600;
	text-decoration: none !important;
	transition: background 0.2s ease;
}

.hst-wa-float__tooltip-cta:hover {
	background: #1ebe5d;
	color: #fff !important;
}

.hst-wa-float__tooltip-cta .hst-wa-float__icon {
	width: 0.875rem;
	height: 0.875rem;
	fill: #fff;
}

/* Main button */
.hst-wa-float__btn {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 100%;
	border-radius: 999px;
	background: #25d366;
	color: #fff;
	text-decoration: none !important;
	box-shadow: 0 4px 20px rgba(37, 211, 102, 0.45);
	transition: transform 0.3s ease, box-shadow 0.3s ease, background 0.2s ease;
}

.hst-wa-float__btn:hover {
	background: #22c55e;
	transform: scale(1.1);
	box-shadow: 0 8px 28px rgba(37, 211, 102, 0.5);
}

.hst-wa-float__btn:active {
	transform: scale(0.95);
}

.hst-wa-float__icon--btn {
	position: relative;
	z-index: 2;
	width: 1.75rem;
	height: 1.75rem;
	fill: #fff;
}

.hst-wa-float__ping {
	position: absolute;
	inset: 0;
	border-radius: 999px;
	background: #25d366;
	opacity: 0.4;
	animation: hst-wa-ping 1.5s cubic-bezier(0, 0, 0.2, 1) infinite;
	pointer-events: none;
}

.hst-wa-float__ping--delay {
	opacity: 0.2;
	animation-delay: 0.3s;
}

@keyframes hst-wa-ping {
	75%,
	100% {
		transform: scale(1.8);
		opacity: 0;
	}
}

.hst-wa-float__badge {
	position: absolute;
	top: -0.25rem;
	right: -0.25rem;
	z-index: 3;
	width: 1.25rem;
	height: 1.25rem;
	border-radius: 999px;
	background: #dc2626;
	color: #fff;
	font-size: 0.6875rem;
	font-weight: 700;
	line-height: 1.25rem;
	text-align: center;
}
