.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: var(--header-h);
  background: transparent;
  border-bottom: 1px solid transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  transition:
    background 0.35s ease,
    border-color 0.35s ease,
    backdrop-filter 0.35s ease,
    box-shadow 0.35s ease;
}

/* UI8-style: transparent at top → glass on scroll */
.site-header.is-scrolled {
  background: rgba(10, 10, 10, 0.72);
  backdrop-filter: blur(20px) saturate(1.2);
  -webkit-backdrop-filter: blur(20px) saturate(1.2);
  border-bottom-color: var(--border-subtle);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.04);
}

/* Transparent state — lighter nav, no filled pills */
.site-header:not(.is-scrolled) .header-nav__link {
  color: rgba(245, 245, 247, 0.72);
  background: transparent;
}

.site-header:not(.is-scrolled) .header-nav__link:hover,
.site-header:not(.is-scrolled) .header-nav__link.is-active {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.06);
}

.site-header:not(.is-scrolled) .header-search-btn {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.08);
  color: rgba(245, 245, 247, 0.55);
}

.site-header:not(.is-scrolled) .header-search-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.12);
  color: rgba(245, 245, 247, 0.85);
}

.site-header:not(.is-scrolled) .header-search-btn kbd {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.1);
  color: rgba(245, 245, 247, 0.45);
}

.site-header:not(.is-scrolled) .header-account-btn,
.site-header:not(.is-scrolled) .cart-btn,
.site-header:not(.is-scrolled) .menu-toggle {
  color: rgba(245, 245, 247, 0.72);
}

.site-header:not(.is-scrolled) .header-account-btn:hover,
.site-header:not(.is-scrolled) .cart-btn:hover,
.site-header:not(.is-scrolled) .menu-toggle:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-primary);
}

.site-header:not(.is-scrolled) .header-nav .btn--primary.btn--sm,
.site-header:not(.is-scrolled) .btn--primary.btn--sm {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: var(--text-primary);
}

.site-header:not(.is-scrolled) .header-nav .btn--primary.btn--sm:hover,
.site-header:not(.is-scrolled) .btn--primary.btn--sm:hover {
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(255, 255, 255, 0.2);
  color: #fff;
  box-shadow: none;
}

.header-inner {
  display: flex;
  align-items: center;
  height: var(--header-h);
  gap: 16px;
}

.header-start {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 0;
}

.header-logo {
  flex-shrink: 0;
  display: flex;
  align-items: center;
}

.header-logo img,
.header-logo svg {
  height: 32px;
  width: 32px;
  border-radius: 8px;
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.header-nav__link {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 8px 12px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  border-radius: var(--radius-md);
  transition: all var(--transition);
}

.header-nav__link:hover,
.header-nav__link.is-active {
  color: var(--text-primary);
  background: var(--bg-elevated);
}

.header-nav__link svg {
  width: 14px;
  height: 14px;
  opacity: 0.6;
}

.header-nav__access {
  flex-shrink: 0;
}

.header-start .header-search-btn {
  flex: 1;
  max-width: 280px;
  min-width: 0;
  position: relative;
  z-index: 2;
  cursor: pointer;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  flex-shrink: 0;
}

.header-search-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  font-size: 13px;
  color: var(--text-muted);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  transition: all var(--transition);
  min-width: 180px;
  flex-shrink: 1;
}

.header-search-btn:hover {
  border-color: var(--border-default);
  color: var(--text-secondary);
}

.header-search-btn kbd {
  margin-left: auto;
  padding: 2px 6px;
  font-size: 11px;
  font-family: inherit;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: 4px;
  color: var(--text-muted);
}

.header-account-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  border-radius: var(--radius-md);
  transition: all var(--transition);
  cursor: pointer;
  text-decoration: none;
  flex-shrink: 0;
  overflow: hidden;
}

.header-account-btn:hover {
  background: var(--bg-elevated);
  color: var(--text-primary);
}

.header-account-btn__avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
}

.header-account-btn__initial {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.18);
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  color: var(--text-primary);
  text-transform: uppercase;
}

.cart-btn {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  border-radius: var(--radius-md);
  transition: all var(--transition);
  cursor: pointer;
}

