/* ==========================================================================
   Шапка сайта v2 (Плавное сжатие в 1 строку при скролле, современный стиль)
   ========================================================================== */

:root {
  --color-gold: #c5a059;
  --color-gold-light: #dfb76c;
}

.header--v2 {
  background: var(--color-header, #071836);
  color: #ffffff;
  position: sticky;
  top: 0;
  z-index: 500;
  transition: box-shadow 0.3s ease;
}

.header--v2.is-scrolled {
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.45);
}

/* 1. Верхняя информационная полоса (скрывается при скролле) */
.header__top-bar {
  background: rgba(0, 0, 0, 0.28);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 12px;
  color: #94a3b8;
  max-height: 38px;
  overflow: hidden;
  transition: max-height 0.35s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.25s ease, border-color 0.25s ease;
}

.header--v2.is-scrolled .header__top-bar {
  max-height: 0;
  opacity: 0;
  border-bottom-color: transparent;
}

.header__top-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 36px;
  padding: 0 16px;
}

.header__top-left,
.header__top-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.header__top-address {
  color: #cbd5e1;
  font-weight: 500;
}

.header__top-divider {
  color: rgba(255, 255, 255, 0.2);
}

.header__top-tag {
  color: var(--color-gold-light);
  font-weight: 600;
  letter-spacing: 0.02em;
}

.header__top-note {
  font-size: 12px;
  color: #94a3b8;
}

.header__top-phone {
  color: #ffffff;
  font-weight: 700;
  font-family: var(--font-text);
  letter-spacing: 0.02em;
  text-decoration: none;
  transition: color 0.15s;
}

.header__top-phone:hover {
  color: var(--color-gold-light);
}

/* 2. Основная строка: Лого + Навигация + Кнопка */
.header__main-bar {
  height: 64px;
  display: flex;
  align-items: center;
  transition: height 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.header--v2.is-scrolled .header__main-bar {
  height: 54px;
}

.header__main-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  padding: 0 16px;
}

.header__brand {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  text-decoration: none;
}

