/* ════════════════════════════════════════
   UNIVERSAL NAVBAR — BARS ROBOTICS
   Подключить после основного :root с переменными
   (--blue, --navy, --gray, --border и т.д.)
   либо вставить блок :root ниже, если его ещё нет.
   ════════════════════════════════════════ */

:root {
  --blue: #1a6bf5;
  --blue-light: #4d8eff;
  --blue-dark: #0a4dc4;
  --navy: #0d1b2e;
  --navy2: #12253d;
  --white: #ffffff;
  --offwhite: #f4f7ff;
  --gray: #8a9bbf;
  --gold: #f5a623;
  --border: rgba(26, 107, 245, 0.1);
}

/* ─── TOP NAV (десктоп) ─── */
nav#navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 48px;
  height: 72px;
  background: rgba(244, 247, 255, 0.9);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  transition: box-shadow 0.3s;
}
nav#navbar.scrolled {
  box-shadow: 0 4px 24px rgba(26, 107, 245, 0.1);
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}
.nav-logo-icon {
  width: 98px;
  height: 68px;
  border-radius: 10px;
  overflow: hidden;
}
.nav-logo-text {
  font-family: "Unbounded", sans-serif;
  font-size: 14px;
  font-weight: 700;
  color: var(--navy);
  letter-spacing: 0.5px;
}

.nav-links {
  display: flex;
  gap: 36px;
  list-style: none;
}
.nav-links a {
  font-size: 14px;
  font-weight: 500;
  color: var(--navy);
  text-decoration: none;
  letter-spacing: 0.2px;
  transition: color 0.2s;
  position: relative;
}
.nav-links a.active {
  color: var(--blue);
}
.nav-links a::after {
  content: "";
  position: absolute;
  bottom: -3px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--blue);
  transform: scaleX(0);
  transition: transform 0.25s;
  border-radius: 2px;
}
.nav-links a:hover {
  color: var(--blue);
}
.nav-links a:hover::after,
.nav-links a.active::after {
  transform: scaleX(1);
}

/* ─── BURGER ─── */
.burger {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: 8px;
  border-radius: 10px;
  background: rgba(26, 107, 245, 0.08);
  border: 1px solid rgba(26, 107, 245, 0.15);
  transition: background 0.2s;
}
.burger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--navy);
  border-radius: 2px;
  transition: transform 0.3s, opacity 0.3s;
}
.burger.open span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.burger.open span:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}
.burger.open span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ─── MOBILE DROPDOWN MENU ─── */
.mobile-menu {
  display: none;
  position: fixed;
  top: 72px;
  left: 12px;
  right: 12px;
  background: rgba(255, 255, 255, 0.97);
  backdrop-filter: blur(20px);
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 20px;
  z-index: 99;
  flex-direction: column;
  gap: 4px;
  box-shadow: 0 16px 48px rgba(26, 107, 245, 0.15);
  transform: translateY(-8px);
  opacity: 0;
  transition: transform 0.3s cubic-bezier(0.34, 1.26, 0.64, 1),
    opacity 0.25s ease;
}
.mobile-menu.open {
  display: flex;
  transform: translateY(0);
  opacity: 1;
}
.mobile-menu a {
  font-size: 15px;
  font-weight: 600;
  color: var(--navy);
  text-decoration: none;
  padding: 14px 18px;
  border-radius: 14px;
  transition: background 0.2s, color 0.2s;
  display: flex;
  align-items: center;
  gap: 10px;
}
.mobile-menu a.active {
  color: var(--blue);
  background: rgba(26, 107, 245, 0.07);
}
.mobile-menu a:hover {
  background: rgba(26, 107, 245, 0.07);
  color: var(--blue);
}

/* ─── BOTTOM NAV (мобильный) ─── */
.bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px);
  border-top: 1px solid var(--border);
  padding: 8px 0 20px;
  box-shadow: 0 -8px 32px rgba(26, 107, 245, 0.1);
}
.bottom-nav-inner {
  display: flex;
  justify-content: space-around;
  align-items: center;
}
.bottom-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 8px 14px;
  text-decoration: none;
  color: var(--gray);
  font-size: 11px;
  font-weight: 600;
  border-radius: 12px;
  transition: color 0.2s;
}
.bottom-nav-item svg {
  width: 22px;
  height: 22px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.bottom-nav-item.active,
.bottom-nav-item:hover {
  color: var(--blue);
}

/* ─── RESPONSIVE SWITCH ─── */
@media (max-width: 900px) {
  nav#navbar {
    padding: 0 24px;
  }
  .nav-links {
    display: none !important;
  }
  .burger {
    display: flex;
  }
  .bottom-nav {
    display: block;
  }
  /* отступ снизу чтобы контент сайта не перекрывался bottom-nav */
  body {
    padding-bottom: 80px;
  }
}