/* Site header (inc/bafbox-header.php, template-parts/site-header.php, static/js/bafbox-header.js) */
.bbh-topbar, .bbh-header {
  --bbh-ink: #4C341A; --bbh-muted: #8E6B48; --bbh-line: #EADBC0; --bbh-sand: #F9F1E0; --bbh-paper: #fff; --bbh-cream: #FFFAF0;
  --bbh-blue: #4B59A7; --bbh-blue-deep: #27356F; --bbh-blue-50: #EDEEFF; --bbh-yellow: #FFC92C; --bbh-red: #AF342D; --bbh-red-deep: #8E2621;
  font-family: "Jost", sans-serif;
}
/* same width as .container--box, so the header lines up with the page content */
.bbh-wrap { width: 90%; margin-inline: auto; }
@media (min-width: 1440px) { .bbh-wrap { width: 100%; max-width: 83.75rem; } }
.bbh-icon { width: 1.25em; height: 1.25em; flex: none; }
.bbh-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.bbh-topbar a:focus-visible, .bbh-topbar button:focus-visible, .bbh-header a:focus-visible, .bbh-header button:focus-visible, .bbh-header input:focus-visible {
  outline: 3px solid var(--bbh-blue); outline-offset: 2px; border-radius: 8px;
}

/* top bar */
.bbh-topbar { background: var(--bbh-blue-deep); color: var(--bbh-cream); font-size: .88rem; line-height: 1.3; position: relative; z-index: 1000; }
.bbh-topbar .bbh-wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 40px; }
.bbh-usps { display: flex; gap: 28px; list-style: none; margin: 0; padding: 0; min-width: 0; overflow: hidden; }
.bbh-usps li:nth-child(n+4) { display: none; } /* at most 3 side by side; the switches must stay visible */
.bbh-usps li { display: flex; align-items: center; gap: .45em; white-space: nowrap; }
.bbh-usps strong { color: var(--bbh-yellow); font-weight: 600; }
.bbh-usps a { color: inherit; text-decoration: underline; }
.bbh-locale { display: flex; gap: 6px; flex: none; }
.bbh-dd { position: relative; }
.bbh-dd-btn {
  display: flex; align-items: center; gap: 7px; border: 0; background: rgba(255, 250, 240, .1); color: var(--bbh-cream);
  border-radius: 8px; padding: 5px 9px 5px 8px; font-size: .86rem; font-weight: 500; line-height: 1; cursor: pointer;
}
.bbh-dd-btn:hover, .bbh-dd-btn[aria-expanded="true"] { background: rgba(255, 250, 240, .2); }
.bbh-chev { width: 12px; height: 12px; transition: rotate .15s; }
.bbh-dd-btn[aria-expanded="true"] .bbh-chev { rotate: 180deg; }
.bbh-flag { width: 20px; height: 14px; border-radius: 3px; flex: none; box-shadow: 0 0 0 1px rgba(0, 0, 0, .15); }
.bbh-cur { font-weight: 700; color: var(--bbh-yellow); min-width: 1.1em; text-align: center; }
.bbh-dd-menu {
  position: absolute; right: 0; top: calc(100% + 6px); min-width: 190px; background: var(--bbh-paper); color: var(--bbh-ink);
  border-radius: 12px; padding: 6px; list-style: none; margin: 0; box-shadow: 0 14px 36px rgba(39, 53, 111, .22); z-index: 1001;
}
.bbh-dd-menu a {
  display: flex; align-items: center; gap: 10px; border-radius: 8px; padding: 9px 10px; font-size: .92rem; color: var(--bbh-ink); text-decoration: none;
}
.bbh-dd-menu a:hover, .bbh-dd-menu a:focus-visible { background: var(--bbh-blue-50); }
.bbh-dd-menu a[aria-checked="true"] { font-weight: 600; }
.bbh-dd-menu .bbh-icon { margin-left: auto; color: var(--bbh-blue); visibility: hidden; }
.bbh-dd-menu a[aria-checked="true"] .bbh-icon { visibility: visible; }
.bbh-dd-menu .bbh-cur { color: var(--bbh-blue); }

