/* layout.css — header (логотип слева, гамбургер СПРАВА, drawer справа) + footer */

/* ─────────── HEADER ─────────── */
.site-header {
  position: sticky; top: 0; z-index: 100;
  height: var(--header-h);
  background: var(--paper);
  border-bottom: var(--hairline);
  transition: background var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease), border-color var(--dur-fast);
}
.site-header.scrolled { box-shadow: var(--shadow-sm); }

/* overlay-режим (поверх navy-hero на Главной, пока не проскроллено) */
.site-header.header--overlay:not(.scrolled) {
  position: fixed; left: 0; right: 0;
  background: transparent; border-bottom-color: transparent;
}
.site-header.header--overlay:not(.scrolled) .nav-link,
.site-header.header--overlay:not(.scrolled) .logo-text,
.site-header.header--overlay:not(.scrolled) .icon-btn { color: var(--on-navy); }
.site-header.header--overlay:not(.scrolled) .burger span { background: var(--on-navy); }

.header-inner {
  height: 100%; max-width: var(--container); margin-inline: auto;
  padding-inline: var(--s-5);
  display: flex; align-items: center; justify-content: space-between; gap: var(--s-5);
}
.brand { display: flex; align-items: center; gap: var(--s-3); flex-shrink: 0; }
.brand img { height: 58px; width: auto; }
.logo-text { font-family: var(--font-display); font-weight: 700; font-size: 1.05rem; color: var(--navy-ink); line-height: 1.1; max-width: 16ch; }

/* десктоп-меню */
.primary-nav { display: flex; align-items: center; gap: clamp(.55rem, 1.25vw, 1.4rem); flex-wrap: nowrap; }
.nav-link {
  position: relative; font-size: .92rem; font-weight: 600; color: var(--text);
  padding-block: var(--s-2); transition: color var(--dur-fast); white-space: nowrap;
}
.nav-link::after {
  content: ""; position: absolute; left: 0; bottom: 2px; height: 2px; width: 100%;
  background: var(--gold); transform: scaleX(0); transform-origin: left; transition: transform var(--dur-fast) var(--ease);
}
.nav-link:hover, .nav-link[aria-current="page"] { color: var(--navy); }
.nav-link:hover::after, .nav-link[aria-current="page"]::after { transform: scaleX(1); }
[data-theme="dark"] .nav-link:hover, [data-theme="dark"] .nav-link[aria-current="page"] { color: var(--text); }

.header-actions { display: flex; align-items: center; gap: var(--s-3); }
/* Кнопка «позвонить» в хедере */
.header-phone { display: inline-flex; align-items: center; gap: var(--s-2); font-weight: 700; font-size: .95rem; color: var(--navy); padding: .5rem 1rem; border: 1.5px solid var(--gold-line); border-radius: var(--r-pill); transition: background var(--dur-fast), border-color var(--dur-fast), color var(--dur-fast); white-space: nowrap; }
.header-phone:hover { background: var(--gold-soft); border-color: var(--gold); color: var(--gold); }
.header-phone__icon { color: var(--gold); }
.site-header.header--overlay:not(.scrolled) .header-phone { color: var(--on-navy); border-color: rgba(255,255,255,.45); }
@media (max-width: 560px) { .header-phone__num { display: none; } .header-phone { padding: .5rem .6rem; } }
.icon-btn {
  width: 40px; height: 40px; display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--line); border-radius: var(--r-pill); background: transparent; color: var(--text);
  cursor: pointer; transition: border-color var(--dur-fast), color var(--dur-fast), background var(--dur-fast);
}
.icon-btn:hover { border-color: var(--gold); color: var(--gold); }

