.mariposa-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  width: 100%;
  height: 80px;
  background: #fbf7ef;
}

.admin-bar .mariposa-header {
  top: 32px;
}

.mariposa-header__inner {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(100% - 48px, 1440px);
  height: 100%;
  margin: 0 auto;
}

.mariposa-header__brand {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
}

.mariposa-header__logo {
  display: block;
  width: auto;
  max-width: 180px;
  height: 48px;
  object-fit: contain;
}

.mariposa-header__panel,
.mariposa-header__menu {
  display: flex;
  align-items: center;
}

.mariposa-header__panel {
  gap: 40px;
}

.mariposa-header__menu {
  gap: 32px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.mariposa-header__menu .menu-item {
  position: relative;
}

.mariposa-header__menu .menu-item-has-children > a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.mariposa-header__menu .menu-item-has-children > a::after {
  width: 7px;
  height: 7px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  content: "";
  transform: translateY(-2px) rotate(45deg);
}

.mariposa-header__menu .sub-menu {
  position: absolute;
  top: 100%;
  left: -24px;
  z-index: 10;
  display: none;
  min-width: 240px;
  margin: 0;
  padding: 24px;
  border: 1px solid #c3beb6;
  border-radius: 15px;
  background: #fbf7ef;
  list-style: none;
}

.mariposa-header__menu .menu-item-has-children:hover > .sub-menu,
.mariposa-header__menu .menu-item-has-children:focus-within > .sub-menu {
  display: block;
}

.mariposa-header__menu .sub-menu .menu-item,
.mariposa-header__menu .sub-menu a {
  min-height: 32px;
}

.mariposa-header__menu .sub-menu a {
  display: flex;
  align-items: center;
  width: 100%;
  padding: 4px 0;
  line-height: 24px;
}

.mariposa-header__menu a {
  color: #0f0c09;
  font-family: "Inter", sans-serif;
  font-size: 16px;
  font-weight: 500;
  line-height: 24px;
  text-decoration: none;
  transition: color 180ms ease;
}

.mariposa-header__menu a:hover,
.mariposa-header__menu a:focus-visible,
.mariposa-header__menu .current-menu-item > a,
.mariposa-header__menu .current_page_item > a {
  color: #fd6b00;
}

.mariposa-header__menu a:focus-visible,
.mariposa-header__cta:focus-visible,
.mariposa-header__toggle:focus-visible {
  outline: 2px solid #fd6b00;
  outline-offset: 4px;
}

.mariposa-header__cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 24px;
  border-radius: 999px;
  background: #fd6b00;
  color: #fff;
  font-family: "Inter", sans-serif;
  font-size: 18px;
  font-weight: 600;
  line-height: 24px;
  text-decoration: none;
  transition: background-color 180ms ease;
}

.mariposa-header__cta:hover,
.mariposa-header__cta:focus-visible {
  background: #0f0c09;
  color: #fff;
}

.mariposa-header__toggle {
  display: none;
  width: 48px;
  height: 48px;
  padding: 12px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #0f0c09;
  cursor: pointer;
}

.mariposa-header__toggle span {
  display: block;
  width: 24px;
  height: 2px;
  margin: 5px 0;
  background: currentColor;
  transition: transform 180ms ease, opacity 180ms ease;
}

@media (max-width: 1024px) {
  .mariposa-header {
    height: 72px;
  }

  .mariposa-header__inner {
    width: calc(100% - 32px);
  }

  .mariposa-header__logo {
    max-width: 160px;
    height: 42px;
  }

  .mariposa-header__toggle {
    display: block;
  }

  .mariposa-header__toggle[aria-expanded="true"] span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
  }

  .mariposa-header__toggle[aria-expanded="true"] span:nth-child(2) {
    opacity: 0;
  }

  .mariposa-header__toggle[aria-expanded="true"] span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
  }

  .mariposa-header__panel {
    position: absolute;
    top: 100%;
    right: -16px;
    left: -16px;
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 24px;
    padding: 24px 16px 32px;
    background: #fbf7ef;
  }

  .mariposa-header__panel.is-open {
    display: flex;
  }

  .mariposa-header__menu {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
  }

  .mariposa-header__menu a {
    display: block;
    padding: 12px 0;
  }

  .mariposa-header__menu .menu-item-has-children > a {
    display: flex;
    justify-content: space-between;
  }

  .mariposa-header__menu .sub-menu {
    position: static;
    display: block;
    min-width: 0;
    padding: 0 0 8px 16px;
    border: 0;
    border-radius: 0;
    background: transparent;
  }

  .mariposa-header__menu .sub-menu a {
    min-height: 40px;
    padding: 8px 0;
    font-size: 15px;
  }

  .mariposa-header__cta {
    align-self: flex-start;
  }
}

@media (max-width: 782px) {
  .admin-bar .mariposa-header {
    top: 46px;
  }
}

@media (max-width: 767px) {
  .mariposa-header {
    height: 64px;
  }

  .mariposa-header__logo {
    max-width: 140px;
    height: 38px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .mariposa-header *,
  .mariposa-header *::before,
  .mariposa-header *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