/* main row (sticky: base.css header.sticky-header, z-index 999) */
.bbh-header { background: var(--bbh-paper); border-bottom: 1px solid var(--bbh-line); }
.bbh-row { display: flex; align-items: center; gap: 20px; min-height: 72px; }
.bbh-logo { display: flex; flex-direction: column; text-decoration: none; flex: none; }
.bbh-logo img { height: 38px; width: auto; display: block; }
/* the subtitle spans exactly the lettering of the logo (B left edge → X right edge) */
.bbh-logo small { font-size: 15.7px; line-height: 1.2; white-space: nowrap; color: var(--bbh-blue); margin-top: 3px; padding-left: 0; }
.bbh-logo--xmas small { font-size: 12.25px; padding-left: 8px; letter-spacing: 0; }
.bbh-nav { margin-inline: auto; }
.bbh-nav ul { display: flex; gap: 2px; list-style: none; margin: 0; padding: 0; }
.bbh-nav a {
  display: block; white-space: nowrap; padding: .5em .75em; border-radius: 999px; text-decoration: none; font-weight: 500;
  color: var(--bbh-blue-deep); font-size: 1rem; line-height: 1.5;
}
.bbh-nav a:hover, .bbh-nav a[aria-current="page"] { background: var(--bbh-blue-50); color: var(--bbh-blue-deep); }
.bbh-nav .bbh-hl a { background: var(--bbh-red); color: var(--bbh-cream); }
.bbh-nav .bbh-hl a:hover, .bbh-nav .bbh-hl a[aria-current="page"] { background: var(--bbh-red-deep); color: var(--bbh-cream); }
.bbh-actions { display: flex; align-items: center; gap: 6px; }
.bbh-icon-btn {
  position: relative; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 999px; border: 0;
  background: transparent; color: var(--bbh-blue-deep); cursor: pointer; text-decoration: none; flex: none;
}
.bbh-icon-btn:hover, .bbh-icon-btn[aria-expanded="true"] { background: var(--bbh-blue-50); color: var(--bbh-blue-deep); }
.bbh-badge {
  position: absolute; top: 3px; right: 1px; min-width: 19px; height: 19px; padding: 0 5px; border-radius: 999px;
  background: var(--bbh-yellow); color: var(--bbh-ink); font-size: .72rem; font-weight: 700; display: grid; place-items: center; line-height: 1;
}
.bbh-badge.hidden { display: none; }
.bbh-cart-sum { font-weight: 600; color: var(--bbh-blue-deep); font-size: .95rem; margin-right: 8px; font-variant-numeric: tabular-nums; white-space: nowrap; text-decoration: none; }
.bbh-cart-sum[hidden] { display: none; }
.bbh-cta {
  display: inline-flex; align-items: center; justify-content: center; gap: .5em; border-radius: 999px; font-weight: 600;
  text-decoration: none; padding: .85em 1.5em; font-size: 1rem; line-height: 1.1; white-space: nowrap;
  background: var(--bbh-blue); color: var(--bbh-cream); transition: background .15s ease;
}
.bbh-cta:hover { background: var(--bbh-blue-deep); color: var(--bbh-cream); }
.bbh-burger { display: none; }
.bbh-burger .bbh-icon + .bbh-icon { display: none; }
.bbh-burger[aria-expanded="true"] .bbh-icon:first-child { display: none; }
.bbh-burger[aria-expanded="true"] .bbh-icon + .bbh-icon { display: block; }

/* search */
.bbh-search { border-top: 1px solid var(--bbh-line); background: var(--bbh-paper); }
.bbh-search form { display: flex; align-items: center; gap: 10px; padding: 12px 0; color: var(--bbh-blue-deep); }
.bbh-search input[type="search"] {
  flex: 1; min-width: 0; border: 2px solid var(--bbh-line); border-radius: 999px; padding: .6em 1em; font: inherit; font-size: 1rem;
  color: var(--bbh-ink); background: var(--bbh-cream); outline: none;
}
.bbh-search input[type="search"]:focus { border-color: var(--bbh-blue); }
.bbh-search-go { border: 0; border-radius: 999px; background: var(--bbh-yellow); color: var(--bbh-ink); font-weight: 600; padding: .7em 1.3em; cursor: pointer; font: inherit; font-weight: 600; }

/* phone drawer */
.bbh-drawer { border-top: 1px solid var(--bbh-line); background: var(--bbh-paper); max-height: calc(100vh - 60px); overflow-y: auto; }
.bbh-drawer ul { list-style: none; margin: 0; padding: 8px 0; display: grid; }
.bbh-drawer li a {
  display: flex; justify-content: space-between; padding: 12px 0; border-bottom: 1px solid var(--bbh-sand); text-decoration: none;
  font-weight: 500; color: var(--bbh-blue-deep); font-size: 1.05rem;
}
.bbh-drawer .bbh-hl a { color: var(--bbh-red); }
.bbh-cta--drawer { width: 100%; margin: 8px 0 4px; }
.bbh-prefs { display: grid; gap: 10px; padding: 14px 0 18px; }
.bbh-prefs > div { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.bbh-prefs > div > span { font-size: .9rem; color: var(--bbh-muted); }
.bbh-seg { display: inline-flex; background: var(--bbh-sand); border-radius: 999px; padding: 3px; }
.bbh-seg a { border-radius: 999px; padding: .4em .95em; font-weight: 600; font-size: .88rem; color: var(--bbh-muted); display: flex; gap: 6px; align-items: center; text-decoration: none; }
.bbh-seg a[aria-checked="true"] { background: var(--bbh-paper); color: var(--bbh-ink); box-shadow: 0 2px 6px rgba(76, 52, 26, .12); }
.bbh-linguise { display: none !important; }

@media (max-width: 1100px) {
  .bbh-nav { display: none; }
  .bbh-burger { display: grid; margin-left: -10px; }
  .bbh-actions { margin-left: auto; }
}
@media (max-width: 1240px) and (min-width: 901px) {
  .bbh-usps li:nth-child(n+3) { display: none; }
}
@media (max-width: 900px) {
  .bbh-locale { display: none; }
  .bbh-topbar .bbh-wrap { justify-content: center; }
  .bbh-usps li:not(.is-on) { display: none; }
  .bbh-usps li.is-on { display: flex; }
  .bbh-usps li { animation: bbh-in .35s ease; }
}
@keyframes bbh-in { from { opacity: 0; translate: 0 4px; } to { opacity: 1; translate: 0 0; } }
@media (max-width: 720px) {
  .bbh-row { min-height: 60px; gap: 8px; }
  .bbh-logo img { height: 30px; }
  .bbh-logo small { display: none; }
  .bbh-row .bbh-cta, .bbh-cart-sum { display: none; }
  .bbh-topbar { font-size: .82rem; }
  .bbh-topbar .bbh-wrap { min-height: 36px; }
}
@media (min-width: 1101px) { .bbh-drawer { display: none !important; } }
@media (prefers-reduced-motion: reduce) { .bbh-usps li { animation: none; } }
/* the box form's modal (template-parts/subscription-form-new.php) covers the whole header */
body:has(#subscription-form-new .modal) .bbh-topbar { z-index: 0; }
