/* ============================================
   FTL Advisers — Header
   header.css
   
   Структура:
   .header
     .header-top      — логотип + контакты + иконки + lang
     .header-nav      — навигация с дропдаунами
   .banner            — hero-баннер страницы
   .breadcrumbs       — хлебные крошки
   
   Зависит от: variables.css, typography.css, layout.css
   ============================================ */


/* ══════════════════════════════════════════
   HEADER WRAPPER
   ══════════════════════════════════════════ */

.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: var(--bg-page);
  transition: box-shadow var(--duration) var(--ease);
}

.header.scrolled {
  box-shadow: 0 2px 24px rgba(55, 79, 26, 0.08);
}


/* ══════════════════════════════════════════
   HEADER TOP BAR
   Логотип | email | телефон | 🔍 | ✈ | RU/EN
   ══════════════════════════════════════════ */

.header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 0 16px;
  border-bottom: 1px solid var(--border-light);
}

/* --- Logo --- */
.header-logo {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.header-logo img {
  height: 20px;
  width: auto;
}

/* --- Right side: contacts + icons + lang --- */
.header-right {
  display: flex;
  align-items: center;
  gap: 28px;
}

.header-contact {
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 400;
  color: var(--text-primary);
  letter-spacing: 0.02em;
}

/* --- Icon buttons (search, telegram) --- */
.header-icons {
  display: flex;
  align-items: center;
  gap: 16px;
}

.header-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
}

.header-icon img,
.header-icon svg {
  width: 20px;
  height: 20px;
  object-fit: contain;
}

/* --- Header search (раскрывающееся поле) --- */
.header-search {
  display: inline-flex;
  align-items: center;
  position: relative;
}

.header-search__input {
  width: 0;
  padding: 0;
  border: none;
  outline: none;
  background: var(--bg-card);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 14px;
  border-radius: 20px;
  opacity: 0;
  margin-right: 0;
  transition:
    width var(--duration) var(--ease),
    padding var(--duration) var(--ease),
    opacity var(--duration) var(--ease),
    margin-right var(--duration) var(--ease);
}

.header-search__input::placeholder {
  color: var(--link-hover);
}

.header-search.is-open .header-search__input {
  width: 240px;
  padding: 8px 16px;
  opacity: 1;
  margin-right: 8px;
}

.header-search__btn {
  background: transparent;
  border: none;
  padding: 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
}

.header-search__btn img,
.header-search__btn svg {
  width: 20px;
  height: 20px;
  object-fit: contain;
}

/* --- Language switch --- */
.lang-switch {
  display: flex;
  border: 1px solid var(--text-primary);
  border-radius: 20px;
  overflow: hidden;
}

.lang-btn {
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.05em;
  padding: 5px 12px;
  border: none;
  background: transparent;
  color: var(--text-primary);
  cursor: pointer;
  transition: all var(--duration) var(--ease);
}

.lang-btn.active {
  background: var(--text-primary);
  color: var(--text-on-dark);
}

.lang-btn:hover:not(.active) {
  background: var(--border-light);
}


/* ══════════════════════════════════════════
   HEADER NAVIGATION
   ══════════════════════════════════════════ */

.header-nav {
  padding: 14px 0;
}

.header-nav > ul {
  list-style: none;
  display: flex;
  align-items: center;
}

/* --- Nav item --- */
.nav-item {
  position: relative;
}

.nav-link,
.nav-trigger {
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 400;
  color: var(--text-primary);
  padding: 8px 16px;
  letter-spacing: 0.01em;
  cursor: pointer;
  background: none;
  border: none;
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  transition: color var(--duration) var(--ease);
}

.nav-link:hover,
.nav-trigger:hover {
  color: var(--link-hover);
  opacity: 1;
}

/* Первый и последний пункт без лишнего padding */
.nav-item:first-child .nav-link,
.nav-item:first-child .nav-trigger {
  padding-left: 0;
}

.nav-item:last-child .nav-link,
.nav-item:last-child .nav-trigger {
  padding-right: 0;
}

/* --- Dropdown arrow --- */
.nav-arrow {
  width: 7px;
  height: 7px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg);
  margin-top: -3px;
  flex-shrink: 0;
  transition: transform 0.3s var(--ease);
}

.nav-item.open .nav-arrow {
  transform: rotate(-135deg);
  margin-top: 2px;
}


/* ══════════════════════════════════════════
   DROPDOWNS
   Фон: --bg-card (#F9FCF5)
   Border: --border-color
   Скругление: --radius-3 (10px)
   ══════════════════════════════════════════ */

