/* ============================================================
   HEADER (static — floating pill takes over on scroll)
   ============================================================ */

#header.header {
  display: contents;
}

/* ============================================================
   TOP BAR (bm_topbanner) — promo left + utility links right
   ============================================================ */

#bm-topbanner .bm-topbanner__item { padding: 0; }
#bm-topbanner { padding-inline: 0; }
#bm-topbanner .bm-topbanner__content { flex: 1 1 100%; width: 100%; padding: 0; }

.bm-tb-wrap {
  display: grid;
  grid-template-columns: 1fr auto;
  width: 100%;
  align-items: center;
  gap: 2rem;
  max-width: none;
  margin: 0 auto;
  padding: 0.3rem var(--bz-pad);
  font-size: 11px;
  font-weight: 500;
  line-height: 1.4;
}

.bm-tb-left { display: none; }

.bm-tb-middle { display: inline-flex; align-items: center; gap: 1.5rem; white-space: nowrap; justify-self: start; }

.bm-tb-middle > span:not(.bm-tb-sep) { display: inline-flex; align-items: center; gap: 0.35rem; }
.bm-tb-middle > span:not(.bm-tb-sep)::before { content: "✓"; color: #00B67A; font-weight: 700; }
.bm-tb-middle .bm-tb-sep { display: none; }

.bm-tp {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  text-decoration: none;
  color: inherit;
  font-weight: 600;
}

.bm-tp:hover { opacity: 0.85; color: inherit; }

.bm-tp__label { color: #FFFFFF; font-weight: 700; }
.bm-tp__star { color: #00B67A; font-size: 13px; line-height: 1; }
.bm-tp__brand { color: #FFFFFF; font-weight: 700; }

.bm-tb-right { display: inline-flex; align-items: center; gap: 1.5rem; justify-self: end; }
.bm-tb-right a {
  color: inherit;
  text-decoration: none;
  opacity: 0.85;
  transition: opacity .15s ease;
}
.bm-tb-right a:hover { opacity: 1; }

@media (max-width: 760px) {
  .bm-tb-wrap { display: flex; flex-direction: column; gap: 0.4rem; padding: 0.5rem 1rem; }
  .bm-tb-middle { flex-wrap: wrap; justify-content: center; white-space: normal; }
  .bm-tb-right { gap: 1rem; font-size: 11.5px; }
}

/* ============================================================
   HEADER (logo + search + icons + mega nav)
   ============================================================ */

.mh-header {
  position: sticky;
  top: 0;
  z-index: 1100;
  background: #FFFFFF;
  border-bottom: 1px solid var(--mh-line);
  transition: transform .35s cubic-bezier(.4, 0, .2, 1);
  will-change: transform;
}

.mh-header--hidden { transform: translateY(-100%); }

@media (prefers-reduced-motion: reduce) {
  .mh-header { transition: none; }
}

.mh-header__inner {
  max-width: var(--bz-max);
  margin: 0 auto;
  padding: 0.95rem var(--bz-pad);
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  gap: 2.5rem;
  align-items: center;
}

.mh-header__brand {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  line-height: 0;
}

.mh-header__brand-img {
  height: 58px;
  width: auto;
  display: block;
  mix-blend-mode: multiply;
}

.mh-header__search-modal { display: contents; }
.mh-header__search-modal .bm-search-trigger { display: none; }

.mh-header__brand-mark { color: var(--mh-plum); }
.mh-header__brand-dot { color: var(--mh-primary); font-size: 28px; margin-left: 1px; line-height: 0.7; }

.mh-header__search {
  position: relative;
  display: flex;
  align-items: center;
  background: #EBEBEB;
  border: 0;
  border-radius: 999px;
  padding: 0 0.5rem 0 1.35rem;
  height: 49px;
  max-width: 680px;
  margin: 0 auto;
  width: 100%;
  transition: background-color .18s ease;
  cursor: text;
}

.mh-header__search:hover { background: #E4E1DA; }
.mh-header__search:focus-within { background: #FFFFFF; box-shadow: 0 0 0 2px var(--mh-ink); }

.mh-header__search-icon {
  width: 16px;
  height: 16px;
  font-size: 18px;
  color: var(--mh-muted);
  flex-shrink: 0;
}

.mh-header__search-input {
  flex: 1;
  padding: 0.6rem 0.75rem;
  font-size: 14px;
  color: var(--mh-plum);
  min-width: 0;
  height: 100%;
}
input.mh-header__search-input {
  border: 0;
  background: transparent;
  outline: none;
  box-shadow: none;
}
input.mh-header__search-input:focus,
input.mh-header__search-input:active,
input.mh-header__search-input:hover {
  background: transparent;
  outline: none;
  box-shadow: none;
}

.mh-header__search-input::placeholder { color: var(--mh-muted); font-weight: 400; }

.mh-header__search-submit { display: none; }

.mh-header__icons {
  display: flex;
  gap: 0.25rem;
  align-items: center;
}

.mh-header__icon-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem;
  width: 40px;
  height: 40px;
  color: var(--mh-plum);
  text-decoration: none;
  border-radius: 8px;
  transition: background-color .15s ease;
}

.mh-header__icon-btn:hover {
  background: var(--mh-cream);
}

.mh-header__icon-btn svg,
.mh-header__icon-btn i {
  width: 26px;
  height: 26px;
  font-size: 22px;
  line-height: 1;
}
.mh-header__icon-btn .mh-header__icon { stroke-width: 10; }

.mh-header__icon-label { display: none; }

.mh-header__icon-badge {
  position: absolute;
  top: 4px;
  right: 4px;
  background: var(--mh-primary);
  color: #FFFFFF;
  font-weight: 700;
  font-size: 10px;
  min-width: 16px;
  height: 16px;
  border-radius: 999px;
  padding-inline: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1.5px solid #FFFFFF;
}

.mh-header__icon-badge--cart { background: var(--mh-plum); }

/* Cart badge is wired to bm_cart's live counter (.bm-cart-count). The module's
   bm_cart.css restyles .bm-cart-count (opacity:0, top/right:-4px, 9px, module
   colors) — override it here so the theme badge keeps its look, and let the
   module drive visibility via .bm-cart-count-visible (hidden at 0, revealed
   live on add-to-cart). Two-class selector beats the module's single-class rule. */
.mh-header__icon-badge--cart.bm-cart-count {
  position: absolute;
  top: 4px;
  right: 4px;
  min-width: 16px;
  height: 16px;
  padding-inline: 4px;
  background: var(--mh-plum);
  color: #FFFFFF;
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
  border: 1.5px solid #FFFFFF;
  border-radius: 999px;
  transform: none;
  opacity: 0;
  transition: opacity 0.2s ease;
}
.mh-header__icon-badge--cart.bm-cart-count.bm-cart-count-visible { opacity: 1; }

.mh-header__mobile-toggle {
  display: none;
  background: transparent;
  border: 0;
  color: var(--mh-plum);
  padding: 0.5rem;
  cursor: pointer;
}

.mh-header__mobile-toggle svg,
.mh-header__mobile-toggle i { width: 26px; height: 26px; font-size: 26px; line-height: 1; }

/* ---------- Mega nav ---------- */

.mh-nav {
  background: #FFFFFF;
  border-bottom: 1px solid var(--mh-line);
}

.mh-nav__inner {
  max-width: var(--bz-max);
  margin: 0 auto;
  padding: 0 var(--bz-pad);
}

.mh-nav__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 0.25rem;
  flex-wrap: wrap;
  justify-content: center;
}

.mh-nav__item { flex: 0 0 auto; }

.mh-nav__link {
  display: inline-block;
  color: var(--mh-plum);
  font-weight: 500;
  font-size: 13px;
  letter-spacing: -0.005em;
  text-decoration: none;
  padding: 0.65rem 0.7rem;
  border-bottom: 2px solid transparent;
  transition: color .15s ease, border-color .15s ease;
  margin-bottom: -1px;
}

.mh-nav__link:hover {
  color: var(--mh-primary-deep);
  border-color: var(--mh-primary);
}

.mh-nav__item--accent .mh-nav__link {
  color: var(--mh-primary-deep);
  font-weight: 500;
}

/* ── Main navigation: theme styling for bm_menu.
   DESKTOP (>=992px): override bm_menu's mobile-first mega-menu.css into the theme's
   horizontal pill/underline bar. MOBILE (<992px): NO overrides — bm_menu's native
   off-canvas sidebar (mega-menu.css) applies, opened by the header/pill hamburger. */
#bm-menu .bm-toggle.toggle-open { display: none; } /* theme header toggle opens the sidebar */
#bm-menu .bm-nav-header { justify-content: end; } /* right-align the sidebar close button */
#bm-menu .bm-nav.open { max-width: 80%; } /* mobile sidebar width */

@media (min-width: 992px) {
.mh-nav__link { font-size: 15px; }
#bm-menu.bm-menu {
  display: block;
  width: 100%;
  max-width: none;
  flex: none;
  background: #FFFFFF;
  border-bottom: 1px solid var(--mh-line);
  position: relative;   /* positioning context for the full-width hover panel */
}
#bm-menu .bm-toggle,
#bm-menu .bm-nav-header { display: none; }
#bm-menu .bm-nav {
  list-style: none;
  margin: 0 auto;
  padding: 0 var(--bz-pad);
  max-width: var(--bz-max);
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.25rem;
  flex-wrap: wrap;
  justify-content: center;
  position: static;
  transform: none;
  inset: auto;
  height: auto;
  width: auto;
  background: transparent;
  box-shadow: none;
}
#bm-menu .bm-item {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  position: static;
}
#bm-menu .bm-item > a {
  display: flex;
  align-items: center;
  color: var(--mh-plum);
  font-weight: 500;
  font-size: 15px;
  letter-spacing: -0.005em;
  text-decoration: none;
  padding: 0.65rem 0.7rem;
  border-bottom: 2px solid transparent;
  transition: color .15s ease, border-color .15s ease;
  margin-bottom: -1px;
  background: transparent;
}
#bm-menu .bm-item > a > span { text-transform: none; }
#bm-menu .bm-item > a:hover {
  color: var(--mh-primary-deep);
  border-color: var(--mh-primary);
}
/* "Tilbud" accent (last item), mirroring the old .mh-nav--accent */
#bm-menu .bm-item:last-child > a { color: var(--mh-primary-deep); }

