/* ============================================================
   header.css — шапка и навигация ГК Такт
   ============================================================ */

/* ── Preloader ──────────────────────────────────────────────── */
#preloader {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: var(--c-bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  transition: opacity .6s ease, visibility .6s ease;
}

#preloader.fade-out {
  opacity: 0;
  visibility: hidden;
}

.preloader__logo {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 800;
  color: var(--c-ink);
  letter-spacing: -0.02em;
  animation: preloaderPulse 1.4s ease-in-out infinite;
}

.preloader__logo span { color: var(--c-accent); }

.preloader__bar {
  width: 120px;
  height: 3px;
  background: var(--c-border);
  border-radius: 2px;
  overflow: hidden;
}

.preloader__bar::after {
  content: '';
  display: block;
  height: 100%;
  width: 40%;
  background: linear-gradient(90deg, var(--c-accent), var(--c-gold));
  border-radius: 2px;
  animation: preloaderSlide 1.2s ease-in-out infinite;
}

@keyframes preloaderPulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.5; }
}

@keyframes preloaderSlide {
  0%   { transform: translateX(-150%); }
  100% { transform: translateX(350%); }
}

/* ── Шапка ──────────────────────────────────────────────────── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(251, 247, 242, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--c-border);
  transition: box-shadow var(--tr);
}

.site-header.scrolled {
  box-shadow: var(--shadow-md);
}

.header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  height: 68px;
}

/* ── Логотип ────────────────────────────────────────────────── */
.header__logo {
  flex-shrink: 0;
  text-decoration: none;
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.logo__brand {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--c-ink);
  letter-spacing: -0.03em;
  line-height: 1;
}

.logo__brand span { color: var(--c-accent); }

.logo__sub {
  font-family: var(--font-body);
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--c-ink-soft);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  line-height: 1;
}

/* ── Навигация ──────────────────────────────────────────────── */
.header__nav {
  flex: 1;
}

.nav__list {
  display: flex;
  align-items: center;
  gap: 4px;
  list-style: none;
  padding: 0;
  margin: 0;
}

.nav__item { position: relative; }

.nav__link {
  display: block;
  padding: 8px 14px;
  border-radius: var(--r-sm);
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--c-ink);
  text-decoration: none;
  transition: background var(--tr-fast), color var(--tr-fast);
  white-space: nowrap;
}

.nav__link:hover,
.nav__link.active {
  color: var(--c-accent);
  background: rgba(224, 122, 43, 0.08);
}

/* Выпадающее меню каталога */
.nav__item--dropdown:hover .nav__dropdown { display: block; }

.nav__dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 1px);
  left: 0;
  min-width: 220px;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-lg);
  padding: 8px;
  animation: dropIn .2s ease;
}

@keyframes dropIn {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.nav__dropdown a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: var(--r-sm);
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--c-ink);
  text-decoration: none;
  transition: background var(--tr-fast), color var(--tr-fast);
}

.nav__dropdown a:hover {
  background: var(--c-bg-alt);
  color: var(--c-accent);
}

.nav__dropdown a i {
  width: 18px;
  text-align: center;
  color: var(--c-accent);
  font-size: 0.85rem;
}

/* ── Контакты в шапке ───────────────────────────────────────── */
.header__contacts {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 16px;
}

.header__phone {
  display: flex;
  flex-direction: column;
  text-align: right;
}

.header__phone a {
  font-family: var(--font-mono);
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--c-ink);
  text-decoration: none;
  transition: color var(--tr-fast);
  line-height: 1.4;
}

.header__phone a:hover { color: var(--c-accent); }

.header__phone small {
  font-size: 0.72rem;
  color: var(--c-ink-soft);
}

.header__cta {
  /* Кнопка «Заявка» */
}

/* ── Бургер (мобильный) ─────────────────────────────────────── */
.burger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  border-radius: var(--r-sm);
  transition: background var(--tr-fast);
}

.burger:hover { background: var(--c-bg-alt); }

.burger__line {
  display: block;
  height: 2px;
  background: var(--c-ink);
  border-radius: 2px;
  transition: transform var(--tr), opacity var(--tr), width var(--tr-fast);
}

.burger__line:nth-child(2) { width: 70%; }

.burger.open .burger__line:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.burger.open .burger__line:nth-child(2) { opacity: 0; width: 100%; }
.burger.open .burger__line:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ── Мобильное меню ─────────────────────────────────────────── */
.mobile-menu {
  display: none;
  position: fixed;
  top: 68px;
  left: 0; right: 0; bottom: 0;
  background: var(--c-bg);
  z-index: 999;
  overflow-y: auto;
  padding: 24px 20px;
  transform: translateX(-100%);
  transition: transform .35s cubic-bezier(.4,0,.2,1);
}

.mobile-menu.open {
  display: block;
  transform: translateX(0);
}

.mobile-menu__nav { list-style: none; padding: 0; margin: 0 0 24px; }

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

.mobile-menu__nav a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 0;
  font-size: 1rem;
  font-weight: 600;
  color: var(--c-ink);
  text-decoration: none;
  transition: color var(--tr-fast);
}

.mobile-menu__nav a:hover { color: var(--c-accent); }

.mobile-menu__nav a i {
  width: 20px;
  text-align: center;
  color: var(--c-accent);
}

.mobile-menu__contacts {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-top: 24px;
}

.mobile-menu__contacts a.phone-link {
  font-family: var(--font-mono);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--c-ink);
}