.dropdown {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  min-width: 260px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-3);
  padding: 14px 0;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: all var(--duration) var(--ease);
  z-index: 100;
  box-shadow: 0 8px 32px rgba(55, 79, 26, 0.08);
}

.nav-item.open .dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dropdown a {
  display: block;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 400;
  color: var(--text-primary);
  padding: 8px 24px;
  transition: background var(--duration) var(--ease),
              color var(--duration) var(--ease);
  letter-spacing: 0.01em;
}

.dropdown a:hover {
  background: var(--border-light);
  color: var(--text-primary);
  opacity: 1;
}

/* Overlay для закрытия дропдаунов при клике вне */
.nav-overlay {
  position: fixed;
  inset: 0;
  z-index: 999;
  display: none;
}

.nav-overlay.active {
  display: block;
}


/* ══════════════════════════════════════════
   BURGER (tablet / mobile)
   ══════════════════════════════════════════ */

.burger {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: 4px;
  background: none;
  border: none;
  cursor: pointer;
}

.burger span {
  width: 24px;
  height: 2px;
  background: var(--text-primary);
  transition: all 0.3s var(--ease);
}

/* Tablet right side (icons + lang + burger) */
.header-right-tablet {
  display: none;
  align-items: center;
  gap: 14px;
}


/* ══════════════════════════════════════════
   BANNER (Hero)
   Полноширинный баннер с фоновой картинкой
   и заголовком страницы (H1: 110px)
   Скругление снизу: --radius-1 (40px)
   ══════════════════════════════════════════ */

.banner {
  margin-top: var(--header-height);
  margin-left: 20px;
  margin-right: 20px;
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-1);
}

.banner-img {
  width: 100%;
  height: 520px;
  object-fit: cover;
  display: block;
}


/* ══════════════════════════════════════════
   BANNER SLIDER — суперобложка с несколькими слайдами
   ══════════════════════════════════════════ */

.banner-slides {
  position: relative;
  width: 100%;
  height: 590px;
}

.banner-slide {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 1.5s ease;
}

.banner-slide.is-active {
  opacity: 1;
}

.banner-slide .banner-img {
  height: 100%;
}


/* Контент — обычный баннер (внутренние страницы) */
.banner-content {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 0 50px 48px;
  z-index: 2;
}

.banner-inner {
  /* Контент прижат к левому краю баннера */
}

/* Заголовок в баннере: не шире 65% */
.banner-inner h1,
.banner-inner .h1,
.banner-inner h2,
.banner-inner .h2 {
  max-width: 65%;
}

/* ── Слайдер-обложка (главная) ── */

.banner--slider .banner-content {
  top: 0;
  bottom: 0;
  padding: 50px 50px 80px;
  display: flex;
  flex-direction: column;
  pointer-events: none;
}

/* Возвращаем клики на интерактивные элементы внутри */
.banner--slider .banner-content a,
.banner--slider .banner-content button {
  pointer-events: auto;
}

.banner--slider .banner-inner {
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* Текст-подпись над заголовком */
.banner-lead {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  color: var(--text-primary);
  max-width: 480px;
  margin: 0;
}

/* Нижняя часть: H1 слева, кнопка справа */
.banner-bottom {
  margin-top: auto;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
}

/* Кнопка в баннере */
.banner-cta {
  flex-shrink: 0;
  margin-bottom: 8px;
}


/* Листалка внизу баннера */
.banner-carousel {
  position: absolute;
  bottom: 32px;
  left: 0;
  right: 0;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
}

.banner-carousel__arrow {
  background: transparent;
  border: none;
  padding: 0;
  cursor: pointer;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-on-dark);
  transition: opacity var(--duration) var(--ease);
}

.banner-carousel__arrow:hover {
  opacity: 0.6;
}

.banner-carousel__arrow svg {
  width: 20px;
  height: 20px;
  display: block;
}

.banner-carousel__dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: transparent;
  border: 1.5px solid var(--text-on-dark);
  padding: 0;
  cursor: pointer;
  transition: background var(--duration) var(--ease);
}

.banner-carousel__dot.is-active {
  background: var(--text-on-dark);
}


/* ══════════════════════════════════════════
   BREADCRUMBS
   ══════════════════════════════════════════ */

.breadcrumbs {
  padding: 16px 0;
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--link-hover); /* #374F1A 50% */
}

.breadcrumbs a {
  color: var(--link-hover);
}

.breadcrumbs a:hover {
  color: var(--text-primary);
  opacity: 1;
}

.breadcrumbs .sep {
  margin: 0 8px;
  color: var(--border-light);
}