/* ── Hover mega-panel (subcategory dropdowns) ── */
#bm-menu .bm-item.has-dropdown > a::after {
  content: "";
  display: inline-block;
  width: 0.4em; height: 0.4em;
  margin-left: 0.35em;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: translateY(-1px) rotate(45deg);
  opacity: 0.55;
}
#bm-menu .bm-drop {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  display: block;
  background: #FFFFFF;
  border-top: 1px solid var(--mh-line);
  box-shadow: 0 16px 34px rgba(var(--mh-primary-rgb), 0.10);
  z-index: 1200;
  opacity: 0;
  visibility: hidden;
  transform: translateY(6px);
  transition: opacity .16s ease, transform .16s ease, visibility 0s linear .16s;
  pointer-events: none;
}
#bm-menu .bm-item.has-dropdown:hover > .bm-drop,
#bm-menu .bm-item.has-dropdown:focus-within > .bm-drop {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  transition: opacity .16s ease, transform .16s ease;
  pointer-events: auto;
}
#bm-menu .bm-drop > .container {
  max-width: var(--bz-max);
  margin: 0 auto;
  padding: 1.4rem var(--bz-pad);
}
#bm-menu .bm-cats {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 0.1rem 1.5rem;
}
#bm-menu .bm-cats img { display: none; }         /* text menu, no thumbnails */
#bm-menu .bm-cats > li > ul { display: none; }   /* only show depth-1 as flat columns */
#bm-menu .bm-cats a {
  display: block;
  padding: 0.45rem 0.4rem;
  color: var(--mh-plum);
  font-size: 13px;
  line-height: 1.2;
  text-decoration: none;
  border-radius: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
