.mso-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background-color: var(--color-surface);
  box-shadow: var(--shadow-sm);
}

.mso-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: var(--space-3);
  padding-bottom: var(--space-3);
  gap: var(--space-4);
}

.mso-header__brand {
  display: flex;
  align-items: center;
}

.mso-header__logo {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--color-primary);
}

.mso-header__logo-mark {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--color-primary), var(--color-primary-light));
  position: relative;
  box-shadow: var(--shadow-md);
}

.mso-header__logo-mark::before,
.mso-header__logo-mark::after {
  content: "";
  position: absolute;
  inset: 7px;
  border-radius: var(--radius-sm);
  border: 2px solid rgba(255, 255, 255, 0.9);
}

.mso-header__logo-mark::after {
  inset: 11px 4px 3px 10px;
  border-top: 0;
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
}

.mso-header__logo-text {
  font-size: var(--font-size-lg);
  color: var(--color-gray-900);
}

.mso-header__logo-text span {
  color: var(--color-primary);
}

.mso-header__nav {
  margin-left: auto;
}

.mso-header__nav-list {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  list-style: none;
}

.mso-header__nav-link {
  font-size: var(--font-size-sm);
  font-weight: 500;
  color: var(--color-gray-700);
  padding: 0.4rem 0;
  position: relative;
}

.mso-header__nav-link::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 0;
  height: 2px;
  border-radius: var(--radius-full);
  background: var(--color-accent);
  transition: width var(--transition-fast);
}

.mso-header__nav-link:hover::after,
.mso-header__nav-link:focus-visible::after {
  width: 100%;
}

.mso-header__nav-link--button {
  padding: 0.55rem 1.2rem;
  border-radius: var(--radius-full);
  background-color: var(--color-primary);
  color: #ffffff!important;
  box-shadow: var(--shadow-sm);
}

.mso-header__nav-link--button::after {
  display: none;
}

.mso-header__nav-link--button:hover {
  background-color: var(--color-primary-light);
}

.mso-header__nav-item--cta {
  margin-left: var(--space-2);
}

.mso-header__toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 4px;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  border: 1px solid var(--color-gray-200);
  background-color: var(--color-surface);
  cursor: pointer;
}

.mso-header__toggle-bar {
  width: 18px;
  height: 2px;
  border-radius: var(--radius-full);
  background-color: var(--color-gray-800);
  transition: transform var(--transition-fast), opacity var(--transition-fast);
}

.mso-header__toggle:focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: 2px;
}

.mso-header--menu-open .mso-header__toggle-bar:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
}

.mso-header--menu-open .mso-header__toggle-bar:nth-child(2) {
  opacity: 0;
}

.mso-header--menu-open .mso-header__toggle-bar:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
}

@media (max-width: 900px) {
  .mso-header__toggle {
    display: inline-flex;
  }

  .mso-header__nav {
    position: absolute;
    inset-inline: 0;
    top: 100%;
    background-color: var(--color-surface);
    box-shadow: var(--shadow-md);
    border-top: 1px solid var(--color-gray-200);
    transform-origin: top;
  }

  .mso-header__nav-list {
    flex-direction: column;
    align-items: flex-start;
    padding: var(--space-4);
    gap: var(--space-2);
  }

  .mso-header__nav-link {
    width: 100%;
    padding: 0.6rem 0.2rem;
  }

  .mso-header__nav-item--cta {
    width: 100%;
    margin-left: 0;
    margin-top: var(--space-2);
  }

  .mso-header__nav-link--button {
    display: inline-flex;
    justify-content: center;
    width: 100%;
  }

  .mso-header__nav {
    display: none;
  }

  .mso-header--menu-open .mso-header__nav {
    display: block;
  }
}

@media (prefers-reduced-motion: reduce) {
  .mso-header__toggle-bar {
    transition: none;
  }
}
