/* ==========================================================================
   Site header, laid out like the reference store:
     row 1: search | logo (centred) | language, account, cart
     row 2: navigation, centred
     strip: rotating USP line
   Rendered by [mbb_header] (inc/mega-menu.php). Width and logo size come
   from Astra's Customizer via --mbb-hdr-shell / --mbb-logo-w.
   ========================================================================== */

:root {
  --mbb-hdr-ink: #1a1a1a;
  --mbb-hdr-muted: #6b7280;
  --mbb-hdr-accent: rgb(var(--mbb-button));
  --mbb-hdr-border: #e2e2e2;
  --mbb-hdr-shell: 1200px;
  --mbb-logo-w: 94px;
  --mbb-logo-w-tablet: 94px;
  --mbb-logo-w-mobile: 80px;
  --mbb-hdr-shadow: 0 24px 60px rgba(26, 26, 26, .16);
  --mbb-usp-bg: #f0eae4;
  --mbb-announce-bg: #eae4ee;
}

.mbb-header,
.mbb-header * { box-sizing: border-box; }

.mbb-header {
  font-family: Roboto, sans-serif;
  position: relative;
  z-index: 900;
  background: #fff;
  color: var(--mbb-hdr-ink);
  font-size: 14px;
  line-height: 1.4;
}

.mbb-header a { text-decoration: none; color: inherit; }
.mbb-header button { font: inherit; color: inherit; }
.mbb-header ul { list-style: none; margin: 0; padding: 0; }

.mbb-header__inner {
  width: min(calc(100% - 48px), var(--mbb-hdr-shell));
  margin-inline: auto;
}

/* Icon buttons shared by search, account, cart, USP arrows ---------------- */

.mbb-header .mbb-icon-btn,
.mbb-header .mbb-icon-btn:hover,
.mbb-header .mbb-icon-btn:focus {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--mbb-hdr-ink);
  box-shadow: none;
  cursor: pointer;
  transition: color .15s, background-color .15s;
}

.mbb-header .mbb-icon-btn svg { width: 24px; height: 24px; }

.mbb-header .mbb-icon-btn:hover,
.mbb-header .mbb-icon-btn:focus-visible { color: var(--mbb-hdr-accent); background: rgba(var(--mbb-button), .07); }

/* Row 1 ---------------------------------------------------------------- */

.mbb-header__top-inner {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  min-height: 96px;
  padding-block: 8px;
}

.mbb-header__left { display: flex; align-items: center; justify-self: start; }
.mbb-header__right { display: flex; align-items: center; gap: 6px; justify-self: end; }

.mbb-logo { display: inline-flex; align-items: center; justify-self: center; }

.mbb-logo__img {
  display: block;
  width: var(--mbb-logo-w);
  height: auto;
  max-width: none;
  object-fit: contain;
}

.mbb-logo__text { font-weight: 800; font-size: 20px; letter-spacing: .02em; }

/* Search */

.mbb-search { position: relative; display: flex; align-items: center; }

.mbb-search__form {
  position: absolute;
  top: 50%;
  left: 0;
  z-index: 30;
  display: flex;
  gap: 6px;
  width: min(420px, 70vw);
  padding: 6px;
  background: #fff;
  border: 1px solid var(--mbb-hdr-border);
  border-radius: 12px;
  box-shadow: var(--mbb-hdr-shadow);
  transform: translateY(-50%);
  opacity: 0;
  visibility: hidden;
  transition: opacity .15s, visibility .15s;
}

.mbb-search.is-open .mbb-search__form { opacity: 1; visibility: visible; }

.mbb-search__form input[type="search"] {
  flex: 1 1 auto;
  min-width: 0;
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--mbb-hdr-border);
  border-radius: 8px;
  font: inherit;
}

.mbb-header .mbb-search__submit,
.mbb-header .mbb-search__submit:hover,
.mbb-header .mbb-search__submit:focus {
  height: 40px;
  min-height: 0;
  padding: 0 14px;
  border: 0;
  border-radius: 8px;
  background: var(--mbb-hdr-accent);
  color: #fff;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
}

