/* ============================================
   Component: Back to Top
   ============================================ */

.back-to-top {
  position: fixed;
  right: var(--space-6);
  bottom: var(--space-6);
  z-index: 90;

  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: none;
  cursor: pointer;

  background: var(--color-primary);
  color: white;
  box-shadow: var(--shadow-lg);

  display: grid;
  place-items: center;

  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease, background-color 0.15s ease;
}

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

.back-to-top:hover {
  background: var(--color-secondary);
}

.back-to-top:focus-visible {
  outline: 2px solid var(--color-secondary);
  outline-offset: 3px;
}

@media (max-width: 600px) {
  .back-to-top {
    right: var(--space-4);
    bottom: var(--space-4);
    width: 44px;
    height: 44px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .back-to-top { transition: opacity 0.2s ease; transform: none; }
}
