/* Public main menu (#nav in the layout): a light floating pill bar with a solid
   purple-to-pink active tab. Loaded after all/pages.css and overrides its old
   dark bar. Fits 7 tabs (with "Promocje") beside the logo on desktop (see below); below
   1104px it sits under the logo; on phones the hamburger opens it as a card. */

#nav {
  display: flex;
  align-items: center;
  gap: 2px;
  float: right;
  height: auto;
  margin: 6px 0 0;
  padding: 5px;
  border: 1px solid #e3ddee;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 6px 20px rgba(78, 47, 138, 0.1), 0 1px 2px rgba(78, 47, 138, 0.06);
}
#nav::after { content: none; }

#nav > li {
  float: none;
  margin: 0;
  padding: 0;
  background: none;
  font: 14px/1 'museo500', Arial, Helvetica, sans-serif;
}

#nav > li > a,
#nav > li:first-child > a {
  position: relative;
  display: flex;
  align-items: center;
  gap: 7px;
  height: auto;
  margin: 0;
  padding: 11px 14px;
  border-radius: 999px;
  background: none;
  color: #4e2f8a;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

#nav > li:hover > a,
#nav > li > a:focus-visible {
  height: auto;
  margin: 0;
  padding: 11px 14px;
  border-radius: 999px;
  background: #f3eefb;
  color: #3b1f72;
  outline: none;
}

#nav > li.active > a,
#nav > li.active:hover > a {
  height: auto;
  margin: 0;
  padding: 11px 14px;
  border-radius: 999px;
  background: linear-gradient(135deg, #7b52c9 0%, #9a3fb8 55%, #e2366f 100%);
  color: #fff;
  box-shadow: 0 4px 12px rgba(150, 50, 160, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

/* "Pogotowie stomatologiczne": a small red pulse dot so the emergency tab stands out. */
#nav > li > a[href="/pogotowie-stomatologiczne"]::before {
  content: "";
  flex: none;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #ef2c42;
  box-shadow: 0 0 0 0 rgba(239, 44, 66, 0.5);
  animation: nav-pulse 2.4s ease-out infinite;
}
#nav > li.active > a[href="/pogotowie-stomatologiczne"]::before { background: #fff; animation: none; }

@keyframes nav-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(239, 44, 66, 0.5); }
  70%  { box-shadow: 0 0 0 7px rgba(239, 44, 66, 0); }
  100% { box-shadow: 0 0 0 0 rgba(239, 44, 66, 0); }
}

@media (prefers-reduced-motion: reduce) {
  #nav > li > a { transition: none; }
  #nav > li > a[href="/pogotowie-stomatologiczne"]::before { animation: none; }
}

/* With 7 tabs ("Promocje" shown) the header (max 998px) gets tight next to the
   logo: slightly smaller text and padding, desktop only. */
@media only screen and (min-width: 1104px) {
  #nav:has(> li:nth-child(7)) > li { font-size: 13px; }
  #nav:has(> li:nth-child(7)) { gap: 0; padding: 4px; }
  #nav:has(> li:nth-child(7)) > li > a { padding: 10px 10px; }
}

/* 768-1103px: the bar sits under the logo (pages.css floats it left); let it wrap
   if a tablet is too narrow for all tabs. */
@media only screen and (min-width: 768px) and (max-width: 1103px) {
  #nav { flex-wrap: wrap; margin-top: 4px; border-radius: 24px; }
}

/* Phones: hamburger + the menu as a floating card. */
@media only screen and (max-width: 767px) {
  .opener {
    width: 42px;
    height: 42px;
    border: 1px solid #e3ddee;
    border-radius: 12px;
    background:
      url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%234e2f8a' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M4 7h16M4 12h16M4 17h16'/%3E%3C/svg%3E") center / 22px no-repeat,
      #fff;
    box-shadow: 0 4px 14px rgba(78, 47, 138, 0.12);
    box-sizing: border-box;
  }
  .slide { top: 70px; width: 270px; }
  .slide #nav {
    display: grid;
    gap: 2px;
    float: none;
    margin: 0;
    padding: 8px;
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 16px 40px rgba(40, 10, 80, 0.2);
  }
  #nav > li { display: block; font-size: 16px; text-align: left; }
  #nav > li > a,
  #nav > li:first-child > a,
  #nav > li:hover > a,
  #nav > li.active > a { padding: 12px 14px; border-radius: 10px; }
}
