/* ============================================================
   DKCOSM — Navigation
   Premium Glassmorphism Header + Mobile Menu
   ============================================================ */

/* ---- Header ---- */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: var(--z-fixed);
  height: 90px;
  padding: 0;
  transition: all var(--duration) ease;
  display: flex;
  align-items: center;
}

.header.scrolled {
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(20px) saturate(1.8);
  -webkit-backdrop-filter: blur(20px) saturate(1.8);
  height: 70px;
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.25);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: var(--container-wide);
  margin: 0 auto;
  padding: 0 var(--space-lg);
  position: relative;
}

/* ---- Logo ---- */
.logo {
  display: flex;
  align-items: center;
  z-index: 10;
  height: 140px;
  position: relative;
  top: 10px; /* Adjust to 'break out' of the 90px header */
}

.logo img {
  height: 100%;
  width: auto;
  transition: transform var(--duration) ease;
}

.header.scrolled .logo {
  transform: scale(0.7);
}

/* ---- Desktop Nav ---- */
.nav-desktop {
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.nav-link {
  position: relative;
  display: flex;
  align-items: center;
  height: 45px; /* Exactly half of header height (90px) */
  padding: 0 1.2rem;
  font-family: var(--font-heading);
  font-weight: 500;
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.7);
  border-radius: var(--border-radius);
  transition: all var(--duration-fast) ease;
  white-space: nowrap;
}

.nav-link:hover,
.nav-link.active {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

.nav-link.active::after {
  content: '';
  position: absolute;
  bottom: 0.3em;
  left: 50%;
  transform: translateX(-50%);
  width: 20px;
  height: 2px;
  background: var(--accent);
  border-radius: 2px;
}

.nav-cta {
  margin-left: 0.8rem;
}

/* ---- Mobile Toggle (Premium Pill Design) ---- */
.mobile-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 56px;
  height: 36px;
  cursor: pointer;
  z-index: 1001; /* Above everything */
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: 100px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: all 0.3s var(--ease-out);
  gap: 4px;
}

.mobile-toggle:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: var(--accent);
}

.mobile-toggle span {
  display: block;
  height: 2px;
  background: #fff;
  border-radius: 2px;
  transition: all 0.4s var(--ease-out);
}

.mobile-toggle span:nth-child(1) {
  width: 20px;
}

.mobile-toggle span:nth-child(2) {
  width: 14px;
  margin-left: auto;
  margin-right: 18px; /* Offset for aesthetic */
}

.mobile-toggle span:nth-child(3) {
  display: none; /* Only 2 bars for minimalist look */
}

/* Toggle active state */
.mobile-toggle.active {
  background: var(--accent);
  border-color: var(--accent);
}

.mobile-toggle.active span:nth-child(1) {
  transform: translateY(3px) rotate(45deg);
  width: 18px;
}

.mobile-toggle.active span:nth-child(2) {
  transform: translateY(-3px) rotate(-45deg);
  width: 18px;
  margin: 0;
}

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

/* ---- Mobile Menu Overlay ---- */
.mobile-menu {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.97);
  backdrop-filter: blur(30px);
  -webkit-backdrop-filter: blur(30px);
  z-index: var(--z-overlay);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  opacity: 0;
  visibility: hidden;
  transition: all var(--duration) var(--ease-out);
}

.mobile-menu.open {
  opacity: 1;
  visibility: visible;
}

.menu-close {
  position: absolute;
  top: 2rem;
  right: 2rem;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  cursor: pointer;
  color: #fff;
  transition: all 0.3s ease;
}

.menu-close:hover {
  background: rgba(255, 255, 255, 0.12);
  transform: rotate(90deg);
}

.mobile-menu .nav-link {
  font-size: 1.5rem;
  padding: 0.8em 1.5em;
  color: rgba(255, 255, 255, 0.6);
  transform: translateY(30px);
  opacity: 0;
  transition:
    color var(--duration-fast) ease,
    transform var(--duration-slow) var(--ease-out),
    opacity var(--duration-slow) var(--ease-out);
}

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

/* Stagger mobile links */
.mobile-menu .nav-link:nth-child(1) {
  transition-delay: 0.05s;
}

.mobile-menu .nav-link:nth-child(2) {
  transition-delay: 0.1s;
}

.mobile-menu .nav-link:nth-child(3) {
  transition-delay: 0.15s;
}

.mobile-menu .nav-link:nth-child(4) {
  transition-delay: 0.2s;
}

.mobile-menu .nav-link:nth-child(5) {
  transition-delay: 0.25s;
}

.mobile-menu .nav-link:nth-child(6) {
  transition-delay: 0.3s;
}

.mobile-menu .nav-link:nth-child(7) {
  transition-delay: 0.35s;
}

.mobile-menu .nav-link:hover {
  color: #fff;
}

.mobile-menu .btn {
  margin-top: 1rem;
  transform: translateY(30px);
  opacity: 0;
  transition: all var(--duration-slow) var(--ease-out);
  transition-delay: 0.4s;
}

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

/* ---- Responsive ---- */
@media (max-width: 1024px) {
  .nav-desktop {
    display: none;
  }

  .mobile-toggle {
    display: flex;
  }
}

@media (max-width: 768px) {
  .header {
    height: 90px;
  }

  .header-inner {
    padding: 0 var(--space-md);
  }

  .logo {
    height: 80px;
    margin: 0;
  }
}