.header {
  position: sticky;
  top: 0;
  z-index: 100;
  padding-top: var(--header-offset-top);
  background-color: transparent;
}

.header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: clamp(1rem, calc(24 / var(--design-width) * 100vw), 1.5rem);
  padding-bottom: clamp(0.75rem, calc(12 / var(--design-width) * 100vw), 1rem);
}

.header__logo {
  flex-shrink: 0;
}

.header__logo img {
  display: block;
  width: auto;
  height: clamp(1.25rem, calc(30 / var(--design-width) * 100vw), 1.875rem);
}

.header__nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex: 1;
  min-width: 0;
  gap: clamp(2rem, calc(64 / var(--design-width) * 100vw), 3.5rem);
  padding-inline: clamp(1.75rem, calc(56 / var(--design-width) * 100vw), 4.5rem);
}

.header__link {
  font-size: var(--text-nav);
  font-weight: 400;
  line-height: 1.2;
  color: var(--color-text);
  white-space: nowrap;
  transition: opacity 0.2s ease;
}

.header__link:hover {
  opacity: 0.7;
}

.header__aside {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  gap: clamp(1rem, calc(24 / var(--design-width) * 100vw), 1.75rem);
}

.header__contacts {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.125rem;
}

.header__phone {
  font-size: var(--text-nav);
  font-weight: 500;
  line-height: 1.2;
  color: var(--color-text);
  white-space: nowrap;
  transition: opacity 0.2s ease;
}

.header__phone:hover {
  opacity: 0.7;
}

.header__hours {
  font-size: var(--text-hours);
  font-weight: 400;
  line-height: 1.2;
  color: var(--color-text);
  white-space: nowrap;
}

.header__cta {
  padding: 0.75em clamp(1.75rem, calc(36 / var(--design-width) * 100vw), 2.25rem);
  font-size: var(--text-nav);
  font-weight: 400;
  line-height: 1.2;
  color: #ffffff;
  white-space: nowrap;
  background: var(--gradient-gold);
  border-radius: var(--radius-btn);
  transition: opacity 0.2s ease;
}

.header__cta:hover {
  opacity: 0.9;
}

.header__burger {
  display: none;
  flex-shrink: 0;
  flex-direction: column;
  align-items: stretch;
  justify-content: center;
  gap: clamp(0.3125rem, calc(6 / var(--design-width) * 100vw), 0.4375rem);
  width: clamp(2.25rem, calc(44 / var(--design-width) * 100vw), 2.75rem);
  height: clamp(2.25rem, calc(44 / var(--design-width) * 100vw), 2.75rem);
  padding: 0;
  background: transparent;
  border: 0;
  cursor: pointer;
}

.header__burger-line {
  display: block;
  width: 100%;
  height: 2px;
  background-color: var(--color-text);
  border-radius: 1px;
  transition:
    transform 0.25s ease,
    opacity 0.25s ease;
}

.header.is-menu-open .header__burger-line:nth-child(1) {
  transform: translateY(8px) rotate(45deg);
}

.header.is-menu-open .header__burger-line:nth-child(2) {
  opacity: 0;
}

.header.is-menu-open .header__burger-line:nth-child(3) {
  transform: translateY(-8px) rotate(-45deg);
}

@media (max-width: 1100px) {
  .header__inner {
    flex-wrap: wrap;
    row-gap: clamp(0.75rem, calc(16 / var(--design-width) * 100vw), 1rem);
  }

  .header__nav {
    order: 3;
    flex: 1 1 100%;
    justify-content: center;
    padding-inline: 0;
    gap: clamp(1.25rem, calc(40 / var(--design-width) * 100vw), 2.5rem);
  }
}

@media (max-width: 900px) {
  .header {
    z-index: 300;
  }

  .header.is-menu-open {
    z-index: 500;
  }

  .page-top > .header {
    z-index: 300;
  }

  .header__inner {
    flex-wrap: nowrap;
    align-items: center;
  }

  .header__logo img {
    height: clamp(2.25rem, calc(52 / var(--design-width) * 100vw), 3rem);
  }

  .header__nav,
  .header__aside {
    position: fixed;
    left: 0;
    right: 0;
    z-index: 2;
    display: none;
    pointer-events: none;
  }

  .header__nav {
    top: clamp(5.5rem, calc(120 / var(--design-width) * 100vw), 7rem);
    flex: none;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: clamp(1.25rem, calc(28 / var(--design-width) * 100vw), 1.75rem);
    order: 0;
    padding-inline: var(--gutter-min);
  }

  .header__aside {
    top: auto;
    bottom: clamp(2rem, calc(48 / var(--design-width) * 100vw), 3rem);
    flex-direction: column;
    align-items: center;
    gap: clamp(0.875rem, calc(20 / var(--design-width) * 100vw), 1.25rem);
    margin-left: 0;
  }

  .header__contacts {
    align-items: center;
  }

  .header__hours {
    display: block;
  }

  .header__burger {
    display: flex;
    position: relative;
    z-index: 4;
  }

  .header__menu-screen {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 1;
    background-color: var(--color-bg);
  }

  .header.is-menu-open .header__menu-screen {
    display: block;
  }

  .header.is-menu-open .header__inner {
    position: relative;
    z-index: 4;
  }

  .header.is-menu-open .header__nav,
  .header.is-menu-open .header__aside {
    display: flex;
    pointer-events: auto;
    z-index: 3;
  }

  .header.is-menu-open .header__link {
    font-size: clamp(1.125rem, calc(24 / var(--design-width) * 100vw), 1.5rem);
    white-space: normal;
  }
}

@media (max-width: 700px) {
  .header__link {
    white-space: normal;
  }
}