.cart-btn:hover {
  background: var(--bg-elevated);
  color: var(--text-primary);
}

.cart-btn__count {
  position: absolute;
  top: 2px;
  right: 2px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  font-size: 10px;
  font-weight: 700;
  line-height: 16px;
  text-align: center;
  background: var(--accent);
  color: var(--accent-on);
  border-radius: var(--radius-full);
}

.cart-btn__count:empty,
.cart-btn__count[data-count="0"] {
  display: none;
}

/* Browse dropdown */
.nav-dropdown {
  position: relative;
}

.nav-dropdown__menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  min-width: 280px;
  padding: 8px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: all 0.2s ease;
}

.nav-dropdown.is-open .nav-dropdown__menu,
.nav-dropdown:hover .nav-dropdown__menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.nav-dropdown__item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  font-size: 14px;
  color: var(--text-secondary);
  border-radius: var(--radius-md);
  transition: all var(--transition);
}

.nav-dropdown__item:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.nav-dropdown__item-count {
  font-size: 12px;
  color: var(--text-muted);
}

/* Mobile menu */
.menu-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  color: var(--text-primary);
  border-radius: var(--radius-md);
}

.menu-toggle:hover { background: var(--bg-elevated); }

.mobile-drawer {
  position: fixed;
  inset: 0;
  z-index: 200;
  visibility: hidden;
}

.mobile-drawer.is-open { visibility: visible; }

.mobile-drawer__backdrop {
  position: absolute;
  inset: 0;
  background: var(--bg-overlay);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.mobile-drawer.is-open .mobile-drawer__backdrop { opacity: 1; }

.mobile-drawer__panel {
  position: absolute;
  top: 0;
  right: 0;
  width: min(320px, 85vw);
  height: 100%;
  background: var(--bg-surface);
  border-left: 1px solid var(--border-subtle);
  padding: 24px;
  transform: translateX(100%);
  transition: transform 0.3s ease;
  overflow-y: auto;
}

.mobile-drawer.is-open .mobile-drawer__panel { transform: translateX(0); }

.mobile-drawer__close {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  margin-bottom: 24px;
}

.mobile-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.mobile-nav__link {
  padding: 12px;
  font-size: 16px;
  font-weight: 500;
  color: var(--text-secondary);
  border-radius: var(--radius-md);
}

.mobile-nav__link:hover { background: var(--bg-elevated); color: var(--text-primary); }

@media (max-width: 900px) {
  .header-nav { display: none; }

  .header-start .header-search-btn span,
  .header-start .header-search-btn kbd { display: none; }

  .header-start .header-search-btn {
    flex: 0 0 auto;
    max-width: none;
    min-width: auto;
    padding: 7px 10px;
  }

  .menu-toggle { display: flex; }
}

/* Search overlay */
.search-overlay {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 15vh;
  background: var(--bg-overlay);
  backdrop-filter: blur(4px);
  opacity: 0;
  visibility: hidden;
  transition: all 0.2s ease;
}

.search-overlay.is-open {
  opacity: 1;
  visibility: visible;
}

.search-overlay__box {
  width: min(600px, 90vw);
  background: var(--bg-elevated);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  transform: scale(0.96);
  transition: transform 0.2s ease;
}

.search-overlay.is-open .search-overlay__box { transform: scale(1); }

.search-overlay__input-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-subtle);
}

.search-overlay__input {
  flex: 1;
  font-size: 16px;
  background: none;
  border: none;
  outline: none;
  color: var(--text-primary);
}

.search-overlay__input::placeholder { color: var(--text-muted); }

.search-overlay__results {
  max-height: 360px;
  overflow-y: auto;
  padding: 8px;
}

.search-result {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  transition: background var(--transition);
}

.search-result:hover { background: var(--bg-hover); }

.search-result img {
  width: 48px;
  height: 32px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
}

.search-result__info { flex: 1; min-width: 0; }

.search-result__title {
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.search-result__meta {
  font-size: 12px;
  color: var(--text-muted);
}

.search-overlay__hint {
  padding: 12px 20px;
  font-size: 12px;
  color: var(--text-muted);
  border-top: 1px solid var(--border-subtle);
}
