/* DAAB — floating back-to-top control */

.daab-back-to-top {
  position: fixed;
  z-index: var(--z-back-to-top, 10050);
  right: max(14px, var(--daab-safe-right));
  bottom: max(14px, var(--daab-safe-bottom));
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: max(var(--daab-touch-min), 48px);
  height: max(var(--daab-touch-min), 48px);
  margin: 0;
  padding: 0;
  border: 1px solid rgba(0, 105, 180, 0.22);
  border-radius: 999px;
  color: #fff;
  background: linear-gradient(145deg, var(--blue-700), var(--blue-600));
  box-shadow: 0 10px 28px rgba(0, 45, 82, 0.28);
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translate3d(0, 14px, 0);
  transition:
    opacity 0.22s ease,
    transform 0.22s ease,
    visibility 0.22s ease,
    box-shadow 0.18s ease,
    border-color 0.18s ease;
  pointer-events: none;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

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

.daab-back-to-top__icon {
  display: block;
  width: 22px;
  height: 22px;
}

.daab-back-to-top:focus-visible {
  outline: 3px solid rgba(255, 240, 191, 0.95);
  outline-offset: 3px;
}

@media (hover: hover) and (pointer: fine) {
  .daab-back-to-top.is-visible:hover {
    border-color: rgba(201, 155, 59, 0.55);
    box-shadow: var(--shadow-strong);
    transform: translate3d(0, -2px, 0);
  }
}

html.daab-scroll-lock .daab-back-to-top,
body.daab-scroll-lock .daab-back-to-top {
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

@media (max-width: 1180px) {
  .daab-back-to-top {
    right: max(14px, calc(10px + var(--daab-safe-right, 0px)));
    bottom: max(
      18px,
      calc(14px + env(safe-area-inset-bottom, 0px))
    );
    width: 48px;
    height: 48px;
    box-shadow: 0 12px 32px rgba(0, 45, 82, 0.34);
  }
}

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

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

@media print {
  .daab-back-to-top {
    display: none !important;
  }
}
