.header {
  position: sticky;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 100;
  background: #111010;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  box-shadow: 0 2px 24px rgba(0, 0, 0, 0.3);
  padding: 0;
}

.header__container {
  display: flex;
  align-items: center;
  max-width: 1421px;
  width: 100%;
  margin: 0 auto;
  padding: 0 40px;
  height: 72px;
  gap: 8px;
}

.header__logo {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  text-decoration: none;
  margin-right: 16px;
}

.header__logo img {
  width: 64px;
  height: auto;
  display: block;
}

.header__nav {
  display: flex;
  align-items: center;
  gap: 0;
  flex: 1;
  min-width: 0;
}

.header__link {
  font-size: 13px;
  font-weight: 600;
  color: #978d8d;
  text-transform: uppercase;
  text-decoration: none;
  padding: 8px 10px;
  border-radius: 6px;
  transition: color 0.3s;
  white-space: nowrap;
  cursor: pointer;
  background: none;
  border: none;
  font-family: inherit;
  line-height: 1;
  letter-spacing: 0.03em;
}

.header__link:hover {
  color: #fff;
}

.header__more {
  position: relative;
}

.header__more-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  background: none !important;
  outline: none;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  font-size: 16px;
  font-family: inherit;
  font-weight: 600;
  letter-spacing: 0.03em;
  line-height: 1;
}

.header__more-btn svg {
  transition: transform 0.25s;
  flex-shrink: 0;
}

.header__more:hover .header__more-btn svg {
  transform: rotate(180deg);
}

/* Higher specificity (.header + class) overrides style.css (.class only) */
.header .header__dropdown {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  left: auto;
  transform: translateY(-6px);
  background: #1e1e1e;
  border-radius: 12px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.4);
  padding: 12px;
  width: 720px;
  max-height: 500px;
  overflow-y: auto;
  display: flex;
  align-items: flex-start;
  gap: 4px;
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
  /* задержка 200ms перед скрытием — время переместить мышь */
  transition:
    opacity 0.2s 0.2s,
    transform 0.2s 0.2s,
    visibility 0s 0.4s;
  border: 1px solid rgba(255, 255, 255, 0.08);
  z-index: 9999;
}

/* псевдоэлемент закрывает зазор между кнопкой и дропдауном */
.header .header__dropdown::before {
  content: '';
  position: absolute;
  top: -12px;
  left: 0;
  right: 0;
  height: 12px;
}

.header__dropdown-section {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.header__dropdown-section-title {
  font-size: 9px;
  font-weight: 700;
  color: #555;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  padding: 4px 10px 6px;
  white-space: nowrap;
}

.header .header__more.-open .header__dropdown {
  opacity: 1;
  pointer-events: auto;
  visibility: visible;
  transform: translateY(0);
  transition:
    opacity 0.15s,
    transform 0.15s,
    visibility 0s;
}

.header .header__dropdown-link {
  font-size: 12px;
  font-weight: 500;
  color: #978d8d;
  padding: 8px 12px;
  border-radius: 6px;
  border-left: none;
  transition:
    color 0.2s,
    background 0.2s;
  display: block;
  text-decoration: none;
  line-height: 1.3;
  white-space: normal;
}

.header .header__dropdown-link:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.06);
  padding-left: 12px;
}

.header__actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
  margin-left: auto;
}

.header__phone {
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  text-decoration: none;
  white-space: nowrap;
  transition: color 0.2s;
  letter-spacing: 0.01em;
}

.header__phone:hover {
  color: rgba(255, 255, 255, 0.65);
}

.header__cta {
  font-size: 12px !important;
  font-weight: 700 !important;
  padding: 0 20px !important;
  height: 40px !important;
  min-height: 40px !important;
  background: #803db1 !important;
  border: none !important;
  border-radius: 8px !important;
  color: #fff !important;
  text-transform: uppercase !important;
  letter-spacing: 0.06em !important;
  transition: background 0.2s !important;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
}

.header__cta:hover {
  background: #6b2fa0 !important;
}

.header__cta::after {
  display: none !important;
}

.header__burger {
  display: none;
  position: relative;
  background: none;
  border: none;
  cursor: pointer;
  width: 44px;
  height: 44px;
  flex-shrink: 0;
}

.header__burger span {
  display: block;
  position: absolute;
  left: 50%;
  top: 50%;
  width: 24px;
  height: 2px;
  background: #fff;
  border-radius: 2px;
  transform-origin: center center;
  transition:
    transform 0.3s,
    opacity 0.3s;
  margin-left: -12px;
  margin-top: -1px;
}

.header__burger span:nth-child(1) {
  transform: translateY(-8px);
}
.header__burger span:nth-child(2) {
  transform: translateY(0);
}
.header__burger span:nth-child(3) {
  transform: translateY(8px);
}

.header__burger.-active span:nth-child(1) {
  transform: rotate(45deg);
}
.header__burger.-active span:nth-child(2) {
  opacity: 0;
}
.header__burger.-active span:nth-child(3) {
  transform: rotate(-45deg);
}

.header__mobile {
  position: fixed;
  top: 72px;
  left: 0;
  width: 100%;
  height: calc(100vh - 72px);
  background: #111010;
  padding: 16px 20px 40px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
  z-index: 99;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  opacity: 0;
  pointer-events: none;
  transform: translateY(-8px);
  transition:
    opacity 0.25s,
    transform 0.25s;
}

.header__mobile.-open {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.header__mobile-link {
  font-size: 14px;
  font-weight: 600;
  color: #978d8d;
  text-transform: uppercase;
  text-decoration: none;
  padding: 13px 16px;
  border-radius: 8px;
  transition:
    color 0.3s,
    background 0.3s;
  letter-spacing: 0.03em;
}

.header__mobile-link:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.05);
}

.header__mobile-divider {
  height: 1px;
  background: rgba(255, 255, 255, 0.07);
  margin: 10px 0;
}

.header__mobile-group-title {
  font-size: 14px;
  font-weight: 700;
  color: #555;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  padding: 12px 16px;
}

.header__mobile-services {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px;
}

.header__mobile-services .header__mobile-link {
  font-size: 12px;
  padding: 9px 14px;
}

.header__mobile-bottom {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 12px;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
}

.header__mobile-bottom .header__phone {
  font-size: 20px;
  padding: 4px 16px;
  display: block;
}

.header__mobile-bottom .header__cta {
  width: 100%;
  border-radius: 10px !important;
  height: 50px !important;
  min-height: 50px !important;
  font-size: 13px !important;
}

@media (max-width: 1440px) {
  .header__phone {
    display: none;
  }
}

@media (max-width: 1100px) {
  .header__container {
    padding: 0 24px;
  }

  .header__link {
    font-size: 11px;
    padding: 8px 6px;
  }

  .header__more-btn {
    font-size: 11px;
  }

  .header .header__dropdown {
    width: 560px;
  }
}

@media (max-width: 900px) {
  .header__nav {
    display: none;
  }
}

@media (max-width: 768px) {
  .header__actions {
    display: none;
  }

  .header__burger {
    display: flex;
  }

  .header__container {
    padding: 0 16px;
    height: 60px;
  }

  .header__logo img {
    width: 56px;
  }

  .header__mobile {
    top: 60px;
    height: calc(100vh - 60px);
  }
}

@media (max-width: 480px) {
  .header__mobile-services {
    grid-template-columns: 1fr;
  }
}
