.header {
  position: sticky;
  top: 0;
  z-index: 80;
  background: var(--color-bg-header);
  color: var(--color-text-primary);
  border-bottom: 1px solid var(--color-border);
}

.header--scrolled {
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.header__promo {
  height: 36px;
  display: flex;
  align-items: center;
  background: linear-gradient(
    90deg,
    rgba(255, 128, 0, 0.26),
    rgba(255, 128, 0, 0.05) 55%,
    rgba(255, 128, 0, 0.14)
  );
  border-bottom: 1px solid rgba(234, 88, 12, 0.15);
}

.header__promoInner {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
}

.header__promoText {
  flex: 1;
  min-width: 0;
  font-size: var(--text-xs);
  font-weight: var(--font-weight-bold);
  letter-spacing: 0.01em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.header__promoHint {
  font-weight: var(--font-weight-regular);
  color: var(--color-text-muted);
  margin-left: 6px;
}

.header__promoLink {
  font-size: var(--text-xs);
  font-weight: var(--font-weight-bold);
  letter-spacing: 0.01em;
  color: var(--color-text-primary);
  text-decoration: none;
  white-space: nowrap;
  border-bottom: 1px solid var(--color-accent);
}

.header__promoLink:hover {
  color: var(--color-nav-link-hover);
  border-bottom-color: var(--color-nav-link-hover);
  text-decoration: none;
}


.header__inner {
  height: var(--header-height);
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: var(--space-4);
}

.header__logo {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: var(--font-weight-black);
  letter-spacing: 0.02em;
  font-size: var(--text-xl);
  white-space: nowrap;
}

.header__logoImg {
  width: 36px;
  height: 36px;
  object-fit: contain;
}

.header__logoText {
  line-height: 1;
}

.header__logoAccent {
  color: var(--color-accent);
}

.header__logo:hover {
  text-decoration: none;
}

.header__nav {
  display: flex;
  align-items: center;
  gap: var(--space-5);
}

.header__link {
  font-size: var(--text-sm);
  font-weight: var(--font-weight-bold);
  color: var(--color-nav-link);
  text-decoration: none;
  padding: 8px 0;
  transition: color var(--duration-fast) var(--ease-out);
}

.header__link:hover {
  color: var(--color-nav-link-hover);
  text-decoration: none;
}

.header__actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-3);
}

.header__search {
  display: flex;
  align-items: center;
}

.header__search .input {
  width: 260px;
}

.input--dark {
  background: var(--color-search-bg);
  border: 1px solid var(--color-search-border);
  color: var(--color-text-primary);
}

.input--dark::placeholder {
  color: var(--color-text-muted);
}

.input--dark:focus {
  border-color: var(--color-accent);
  box-shadow: var(--focus-ring);
}

.header__cart {
  white-space: nowrap;
}

.header__cartCount {
  display: inline-grid;
  place-items: center;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: var(--radius-pill);
  background: var(--color-accent);
  color: var(--color-on-accent);
  font-size: var(--text-xs);
  font-weight: var(--font-weight-black);
  line-height: 1;
}

.header__toggle {
  display: none;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: var(--radius-1);
  border: 1px solid var(--color-border-strong);
  background: var(--color-bg-section);
  color: var(--color-text-primary);
  font-weight: var(--font-weight-bold);
  font-size: var(--text-sm);
  transition: background-color var(--duration-normal) var(--ease-out),
    border-color var(--duration-normal) var(--ease-out);
}

.header__toggle:hover {
  background: var(--color-bg-inset);
  text-decoration: none;
}

.subheader {
  background: var(--color-bg-section);
  border-bottom: 1px solid var(--color-border);
}

.subheader__inner {
  height: 44px;
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

.subheader__link {
  font-size: var(--text-xs);
  font-weight: var(--font-weight-bold);
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--color-nav-link);
  text-decoration: none;
}

.subheader__link:hover {
  color: var(--color-nav-link-hover);
  text-decoration: none;
}

@media (max-width: 900px) {
  .header__nav {
    display: none;
    position: absolute;
    top: calc(var(--header-height) + 36px);
    left: 0;
    right: 0;
    background: var(--color-bg-header);
    padding: var(--space-4) var(--container-padding);
    border-bottom: 1px solid var(--color-border);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-3);
  }

  .header[data-nav-open="true"] .header__nav {
    display: flex;
  }

  .header__search .input {
    width: 180px;
  }

  .header__toggle {
    display: inline-flex;
  }

  .header__promoLink {
    display: none;
  }

  .subheader__inner {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .subheader__inner::-webkit-scrollbar {
    display: none;
  }

  .subheader__link {
    white-space: nowrap;
  }
}

@media (max-width: 600px) {
  .header__inner {
    gap: var(--space-2);
  }

  .header__actions {
    gap: var(--space-2);
  }

  .header__search .input {
    width: 120px;
    padding: 8px 10px;
    font-size: var(--text-xs);
  }

  .header__cart {
    padding: 8px 10px;
    font-size: var(--text-xs);
  }

  .header__cartCount {
    min-width: 18px;
    height: 18px;
    font-size: 10px;
  }

  .header__toggle {
    padding: 8px 10px;
    font-size: var(--text-xs);
  }
}

@media (max-width: 440px) {
  .header__promo {
    height: 28px;
  }

  .header__promoText {
    font-size: 10px;
  }

  .header__promoHint {
    display: none;
  }

  .header__inner {
    height: 52px;
    gap: var(--space-2);
  }

  .header__logoImg {
    width: 28px;
    height: 28px;
  }

  .header__logo {
    gap: 6px;
    font-size: var(--text-lg);
  }

  .header__search {
    display: none;
  }

  .header__cartLabel {
    display: none;
  }

  .header__toggle {
    gap: 4px;
  }

  .header__nav {
    top: calc(52px + 28px);
  }
}
