/* ===============================================================
   Category/State header V1: UI-only patch, 27 October 2026.
   The HTML markup, auth handlers and voice-search JS are shared with homepage.
   No category text, state path, canonical, schema or MySQL touched.
   =============================================================== */
/* States landing ONLY — preserve homepage shared header's actual design.
   The header markup/links/auth come from partials/header.php unchanged.
   This file reverses overlapping explore.css mobile rules; no state data touched. */
@media (max-width:900px) {
 body.bv-taxonomy-home-header .site-header.bv-home-header .bv-home-head-grid {
   width:calc(100% - 22px)!important;
   max-width:none!important;
   margin-inline:11px!important;
   padding:6px 0!important;
   column-gap:5px!important;
   row-gap:6px!important;
   grid-template-columns:minmax(0,1fr) 33px 54px 103px!important;
   grid-template-areas:"brand help account list" "search search search ask"!important;
 }
 body.bv-taxonomy-home-header .site-header.bv-home-header .bv-home-brand {gap:4px!important;min-height:0!important;height:28px!important;min-width:0!important;}
 body.bv-taxonomy-home-header .site-header.bv-home-header .bv-home-brand .brand-name {font-size:15px!important;line-height:1!important;}
 body.bv-taxonomy-home-header .site-header.bv-home-header .bv-home-brand .brand-mark,
 body.bv-taxonomy-home-header .site-header.bv-home-header .bv-home-brand .brand-mark img {width:30px!important;height:28px!important;}
 body.bv-taxonomy-home-header .site-header.bv-home-header .bv-home-header-search {
   grid-area:search!important;
   width:100%!important;
   min-width:0!important;
   height:41px!important;
   padding:3px 5px!important;
   border:2px solid transparent!important;
   border-radius:13px!important;
   background:linear-gradient(#fff,#fafdff) padding-box,
     linear-gradient(111deg,#287ce1 0%,#9bcfff 46%,#ffcb85 74%,#f77402 100%) border-box!important;
 }
 body.bv-taxonomy-home-header .site-header.bv-home-header .bv-home-header-search:focus-within {
   background:linear-gradient(#fff,#fff) padding-box,
     linear-gradient(111deg,#146bd2,#559cf6 40%,#ffaf55 75%,#f77402) border-box!important;
 }
 body.bv-taxonomy-home-header .site-header.bv-home-header .bv-home-header-search input[type=search] {
   min-width:0!important;
   padding:0 5px!important;
   font-size:16px!important;
 }
 body.bv-taxonomy-home-header .site-header.bv-home-header .bv-home-ask {
   grid-area:ask!important;
   min-width:103px!important;
   width:103px!important;
   height:41px!important;
   padding:0 6px!important;
   font-size:10px!important;
   gap:5px!important;
 }
 body.bv-taxonomy-home-header .site-header.bv-home-header .bv-home-help {
   grid-area:help!important;
   width:33px!important;
   min-width:33px!important;
   height:34px!important;
   min-height:34px!important;
   padding:0!important;
   font-size:11px!important;
   background:linear-gradient(130deg,#e8f5ff,#fff)!important;
 }
 body.bv-taxonomy-home-header .site-header.bv-home-header .bv-home-account {
   grid-area:account!important;
   width:54px!important;
   min-width:54px!important;
   max-width:54px!important;
   height:34px!important;
   min-height:34px!important;
   padding:0 5px!important;
   font-size:10.5px!important;
   border:1px solid #b6d0f1!important;
   border-radius:9px!important;
   background:linear-gradient(135deg,#fff,#f7fbff)!important;
   display:inline-flex!important;
   align-items:center!important;
   justify-content:center!important;
 }
 body.bv-taxonomy-home-header .site-header.bv-home-header .bv-home-list-business {
   grid-area:list!important;
   width:103px!important;
   min-width:103px!important;
   min-height:35px!important;
   height:35px!important;
   padding:0 5px!important;
   font-size:10px!important;
   display:flex!important;
   align-items:center!important;
   justify-content:center!important;
 }
 /* Existing homepage authenticated-state layout; no links or sessions modified. */
 body.bv-taxonomy-home-header .site-header.bv-home-header .bv-home-head-grid:has(.bv-home-logout) {
   grid-template-columns:minmax(0,1fr) 33px minmax(74px,auto) minmax(58px,auto)!important;
 }
 body.bv-taxonomy-home-header .site-header.bv-home-header .bv-home-head-grid:has(.bv-home-logout) .bv-home-account {
   width:auto!important;min-width:74px!important;max-width:none!important;padding-inline:7px!important;
 }
 body.bv-taxonomy-home-header .site-header.bv-home-header .bv-home-logout {
   grid-area:list!important;display:inline-flex!important;align-items:center!important;justify-content:center!important;
   min-height:34px!important;height:34px!important;padding:0 7px!important;
 }
}
@media (max-width:360px) {
 body.bv-taxonomy-home-header .site-header.bv-home-header .bv-home-head-grid {
   column-gap:4px!important;row-gap:4px!important;
   grid-template-columns:minmax(0,1fr) 30px 48px 88px!important;
 }
 body.bv-taxonomy-home-header .site-header.bv-home-header .bv-home-brand {height:26px!important;}
 body.bv-taxonomy-home-header .site-header.bv-home-header .bv-home-brand .brand-name {font-size:12px!important;}
 body.bv-taxonomy-home-header .site-header.bv-home-header .bv-home-brand .brand-mark,
 body.bv-taxonomy-home-header .site-header.bv-home-header .bv-home-brand .brand-mark img {width:30px!important;height:26px!important;}
 body.bv-taxonomy-home-header .site-header.bv-home-header .bv-home-help {width:30px!important;min-width:30px!important;}
 body.bv-taxonomy-home-header .site-header.bv-home-header .bv-home-account {width:48px!important;min-width:48px!important;max-width:48px!important;}
 body.bv-taxonomy-home-header .site-header.bv-home-header .bv-home-list-business {width:88px!important;min-width:88px!important;font-size:8.5px!important;}
 body.bv-taxonomy-home-header .site-header.bv-home-header .bv-home-ask {min-width:88px!important;width:88px!important;gap:3px!important;}
 body.bv-taxonomy-home-header .site-header.bv-home-header .bv-home-head-grid:has(.bv-home-logout) {
   grid-template-columns:minmax(0,1fr) 30px minmax(70px,auto) minmax(54px,auto)!important;
 }
}




/* State-context L1: uses .clean-taxonomy-step rather than .taxonomy-root-directory.
   Present exactly the same V4 image-ready card design without modifying state PHP. */
body.bv-taxonomy-home-header .clean-taxonomy-step .category-grid-page {
  grid-template-columns:repeat(5,minmax(0,1fr)) !important;
  gap:11px !important;
  padding:0 0 10px !important;
}
body.bv-taxonomy-home-header .clean-taxonomy-step .category-card-page {
  min-width:0;
  display:flex !important;
  flex-direction:column;
  align-items:stretch;
  gap:7px !important;
  padding:9px !important;
  border:1px solid #dae7f5 !important;
  border-radius:17px !important;
  background:linear-gradient(170deg,#fff 0%,#fcfdff 76%,#f7faff 100%) !important;
  box-shadow:0 5px 14px rgba(24,81,152,.055) !important;
  position:relative;
  overflow:hidden;
  transform:none;
  transition:border-color .15s,transform .15s var(--hv4-ease),box-shadow .15s;
}
body.bv-taxonomy-home-header .clean-taxonomy-step .category-card-page:hover,
body.bv-taxonomy-home-header .clean-taxonomy-step .taxonomy-node-card:hover {
  transform:translateY(-2px) !important;
  border-color:#79b5f4 !important;
  box-shadow:0 12px 25px rgba(20,96,187,.11) !important;
}
body.bv-taxonomy-home-header .clean-taxonomy-step .category-card-page figure {
  display:block !important;
  width:100% !important;
  height:104px !important;
  flex:0 0 104px;
  margin:0 !important;
  border-radius:11px !important;
  overflow:hidden;
  background:radial-gradient(circle at 70% 30%,#dbeafa,#edf4fd 50%,#fff0e5);
}
body.bv-taxonomy-home-header .clean-taxonomy-step .category-card-page figure img {
  display:block !important;
  width:100% !important;
  height:100% !important;
  object-fit:cover !important;
  object-position:center !important;
}
body.bv-taxonomy-home-header .clean-taxonomy-step .category-card-copy {
  min-width:0;
  display:flex;
  flex:1 1 auto;
  flex-direction:column;
  align-items:stretch;
  text-align:left;
  gap:5px !important;
  padding:1px 2px 0 !important;
}
body.bv-taxonomy-home-header .clean-taxonomy-step .category-card-copy strong {
  font-size:13.2px !important;
  line-height:1.33 !important;
  font-weight:850;
  color:#103960 !important;
  overflow-wrap:anywhere;
}
body.bv-taxonomy-home-header .clean-taxonomy-step .category-card-copy small {
  display:block !important;
  font-size:10.7px !important;
  line-height:1.46 !important;
  color:#617993 !important;
  overflow:visible !important;
  text-overflow:clip !important;
  -webkit-line-clamp:unset !important;
  line-clamp:unset !important;
  max-height:none !important;
  white-space:normal !important;
}
body.bv-taxonomy-home-header .clean-taxonomy-step .category-card-meta {
  display:block;
  align-self:start;
  margin-top:auto !important;
  padding:5px 8px !important;
  border-radius:8px;
  color:#0e64bf !important;
  background:#eaf3ff !important;
  font-size:10px !important;
  font-weight:820 !important;
  white-space:normal !important;
}
body.bv-taxonomy-home-header .clean-taxonomy-step .category-card-arrow {
  position:absolute !important;
  right:14px !important;
  bottom:13px !important;
  color:#f27a26 !important;
  font-size:18px !important;
  font-weight:900 !important;
  opacity:1 !important;
}



/* Align State Hub's Browse Industries / Browse Products buttons to the page center.
   Earlier command CSS used justify-content:flex-start and margin:0!important. */
body.bv-states-command-ui .explore-hero.taxonomy-hero-compact>.shell {
    display:flex!important;flex-wrap:wrap!important;justify-content:center!important;
    align-items:center!important;
}
body.bv-states-command-ui .explore-hero.taxonomy-hero-compact .eyebrow {
    flex:1 1 100%!important;text-align:center!important;
}
body.bv-states-command-ui .explore-hero.taxonomy-hero-compact h1 {
    flex:1 1 100%!important;max-width:100%!important;text-align:center!important;
}
body.bv-states-command-ui .explore-hero.taxonomy-hero-compact .explore-toolbar {
    flex:1 1 100%!important;order:2!important;display:flex!important;flex-wrap:wrap!important;
    width:100%!important;max-width:100%!important;justify-content:center!important;
    align-self:center!important;margin:4px auto 0!important;
}
body.bv-states-command-ui .explore-hero.taxonomy-hero-compact p {
    order:3!important;flex:1 1 100%!important;max-width:100%!important;text-align:center!important;margin-inline:auto!important;
}
@media(max-width:650px) {
  body.bv-states-command-ui .explore-hero.taxonomy-hero-compact .explore-toolbar {
    flex:1 1 100%!important;width:100%!important;justify-content:center!important;
    margin:5px auto 0!important;
  }
}

/* State-context L1 categories: match the 5/4/3/2-column responsive V4 directory.
   L2 and L3 selector pages already match via original V4 .taxonomy-grid rules. */
@media(min-width:1500px) {
 body.bv-taxonomy-home-header .clean-taxonomy-step .category-grid-page{grid-template-columns:repeat(6,minmax(0,1fr))!important;}
}
@media(max-width:1100px) {
 body.bv-taxonomy-home-header .clean-taxonomy-step .category-grid-page{grid-template-columns:repeat(4,minmax(0,1fr))!important;}
}
@media(max-width:820px) {
 body.bv-taxonomy-home-header .clean-taxonomy-step .category-grid-page{grid-template-columns:repeat(3,minmax(0,1fr))!important;}
}
@media(max-width:600px) {
 body.bv-taxonomy-home-header .clean-taxonomy-step .category-grid-page{grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:8px!important;}
 body.bv-taxonomy-home-header .clean-taxonomy-step .category-card-page{padding:7px!important;gap:6px!important;border-radius:13px!important;}
 body.bv-taxonomy-home-header .clean-taxonomy-step .category-card-page figure{height:86px!important;flex-basis:86px!important;border-radius:9px!important;}
 body.bv-taxonomy-home-header .clean-taxonomy-step .category-card-copy strong{font-size:12px!important;}
 body.bv-taxonomy-home-header .clean-taxonomy-step .category-card-copy small{font-size:10px!important;line-height:1.38!important;}
 body.bv-taxonomy-home-header .clean-taxonomy-step .category-card-meta{font-size:9.4px!important;padding:4px 6px!important;}
}
/* Matching L1 offscreen paint optimization; all 50 links remain in the initial HTML. */
@supports(content-visibility:auto) {
  body.bv-taxonomy-home-header .clean-taxonomy-step .category-grid-page [data-taxonomy-node]:nth-child(n+16) {content-visibility:auto;contain-intrinsic-size:auto 170px;}
}
body.bv-taxonomy-home-header .clean-taxonomy-step [data-taxonomy-node][hidden]{display:none!important;}

/* =====================================================================
   Taxonomy Header V1 — Voice search CSP-safe visual styles.
   Homepage uses these through dynamically injected CSS in index.js.
   states.php has a stricter style-src-elem 'self' and style-src-attr
   'none', which blocks index.js's <style> and positioning attributes.
   Mirror the VISUAL CSS externally; NEVER relax CSP / edit index.js.
   Original state UI, SEO and taxonomy styling are preserved above.
   ===================================================================== */
body.bv-taxonomy-home-header #bv-home-header-search.bv-voice-ready {
  position: relative !important;
}
body.bv-taxonomy-home-header #bv-home-header-search.bv-voice-ready > .bv-voice-indicator {
  position: absolute !important;
  z-index: 12 !important;
  display: none !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 9px !important;
  box-sizing: border-box !important;
  /* JS sets inline left/top/width only on less-strict pages; use a fixed
     CSS fallback because style-src-attr 'none' blocks those on states. */
  top: 50% !important;
  left: 43px !important;
  right: 52px !important;
  width: auto !important;
  max-width: calc(100% - 95px) !important;
  height: 34px !important;
  margin: 0 !important;
  padding: 5px 12px !important;
  transform: translateY(-50%) !important;
  border: 1px solid #c7dcff !important;
  border-radius: 999px !important;
  background: rgba(247,251,255,.98) !important;
  box-shadow: 0 3px 15px rgba(35,101,178,.12) !important;
  color: #1459a8 !important;
  font: 600 13px/1.25 system-ui,-apple-system,BlinkMacSystemFont,'Segoe UI',sans-serif !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  pointer-events: none !important;
  user-select: none !important;
}
/* Exact state switch used by original index.js: neither data-bv-voice-bound
   nor bv-voice-ready means the microphone has started listening. */
body.bv-taxonomy-home-header #bv-home-header-search.bv-voice-ready > .bv-voice-indicator.is-visible {
  display: flex !important;
}
body.bv-taxonomy-home-header #bv-home-header-search .bv-voice-indicator .bv-voice-dot {
  flex: 0 0 8px !important;
  width: 8px !important;
  height: 8px !important;
  border-radius: 50% !important;
  background: #ef4444 !important;
  box-shadow: 0 0 0 3px rgba(239,68,68,.12) !important;
  animation: bv-voice-pulse 1.1s ease-in-out infinite;
}
body.bv-taxonomy-home-header #bv-home-header-search .bv-voice-indicator .bv-voice-bars {
  display: flex !important;
  align-items: center !important;
  gap: 2px !important;
  height: 14px !important;
}
body.bv-taxonomy-home-header #bv-home-header-search .bv-voice-indicator .bv-voice-bars span {
  display: block !important;
  width: 3px !important;
  height: 5px !important;
  background: #2779dc !important;
  border-radius: 5px !important;
  animation: bv-voice-wave .8s ease-in-out infinite alternate;
}
body.bv-taxonomy-home-header #bv-home-header-search .bv-voice-indicator .bv-voice-bars span:nth-child(2) {
  animation-delay: .18s;
}
body.bv-taxonomy-home-header #bv-home-header-search .bv-voice-indicator .bv-voice-bars span:nth-child(3) {
  animation-delay: .35s;
}
body.bv-taxonomy-home-header #bv-home-header-search .bv-voice-indicator.is-processing .bv-voice-dot {
  background: #2781e7 !important;
  animation: none !important;
}
body.bv-taxonomy-home-header #bv-home-header-search .bv-voice-indicator.is-processing .bv-voice-bars span {
  animation-duration: 1.5s;
}
body.bv-taxonomy-home-header #bv-home-header-search.bv-voice-ready .bv-voice-input-active {
  color: transparent !important;
  caret-color: transparent !important;
}
body.bv-taxonomy-home-header #bv-home-header-search.bv-voice-ready .bv-voice-input-active::placeholder {
  color: transparent !important;
}
body.bv-taxonomy-home-header #bv-home-header-search .bv-voice-trigger-active {
  color: #0d67c7 !important;
  filter: drop-shadow(0 0 4px rgba(38,116,220,.32)) !important;
}
@keyframes bv-voice-pulse {
  0%,100% { opacity:1; transform:scale(1); }
  50% { opacity:.45; transform:scale(.75); }
}
@keyframes bv-voice-wave {
  0%,100% { height:4px; }
  50% { height:13px; }
}
@media (max-width: 480px) {
  body.bv-taxonomy-home-header #bv-home-header-search.bv-voice-ready > .bv-voice-indicator {
    left: 31px !important;
    right: 39px !important;
    max-width: calc(100% - 70px) !important;
    height: 30px !important;
    padding: 4px 6px !important;
    gap: 4px !important;
    font-size: 10.5px !important;
  }
}
@media (prefers-reduced-motion: reduce) {
  body.bv-taxonomy-home-header #bv-home-header-search .bv-voice-indicator .bv-voice-dot,
  body.bv-taxonomy-home-header #bv-home-header-search .bv-voice-indicator .bv-voice-bars span {
    animation: none !important;
  }
}

