/* ================================================================
   HEADER v3 — Moon Juice layout
   nav-left | logo-center | icons-right
   + mega dropdown + search overlay + mobile drawer
   (2026-06-15)
   ================================================================ */

/* ── Announcement bar ── */
.bm-announce {
  background: #111827;
  color: #fff;
  font-family: 'Golos Text', sans-serif;
  font-size: 12px;
  line-height: 1;
  letter-spacing: .02em;
}
.bm-announce__inner {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px 16px;
  position: relative;
}
.bm-announce__text { text-align: center; }
.bm-announce__link {
  color: #9CA3AF;
  text-decoration: none;
  font-weight: 600;
  transition: color 180ms;
}
.bm-announce__link:hover { color: #fff; }
.bm-announce__close {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: rgba(255,255,255,.5);
  cursor: pointer;
  padding: 8px;
  line-height: 0;
  transition: color 180ms;
}
.bm-announce__close:hover { color: #fff; }

/* ── Header shell ── */
.bm-header {
  position: sticky !important;
  top: 0 !important;
  z-index: 500 !important;
  background: #fff !important;
  border-bottom: 1px solid #E8E0D4 !important;
  overflow: visible !important;
}

/* ── Inner: 3-column grid ── */
.bm-header__inner {
  display: grid !important;
  grid-template-columns: 1fr auto 1fr !important;
  align-items: center !important;
  height: 72px !important;
  gap: 0 !important;
}

/* Hide old navbar row */
.bm-navbar { display: none !important; }

/* ── LEFT: Primary nav ── */
.bm-nav-primary {
  display: flex;
  align-items: center;
  height: 100%;
}
.bm-nav-primary__link {
  display: inline-flex;
  align-items: center;
  height: 72px;
  padding: 0 14px;
  font-family: 'Golos Text', sans-serif;
  font-size: 13px;
  font-weight: 500;
  color: #1A1A1A;
  text-decoration: none;
  border-bottom: 2px solid transparent;
  transition: color 150ms, border-color 150ms;
  white-space: nowrap;
  position: relative;
}
.bm-nav-primary__link:hover { color: #000; border-bottom-color: rgba(0,0,0,.2); }
.bm-nav-primary__link--active { color: #000; border-bottom-color: #1A1A1A; }

/* Hide burger on desktop */
.bm-burger { display: none !important; }

/* ── CENTER: Logo ── */
.bm-logo {
  display: inline-flex;
  align-items: baseline;
  gap: 0;
  text-decoration: none;
  font-size: 22px;
  font-weight: 700;
  font-family: 'Unbounded', sans-serif;
  white-space: nowrap;
  justify-self: center;
}
.bm-logo__bio    { color: #059669; }
.bm-logo__dot    { color: #059669; }
.bm-logo__mentor { color: #111827; }

/* ── RIGHT: Utility icons ── */
.bm-header__right {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 2px;
}
.bm-util-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: none;
  border: none;
  cursor: pointer;
  color: #1A1A1A;
  border-radius: 50%;
  transition: background 150ms;
  position: relative;
  text-decoration: none;
  flex-shrink: 0;
}
.bm-util-btn:hover { background: #F5F0E8; }

/* Cart count badge */
.bm-cart-btn { position: relative; }
.bm-cart-count {
  position: absolute;
  top: 4px; right: 2px;
  background: #1A1A1A;
  color: #fff;
  font-family: 'Golos Text', sans-serif;
  font-size: 9px;
  font-weight: 700;
  min-width: 15px;
  height: 15px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 3px;
  line-height: 1;
  pointer-events: none;
}

/* ── MEGA MENU ── */
.bm-mega {
  position: absolute;
  top: 100%;
  left: 0; right: 0;
  background: #fff;
  border-top: 1px solid #E8E0D4;
  border-bottom: 1px solid #E8E0D4;
  box-shadow: 0 12px 40px rgba(0,0,0,.07);
  z-index: 499;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: opacity 200ms ease, transform 200ms ease, visibility 0ms 200ms;
  pointer-events: none;
}
.bm-mega.is-open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  transition-delay: 0ms;
  pointer-events: auto;
}

.bm-mega__inner {
  display: grid;
  grid-template-columns: repeat(4, 1fr) 210px;
  gap: 0;
  padding: 36px 0;
}
.bm-mega__col {
  padding: 0 28px;
  border-right: 1px solid #F0EAE0;
}
.bm-mega__col:first-child { padding-left: 0; }

.bm-mega__col-title {
  display: block;
  font-family: 'Golos Text', sans-serif;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: #1A1A1A;
  text-decoration: none;
  margin-bottom: 18px;
  transition: color 150ms;
}
.bm-mega__col-title:hover { color: #059669; }

.bm-mega__list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.bm-mega__list li { margin-bottom: 12px; }
.bm-mega__list a {
  font-family: 'Golos Text', sans-serif;
  font-size: 14px;
  font-weight: 400;
  color: #5C574F;
  text-decoration: none;
  transition: color 150ms;
  display: inline-flex;
  align-items: center;
  gap: 7px;
}
.bm-mega__list a:hover { color: #1A1A1A; }

.bm-mega__tag {
  display: inline-block;
  background: #F5EDD4;
  color: #7A6830;
  font-size: 9px;
  font-weight: 700;
  font-style: normal;
  letter-spacing: .07em;
  text-transform: uppercase;
  padding: 2px 6px;
  border-radius: 3px;
}

/* Promo column */
.bm-mega__promo {
  padding: 24px;
  background: #FAF8F3;
  border-radius: 8px;
  margin: -12px 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.bm-mega__promo-eyebrow {
  font-family: 'Golos Text', sans-serif;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: #9B9589;
  margin: 0 0 10px;
}
.bm-mega__promo-title {
  font-family: 'Golos Text', sans-serif;
  font-size: 17px;
  font-weight: 600;
  color: #1A1A1A;
  line-height: 1.35;
  margin: 0 0 18px;
}
.bm-mega__promo-link {
  font-family: 'Golos Text', sans-serif;
  font-size: 11px;
  font-weight: 700;
  color: #1A1A1A;
  text-decoration: none;
  letter-spacing: .06em;
  text-transform: uppercase;
  border-bottom: 1px solid #1A1A1A;
  padding-bottom: 2px;
  display: inline-block;
  transition: color 150ms, border-color 150ms;
}
.bm-mega__promo-link:hover { color: #059669; border-color: #059669; }

/* ── SEARCH OVERLAY ── */
.bm-search-overlay {
  position: fixed;
  top: 0; left: 0; right: 0;
  background: #fff;
  border-bottom: 1px solid #E8E0D4;
  z-index: 9500;
  padding: 18px 0;
  transform: translateY(-100%);
  transition: transform 220ms cubic-bezier(.4,0,.2,1);
  box-shadow: 0 4px 24px rgba(0,0,0,.08);
}
.bm-search-overlay.is-open { transform: translateY(0); }

.bm-search-overlay__inner {
  display: flex;
  align-items: center;
  gap: 16px;
}
.bm-search-overlay form {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 14px;
  border-bottom: 1.5px solid #1A1A1A;
  padding-bottom: 10px;
}
.bm-search-overlay form svg { flex-shrink: 0; color: #9B9589; }
.bm-search-overlay input[type="search"] {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  font-family: 'Golos Text', sans-serif;
  font-size: 20px;
  font-weight: 300;
  color: #1A1A1A;
  padding: 0;
}
.bm-search-overlay input[type="search"]::placeholder { color: #C0BAB0; }
.bm-search-overlay button[type="submit"] {
  background: none;
  border: none;
  font-size: 22px;
  cursor: pointer;
  color: #1A1A1A;
  padding: 0;
  line-height: 1;
  flex-shrink: 0;
  transition: color 150ms;
}
.bm-search-overlay button[type="submit"]:hover { color: #059669; }
.bm-search-overlay__close {
  flex-shrink: 0;
  background: none;
  border: none;
  cursor: pointer;
  color: #9B9589;
  padding: 8px;
  line-height: 0;
  transition: color 150ms;
}
.bm-search-overlay__close:hover { color: #1A1A1A; }

/* ── MOBILE DRAWER ── */
.bm-mobile-menu {
  position: fixed;
  inset: 0;
  z-index: 9000;
  visibility: hidden;
  pointer-events: none;
}
.bm-mobile-menu.is-open {
  visibility: visible;
  pointer-events: auto;
}
.bm-mobile-menu__inner {
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 280px;
  max-width: 85vw;
  background: #fff;
  display: flex;
  flex-direction: column;
  transform: translateX(-100%);
  transition: transform 280ms cubic-bezier(.4,0,.2,1);
  overflow-y: auto;
}
.bm-mobile-menu.is-open .bm-mobile-menu__inner { transform: translateX(0); }

.bm-mobile-menu__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 20px 16px;
  border-bottom: 1px solid #E8E0D4;
}
.bm-mobile-menu__close {
  background: none;
  border: none;
  cursor: pointer;
  color: #5C574F;
  padding: 6px;
  line-height: 0;
  transition: color 150ms;
}
.bm-mobile-menu__close:hover { color: #1A1A1A; }

.bm-mobile-nav { padding: 12px 0; flex: 1; }
.bm-mobile-nav a {
  display: block;
  padding: 14px 20px;
  font-family: 'Golos Text', sans-serif;
  font-size: 16px;
  font-weight: 500;
  color: #1A1A1A;
  text-decoration: none;
  border-bottom: 1px solid #F0EBE3;
  transition: background 150ms;
}
.bm-mobile-nav a:hover { background: #FAF8F3; }

.bm-mobile-menu__footer {
  padding: 16px 20px 32px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  border-top: 1px solid #E8E0D4;
}
.bm-mobile-menu__footer a,
.bm-mobile-menu__footer button {
  font-family: 'Golos Text', sans-serif;
  font-size: 14px;
  color: #5C574F;
  text-decoration: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  text-align: left;
  transition: color 150ms;
}
.bm-mobile-menu__footer a:hover,
.bm-mobile-menu__footer button:hover { color: #1A1A1A; }

.bm-mobile-menu__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.45);
  opacity: 0;
  transition: opacity 280ms ease;
}
.bm-mobile-menu.is-open .bm-mobile-menu__backdrop { opacity: 1; }

/* ── RESPONSIVE ── */
@media (max-width: 900px) {
  .bm-nav-primary__link { padding: 0 10px; font-size: 12px; }
  .bm-mega__inner { grid-template-columns: repeat(2, 1fr) 200px; gap: 24px; padding: 28px 0; }
  .bm-mega__col:nth-child(n+3) { border-right: none; }
  .bm-mega__col:nth-child(3) { border-right: 1px solid #F0EAE0; }
}

@media (max-width: 768px) {
  .bm-announce__inner { padding: 8px 40px 8px 16px; justify-content: center; }
  .bm-announce { font-size: 11px; }

  .bm-header__inner {
    grid-template-columns: auto 1fr auto !important;
    height: 60px !important;
    padding: 0 12px;
  }

  /* Show burger */
  .bm-burger {
    display: flex !important;
    background: none;
    border: none;
    cursor: pointer;
    color: #1A1A1A;
    padding: 8px;
    margin-left: -8px;
    line-height: 0;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
  }

  /* Hide desktop nav */
  .bm-nav-primary { display: none !important; }

  /* Logo smaller */
  .bm-logo { font-size: 18px !important; justify-self: center; }

  /* Compact right icons */
  .bm-header__right { gap: 0; }
  .bm-util-btn { width: 36px; height: 36px; }

  /* No mega on mobile */
  .bm-mega { display: none !important; }
}

@media (max-width: 480px) {
  .bm-announce__text a { display: none; }
  .bm-logo { font-size: 16px !important; }
}

/* ═══════════════════════════════════════════════════════════════
   MOBILE MENU — акордеон розділів магазину (2026-10-13)
   Розмітку дає bm_nav_render_mobile() (inc/nav-menu.php) — те саме
   джерело, що й десктопне мега-меню, тому списки не розʼїжджаються.
   ═══════════════════════════════════════════════════════════════ */
.bm-mnav-acc {
  border-bottom: 1px solid #F0EBE3;
  background: #FCFBF8;
}
.bm-mnav-acc__item + .bm-mnav-acc__item { border-top: 1px solid #F0EBE3; }

.bm-mnav-acc__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  /* зсув ліворуч на 32px відносно пунктів верхнього рівня — видно вкладеність */
  padding: 13px 20px 13px 32px;
  background: none;
  border: none;
  cursor: pointer;
  font-family: 'Golos Text', sans-serif;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: #5C574F;
  text-align: left;
  transition: color 150ms;
}
.bm-mnav-acc__head:hover { color: #1A1A1A; }

.bm-mnav-acc__chevron {
  flex-shrink: 0;
  transition: transform 220ms cubic-bezier(.4,0,.2,1);
}
.bm-mnav-acc__head[aria-expanded="true"] { color: #1A1A1A; }
.bm-mnav-acc__head[aria-expanded="true"] .bm-mnav-acc__chevron { transform: rotate(180deg); }

/* Згортання через grid-rows: анімується без фіксованої висоти,
   тому список будь-якої довжини розкривається плавно. */
.bm-mnav-acc__body {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 240ms cubic-bezier(.4,0,.2,1);
}
.bm-mnav-acc__head[aria-expanded="true"] + .bm-mnav-acc__body { grid-template-rows: 1fr; }
/* Рівно один рядок сітки — інакше 0fr застосується тільки до першого елемента */
.bm-mnav-acc__body-inner { overflow: hidden; min-height: 0; }

.bm-mnav-acc__body a {
  display: block;
  padding: 11px 20px 11px 44px;
  font-family: 'Golos Text', sans-serif;
  font-size: 14px;
  font-weight: 400;
  color: #5C574F;
  text-decoration: none;
  border-bottom: none;
  transition: color 150ms, background 150ms;
}
.bm-mnav-acc__body a:first-child { padding-top: 4px; }
.bm-mnav-acc__body a:last-child  { padding-bottom: 14px; }
.bm-mnav-acc__body a:hover { color: #1A1A1A; background: #FAF8F3; }
