/* Homepage navigation: Products photo menu, Blog and Compare disclosures, mobile drawer */
.bs-nav-root {
  --nav-ink: #102c48;
  --nav-blue: #1a6faf;
  --nav-border: #d8e3ed;
  --nav-focus: #f5a623;
}
.bs-sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}
.bs-nav-item { position: relative; display: inline-flex; align-items: center; align-self: stretch; }
.bs-nav-item > details { display: flex; align-items: center; }
.bs-nav-item > details > summary, .bs-nav-item > .bs-nav-link {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0;
  color: #33485b;
  font: 500 .9rem/1.25 "DM Sans", sans-serif;
  cursor: pointer;
  text-decoration: none;
}
.bs-nav-root :is(.bs-nav-item, .bs-mobile-fold, .bs-product-picker) summary { list-style: none; }
.bs-nav-root :is(.bs-nav-item, .bs-mobile-fold, .bs-product-picker) summary::-webkit-details-marker { display: none; }
.bs-nav-item > details > .bs-nav-caret-only { min-width: 24px; justify-content: center; }
.bs-nav-item > details > summary:hover, .bs-nav-item > details[open] > summary,
.bs-nav-item:has(details[open]) > .bs-nav-link { color: var(--nav-blue); }
.bs-nav-chevron {
  display: inline-block;
  width: 7px;
  height: 7px;
  flex: none;
  margin: 0 2px 3px;
  border: solid currentColor;
  border-width: 0 1.5px 1.5px 0;
  transform: rotate(45deg);
  transition: transform .15s ease-out;
}
details[open] > summary > .bs-nav-chevron { transform: translateY(3px) rotate(225deg); }

