.site-header {
  position: relative;
  height: var(--header-height);
  display: flex;
  align-items: center;
  background: rgba(247, 246, 242, 0.78);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid transparent;
}

.site-chrome {
  position: sticky;
  top: 0;
  z-index: var(--z-header);
}

.site-chrome:has(.site-header.is-scrolled) .site-header,
.site-header.is-scrolled {
  background: rgba(255, 255, 255, 0.92);
  border-bottom-color: var(--border);
  box-shadow: 0 8px 24px rgba(20, 23, 28, 0.04);
}

.header-desktop-only {
  display: none;
}

.topbar {
  background: var(--primary);
  color: #fff;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-align: center;
  padding: 0.4rem 1rem;
}

.topbar-inner {
  max-width: var(--container-width);
  margin: 0 auto;
}

.header-inner {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.6rem;
  width: min(100% - 32px, var(--container-width));
  margin-inline: auto;
}

.logo-fallback {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--text);
}

.topbar a {
  color: inherit;
}

.user-menu-btn {
  display: none;
  align-items: center;
  gap: 0.45rem;
  max-width: 220px;
  min-height: 40px;
  padding: 0.3rem 0.7rem;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.user-menu-btn:hover,
.user-menu-btn:focus-visible {
  background: rgba(255, 255, 255, 0.7);
  outline: none;
  box-shadow: var(--focus);
}

.user-menu-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 148px;
  font-size: 0.86rem;
}

.mega-wrap {
  position: relative;
}

.mega-menu {
  display: none;
  position: absolute;
  top: calc(100% + 0.85rem);
  left: 0;
  width: min(920px, calc(100vw - 4rem));
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 1.1rem;
  z-index: 50;
}

.mega-wrap.is-open .mega-menu {
  display: block;
}

.mega-cols {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 1.2rem;
}

.mega-label {
  margin: 0 0 0.7rem;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 700;
}

.mega-list,
.mega-products {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.2rem;
}

.mega-list a,
.mega-products a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  padding: 0.45rem 0.55rem;
  border-radius: 10px;
  color: var(--text);
  font-weight: 600;
}

.mega-list small {
  color: var(--muted);
  font-weight: 500;
}

.mega-products a {
  justify-content: flex-start;
}

.mega-products img {
  width: 56px;
  height: 40px;
  object-fit: cover;
  border-radius: 8px;
  flex-shrink: 0;
}

.mega-products span {
  display: grid;
  gap: 0.15rem;
  min-width: 0;
}

.mega-list a:hover,
.mega-list a:focus-visible,
.mega-products a:hover,
.mega-products a:focus-visible {
  background: var(--surface-soft);
  outline: none;
}

.mega-all {
  display: inline-flex;
  margin-top: 0.85rem;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--primary);
}

.mega-trigger:focus-visible {
  outline: none;
  box-shadow: var(--focus);
}

.header-inner .logo {
  justify-self: start;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
}

.logo-brand .logo-mark-wrap,
.logo-brand .logo-svg-wrap {
  height: 34px;
  width: 34px;
  max-width: 34px;
  flex-shrink: 0;
}

.logo-brand .logo-mark-svg,
.logo-brand .logo-svg-inline {
  width: 34px;
  height: 34px;
  display: block;
}

.logo-brand .logo-brand-svg {
  width: auto;
  height: 40px;
  max-width: min(168px, 46vw);
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  font-weight: 750;
  letter-spacing: -0.04em;
  font-size: 1.15rem;
}

.logo-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  min-width: 0;
}

.logo-mark-wrap,
.logo-svg-wrap {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
}

.logo-wordmark {
  font-weight: 750;
  letter-spacing: -0.04em;
  font-size: 1.15rem;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: clamp(7rem, 30vw, 12rem);
}

.logo-brand-on-dark .logo-wordmark {
  color: #f4f3ef;
}

.logo-img {
  max-height: 40px;
  width: auto;
  display: block;
  object-fit: contain;
}

.logo-img-default {
  max-height: 42px;
}
.logo-img-mobile { display: none; }
@media (max-width: 720px) {
  .logo:has(.logo-img-mobile) .logo-img-desktop { display: none; }
  .logo-img-mobile { display: block; }
}

.logo-mark {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--secondary);
  color: #fff;
  display: grid;
  place-items: center;
}

.nav-desktop {
  display: none;
  justify-content: center;
  gap: 0.2rem;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  min-height: 40px;
  padding: 0.35rem 0.8rem;
  border-radius: 999px;
  color: var(--text-secondary);
  font-weight: 550;
  font-size: 0.95rem;
}

.nav-link:hover,
.nav-link.is-active {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.7);
}

