.navbar {
  position: fixed;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: var(--z-nav);
  width: calc(100% - 40px);
  max-width: 1200px;
  height: var(--nav-height);
  border-radius: 28px;
  overflow: visible;
  transition: all 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

.navbar.scrolled {
  top: 12px;
  box-shadow:
    0 8px 32px rgba(26, 32, 16, 0.12),
    0 2px 8px rgba(26, 32, 16, 0.06);
}

.navbar-glass {
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.55);
  backdrop-filter: blur(30px) saturate(1.8);
  -webkit-backdrop-filter: blur(30px) saturate(1.8);
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: 28px;
  box-shadow:
    0 8px 32px rgba(26, 32, 16, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.8);
  transition: all 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

.navbar-glass::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 50%;
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.4) 0%,
    transparent 100%
  );
  border-radius: 28px 28px 0 0;
  pointer-events: none;
}

.navbar-glass::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 20%;
  right: 20%;
  height: 2px;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(143, 169, 74, 0.6) 50%,
    transparent 100%
  );
  border-radius: 2px;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.navbar:hover .navbar-glass::after {
  opacity: 1;
}

.navbar.scrolled .navbar-glass {
  background: rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(40px) saturate(1.8);
  -webkit-backdrop-filter: blur(40px) saturate(1.8);
}

