/* Stały przycisk poza układem dokumentu — wygląd zgodny z zaakceptowaną makietą. */
.back-to-top {
  position: fixed;
  right: max(24px, env(safe-area-inset-right));
  bottom: calc(24px + env(safe-area-inset-bottom, 0px));
  z-index: 19;
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid #ffffff40;
  border-radius: 50%;
  background: #1f2d4a;
  color: #fff;
  box-shadow: 0 4px 14px #1f2d4a38;
  cursor: pointer;
  animation: back-to-top-appear .18s ease-out;
  transition: background-color .18s ease;
}
.back-to-top[hidden] { display: none; }
.back-to-top svg { width: 22px; height: 22px; }
@media (hover: hover) { .back-to-top:hover { background: #df1722; } }
.back-to-top:focus-visible { outline: 3px solid #df1722; outline-offset: 4px; }
body:has(dialog[open], .privacy-banner:not([hidden]), .site-menu-shell[open], .header-store[open]) .back-to-top {
  visibility: hidden;
  pointer-events: none;
}
@keyframes back-to-top-appear {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}
@media (max-width: 540px) {
  .back-to-top {
    right: max(20px, env(safe-area-inset-right));
    bottom: calc(20px + env(safe-area-inset-bottom, 0px));
    width: 46px;
    height: 46px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .back-to-top { animation: none; transition: none; }
}