/**
 * دکمه بازگشت به بالا — میم چه
 */

.scrollToTop {
	--y14-st-size: 48px;
	left: 20px !important;
	right: auto !important;
	bottom: 20px !important;
	width: var(--y14-st-size) !important;
	height: var(--y14-st-size) !important;
	border: 0 !important;
	border-radius: 999px !important;
	background: linear-gradient(
		145deg,
		var(--y14-brand-primary-light, #0052ce) 0%,
		var(--y14-brand-primary, #001687) 58%,
		var(--y14-brand-primary-dark, #02164c) 100%
	) !important;
	color: #fff !important;
	box-shadow:
		0 10px 28px rgba(var(--y14-brand-primary-rgb, 0, 22, 135), 0.38),
		0 0 0 1px rgba(255, 255, 255, 0.14) inset !important;
	opacity: 0;
	pointer-events: none;
	transform: translate3d(0, 18px, 0) scale(0.82);
	transition:
		opacity 0.35s ease,
		transform 0.45s cubic-bezier(0.34, 1.45, 0.64, 1),
		box-shadow 0.3s ease,
		background 0.3s ease;
	overflow: visible;
}

.scrollToTop::before {
	content: "";
	position: absolute;
	inset: 0;
	border-radius: inherit;
	background: rgba(var(--y14-brand-primary-rgb, 0, 22, 135), 0.35);
	opacity: 0;
	transform: scale(1);
	z-index: -1;
	pointer-events: none;
}

.scrollToTop::after {
	position: relative;
	z-index: 1;
	color: #fff !important;
	font-size: 17px !important;
	font-weight: 700;
	transition: transform 0.3s cubic-bezier(0.34, 1.45, 0.64, 1);
}

.scrollToTop.button-show {
	opacity: 1;
	transform: translate3d(0, 0, 0) scale(1);
	pointer-events: auto;
	animation: y14-scroll-top-enter 0.55s cubic-bezier(0.34, 1.45, 0.64, 1);
}

.scrollToTop.button-show::before {
	animation: y14-scroll-top-ring 2.4s ease-out infinite;
}

.scrollToTop:hover {
	color: #fff !important;
	transform: translate3d(0, -4px, 0) scale(1.06) !important;
	box-shadow:
		0 16px 36px rgba(var(--y14-brand-primary-rgb, 0, 22, 135), 0.48),
		0 0 0 1px rgba(255, 255, 255, 0.22) inset !important;
}

.scrollToTop:hover::after {
	transform: translateY(-2px);
}

.scrollToTop:active {
	transform: translate3d(0, 0, 0) scale(0.94) !important;
	transition-duration: 0.12s;
}

.scrollToTop:active::after {
	transform: translateY(0);
}

@keyframes y14-scroll-top-enter {
	from {
		opacity: 0;
		transform: translate3d(0, 22px, 0) scale(0.65);
	}

	to {
		opacity: 1;
		transform: translate3d(0, 0, 0) scale(1);
	}
}

@keyframes y14-scroll-top-ring {
	0% {
		opacity: 0.45;
		transform: scale(1);
	}

	70% {
		opacity: 0;
		transform: scale(1.55);
	}

	100% {
		opacity: 0;
		transform: scale(1.55);
	}
}

@media (max-width: 1024px) {
	.scrollToTop {
		--y14-st-size: 42px;
		left: 12px !important;
		right: auto !important;
		bottom: 10px !important;
	}

	.scrollToTop::after {
		font-size: 15px !important;
	}
}

.sticky-toolbar-on .scrollToTop {
	bottom: 67px !important;
}

.sticky-toolbar-on .wd-sticky-btn-shown.scrollToTop {
	bottom: calc(12px + 55px + var(--wd-sticky-btn-height)) !important;
}

@media (prefers-reduced-motion: reduce) {
	.scrollToTop,
	.scrollToTop.button-show,
	.scrollToTop::before,
	.scrollToTop::after {
		animation: none !important;
		transition: opacity 0.2s ease !important;
	}
}