/* гамбургер — СПРАВА */
.burger {
  display: none; width: 44px; height: 44px; flex-direction: column; justify-content: center; gap: 5px;
  border: none; background: transparent; cursor: pointer; padding: 10px; border-radius: var(--r-sm);
}
.burger span { display: block; height: 2px; width: 100%; background: var(--navy-ink); border-radius: 2px; transition: transform var(--dur-fast) var(--ease), opacity var(--dur-fast); }
.burger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.burger.open span:nth-child(2) { opacity: 0; }
.burger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ─────────── MOBILE DRAWER (справа) ─────────── */
.nav-overlay {
  position: fixed; inset: 0; background: rgba(6, 20, 120, .35); backdrop-filter: blur(2px);
  opacity: 0; visibility: hidden; transition: opacity var(--dur-fast); z-index: 110;
}
.nav-overlay.open { opacity: 1; visibility: visible; }
.drawer {
  position: fixed; top: 0; right: 0; height: 100dvh; width: min(86vw, 340px);
  background: var(--paper); z-index: 120; box-shadow: var(--shadow-lg);
  transform: translateX(100%); transition: transform var(--dur) var(--ease-out);
  display: flex; flex-direction: column; padding: var(--s-5);
}
.drawer.open { transform: none; }
.drawer-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: var(--s-5); padding-bottom: var(--s-4); border-bottom: var(--hairline); }
.drawer-head .brand img { height: 38px; }
.drawer-close { font-size: 1.4rem; background: none; border: none; cursor: pointer; color: var(--muted); width: 40px; height: 40px; }
.drawer-nav { display: flex; flex-direction: column; gap: 2px; }
.drawer-nav a {
  font-family: var(--font-display); font-size: 1.15rem; font-weight: 700; color: var(--navy-ink);
  padding: var(--s-3) var(--s-2); border-radius: var(--r-sm); border-bottom: 1px solid var(--line);
  transition: color var(--dur-fast), padding-left var(--dur-fast);
}
[data-theme="dark"] .drawer-nav a { color: var(--text); }
.drawer-nav a:hover, .drawer-nav a[aria-current="page"] { color: var(--gold); padding-left: var(--s-4); }
.drawer-foot { margin-top: auto; padding-top: var(--s-5); border-top: var(--hairline); color: var(--muted); font-size: var(--t-sm); }
.drawer-foot a { color: var(--navy); font-weight: 600; }

/* ─────────── FOOTER ─────────── */
.site-footer { background: var(--navy); color: var(--on-navy); padding-block: var(--s-8) var(--s-6); margin-top: var(--s-9); position: relative; }
.site-footer::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 3px; background: linear-gradient(90deg, var(--gold), transparent 70%); }
.footer-grid { display: grid; grid-template-columns: 1.6fr repeat(2, 1fr) 1.4fr; gap: var(--s-6); }
/* Лого не PNG (белый фон) → сажаем на белую плашку с тонкой золотой обводкой, чтобы не было «бледного пятна» на тёмном футере */
.footer-brand img { display: inline-block; height: 44px; width: auto; margin-bottom: var(--s-4); background: #fff; padding: 9px 14px; border-radius: 12px; border: 1px solid var(--gold-line); box-shadow: 0 6px 18px -8px rgba(0,0,0,.5); }
.footer-about { color: var(--on-navy-muted); font-size: var(--t-sm); line-height: 1.6; max-width: 38ch; }
.footer-col h4 { color: var(--gold); font-family: var(--font-sans); font-size: var(--t-xs); letter-spacing: .16em; text-transform: uppercase; margin-bottom: var(--s-4); font-weight: 700; }
.footer-col a, .footer-contacts span { display: block; color: var(--on-navy-muted); font-size: var(--t-sm); padding-block: 5px; transition: color var(--dur-fast); }
.footer-col a:hover { color: var(--gold); }
.footer-contacts a { color: var(--on-navy-muted); }
.footer-bottom { margin-top: var(--s-7); padding-top: var(--s-5); border-top: 1px solid rgba(255,255,255,.12); display: flex; flex-wrap: wrap; gap: var(--s-3); justify-content: space-between; color: var(--on-navy-muted); font-size: var(--t-sm); }

/* ─────────── адаптив ─────────── */
/* до 1080px прячем горизонтальное меню в бургер — чтобы пункты не переносились на 2 строки */
@media (max-width: 1080px) {
  .primary-nav { display: none; }
  .burger { display: flex; }
}
@media (max-width: 980px) {
  .footer-grid { grid-template-columns: 1fr 1fr; gap: var(--s-6); }
  .footer-brand { grid-column: 1 / -1; }
}
@media (max-width: 560px) {
  .footer-grid { grid-template-columns: 1fr; }
  .logo-text { display: none; }
}
