/**
 * Back to Top Component
 * ======================
 * Floating scroll-to-top button, bottom-left, mirrors the dark-mode-toggle
 * FAB styling but on the opposite corner to avoid the existing FAB stack.
 */

.back-to-top {
  position: fixed !important;
  left: max(0.9rem, env(safe-area-inset-left)) !important;
  bottom: max(0.9rem, env(safe-area-inset-bottom)) !important;
  top: auto !important;
  right: auto !important;
  width: var(--giw-fab-size);
  height: var(--giw-fab-size);
  border-radius: 50%;
  background: linear-gradient(135deg, #0077BE, #00D4E4);
  border: 3px solid rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10005 !important;
  box-shadow: 0 8px 25px rgba(0, 119, 190, 0.4);
  transition: transform 0.3s ease, box-shadow 0.3s ease, opacity 0.3s ease, visibility 0.3s ease;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
}

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

.back-to-top:hover {
  transform: scale(1.1);
  box-shadow: 0 10px 35px rgba(0, 119, 190, 0.6);
}

.back-to-top:focus-visible {
  outline: 3px solid rgba(0, 212, 228, 0.85);
  outline-offset: 4px;
  box-shadow: 0 0 0 6px rgba(0, 119, 190, 0.25);
}

.back-to-top-icon {
  font-size: 1.5rem;
  font-weight: 700;
  color: #fff;
  line-height: 1;
}

@media (max-width: 768px) {
  .back-to-top {
    width: var(--giw-fab-size);
    height: var(--giw-fab-size);
  }
}

@media (prefers-reduced-motion: reduce) {
  .back-to-top {
    transition: opacity 0.3s ease, visibility 0.3s ease;
  }

  .back-to-top:hover {
    transform: none;
    box-shadow: 0 8px 25px rgba(0, 119, 190, 0.4);
  }

  .back-to-top.is-visible {
    transform: none;
  }
}
