:root {
  --mobile-header-height: 68px;
  --safe-area-top: env(safe-area-inset-top, 0px);

  /* размеры логотипа */
  --logo-h-desktop: 56px;
  --logo-h-mobile: 34px;

  /* цвета */
  --brand-title: #0f172a;
  --brand-subtitle: #6b7280;
  --brand-link: #111827;
}

/* Общая обёртка шапки */
header.main-header {
  position: relative;
  z-index: 1000;
  width: 100%;
}

/* ===== Desktop header ===== */
.main-header__container {
  max-width: 1200px;
  margin: 5px auto;
  padding: 0 24px;
  min-height: 64px;

  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.main-header__logo--desktop,
.main-header__profile--desktop,
.main-header__nav--desktop {
  display: flex;
  align-items: center;
}

/* Логотип + Тексты */
.main-header__brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: inherit;
  min-width: 0;
}

/* Логотип без круга и фона */
.main-header__brand-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;

  background: transparent;
  border: none;
  box-shadow: none;
  border-radius: 0;
  padding: 0;
  margin: 0;
  overflow: visible;
  flex: 0 0 auto;
}

.main-header__logo-img {
  height: var(--logo-h-desktop);
  width: auto;
  display: block;
  object-fit: contain;
  max-width: 100%;
  user-select: none;
}

.main-header__brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.08;
  min-width: 0;
}

.main-header__brand-title {
  font-weight: 600; /* меньше жирности */
  font-size: 16px;
  letter-spacing: -0.012em;
  color: var(--brand-title);
  padding-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 34ch;
}

.main-header__brand-subtitle {
  margin-top: 2px;
  font-size: 11px;
  font-weight: 450;
  letter-spacing: 0.01em;
  color: var(--brand-subtitle);

  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 34ch;
}

/* Навигация */
.main-header__menu-list {
  display: flex;
  gap: 2rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.main-header__menu-link {
  text-decoration: none;
  color: var(--brand-link);
  font-size: 1rem;
  font-weight: 400;
  padding: 4px 0;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  transition: opacity 0.16s ease;
}

@media (hover: hover) {
  .main-header__menu-link:hover {
    opacity: 0.72;
  }
}

/* Профиль */
.main-header__profile-link {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: var(--brand-link);
  font-size: 1rem;
  transition: opacity 0.16s ease;
}

@media (hover: hover) {
  .main-header__profile-link:hover {
    opacity: 0.72;
  }
}

.main-header__profile-link i {
  font-size: 1.1rem;
  line-height: 1;
}

/* ===== Mobile header ===== */
.brandbar--mobile {
  display: none;
}

/* Мобильная версия */
@media (max-width: 1024px) {
  .main-header__container {
    display: none;
  }

  header.main-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 2000;
  }

  body {
    padding-top: calc(var(--mobile-header-height) + var(--safe-area-top));
  }

  .brandbar--mobile {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 16px 10px;
    box-sizing: border-box;
    height: var(--mobile-header-height);

    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
  }

  .brandbar--mobile .logo {
    display: inline-flex;
    gap: 12px;
    align-items: center;
    text-decoration: none;
    color: #0f1220;
    min-width: 0;
  }

  .brandbar--mobile .app-logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    background: transparent;
    border: 0;
    box-shadow: none;
    border-radius: 0;
    padding: 0;
    margin: 0;
    overflow: visible;
    flex: 0 0 auto;
  }

  .brandbar--mobile .app-logo img {
    height: var(--logo-h-mobile);
    width: auto;
    display: block;
    object-fit: contain;

    background: transparent;
    border-radius: 0;
    box-shadow: none;
  }

  .brandbar--mobile .logo-text {
    display: flex;
    flex-direction: column;
    line-height: 1.08;
    min-width: 0;
  }

  .brandbar--mobile .logo-title {
    font-weight: 600;
    font-size: 14px;
    letter-spacing: -0.012em;
    color: var(--brand-title);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 24ch;
    padding-bottom: 1px;
  }

  .brandbar--mobile .logo-subtitle {
    margin-top: 2px;
    font-size: 11px;
    font-weight: 450;
    letter-spacing: 0.01em;
    color: var(--brand-subtitle);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 24ch;
  }

  .wb-profile {
    height: 40px;
    width: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: rgba(243, 244, 247, 0.9);
    border: 1px solid rgba(13, 16, 40, 0.08);
    color: #0f1220;
    text-decoration: none;
  }

  .wb-profile i {
    font-size: 18px;
    line-height: 1;
  }
}

@media (max-width: 480px) {
  .main-header__menu-link {
    font-size: 0.95rem;
  }
}
@media (max-width: 1024px) {
  /* ... тут уже есть brandbar--mobile и прочее ... */

  .wb-back,
  .wb-profile {
    height: 40px;
    width: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: rgba(243, 244, 247, 0.9);
    border: 1px solid rgba(13, 16, 40, 0.08);
    color: #0f1220;
    text-decoration: none;
    cursor: pointer;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
  }

  .wb-back i,
  .wb-profile i {
    font-size: 18px;
    line-height: 1;
  }
}
/* ===== GLASS ICON BUTTONS: back / profile / bell ===== */
@media (max-width: 1024px) {
  .wb-back,
  .wb-profile,
  .wb-bell {
    height: 40px;
    width: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;

    border-radius: 12px;
    padding: 0;
    text-decoration: none;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;

    /* стеклянный фон */
    background: rgba(255, 255, 255, 0.78);
    border: 1px solid rgba(255, 255, 255, 0.92);

    /* единая стеклянная тень */
    box-shadow: var(--shadow-glass, 0 8px 24px rgba(31, 38, 135, 0.15));

    /* лёгкое стекло */
    backdrop-filter: blur(12px) saturate(150%);
    -webkit-backdrop-filter: blur(12px) saturate(150%);

    color: #0f1220;
  }

  .wb-back i,
  .wb-profile i,
  .wb-bell i {
    font-size: 18px;
    line-height: 1;
  }

  .wb-back:active,
  .wb-profile:active,
  .wb-bell:active {
    transform: scale(0.97);
    box-shadow: var(--shadow-ink-sm, 0 6px 18px rgba(0, 0, 0, 0.08));
  }
}