.breadcrumbs .current {
  color: var(--text-primary);
}


/* ══════════════════════════════════════════
   RESPONSIVE — Tablet (768–1024px)
   ══════════════════════════════════════════ */

@media (max-width: 1024px) {
  .header-right {
    display: none;
  }

  .header-nav {
    display: none;
  }

  .header-right-tablet {
    display: flex;
  }

  .burger {
    display: flex;
  }

  .header-top {
    border-bottom: none;
    padding: 16px 0;
  }

  .banner {
    margin-top: var(--header-height);
  }

  .banner-img {
    height: 400px;
  }
}

@media (max-width: 768px) {
  /* Только лого + бургер */
  .header-right-tablet .header-icon,
  .header-right-tablet .lang-switch {
    display: none;
  }

  .header-logo img {
    height: 18px;
    width: 190px;
    object-fit: contain;
    object-position: left;
  }

  .burger {
    width: 40px;
    height: 40px;
    justify-content: center;
    align-items: center;
    padding: 0;
  }

  .burger span {
    width: 20px;
  }

  .banner {
    margin-top: var(--header-height);
  }

  .banner-img {
    height: 280px;
  }

  .banner-content {
    padding: 0 24px 24px;
  }
}


/* ══════════════════════════════════════════
   DESKTOP ONLY
   ══════════════════════════════════════════ */

@media (min-width: 1025px) {
  .header-right-tablet {
    display: none !important;
  }

  .burger {
    display: none !important;
  }
}


/* ══════════════════════════════════════════
   MOBILE MENU
   Полноэкранная панель, открывается бургером
   ══════════════════════════════════════════ */

.mobile-menu {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2000;
  background: var(--bg-page);
  overflow-y: auto;
  padding: 20px;
  display: none;
}

.mobile-menu.is-open {
  display: block;
}

.mobile-menu__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.mobile-menu__logo img {
  height: 18px;
  width: 190px;
  object-fit: contain;
  object-position: left;
}

.mobile-menu__close {
  width: 40px;
  height: 40px;
  background: none;
  border: none;
  cursor: pointer;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.mobile-menu__close::before,
.mobile-menu__close::after {
  content: '';
  position: absolute;
  width: 20px;
  height: 2px;
  background: var(--text-primary);
}

.mobile-menu__close::before { transform: rotate(45deg); }
.mobile-menu__close::after { transform: rotate(-45deg); }

/* Верхняя полоска: telegram + lang */
.mobile-menu__top {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-bottom: 20px;
}

.mobile-menu__top .header-icon img {
  width: 24px;
  height: 24px;
}

/* Поиск */
.mobile-menu__search {
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid var(--border-light);
  padding-bottom: 8px;
}

.mobile-menu__search input {
  flex: 1;
  border: none;
  background: none;
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--text-primary);
  outline: none;
  padding: 4px 0;
}

.mobile-menu__search input::placeholder {
  color: var(--link-hover);
}

.mobile-menu__search button {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  width: 20px;
  height: 20px;
}

.mobile-menu__search button img {
  width: 100%;
  height: 100%;
}

/* Контакты */
.mobile-menu__contacts {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
  font-family: var(--font-body);
  font-size: 14px;
}

.mobile-menu__contacts a {
  color: var(--text-primary);
}

/* Навигация */
.mobile-menu__nav {
  display: flex;
  flex-direction: column;
}

.mobile-menu__nav-item {
  border-bottom: 1px solid var(--border-light);
}

.mobile-menu__nav-item:first-child {
  border-top: 1px solid var(--border-light);
}

.mobile-menu__nav-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 0;
  font-family: var(--font-heading);
  font-size: 16px;
  font-weight: 300;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  color: var(--text-primary);
  text-decoration: none;
  background: none;
  border: none;
  width: 100%;
  cursor: pointer;
  text-align: left;
}

.mobile-menu__nav-arrow {
  width: 12px;
  height: 12px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg);
  transition: transform 0.3s var(--ease);
  flex-shrink: 0;
}

.mobile-menu__nav-item.open .mobile-menu__nav-arrow {
  transform: rotate(-135deg);
}

.mobile-menu__nav-dropdown {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s var(--ease);
}

.mobile-menu__nav-item.open .mobile-menu__nav-dropdown {
  max-height: 600px;
}

.mobile-menu__nav-dropdown a {
  display: block;
  padding: 8px 0 8px 16px;
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--text-primary);
  text-decoration: none;
}

.mobile-menu__nav-dropdown a:last-child {
  padding-bottom: 16px;
}