/* Language dropdown */

.mbb-lang { position: relative; }

.mbb-header .mbb-lang__toggle,
.mbb-header .mbb-lang__toggle:hover,
.mbb-header .mbb-lang__toggle:focus {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 44px;
  padding: 0 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--mbb-hdr-ink);
  font-size: 14px;
  font-weight: 500;
  line-height: 1;
  box-shadow: none;
  cursor: pointer;
}

.mbb-header .mbb-lang__toggle:hover,
.mbb-header .mbb-lang__toggle:focus-visible { color: var(--mbb-hdr-accent); }

.mbb-lang__list {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 30;
  min-width: 150px;
  padding: 6px;
  background: #fff;
  border: 1px solid var(--mbb-hdr-border);
  border-radius: 10px;
  box-shadow: var(--mbb-hdr-shadow);
  opacity: 0;
  visibility: hidden;
  transform: translateY(6px);
  transition: opacity .15s, transform .15s, visibility .15s;
}

.mbb-lang.is-open .mbb-lang__list { opacity: 1; visibility: visible; transform: none; }

.mbb-lang__list a {
  display: block;
  padding: 9px 12px;
  border-radius: 6px;
  font-weight: 500;
}

.mbb-lang__list a:hover,
.mbb-lang__list a:focus-visible,
.mbb-lang__list a[aria-current="true"] { background: rgba(var(--mbb-button), .07); color: var(--mbb-hdr-accent); }

/* Cart */

.mbb-cart {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  transition: color .15s, background-color .15s;
}

.mbb-cart:hover,
.mbb-cart:focus-visible { color: var(--mbb-hdr-accent); background: rgba(var(--mbb-button), .07); }

.mbb-cart__total { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

.mbb-cart__icon { position: relative; display: inline-flex; width: 24px; height: 24px; }
.mbb-cart__icon svg { width: 24px; height: 24px; }

.mbb-cart__count {
  position: absolute;
  top: -7px;
  right: -9px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--mbb-hdr-accent);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  line-height: 18px;
  text-align: center;
}

.mbb-cart__count:empty,
.mbb-cart__count[data-zero] { display: none; }

/* Row 2: navigation ---------------------------------------------------- */

.mbb-header__navrow { border-bottom: 1px solid var(--mbb-hdr-border); }

.mbb-header__nav-inner { position: relative; }

.mbb-primary-nav {
  display: flex;
  justify-content: center;
  align-items: stretch;
}

.mbb-primary-nav__head { display: none; }

.mbb-menu { display: flex; align-items: stretch; gap: 2px; }

.mbb-menu__item {
  position: static;   /* the panel spans the whole row */
  display: flex;
  align-items: stretch;
  margin: 0;
}

.mbb-header .mbb-menu__toggle,
.mbb-header .mbb-menu__toggle:hover,
.mbb-header .mbb-menu__toggle:focus,
.mbb-header .mbb-menu__toggle:active,
.mbb-header .mbb-menu__item--direct > a {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-height: 50px;
  padding: 0 13px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  color: var(--mbb-hdr-ink);
  font-size: 15px;
  font-weight: 500;
  line-height: 1;
  letter-spacing: normal;
  text-transform: none;
  white-space: nowrap;
  cursor: pointer;
  transition: color .15s;
}

.mbb-header .mbb-menu__toggle::after,
.mbb-header .mbb-menu__item--direct > a::after {
  content: "";
  position: absolute;
  left: 13px;
  right: 13px;
  bottom: 0;
  height: 2px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: 50%;
  transition: transform .15s;
}

.mbb-header .mbb-menu__toggle:hover,
.mbb-header .mbb-menu__toggle:focus-visible,
.mbb-header .mbb-menu__item.is-open > .mbb-menu__toggle,
.mbb-header .mbb-menu__item.is-current > .mbb-menu__toggle,
.mbb-header .mbb-menu__item--direct > a:hover,
.mbb-header .mbb-menu__item--direct > a:focus-visible,
.mbb-header .mbb-menu__item--direct > a[aria-current="page"] { color: var(--mbb-hdr-accent); }

