.floatbuton {
	--floatbuton-size: 52px;
	--floatbuton-gap: 12px;
	--floatbuton-edge: 18px;
	--floatbuton-neutral: #334155;
	position: fixed;
	top: 50%;
	z-index: 999999;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: var(--floatbuton-gap);
	background: none !important;
	border: none !important;
	box-shadow: none !important;
	padding: 0 !important;
	margin: 0 !important;
	transform: translateY(-50%);
	opacity: 0;
	animation: floatbutonFadeIn 240ms ease 80ms forwards;
}

.floatbuton::before,
.floatbuton::after {
	display: none !important;
}

@keyframes floatbutonFadeIn {
	from {
		opacity: 0;
	}

	to {
		opacity: 1;
	}
}

.floatbuton--right {
	right: var(--floatbuton-edge);
}

.floatbuton--left {
	left: var(--floatbuton-edge);
}

.floatbuton--small {
	--floatbuton-size: 44px;
}

.floatbuton--medium {
	--floatbuton-size: 52px;
}

.floatbuton--large {
	--floatbuton-size: 62px;
}

.floatbuton .floatbuton__button {
	position: relative;
	display: inline-flex !important;
	align-items: center;
	justify-content: center;
	width: var(--floatbuton-size) !important;
	height: var(--floatbuton-size) !important;
	padding: 0 !important;
	border: 0 !important;
	border-radius: 999px !important;
	background: var(--floatbuton-color, var(--floatbuton-neutral)) !important;
	box-shadow: 0 10px 24px rgba(15, 23, 42, 0.22) !important;
	color: #fff !important;
	line-height: 1 !important;
	cursor: pointer;
	text-decoration: none !important;
	transition:
		transform 180ms ease,
		box-shadow 180ms ease,
		filter 180ms ease,
		opacity 200ms ease;
}

.floatbuton .floatbuton__button:hover,
.floatbuton .floatbuton__button:focus-visible {
	transform: scale(1.08);
	box-shadow: 0 14px 30px rgba(15, 23, 42, 0.3);
	filter: brightness(1.04);
	outline: none;
}

.floatbuton .floatbuton__button:focus-visible {
	box-shadow:
		0 14px 30px rgba(15, 23, 42, 0.3),
		0 0 0 3px rgba(255, 255, 255, 0.95),
		0 0 0 6px rgba(37, 99, 235, 0.45);
}

.floatbuton .floatbuton__button:focus:not(:focus-visible) {
	box-shadow: 0 10px 24px rgba(15, 23, 42, 0.22);
	outline: none;
}

.floatbuton .floatbuton__button svg,
.floatbuton .floatbuton__button img {
	width: 56%;
	height: 56%;
	display: block;
	object-fit: contain;
}

.floatbuton .floatbuton__button svg {
	fill: currentColor;
}

.floatbuton .floatbuton__button--top {
	--floatbuton-color: var(--floatbuton-neutral);
}

.floatbuton .floatbuton__button--zalo img.floatbuton__zalo-logo {
	width: 100%;
	height: 100%;
	border-radius: inherit;
	object-fit: cover;
}

.floatbuton__tooltip {
	position: absolute;
	top: 50%;
	width: max-content;
	max-width: 180px;
	padding: 6px 9px;
	border-radius: 6px;
	background: rgba(15, 23, 42, 0.95);
	color: #fff;
	font-size: 13px;
	font-weight: 500;
	line-height: 1.2;
	white-space: nowrap;
	opacity: 0;
	pointer-events: none;
	transform: translateY(-50%) scale(0.96);
	transition:
		opacity 160ms ease,
		transform 160ms ease;
}

.floatbuton--right .floatbuton__tooltip {
	right: calc(100% + 10px);
}

.floatbuton--left .floatbuton__tooltip {
	left: calc(100% + 10px);
}

.floatbuton .floatbuton__button:hover .floatbuton__tooltip,
.floatbuton .floatbuton__button:focus-visible .floatbuton__tooltip {
	opacity: 1;
	transform: translateY(-50%) scale(1);
}

.floatbuton__toggle {
	display: flex;
	align-items: center;
	justify-content: center;
	width: var(--floatbuton-size);
	height: 22px;
	padding: 0;
	border: 0;
	border-radius: 999px;
	background: rgba(51, 65, 85, 0.14);
	color: #334155;
	cursor: pointer;
	transition:
		background 180ms ease,
		height 220ms cubic-bezier(0.4, 0, 0.2, 1),
		box-shadow 180ms ease;
}

.floatbuton__toggle:hover,
.floatbuton__toggle:focus-visible {
	background: rgba(51, 65, 85, 0.26);
	outline: none;
}

.floatbuton__toggle:focus-visible {
	box-shadow:
		0 0 0 2px rgba(255, 255, 255, 0.9),
		0 0 0 4px rgba(37, 99, 235, 0.45);
}

.floatbuton__toggle:focus:not(:focus-visible) {
	outline: none;
}

.floatbuton__toggle svg {
	width: 13px;
	height: 13px;
	display: block;
	flex-shrink: 0;
	transition: transform 280ms cubic-bezier(0.4, 0, 0.2, 1);
}

.floatbuton--collapsed .floatbuton__toggle {
	background: var(--floatbuton-neutral);
	color: #fff;
	height: var(--floatbuton-size);
	box-shadow: 0 10px 24px rgba(15, 23, 42, 0.22);
}

.floatbuton--collapsed .floatbuton__toggle:hover,
.floatbuton--collapsed .floatbuton__toggle:focus-visible {
	background: #475569;
}

.floatbuton--collapsed .floatbuton__toggle svg {
	width: 52%;
	height: 52%;
	transform: rotate(180deg);
}

@media (max-width: 767px) {
	.floatbuton {
		--floatbuton-edge: 12px;
		--floatbuton-gap: 8px;
		--floatbuton-size: 46px;
		top: 50%;
		bottom: auto;
		transform: translateY(-50%);
	}

	.floatbuton--small {
		--floatbuton-size: 42px;
	}

	.floatbuton--large {
		--floatbuton-size: 50px;
	}

	.floatbuton--hide-mobile {
		display: none;
	}

	.floatbuton__tooltip {
		display: none;
	}
}

@media (prefers-reduced-motion: reduce) {
	.floatbuton,
	.floatbuton .floatbuton__button,
	.floatbuton__tooltip,
	.floatbuton__toggle,
	.floatbuton__toggle svg {
		animation: none;
		transition: none;
	}

	.floatbuton {
		opacity: 1;
	}

	.floatbuton .floatbuton__button:hover,
	.floatbuton .floatbuton__button:focus-visible {
		transform: none;
	}
}
