.header-8 {
  position: relative;
  z-index: 80;
  background: var(--color-white);
}

.header-8__masthead {
  padding: 12px 0 14px;
  background: var(--color-white);
}

.header-8__masthead-inner {
  display: grid;
  grid-template-columns: minmax(250px, 1fr) auto minmax(160px, 1fr);
  align-items: start;
  gap: 24px;
}

.header-8__contact {
  padding-top: 4px;
  color: var(--color-text-dark);
  font-family: var(--font-family);
}

.header-8__phone {
  display: inline-block;
  margin-bottom: 4px;
  color: var(--color-text-dark);
  font-size: var(--font-size-small);
  font-weight: 700;
  line-height: 1.2;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

.header-8__address {
  margin: 0;
  font-size: var(--font-size-small);
  font-style: italic;
  line-height: 1.45;
}

.header-8__brand {
  display: inline-flex;
  justify-self: center;
  align-items: center;
}

.header-8__brand img {
  display: block;
  width: clamp(96px, 8vw, 148px);
}

.header-8__social {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 20px;
  padding-top: 6px;
}

.header-8__social a {
  color: var(--color-text-dark);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.header-8__social a:hover {
  opacity: 0.75;
  transform: translateY(-1px);
}

.header-8__social svg {
  width: 19px;
  height: 19px;
}

.header-8__navband {
  background: var(--color-surface-subtle);
  box-shadow: 0 7px 18px rgba(var(--color-text-dark-rgb), 0.36);
}

.header-8__navband-inner {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 66px;
}

.header-8__nav {
  width: 100%;
}

.header-8__toggle {
  display: none;
  width: 46px;
  height: 46px;
  border: 0;
  background: transparent;
  padding: 0;
}

.header-8__toggle span {
  display: block;
  width: 27px;
  height: 3px;
  margin: 5px auto;
  border-radius: 999px;
  background: var(--color-background-dark);
}

.header-8__menu {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: clamp(20px, 3vw, 48px);
  margin: 0;
  padding: 0;
  list-style: none;
}

.header-8__item {
  position: relative;
}

.header-8__link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 52px;
  padding: 12px 8px;
  border: 0;
  background: transparent;
  color: var(--color-text-dark);
  font-family: var(--font-family);
  font-size: clamp(15px, 1.35vw, 18px);
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: color 0.2s ease, background 0.2s ease;
}

.header-8__item.is-active > .header-8__link {
  padding: 12px 30px;
  border-radius: 999px;
  background: var(--color-background-dark);
  color: var(--color-white);
}

.header-8__link:hover {
  color: var(--color-text-dark);
}

.header-8__item.is-active > .header-8__link:hover {
  color: var(--color-text-light);
}

.header-8__caret {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.header-8__caret svg {
  width: 14px;
  height: 14px;
}

.header-8__submenu {
  position: absolute;
  top: 100%;
  left: 50%;
  z-index: 20;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 250px;
  padding: 12px;
  border-radius: 20px;
  background: var(--color-white);
  box-shadow: 0 22px 34px rgba(var(--color-text-dark-rgb), 0.16);
  opacity: 0;
  pointer-events: none;
  transform: translateX(-50%) translateY(8px);
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.header-8__submenu::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: -12px;
  height: 12px;
}

.header-8__submenu-link {
  display: block;
  padding: 8px 10px;
  border-radius: 14px;
  color: var(--color-text-dark);
  font-family: var(--font-family);
  font-size: var(--font-size-small);
  font-weight: 500;
  text-decoration: none;
}

.header-8__submenu-link:hover {
  background: var(--color-surface-subtle);
}

.header-8__item--services.is-open > .header-8__submenu,
.header-8__item--services:focus-within > .header-8__submenu {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}

.header-8__item--services.is-open > .header-8__link .header-8__caret {
  transform: rotate(180deg);
}

@media (max-width: 1180px) {
  .header-8__masthead {
    padding: 12px 0;
  }

  .header-8__masthead-inner {
    grid-template-columns: 1fr auto;
    grid-template-areas:
      "brand social"
      "contact contact";
    align-items: center;
  }

  .header-8__brand {
    grid-area: brand;
    justify-self: start;
  }

  .header-8__social {
    grid-area: social;
    padding-top: 0;
  }

  .header-8__contact {
    grid-area: contact;
  }

  .header-8__navband-inner {
    min-height: 58px;
  }

  .header-8__toggle {
    position: absolute;
    top: 50%;
    right: 0;
    z-index: 3;
    display: block;
    transform: translateY(-50%);
  }

  .header-8__menu {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    left: auto;
    display: none;
    width: min(360px, calc(100vw - 32px));
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    margin: 0;
    padding: 16px;
    border-radius: 24px;
    background: var(--color-white);
    box-shadow: 0 18px 30px rgba(var(--color-text-dark-rgb), 0.18);
    text-align: left;
  }

  .header-8__menu.is-open {
    display: flex;
  }

  .header-8__item {
    width: 100%;
  }

  .header-8__link,
  .header-8__item.is-active > .header-8__link {
    justify-content: space-between;
    width: 100%;
    min-height: 0;
    padding: 16px 18px;
    border-radius: 16px;
    font-size: var(--font-size-body);
  }

  .header-8__submenu {
    position: static;
    display: none;
    width: 100%;
    min-width: 0;
    margin-top: 0;
    padding: 2px 0 0;
    border-radius: 0;
    background: var(--color-white);
    box-shadow: none;
    opacity: 1;
    pointer-events: auto;
    transform: none;
  }

  .header-8__item--services.is-open > .header-8__submenu {
    display: flex;
    flex-direction: column;
    opacity: 1;
    pointer-events: auto;
    transform: none;
  }

  .header-8__submenu::before {
    display: none;
  }

  .header-8__submenu-link {
    width: 100%;
    padding: 10px 10px;
    border-radius: 0;
    font-size: var(--font-size-body);
  }

  .header-8__submenu-link:hover {
    background: transparent;
  }
}

@media (max-width: 640px) {
  .header-8__contact {
    text-align: left;
  }

  .header-8__phone,
  .header-8__address {
    font-size: var(--font-size-body);
  }

  .header-8__social {
    gap: 14px;
  }

  .header-8__social svg {
    width: 20px;
    height: 20px;
  }

  .header-8__menu {
    padding: 14px;
  }
}
