/* ==========================================================================
   Header: логотип, меню, поиск, язык, вход (разметка — views/header.php)
   ========================================================================== */

.site-header {
  position: relative;
  z-index: 50;
  background: #fff;
  border-bottom: 0.0625rem solid var(--c-line);
}

.header__inner {
  display: flex;
  align-items: center;
  gap: 2rem;
  min-height: 4.5rem;
}

/* Логотип */
.brand {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  flex: none;
  color: var(--c-navy);
}

.brand__mark {
  width: 2.125rem;
  height: 1.875rem;
  fill: var(--c-blue);
}

.brand__text {
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
}

.brand__name {
  font-family: var(--font-head);
  font-size: 1.625rem;
  line-height: 1;
  font-weight: 800;
  letter-spacing: -.01em;
}

.brand__name b {
  font-weight: inherit;
  color: var(--c-blue);
}

.brand__tag {
  font-size: 0.5625rem;
  line-height: 1;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--c-muted);
  white-space: nowrap;
}

/* Меню */
.nav {
  flex: 1;
  min-width: 0;
}

.nav__list {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.25rem 2rem;
}

.nav__link {
  display: block;
  padding-block: 0.5rem;
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--c-navy);
  transition: color .2s;
}

.nav__link:hover,
.nav__link.is-current {
  color: var(--c-blue);
}

.nav__login {
  display: none;
}

/* Инструменты справа */
.header__tools {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex: none;
}

.header__icon {
  display: grid;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  margin-inline: -0.5rem;
  padding: 0;
  color: var(--c-navy);
  background: none;
  border: 0;
  border-radius: 50%;
  transition: background-color .2s, color .2s;
}

.header__icon:hover,
.header__icon[aria-expanded="true"] {
  color: var(--c-blue);
  background: var(--c-soft);
}

.header__icon .icon {
  width: 1.375rem;
  height: 1.375rem;
}

.lang {
  display: flex;
  gap: 0.25rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--c-muted);
}

.lang a {
  transition: color .2s;
}

.lang a[aria-current="true"],
.lang a:hover {
  color: var(--c-navy);
}

.header__login {
  min-height: 2.5rem;
  padding-inline: 1.25rem;
}

/* Поиск */
.header-search {
  border-top: 0.0625rem solid var(--c-line);
  background: #fff;
}

.header-search__inner {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding-block: 0.75rem;
}

.header-search__icon {
  width: 1.25rem;
  height: 1.25rem;
  flex: none;
  color: var(--c-muted);
}

.header-search__input {
  flex: 1;
  min-width: 0;
  height: 2.75rem;
  padding: 0 0.875rem;
  font-size: 1rem;
  border: 0.0625rem solid var(--c-field-line);
  border-radius: var(--radius);
  outline: 0;
  transition: border-color .2s;
}

.header-search__input:focus {
  border-color: var(--c-blue);
}

/* Бургер */
.burger {
  display: none;
  position: relative;
  width: 2.5rem;
  height: 2.5rem;
  margin-right: -0.5rem;
  padding: 0;
  background: none;
  border: 0;
  color: var(--c-navy);
}

.burger__line {
  position: absolute;
  left: 0.625rem;
  right: 0.625rem;
  height: 0.125rem;
  background: currentColor;
  border-radius: 0.125rem;
  transition: transform .2s, opacity .2s;
}

.burger__line:nth-child(1) { top: 0.8125rem; }
.burger__line:nth-child(2) { top: 1.1875rem; }
.burger__line:nth-child(3) { top: 1.5625rem; }

.burger[aria-expanded="true"] .burger__line:nth-child(1) {
  transform: translateY(0.375rem) rotate(45deg);
}

.burger[aria-expanded="true"] .burger__line:nth-child(2) {
  opacity: 0;
}

.burger[aria-expanded="true"] .burger__line:nth-child(3) {
  transform: translateY(-0.375rem) rotate(-45deg);
}

@media (max-width: 1240px) {
  .header__inner {
    gap: 1.5rem;
  }

  .nav__list {
    column-gap: 1.375rem;
  }
}

@media (min-width: 1000px) and (max-width: 1120px) {
  .header__inner,
  .header__tools {
    gap: 1rem;
  }

  .nav__list {
    column-gap: 1rem;
  }

  .nav__link {
    font-size: 0.875rem;
  }
}

@media (max-width: 999px) {
  .header__inner {
    justify-content: space-between;
    min-height: 4rem;
  }

  .burger {
    display: block;
  }

  .header__tools {
    gap: 1rem;
  }

  .lang,
  .header__login {
    display: none;
  }

  .nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    padding: 0.5rem var(--gutter) 1.25rem;
    background: #fff;
    border-top: 0.0625rem solid var(--c-line);
    box-shadow: 0 1rem 1.5rem rgba(7, 29, 73, .08);
  }

  .site-header.is-open .nav {
    display: block;
  }

  .nav__list {
    flex-direction: column;
    justify-content: flex-start;
    gap: 0;
  }

  .nav__link {
    padding-block: 0.8125rem;
    font-size: 1rem;
    border-bottom: 0.0625rem solid var(--c-line);
  }

  .nav__login {
    display: flex;
    width: 100%;
    margin-top: 1rem;
  }
}

@media (max-width: 560px) {
  .container {
    --gutter: 1rem;
  }

  .brand__mark {
    width: 1.875rem;
    height: 1.625rem;
  }

  .brand__name {
    font-size: 1.375rem;
  }

  .brand__tag {
    font-size: 0.5rem;
  }
}
