/* Shared site header — главная, benefits, portal pages */
:root {
  --site-header-h: 72px;
  --chrome-bg: #fafafa;
  --chrome-surface-2: #f5f5f5;
  --chrome-border: #e5e5e5;
  --chrome-text: #0a0a0a;
  --chrome-muted: #737373;
  --chrome-container: 1180px;
  --chrome-radius-full: 999px;
  --chrome-text-sm: clamp(0.875rem, 0.8rem + 0.35vw, 1rem);
  --chrome-font: 'Inter', system-ui, sans-serif;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(250, 250, 250, .88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--chrome-border);
  font-family: var(--chrome-font);
}

.site-header .container {
  width: min(var(--chrome-container), calc(100% - 40px));
  margin: 0 auto;
}

.site-header .header-row {
  min-height: var(--site-header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: nowrap;
}

.site-header .brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex-shrink: 1;
  text-decoration: none;
  color: inherit;
}

.site-header .brand-mark {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: #fff;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  overflow: hidden;
  border: 1px solid var(--chrome-border);
  padding: 5px;
  box-sizing: border-box;
}

.site-header .brand-mark img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.site-header .brand-title {
  display: block;
  font-size: var(--chrome-text-sm);
  color: var(--chrome-text);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -.02em;
}

.site-header .brand-text span {
  display: block;
  font-size: 11px;
  color: var(--chrome-muted);
  line-height: 1.15;
  margin-top: 3px;
}

.site-header .header-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
  min-width: 0;
  flex: 1 1 auto;
  justify-content: flex-end;
}

.site-header .nav-wrap {
  display: flex;
  gap: 0;
  flex-wrap: nowrap;
  white-space: nowrap;
  flex: 1 1 auto;
  min-width: 0;
}

.site-header .nav-link,
.site-header .theme-pill {
  min-height: 40px;
  padding: 0 7px;
  border-radius: var(--chrome-radius-full);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: var(--chrome-text-sm);
  font-weight: 500;
  transition: .18s ease;
  border: none;
  white-space: nowrap;
  flex: 0 0 auto;
  line-height: 1.2;
  letter-spacing: -.01em;
  text-decoration: none;
}

.site-header .nav-link[href="cabinet.html"] {
  padding-right: 8px;
  flex-shrink: 0;
}

.site-header .nav-link {
  background: transparent;
  color: var(--chrome-muted);
}

.site-header .nav-link:hover,
.site-header .nav-link.is-active {
  color: var(--chrome-text);
  background: var(--chrome-surface-2);
}

.site-header .nav-link.is-active {
  font-weight: 600;
}

.site-header .theme-pill {
  background: var(--chrome-text);
  color: #fff;
  font-weight: 600;
  flex-shrink: 0;
  padding: 0 12px;
  letter-spacing: normal;
  gap: 0.35em;
}

.site-header .theme-pill:hover {
  background: #262626;
  transform: translateY(-1px);
}

/* Portal page: header + sidebar shell */
body.portal-page {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

body.portal-page .shell {
  flex: 1;
  min-height: 0;
}

body.portal-page .sidebar {
  top: var(--site-header-h);
  height: calc(100vh - var(--site-header-h));
}

@media (max-width: 1180px) {
  .site-header .brand-text span { display: none; }
  .site-header .theme-pill-extra { display: none; }
  .site-header .nav-link[href="index.html"],
  .site-header .nav-link[href="index.html#top"],
  .site-header .nav-link[href="index.html#interests"] { display: none; }
}

@media (max-width: 960px) {
  .site-header .nav-link[href="portal-kasko-journey.html"],
  .site-header .nav-link[href="portal-solutions-presentation.html"] { display: none; }
}

@media (max-width: 840px) {
  .site-header .brand-text { max-width: 140px; }
  .site-header .brand-title { font-size: 12px; line-height: 1.15; }
}

@media (max-width: 720px) {
  :root { --site-header-h: 64px; }
  .site-header .container { width: min(var(--chrome-container), calc(100% - 24px)); }
}

/* ===== Мобильное бургер-меню (добавлено) ===== */
.site-header .nav-burger {
  display: none;
  flex: 0 0 auto;
  width: 42px; height: 38px;
  border: 1px solid var(--border, #e5e5e5);
  background: var(--surface-2, #f2f2f2);
  border-radius: 999px;
  cursor: pointer; padding: 0;
  align-items: center; justify-content: center;
  flex-direction: column; gap: 4px;
}
.site-header .nav-burger span {
  display: block; width: 18px; height: 2px;
  background: var(--text, #171717); border-radius: 2px; transition: .2s ease;
}
.site-header .nav-burger[aria-expanded="true"] span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.site-header .nav-burger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.site-header .nav-burger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

@media (max-width: 960px) {
  .site-header .nav-burger { display: inline-flex; order: 3; }
  .site-header .theme-pill { order: 2; }
  .site-header .header-row { position: relative; }
  .site-header .nav-wrap {
    position: absolute; top: 100%; left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 2px;
    background: rgba(250,250,250,.98);
    -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border, #e5e5e5);
    box-shadow: 0 12px 24px rgba(0,0,0,.08);
    padding: 8px 16px 14px;
    max-height: 0; overflow: hidden; opacity: 0; pointer-events: none;
    transition: max-height .28s ease, opacity .2s ease;
  }
  .site-header .nav-wrap.open {
    max-height: 70vh; opacity: 1; pointer-events: auto; overflow-y: auto;
  }
  .site-header .nav-link {
    display: flex !important; justify-content: flex-start;
    min-height: 46px; padding: 0 10px; width: 100%;
    font-size: 15px; color: var(--text, #171717); border-radius: 10px;
  }
  .site-header .nav-link:hover { background: var(--surface-2, #f0f0f0); }
}
