/* Header block (BEM) — по макету Figma Modern Legal Solutions */
/* Переменные --header-* определены в static/css/global.css */

/* Контейнер шапки: без фона, два яруса внутри */
.header {
  width: 100%;
  background: #fff;
  z-index: 1000;
}

/* ——— Верхняя полоса (золотая) ——— */
.header__top {
  background: var(--header-gold-bg);
  min-height: 36px;
  display: flex;
  align-items: center;
}

.header__top-inner {
  width: 100%;
  margin: 0 auto;
  padding: 0 59px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-sizing: border-box;
}

.header__top-left {
  display: flex;
  align-items: center;
  gap: 26px;
}

.header__top-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--header-text-on-gold);
  text-decoration: none;
  font-family: var(--font-secondary);
  font-size: 15px;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  transition: opacity 0.2s;
}

.header__top-link_email {
  text-transform: lowercase;
}

.header__top-link:hover {
  opacity: 0.9;
}

.header__top-icon {
  flex-shrink: 0;
}

.header__top-right {
  display: flex;
  align-items: center;
  gap: 45px;
  font-family: "Inter", "Roboto", sans-serif;
  font-size: 14px;
  font-weight: 300;
  color: var(--header-text-on-gold);
  text-transform: capitalize;
  letter-spacing: 0.02em;
}

/* По макету: «Красноярск» — обычная насыщенность (Inter Light), не жирный */
.header__top-city {
  font-weight: 300;
}

.header__top-lang {
  font-family: var(--font-secondary);
  font-weight: 300;
}

/* ——— City switcher (десктоп) ——— */
.header__city-wrapper {
  display: flex;
  align-items: center;
  gap: 8px;
}

.header__city-label {
  color: var(--header-text-on-gold);
  font-family: var(--font-secondary);
  font-size: 14px;
  font-weight: 300;
  letter-spacing: 0.02em;
  white-space: nowrap;
  text-transform: none;
}

.header__city-switcher {
  position: relative;
}

.header__city-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--header-text-on-gold);
  font-family: var(--font-secondary);
  font-size: 14px;
  font-weight: 300;
  letter-spacing: 0.02em;
  padding: 0;
  transition: opacity 0.2s;
}

.header__city-btn:hover {
  opacity: 0.85;
}

.header__city-name {
  text-transform: capitalize;
}

.header__city-arrow {
  width: 10px;
  height: 6px;
  flex-shrink: 0;
  fill: var(--header-text-on-gold);
  transition: transform 0.2s;
}

.header__city-switcher_open .header__city-arrow {
  transform: rotate(180deg);
}

.header__city-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  background: #fff;
  border: 1px solid #e5e5e5;
  border-top: 2px solid var(--header-gold);
  min-width: 280px;
  padding: 0;
  margin: 0;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
  z-index: 1100;
  border-radius: 0 0 6px 6px;
}

.header__city-switcher_open .header__city-dropdown {
  display: block;
}

/* ——— City form (shared desktop + mobile) ——— */

.city-form {
  padding: 16px 20px 20px;
}

