/* Bouton back to top, coin bas droite (discret) */
.ais-site-floats {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 9998;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.ais-back-to-top {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.35rem;
  height: 2.35rem;
  padding: 0;
  border: 1px solid rgba(22, 58, 114, 0.14);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(8px);
  color: rgba(22, 58, 114, 0.55);
  box-shadow: 0 2px 10px rgba(15, 39, 68, 0.08);
  cursor: pointer;
  opacity: 0;
  transform: translateY(6px);
  pointer-events: none;
  transition:
    opacity 0.22s ease,
    transform 0.22s ease,
    background 0.2s ease,
    border-color 0.2s ease,
    color 0.2s ease,
    box-shadow 0.2s ease;
}

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

.ais-back-to-top:hover,
.ais-back-to-top:focus-visible {
  opacity: 1;
  background: rgba(255, 255, 255, 0.96);
  border-color: rgba(37, 99, 235, 0.28);
  color: #2563eb;
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(15, 39, 68, 0.12);
  outline: none;
}

.ais-back-to-top i {
  font-size: 0.82rem;
  line-height: 1;
}

html[data-style="dark"] .ais-back-to-top,
html[data-theme="dark"] .ais-back-to-top {
  background: rgba(15, 39, 68, 0.72);
  border-color: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.55);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

html[data-style="dark"] .ais-back-to-top:hover,
html[data-theme="dark"] .ais-back-to-top:hover,
html[data-style="dark"] .ais-back-to-top:focus-visible,
html[data-theme="dark"] .ais-back-to-top:focus-visible {
  background: rgba(22, 58, 114, 0.92);
  border-color: rgba(96, 165, 250, 0.35);
  color: #93c5fd;
}

@media (max-width: 768px) {
  .ais-site-floats {
    right: 0.75rem;
    bottom: 0.75rem;
  }

  .ais-back-to-top {
    width: 2.15rem;
    height: 2.15rem;
  }

  .ais-back-to-top i {
    font-size: 0.78rem;
  }
}

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