#bm-menu .bm-cats a:hover {
  color: var(--mh-primary-deep);
  background: var(--mh-rose);
}

  /* desktop: theme hamburger hidden (mobile <992 shows it to open bm_menu's sidebar) */
  .mh-header__mobile-toggle { display: none; }
}

@media (max-width: 1024px) {
  .mh-header__inner {
    grid-template-columns: auto 1fr auto;
    gap: 1rem;
  }
  .mh-header__icons { display: none; }
  .mh-header__mobile-toggle { display: inline-flex; }
}

@media (max-width: 640px) {
  .mh-header__search { display: none; }
  .mh-header__inner { padding: 0.85rem 1rem; }
  .mh-nav { display: none; }
}

/* ============================================================
   HEADER — unified mobile/tablet layout (≤1024px)
   logo + wishlist + cart on top row, full-width search below.
   This is the authoritative rule and overrides earlier media queries.
   ============================================================ */
@media (max-width: 1024px) {
  .mh-header__inner {
    display: grid;
    grid-template-columns: auto 1fr auto;
    grid-template-rows: auto auto;
    grid-template-areas:
      "toggle logo icons"
      "search search search";
    padding: 0.65rem 1rem;
    row-gap: 0.55rem;
    column-gap: 0.6rem;
    align-items: center;
  }
  .mh-header__brand {
    grid-area: logo;
    justify-self: center;
  }
  .mh-header__brand-img { height: 36px; }
  .mh-header__icons {
    grid-area: icons;
    display: inline-flex;
    gap: 0.15rem;
    flex-wrap: nowrap;
    justify-self: end;
  }
  /* Show only wishlist + cart on mobile/tablet (hide account icon) */
  .mh-header__icons > a[aria-label="Min konto"] { display: none; }
  .mh-header__icon-btn {
    width: 40px;
    height: 40px;
    padding: 0.4rem;
  }
  .mh-header__icon-btn .ph { font-size: 22px; }
  .mh-header__mobile-toggle {
    grid-area: toggle;
    display: inline-flex;
    justify-self: start;
  }

  .mh-header__search {
    display: flex;
    grid-area: search;
    width: 100%;
    max-width: 100%;
    margin: 0;
    height: 42px;
    border-radius: 0;
  }
  input.mh-header__search-input { font-size: 14px; }
}

