/* ============================================================================
   SCROLL TO TOP v1.0 — Botón volver arriba
   Aparece solo después de hacer scroll, posición bottom-right
   ============================================================================ */

.scroll-top-btn {
  position: fixed;
  bottom: 88px;
  right: 26px;
  z-index: 99;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1.5px solid var(--border-color, #374151);
  background: var(--card-bg, #1a1a1a);
  color: var(--text-secondary, #d1d5db);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  cursor: pointer;
  box-shadow: var(--shadow-lg, 0 10px 15px rgba(0,0,0,0.3));
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);

  /* Oculto por defecto */
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px);
  transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease,
              background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
  -webkit-tap-highlight-color: transparent;
}

.scroll-top-btn.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.scroll-top-btn:hover {
  background: linear-gradient(135deg, var(--accent-burgundy, #9b2c2c), var(--accent-gold, #d4af37));
  border-color: transparent;
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(155, 44, 44, 0.35);
}

.scroll-top-btn:active {
  transform: scale(0.92);
}

/* ── Desktop: un poco más separado del borde ── */
@media (min-width: 769px) {
  .scroll-top-btn {
    width: 42px;
    height: 42px;
    bottom: 90px;
    right: 28px;
  }
}

/* ── Reducir movimiento ── */
@media (prefers-reduced-motion: reduce) {
  .scroll-top-btn {
    transition: opacity 0.15s ease, visibility 0.15s ease;
    transform: none !important;
  }
}