/* Scroll To Top */
.scroll-top {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 90;
  display: inline-flex;
  width: 50px;
  height: 50px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--color-border, #e5e7eb);
  border-radius: 9999px;
  background-color: #ffffff;
  box-shadow: 0 6px 18px rgba(23, 23, 23, 0.08);
  color: var(--color-primary, #007237);
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(10px);
  transition:
    opacity 250ms ease-out,
    visibility 250ms ease-out,
    transform 250ms ease-out,
    box-shadow 250ms ease-out,
    border-color 250ms ease-out;
}

@media (min-width: 1024px) {
  .scroll-top {
    width: 56px;
    height: 56px;
  }
}

body.has-mobile-bottom-nav .scroll-top {
  bottom: calc(24px + 72px + env(safe-area-inset-bottom, 0px));
}

@media (min-width: 1024px) {
  body.has-mobile-bottom-nav .scroll-top {
    bottom: 24px;
  }
}

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

.scroll-top:hover {
  border-color: var(--color-primary, #007237);
  box-shadow: 0 10px 24px rgba(0, 114, 55, 0.16);
  transform: translateY(-3px);
}

.scroll-top:active {
  transform: translateY(-1px) scale(0.96);
}

.scroll-top:focus-visible {
  outline: none;
  border-color: var(--color-primary, #007237);
  box-shadow:
    0 0 0 4px rgba(0, 114, 55, 0.16),
    0 10px 24px rgba(0, 114, 55, 0.14);
}

.scroll-top__progress {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
  pointer-events: none;
}

.scroll-top__track,
.scroll-top__indicator {
  stroke-width: 3;
  stroke-linecap: round;
}

.scroll-top__track {
  stroke: #e5e7eb;
}

.scroll-top__indicator {
  stroke: var(--color-primary, #007237);
  stroke-dasharray: 150.8;
  stroke-dashoffset: 150.8;
  transition: stroke-dashoffset 120ms linear;
}

.scroll-top__icon {
  position: relative;
  z-index: 1;
  width: 18px;
  height: 18px;
  transition: transform 250ms ease-out;
}

@media (min-width: 1024px) {
  .scroll-top__icon {
    width: 20px;
    height: 20px;
  }
}

.scroll-top:hover .scroll-top__icon {
  transform: translateY(-2px);
}

@media (prefers-reduced-motion: reduce) {
  .scroll-top,
  .scroll-top__icon,
  .scroll-top__indicator {
    transition-duration: 0.01ms;
  }
}
