/**
 * === Scroll To Top - FAB nÃƒÂºt lÃƒÂªn Ã„â€˜Ã¡ÂºÂ§u trang gÃƒÂ³c phÃ¡ÂºÂ£i dÃ†Â°Ã¡Â»â€ºi ===
 *
 * MÃƒÂ´ tÃ¡ÂºÂ£: Floating action button cÃ¡Â»â€˜ Ã„â€˜Ã¡Â»â€¹nh gÃƒÂ³c phÃ¡ÂºÂ£i dÃ†Â°Ã¡Â»â€ºi viewport.
 *        MÃ¡ÂºÂ·c Ã„â€˜Ã¡Â»â€¹nh hidden (display: none qua [hidden] attribute).
 *        JS bÃ¡Â»Â [hidden] + thÃƒÂªm class .is-visible khi user cuÃ¡Â»â„¢n > 400px.
 *        Click Ã¢â€ â€™ lenis.scrollTo(0) (smooth) hoÃ¡ÂºÂ·c fallback window.scrollTo.
 *
 * Flow:
 *   1. Default state: hidden via [hidden] attribute
 *   2. is-visible class: opacity 1 + transform identity
 *   3. Transition opacity + transform Ã„â€˜Ã¡Â»Æ’ fade-in/scale-up
 *   4. Hover: scale 1.08 + shadow Ã„â€˜Ã¡ÂºÂ­m
 *   5. Active/click: scale 0.96 (press feedback)
 *   6. Focus-visible: outline ring (a11y)
 */

.floating-utility {
	position: fixed;
	right: clamp(20px, 3vw, 32px);
	bottom: clamp(20px, 3vw, 32px);
	z-index: 9998;
	display: flex;
	flex-direction: column;
	align-items: flex-end;
	gap: 10px;
}

.floating-utility__item {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	border-radius: 999px;
	border: none;
	background: var(--color-primary-600, var(--color-brand-secondary));
	color: #ffffff;
	box-shadow: 0 8px 24px rgba(46, 125, 92, 0.32),
	            0 4px 8px rgba(0, 0, 0, 0.12);
	text-decoration: none;
	cursor: pointer;
	transition:
		opacity 280ms var(--ease-standard, ease),
		transform 280ms var(--ease-standard, ease),
		background-color 200ms var(--ease-standard, ease),
		box-shadow 200ms var(--ease-standard, ease);
}

.floating-utility__item--hotline {
	position: fixed;
	right: auto !important;
	left: clamp(20px, 3vw, 32px) !important;
	bottom: clamp(20px, 3vw, 32px);
	z-index: 9998;
	min-height: 48px;
	padding: 0 16px;
	font-size: var(--text-caption);
	font-weight: var(--weight-bold);
	letter-spacing: 0.01em;
	animation: floating-utility-enter 520ms var(--ease-standard, ease) both 900ms;
}

.scroll-to-top {
	width: 48px;
	height: 48px;

	/* Default visual state khi visible nhÃ†Â°ng chÃ†Â°a hover */
	opacity: 0;
	transform: translateY(20px) scale(0.85);
	pointer-events: none;
}

/* Khi JS bÃ¡Â»Â [hidden] attribute thÃƒÂ¬ display lÃ¡ÂºÂ¡i block, sau Ã„â€˜ÃƒÂ³ add .is-visible */
.scroll-to-top[hidden] {
	display: none !important;
}

.scroll-to-top.is-visible {
	opacity: 1;
	transform: translateY(0) scale(1);
	pointer-events: auto;
}

.floating-utility__item:hover,
.floating-utility__item:focus-visible {
	background: var(--color-primary-700, var(--color-brand-primary));
	transform: translateY(-2px) scale(1.08);
	box-shadow: 0 12px 32px rgba(46, 125, 92, 0.42),
	            0 6px 12px rgba(0, 0, 0, 0.18);
}

.scroll-to-top:active {
	transform: translateY(0) scale(0.96);
}

.floating-utility__item:focus-visible,
.scroll-to-top:focus-visible {
	outline: 3px solid var(--color-focus, var(--color-brand-primary));
	outline-offset: 3px;
}

.scroll-to-top svg {
	display: block;
}

/* Mobile: thu nhÃ¡Â»Â chÃƒÂºt + Ã„â€˜Ã¡ÂºÂ©y sÃƒÂ¡t mÃƒÂ©p hÃ†Â¡n */
@media (max-width: 767px) {
	.floating-utility {
		right: 16px;
		bottom: 16px;
	}

	.floating-utility__item--hotline span {
		display: none;
	}

	.floating-utility__item--hotline {
		right: auto !important;
		left: 16px !important;
		bottom: 16px;
		width: 44px;
		height: 44px;
		min-height: 44px;
		padding: 0;
	}

	.scroll-to-top {
		width: 44px;
		height: 44px;
	}
}

@keyframes floating-utility-enter {
	from {
		opacity: 0;
		transform: translateY(16px) scale(0.96);
	}
	to {
		opacity: 1;
		transform: translateY(0) scale(1);
	}
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
	.scroll-to-top {
		transition: opacity 200ms linear;
		transform: none !important;
	}
	.scroll-to-top.is-visible { transform: none !important; }
	.scroll-to-top:hover { transform: none !important; }
}