.mbb-header .mbb-menu__toggle:hover::after,
.mbb-header .mbb-menu__toggle:focus-visible::after,
.mbb-header .mbb-menu__item.is-open > .mbb-menu__toggle::after,
.mbb-header .mbb-menu__item.is-current > .mbb-menu__toggle::after,
.mbb-header .mbb-menu__item--direct > a:hover::after,
.mbb-header .mbb-menu__item--direct > a:focus-visible::after,
.mbb-header .mbb-menu__item--direct > a[aria-current="page"]::after { transform: scaleX(1); }

.mbb-header .mbb-menu__item--direct > a[aria-current="page"] { color: var(--mbb-hdr-ink); }

.mbb-chevron { width: 15px; height: 15px; transition: transform .16s; }
.mbb-menu__item.is-open > .mbb-menu__toggle .mbb-chevron,
.mbb-lang.is-open .mbb-chevron { transform: rotate(180deg); }

/* Mega panel (asbeverages.org pattern) ---------------------------------- */

.mbb-mega-panel {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: minmax(220px, .68fr) minmax(0, 2fr);
  gap: 34px;
  max-height: min(680px, calc(100vh - 180px));
  overflow: auto;
  padding: 32px;
  background: #fff;
  border: 1px solid var(--mbb-hdr-border);
  border-top: 3px solid var(--mbb-hdr-accent);
  border-radius: 0 0 18px 18px;
  box-shadow: var(--mbb-hdr-shadow);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(10px);
  transition: opacity .15s, transform .15s, visibility .15s;
}

.mbb-menu__item.is-open > .mbb-mega-panel {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0);
}

.mbb-mega-panel p { margin: 0; }

.mbb-mega-panel__intro {
  min-width: 0;
  padding: 3px 24px 3px 0;
  border-right: 1px solid var(--mbb-hdr-border);
}

.mbb-eyebrow {
  display: block;
  margin-bottom: 9px;
  color: var(--mbb-hdr-accent);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .13em;
  text-transform: uppercase;
}

.mbb-mega-panel__title {
  margin: 0 0 11px;
  color: var(--mbb-hdr-ink);
  font-size: clamp(22px, 2vw, 30px);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -.02em;
}

.mbb-mega-panel__text { color: var(--mbb-hdr-muted); font-size: 14px; line-height: 1.65; }

.mbb-mega-panel__grid { min-width: 0; }

.mbb-nav-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.mbb-nav-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  height: 100%;
  min-height: 64px;
  padding: 15px 17px;
  border: 1px solid var(--mbb-hdr-border);
  border-radius: 12px;
  background: #fbfbfc;
  color: var(--mbb-hdr-ink);
  transition: border-color .15s, background-color .15s, transform .15s;
}

.mbb-nav-card:hover,
.mbb-nav-card:focus-visible,
.mbb-nav-card[aria-current="page"] {
  background: #fdf5f7;
  border-color: rgba(var(--mbb-button), .55);
  transform: translateY(-2px);
}