.header__logo {
  height: 44px;
  width: auto;
  display: block;
  transition: height 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.header--v2.is-scrolled .header__logo {
  height: 36px;
}

/* Навигация */
.nav {
  display: flex;
  align-items: center;
}

.nav__list {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav__item {
  position: relative;
}

.nav__link {
  display: inline-flex;
  align-items: center;
  padding: 10px 16px;
  color: #e2e8f0;
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: none;
  border: 0;
  cursor: pointer;
  text-decoration: none;
  transition: color 0.15s, background 0.15s, padding 0.3s ease;
}

.header--v2.is-scrolled .nav__link {
  padding: 8px 14px;
}

.nav__dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 290px;
  background: var(--color-navy-dark, #091d42);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.45);
  list-style: none;
  display: none;
  z-index: 300;
  margin: 0;
  padding: 6px 0;
  border-radius: 0 0 6px 6px;
}

.nav__dropdown a {
  display: block;
  padding: 10px 16px;
  font-size: 13px;
  color: #cbd5e1;
  line-height: 1.4;
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
}

@media (min-width: 980px) {
  .nav__link:hover,
  .nav__item:hover > .nav__link {
    color: var(--color-gold-light);
    background: rgba(255, 255, 255, 0.06);
    text-decoration: none;
  }

  .nav__item:hover .nav__dropdown {
    display: block;
  }

  .nav__dropdown a:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
    text-decoration: none;
  }
}

/* Действия справа на десктопе */
.header__actions-desktop {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.header__btn-consult {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 38px;
  padding: 0 18px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-radius: 4px;
  background: linear-gradient(180deg, #e2282c 0%, #b81418 100%);
  color: #ffffff;
  border: 0;
  cursor: pointer;
  box-shadow: 0 3px 8px rgba(191, 24, 28, 0.35);
  transition: filter 0.2s, transform 0.1s, height 0.3s ease;
  white-space: nowrap;
  text-decoration: none;
}

.header--v2.is-scrolled .header__btn-consult {
  height: 36px;
  padding: 0 16px;
}

.header__btn-consult:hover {
  filter: brightness(1.1);
  color: #ffffff;
  text-decoration: none;
}

/* Мобильные элементы */
.header__mobile-actions {
  display: none;
  align-items: center;
  gap: 8px;
}

.header__phone-mobile-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 36px;
  padding: 0 13px;
  background: linear-gradient(180deg, #e2282c 0%, #b81418 100%);
  box-shadow: 0 2px 6px rgba(191, 24, 28, 0.35);
  color: #ffffff;
  font: 700 13px/1 var(--font-text);
  border-radius: 4px;
  text-decoration: none;
  white-space: nowrap;
  transition: filter 0.15s, transform 0.1s;
}

.header__phone-mobile-btn:hover {
  filter: brightness(1.08);
  text-decoration: none;
}

.header__phone-mobile-btn:active {
  transform: translateY(1px);
}

.header__phone-mobile-btn svg {
  flex-shrink: 0;
  fill: currentColor;
  width: 13px;
  height: 13px;
}

.header__burger {
  width: 36px;
  height: 36px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 4px;
  cursor: pointer;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  flex-shrink: 0;
  transition: background 0.15s, border-color 0.15s;
}

.header__burger:hover {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.3);
}

.header__burger span {
  position: absolute;
  left: 9px;
  width: 18px;
  height: 2px;
  background: #ffffff;
  border-radius: 1px;
  transform-origin: center;
  transition: transform 0.2s ease, opacity 0.15s ease, top 0.2s ease;
  display: block;
}

.header__burger span:nth-child(1) {
  top: 10px;
}

.header__burger span:nth-child(2) {
  top: 17px;
}

.header__burger span:nth-child(3) {
  top: 24px;
}

.header__mobile-drawer-info {
  display: none;
}

/* Мобильная адаптация */
@media (max-width: 979px) {
  .header__top-bar {
    display: none;
  }
  .header__main-bar {
    height: 52px;
  }
  .header--v2.is-scrolled .header__main-bar {
    height: 52px;
  }
  .header__logo {
    height: 36px;
  }
  .header__actions-desktop {
    display: none;
  }
  .header__mobile-actions {
    display: flex;
  }

  .nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--color-navy-dark, #091d42);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding: 8px 16px 20px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5);
  }
  .header.is-menu-open .nav {
    display: block;
  }

  .header.is-menu-open .header__burger {
    background: rgba(255, 255, 255, 0.14);
    border-color: rgba(255, 255, 255, 0.35);
  }
  .header.is-menu-open .header__burger span:nth-child(1) {
    top: 17px;
    transform: rotate(45deg);
  }
  .header.is-menu-open .header__burger span:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
  }
  .header.is-menu-open .header__burger span:nth-child(3) {
    top: 17px;
    transform: rotate(-45deg);
  }

  .nav__list {
    flex-direction: column;
  }
  .nav__link {
    width: 100%;
    padding: 12px 0;
    font-size: 14px;
    justify-content: space-between;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    background: transparent !important;
    color: #e2e8f0;
    text-align: left;
  }
  .nav__link:hover,
  .nav__item:hover > .nav__link {
    background: transparent !important;
    color: #e2e8f0;
    text-decoration: none;
  }
  .nav__item.is-open > .nav__link {
    color: var(--color-gold-light);
    border-bottom-color: rgba(255, 255, 255, 0.1);
  }

  .nav__item--parent > .nav__link::after {
    content: "";
    display: inline-block;
    width: 7px;
    height: 7px;
    border-right: 2px solid rgba(255, 255, 255, 0.6);
    border-bottom: 2px solid rgba(255, 255, 255, 0.6);
    transform: rotate(45deg);
    transition: transform 0.2s ease, border-color 0.2s ease;
    margin-right: 4px;
    flex-shrink: 0;
  }
  .nav__item--parent.is-open > .nav__link::after {
    transform: rotate(-135deg);
    border-color: var(--color-gold-light);
  }

  .nav__dropdown {
    position: static;
    display: none;
    box-shadow: none;
    border: 0;
    background: transparent;
    padding: 4px 0 8px;
    border-radius: 0;
  }
  .nav__item:hover .nav__dropdown {
    display: none;
  }
  .nav__item.is-open .nav__dropdown {
    display: block;
  }
  .nav__dropdown a {
    padding: 8px 0 8px 16px;
    font-size: 13px;
    color: #cbd5e1;
    background: transparent !important;
    text-decoration: none;
  }
  .nav__dropdown a:hover,
  .nav__dropdown a:active {
    background: transparent !important;
    color: #ffffff;
    text-decoration: none;
  }

  .header__mobile-drawer-info {
    display: block;
    padding: 14px 0 0;
    margin-top: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 12px;
    color: #94a3b8;
  }
  .header__mobile-drawer-info strong {
    color: #fff;
    display: block;
    margin-bottom: 2px;
  }
}
