/**
 * EastDigi scroll-to-top — full eastdtc.com animation replica, brand colors.
 * Reference: eastdtc-scroll-to-top.css (Shopify theme asset)
 */

.ed-scroll-to-top .visually-hidden,
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.ed-scroll-to-top {
  --ed-scroll-top-size: 52px;
  position: fixed;
  right: clamp(16px, 3vw, 28px);
  bottom: clamp(20px, 4vw, 32px);
  z-index: 9999;
  width: var(--ed-scroll-top-size);
  height: var(--ed-scroll-top-size);
  padding: 0;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  background: transparent;
  box-shadow:
    0 8px 28px rgba(0, 0, 0, 0.45),
    0 0 0 1px rgba(0, 153, 255, 0.12);
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px) scale(0.92);
  transition:
    opacity 0.35s ease,
    visibility 0.35s ease,
    transform 0.35s cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 0.3s ease;
}

.ed-scroll-to-top:not([hidden]) {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

.ed-scroll-to-top.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

.ed-scroll-to-top:hover {
  box-shadow:
    0 12px 36px rgba(0, 0, 0, 0.55),
    0 0 24px rgba(0, 153, 255, 0.25),
    0 0 12px rgba(191, 0, 255, 0.2);
  transform: translateY(-2px) scale(1.06);
}

.ed-scroll-to-top:focus-visible {
  outline: 2px solid rgba(0, 153, 255, 0.65);
  outline-offset: 3px;
}

.ed-scroll-to-top__svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.ed-scroll-to-top__track {
  transition: stroke 0.3s ease;
}

.ed-scroll-to-top:hover .ed-scroll-to-top__track {
  stroke: rgba(0, 153, 255, 0.38);
}

.ed-scroll-to-top__progress {
  transition: stroke-dashoffset 0.12s linear;
}

.ed-scroll-to-top__orbit {
  transform-origin: 28px 28px;
  animation: ed-scroll-top-orbit 10s linear infinite;
}

@keyframes ed-scroll-top-orbit {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

.ed-scroll-to-top__star {
  animation: ed-scroll-top-twinkle 2.4s ease-in-out infinite;
}

.ed-scroll-to-top__star--2 {
  animation-delay: 0.6s;
}

.ed-scroll-to-top__star--3 {
  animation-delay: 1.2s;
}

.ed-scroll-to-top__star--4 {
  animation-delay: 1.8s;
}

@keyframes ed-scroll-top-twinkle {
  0%,
  100% {
    opacity: 0.45;
    transform: scale(0.85);
  }
  50% {
    opacity: 1;
    transform: scale(1.15);
  }
}

.ed-scroll-to-top__arrows {
  transform-origin: 28px 28px;
}

.ed-scroll-to-top__chevron--1 {
  animation: ed-scroll-top-rise 1.8s ease-in-out infinite;
}

.ed-scroll-to-top__chevron--2 {
  animation: ed-scroll-top-rise 1.8s ease-in-out infinite;
  animation-delay: 0.35s;
}

@keyframes ed-scroll-top-rise {
  0%,
  100% {
    opacity: 1;
    transform: translateY(2px);
  }
  45% {
    opacity: 0.35;
    transform: translateY(-5px);
  }
}

.ed-scroll-to-top:hover .ed-scroll-to-top__chevron--1,
.ed-scroll-to-top:hover .ed-scroll-to-top__chevron--2 {
  animation-duration: 1.1s;
}

.ed-scroll-to-top:hover .ed-scroll-to-top__orbit {
  animation-duration: 6s;
}

@media (prefers-reduced-motion: reduce) {
  .ed-scroll-to-top__orbit,
  .ed-scroll-to-top__star,
  .ed-scroll-to-top__chevron--1,
  .ed-scroll-to-top__chevron--2 {
    animation: none;
  }

  .ed-scroll-to-top {
    transition: opacity 0.2s ease, visibility 0.2s ease;
  }

  .ed-scroll-to-top:hover {
    transform: translateY(0) scale(1);
  }
}

@media screen and (max-width: 749px) {
  .ed-scroll-to-top {
    --ed-scroll-top-size: 46px;
    right: 14px;
    bottom: 18px;
  }
}

@media print {
  .ed-scroll-to-top {
    display: none !important;
  }
}