.mbb-nav-card > span { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.mbb-nav-card strong { font-size: 14px; font-weight: 800; line-height: 1.3; }
.mbb-nav-card small { color: var(--mbb-hdr-muted); font-size: 12px; line-height: 1.45; }
.mbb-nav-card > svg { flex: none; width: 19px; height: 19px; color: var(--mbb-hdr-accent); }

.mbb-nav-groups {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 30px 24px;
}

.mbb-nav-group { margin: 0; min-width: 0; }

.mbb-header .mbb-nav-group__title {
  margin: 0 0 12px;
  color: var(--mbb-hdr-ink);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.3;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.mbb-nav-group__list li + li { margin-top: 7px; }

.mbb-nav-group__list a {
  display: inline-flex;
  padding-block: 3px;
  color: #44546a;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.35;
  transition: color .15s, transform .15s;
}

.mbb-nav-group__list a:hover,
.mbb-nav-group__list a:focus-visible,
.mbb-nav-group__list a[aria-current="page"] { color: var(--mbb-hdr-accent); transform: translateX(2px); }

/* USP strip ------------------------------------------------------------ */

.mbb-usp-bar { background: var(--mbb-usp-bg); }

.mbb-usp-bar__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(calc(100% - 48px), var(--mbb-hdr-shell));
  margin-inline: auto;
  min-height: 44px;
  gap: 12px;
}

.mbb-usp-bar__list { position: relative; flex: 1 1 auto; text-align: center; font-size: 14px; font-weight: 500; }

.mbb-usp-bar__item {
  display: none;
  padding: 10px 0;
  animation: mbb-usp-in .35s ease;
}

.mbb-usp-bar__item.is-active { display: block; }

@keyframes mbb-usp-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

.mbb-header .mbb-usp-bar .mbb-icon-btn { width: 36px; height: 36px; }
.mbb-header .mbb-usp-bar .mbb-icon-btn svg { width: 18px; height: 18px; }

/* Mobile controls, hidden on desktop ----------------------------------- */

.mbb-nav-toggle,
.mbb-nav-close,
.mbb-nav-overlay { display: none; }

.mbb-header a:focus-visible,
.mbb-header button:focus-visible { outline: 3px solid rgba(var(--mbb-button), .35); outline-offset: 3px; }

.elementor-location-header .elementor-section.mbb-header-section > .elementor-container { max-width: none; }
.elementor-location-header .mbb-header-section .elementor-widget-shortcode,
.elementor-location-header .mbb-header-section .elementor-widget-container { margin: 0; padding: 0; }

/* ==========================================================================
   Tablet: smaller logo
   ========================================================================== */

@media (max-width: 1100px) {
  .mbb-logo__img { width: var(--mbb-logo-w-tablet); }
}

/* ==========================================================================
   Below 1100px: off-canvas drawer with accordions
   ========================================================================== */

@media (max-width: 1100px) {
  .mbb-header__top-inner { min-height: 76px; }
  .mbb-header__right { gap: 2px; }
  .mbb-lang { display: none; }

  .mbb-header .mbb-nav-toggle,
  .mbb-header .mbb-nav-toggle:hover,
  .mbb-header .mbb-nav-toggle:focus {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    min-height: 0;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--mbb-hdr-ink);
    box-shadow: none;
    cursor: pointer;
  }

  .mbb-nav-toggle__bars { display: inline-flex; flex-direction: column; gap: 5px; width: 22px; }
  .mbb-nav-toggle__bars i { display: block; height: 2px; border-radius: 2px; background: currentColor; }

  .mbb-header__navrow { border-bottom: 0; }
  .mbb-header__nav-inner { width: auto; }

  .mbb-primary-nav {
    position: fixed;
    top: 0;
    right: 0;
    z-index: 1001;
    display: flex;
    flex-direction: column;
    width: min(430px, calc(100vw - 24px));
    height: 100dvh;
    margin: 0;
    background: #fff;
    box-shadow: -24px 0 70px rgba(26, 26, 26, .22);
    visibility: hidden;
    transform: translateX(105%);
    transition: transform .22s, visibility .22s;
    overflow: hidden;
  }

  .mbb-header.is-mobile-open .mbb-primary-nav { visibility: visible; transform: translateX(0); }

  .mbb-primary-nav__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    border-bottom: 1px solid var(--mbb-hdr-border);
    font-weight: 800;
  }

  .mbb-header .mbb-nav-close,
  .mbb-header .mbb-nav-close:hover,
  .mbb-header .mbb-nav-close:focus {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    min-height: 0;
    padding: 0;
    border: 1px solid var(--mbb-hdr-border);
    border-radius: 10px;
    background: #fff;
    color: var(--mbb-hdr-ink);
    font-size: 26px;
    font-weight: 400;
    line-height: 1;
    box-shadow: none;
    cursor: pointer;
  }

  .mbb-menu {
    display: block;
    flex: 1 1 auto;
    min-height: 0;
    padding: 8px 14px 18px;
    overflow-y: auto;
    overscroll-behavior: contain;
  }

  .mbb-menu__item { display: block; border-bottom: 1px solid var(--mbb-hdr-border); }

  .mbb-header .mbb-menu__toggle,
  .mbb-header .mbb-menu__toggle:hover,
  .mbb-header .mbb-menu__toggle:focus,
  .mbb-header .mbb-menu__item--direct > a {
    width: 100%;
    min-height: 56px;
    justify-content: space-between;
    padding: 0 5px;
    font-size: 16px;
  }

  .mbb-header .mbb-menu__item--direct > a { justify-content: flex-start; }
  .mbb-header .mbb-menu__toggle::after,
  .mbb-header .mbb-menu__item--direct > a::after { display: none; }

  .mbb-mega-panel {
    position: static;
    display: none;
    grid-template-columns: 1fr;
    gap: 18px;
    max-height: none;
    overflow: visible;
    padding: 3px 0 22px;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: none;
    transition: none;
  }

  .mbb-menu__item.is-open > .mbb-mega-panel { display: grid; }

  .mbb-mega-panel__intro { padding: 12px 4px 18px; border-right: 0; border-bottom: 1px solid var(--mbb-hdr-border); }
  .mbb-mega-panel__title { font-size: 21px; }

  .mbb-nav-cards { grid-template-columns: 1fr; padding-inline: 4px; }
  .mbb-nav-card { min-height: 52px; padding: 11px 14px; }

  .mbb-nav-groups { grid-template-columns: 1fr; gap: 22px; padding-inline: 4px; }
  .mbb-nav-group + .mbb-nav-group { padding-top: 18px; border-top: 1px solid var(--mbb-hdr-border); }
  .mbb-nav-group__list a { align-items: center; min-height: 38px; padding-block: 8px; }

  .mbb-nav-overlay {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: block;
    background: rgba(26, 26, 26, .45);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity .2s, visibility .2s;
  }

  .mbb-header.is-mobile-open .mbb-nav-overlay { opacity: 1; visibility: visible; pointer-events: auto; }

  body.mbb-nav-locked { overflow: hidden; }
}

