.header {
  position: sticky;
  top: 0;
  z-index: 20;
}

.header__bar {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  min-height: var(--header-height-mobile);
  padding: 15px 24px 15px 22px;
  background-color: var(--color-white);
  box-shadow: var(--shadow-soft);
}

.header__logo {
  flex: none;
}

.header__logo-image {
  width: 143px;
  height: auto;
}

.header__nav,
.header__phone,
.header__button {
  display: none;
}

.header__call {
  flex: none;
  margin-inline-start: auto;
  padding: 8px;
}

.header__call-icon {
  width: 22px;
  height: 22px;
}

.header__toggle {
  position: relative;
  flex: none;
  width: 37px;
  height: 37px;
  margin-inline-start: 7px;
  border-radius: 50%;
  background-color: var(--color-ink-soft);
  color: var(--color-white);
}

.header__toggle-line {
  position: absolute;
  left: 10px;
  width: 17px;
  height: 2px;
  border-radius: 1px;
  background-color: currentColor;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.header__toggle-line:nth-child(1) {
  top: 12px;
}

.header__toggle-line:nth-child(2) {
  top: 18px;
}

.header__toggle-line:nth-child(3) {
  top: 23px;
}

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

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

.header.is-menu-open .header__toggle-line:nth-child(3) {
  transform: translateY(-5px) rotate(-45deg);
}

.header.is-menu-open .header__bar {
  box-shadow: none;
}

.header__menu {
  position: absolute;
  inset: 100% 0 auto;
  z-index: 1;
  max-height: calc(100dvh - var(--header-height-mobile));
  padding: 25px 21px 24px;
  overflow-y: auto;
  border-top: 1px solid var(--color-line);
  border-radius: 0 0 20px 20px;
  background-color: var(--color-white);
  box-shadow: var(--shadow-soft);
}

.header__menu[hidden] {
  display: none;
}

.header__menu-list {
  display: grid;
  gap: 20px;
}

.header__menu-link {
  display: block;
  font-size: 15px;
  font-weight: 600;
  line-height: 1;
}

.header__menu-phone {
  display: block;
  margin-block-start: 40px;
  font-size: 20px;
  font-weight: 600;
  line-height: 1;
}

.header__menu-button {
  width: 100%;
  margin-block-start: 13px;
}

.header__overlay {
  position: fixed;
  inset: 0;
  z-index: 0;
  width: 100%;
  background-color: var(--color-overlay);
}

.header__overlay[hidden] {
  display: none;
}

@media (1024px <= width) {
  .main {
    margin-block-start: calc(-1 * var(--hero-offset));
  }

  .header {
    top: var(--header-pill-top);
    margin-block-start: var(--header-pill-top);
    height: var(--header-pill-height);
    width: min(100% - 40px, var(--container-width));
    margin-inline: auto;
  }

  .header__bar {
    min-height: var(--header-pill-height);
    padding: 20px 27px 20px 36px;
    border-radius: 100px;
    box-shadow: var(--shadow-pill);
  }

  .header__logo-image {
    width: 178px;
  }

  .header__nav {
    display: block;
    margin-inline-start: clamp(20px, 2.1vw, 41px);
  }

  .header__nav-list {
    display: flex;
    gap: clamp(16px, 1.63vw, 31px);
  }

  .header__nav-link {
    display: inline-block;
    padding-block: 8px;
    font-size: 15px;
    font-weight: 500;
    line-height: 1;
    white-space: nowrap;
    color: var(--color-text-muted);
    transition: color 0.2s ease;
  }

  .header__phone {
    margin-inline-start: auto;
    font-size: 15px;
    font-weight: 600;
    line-height: 1;
    white-space: nowrap;
  }

  .header__button {
    display: inline-flex;
    flex: none;
    white-space: nowrap;
    margin-inline-start: 22px;
  }

  .header__call,
  .header__toggle,
  .header__menu,
  .header__overlay {
    display: none;
  }
}

@media (1024px <= width < 1200px) {
  .header__phone {
    display: none;
  }

  .header__button {
    margin-inline-start: auto;
  }
}

@media (1200px <= width) {
  .header__phone {
    display: block;
  }
}

@media (hover: hover) {
  .header__nav-link:hover,
  .header__phone:hover {
    color: var(--color-gold-text);
  }
}

.header__nav-link:focus-visible {
  color: var(--color-gold-text);
}
