/* Navigation Component */
.nav {
  border-bottom: var(--border-thick);
  background: var(--bg-white);
  position: sticky;
  top: 0;
  z-index: var(--z-sticky);
  padding: var(--space-sm) 0;
  min-height: 80px;
  transition: all 0.3s ease;
}

.nav-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-md);
  height: 100%;
}

.logo {
  font-family: var(--font-heading);
  font-size: 24px;
  font-weight: 900;
  border: var(--border-thick);
  padding: 4px 12px;
  background: var(--ink);
  color: var(--bg-paper);
  box-shadow: 4px 4px 0 var(--blue);
  text-decoration: none;
  transition: all 0.2s ease;
}

.logo:hover,
.logo:focus-visible {
  transform: translate(-2px, -2px);
  box-shadow: 6px 6px 0 var(--blue);
  outline: none;
}

.nav-links {
  display: flex;
  gap: var(--space-md);
  align-items: center;
  height: 100%;
}

.nav-link {
  font-weight: 700;
  text-transform: uppercase;
  font-size: 14px;
  position: relative;
  padding: var(--space-xs) 0;
  transition: color 0.2s ease;
}

.nav-link:hover,
.nav-link:focus-visible {
  color: var(--blue);
  outline: none;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 4px;
  background: var(--blue);
  transition: width 0.3s ease;
}

.nav-link:hover::after,
.nav-link:focus-visible::after,
.nav-link.active::after {
  width: 100%;
}

.nav-link.active {
  color: var(--blue);
}

/* Mobile menu toggle */
.hamburger {
  display: none;
  flex-direction: column;
  gap: 6px;
  background: none;
  border: var(--border-thick);
  padding: 10px;
  cursor: pointer;
  background: var(--bg-white);
  box-shadow: var(--shadow-hard);
  transition: all 0.2s ease;
  border-radius: var(--radius-sm);
  position: fixed;
  top: 17px;
  right: var(--space-md);
  z-index: var(--z-hamburger);
}

.hamburger:hover,
.hamburger:focus-visible {
  transform: translate(-2px, -2px);
  box-shadow: var(--shadow-hover);
  outline: none;
}

.hamburger span {
  width: 24px;
  height: 3px;
  background: var(--ink);
  transition: all 0.3s ease;
  border-radius: 2px;
}

.hamburger.active span:nth-child(1) {
  transform: rotate(45deg) translate(8px, 8px);
}

.hamburger.active span:nth-child(2) {
  opacity: 0;
}

.hamburger.active span:nth-child(3) {
  transform: rotate(-45deg) translate(7px, -7px);
}

/* Mobile menu */
.mobile-menu {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  background: var(--bg-white);
  border-bottom: var(--border-thick);
  z-index: var(--z-modal);
  display: flex;
  flex-direction: column;
  padding: var(--space-lg) var(--space-md);
  gap: var(--space-md);
  overflow-y: auto;
  transform: translateX(100%);
  transition: transform 0.3s ease;
  opacity: 0;
  visibility: hidden;
}

/* Ensure z-index variable is defined */
:root {
  --z-modal: 1000;
  --z-sticky: 100;
  --z-hamburger: 9999;
}

.mobile-menu.active {
  transform: translateX(0);
  opacity: 1;
  visibility: visible;
  animation: slideInRight 0.3s ease;
}

@keyframes slideInRight {
  from {
    transform: translateX(100%);
  }
  to {
    transform: translateX(0);
  }
}

.mobile-menu-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: var(--space-md);
  border-bottom: var(--border-thick);
  position: relative;
  z-index: 1;
}

.mobile-menu-links {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.mobile-menu-link {
  padding: var(--space-sm);
  border: var(--border-thick);
  background: var(--bg-paper);
  font-weight: 700;
  text-transform: uppercase;
  font-size: 18px;
  text-align: center;
  transition: all 0.2s ease;
  text-decoration: none;
  border-radius: var(--radius-sm);
}

.mobile-menu-link:hover,
.mobile-menu-link:focus-visible {
  background: var(--blue);
  color: #fff;
  transform: translate(-2px, -2px);
  box-shadow: var(--shadow-hard);
  outline: none;
}

/* Responsive navigation */
@media (max-width: 900px) {
  .nav-links {
    display: none;
  }

  .nav-inner > .btn:not(.hamburger) {
    display: none;
  }

  .nav-auth {
    display: none !important;
  }

  .hamburger {
    display: flex;
  }
}

/* Sticky navigation scroll effect */
.nav.scrolled {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Dark mode navigation */
[data-theme="dark"] .nav {
  background: var(--bg-white);
}

[data-theme="dark"] .hamburger {
  background: var(--bg-white);
}

[data-theme="dark"] .mobile-menu {
  background: var(--bg-white);
}
