/* ═══════════════════════════════════════════════════════════════
   Menu: na granatowym headerze przezroczyste, po przewinięciu białe.
   Bieżącą pozycję oznacza linia wymiarowa, taka jak „24 h” w Kontakcie.
   Plik ładuje tylko index.html, a identyfikator przebija reguły
   z style.css, z których korzysta też index-split.html.
   ═══════════════════════════════════════════════════════════════ */
#mainNav {
  --ink: #032d90;
  --pen: #ffc83d;
  justify-content: flex-start;
  background: transparent;
  border-bottom: 1px solid transparent;
  box-shadow: none;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  transition: background .25s, border-color .25s;
}
#mainNav.scrolled {
  background: rgba(255,255,255,.95);
  border-bottom-color: var(--border);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
}

/* The logo file is dark, so on the blue header it is turned white */
#mainNav .nav-logo-img { opacity: 1; filter: brightness(0) invert(1); transition: filter .25s; }
#mainNav.scrolled .nav-logo-img { filter: none; }

#mainNav .nav-links {
  order: 1;
  position: relative;
  align-self: stretch;
  gap: 0;
  margin: 0 0 0 auto;
  padding: 0;
  color: #fff;
  transition: color .25s;
}
#mainNav.scrolled .nav-links { color: var(--ink); }
#mainNav .nav-links li { position: relative; display: flex; }
#mainNav .nav-links a {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  padding: 0 13px;
  overflow: visible;
  font-size: 15px;
  font-weight: 500;
  color: inherit;
  white-space: nowrap;
}
#mainNav .nav-links a::after { content: none; }
#mainNav .nav-links a:focus-visible { outline: 2px solid currentColor; outline-offset: -8px; }
#mainNav .nav-links .nav-phone { display: none; }

/* Linia wymiarowa: rozciąga się do szerokości napisu i przechodzi między pozycjami */
#mainNav .nav-links::before {
  content: "";
  position: absolute;
  left: 0;
  bottom: 6px;
  width: var(--w, 0);
  height: 9px;
  border-left: 2px solid currentColor;
  border-right: 2px solid currentColor;
  background: linear-gradient(currentColor, currentColor) center / 100% 2px no-repeat;
  opacity: 0;
  transform: translateX(var(--x, 0));
  transition: transform .34s cubic-bezier(.3,1.2,.5,1), width .34s cubic-bezier(.3,1.2,.5,1), opacity .2s;
  pointer-events: none;
}
#mainNav .nav-links.has-slider::before { opacity: 1; }

/* Na granacie przycisk ma kolor z wyszukiwarki, a na bieli przechodzi w granat */
#mainNav .nav-cta {
  order: 2;
  align-self: center;
  margin: 0 0 0 14px;
  padding: 8px 16px;
  border-radius: 0;
  background: var(--pen);
  color: var(--ink);
  font-size: 15px;
  font-weight: 700;
  transition: background .2s, color .2s;
}
#mainNav .nav-cta:hover { background: #ffd968; }
#mainNav.scrolled .nav-cta { background: var(--ink); color: #fff; }
#mainNav.scrolled .nav-cta:hover { background: #0044d4; }
#mainNav .nav-cta:focus-visible { outline: 2px solid currentColor; outline-offset: -5px; }

#mainNav .hamburger { order: 3; position: static; display: none; flex: none; align-self: stretch; width: 48px; height: auto; margin-right: -12px; color: #fff; transition: color .25s; }
#mainNav.scrolled .hamburger { color: var(--ink); }
#mainNav .hamburger:focus-visible { outline: 2px solid currentColor; outline-offset: -6px; border-radius: 0; }

/* Telefon i tablet: rozwinięcie z rogu na cały ekran */
@media (max-width: 900px) {
  #mainNav { padding: 0 16px; }
  #mainNav .nav-cta { margin-left: auto; padding: 7px 12px; font-size: 14px; }
  #mainNav .hamburger { display: flex; }
  #mainNav .nav-links { display: none; }
  #mainNav .nav-links::before { content: none; }
  #mainNav .nav-links.active {
    display: flex;
    flex-direction: column;
    margin: 0;
    position: absolute;
    top: 100%; left: 0; right: 0;
    height: calc(100vh - 52px);
    height: calc(100dvh - 52px);
    padding: 20px 20px 28px;
    overflow-y: auto;
    border: 0;
    box-shadow: none;
    background-color: var(--ink);
    background-image:
      linear-gradient(rgba(255,255,255,.1) 1px, transparent 1px),
      linear-gradient(90deg, rgba(255,255,255,.1) 1px, transparent 1px);
    background-size: 40px 40px;
    color: #fff;
    animation: menu-open .45s cubic-bezier(.3,.8,.3,1) both;
  }
  #mainNav .nav-links.active li { flex: none; border-bottom: 1px solid rgba(255,255,255,.28); animation: menu-row .35s var(--ease) both; }
  #mainNav .nav-links.active li:nth-child(2) { animation-delay: .04s; }
  #mainNav .nav-links.active li:nth-child(3) { animation-delay: .08s; }
  #mainNav .nav-links.active li:nth-child(4) { animation-delay: .12s; }
  #mainNav .nav-links.active li:nth-child(5) { animation-delay: .16s; }
  #mainNav .nav-links.active li:nth-child(6) { animation-delay: .2s; }
  #mainNav .nav-links.active li:nth-child(7) { animation-delay: .24s; }
  #mainNav .nav-links.active a {
    display: block;
    width: 100%;
    padding: 12px 0;
    font-size: clamp(30px, 9.5vw, 56px);
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: -0.03em;
    text-align: left;
    background: none;
  }
  #mainNav .nav-links.active a[aria-current] { color: var(--pen); }
  #mainNav .nav-links.active .nav-phone { display: block; margin-top: auto; border-bottom: 0; }
  #mainNav .nav-links.active .nav-phone a { padding-top: 24px; font-size: clamp(26px, 8vw, 44px); font-weight: 600; }
  body.menu-open { overflow: hidden; }
  body.menu-open .kc-launch, body.menu-open .kc-panel, body.menu-open #cookie-popup { visibility: hidden; }
}
@keyframes menu-open {
  from { clip-path: circle(0 at 100% 0); }
  to { clip-path: circle(150% at 100% 0); }
}
@keyframes menu-row {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}
