.site-header {
  width: 100%;
  background: var(--bg);
  position: relative;
  overflow: hidden;
}

.site-header::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(circle 1px at 10% 20%, rgba(255 255 255 / 0.05) 99%, transparent 100%),
    radial-gradient(circle 1.5px at 40% 60%, rgba(255 255 255 / 0.04) 99%, transparent 100%),
    radial-gradient(circle 0.8px at 70% 30%, rgba(255 255 255 / 0.03) 99%, transparent 100%),
    radial-gradient(circle 1.2px at 85% 80%, rgba(255 255 255 / 0.06) 99%, transparent 100%);
  background-repeat: no-repeat;
  opacity: 0.15;
  border-radius: 12px;
}

.header-container {
  width: 100%;
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: space-between;
  gap: clamp(12px, 2vw, 24px);
  container-type: inline-size;
  position: relative;
  z-index: 1;
  color: #f8fafc;
  background: #0f172a;
  padding: clamp(12px, 1.6vw, 20px) clamp(10px, 1.6vw, 24px);
  border-bottom-right-radius: 8px;
}

.logo {
  order: 1;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  white-space: nowrap;
  min-width: clamp(140px, 12vw, 220px);
  padding: 6px 8px;
  border-radius: 8px;
}

.logo a {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

.logo img,
.logo svg {
  display: block;
  height: clamp(28px, 3.2vw, 52px);
  width: auto;
  max-width: 100%;
  mix-blend-mode: normal !important;
}

.main-menu {
  order: 2;
  flex: 1 1 auto;
  display: flex;
  justify-content: center;
  margin-top: 0;
  min-width: 0;
}

.main-menu ul {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(8px, 1.2vw, 22px);
  list-style: none;
  margin: 0;
  padding: 0;
  white-space: nowrap;
  flex-wrap: nowrap;
  overflow: visible;
  max-width: 100%;
  box-sizing: border-box;
}

.main-menu ul li a {
  color: #f8fafc;
  text-decoration: none;
  font-weight: 500;
  border-radius: 8px;
  padding: 6px 10px;
  transition: background-color .3s ease, color .3s ease;
  font-size: clamp(1rem, calc(0.85vw + 0.45rem), 1.2rem);
}

.main-menu ul li a:hover,
.main-menu ul li a:focus {
  color: var(--ink);
  background-color: var(--bg-light);
}

.icons {
  order: 3;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  white-space: nowrap;
  gap: clamp(10px, 1.2vw, 16px);
  justify-content: flex-end;
}

.burger {
  display: none;
  cursor: pointer;
  flex-direction: column;
  gap: 4px;
  order: 4;
}

.burger span {
  width: 24px;
  height: 2px;
  background: #f8fafc;
  transition: all .3s ease;
}

.icon-btn,
.cart-contents,
.favorites,
.search-toggle {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  color: #f8fafc;
  text-decoration: none;
  background: transparent;
  border: 0;
  cursor: pointer;
  padding: 0;
}

.icon-btn svg,
.cart-contents svg,
.favorites svg,
.search-toggle svg {
  display: block;
  width: 28px;
  height: 28px;
}

.icon-btn:focus-visible,
.cart-contents:focus-visible,
.favorites:focus-visible,
.search-toggle:focus-visible {
  outline: 2px solid #facc15;
  outline-offset: 2px;
  border-radius: 8px;
}

.search-field {
  width: clamp(220px, 18vw, 320px);
  opacity: 1;
  transform: none;
  transition: width .25s ease, opacity .2s ease, transform .25s ease;
}

.search-field form {
  width: 100%;
}

.search-field input {
  width: 100%;
  height: 40px;
  padding: 0 12px;
  border: 1px solid #374151;
  background: #0b1224;
  color: #f8fafc;
  border-radius: 8px;
  font-size: 14px;
  outline: none;
}

.cart-contents {
  color: #f8fafc;
}

.cart-count {
  position: absolute;
  right: -10px;
  bottom: -8px;
  min-width: 18px;
  height: 18px;
  padding: 0 6px;
  border-radius: 12px;
  background: var(--bg-light);
  color: var(--ink);
  font-size: 12px;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
  pointer-events: none;
}

.header-container.is-stacked {
  flex-wrap: wrap;
}

.header-container.is-stacked .logo {
  order: 1;
}

.header-container.is-stacked .icons {
  order: 2;
  margin-left: auto;
}

.header-container.is-stacked .main-menu {
  order: 3;
  flex: 1 1 100%;
  margin-top: 8px;
}

.header-container.is-stacked .main-menu ul {
  justify-content: center;
}

.header-container.--mobile .main-menu ul {
  display: none;
}

.header-container.--mobile .burger {
  display: flex;
}

.header-container.--mobile .search-field {
  width: 0;
  opacity: 0;
  transform: translateX(-6px);
  overflow: hidden;
}

.header-container.--mobile .search-field.open {
  width: 160px;
  opacity: 1;
  transform: translateX(0);
}

.header-container.--mobile .search-toggle[aria-expanded="true"]+.search-field {
  width: 160px;
  opacity: 1;
  transform: translateX(0);
}

.header-container.--mobile {
  flex-wrap: wrap;
  row-gap: 8px;
  gap: 10px 12px;
}

.header-container.--mobile .logo {
  order: 1;
  flex: 1 1 60%;
  min-width: 0;
}

.header-container.--mobile .icons {
  order: 2;
  flex: 1 1 40%;
  justify-content: center;
}

.header-container.--mobile .burger {
  order: 3;
}

.header-container.--mobile .main-menu {
  order: 4;
  flex: 1 1 100%;
  min-width: 100%;
}

.header-container.--mobile.menu-open .main-menu ul {
  display: flex;
  flex-direction: column;
  position: relative;
  top: 100%;
  left: 0;
  width: 100%;
  background: #0f172a;
  padding: 1rem;
  gap: 1rem;
  z-index: 100;
  border-radius: 0 0 12px 12px;
}

.header-container.--mobile.menu-open .main-menu ul li a {
  color: #f8fafc;
}

.header-container.--mobile.menu-open .main-menu ul li a:hover,
.header-container.--mobile.menu-open .main-menu ul li a:focus {
  color: #facc15;
}

@container (max-width: 1300px) {
  .header-container {
    gap: 16px;
  }

  .main-menu ul {
    gap: clamp(6px, 1vw, 16px);
  }

  .search-field {
    width: clamp(200px, 16vw, 260px);
  }

  .icon-btn,
  .cart-contents,
  .favorites,
  .search-toggle {
    width: 36px;
    height: 36px;
  }

  .icon-btn svg,
  .cart-contents svg,
  .favorites svg,
  .search-toggle svg {
    width: 24px;
    height: 24px;
  }
}

@media (prefers-reduced-motion: reduce) {

  .main-menu ul li a,
  .burger span,
  .search-field {
    transition: none;
  }
}