/* ============================================================
   Truva — site navigation
   Single source of truth for the top bar on EVERY page.
   Loaded last on all pages so it always wins over page-local CSS.
   The bar is fixed (sticky at the top through the whole scroll).
   ============================================================ */

header.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 200;
  border-bottom: 1px solid transparent;
  transition: background .5s cubic-bezier(0.16,1,0.3,1),
              border-color .5s cubic-bezier(0.16,1,0.3,1), backdrop-filter .5s;
}
header.nav.scrolled {
  background: rgba(255,255,255,0.60);
  backdrop-filter: saturate(200%) blur(24px);
  -webkit-backdrop-filter: saturate(200%) blur(24px);
  border-bottom: 1px solid rgba(0,0,0,.055);
}
/* glass hairline along the top edge of the frosted bar */
header.nav::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 1px;
  background: linear-gradient(90deg, transparent 5%, rgba(255,255,255,.9) 50%, transparent 95%);
  opacity: 0; transition: opacity .5s cubic-bezier(0.16,1,0.3,1); pointer-events: none;
}
header.nav.scrolled::before { opacity: 1; }

/* Fixed geometry — NOT tied to each page's --maxw, which differs
   (1200px on index/hakkimizda, 1120px in product.css) and used to
   shift the logo horizontally from page to page. */
header.nav .nav-inner {
  max-width: 1200px; width: 100%; margin: 0 auto; padding: 0 32px;
  height: 70px; display: flex; align-items: center; justify-content: space-between;
}

header.nav .brand { display: flex; align-items: center; gap: 11px; }
header.nav .brand img { height: 20px; width: auto; object-fit: contain; }
header.nav .brand span { font-weight: 700; font-size: 18px; letter-spacing: 0.01em; }

header.nav .nav-links nav { display: flex; gap: 30px; }
header.nav .nav-links a.link {
  font-size: 14px; font-weight: 500; color: var(--ink-2); transition: color .25s;
}
header.nav .nav-links a.link:hover { color: var(--ink); }

header.nav .nav-right { display: flex; align-items: center; gap: 16px; }

/* nav CTA — kept identical so the centred links land on the same x on every page */
header.nav .cta-btn {
  position: relative; overflow: hidden;
  background: var(--ink); color: #fff; font-weight: 600; font-size: 14px;
  padding: 9px 19px; border-radius: 999px;
  transition: transform .2s cubic-bezier(0.16,1,0.3,1), background .25s, box-shadow .25s;
}

header.nav .menu-btn {
  display: none; width: 40px; height: 40px; flex-shrink: 0;
  border: 1px solid var(--line-2); border-radius: 12px;
  background: rgba(255,255,255,.75); cursor: pointer; position: relative;
}
header.nav .menu-btn span {
  position: absolute; left: 11px; right: 11px; height: 2px; border-radius: 2px;
  background: var(--ink);
  transition: transform .3s cubic-bezier(0.16,1,0.3,1), opacity .25s, top .3s cubic-bezier(0.16,1,0.3,1);
}
header.nav .menu-btn span:nth-child(1) { top: 14px; }
header.nav .menu-btn span:nth-child(2) { top: 19px; }
header.nav .menu-btn span:nth-child(3) { top: 24px; }
header.nav.menu-open .menu-btn span:nth-child(1) { top: 19px; transform: rotate(45deg); }
header.nav.menu-open .menu-btn span:nth-child(2) { opacity: 0; }
header.nav.menu-open .menu-btn span:nth-child(3) { top: 19px; transform: rotate(-45deg); }

@media (max-width: 920px) {
  header.nav .menu-btn { display: block; }
  header.nav .nav-links {
    position: fixed; top: 70px; left: 0; right: 0; display: none;
    background: rgba(255,255,255,.97);
    backdrop-filter: blur(20px) saturate(180%); -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-bottom: 1px solid var(--line);
    box-shadow: 0 24px 40px -24px rgba(0,0,0,.15);
  }
  header.nav.menu-open .nav-links { display: block; animation: navMenuIn .35s cubic-bezier(0.16,1,0.3,1); }
  header.nav.menu-open { background: rgba(255,255,255,.97); border-bottom: 1px solid var(--line); }
  header.nav .nav-links nav { display: flex !important; flex-direction: column; gap: 0; padding: 8px 28px 14px; }
  header.nav .nav-links a.link { padding: 15px 2px; font-size: 16px; font-weight: 600; border-bottom: 1px solid var(--line); }
  header.nav .nav-links nav a.link:last-child { border-bottom: none; }
}
@keyframes navMenuIn { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
  header.nav, header.nav::before, header.nav .menu-btn span { transition: none; }
  header.nav.menu-open .nav-links { animation: none; }
}
