/* ── Navbar shell ─────────────────────────────────────────────────────────── */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-h);
  background: var(--navbar-bg);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-bottom: 1px solid var(--border);
  z-index: 200;
  transition: background-color 0.25s ease, border-color 0.25s ease;
}

.navbar__inner {
  width: 100%;
  max-width: 500px;
  margin: 0 auto;
  padding: 0 14px;
  height: 100%;
  display: grid;
  grid-template-columns: 70px 1fr 40px;
  align-items: center;
  gap: 8px;
}

/* ── Logo ─────────────────────────────────────────────────────────────────── */
.navbar__logo {
  display: block;
  line-height: 0;
  width: 70px;
  height: 40px;
  overflow: hidden;
}

.navbar__logo-img {
  height: 40px;
  width: auto;
  max-width: 70px;
  display: block;
  object-fit: contain;
  object-position: left center;
}

/* ── Navbar title (mobile only) ──────────────────────────────────────────── */
.navbar__title {
  text-align: center;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: var(--text);
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── Hamburger ────────────────────────────────────────────────────────────── */
.navbar__hamburger {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 9px;
  border-radius: 10px;
  transition: background 0.2s;
  flex-shrink: 0;
}

.navbar__hamburger:active {
  background: var(--bg-elevated);
}

.navbar__hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform 0.3s ease, opacity 0.25s ease;
  transform-origin: center;
}

.navbar__hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.navbar__hamburger.open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.navbar__hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ── Theme toggle button ─────────────────────────────────────────────────── */
.navbar__theme-btn {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--bg-elevated);
  border: 1.5px solid var(--border-light);
  color: var(--text-muted);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; flex-shrink: 0;
  transition: border-color 0.2s, background 0.2s, color 0.2s;
  -webkit-tap-highlight-color: transparent;
}
.navbar__theme-btn:hover {
  border-color: var(--accent);
  color: var(--accent-bright);
}

/* ── Mobile dropdown ─────────────────────────────────────────────────────── */
.navbar__links {
  display: none;
  list-style: none;
  position: fixed;
  top: var(--nav-h);
  left: 0;
  right: 0;
  background: var(--navbar-menu-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  padding: 10px 12px 16px;
  flex-direction: column;
  gap: 2px;
  z-index: 199;
  transition: background-color 0.25s ease;
}

.navbar__links.open {
  display: flex;
}

.navbar__links a {
  display: block;
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-muted);
  transition: background 0.15s, color 0.15s;
  letter-spacing: -0.01em;
}

.navbar__links a:hover { background: var(--bg-elevated); color: var(--text); }
.navbar__links a.active { background: var(--bg-elevated); color: var(--accent-bright); }

/* ── Desktop ≥ 768 px ─────────────────────────────────────────────────────── */
@media (min-width: 768px) {
  .navbar__inner {
    max-width: 1100px;
    display: flex;
    justify-content: flex-start;   /* logo trzyma się lewej */
    align-items: center;
    gap: 0;
    padding: 0 24px;
    position: relative;            /* kotwica dla absolute centering linków */
  }

  .navbar__logo {
    width: 150px;
    height: 44px;
    flex-shrink: 0;
  }

  .navbar__logo-img {
    height: 44px;
    max-width: 150px;
  }

  .navbar__title {
    display: none;
  }

  .navbar__hamburger {
    display: none;
  }

  /* Linki — wypełniają całą wysokość paska, flex center w obu osiach */
  .navbar__links {
    display: flex !important;
    position: absolute;
    left: 0; right: 0; top: 0; bottom: 0;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    gap: 4px;
    padding: 0;
    background: none;
    border: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    pointer-events: none;   /* kliknięcia przechodzą do logo/przycisków */
    z-index: 1;
  }

  /* Poszczególne linki znów klikalne */
  .navbar__links > li {
    pointer-events: all;
  }

  .navbar__links a {
    padding: 7px 14px;
    font-size: 0.9rem;
  }

  /* Motyw + auth idą na prawo */
  .navbar__theme-btn {
    margin-left: auto;
    flex-shrink: 0;
    position: relative; z-index: 2; /* nad nakładką linków */
  }
}
