:root {
  --header-bg: #000;
  --header-border: rgba(255, 255, 255, 0.09);
  --header-accent: #ff8f8f;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: var(--header-bg);
  border-bottom: 1px solid var(--header-border);
}

.header-inner {
  width: min(100%, 1100px);
  min-height: 78px;
  margin: 0 auto;
  padding: 12px 24px;
  display: flex;
  align-items: center;
  gap: 28px;
}

.brand-link {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 9px;
  color: #fff;
  text-decoration: none;
}

.brand-logo {
  display: block;
  width: 154px;
  height: auto;
  object-fit: contain;
}

.primary-nav,
.account-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 8px;
}

.nav-link {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: #d0cdd2;
  font-size: 13px;
  font-weight: 650;
  text-decoration: none;
  transition: color 160ms ease, background 160ms ease, border-color 160ms ease;
}

.nav-link:hover,
.category-menu[open] > .nav-link {
  color: #fff;
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.08);
}

.category-menu {
  position: relative;
}

.category-menu summary {
  list-style: none;
  cursor: pointer;
}

.category-menu summary::-webkit-details-marker {
  display: none;
}

.category-menu summary svg {
  width: 15px;
  height: 15px;
  transition: transform 160ms ease;
}

.category-menu[open] summary svg {
  transform: rotate(180deg);
}

.category-menu-panel {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(2, minmax(125px, 1fr));
  gap: 3px;
  width: 300px;
  padding: 8px;
  border: 1px solid var(--header-border);
  border-radius: 12px;
  background: #151417;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.42);
}

.category-menu-panel a {
  padding: 10px 11px;
  border-radius: 7px;
  color: #d8d5da;
  font-size: 13px;
  text-decoration: none;
  transition: color 160ms ease, background 160ms ease;
}

.category-menu-panel a:hover,
.category-menu-panel a:focus-visible {
  color: #fff;
  background: rgba(255, 143, 143, 0.12);
}

.search-bar {
  position: relative;
  display: flex;
  flex: 1 1 180px;
  min-width: 140px;
  max-width: 320px;
  align-items: center;
  margin-left: auto;
}

.search-bar input {
  width: 100%;
  height: 42px;
  padding: 0 42px 0 14px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 9px;
  outline: none;
  background: rgba(255, 255, 255, 0.045);
  color: #fff;
  font: inherit;
  font-size: 13px;
  transition: border-color 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.search-bar input::placeholder {
  color: #89868d;
}

.search-bar input:focus {
  border-color: rgba(255, 143, 143, 0.7);
  background: rgba(255, 255, 255, 0.07);
  box-shadow: 0 0 0 3px rgba(255, 143, 143, 0.12);
}

.search-icon-btn {
  position: absolute;
  right: 5px;
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: #aaa7ad;
  cursor: pointer;
  transition: color 160ms ease, background 160ms ease;
}

.search-icon-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.search-icon-btn svg {
  width: 18px;
  height: 18px;
}

.account-actions {
  gap: 8px;
}

.account-actions form {
  margin: 0;
}

.account-button {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  padding: 0 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.045);
  color: #f1eef2;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.account-button:hover {
  transform: translateY(-1px);
  border-color: rgba(255, 143, 143, 0.55);
}

.account-button-primary {
  border-color: var(--header-accent);
  background: var(--header-accent);
  color: #201214;
}

.account-button-primary:hover {
  background: #ffaaaa;
}

.account-profile {
  display: inline-flex;
  max-width: 150px;
  align-items: center;
  gap: 8px;
  color: #e7e4e9;
  font-size: 13px;
  font-weight: 650;
  text-decoration: none;
}

.account-profile img {
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 50%;
}

.account-profile span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  clip-path: inset(50%);
}

.brand-link:focus-visible,
.nav-link:focus-visible,
.account-button:focus-visible,
.account-profile:focus-visible,
.category-menu-panel a:focus-visible,
.search-icon-btn:focus-visible {
  outline: 2px solid var(--header-accent);
  outline-offset: 3px;
}

@media (max-width: 980px) {
  .header-inner {
    gap: 16px;
    padding-inline: 18px;
  }

  .primary-nav {
    gap: 2px;
  }

  .nav-link {
    padding-inline: 9px;
  }
}

@media (max-width: 760px) {
  .header-inner {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 10px 14px;
    padding: 10px 16px 12px;
  }

  .brand-link {
    grid-column: 1;
    grid-row: 1;
  }

  .account-actions {
    grid-column: 2;
    grid-row: 1;
    justify-content: flex-end;
  }

  .primary-nav {
    grid-column: 1;
    grid-row: 2;
  }

  .search-bar {
    grid-column: 2;
    grid-row: 2;
    width: min(100%, 280px);
    min-width: 0;
    margin-left: 0;
  }
}

@media (max-width: 420px) {
  .header-inner {
    column-gap: 8px;
    padding-inline: 12px;
  }

  .brand-logo {
    width: 126px;
  }

  .account-actions {
    gap: 5px;
  }

  .account-button {
    min-height: 36px;
    padding-inline: 10px;
    font-size: 11px;
  }

  .account-profile {
    gap: 5px;
    max-width: 95px;
    font-size: 12px;
  }

  .account-profile img {
    width: 30px;
    height: 30px;
  }
}