.nav-inner {
  position: relative;
  height: 100%;
  padding: 0 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  text-decoration: none;
  color: var(--color-text-primary);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.nav-brand:hover {
  transform: scale(1.03);
}

.nav-logo {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.nav-logo-img {
  max-width: 100%;
  max-height: 100%;
  display: block;
}

.nav-brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.nav-brand-name {
  font-weight: 700;
  font-size: 16px;
  color: var(--color-text-primary);
  letter-spacing: -0.01em;
}

.nav-brand-sub {
  font-size: 11px;
  color: var(--color-text-tertiary);
  letter-spacing: 0.08em;
  text-transform: none;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-link-item {
  position: relative;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 22px;
  border-radius: 14px;
  font-size: 14px;
  font-weight: 500;
  color: var(--color-text-secondary);
  text-decoration: none;
  transition: all 0.25s cubic-bezier(0.22, 1, 0.36, 1);
  cursor: pointer;
  background: transparent;
  border: none;
  white-space: nowrap;
  letter-spacing: 0.01em;
}

.nav-link:hover {
  color: var(--color-primary);
  background: rgba(74, 89, 38, 0.06);
}

.nav-link.active {
  color: white;
  background: linear-gradient(135deg, #4a5926 0%, #6b7d35 100%);
  box-shadow: 0 4px 12px rgba(74, 89, 38, 0.25);
}

.nav-link-icon {
  width: 14px;
  height: 14px;
  transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

.nav-link-item.has-dropdown.open > .nav-link .nav-link-icon {
  transform: rotate(180deg);
}

.nav-dropdown {
  position: absolute;
  top: calc(100% + 12px);
  left: 50%;
  transform: translateX(-50%) translateY(-8px);
  min-width: 220px;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(40px) saturate(1.8);
  -webkit-backdrop-filter: blur(40px) saturate(1.8);
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 20px;
  box-shadow:
    0 12px 48px rgba(26, 32, 16, 0.15),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
  padding: 10px;
  opacity: 0;
  visibility: hidden;
  transition: all 0.35s cubic-bezier(0.22, 1, 0.36, 1);
  transform-origin: top center;
}

.nav-link-item.has-dropdown.open > .nav-dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

.nav-dropdown-item {
  display: block;
  padding: 10px 16px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 500;
  color: var(--color-text-secondary);
  text-decoration: none;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.nav-dropdown-item:hover {
  background: rgba(74, 89, 38, 0.08);
  color: var(--color-primary);
  transform: translateX(4px);
}

.nav-dropdown::before {
  content: '';
  position: absolute;
  top: -6px;
  left: 50%;
  transform: translateX(-50%) rotate(45deg);
  width: 12px;
  height: 12px;
  background: rgba(255, 255, 255, 0.85);
  border-left: 1px solid rgba(255, 255, 255, 0.7);
  border-top: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 3px;
}

.nav-toggle {
  display: none;
  width: 44px;
  height: 44px;
  border: 1px solid rgba(255, 255, 255, 0.6);
  background: rgba(255, 255, 255, 0.5);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: 14px;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  transition: all 0.25s ease;
  flex-shrink: 0;
}

.nav-toggle:hover {
  background: rgba(74, 89, 38, 0.08);
}

.nav-toggle-icon {
  width: 20px;
  height: 20px;
  position: relative;
}

.nav-toggle-icon span {
  position: absolute;
  left: 2px;
  width: 16px;
  height: 2px;
  background: var(--color-text-primary);
  border-radius: 2px;
  transition: all 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

.nav-toggle-icon span:nth-child(1) { top: 5px; }
.nav-toggle-icon span:nth-child(2) { top: 9px; }
.nav-toggle-icon span:nth-child(3) { top: 13px; }

.navbar.expanded .nav-toggle-icon span:nth-child(1) {
  transform: rotate(45deg);
  top: 9px;
}

.navbar.expanded .nav-toggle-icon span:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}

.navbar.expanded .nav-toggle-icon span:nth-child(3) {
  transform: rotate(-45deg);
  top: 9px;
}

.mobile-nav {
  display: none;
  position: fixed;
  top: calc(var(--nav-height) + 12px);
  left: 20px;
  right: 20px;
  bottom: 20px;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(40px) saturate(1.8);
  -webkit-backdrop-filter: blur(40px) saturate(1.8);
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 28px;
  z-index: calc(var(--z-nav) - 1);
  padding: 24px;
  overflow-y: auto;
  transform: translateY(-12px);
  opacity: 0;
  transition: all 0.4s cubic-bezier(0.22, 1, 0.36, 1);
  box-shadow: 0 20px 60px rgba(26, 32, 16, 0.15);
}

.mobile-nav.open {
  transform: translateY(0);
  opacity: 1;
}

.mobile-nav-section {
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(74, 89, 38, 0.08);
}

.mobile-nav-section:last-child {
  border-bottom: none;
}

.mobile-nav-title {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: inherit;
  margin: 0;
  text-transform: none;
}

.mobile-nav-link {
  display: block;
  padding: 12px 16px;
  border-radius: 14px;
  font-size: 15px;
  font-weight: 500;
  color: var(--color-text-secondary);
  text-decoration: none;
  transition: all 0.2s ease;
}

.mobile-nav-link:hover {
  background: rgba(74, 89, 38, 0.08);
  color: var(--color-primary);
}

.mobile-nav-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  margin: 0;
  padding: 14px 16px;
  border: none;
  border-radius: 14px;
  background: transparent;
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--color-text-primary);
  text-align: left;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}

.mobile-nav-head:hover {
  background: rgba(74, 89, 38, 0.06);
}

.mobile-nav-section.active .mobile-nav-head {
  color: var(--color-primary);
  background: rgba(74, 89, 38, 0.08);
}

.mobile-nav-top {
  display: block;
  padding: 14px 16px;
  border-radius: 14px;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--color-text-primary);
  text-decoration: none;
  transition: background 0.2s ease, color 0.2s ease;
}

.mobile-nav-top:hover {
  background: rgba(74, 89, 38, 0.06);
}

.mobile-nav-section.active .mobile-nav-top {
  color: var(--color-primary);
  background: rgba(74, 89, 38, 0.08);
}

.mobile-nav-chevron {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  color: var(--color-text-tertiary);
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

.mobile-nav-section.open .mobile-nav-chevron {
  transform: rotate(180deg);
  color: var(--color-primary);
}

.mobile-nav-sublist {
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  padding: 0 8px;
  transition: max-height 0.35s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.3s ease, padding 0.3s ease;
}

.mobile-nav-section.open .mobile-nav-sublist {
  max-height: 440px;
  opacity: 1;
  padding: 2px 8px 10px;
}

.mobile-nav-section .mobile-nav-link {
  padding-left: 24px;
}

.nav-scroll-indicator {
  position: absolute;
  bottom: 0;
  left: 12px;
  right: 12px;
  height: 2px;
  background: linear-gradient(90deg, #4a5926, #a8c25e);
  border-radius: 2px;
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.15s linear;
}

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .navbar-glass {
    background: rgba(255, 255, 255, 0.95);
  }

  .navbar.scrolled .navbar-glass {
    background: #ffffff;
  }

  .nav-dropdown,
  .mobile-nav,
  .nav-toggle {
    background: rgba(255, 255, 255, 0.97);
  }
}

@media (max-width: 1024px) {
  .navbar {
    top: 10px;
    width: calc(100% - 24px);
  }

  .nav-links {
    display: none;
  }

  .nav-toggle {
    display: flex;
  }

  .mobile-nav {
    display: block;
  }
}

@media (max-width: 768px) {
  .navbar {
    height: var(--nav-height);
    top: 8px;
    width: calc(100% - 16px);
    border-radius: 22px;
  }

  .navbar-glass {
    border-radius: 22px;
  }

  .nav-inner {
    padding: 0 18px;
    gap: 12px;
  }

  .nav-logo {
    width: 40px;
    height: 40px;
  }

  .nav-brand-text {
    display: none;
  }

  .nav-toggle {
    width: 40px;
    height: 40px;
  }

  .mobile-nav {
    top: calc(var(--nav-height) + 8px);
    left: 12px;
    right: 12px;
    bottom: 12px;
    border-radius: 22px;
    padding: 20px;
  }
}
