/* Шапка сайта — общая для главной и остальных страниц (src/components/Header.astro, подключает Base.astro).
   Решение 2026-10-21: при переходе между страницами шапка не должна сдвигаться или менять цвет.
   Единица --u и цвета задают стили страницы (styles.css, product.css). */
.icon-btn { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; }
.icon-btn:hover { background: rgba(255, 255, 255, .45); }

.topbar {
  position: absolute; inset: 0 0 auto 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between;
  height: calc(84 * var(--u)); min-height: 64px;
  padding: 0 calc(48 * var(--u)) 0 calc(63 * var(--u));
  transition: background .25s ease, box-shadow .25s ease;
}
/* Страницы без сцены: ниже первого экрана под шапку уходит текст — подложка, как у шапки на телефоне (product.js) */
.topbar.scrolled { background: rgba(239, 238, 229, .88); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); box-shadow: 0 1px 0 rgba(22, 22, 22, .1); }
.logo { font-family: var(--serif); font-weight: 500; font-size: max(22px, calc(29 * var(--u))); letter-spacing: -.01em; white-space: nowrap; }
.nav { display: flex; gap: calc(37 * var(--u)); font-size: max(13px, calc(14 * var(--u))); margin-left: calc(80 * var(--u)); margin-right: auto; }
.nav a { position: relative; padding: 6px 0; }
.nav a::after { content: ""; position: absolute; left: 0; right: 100%; bottom: 0; height: 1px; background: var(--coral); transition: right .25s; }
.nav a:hover::after { right: 0; }
.nav-drop { position: relative; }
.nav-link { display: inline-flex; align-items: center; gap: 6px; padding: 6px 0; font: inherit; color: inherit; }
.nav-link .caret { width: 6px; height: 6px; border-right: 1.3px solid currentColor; border-bottom: 1.3px solid currentColor; transform: translateY(-2px) rotate(45deg); transition: transform .2s; }
.nav-link[aria-expanded="true"] .caret { transform: translateY(1px) rotate(-135deg); }
.nav-menu {
  position: absolute; left: -14px; top: calc(100% + 10px); z-index: 30; min-width: 250px; padding: 6px;
  display: grid; background: #fff; border-radius: 12px; box-shadow: 0 20px 40px -15px rgba(0, 0, 0, .25);
}
.nav-menu[hidden] { display: none; }
/* пункты отраслей: на главной — кнопки (app.js), на остальных страницах — ссылки на главную */
.nav-menu button, .nav .nav-menu a { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; padding: 9px 12px; border-radius: 8px; font-size: 14px; }
.nav .nav-menu a::after { display: none; }
.nav-menu button:hover, .nav-menu button:focus-visible, .nav-menu a:hover, .nav-menu a:focus-visible { background: var(--surface); }
.nav-menu svg { flex: none; width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linejoin: round; stroke-linecap: round; color: var(--ink-2); }
.actions { display: flex; align-items: center; gap: calc(22 * var(--u)); }
.lang { position: relative; color: var(--ink-2); }
.lang-menu {
  position: absolute; right: 0; top: 46px; min-width: 150px; padding: 6px;
  background: #fff; border-radius: 12px; box-shadow: 0 20px 40px -15px rgba(0, 0, 0, .25);
}
.lang-menu > * { display: block; width: 100%; text-align: left; padding: 9px 12px; border-radius: 8px; font-size: 14px; }
.lang-menu > :hover { background: var(--surface); }
.lang-menu a { color: inherit; text-decoration: none; }
.lang-menu [aria-checked="true"] { color: var(--coral-ink); font-weight: 600; }
.burger { display: none; }

@media (min-width: 861px) {
  /* на широких экранах шапка закреплена: на главной поверх прокрутки-истории */
  .topbar { position: fixed; }
}
@media (max-width: 1100px) {
  .nav { gap: 22px; margin-left: 32px; }
}
@media (max-width: 860px) {
  .topbar { position: sticky; top: 0; height: 64px; padding: 0 16px; background: rgba(239, 238, 229, .88); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
  .logo { font-size: 22px; }
  .actions { gap: 4px; }
  .login, .lang { display: none; }
  .actions .btn-sm { height: 38px; padding: 0 14px; font-size: 13px; }
  .actions .btn-sm .arrow { display: none; }
  .burger { display: inline-grid; align-content: center; gap: 6px; }
  .burger span { display: block; width: 20px; height: 1.5px; background: var(--ink); transition: transform .25s; }
  .burger[aria-expanded="true"] span:first-child { transform: translateY(3.75px) rotate(45deg); }
  .burger[aria-expanded="true"] span:last-child { transform: translateY(-3.75px) rotate(-45deg); }
  .nav {
    position: absolute; left: 0; right: 0; top: 64px; margin: 0;
    flex-direction: column; gap: 0; padding: 8px 16px 18px;
    background: rgba(239, 238, 229, .97); font-size: 17px;
    border-bottom: 1px solid rgba(0, 0, 0, .06);
    opacity: 0; visibility: hidden; transform: translateY(-8px); transition: .25s ease;
  }
  .nav.open { opacity: 1; visibility: visible; transform: none; }
  .nav a { padding: 12px 0; border-bottom: 1px solid rgba(0, 0, 0, .06); }
  .nav a::after { display: none; }
  .nav-link { width: 100%; justify-content: space-between; padding: 12px 0; border-bottom: 1px solid rgba(0, 0, 0, .06); }
  .nav-menu { position: static; min-width: 0; padding: 4px 0 8px; box-shadow: none; background: none; border-radius: 0; }
  .nav-menu button, .nav .nav-menu a { padding: 10px 4px; font-size: 16px; border-bottom: 0; }
  /* «Продукт» на телефоне — список на месте, без подложки и подъёма */
  .prod-menu { width: auto; padding: 0 0 8px; }
  .prod-list { padding: 0; background: none; border-radius: 0; }
  .nav .prod-menu .prod-row { padding: 9px 0 9px 4px; }
  .nav .prod-menu .prod-row:hover, .nav .prod-menu .prod-row:focus-visible { background: none; box-shadow: none; }
  .prod-arr { display: none; }
  .prod-sep { margin: 6px 0 6px 38px; }
  .prod-plat { padding: 8px 0 4px 38px; flex-direction: column; gap: 8px; }
  .nav .prod-menu .prod-plat a { font-size: 15px; }
}

/* ---------- Footer (every page) ---------- */
.footer { display: flex; align-items: center; gap: 28px; flex-wrap: wrap; padding: 34px clamp(16px, 4.1vw, 63px); border-top: 1px solid rgba(22, 22, 22, .12); font-size: 14px; color: var(--ink-2); }
.footer .logo { font-size: 22px; color: var(--ink); }
.footer-links { display: flex; gap: 8px 24px; flex-wrap: wrap; margin-right: auto; }
.footer-links a:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
.footer-copy { color: var(--muted); }