.city-form__title {
  font-family: var(--font-primary);
  font-size: 15px;
  font-weight: 500;
  color: var(--color-dark, #1e1e1e);
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid #e5e5e5;
}

.city-form__group {
  margin-bottom: 12px;
}

.city-form__group:last-child {
  margin-bottom: 0;
}

.city-form__col-label {
  font-family: var(--font-secondary), sans-serif;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: #999;
  margin-bottom: 6px;
}

.city-form--mobile {
  padding: 14px 16px;
}

/* ——— Searchable select component ——— */

.city-select {
  position: relative;
  width: 100%;
}

.city-select__btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 9px 12px;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 4px;
  cursor: pointer;
  text-align: left;
  font-family: var(--font-secondary), sans-serif;
  font-size: 14px;
  color: var(--color-dark, #1e1e1e);
  transition: border-color 0.15s;
}

.city-select__btn:hover,
.city-select--open .city-select__btn {
  border-color: var(--header-gold);
}

.city-select__value {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.city-select__arrow {
  width: 10px;
  height: 6px;
  flex-shrink: 0;
  fill: #999;
  transition: transform 0.2s;
}

.city-select--open .city-select__arrow {
  transform: rotate(180deg);
}

.city-select__dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 2px);
  left: 0;
  right: 0;
  z-index: 20;
  background: #fff;
  border: 1px solid var(--header-gold);
  border-radius: 0 0 4px 4px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.city-select--open .city-select__dropdown {
  display: block;
}

.city-select__search {
  width: 100%;
  padding: 8px 12px;
  border: none;
  border-bottom: 1px solid #eee;
  outline: none;
  font-family: var(--font-secondary), sans-serif;
  font-size: 13px;
  color: var(--color-dark, #1e1e1e);
  box-sizing: border-box;
}

.city-select__list {
  list-style: none;
  padding: 4px 0;
  margin: 0;
  max-height: 200px;
  overflow-y: auto;
}

.city-select__item {
  padding: 8px 12px;
  cursor: pointer;
  font-family: var(--font-secondary), sans-serif;
  font-size: 13px;
  color: var(--color-dark, #1e1e1e);
  transition: background 0.12s, color 0.12s;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.4;
}

.city-select__item:not(.city-select__item--empty):hover {
  background: rgba(178, 151, 57, 0.08);
  color: var(--header-gold);
}

.city-select__item--active {
  color: var(--header-gold);
  font-weight: 600;
  background: rgba(178, 151, 57, 0.06);
}

.city-select__item--pinned::before {
  content: '★ ';
  font-size: 10px;
  color: var(--header-gold);
}

.city-select__item--empty {
  color: #bbb;
  font-style: italic;
  cursor: default;
}

/* ——— Основная навигационная полоса (белая) ——— */
.header__content {
  display: flex;
  align-items: center;
  justify-content: space-evenly;
  padding: 30px 59px 24px;
  margin: 0 auto;
  position: relative;
  flex-wrap: nowrap;
  box-sizing: border-box;

  border-bottom: 1px solid #b4b4b4;
}

/* Логотип: иконка + текст в 3 строки */
.header__logo {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  flex-shrink: 0;
  margin-right: 16%;
}

.header__logo:hover .header__logo-img {
  opacity: 0.9;
}

/* Логотип из footer-logo.svg (иконка + текст в одном файле) */
.header__logo-img {
  display: block;
  height: 64px;
  width: auto;
  max-width: 281px;
  object-fit: contain;
  transition: opacity 0.2s;
}

/* Навигация */
.header__nav {
  flex: 1;
  display: flex;
  min-width: 0;
}

.header__nav-list {
  width: 100%;

  display: flex;
  list-style: none;
  align-items: center;
  flex-wrap: nowrap;
  justify-content: space-between;
  margin: 0;
  padding: 0;
}

.header__nav-item {
  position: relative;
  flex-shrink: 0;
}

.header__nav-link {
  display: block;
  padding: 8px 0;
  color: var(--header-text-dark);
  text-decoration: none;
  font-family: var(--font-raleway);
  font-weight: 500;
  font-size: 16px;
  transition:
    color 0.2s,
    text-decoration-color 0.2s;
  white-space: nowrap;
  line-height: 1.2;
  text-underline-offset: 4px;
}

.header__nav-link:hover {
  text-decoration: underline;
  text-decoration-color: var(--header-gold);
}

.header__nav-link_active {
  color: var(--header-gold);
}

.header__nav-link_active:hover {
  color: var(--header-gold);
  text-decoration: underline;
}

.header__nav-link_no-underline:hover {
  text-decoration: none;
}

/* Dropdown */
.header__nav-item_dropdown {
  position: relative;
}

.header__nav-item_dropdown > .header__nav-link {
  cursor: pointer;
}

.header__nav-item_dropdown::before {
  content: "";
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  height: 8px;
  background: transparent;
  z-index: 1002;
}

.header__dropdown-menu {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  left: -20px;
  background: #fff;
  border: 1px solid #e5e5e5;
  min-width: 200px;
  list-style: none;
  padding: 10px 0;
  margin: 0;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
  z-index: 1001;
}

.header__nav-item_dropdown:hover .header__dropdown-menu,
.header__dropdown-menu:hover {
  display: block;
}

.header__dropdown-item {
  margin: 0;
}

.header__dropdown-link {
  display: block;
  padding: 10px 20px;
  color: var(--header-text-dark);
  text-decoration: none;
  font-family: var(--font-raleway);
  font-weight: 500;
  font-size: 16px;
  white-space: nowrap;
  line-height: 1.2;
  text-underline-offset: 4px;
  transition:
    color 0.2s,
    text-decoration-color 0.2s;
}

.header__dropdown-link:hover {
  text-decoration: underline;
  text-decoration-color: var(--header-gold);
}

.header__dropdown-link_submenu-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-right: 28px;
}

.header__dropdown-link_submenu-trigger:hover {
  padding-left: 20px;
}

.header__dropdown-arrow {
  font-size: 18px;
  color: var(--header-gold);
  margin-left: 8px;
}

.header__dropdown-item_has-submenu {
  position: relative;
}

.header__subdropdown-menu {
  display: none;
  position: absolute;
  left: 100%;
  top: -1px;
  margin-left: 0;
  min-width: 260px;
  background: #fff;
  border: 1px solid #e5e5e5;
  border-left: 2px solid var(--header-gold);
  list-style: none;
  padding: 10px 0;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
  z-index: 1003;
}

.header__dropdown-item_has-submenu:hover .header__subdropdown-menu {
  display: block;
}

/* Кнопка CTA */
.header__cta {
  flex-shrink: 0;
  margin-left: 57px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 13px 16px;
  background: #181E2C;
  color: #fff;
  font-family: var(--font-raleway);
  font-size: 15px;
  font-weight: 500;
  text-decoration: none;
  border: none;
  border-radius: 24px;
  white-space: nowrap;
  max-height: 45px;
  transition:
    background 0.2s,
    transform 0.2s;
}

.header__cta:hover {
  /* background: var(--header-gold-light); */
  /* color: #fff; */
}

/* Гамбургер */
.header__menu-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 8px;
  margin-left: 12px;
}

.header__menu-toggle-line {
  width: 24px;
  height: 2px;
  background: var(--header-text-dark);
  transition: all 0.3s;
}

.header__menu-toggle.header__menu-toggle_active .header__menu-toggle-line:nth-child(1) {
  transform: rotate(45deg) translate(6px, 6px);
}

.header__menu-toggle.header__menu-toggle_active .header__menu-toggle-line:nth-child(2) {
  opacity: 0;
}

.header__menu-toggle.header__menu-toggle_active .header__menu-toggle-line:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

/* ——— Мобильное меню ——— */
.header__mobile-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: #fff;
  z-index: 2000;
  overflow-y: auto;
}

