/* ============================================
   Grow Halal — Premium Site Header
   Design: Apple × Stripe × Linear × Monzo
   Glass effect, sticky, accessible
   ============================================ */

/* ── Site Header ── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(0, 0, 0, 0.04);
  transition: box-shadow 0.3s ease, background 0.3s ease;
}
.site-header.scrolled {
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 1px 12px rgba(0, 0, 0, 0.04), 0 1px 3px rgba(0, 0, 0, 0.02);
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.25rem;
  height: 64px;
}

/* ── Logo ── */
.nav-logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  flex-shrink: 0;
}
.nav-logo__mark {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.nav-logo__mark svg {
  width: 24px;
  height: 24px;
}
.nav-logo__text {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--color-primary-dark);
  letter-spacing: -0.02em;
}
.nav-logo__text span {
  color: var(--color-primary-light);
}

/* ── Site Nav ── */
.site-nav {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}
.site-nav__list {
  display: flex;
  align-items: center;
  gap: 0.15rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

/* ── Nav Links ── */
.nav-link {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.5rem 0.85rem;
  font-family: var(--font-main);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-text-muted);
  text-decoration: none;
  border-radius: var(--radius-sm);
  border: none;
  background: none;
  cursor: pointer;
  transition: color 0.2s ease, background 0.2s ease;
  white-space: nowrap;
}
.nav-link:hover,
.nav-link:focus-visible {
  color: var(--color-primary);
  background: rgba(27, 67, 50, 0.04);
}
.nav-link.active {
  color: var(--color-primary);
  font-weight: 600;
}

/* ── Dropdown ── */
.nav-dropdown {
  position: relative;
}
.nav-dropdown__chevron {
  transition: transform 0.2s ease;
  opacity: 0.5;
}
.nav-dropdown.open .nav-dropdown__chevron {
  transform: rotate(180deg);
}
.nav-dropdown__menu {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  min-width: 220px;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: var(--radius-md);
  padding: 0.5rem;
  box-shadow:
    0 8px 24px rgba(0, 0, 0, 0.06),
    0 2px 8px rgba(0, 0, 0, 0.03);
  list-style: none;
  margin: 0;
  z-index: 100;
  opacity: 0;
  transform: translateX(-50%) translateY(4px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.nav-dropdown.open .nav-dropdown__menu {
  display: block;
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.nav-dropdown__item {
  display: block;
  padding: 0.6rem 0.85rem;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--color-text-muted);
  text-decoration: none;
  border-radius: var(--radius-sm);
  transition: all 0.15s ease;
}
.nav-dropdown__item:hover,
.nav-dropdown__item:focus-visible {
  color: var(--color-primary);
  background: rgba(27, 67, 50, 0.04);
}
.nav-dropdown__item.active {
  color: var(--color-primary);
  font-weight: 600;
  background: rgba(27, 67, 50, 0.04);
}

/* ── Right Side: CTA + My Plans ── */
.site-header__actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-left: 1.5rem;
}
.nav-secondary {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--color-text-muted);
  text-decoration: none;
  transition: color 0.2s ease;
}
.nav-secondary:hover {
  color: var(--color-primary);
}
.nav-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.55rem 1.25rem;
  background: var(--color-primary);
  color: var(--color-white);
  font-family: var(--font-main);
  font-size: 0.82rem;
  font-weight: 600;
  border-radius: 100px;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 1px 4px rgba(27, 67, 50, 0.12);
}
.nav-cta:hover {
  background: var(--color-primary-light);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(27, 67, 50, 0.15);
  color: var(--color-white);
}

/* ── Mobile Toggle ── */
.mobile-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 44px;
  height: 44px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  border-radius: var(--radius-sm);
  transition: background 0.2s ease;
}
.mobile-toggle:hover {
  background: rgba(0, 0, 0, 0.03);
}
.mobile-toggle__bar {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--color-primary-dark);
  border-radius: 2px;
  transition: all 0.25s ease;
}
.mobile-toggle__bar + .mobile-toggle__bar {
  margin-top: 5px;
}
.mobile-toggle.open .mobile-toggle__bar:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.mobile-toggle.open .mobile-toggle__bar:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}
.mobile-toggle.open .mobile-toggle__bar:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ============================================
   Mobile Menu
   ============================================ */
@media (max-width: 768px) {
  .mobile-toggle {
    display: flex;
  }
  .site-nav {
    display: none;
    position: fixed;
    top: 64px;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    flex-direction: column;
    padding: 1.5rem 1.25rem;
    overflow-y: auto;
    z-index: 999;
    animation: none;
  }
  .site-nav.open {
    display: flex;
    animation: navSlideDown 0.25s ease both;
  }
  @keyframes navSlideDown {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
  }
  .site-nav__list {
    flex-direction: column;
    align-items: stretch;
    gap: 0.25rem;
    width: 100%;
  }
  .nav-link {
    padding: 0.85rem 1rem;
    font-size: 1rem;
    border-radius: var(--radius-md);
    min-height: 48px;
  }
  .nav-dropdown__menu {
    position: static;
    transform: none;
    min-width: 100%;
    box-shadow: none;
    border: none;
    background: var(--color-bg);
    border-radius: var(--radius-md);
    margin-top: 0.25rem;
    padding: 0.35rem;
  }
  .nav-dropdown.open .nav-dropdown__menu {
    transform: none;
  }
  .nav-dropdown__item {
    padding: 0.75rem 1rem;
    font-size: 0.95rem;
    min-height: 44px;
    display: flex;
    align-items: center;
  }
  .site-header__actions {
    margin-left: 0;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--color-border);
    width: 100%;
    flex-direction: column;
    gap: 0.75rem;
  }
  .nav-cta {
    width: 100%;
    justify-content: center;
    padding: 0.85rem 1.5rem;
    font-size: 0.95rem;
  }
  .nav-secondary {
    font-size: 0.95rem;
    padding: 0.5rem 0;
  }
  /* Prevent body scroll when nav is open */
  body.nav-open {
    overflow: hidden;
  }
}

/* ── Desktop: hide actions inside nav, show in header ── */
@media (min-width: 769px) {
  .site-header__actions--mobile {
    display: none;
  }
}

/* ── Focus states for accessibility ── */
.nav-link:focus-visible,
.nav-dropdown__trigger:focus-visible,
.nav-dropdown__item:focus-visible,
.nav-cta:focus-visible,
.nav-secondary:focus-visible,
.mobile-toggle:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}