@media (max-width: 640px) {
  .mh-header__inner { padding: 0.55rem 0.85rem; }
  .mh-header__brand-img { height: 32px; }
  .mh-header__icon-btn { width: 38px; height: 38px; }
  .mh-header__search { height: 40px; }
}

/* Module product blocks inside .mh-container drop their nested Bootstrap
   .container constraint (1320px) so the product grid aligns with the
   1650px page grid. The outer .mh-container already handles max-width + padding. */
.mh-container .module-products.container,
.mh-container .ps-featuredproducts .container,
.mh-container .ps-newproducts .container,
.mh-container .ps-bestsellers .container,
.mh-container section.container,
.mh-hookhome .container {
  max-width: 100%;
  width: 100%;
  padding: 0;
  margin: 0;
}

/* Widen Bootstrap's standalone .container cap (default 1320px at the ≥1400px
   xxl breakpoint) to the brand page-grid width so it lines up with --bz-max.
   Loaded after theme.css → wins without; the 100% rule above still
   governs .container nested inside .mh-container. */
@media (min-width: 1400px) {
  .container,
  .container-xxl {
    max-width: var(--bz-max);
  }
}

/* ============================================================
   MOBILE NAV DRAWER — slide-in menu from the burger
   ============================================================ */
.mh-mobnav-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 15, 15, 0.45);
  z-index: 1090;
  opacity: 0;
  transition: opacity .28s ease;
}
.mh-mobnav-overlay.is-open { opacity: 1; }

.mh-mobnav {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: 84vw;
  max-width: 340px;
  background: #FFFFFF;
  z-index: 1095;
  transform: translateX(-100%);
  transition: transform .3s cubic-bezier(.4, 0, .2, 1);
  display: flex;
  flex-direction: column;
  box-shadow: 4px 0 24px rgba(15, 15, 15, 0.12);
  overflow-y: auto;
}
.mh-mobnav.is-open { transform: translateX(0); }

.mh-mobnav__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.1rem 1.25rem;
  border-bottom: 1px solid var(--mh-line);
}
.mh-mobnav__title {
  font-family: var(--mh-font-heading);
  font-weight: 600;
  font-size: 1.15rem;
  color: var(--mh-plum);
  letter-spacing: -0.01em;
}
.mh-mobnav__close {
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 0;
  color: var(--mh-plum);
  cursor: pointer;
  border-radius: 50%;
}
.mh-mobnav__close:hover { background: var(--mh-rose); }
.mh-mobnav__close i { font-size: 22px; }

.mh-mobnav__nav {
  display: flex;
  flex-direction: column;
  padding: 0.5rem 0;
}
.mh-mobnav__link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.95rem 1.25rem;
  font-size: 15px;
  font-weight: 600;
  color: var(--mh-plum);
  text-decoration: none;
  border-bottom: 1px solid var(--mh-line);
}
.mh-mobnav__link:active { background: var(--mh-rose); }
.mh-mobnav__link--accent { color: var(--mh-primary-deep); }

.mh-mobnav__foot {
  margin-top: auto;
  padding: 1rem 1.25rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  border-top: 1px solid var(--mh-line);
}
.mh-mobnav__util {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.65rem 0;
  font-size: 14px;
  font-weight: 500;
  color: var(--mh-plum-soft);
  text-decoration: none;
}
.mh-mobnav__util i { font-size: 19px; color: var(--mh-plum); }
.mh-mobnav__util:active { color: var(--mh-primary-deep); }