@media (max-width: 1024px) {
  .header__mobile-overlay_active {
    display: block;
  }
}

.header__mobile-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid #e5e5e5;
  background: #fff;
  position: sticky;
  top: 0;
  z-index: 2001;
}

.header__mobile-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  max-width: 70%;
}

.header__logo-img_mobile {
  height: 48px;
  max-width: 200px;
}

.header__mobile-phone {
  flex: 1;
  text-align: center;
}

.header__phone-link {
  color: var(--header-gold);
  text-decoration: none;
  font-weight: 500;
  font-size: 14px;
  white-space: nowrap;
  transition: color 0.2s;
}

.header__phone-link:hover {
  color: var(--header-gold-light);
}

.header__mobile-close {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 8px;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  position: relative;
}

.header__mobile-close-line {
  width: 22px;
  height: 2px;
  background: var(--header-text-dark);
  transition: background 0.2s;
  position: absolute;
}

.header__mobile-close-line:nth-child(1) {
  transform: rotate(45deg);
}

.header__mobile-close-line:nth-child(2) {
  transform: rotate(-45deg);
}

.header__mobile-close:hover .header__mobile-close-line {
  background: var(--header-gold);
}

.header__mobile-nav {
  padding: 20px 0;
}

.header__mobile-nav-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.header__mobile-nav-item {
  width: 100%;
  border-bottom: 1px solid #e5e5e5;
}

