/* ==========================================================================
   YS Scroll To Top — círculo blanco con anillo de progreso + porcentaje
   Identidad visual: navy #00247e · acento naranja #cd7d0b
   Inspirado en proporciones/posición del #scroll-top de impacto-gigante
   (5rem, right:50px/bottom:128px, aparición con fade), sin dependencias.
   ========================================================================== */

/* Oculta el botón original del plugin jquery.scrollUp */
#scrollUp {
	display: none !important;
}

.ys-scrolltop {
	position: fixed;
	right: 50px;
	bottom: 50px;
	width: 5rem;
	height: 5rem;
	padding: 0;
	border: none;
	border-radius: 50%;
	background: #ffffff;
	cursor: pointer;
	z-index: 999;
	display: flex;
	align-items: center;
	justify-content: center;
	box-shadow: 0 12px 30px rgba(0, 36, 126, .25);
	opacity: 0;
	visibility: hidden;
	transform: translateY(40px);
	transition: opacity .4s ease, transform .4s cubic-bezier(.2, .8, .2, 1), box-shadow .35s ease, visibility .4s;
}

.ys-scrolltop.is-visible {
	opacity: 1;
	visibility: visible;
	transform: translateY(0);
}

.ys-scrolltop:hover {
	box-shadow: 0 18px 38px rgba(205, 125, 11, .4);
	transform: translateY(-4px);
}

.ys-scrolltop:active {
	transform: translateY(-1px) scale(.96);
}

.ys-scrolltop:focus-visible {
	outline: 2px solid #cd7d0b;
	outline-offset: 3px;
}

/* ---------- Anillo de progreso ---------- */
.ys-scrolltop__ring {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	transform: rotate(-90deg);
}

.ys-scrolltop__track {
	fill: none;
	stroke: rgba(0, 36, 126, .14);
	stroke-width: 3;
}

.ys-scrolltop__progress {
	fill: none;
	stroke: #00247e;
	stroke-width: 3;
	stroke-linecap: round;
	stroke-dasharray: 150.8; /* 2 * PI * r(24) */
	stroke-dashoffset: 150.8;
	transition: stroke-dashoffset .15s linear, stroke .35s ease;
}

.ys-scrolltop:hover .ys-scrolltop__progress {
	stroke: #cd7d0b;
}

/* ---------- Centro: porcentaje + flecha (cross-fade en hover) ---------- */
.ys-scrolltop__center {
	position: relative;
	z-index: 1;
	width: 100%;
	height: 100%;
	display: flex;
	align-items: center;
	justify-content: center;
}

.ys-scrolltop__percent,
.ys-scrolltop__icon {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: opacity .3s ease, transform .3s ease;
}

.ys-scrolltop__percent {
	font-family: 'Barlow', sans-serif;
	font-size: 16px;
	font-weight: 800;
	color: #00247e;
	opacity: 1;
	transform: scale(1);
}

.ys-scrolltop__icon {
	color: #cd7d0b;
	font-size: 18px;
	opacity: 0;
	transform: scale(.6);
}

.ys-scrolltop:hover .ys-scrolltop__percent {
	opacity: 0;
	transform: scale(.6);
}

.ys-scrolltop:hover .ys-scrolltop__icon {
	opacity: 1;
	transform: scale(1);
}

/* idle pulse sutil para llamar la atención sin ser ruidoso */
.ys-scrolltop.is-visible {
	animation: ysScrollTopPulse 3.2s ease-in-out infinite;
}

.ys-scrolltop:hover {
	animation: none;
}

@keyframes ysScrollTopPulse {
	0%, 100% { box-shadow: 0 12px 30px rgba(0, 36, 126, .25), 0 0 0 0 rgba(205, 125, 11, .35); }
	50%      { box-shadow: 0 12px 30px rgba(0, 36, 126, .25), 0 0 0 10px rgba(205, 125, 11, 0); }
}

/* ---------- Responsive ---------- */
@media (max-width: 575px) {
	.ys-scrolltop {
		width: 3.4rem;
		height: 3.4rem;
		right: 18px;
		bottom: 18px;
	}
	.ys-scrolltop__percent { font-size: 12px; }
	.ys-scrolltop__icon { font-size: 14px; }
}

@media (prefers-reduced-motion: reduce) {
	.ys-scrolltop,
	.ys-scrolltop__percent,
	.ys-scrolltop__icon,
	.ys-scrolltop__progress {
		animation: none !important;
		transition-duration: .01ms !important;
	}
}
