/* lot4b-ui-header.css: consolidated from lot4b-header-polish.css (same order). Duplicate and overridden declarations removed. */

/* Reduced motion wins over every unlayered !important transition: important
   declarations inside a cascade layer beat unlayered important ones, at zero
   specificity. Same values as the existing Patch 136 guard. */
@layer lot4b-reduced-motion {
  @media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
      animation-duration: 0.01ms !important;
      animation-iteration-count: 1 !important;
      transition-duration: 0.01ms !important;
      transition-delay: 0s !important;
      scroll-behavior: auto !important;
    }
  }
}

/* ---- from lot4b-header-polish.css ---- */
/* LOT4B UI01 — scoped header polish, 2026-11-09.
   Loaded last to isolate changes from the legacy cascade.
   Only the public marketplace header is affected; no application logic or APIs. */
html body #header#header.lot4b-header {
  --lot4b-header-navy: #0A1F44;
  --lot4b-header-blue: #2563EB;
  --lot4b-header-light: #93C5FD;
  --lot4b-header-bg: #F8FAFC;
  --lot4b-header-white: #FFFFFF;
  --lot4b-header-soft-border: #6FA3FF55;
  --lot4b-header-control-border: #3B82F6;
  --lot4b-header-compact-border: #6FA3FF66;
  --lot4b-header-menu-shadow: #02154A26;
  background: var(--lot4b-header-white) !important;
  color: var(--lot4b-header-navy) !important;
  border-bottom: 1px solid var(--lot4b-header-soft-border) !important;
}
html body #header#header.lot4b-header :is(.lot4b-header-top,.lot4b-header-bottom),
html body #header#header.lot4b-header #nav.open {
  background: var(--lot4b-header-white) !important;
  color: var(--lot4b-header-navy) !important;
}
html body #header#header.lot4b-header #nav a {
  color: var(--lot4b-header-navy) !important;
}
html body #header#header.lot4b-header #nav a:is(:hover,.active,[aria-current="page"]) {
  color: var(--lot4b-header-blue) !important;
  border-bottom-color: var(--lot4b-header-blue) !important;
}
/* The search remains functional and visually distinct inside the white shell. */
html body #header#header.lot4b-header .lot4b-header-search {
  border: 1px solid var(--lot4b-header-control-border) !important;
  background: var(--lot4b-header-white) !important;
  box-shadow: none !important;
}
html body #header#header.lot4b-header .lot4b-header-search :is(input,.lot4b-picker-trigger,.lot4b-search-button) {
  color: var(--lot4b-header-navy) !important;
  background: var(--lot4b-header-white) !important;
}
html body #header#header.lot4b-header .lot4b-header-search :is(.lot4b-picker-trigger,.lot4b-search-button):is(:hover,[aria-expanded="true"]) {
  background: var(--lot4b-header-bg) !important;
  color: var(--lot4b-header-blue) !important;
}
/* One focus indicator at a time. Typing: the bar's own border turns blue (2px, drawn inside, no outer ring).
   Category, board, search button or a menu option reached by keyboard: only that part gets an inset ring,
   so the active part stays clear and the bar is not ringed twice. Opening a menu with the mouse adds no ring. */
