/**
 * HH Contact Buttons - giao diện nút liên hệ nổi.
 * Mọi kích thước suy ra từ --hhcb-size để đổi cỡ chỉ bằng 1 biến.
 */

.hhcb-wrap {
	--hhcb-size: 90px;
	--hhcb-color: #2196f3;
	--hhcb-z: 99999;
	--hhcb-side: 0px;
	--hhcb-bottom: 0px;
	--hhcb-fill-size: calc(var(--hhcb-size) * 0.7222);
	--hhcb-icon-size: calc(var(--hhcb-size) * 0.4444);

	position: absolute;
	bottom: var(--hhcb-bottom);
	line-height: normal;
}

.hhcb-wrap.hhcb-live {
	position: fixed;
	z-index: var(--hhcb-z);
}

.hhcb-wrap.hhcb-pos-left {
	left: var(--hhcb-side);
}

.hhcb-wrap.hhcb-pos-right {
	right: var(--hhcb-side);
}

.hhcb-all {
	display: block;
}

/* ---------- Một nút ---------- */

.hhcb-item {
	position: relative;
	margin-top: -5px;
	width: var(--hhcb-size);
	height: var(--hhcb-size);
}

.hhcb-ring {
	position: relative;
	z-index: 2;
	width: var(--hhcb-size);
	height: var(--hhcb-size);
	cursor: pointer;
	backface-visibility: hidden;
	transform: translateZ(0);
}

/* Vòng sóng lan phía sau */
.hhcb-fill {
	position: absolute;
	width: var(--hhcb-fill-size);
	height: var(--hhcb-fill-size);
	top: calc((var(--hhcb-size) - var(--hhcb-fill-size)) / 2);
	left: calc((var(--hhcb-size) - var(--hhcb-fill-size)) / 2);
	background-color: var(--hhcb-color);
	opacity: 0.7;
	border-radius: 50%;
	border: 2px solid transparent;
	box-shadow: 0 0 0 0 var(--hhcb-color);
	transform-origin: 50% 50%;
}

/* Vòng tròn đặc chứa icon */
.hhcb-icon {
	position: absolute;
	display: flex;
	align-items: center;
	justify-content: center;
	width: var(--hhcb-icon-size);
	height: var(--hhcb-icon-size);
	top: calc((var(--hhcb-size) - var(--hhcb-icon-size)) / 2);
	left: calc((var(--hhcb-size) - var(--hhcb-icon-size)) / 2);
	background-color: var(--hhcb-color);
	border-radius: 50%;
	overflow: hidden;
	transform-origin: 50% 50%;
}

.hhcb-icon a {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 100%;
	color: #fff;
	line-height: 0;
}

.hhcb-icon img,
.hhcb-icon .hhcb-svg {
	max-width: calc(var(--hhcb-icon-size) * 0.675);
	max-height: calc(var(--hhcb-icon-size) * 0.625);
	width: auto;
	height: auto;
	display: block;
}

.hhcb-icon .hhcb-svg {
	width: calc(var(--hhcb-icon-size) * 0.625);
	height: calc(var(--hhcb-icon-size) * 0.625);
}

.hhcb-ring:hover .hhcb-icon {
	transform: scale(1.08);
}

/* ---------- Thanh chữ bên cạnh (hotline) ---------- */

.hhcb-bar {
	position: absolute;
	inset: 0;
	z-index: 1;
	pointer-events: none;
}

.hhcb-bar a {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	left: calc(var(--hhcb-size) / 2);
	padding: 7px 15px 7px calc(var(--hhcb-icon-size) / 2 + 24px);
	background-color: var(--hhcb-color);
	color: #fff;
	font-size: 16px;
	font-weight: 500;
	border-radius: 100px;
	white-space: nowrap;
	text-decoration: none;
	pointer-events: auto;
	transition: opacity 0.25s ease;
}

.hhcb-bar a:hover,
.hhcb-bar a:focus {
	color: #fff;
	opacity: 0.85;
}

.hhcb-pos-right .hhcb-bar a {
	left: auto;
	right: calc(var(--hhcb-size) / 2);
	padding: 7px calc(var(--hhcb-icon-size) / 2 + 24px) 7px 15px;
}

/* ---------- Hoạt ảnh ---------- */

.hhcb-animated .hhcb-fill {
	animation: hhcb-pulse 1.3s infinite;
}

.hhcb-animated .hhcb-icon {
	animation: hhcb-shake 1s infinite ease-in-out;
}

@keyframes hhcb-pulse {
	0% {
		transform: scale(0.9);
		box-shadow: 0 0 0 0 var(--hhcb-color);
	}
	70% {
		transform: scale(1);
		box-shadow: 0 0 0 15px rgba(0, 0, 0, 0);
	}
	100% {
		transform: scale(0.9);
		box-shadow: 0 0 0 0 rgba(0, 0, 0, 0);
	}
}

@keyframes hhcb-shake {
	0%,
	50%,
	100% {
		transform: rotate(0) scale(1) skew(1deg);
	}
	10%,
	30% {
		transform: rotate(-25deg) scale(1) skew(1deg);
	}
	20%,
	40% {
		transform: rotate(25deg) scale(1) skew(1deg);
	}
}

/* ---------- Ẩn / hiện theo thiết bị ---------- */

@media (max-width: 736px) {
	.hhcb-bar {
		display: none;
	}

	.hhcb-wrap.hhcb-hide-mobile {
		display: none;
	}
}

@media (min-width: 737px) {
	.hhcb-wrap.hhcb-hide-desktop {
		display: none;
	}
}

@media (prefers-reduced-motion: reduce) {
	.hhcb-animated .hhcb-fill,
	.hhcb-animated .hhcb-icon {
		animation: none;
	}
}
