/* Vissza az oldal tetejére gomb (a régi scroll progress indikátor helyett) */

.back-to-top {
  --btt-size: 56px;

  position: fixed;
  right: 24px;
  bottom: calc(32px + env(safe-area-inset-bottom, 0px));
  z-index: 9999;

  display: flex;
  align-items: center;
  justify-content: center;
  width: var(--btt-size);
  height: var(--btt-size);
  margin: 0;
  padding: 0;

  color: #000000;
  /* ugyanaz a színátmenet, mint a WEBSHOP menüpontnál / a scrollbar thumbon */
  background: linear-gradient(0deg, var(--primary-light, #ffce53) 0%, var(--primary-dark, #ebaa05) 100%);
  border: none;
  border-radius: 50%;
  box-shadow:
    0 6px 18px rgba(0, 0, 0, 0.12),
    0 2px 6px rgba(0, 0, 0, 0.06);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;

  /* rejtett állapot */
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(12px);
  transition:
    opacity 0.25s ease,
    transform 0.25s ease,
    visibility 0.25s ease,
    color 0.25s ease,
    box-shadow 0.25s ease;
}

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

.back-to-top svg {
  display: block;
  width: 24px;
  height: 24px;
  transition: transform 0.25s ease;
}

@media (hover: hover) {
  .back-to-top:hover {
    color: #000000;
    box-shadow:
      0 10px 24px rgba(0, 0, 0, 0.16),
      0 3px 8px rgba(0, 0, 0, 0.08);
  }

  .back-to-top:hover svg {
    transform: translateY(-2px);
  }
}

.back-to-top:active {
  transform: scale(0.94);
}

.back-to-top:focus-visible {
  outline: 2px solid #000000;
  outline-offset: 3px;
}

@media (max-width: 1024px) {
  .back-to-top {
    --btt-size: 52px;
    right: 16px;
    bottom: calc(24px + env(safe-area-inset-bottom, 0px));
  }
}

@media (max-width: 640px) {
  .back-to-top {
    --btt-size: 48px;
    right: 12px;
    bottom: calc(20px + env(safe-area-inset-bottom, 0px));
  }

  .back-to-top svg {
    width: 22px;
    height: 22px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .back-to-top,
  .back-to-top svg {
    transition: opacity 0.15s linear, visibility 0.15s linear;
    transform: none !important;
  }
}