/* Only relevant on small screens; keep hidden on desktop */
@media (min-width: 1025px) {
  .mh-mobnav, .mh-mobnav-overlay { display: none; }
}


@media (max-width: 991.98px) {
  /* Remove the divider line under the header on mobile */
  .mh-header { border-bottom: 0; }
}

@media (max-width: 640px) {
  /* Logo — smaller and sitting next to the burger menu (not centered) */
  .mh-header__brand { justify-self: start; }
  .mh-header__brand-img { height: 24px; }

  /* Search bar — edge-to-edge full width */
  .mh-header__inner { padding-left: 0.75rem; padding-right: 0.75rem; }
  .mh-header__search {
    margin-left: -0.75rem;
    margin-right: -0.75rem;
    width: calc(100% + 1.5rem);
    max-width: calc(100% + 1.5rem);
    border-radius: 0;
  }
}
/* MyHair drawer: keep the native menu behaviour, style the theme-owned surface. */
#header .mhb-drawer #bm-menu #bm-nav {
  display:flex; width:min(420px,92vw); padding:12px 20px 28px!important;
  background:#f9f8f6; color:#242126; border:0; border-radius:0 20px 20px 0;
  transform:translateX(-105%); visibility:hidden;
  transition:transform 320ms cubic-bezier(.22,1,.36,1),visibility 0s 320ms;
  box-shadow:none;
}
#header .mhb-drawer #bm-menu #bm-nav.open {
  transform:translateX(0);visibility:visible;
  transition:transform 320ms cubic-bezier(.22,1,.36,1),visibility 0s;
  box-shadow:12px 0 40px #24212618;
}
#header .mhb-drawer #bm-menu #bm-nav * {visibility:inherit!important}
#header .mhb-drawer nav#bm-menu::before {
  content:'';position:fixed;inset:0;z-index:1100;background:#24212666;
  opacity:0;visibility:hidden;pointer-events:none;
  transition:opacity 260ms ease,visibility 0s 320ms;
}
#header .mhb-drawer nav#bm-menu.overlay::before {
  opacity:1;visibility:visible;pointer-events:auto;transition-delay:0s;
}
#header .mhb-drawer #bm-menu #bm-nav .bm-nav-header {
  padding:8px 0 20px;border:0;align-items:center;justify-content:space-between;
}
#header .mhb-drawer #bm-menu #bm-nav .bm-nav-header::before {
  content:'Menu';font:600 28px/1.2 Syne,sans-serif;letter-spacing:-.025em;
}
#header .mhb-drawer #bm-menu #bm-nav .toggle-close {
  background:#eee9f0;border:0;border-radius:50%;color:#62506f;transition:background 160ms;
}
#header .mhb-drawer #bm-menu #bm-nav .toggle-close:hover {background:#e3dce9}
#header .mhb-drawer #bm-menu #bm-nav>.bm-item {border:0;margin:2px 0;background:transparent}
#header .mhb-drawer #bm-menu #bm-nav>.bm-item>a {
  padding:14px 16px!important;border-radius:10px;font:500 17px/1.4 Montserrat,sans-serif;
  color:#242126;transition:background 160ms,color 160ms;min-height:52px;
}
#header .mhb-drawer #bm-menu #bm-nav>.bm-item>a:hover,
#header .mhb-drawer #bm-menu #bm-nav>.bm-item.open>a {background:#eee9f0;color:#62506f}
#header .mhb-drawer #bm-menu #bm-nav .bm-drop {background:transparent;border:0}
#header .mhb-drawer #bm-menu #bm-nav .bm-drop>.container {padding:6px 12px 12px}
#header .mhb-drawer #bm-menu #bm-nav .bm-cats a {color:#625b67;border-radius:8px;padding:10px 16px;min-height:44px}
#header .mhb-drawer #bm-menu #bm-nav .bm-cats a:hover {color:#62506f;background:#eee9f0}
#header .mhb-drawer #bm-menu #bm-nav a:focus-visible,
#header .mhb-drawer #bm-menu #bm-nav button:focus-visible {outline:2px solid #74648d;outline-offset:-2px}
@media(prefers-reduced-motion:reduce){
 #header .mhb-drawer #bm-menu #bm-nav,#header .mhb-drawer #bm-menu #bm-nav.open,
 #header .mhb-drawer nav#bm-menu::before,#header .mhb-drawer nav#bm-menu.overlay::before {transition:none}
}
