/* NOREM — wspólny, ikonowy przycisk powrotu na górę strony. */

.back-to-top {
  position: fixed;
  z-index: 19;
  right: clamp(20px, 2.2vw, 34px);
  bottom: clamp(20px, 2.2vw, 34px);
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 50%;
  background: var(--ink);
  color: #fff;
  box-shadow: 0 12px 30px rgba(9, 27, 43, 0.2);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(10px);
  transition:
    opacity 180ms var(--ease),
    visibility 180ms var(--ease),
    background-color 180ms var(--ease),
    transform 180ms var(--ease);
}

.back-to-top.is-visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: none;
}

.back-to-top:hover {
  background: #10283d;
  transform: translateY(-2px);
}

.back-to-top:active {
  transform: translateY(1px);
}

.back-to-top:focus-visible {
  outline: 3px solid rgba(47, 123, 199, 0.45);
  outline-offset: 4px;
}

.back-to-top svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

@media (max-width: 760px) {
  .back-to-top {
    width: 44px;
    height: 44px;
  }

  .cart-page .back-to-top {
    bottom: calc(94px + env(safe-area-inset-bottom));
  }
}

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