/* Header layout */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(255, 255, 255, 0.95);
  border-bottom: 1px solid #e5e7eb;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
}

.header-shell {
  width: min(94%, 1200px);
  margin: 0 auto;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 2rem;
  padding: 0.8rem 0;
  transition: all 0.3s ease;
}

[data-header-sentinel] {
  display: block;
  height: 1px;
  margin-top: -1px;
  pointer-events: none;
}

/* Floating capsule on scroll */
.site-header.is-floating { 
  top: 12px; 
  background: transparent; 
  border-bottom-color: transparent; 
  backdrop-filter: none;
}

.site-header.is-floating .header-shell {
  background: #ffffff;
  border-radius: 9999px;
  padding: 0.6rem 1.5rem;
  box-shadow: 0 20px 40px -10px rgba(15, 23, 42, 0.15), 0 0 0 1px rgba(15, 23, 42, 0.05);
}

/* Brand */
.brand {
  display: inline-flex;
  flex-direction: column;
  line-height: 1.1;
  flex-shrink: 0;
}

.brand__name {
  font-weight: 800;
  letter-spacing: -0.02em;
  font-size: 1.35rem;
  color: #000;
}

/* Center nav */
.primary-nav {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
}

.nav-item {
  position: relative;
}

.nav-link {
  color: var(--color-muted);
  font-weight: 600;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.5rem 0.85rem;
  border: none;
  background: transparent;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.95rem;
  border-radius: 8px;
}

.nav-link:hover {
  color: #000;
  background: rgba(0, 0, 0, 0.04);
}

.chevron {
  transition: transform 0.2s ease;
  opacity: 0.5;
}

.has-dropdown:hover .chevron {
  transform: rotate(180deg);
  opacity: 1;
}

/* Dropdown Menu Desktop */
.dropdown-menu {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(10px);
  background: #ffffff;
  min-width: 240px;
  padding: 0.75rem;
  border-radius: 1.25rem;
  box-shadow: 0 30px 60px -12px rgba(15, 23, 42, 0.18), 0 0 0 1px rgba(15, 23, 42, 0.05);
  opacity: 0;
  visibility: hidden;
  transition: all 0.25s cubic-bezier(0.2, 0, 0, 1);
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  z-index: 100;
}

/* Mega Menu Variant */
.mega-menu {
  min-width: 900px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
  padding: 2.25rem;
}

.mega-column {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.mega-title {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 800;
  color: #94a3b8;
  margin-bottom: 1.25rem;
  padding-left: 0.85rem;
}

.has-dropdown:hover .dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(8px);
}

.dropdown-link {
  padding: 0.85rem;
  border-radius: 0.75rem;
  color: var(--color-text);
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  line-height: 1.3;
}

.dropdown-link strong {
  font-weight: 700;
  font-size: 0.95rem;
  color: #000;
}

.dropdown-link span {
  font-size: 0.8rem;
  color: #64748b;
  font-weight: 400;
}

.dropdown-link:hover {
  background: #f1f5f9;
  transform: translateX(5px);
}

/* CTA Group */
.header-cta-group {
  justify-self: end;
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
}

.cta-link {
  background: #000;
  color: #fff;
  padding: 0.65rem 1.35rem;
  border-radius: 9999px;
  font-weight: 700;
  font-size: 0.9rem;
  transition: all 0.2s ease;
  border: 1.5px solid #000;
  white-space: nowrap;
}

.cta-link--outline {
  background: transparent;
  color: #000;
  border-color: rgba(0, 0, 0, 0.15);
}

.cta-link--outline:hover {
  background: #f8fafc;
  border-color: #000;
}

.cta-link:not(.cta-link--outline):hover {
  background: #222;
  border-color: #222;
  transform: translateY(-1px);
  box-shadow: 0 10px 20px -5px rgba(0,0,0,0.2);
}

/* Hamburger (mobile) */
.hamburger {
  display: none;
  justify-self: end;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #000;
  cursor: pointer;
}

.hamburger-box {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
}

.hamburger-inner,
.hamburger-inner::before,
.hamburger-inner::after {
  content: "";
  display: block;
  width: 20px;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
  transition: all 0.25s ease;
}

.hamburger-inner::before { transform: translateY(-6px); }
.hamburger-inner::after { transform: translateY(6px); }

.hamburger[aria-expanded="true"] .hamburger-inner { transform: rotate(45deg); }
.hamburger[aria-expanded="true"] .hamburger-inner::before { transform: rotate(90deg); }
.hamburger[aria-expanded="true"] .hamburger-inner::after { opacity: 0; }

/* Mobile menu panel */
.mobile-menu {
  position: fixed;
  top: var(--header-height, 72px);
  left: 0;
  width: 100%;
  height: calc(100vh - var(--header-height, 72px));
  background: #ffffff;
  overflow-y: auto;
  z-index: 999;
  border-top: 1px solid #e5e7eb;
  padding-bottom: 4rem; /* Bottom padding for scroll room */
}

.mobile-nav {
  width: min(92%, 1100px);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 1.25rem 0 2rem;
}

.mobile-link {
  color: #000;
  font-weight: 600;
  padding: 0.85rem 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  border: none;
  background: transparent;
  text-align: left;
  font-size: 1.1rem;
  font-family: inherit;
  cursor: pointer;
}

.mobile-dropdown-toggle[aria-expanded="true"] .chevron { transform: rotate(180deg); }

.mobile-dropdown {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  padding-left: 1rem;
  border-left: 2px solid #f1f5f9;
  margin-bottom: 0.5rem;
}

.mobile-sublink {
  padding: 0.7rem 0;
  color: #64748b;
  font-weight: 500;
  font-size: 1rem;
}

.mobile-cta {
  align-self: start;
  display: inline-block;
  margin-top: 1.5rem;
  background: #000;
  color: #fff;
  padding: 0.85rem 1.75rem;
  border-radius: 9999px;
  font-weight: 700;
  text-align: center;
}

/* Responsive */
@media (max-width: 1024px) {
  .mega-menu { min-width: 100%; width: 95vw; }
}

@media (max-width: 900px) {
  .header-shell { grid-template-columns: 1fr auto; gap: 1rem; }
  .primary-nav, .header-cta-group { display: none; }
  .hamburger { display: inline-grid; }
}

body.no-scroll, 
html.no-scroll { 
  overflow: hidden !important;
  height: 100% !important;
}