@media (max-width: 600px) {
  .mbb-header__inner,
  .mbb-usp-bar__inner { width: calc(100% - 24px); }
  .mbb-logo__img { width: var(--mbb-logo-w-mobile); }
  .mbb-usp-bar__list { font-size: 13px; }
  .mbb-search__form { width: calc(100vw - 24px); left: -6px; }
}

@media (prefers-reduced-motion: reduce) {
  .mbb-header * { transition-duration: .01ms !important; animation: none !important; }
}

/* ==========================================================================
   Announcement bar
   Sits above the header row. Colours are the reference store's values.
   ========================================================================== */

.mbb-announce {
  background: var(--mbb-announce-bg);
  border-bottom: 1px solid rgba(26, 26, 26, .08);
  color: var(--mbb-hdr-ink);
}

.mbb-announce__inner {
  width: min(calc(100% - 48px), var(--mbb-hdr-shell));
  margin-inline: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
}

.mbb-announce__message {
  margin: 0;
  padding: 10px 0;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
  text-align: center;
}

.mbb-header .mbb-announce__link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: inherit;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.mbb-announce__link svg { width: 14px; height: 10px; transition: transform .15s; }

.mbb-header .mbb-announce__link:hover,
.mbb-header .mbb-announce__link:focus-visible { color: var(--mbb-hdr-accent); }
.mbb-header .mbb-announce__link:hover svg { transform: translateX(3px); }

@media (max-width: 600px) {
  .mbb-announce__inner { width: calc(100% - 24px); }
  .mbb-announce__message { font-size: 13px; padding: 8px 0; }
}