html body #header#header.lot4b-header .lot4b-header-search:focus-within {
  outline: none !important;
  box-shadow: none !important;
}
html body #header#header.lot4b-header .lot4b-header-search:has(#header-query:focus) {
  border-color: var(--lot4b-header-blue) !important;
  box-shadow: inset 0 0 0 1px var(--lot4b-header-blue) !important;
}
html body #header#header.lot4b-header .lot4b-header-search :is(.lot4b-picker-trigger,.lot4b-search-button,[role="option"]):focus-visible {
  outline: 2px solid var(--lot4b-header-blue) !important;
  outline-offset: -2px !important;
  box-shadow: none !important;
}
html body #header#header.lot4b-header .lot4b-header-search :is(.lot4b-picker-menu,.lot4b-picker-menu [role="option"]) {
  background: var(--lot4b-header-white) !important;
  color: var(--lot4b-header-navy) !important;
}
html body #header#header.lot4b-header .lot4b-header-search .lot4b-picker-menu [role="option"]:is(:hover,[aria-selected="true"]) {
  background: var(--lot4b-header-bg) !important;
  color: var(--lot4b-header-blue) !important;
}
/* Header utilities use a single brand color system. */
html body #header#header.lot4b-header .lot4b-header-actions :is(.bell-button,.market-country-trigger,.lang,.account-nav,#menu) {
  color: var(--lot4b-header-navy) !important;
}
html body #header#header.lot4b-header .lot4b-header-actions :is(.bell-button,.market-country-trigger,.lang,#menu):is(:hover,:focus-visible,[aria-expanded="true"]) {
  background: var(--lot4b-header-bg) !important;
  color: var(--lot4b-header-blue) !important;
  border-color: transparent !important;
}
html body #header#header.lot4b-header .lot4b-header-actions .bell-count {
  background: var(--lot4b-header-blue) !important;
  border-color: var(--lot4b-header-white) !important;
  color: var(--lot4b-header-white) !important;
}
html body #header#header.lot4b-header .lot4b-header-actions .market-country-menu {
  background: var(--lot4b-header-white) !important;
  color: var(--lot4b-header-navy) !important;
  border: 1px solid var(--lot4b-header-soft-border) !important;
}
html body #header#header.lot4b-header .lot4b-header-actions .market-country-option {
  background: var(--lot4b-header-white) !important;
  color: var(--lot4b-header-navy) !important;
}
html body #header#header.lot4b-header .lot4b-header-actions .market-country-option:is(:hover,.is-active) {
  background: var(--lot4b-header-bg) !important;
  color: var(--lot4b-header-blue) !important;
  box-shadow: inset 0 -2px var(--lot4b-header-blue) !important;
}
/* Always provide a recognizable, circular account control (not a floating letter). */
html body #header#header.lot4b-header .lot4b-header-actions .lot4b-account-picker {
  display: inline-flex !important;
  position: relative !important;
  align-items: center !important;
}
html body #header#header.lot4b-header .lot4b-header-actions .lot4b-account-picker > .account-nav.is-user-avatar {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  flex: 0 0 38px !important;
  width: 38px !important;
  min-width: 38px !important;
  height: 38px !important;
  min-height: 38px !important;
  padding: 0 !important;
  border: 1.5px solid var(--lot4b-header-light) !important;
  border-radius: 50% !important;
  background: var(--lot4b-header-bg) !important;
  color: var(--lot4b-header-navy) !important;
  overflow: hidden !important;
  box-shadow: none !important;
}
html body #header#header.lot4b-header .lot4b-header-actions .lot4b-account-picker > .account-nav.is-user-avatar:is(:hover,:focus-visible,[aria-expanded="true"]) {
  border-color: var(--lot4b-header-blue) !important;
  background: var(--lot4b-header-bg) !important;
  color: var(--lot4b-header-blue) !important;
}
html body #header#header.lot4b-header .lot4b-header-actions .lot4b-account-picker .header-avatar-fallback {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 100% !important;
  height: 100% !important;
  font-size: 15px !important;
  font-weight: 800 !important;
  line-height: 1 !important;
}
html body #header#header.lot4b-header .lot4b-account-menu {
  background: var(--lot4b-header-white) !important;
  color: var(--lot4b-header-navy) !important;
  border: 1px solid var(--lot4b-header-soft-border) !important;
}
html body #header#header.lot4b-header .lot4b-account-menu > :is(a,button) {
  color: var(--lot4b-header-navy) !important;
}
html body #header#header.lot4b-header .lot4b-account-menu > :is(a,button):is(:hover,:focus-visible) {
  background: var(--lot4b-header-bg) !important;
  color: var(--lot4b-header-blue) !important;
}
html body #header#header.lot4b-header .lot4b-account-menu > #header-logout {
  color: var(--lot4b-header-navy) !important;
}
html body #header#header.lot4b-header .lot4b-post-actions .btn:not(.ghost) {
  background: var(--lot4b-header-navy) !important;
  border-color: var(--lot4b-header-navy) !important;
  color: var(--lot4b-header-white) !important;
}
html body #header#header.lot4b-header .lot4b-post-actions .btn.ghost {
  background: var(--lot4b-header-white) !important;
  border-color: var(--lot4b-header-control-border) !important;
  color: var(--lot4b-header-navy) !important;
}
html body #header#header.lot4b-header :is(a,button,input,.lot4b-picker-trigger):focus-visible {
  outline: 2px solid var(--lot4b-header-blue) !important;
  outline-offset: 3px !important;
}
/* Desktop compact mode: explicit accessible menu button, never hover-only. */
@media (min-width: 901px) {
  html body #header#header.lot4b-header .lot4b-header-actions #menu {
    display: none !important;
  }
  html body #header#header.lot4b-header.is-compact .lot4b-header-actions #menu {
    display: inline-grid !important;
    place-items: center !important;
    width: 40px !important;
    height: 40px !important;
    min-width: 40px !important;
    min-height: 40px !important;
    padding: 0 !important;
    border: 1px solid var(--lot4b-header-compact-border) !important;
    border-radius: 9px !important;
    font-size: 22px !important;
    line-height: 1 !important;
    cursor: pointer !important;
  }
  html body #header#header.lot4b-header.is-compact .lot4b-header-bottom {
    position: absolute !important;
    top: 100% !important;
    inset-inline: 0 !important;
    display: grid !important;
    grid-template-rows: minmax(0,0fr) !important;
    max-height: 0 !important;
    min-height: 0 !important;
    opacity: 0 !important;
    visibility: hidden !important;
    transform: translateY(-4px) !important;
    pointer-events: none !important;
    overflow: hidden !important;
    border: 0 !important;
    padding: 0 !important;
  }
  html body #header#header.lot4b-header.is-compact.is-nav-open .lot4b-header-bottom {
    grid-template-rows: minmax(0,1fr) !important;
    max-height: 180px !important;
    min-height: 44px !important;
    opacity: 1 !important;
    visibility: visible !important;
    transform: none !important;
    pointer-events: auto !important;
    overflow: visible !important;
    border-top: 1px solid var(--lot4b-header-soft-border) !important;
    box-shadow: 0 12px 28px var(--lot4b-header-menu-shadow) !important;
  }
  html body #header#header.lot4b-header.is-compact.is-nav-open .lot4b-header-bottom .lot4b-tabs-row {
    min-height: 44px !important;
    max-height: none !important;
    overflow: visible !important;
  }
}
@media (max-width: 900px) {
  /* Existing responsive layout and drawer remain authoritative. */
  html body #header#header.lot4b-header .lot4b-header-actions .lot4b-account-picker > .account-nav.is-user-avatar {
    flex-basis: 44px !important;
    width: 44px !important;
    min-width: 44px !important;
    height: 44px !important;
    min-height: 44px !important;
  }
}
@media (prefers-reduced-motion: reduce) {
  html body #header#header.lot4b-header.is-compact .lot4b-header-bottom {
    transition: none !important;
  }
}

