*,
*::before,
*::after {
  box-sizing: border-box;
}
html {
  scroll-behavior: smooth;
}
img {
  max-width: 100%;
  height: auto;
  display: block;
}
button,
input,
select,
textarea {
  font: inherit;
}
a {
  -webkit-tap-highlight-color: transparent;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ===== Scroll to top ===== */

.scroll-top-btn {
  --scroll-top-offset-desktop: 24px;
  --scroll-top-offset-mobile: 14px;

  position: fixed;
  right: calc(24px + env(safe-area-inset-right));
  bottom: calc(var(--scroll-top-offset-desktop) + env(safe-area-inset-bottom));
  width: 56px;
  height: 56px;
  padding: 0;
  border: none;
  border-radius: 0;
  background: transparent;
  color: #111827;
  box-shadow: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 1001;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  pointer-events: none;
  touch-action: manipulation;
  transition:
    opacity 0.22s ease,
    transform 0.22s ease,
    visibility 0.22s ease;
}

.scroll-top-btn svg {
  width: 34px;
  height: 34px;
  display: block;
}

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

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

.scroll-top-btn:focus-visible {
  outline: none;
}

html.dark .scroll-top-btn {
  color: #ffffff;
}

body.has-sticky-cta .scroll-top-btn {
  --scroll-top-offset-mobile: 104px;
}

@media (max-width: 819px) {
  .scroll-top-btn {
    right: calc(12px + env(safe-area-inset-right));
    bottom: calc(var(--scroll-top-offset-mobile) + env(safe-area-inset-bottom));
    width: 52px;
    height: 52px;
  }

  .scroll-top-btn svg {
    width: 32px;
    height: 32px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .scroll-top-btn {
    transition: none;
  }
}
