.header-9 {
  position: relative;
  z-index: 80;
  background: #ffffff;
  border-bottom-left-radius: 44px;
  border-bottom-right-radius: 44px;
  box-shadow: 0 16px 38px rgba(29, 38, 31, 0.06);
}

.header-9__inner {
  display: grid;
  grid-template-columns: minmax(220px, 280px) 1fr auto;
  align-items: center;
  gap: 28px;
  min-height: 158px;
}

.header-9__brand {
  display: inline-flex;
  align-items: center;
}

.header-9__brand img {
  display: block;
  width: min(100%, 260px);
}

.header-9__nav {
  justify-self: center;
}

.header-9__menu {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(18px, 2.4vw, 52px);
  margin: 0;
  padding: 0;
  list-style: none;
}

.header-9__item {
  position: relative;
}

.header-9__link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 0;
  border: 0;
  background: transparent;
  color: #2b3034;
  font-family: "Montserrat", sans-serif;
  font-size: clamp(16px, 1.25vw, 19px);
  font-weight: 700;
  letter-spacing: 0.01em;
  text-decoration: none;
  cursor: pointer;
  transition: color 0.2s ease;
}

.header-9__item.is-active > .header-9__link {
  color: #9abb8b;
}

.header-9__link:hover,
.header-9__item.is-open > .header-9__link {
  color: #6e9464;
}

.header-9__caret,
.header-9__cta-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.header-9__caret svg {
  width: 14px;
  height: 14px;
}

.header-9__submenu {
  position: absolute;
  top: calc(100% + 14px);
  left: 50%;
  z-index: 20;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 270px;
  padding: 16px;
  border-radius: 22px;
  background: #ffffff;
  box-shadow: 0 18px 44px rgba(26, 31, 26, 0.14);
  opacity: 0;
  pointer-events: none;
  transform: translateX(-50%) translateY(8px);
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.header-9__submenu-link {
  display: block;
  padding: 10px 12px;
  border-radius: 14px;
  color: #38403a;
  font-family: "Nunito Sans", sans-serif;
  font-size: 16px;
  font-weight: 700;
  text-decoration: none;
}

.header-9__submenu-link:hover {
  background: #f1f4eb;
  color: #577a50;
}

.header-9__item--has-children.is-open > .header-9__submenu,
.header-9__item--has-children:focus-within > .header-9__submenu {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}

.header-9__item--has-children.is-open .header-9__caret {
  transform: rotate(180deg);
}

.header-9__cta {
  display: inline-flex;
  align-items: center;
  gap: 18px;
  min-height: 110px;
  padding: 20px 30px;
  border-radius: 0 0 0 16px;
  background: #98b98b;
  color: #ffffff;
  font-family: "Montserrat", sans-serif;
  font-size: 18px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}

.header-9__cta-icon svg {
  width: 28px;
  height: 28px;
}

.header-9__toggle {
  display: none;
  width: 48px;
  height: 48px;
  border: 0;
  background: transparent;
  padding: 0;
}

.header-9__toggle span {
  display: block;
  width: 28px;
  height: 3px;
  margin: 5px auto;
  border-radius: 999px;
  background: #39413d;
}

@media (max-width: 1180px) {
  .header-9__inner {
    grid-template-columns: minmax(200px, 230px) 1fr auto;
    gap: 20px;
    min-height: 132px;
  }

  .header-9__cta {
    min-height: 92px;
    padding: 18px 20px;
    font-size: 16px;
  }
}

@media (max-width: 980px) {
  .header-9 {
    border-bottom-left-radius: 30px;
    border-bottom-right-radius: 30px;
  }

  .header-9__inner {
    grid-template-columns: minmax(0, 1fr) auto auto;
    grid-template-areas:
      "brand cta toggle";
    gap: 14px;
    min-height: auto;
    padding: 18px 0 22px;
  }

  .header-9__brand {
    grid-area: brand;
    min-width: 0;
  }

  .header-9__brand img {
    width: min(100%, 172px);
  }

  .header-9__toggle {
    grid-area: toggle;
    display: block;
    justify-self: end;
    width: 42px;
    height: 42px;
  }

  .header-9__nav {
    grid-column: 1 / -1;
    grid-row: 2;
    width: 100%;
  }

  .header-9__menu {
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    width: 100%;
    margin-top: 6px;
    padding: 18px;
    border-radius: 24px;
    background: #f7f8f4;
  }

  .header-9__menu.is-open {
    display: flex;
  }

  .header-9__link {
    width: 100%;
    justify-content: space-between;
    padding: 14px 2px;
    font-size: 17px;
  }

  .header-9__submenu {
    position: static;
    top: auto;
    left: auto;
    min-width: 0;
    padding: 4px 0 0 14px;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    opacity: 1;
    pointer-events: auto;
    transform: none;
    display: none;
  }

  .header-9__item--has-children.is-open > .header-9__submenu {
    display: flex;
    transform: none;
  }

  .header-9__submenu-link {
    padding: 9px 0;
  }

  .header-9__cta {
    grid-area: cta;
    justify-content: center;
    width: 46px;
    height: 46px;
    min-height: 46px;
    padding: 0;
    border-radius: 14px;
    white-space: nowrap;
    gap: 0;
  }

  .header-9__cta-text {
    display: none;
  }

  .header-9__cta-icon svg {
    width: 22px;
    height: 22px;
  }
}

@media (max-width: 640px) {
  .header-9__brand img {
    width: min(100%, 150px);
  }

  .header-9__cta {
    width: 42px;
    height: 42px;
    min-height: 42px;
    border-radius: 12px;
  }

  .header-9__cta-icon svg {
    width: 20px;
    height: 20px;
  }
}
