/* ============================================================================
   BK Header — sticky bar, bilingual wordmark, editorial mega-menu, mobile drawer
   ========================================================================== */

.bk-header {
  position: sticky;            /* also the containing block for the mega-panel */
  top: 0;
  z-index: 40;
  background-color: rgb(var(--color-background));
  color: rgb(var(--color-foreground));
  border-bottom: 1px solid var(--bk-hairline);
}

.bk-header__bar {
  display: flex;
  align-items: center;
  gap: var(--bk-space-8);
  padding-block: var(--bk-space-4);
}

/* ---- Wordmark ------------------------------------------------------------- */
.bk-header__brand { text-decoration: none; color: var(--bk-ink); margin-right: auto; }
.bk-header__wordmark { gap: 0.1em; align-items: flex-start; }
.bk-header__wordmark .bk-deva { font-size: 1.05rem; line-height: 1; color: var(--bk-ink); }
.bk-header__wordmark-latin {
  font-family: var(--bk-font-body);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--bk-ink);
}
.bk-header__logo { display: block; height: auto; }

/* ---- Desktop nav ---------------------------------------------------------- */
.bk-header__nav { display: none; }
.bk-header__menu {
  display: flex;
  align-items: center;
  gap: var(--bk-space-8);
  list-style: none;
  margin: 0;
  padding: 0;
}
.bk-header__link {
  font-family: var(--bk-font-body);
  font-size: var(--bk-fs-eyebrow);
  font-weight: 500;
  letter-spacing: var(--bk-tracking-eyebrow);
  text-transform: uppercase;
  color: var(--bk-ink);
  text-decoration: none;
  padding-block: var(--bk-space-4);
  background-image: linear-gradient(var(--bk-brass), var(--bk-brass));
  background-repeat: no-repeat;
  background-position: 0 calc(100% - 0.6rem);
  background-size: 0% 1px;
  transition: background-size var(--bk-dur-fast) var(--bk-ease);
}
.bk-header__item.has-mega:hover .bk-header__link,
.bk-header__item:focus-within .bk-header__link { background-size: 100% 1px; }

/* ---- Mega-menu (full-bleed editorial panel) ------------------------------- */
.bk-header__mega {
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  background: var(--bk-bg-cream);
  border-bottom: 1px solid var(--bk-hairline);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: opacity var(--bk-dur-base) var(--bk-ease),
              transform var(--bk-dur-base) var(--bk-ease),
              visibility var(--bk-dur-base);
  pointer-events: none;
}
.bk-header__item.has-mega:hover .bk-header__mega,
.bk-header__item.has-mega:focus-within .bk-header__mega {
  opacity: 1;
  visibility: visible;
  transform: none;
  pointer-events: auto;
}
.bk-header__mega-inner {
  display: flex;
  gap: var(--bk-space-16);
  padding-block: var(--bk-space-12);
}
.bk-header__mega-col span.bk-eyebrow { color: var(--bk-ink-soft); display: block; margin-bottom: var(--bk-space-4); }
.bk-header__mega-col ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--bk-space-3); }
.bk-header__mega-col a {
  font-family: var(--bk-font-display);
  font-size: 1.05rem;
  color: var(--bk-ink);
  text-decoration: none;
}
.bk-header__mega-col a:hover { color: var(--bk-brass-deep); }

/* ---- Actions -------------------------------------------------------------- */
.bk-header__actions { display: flex; align-items: center; gap: var(--bk-space-4); }
.bk-header__action {
  position: relative;
  display: inline-flex;
  align-items: center;
  color: var(--bk-ink);
  text-decoration: none;
  padding: 0.25rem;
}
.bk-header__action:hover { color: var(--bk-brass-deep); }
.bk-header__bag-count {
  position: absolute;
  top: -4px; right: -6px;
  min-width: 1rem; height: 1rem;
  padding: 0 0.2rem;
  display: grid; place-items: center;
  font-family: var(--bk-font-body);
  font-size: 0.625rem;
  font-variant-numeric: tabular-nums;
  color: var(--bk-on-olive);
  background: var(--bk-olive);
  border-radius: var(--bk-radius-pill);
}

/* ---- Hamburger ------------------------------------------------------------ */
.bk-header__burger {
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 24px; height: 24px;
  background: none; border: 0; cursor: pointer; padding: 0;
}
.bk-header__burger span {
  display: block; height: 1px; width: 100%; background: var(--bk-ink);
}

/* ============================================================================
   MOBILE drawer
   ========================================================================== */
.bk-header__drawer { position: fixed; inset: 0; z-index: 60; }
.bk-header__drawer[hidden] { display: none; }
.bk-header__drawer-scrim {
  position: absolute; inset: 0;
  background: rgba(42, 42, 34, 0.4);
  opacity: 0;
  transition: opacity var(--bk-dur-base) var(--bk-ease);
}
.bk-header__drawer-panel {
  position: absolute; top: 0; left: 0;
  height: 100%; width: min(360px, 85vw);
  background: var(--bk-bg-cream);
  transform: translateX(-100%);
  transition: transform var(--bk-dur-base) var(--bk-ease);
  display: flex; flex-direction: column;
  padding: var(--bk-space-6);
  overflow-y: auto;
}
.bk-header__drawer.is-open .bk-header__drawer-scrim { opacity: 1; }
.bk-header__drawer.is-open .bk-header__drawer-panel { transform: none; }
.bk-header__drawer-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  padding-bottom: var(--bk-space-6);
  border-bottom: 1px solid var(--bk-hairline);
}
.bk-header__drawer-close { background: none; border: 0; cursor: pointer; font-size: 1.75rem; line-height: 1; color: var(--bk-ink-soft); }
.bk-header__drawer-menu { list-style: none; margin: var(--bk-space-6) 0 0; padding: 0; display: flex; flex-direction: column; gap: var(--bk-space-4); }
.bk-header__drawer-menu > li > a {
  font-family: var(--bk-font-display);
  font-size: 1.5rem;
  color: var(--bk-ink);
  text-decoration: none;
}
.bk-header__drawer-menu ul { list-style: none; margin: var(--bk-space-2) 0 0; padding: 0 0 0 var(--bk-space-4); display: flex; flex-direction: column; gap: var(--bk-space-2); }
.bk-header__drawer-menu ul a { font-family: var(--bk-font-body); font-size: var(--bk-fs-body); color: var(--bk-ink-soft); text-decoration: none; }

/* ============================================================================
   RESPONSIVE
   ========================================================================== */
@media screen and (max-width: 989px) {
  .bk-header__bar { display: grid; grid-template-columns: 1fr auto 1fr; gap: var(--bk-space-4); }
  .bk-header__burger { justify-self: start; }
  .bk-header__brand { justify-self: center; margin-right: 0; }
  .bk-header__actions { justify-self: end; }
}

@media screen and (min-width: 990px) {
  .bk-header__burger { display: none; }
  .bk-header__nav { display: block; }
}
