header {
    width: 100%;
    background: var(--color-dark);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    position: sticky;
    top: 0;
    z-index: 50;
}

.header__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 72px;
}

.header__logo {
    font-size: 22px;
    font-weight: 700;
    color: white;
}

.header-nav ul {
    display: flex;
    gap: 28px;
}

.header-nav a {
    font-size: 15px;
    font-weight: 500;
    color: #e5e7eb;
    transition: var(--transition-fast);
}

.header-nav a:hover {
    color: white;
}

.mobile-toggle {
    display: none;
    width: 40px;
    height: 40px;
    padding: 0;
    border: 0;
    background: transparent;
    color: white;
    cursor: pointer;
    align-items: center;
    justify-content: center;
}

.mobile-toggle__icon {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.mobile-toggle__line {
    display: block;
    width: 18px;
    height: 2px;
    border-radius: 999px;
    background: currentColor;
}

.header-mobile-cart {
    display: none;
    position: relative;
    width: 40px;
    height: 40px;
    padding: 0;
    align-items: center;
    justify-content: center;
    color: white;
}

.header-mobile-cart__icon {
    width: 22px;
    height: 22px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

@media (max-width: 768px) {
    .header-nav {
        display: none;
    }
    .header-mobile-cart {
        display: inline-flex;
        margin-left: auto;
        position: relative;
        z-index: 2;
    }
    .mobile-toggle {
        display: inline-flex;
        margin-left: 8px;
        position: relative;
        z-index: 2;
    }

}

.header__logo-image {
    height: 20px;      /* подгони под свой логотип */
    display: block;
}

/* форма не ломает навигацию */
.nav-logout-form {
  margin: 0;
}

/* кнопка = ссылка */
.nav-logout-btn {
  background: none;
  border: none;
  padding: 0;
  margin: 0;

  font: inherit;
  color: inherit;
  cursor: pointer;
}

/* если у меню есть общий класс */
nav a,
.nav-logout-btn {
  color: #fff;
  text-decoration: none;
  font-weight: 500;
  padding: 8px 12px;
  transition: color 0.2s ease;
}

nav a:hover,
.nav-logout-btn:hover {
  color: var(--theme-link, #4da3ff); /* или твой hover-цвет */
}

/* список */
.nav-list {
  display: flex;
  align-items: center;
  gap: 24px;
  list-style: none;
  margin: 0;
  padding: 0;
}

/* ОБЩИЙ стиль пункта меню */
.nav-item {
  background: none;
  border: none;
  padding: 8px 0;

  font: inherit;
  color: #ffffff;
  text-decoration: none;
  cursor: pointer;

  position: relative;
}

/* hover — одинаковый для всех */
.nav-item:hover {
  color: #ffffff;
}

/* УБИРАЕМ браузерные эффекты кнопки */
.nav-item--button {
  outline: none;
}

.nav-item--button:focus,
.nav-item--button:focus-visible {
  outline: none;
  box-shadow: none;
}

/* Обёртка корзины с бейджем */
.cart-nav-item {
  position: relative;
}

.cart-badge {
  position: absolute;
  top: -10px;
  right: -20px;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  background: #ef4444;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
  border-radius: 9px;
  pointer-events: none;
}

.header-mobile-cart__badge {
  top: -4px;
  right: -4px;
}

/* Один переключатель остаётся в шапке во всех режимах открытия сайта. */
.theme-toggle {
    display: inline-flex;
    flex: 0 0 44px;
    width: 44px;
    height: 44px;
    align-items: center;
    justify-content: center;
    margin-left: 16px;
    padding: 0;
    border: 1px solid transparent;
    border-radius: 50%;
    background: transparent;
    color: #ffffff;
    cursor: pointer;
    transition: background-color var(--transition-fast);
}
.theme-toggle[hidden] { display: none; }
.theme-toggle:hover { background: rgba(255, 255, 255, 0.1); }
.theme-toggle:focus-visible,
.header-mobile-cart:focus-visible,
.mobile-toggle:focus-visible {
    outline: 2px solid var(--theme-focus, #ffffff);
    outline-offset: 2px;
}
.theme-toggle__icon {
    width: 22px;
    height: 22px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.theme-toggle__icon--sun { display: none; }
:root[data-theme="dark"] .theme-toggle__icon--moon { display: none; }
:root[data-theme="dark"] .theme-toggle__icon--sun { display: block; }

/* В MAX верхнее пространство уже выделено native viewport. */
html.is-telegram-browser body > header { padding-top: var(--content-top); }
html.is-embedded-webapp .container {
    padding-left: calc(16px + var(--content-left));
    padding-right: calc(16px + var(--content-right));
}
html.is-embedded-webapp body { padding-bottom: var(--content-bottom); }
html.is-embedded-webapp .mobile-menu {
    padding-top: calc(18px + var(--content-top));
    padding-right: calc(18px + var(--content-right));
    padding-bottom: calc(18px + var(--content-bottom));
}

@media (min-width: 769px) and (max-width: 1023px) {
    .header__logo-image { max-width: 96px; height: auto; }
    .header-nav ul { gap: 12px; }
    .header-nav a, .header-nav .nav-item { font-size: 14px; padding: 8px 0; white-space: nowrap; }
    .theme-toggle { margin-left: 12px; }
}
