/* ==========================================================================
   Шапка сайта (Header — Quiet Luxury)
   ========================================================================== */

.header {
  position: sticky;
  top: 0;
  z-index: 100;
  /* 29.09: форсим GPU-слой — без этого backdrop-filter при скролле за шапкой
     пересчитывает blur каждый кадр и текст (Александр Киямов / Репортажный фотограф)
     «сплющивается» на субпикселях. translateZ(0) кэширует текст в текстуру. */
  transform: translateZ(0);
  /* 30.09: фон шапки = фон темы (var(--color-bg)) с 94% непрозрачностью, а не хардкод белого.
     Белый фон на кремовых секциях давал «полосу» — визуально шапка "становилась короче" при скролле.
     color-mix: Chrome 111+, Safari 16.2+, FF 113+; fallback для старых браузеров — кремовый. */
  background-color: #f7f4eeF0;
  background-color: color-mix(in srgb, var(--color-bg, #f7f4ee) 94%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--color-border-subtle, #eae8e1);
  transition: background-color 0.3s ease, border-color 0.3s ease;
}

.header__inner {
  max-width: var(--container-max-width, 1240px);
  margin: 0 auto;
  padding: 18px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: clamp(16px, 2vw, 32px);
}

/* Брендинг / Логотип */
.header__brand {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  color: inherit;
  transition: opacity 0.25s ease;
}

.header__brand:hover {
  opacity: 0.85;
}

.header__brand:focus-visible {
  outline: 1px solid var(--color-accent, #8c6747);
  outline-offset: 4px;
}

.header__title {
  font-family: var(--font-display, 'Playfair Display', Georgia, serif);
  font-size: 19px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--color-text-primary, #1a1a18);
  line-height: 1.1;
  white-space: nowrap;
}

/* Навигация */
.header__nav {
  display: flex;
  align-items: center;
  gap: clamp(18px, 1.8vw, 28px);
}

.header__link {
  font-family: var(--font-ui, 'Inter', sans-serif);
  font-size: 13px;
  font-weight: 400;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-text-secondary, #3a3833);
  text-decoration: none;
  transition: color 0.25s ease;
  position: relative;
  padding: 4px 0;
  white-space: nowrap;
}

.header__link::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 1px;
  background-color: var(--color-text-primary, #1a1a18);
  transition: width 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.header__link:hover {
  color: var(--color-text-primary, #1a1a18);
}

.header__link:hover::after {
  width: 100%;
}

.header__nav-mobile-contacts {
  display: none;
}

/* Правая колонка шапки (контакты + быстрая связь) */
.header__actions {
  display: flex;
  align-items: center;
  gap: clamp(14px, 1.5vw, 20px);
  flex-shrink: 0;
}

.header__phone {
  font-family: var(--font-ui, 'Inter', sans-serif);
  font-size: 13px;
  font-weight: 400;
  letter-spacing: 0.04em;
  color: var(--color-text-secondary, #3a3833);
  text-decoration: none;
  transition: color 0.2s ease;
  white-space: nowrap;
}

.header__phone:hover {
  color: var(--color-text-primary, #1a1a18);
}

.header__mobile-call-btn {
  display: none;
}

.header__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 22px;
  font-family: var(--font-ui, 'Inter', sans-serif);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--color-text-primary, #1a1a18);
  background: transparent;
  border: 1px solid var(--color-text-primary, #1a1a18);
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.header__btn:hover {
  background-color: var(--color-text-primary, #1a1a18);
  color: var(--color-bg-primary, #fbfbf9);
}

/* Мобильный бургер (Apple HIG touch target ≥44px) */
.header__burger {
  display: none;
  background: none;
  border: none;
  width: 44px;
  height: 44px;
  padding: 10px;
  cursor: pointer;
  color: var(--color-text-primary, #1a1a18);
  align-items: center;
  justify-content: center;
}

/* ==========================================================================
   Адаптивность Header
   ========================================================================== */
@media (max-width: 960px) {
  .header__inner {
    padding: 14px 20px;
    gap: 16px;
  }
  
  .header__nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    box-sizing: border-box;
    /* 30.09: тот же фон, что и у шапки (color-mix от темы) — без белой полосы на креме */
    background-color: #f7f4ee;
    background-color: color-mix(in srgb, var(--color-bg, #f7f4ee) 98%, transparent);
    border-bottom: 1px solid var(--color-border-subtle, #eae8e1);
    flex-direction: column;
    align-items: flex-start;
    padding: 28px 24px;
    gap: 22px;
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.06);
  }

  .header__nav.is-open {
    display: flex;
  }

  .header__nav-mobile-contacts {
    display: flex;
    flex-direction: column;
    gap: 16px;
    width: 100%;
    margin-top: 16px;
    padding-top: 20px;
    border-top: 1px solid var(--color-border-subtle, #eae8e1);
  }

  .header__nav-mobile-phone {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 16px;
    font-weight: 500;
    color: var(--color-text-primary, #1a1a18);
    text-decoration: none;
    padding: 6px 0;
  }

  .header__nav-mobile-cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 14px 24px;
    font-family: var(--font-ui, 'Inter', sans-serif);
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    text-decoration: none;
    background-color: var(--color-text-primary, #1a1a18);
    color: var(--color-bg-primary, #fbfbf9);
    border: 1px solid var(--color-text-primary, #1a1a18);
    text-align: center;
    width: 100%;
    box-sizing: border-box;
    transition: all 0.3s ease;
  }

  .header__nav-mobile-cta:hover {
    background-color: transparent;
    color: var(--color-text-primary, #1a1a18);
  }

  .header__phone {
    display: none;
  }

  .header__btn {
    display: none;
  }

  .header__mobile-call-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1px solid var(--color-border-subtle, #eae8e1);
    color: var(--color-text-primary, #1a1a18);
    text-decoration: none;
    background: transparent;
    transition: background 0.2s ease, border-color 0.2s ease;
  }

  .header__mobile-call-btn:hover {
    background-color: #f2f0eb;
    border-color: var(--color-text-primary, #1a1a18);
  }

  .header__burger {
    display: inline-flex;
  }
}

@media (max-width: 480px) {
  .header__title {
    font-size: 16px;
    letter-spacing: 0.12em;
  }
}