/* Desktop panels. The panel is a child of the nav item, so there is no hover gap. */
.bs-nav-panel {
  position: absolute;
  z-index: 50;
  top: 100%;
  left: var(--nav-offset, 0);
  box-sizing: border-box;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior-y: contain;
  max-height: calc(100vh - 86px);
  max-height: var(--nav-space, calc(100dvh - 86px));
  scroll-padding-block: 8px;
  scrollbar-width: thin;
  scrollbar-color: #91a6b9 transparent;
  border: 1px solid var(--nav-border);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 12px 32px rgb(16 44 72 / 16%);
}
.bs-nav-item > details[open] > .bs-nav-panel { animation: bs-nav-in .16s ease-out; }
@keyframes bs-nav-in { from { opacity: 0; transform: translateY(-3px); } to { opacity: 1; transform: none; } }
.bs-nav-panel--list {
  width: max-content;
  min-width: 210px;
  max-width: min(320px, calc(100vw - 24px));
  max-height: min(25rem, var(--nav-space, calc(100dvh - 86px)));
  padding: 6px;
  /* Scroll cue: the shadows appear only when more links sit above or below */
  background:
    linear-gradient(#fff 30%, rgb(255 255 255 / 0)) top / 100% 28px no-repeat local,
    linear-gradient(rgb(255 255 255 / 0), #fff 70%) bottom / 100% 28px no-repeat local,
    radial-gradient(farthest-side at 50% 0, rgb(16 44 72 / 16%), transparent) top / 100% 10px no-repeat scroll,
    radial-gradient(farthest-side at 50% 100%, rgb(16 44 72 / 16%), transparent) bottom / 100% 10px no-repeat scroll,
    #fff;
}
.bs-nav-root .bs-nav-panel--list > a, .bs-nav-root .bs-mobile-links > a {
  display: flex;
  align-items: center;
  min-height: 42px;
  padding: 8px 12px;
  color: #243c51;
  font: 500 .9rem/1.35 "DM Sans", sans-serif;
  text-decoration: none;
  border-radius: 6px;
  white-space: normal;
}
.bs-nav-root .bs-nav-panel--list > a:is(:hover, :focus-visible),
.bs-nav-root .bs-mobile-links > a:is(:hover, :focus-visible) { background: #edf3f8; color: var(--nav-blue); }
.bs-nav-root .bs-nav-panel a::after { content: none; }

/* Products: compact dark photo picker, brand navy */
.bs-nav-panel--products { width: min(790px, calc(100vw - 24px)); border-color: var(--nav-ink); background: var(--nav-ink); }
.bs-product-picker { padding: 16px; background: var(--nav-ink); color: #fff; }
.bs-product-picker ul { list-style: none; margin: 0; padding: 0; }
.bs-product-picker li { list-style: none; min-width: 0; margin: 0; padding: 0; }
.bs-product-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.bs-nav-root .bs-product-picker a.bs-product-card {
  position: relative;
  display: block;
  border: 1px solid #4d6479;
  border-radius: 10px;
  overflow: hidden;
  background: #1c3951;
  color: #fff;
  text-decoration: none;
}
.bs-product-picture {
  display: block;
  width: 100%;
  aspect-ratio: 7 / 5;
  background-color: #38556e;
  background-image: url("./product-categories.jpg");
  background-size: 400% 200%;
  background-repeat: no-repeat;
  background-position: var(--pic-x) var(--pic-y);
  transition: transform .25s ease-out;
}
.bs-product-caption {
  position: absolute;
  inset: auto 0 0;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 6px;
  padding: 22px 10px 8px;
  background: linear-gradient(to top, rgb(16 44 72 / 94%) 0%, rgb(16 44 72 / 78%) 55%, rgb(16 44 72 / 0) 100%);
  color: #fff;
  font: 600 14px/1.25 "DM Sans", sans-serif;
  text-shadow: 0 1px 2px rgb(0 0 0 / 35%);
}
.bs-product-arrow {
  display: grid; place-items: center; flex: none;
  width: 22px; height: 22px;
  border: 1px solid rgb(255 255 255 / 55%);
  border-radius: 50%;
  font-size: 12px; line-height: 1; text-shadow: none;
}
.bs-nav-root .bs-product-picker a.bs-product-card:is(:hover, :focus-visible) { border-color: var(--nav-focus); color: #fff; }
.bs-product-card:is(:hover, :focus-visible) .bs-product-picture { transform: scale(1.04); }
.bs-product-card:is(:hover, :focus-visible) .bs-product-arrow { background: var(--nav-focus); color: var(--nav-ink); border-color: var(--nav-focus); }

/* Category icons from the owner's pack (one local sprite, original colours).
   Navy-stroked artwork, so every icon on the navy picker sits on a light tile. */
.bs-cat-icon {
  display: block; flex: none; box-sizing: border-box;
  width: 24px; height: 24px; min-width: 0; min-height: 0;
  overflow: visible; pointer-events: none;
}
.bs-cat-icon--group, .bs-cat-icon--type { border-radius: 7px; background: #eef5fb; box-shadow: inset 0 0 0 1px rgb(255 255 255 / 70%); }
.bs-cat-icon--group { width: 30px; height: 30px; padding: 4px; }
.bs-cat-icon--type { width: 26px; height: 26px; padding: 3px; border-radius: 6px; }
.bs-category-name { display: inline-flex; align-items: center; gap: 10px; min-width: 0; }
/* The trailing circle on each photo card carries that category's icon */
.bs-product-arrow--icon { width: 32px; height: 32px; padding: 4px; box-sizing: border-box; border: 1.5px solid #fff; background: #f4f8fc; box-shadow: 0 1px 4px rgb(0 0 0 / 30%); }
.bs-product-arrow--icon .bs-cat-icon { width: 100%; height: 100%; }
.bs-product-card:is(:hover, :focus-visible) .bs-product-arrow--icon { background: #fff; border-color: var(--nav-focus); box-shadow: 0 0 0 2px var(--nav-focus); }
/* Homepage "What are you shopping for?" cards */
.category-card__icon .bs-cat-icon--home { width: 44px; height: 44px; margin-inline: auto; }

/* All categories directory and Latest activity */
.bs-nav-directory { margin-top: 12px; border-top: 1px solid #496076; }
.bs-nav-directory > summary, .bs-category-group > summary {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  min-height: 44px; padding: 6px 3px; cursor: pointer;
  color: #f6f9fc; font: 600 14px/1.35 "DM Sans", sans-serif;
}
.bs-directory-count, .bs-group-count { margin-left: 6px; color: #b8c8d6; font-weight: 400; font-size: 12px; }
.bs-category-groups { margin-top: 4px; padding-inline: 10px; border-radius: 8px; background: #1c3951; }
.bs-category-group + .bs-category-group { border-top: 1px solid #455c70; }
.bs-category-group > summary { font-weight: 500; }
.bs-category-group ul { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2px 10px; padding-bottom: 8px; }
.bs-nav-root .bs-product-picker :is(.bs-nav-directory, .bs-recent-links) a {
  display: flex; align-items: center; gap: 8px; min-height: 40px;
  padding: 4px 6px; border-radius: 4px;
  color: #ebf3fa; font: 400 14px/1.4 "DM Sans", sans-serif; text-decoration: none;
}
.bs-nav-root .bs-product-picker :is(.bs-nav-directory, .bs-recent-links) a:is(:hover, :focus-visible) {
  background: #324f69; color: #fff; text-decoration: underline; text-underline-offset: 3px;
}
.bs-category-status {
  margin-left: auto; flex: none;
  padding: 1px 6px; border-radius: 999px;
  background: rgb(245 166 35 / 16%); color: #f3d9a6;
  font-size: 11px; font-weight: 600; text-decoration: none;
}
.bs-recent-links { margin-top: 12px; padding-top: 10px; border-top: 1px solid #496076; }
.bs-recent-title { margin: 0 0 4px; padding: 0 6px; color: #f6f9fc; font: 600 14px/1.4 "DM Sans", sans-serif; }
.bs-recent-links ul { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px 10px; }
.bs-nav-root .bs-product-picker .bs-recent-links a { flex-direction: column; align-items: flex-start; justify-content: flex-start; gap: 2px; height: 100%; padding: 6px; }
.bs-recent-text { font-size: 13px; line-height: 1.35; }
.bs-recent-meta { color: #b8c8d6; font-size: 12px; }

/* Focus */
.bs-nav-root :is(.bs-nav-item, .bs-mobile-fold) :is(a, summary):focus-visible { outline: 2px solid var(--nav-blue); outline-offset: -2px; }
.bs-nav-root .bs-nav-item > :is(details > summary, .bs-nav-link):focus-visible { outline-offset: 3px; border-radius: 4px; }
.bs-nav-root .bs-product-picker :is(a, summary):focus-visible { outline: 2px solid var(--nav-focus); outline-offset: -3px; }

@media (min-width: 1025px) and (max-width: 1360px) {
  .bs-nav-root .navbar__inner { gap: 12px; padding-inline: 16px; }
  .bs-nav-root .navbar__logo-img { max-width: clamp(142px, calc(26vw - 124px), 220px); }
  .bs-nav-root .navbar__links { gap: clamp(4px, calc(4vw - 42px), 14px); }
  .bs-nav-root .navbar__actions { gap: 6px; }
  .bs-nav-root .navbar__actions .navbar__action-link { padding-inline: 12px; }
}

/* Mobile drawer: one scroll region, Products, Blog and Compare first */
.bs-nav-root .navbar__mobile-panel { max-height: var(--bs-drawer-space, calc(100dvh - 72px)); overflow-y: auto; overscroll-behavior-y: contain; }
.bs-mobile-fold { border-bottom: 1px solid var(--nav-border); }
.bs-mobile-fold > summary {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  min-height: 48px; padding: 5px 8px; cursor: pointer;
  color: #193c59; font: 600 16px/1.3 "DM Sans", sans-serif;
}
.bs-mobile-fold > .bs-product-picker { margin: 0 0 8px; padding: 10px; border-radius: 10px; }
.bs-mobile-fold .bs-product-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.bs-mobile-fold .bs-product-caption { padding: 18px 7px 6px; font-size: 13px; }
.bs-mobile-fold .bs-product-arrow--icon { width: 28px; height: 28px; padding: 3px; }
.bs-mobile-fold .bs-category-group ul, .bs-mobile-fold .bs-recent-links ul { grid-template-columns: minmax(0, 1fr); }
.bs-mobile-links { display: grid; margin: 0 4px 8px; padding: 3px 6px; border-radius: 8px; background: #f4f7fa; }

/* Homepage statistics: two editorial links */
.stats-bar a.bs-stat-link {
  display: flex; flex-direction: column; align-items: center;
  min-height: 48px; height: 100%;
  color: #fff; text-decoration: none;
}
.stats-bar .bs-stat-link .stat-item__number {
  display: grid;
  place-items: center;
  min-height: clamp(2.8rem, 6vw, 3.6rem);
  font: 400 clamp(20px, 2vw, 30px)/1.14 "DM Serif Display", Georgia, serif;
  text-wrap: balance;
}
.bs-stat-link:hover .stat-item__label { text-decoration: underline; text-underline-offset: 4px; }
.stats-bar .bs-stat-link:focus-visible { outline: 2px solid var(--nav-focus, #f5a623); outline-offset: 3px; border-radius: 4px; }
bs-research-count[data-state="unavailable"] { font-size: .5em; letter-spacing: 0; }
/* Sits in the navy About section, styled like the team cards beside it */
.bs-funding-note {
  scroll-margin-block-start: 92px;
  margin-block: 4px 24px;
  padding: 16px 18px;
  border: 1px solid rgb(255 255 255 / 14%);
  border-left: 3px solid #f5a623;
  border-radius: 0 12px 12px 0;
  background: rgb(255 255 255 / 6%);
}
.bs-funding-note h3 { color: #fff; margin: 0 0 6px; font: 400 24px/1.2 "DM Serif Display", Georgia, serif; }
.bs-funding-note p { margin: 0; max-width: 62ch; color: rgb(255 255 255 / 82%); font-size: 15px; line-height: 1.6; }
.bs-funding-note strong { color: #fff; font-weight: 600; }
.bs-funding-note a { color: #f5a623; text-decoration: underline; text-underline-offset: 3px; }
.bs-funding-note a:focus-visible { outline: 2px solid #f5a623; outline-offset: 2px; border-radius: 2px; }
#homepage-statistics, #homepage-categories { scroll-margin-block-start: 80px; }
#categories-heading { scroll-margin-block-start: 9rem; }

@media (prefers-reduced-motion: reduce) {
  .bs-nav-root :is(.bs-nav-panel, .bs-nav-chevron, .bs-product-picture) { animation: none !important; transition: none !important; }
  .bs-product-card:is(:hover, :focus-visible) .bs-product-picture { transform: none; }
}
