/* Zarabiacze.online — fixed mobile bottom navigation */
:root {
  --zb-nav-purple: #7657f6;
  --zb-nav-blue: #5c7cf7;
  --zb-nav-ink: #4c4868;
  --zb-nav-muted: #68708a;
  --zb-nav-border: rgba(118, 87, 246, .12);
}
.zb-bottom-nav {
  display: none;
}
@media (max-width: 767px) {
  body {
    padding-bottom: calc(82px + env(safe-area-inset-bottom, 0px)) !important;
  }
  .zb-bottom-nav {
    position: fixed;
    inset-inline: 0;
    /* Safari iOS: JS updates this when its browser toolbar changes the visual viewport. */
    bottom: 0;
    z-index: 100000;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    align-items: stretch;
    width: 100%;
    min-height: 68px;
    padding: 7px 5px calc(7px + env(safe-area-inset-bottom, 0px));
    box-sizing: border-box;
    background: rgba(255, 255, 255, .97);
    border-top: 1px solid var(--zb-nav-border);
    box-shadow: 0 -7px 28px rgba(54, 39, 119, .10);
    /* Opaque background avoids Safari backdrop-filter repaint flicker while scrolling. */
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    isolation: isolate;
  }
  .zb-bottom-nav__item {
    min-width: 0;
    min-height: 52px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 3px 1px;
    border: 0;
    border-radius: 12px;
    color: var(--zb-nav-muted);
    background: transparent;
    text-decoration: none;
    font-family: inherit;
    font-size: clamp(9px, 2.65vw, 11px);
    font-weight: 650;
    line-height: 1.1;
    letter-spacing: -.15px;
    text-align: center;
    white-space: nowrap;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
  }
  .zb-bottom-nav__item svg {
    display: block;
    width: 21px;
    height: 21px;
    flex: 0 0 21px;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.9;
    stroke-linecap: round;
    stroke-linejoin: round;
  }
  .zb-bottom-nav__item[aria-current="page"],
  .zb-bottom-nav__item.is-active {
    color: var(--zb-nav-purple);
  }
  .zb-bottom-nav__item[aria-current="page"] svg,
  .zb-bottom-nav__item.is-active svg {
    filter: drop-shadow(0 3px 6px rgba(118, 87, 246, .18));
  }
  .zb-bottom-nav__item:active {
    background: #f3f0ff;
  }
  .zb-bottom-nav__item--chat svg {
    color: var(--zb-nav-purple);
  }
  #zarabiacze-chat-window {
    bottom: calc(76px + env(safe-area-inset-bottom, 0px)) !important;
    max-height: calc(100dvh - 100px - env(safe-area-inset-bottom, 0px)) !important;
  }
}
@media (max-width: 360px) {
  .zb-bottom-nav { padding-inline: 2px; }
  .zb-bottom-nav__item { font-size: 9px; letter-spacing: -.25px; }
  .zb-bottom-nav__item svg { width: 19px; height: 19px; flex-basis: 19px; }
}
@media (min-width: 768px) {
  body { padding-bottom: 0 !important; }
}
@media (prefers-reduced-motion: no-preference) {
  .zb-bottom-nav__item { transition: color .18s ease, background-color .18s ease; }
}

/* Hide the legacy chat launcher on phones; the bottom-nav chat remains available. */
@media (max-width: 767px) {
  #zarabiacze-chat-button {
    display: none !important;
    visibility: hidden !important;
    pointer-events: none !important;
  }
}


/* iOS Safari + Android: keep the mobile navigation above browser controls. */
@media (max-width: 767px) {
  .zb-bottom-nav {
    bottom: 0 !important;
    padding-bottom: calc(7px + env(safe-area-inset-bottom, 0px));
    /* Avoid forcing a separate compositing layer on iOS Safari. */
  }
  body {
    padding-bottom: calc(82px + env(safe-area-inset-bottom, 0px)) !important;
  }
}


/* Mobile only: show bottom navigation after the visitor makes a cookie choice. */
@media (max-width: 767px) {
  body.cookie-consent-open .zb-bottom-nav {
    display: none !important;
    visibility: hidden !important;
    pointer-events: none !important;
  }
}


/* Mobile: keep the back-to-top arrow comfortably above the fixed bottom navigation. */
@media (max-width: 767px) {
  #scrollTop,
  .scroll-top {
    bottom: calc(100px + env(safe-area-inset-bottom, 0px)) !important;
    right: 16px !important;
    z-index: 9990 !important;
  }
}


/* Blokuje białe odbijanie na końcu strony, ale pozostawia natywne przewijanie palcem i kółkiem myszy. */
html, body { overscroll-behavior-y: auto !important; touch-action: auto !important; }


/* Desktop safeguard: keep native mouse-wheel, keyboard and scrollbar scrolling. */
@media (min-width: 768px) {
  html,
  body {
    overflow-x: hidden;
    overflow-y: auto !important;
    height: auto !important;
    min-height: 100%;
    overscroll-behavior-y: auto !important;
    touch-action: auto !important;
  }
}
