/* Botón flotante "Volver arriba" — un solo CSS global, z-index por debajo del banner cookies */
#back-to-top {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 10040;
  width: 52px;
  height: 52px;
  padding: 0;
  margin: 0;
  border: none;
  border-radius: 50%;
  background: rgba(36, 41, 46, 0.92);
  color: #fff;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(12px);
  transition:
    opacity 0.28s ease,
    transform 0.28s ease,
    visibility 0.28s ease,
    background 0.2s ease,
    box-shadow 0.2s ease;
}

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

#back-to-top:hover,
#back-to-top:focus-visible {
  background: rgba(24, 28, 32, 0.98);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.22);
}

#back-to-top:focus-visible {
  outline: 3px solid rgba(100, 180, 255, 0.85);
  outline-offset: 3px;
}

#back-to-top svg {
  width: 22px;
  height: 22px;
  display: block;
  fill: currentColor;
}

@media (max-width: 736px) {
  #back-to-top {
    right: 0.75rem;
    bottom: 0.75rem;
    width: 48px;
    height: 48px;
  }

  #back-to-top svg {
    width: 20px;
    height: 20px;
  }
}

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