/* "Brand filter" category menu (t389u option B, t390u). Loaded only when the site uses it
   (settings.nav_menu.style = brand_filter; Sparesbase by default). Markup: templates/base/partials/nav_brand_filter.twig,
   behaviour: themes/base/js/nav-brand-filter.js (hover-intent / click open, Esc, click outside). */
.has-bf { position: static; }
.site-nav .container { position: relative; }
.has-bf.is-open > .site-nav__link { color: var(--brand-accent); }
.nbf {
  position: absolute; left: 0; right: 0; top: 100%; z-index: 60;
  display: flex; flex-direction: column; max-height: min(56vh, 480px);
  background: #fff; border: 1px solid #e6e6e6; border-top: 3px solid var(--brand-accent);
  box-shadow: 0 12px 28px rgb(0 0 0 / .16); text-align: left; color: #1c1c1b;
}
.nbf[hidden] { display: none; }
.nbf__search {
  display: flex; align-items: center; gap: 10px; flex: none;
  margin: 14px 22px 6px; padding: 0 12px; border: 2px solid var(--brand-accent); border-radius: 4px; background: #fff;
}
.nbf__search .material-icons { color: var(--brand-accent); }
.nbf__input { flex: 1; min-width: 0; border: 0; outline: 0; padding: 9px 0; font: inherit; font-size: .9rem; background: transparent; }
.nbf__input::-webkit-search-cancel-button { cursor: pointer; }
.nbf__hint { font-size: .75rem; color: #888; white-space: nowrap; }
.nbf__body { flex: 1; min-height: 0; overflow: auto; overscroll-behavior: contain; padding: 0 22px; }
.nbf__h, .nbf__results h4 { margin: 12px 0 8px; font-size: .72rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: #888; }
.nbf__tiles { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(var(--nbf-tiles, 8), minmax(0, 1fr)); gap: 8px; }
.nbf__tile {
  display: flex; flex-direction: column; align-items: center; justify-content: center; height: 58px; padding: 0 6px;
  border: 1px solid #e3e3e3; border-radius: 4px; background: #fafafa; color: #1c1c1b; text-decoration: none; text-align: center;
}
.nbf__tile strong { font-size: .9rem; line-height: 1.15; }
.nbf__tile span { font-size: .7rem; color: #888; }
.nbf__tile:hover, .nbf__tile:focus-visible { border-color: var(--brand-accent); color: var(--brand-accent); background: #fff; }
.nbf__all { list-style: none; margin: 0 0 10px; padding: 0; columns: 7 140px; column-gap: 16px; }
.nbf__all li { break-inside: avoid; }
.nbf__all a { display: block; padding: 2px 0; font-size: .8rem; color: #333; text-decoration: none; }
.nbf__all em { font-style: normal; color: #aaa; font-size: .7rem; }
.nbf__all a:hover, .nbf__all a:focus-visible { color: var(--brand-accent); }
.nbf__results { padding: 0 0 12px; }
.nbf__groups { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 4px 24px; }
.nbf__group h5 { margin: 10px 0 5px; font-size: .82rem; }
.nbf__group h5 a { color: #1c1c1b; text-decoration: none; }
.nbf__group h5 a:hover, .nbf__group h5 a:focus-visible { color: var(--brand-accent); text-decoration: underline; }
.nbf__group ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.nbf__group ul a { display: inline-block; padding: 4px 10px; border: 1px solid #e3e3e3; border-radius: 14px; font-size: .78rem; color: #333; text-decoration: none; }
.nbf__group ul a:hover, .nbf__group ul a:focus-visible { border-color: var(--brand-accent); color: var(--brand-accent); }
.nbf__group ul .nbf__more a { border-style: dashed; color: var(--brand-accent); font-weight: 700; }
.nbf__results mark { background: #fde3e2; color: inherit; }
.nbf__empty { margin: 14px 0; font-size: .85rem; color: #555; }
.nbf__empty a { color: var(--brand-accent); font-weight: 700; }
.nbf__foot {
  display: flex; flex-wrap: wrap; gap: 4px 16px; align-items: center; flex: none;
  padding: 9px 22px; border-top: 1px solid #eee; background: #f7f7f7; font-size: .78rem; color: #777;
}
.nbf__foot a { font-weight: 700; color: var(--brand-accent); text-decoration: none; }
.nbf__foot a:hover { text-decoration: underline; }

/* compact (scrolled) header: the nav is the narrow burger panel, so the brand panel opens inline under its tab */
@media (min-width: 768px) {
  .site-header.is-compact .nbf { position: static; max-height: none; box-shadow: none; border-left: 0; border-right: 0; }
  .site-header.is-compact .nbf__search { margin: 10px 12px 4px; }
  .site-header.is-compact .nbf__hint { display: none; }
  .site-header.is-compact .nbf__body { padding: 0 12px; max-height: 50vh; }
  .site-header.is-compact .nbf__tiles { grid-template-columns: 1fr 1fr; }
  .site-header.is-compact .nbf__all { columns: 2; }
  .site-header.is-compact .nbf__groups { grid-template-columns: 1fr; }
  .site-header.is-compact .nbf__foot { padding: 8px 12px; }
  .site-header.is-compact .nbf__foot span { display: none; }
}
@media (min-width: 768px) and (max-width: 1100px) {
  .site-header:not(.is-compact) .nbf__tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 767px) { .nbf { display: none !important; } }