.nav-link:focus-visible {
  outline: none;
  box-shadow: var(--focus);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.header-search-desktop {
  margin-right: 0.2rem;
}

.header-actions .btn {
  display: none;
}

.cart-btn {
  position: relative;
}

.cart-count {
  position: absolute;
  top: 4px;
  right: 4px;
  min-width: 16px;
  height: 16px;
  border-radius: 99px;
  background: var(--primary);
  color: #fff;
  font-size: 10px;
  display: grid;
  place-items: center;
  font-weight: 700;
}

.cart-count[hidden] {
  display: none !important;
}

.menu-toggle {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: grid;
  place-items: center;
}

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

.mobile-nav {
  position: fixed;
  inset: 0;
  z-index: var(--z-overlay);
  pointer-events: none;
  overflow: hidden;
}

.mobile-nav.is-open {
  pointer-events: auto;
}

.mobile-nav-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(16, 18, 24, 0.42);
  opacity: 0;
  transition: opacity 240ms var(--ease);
}

.mobile-nav.is-open .mobile-nav-backdrop {
  opacity: 1;
}

.mobile-nav-panel {
  position: absolute;
  inset: 0 0 0 auto;
  width: min(100%, 420px);
  max-width: 100%;
  background: #fbfaf7;
  transform: translateX(100%);
  transition: transform 320ms var(--ease);
  display: flex;
  flex-direction: column;
  padding: 1.1rem 1.2rem 2rem;
}

.mobile-nav.is-open .mobile-nav-panel {
  transform: translateX(0);
}

.mobile-nav-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.mobile-nav-list a,
.mobile-acc-btn {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  min-height: 52px;
  padding: 0.6rem 0.2rem;
  font-size: 1.2rem;
  font-weight: 650;
  letter-spacing: -0.03em;
  border-bottom: 1px solid var(--border);
}

.mobile-acc-panel {
  display: none;
  padding: 0.4rem 0 0.8rem 0.2rem;
}

.mobile-acc.is-open .mobile-acc-panel {
  display: block;
}

.mobile-acc-panel a {
  min-height: 44px;
  font-size: 1rem;
  font-weight: 500;
  color: var(--text-secondary);
  border-bottom: 0;
}

.mobile-nav-foot {
  margin-top: auto;
  display: grid;
  gap: 0.7rem;
  padding-top: 1.5rem;
}

.mobile-nav:not(.is-open),
.modal:not(.is-open),
.drawer:not(.is-open) {
  visibility: hidden;
}

.notify-menu {
  position: relative;
}

.notify-menu .btn-icon {
  position: relative;
}

.notify-count {
  position: absolute;
  top: 4px;
  right: 4px;
  min-width: 16px;
  height: 16px;
  border-radius: 99px;
  background: var(--primary);
  color: #fff;
  font-size: 10px;
  display: grid;
  place-items: center;
  font-weight: 700;
}

.notify-count[hidden] {
  display: none !important;
}

.notify-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  width: min(calc(100vw - 24px), 360px);
  background: var(--surface);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  padding: 0.7rem;
  z-index: 40;
  display: none;
}

.notify-menu.is-open .notify-panel {
  display: grid;
  gap: 0.55rem;
}

.notify-panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
}

.notify-drop-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.2rem;
  max-height: min(50vh, 320px);
  overflow: auto;
}

.notify-drop-list a {
  display: grid;
  gap: 0.15rem;
  padding: 0.55rem 0.6rem;
  border-radius: 10px;
  min-width: 0;
}

.notify-drop-list li.is-unread a {
  background: var(--surface-soft);
}

.notify-drop-list a:hover {
  background: var(--surface-soft);
}

.notify-all-link {
  display: block;
  text-align: center;
  padding: 0.45rem;
  font-size: 0.88rem;
}

.notify-backdrop {
  display: none;
}

@media (max-width: 639px) {
  .notify-menu.is-open .notify-backdrop {
    display: block;
    position: fixed;
    inset: var(--header-height) 0 0 0;
    background: rgba(16, 18, 24, 0.4);
    z-index: 39;
  }

  .notify-panel {
    position: fixed;
    top: var(--header-height);
    right: 0;
    left: auto;
    bottom: 0;
    width: min(100%, 360px);
    border-radius: 0;
    z-index: 40;
    overflow: auto;
  }
}

@media (min-width: 1100px) {
  .header-inner {
    grid-template-columns: auto 1fr auto;
    width: min(100% - 64px, var(--container-width));
  }

  .header-inner .logo {
    justify-self: start;
    max-width: none;
  }

  .logo-svg-wrap {
    max-width: 180px;
  }

  .nav-desktop {
    display: flex;
  }

  .header-actions .btn,
  .header-desktop-only,
  .user-menu-btn {
    display: inline-flex;
  }

  .header-search-desktop {
    display: block;
  }

  .search-toggle {
    display: none;
  }

  .menu-toggle {
    display: none;
  }
}
