/* Fixed "back to top" — keep below modal overlays (site modals use higher z-index).
   bottom: sabit .hh-footer şeridinin üstünde dursun (footer dosyasına dokunulmadan). */
.app-back-to-top {
  --app-btt-bg: #ffffff;
  --app-btt-fg: #0f172a;
  --app-btt-shadow: 0 2px 12px rgba(15, 23, 42, 0.12);
  --app-btt-shadow-hover: 0 4px 16px rgba(15, 23, 42, 0.16);
  /* Yaklaşık footer yüksekliği + buton ile şerit arasında küçük pay */
  --app-btt-footer-clearance: 76px;

  position: fixed;
  right: max(16px, env(safe-area-inset-right));
  bottom: calc(max(16px, env(safe-area-inset-bottom)) + var(--app-btt-footer-clearance));
  z-index: 1035;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  margin: 0;
  padding: 0;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 50%;
  background: var(--app-btt-bg);
  color: var(--app-btt-fg);
  box-shadow: var(--app-btt-shadow);
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition:
    opacity 0.22s ease,
    visibility 0.22s ease,
    box-shadow 0.2s ease,
    background 0.2s ease,
    border-color 0.2s ease,
    color 0.2s ease;
}

.app-back-to-top:hover {
  box-shadow: var(--app-btt-shadow-hover);
}

.app-back-to-top:focus-visible {
  outline: 2px solid #2563eb;
  outline-offset: 2px;
}

.app-back-to-top.is-visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.app-back-to-top svg {
  display: block;
  width: 22px;
  height: 22px;
}

html[data-theme="dark"] .app-back-to-top,
[data-theme="dark"] .app-back-to-top {
  --app-btt-bg: #1e293b;
  --app-btt-fg: #f1f5f9;
  --app-btt-shadow: 0 2px 14px rgba(0, 0, 0, 0.35);
  --app-btt-shadow-hover: 0 4px 20px rgba(0, 0, 0, 0.45);
  border-color: rgba(241, 245, 249, 0.12);
}