.header__mobile-nav-link {
  display: block;
  padding: 14px 20px;
  color: var(--header-text-dark);
  text-decoration: none;
  font-family: var(--font-raleway);
  font-size: 16px;
  font-weight: 500;
  text-transform: capitalize;
  transition:
    color 0.2s,
    background 0.2s;


}

.header__mobile-nav-link:hover {
  color: var(--header-gold);
  background: rgba(178, 151, 57, 0.08);
}

.header__mobile-dropdown-menu {
  display: none;
  list-style: none;
  margin: 0;
  padding: 0;
  background: rgba(0, 0, 0, 0.04);
}

.header__mobile-nav-item_active .header__mobile-dropdown-menu {
  display: block;
}

.header__mobile-dropdown-link {
  display: block;
  padding: 12px 20px 12px 40px;
  color: var(--header-text-dark);
  text-decoration: none;
  font-size: 14px;
  transition:
    color 0.2s,
    background 0.2s;
}

.header__mobile-dropdown-link:hover {
  color: var(--header-gold);
  background: rgba(178, 151, 57, 0.08);
}

.header__mobile-dropdown-menu .header__mobile-dropdown-menu {
  border-bottom: none;
}

.header__mobile-dropdown-menu .header__mobile-dropdown-menu .header__mobile-dropdown-link {
  padding-left: 48px;
  font-size: 13px;
}

/* ——— City switcher (мобильное меню) ——— */
.header__mobile-city {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 20px;
  border-bottom: 2px solid var(--header-gold);
  background: rgba(178, 151, 57, 0.06);
}

.header__mobile-city-label {
  font-family: var(--font-raleway);
  font-size: 14px;
  color: var(--header-text-dark);
  flex-shrink: 0;
}

.header__mobile-city-switcher {
  position: relative;
  flex: 1;
}

.header__mobile-city-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--header-gold);
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 500;
  padding: 0;
}

.header__mobile-city-arrow {
  width: 10px;
  height: 6px;
  flex-shrink: 0;
  fill: var(--header-gold);
  transition: transform 0.2s;
}

.header__mobile-city-switcher_open .header__mobile-city-arrow {
  transform: rotate(180deg);
}

.header__mobile-city-form {
  display: none;
  background: #fafafa;
  border-top: 1px solid #e5e5e5;
}

.header__mobile-city-switcher_open .header__mobile-city-form {
  display: block;
}

.city-form--mobile .city-form__list {
  max-height: 160px;
}

/* ——— Адаптив ——— */
@media (max-width: 1200px) {
  .header__top-inner,
  .header__content {
    padding-left: 24px;
    padding-right: 24px;
  }

  .header__nav-link {
    font-size: 14px;
  }

  .header__logo-img {
    height: 56px;
  }

}

@media (max-width: 1024px) {
  .header__top {
    display: none;
  }

  .header__content {
    padding: 12px 20px;
  }

  .header__nav {
    display: none;
  }

  .header__cta {
    display: none;
  }

  .header__menu-toggle {
    display: flex;
  }

  .header__logo {
    margin-right: 0;
  }

  .header__logo-img {
    height: 48px;
    max-width: 180px;
  }
}

@media (max-width: 768px) {
  .header__content {
    padding: 10px 16px;
  }

  .header__logo-img {
    height: 44px;
    max-width: 160px;
  }

  .header__logo-img_mobile {
    height: 44px;
    max-width: 160px;
  }
}
