/* Menu główne z podziałem na obszary — serwisy integrator-ksef-* (markup: includes/menu-obszary.php).
   Wygląd podmenu jak w głównym nagłówku intuiti.pl (ciemne szkło, strzałka łącząca z zakładką),
   ale własne klasy (.nm-*) — baza.css nie zna rozwijanych podmenu.
   Desktop: podmenu otwiera się po najechaniu i po fokusie z klawiatury, a klik/dotyk przełącza je
   (skrypt zaraz za menu). Telefon: grupy to przyciski, a lista otwiera się pod nimi w pełnej szerokości. */
.site-nav--obszary { gap: 4px; }
.nm-item { position: relative; display: flex; align-items: center; }
.nm-link, .nm-btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 8px 13px; font: inherit; font-size: 13.5px; line-height: 1.2;
  color: var(--ink-text); background: transparent; border: 0; border-radius: 8px;
  text-decoration: none; white-space: nowrap; cursor: pointer;
  transition: background .15s, color .15s;
}
.nm-link:hover, .nm-btn:hover,
.nm-has-sub:hover > .nm-btn, .nm-has-sub.is-open > .nm-btn { background: var(--ink-line); text-decoration: none; }
.nm-btn:focus-visible, .nm-link:focus-visible, .nm-sub a:focus-visible { outline: 2px solid var(--cyan, #6fd3ff); outline-offset: 2px; }
.nm-caret { transition: transform .18s ease; }
.nm-has-sub:hover .nm-caret, .nm-has-sub.is-open .nm-caret { transform: rotate(180deg); }
.nm-has-sub.is-active > .nm-btn, .nm-link.is-current { color: var(--cyan, #6fd3ff); }

.nm-sub {
  position: absolute; top: calc(100% + 10px); left: 0; z-index: 60;
  min-width: 270px; padding: 8px;
  background: linear-gradient(180deg, rgba(17,32,58,.94) 0%, rgba(10,22,40,.97) 100%);
  backdrop-filter: blur(14px) saturate(140%); -webkit-backdrop-filter: blur(14px) saturate(140%);
  border: 1px solid var(--ink-line-2); border-top: 2px solid var(--cyan, #6fd3ff); border-radius: 12px;
  box-shadow: 0 1px 0 rgba(255,255,255,.06) inset, 0 2px 8px rgba(0,0,0,.28), 0 28px 60px -14px rgba(0,0,0,.55);
  opacity: 0; visibility: hidden; transform: translateY(-8px) scale(.985); transform-origin: top left;
  transition: opacity .18s ease, transform .18s cubic-bezier(.16,.8,.24,1), visibility .18s;
}
.nm-sub::before {
  content: ""; position: absolute; top: -8px; left: 26px; width: 12px; height: 12px;
  background: var(--cyan, #6fd3ff); clip-path: polygon(50% 0, 100% 100%, 0 100%);
}
/* przedostatnia i ostatnia grupa otwierają się w lewo, żeby panel nie wychodził poza ekran */
.nm-has-sub:nth-last-child(-n+3) > .nm-sub { left: auto; right: 0; transform-origin: top right; }
.nm-has-sub:nth-last-child(-n+3) > .nm-sub::before { left: auto; right: 26px; }
.nm-has-sub:hover > .nm-sub, .nm-has-sub:focus-within > .nm-sub, .nm-has-sub.is-open > .nm-sub {
  opacity: 1; visibility: visible; transform: none;
}
/* most nad szczeliną: bez niego panel znika, gdy kursor przechodzi przez odstęp */
.nm-has-sub::after { content: ""; position: absolute; top: 100%; left: 0; right: 0; height: 12px; }

.site-nav--obszary .nm-sub a {
  position: relative; display: block; padding: 8px 14px 8px 16px; border-radius: 8px;
  font-size: 13.5px; color: var(--ink-text); text-decoration: none; white-space: nowrap;
}
.site-nav--obszary .nm-sub a::before {
  content: ""; position: absolute; left: 0; top: 7px; bottom: 7px; width: 3px; border-radius: 3px;
  background: var(--cyan, #6fd3ff); opacity: 0; transition: opacity .15s;
}
.site-nav--obszary .nm-sub a:hover { background: var(--ink-line); }
.site-nav--obszary .nm-sub a:hover::before, .site-nav--obszary .nm-sub a.is-current::before { opacity: 1; }
.site-nav--obszary .nm-sub a.is-current { color: var(--cyan, #6fd3ff); }

/* Telefon: baza.css chowa na nim wszystkie linki bez .nav-mob. Tu nic nie chowamy —
   grupy są przyciskami, więc menu zostaje krótkie (4 grupy + Kontakt), a lista rozwija się pod nimi. */
@media (max-width: 700px) {
  .site-nav.site-nav--obszary { flex-wrap: wrap; justify-content: center; gap: 2px 4px; }
  .site-nav.site-nav--obszary .nm-link, .site-nav.site-nav--obszary .nm-btn { padding: 8px 10px; font-size: 13px; }
  .nm-item.nm-has-sub { position: static; }
  .nm-has-sub::after, .nm-sub::before { display: none; }
  .nm-sub {
    position: absolute; left: 12px; right: 12px; top: 100%; min-width: 0; margin-top: 6px;
    transform: translateY(-6px);
  }
  .nm-has-sub:nth-last-child(-n+3) > .nm-sub { left: 12px; right: 12px; }
  /* na dotyku hover nie istnieje — panel otwiera tylko klik */
  .nm-has-sub:hover > .nm-sub:not(.x), .nm-has-sub:focus-within > .nm-sub:not(.x) { opacity: 0; visibility: hidden; }
  .nm-has-sub.is-open > .nm-sub { opacity: 1; visibility: visible; transform: none; }
  .site-nav.site-nav--obszary .nm-sub a { display: block !important; font-size: 14px; padding: 10px 14px 10px 16px; }
}