/* Add to home screen: the steps window opened from the mobile menu (install-app.js) */
dialog#modal.lot4b-install-modal { width: min(520px, 94vw); padding: 20px; border-radius: 18px; overflow: auto; }
dialog#modal.lot4b-install-modal .dialog-close { display: inline-flex; align-items: center; justify-content: center; min-width: 48px; min-height: 48px; }
.lot4b-install-dialog h2 { font-size: 20px; margin: 0 0 8px; }
.lot4b-install-dialog p { margin: 0 0 12px; color: #334155; }
.lot4b-install-steps { display: grid; gap: 10px; margin: 0 0 16px; padding-inline-start: 22px; color: #0F172A; line-height: 1.7; }
dialog#modal .lot4b-install-dialog .lot4b-install-done { width: 100%; min-height: 48px !important; }

/* Home-screen installation banner in the page flow. */
/* Visibility is decided once in install-app.js, including iOS with an attached pointer. */
 html body .lot4b-install-banner { display: block; margin: 8px auto; padding: 8px 10px; width: min(520px, calc(100% - 16px)); box-sizing: border-box; border: 1px solid #e2e8f0; border-radius: 16px; background: #fff; color: #0f172a; }
 .lot4b-install-banner-row { display: flex; align-items: center; gap: 8px; }
 .lot4b-install-banner-row img { flex: 0 0 44px; width: 44px; height: 44px; border-radius: 10px; }
 .lot4b-install-banner-row > div { flex: 1; min-width: 0; }
 .lot4b-install-banner strong { font-size: 14px; line-height: 1.4; }
 .lot4b-install-banner p { margin: 2px 0 0; font-size: 12px; color: #64748b; }
 html body .lot4b-install-banner [data-install-dismiss] { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 44px; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 8px; background: transparent; color: #475569; font-size: 26px; }
 html body .lot4b-install-banner [data-install-app] { width: 100%; min-height: 44px; margin-top: 6px; padding: 8px 12px; border: 0; border-radius: 10px; background: #2563eb; color: #fff; font: inherit; font-weight: 700; }
 .lot4b-install-banner button:focus-visible { outline: 2px solid #0f172a; outline-offset: 2px; }
