/**
 * D-038/D-039 navigation layer.
 */

.mm-header__bar {
  grid-template-columns: minmax(9.5rem, auto) auto minmax(16rem, 1fr) auto;
  gap: clamp(0.6rem, 1.2vw, 1rem);
  min-height: 72px;
}

.mm-header__category-trigger {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  gap: 0.55rem;
  padding: 0.55rem 0.85rem;
  border: 1px solid rgba(255,255,255,0.24);
  border-radius: var(--mm-radius-sm);
  background: #171a16;
  color: #fff;
  font-size: 0.82rem;
  font-weight: 800;
}

.mm-header__category-trigger[aria-expanded="false"]:hover {
  border-color: rgba(155, 197, 30, 0.78);
  background: #22261f;
  color: #fff;
}

.mm-header__category-trigger[aria-expanded="true"] {
  border-color: var(--mm-lime);
  background: var(--mm-lime);
  color: var(--mm-ink);
}

.mm-header__category-trigger svg,
.mm-header__menu-toggle svg {
  width: 1.15rem;
  height: 1.15rem;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-width: 1.8;
}

.mm-header__logo img {
  width: 42px;
  height: 42px;
}

.mm-mega-menu {
  position: absolute;
  z-index: 70;
  top: 100%;
  left: 50%;
  display: grid;
  width: min(1160px, calc(100vw - 2rem));
  min-height: 410px;
  grid-template-columns: 300px minmax(0, 1fr);
  overflow: hidden;
  border: 1px solid var(--mm-line);
  border-radius: 0 0 14px 14px;
  background: #fff;
  color: var(--mm-text);
  box-shadow: 0 22px 65px rgba(10,12,8,0.25);
  transform: translateX(-50%);
}

.mm-mega-menu[hidden] { display: none; }

.mm-mega-menu__roots {
  padding: 1.4rem 1rem;
  background: #111410;
  color: #fff;
}

.mm-mega-menu__eyebrow {
  margin: 0 0 0.85rem 0.55rem;
  color: #979d93;
  font-size: 0.64rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.mm-mega-menu__roots [role="tab"] {
  display: grid;
  width: 100%;
  min-height: 58px;
  grid-template-columns: 1.5rem 1fr 1rem;
  align-items: center;
  gap: 0.65rem;
  padding: 0.55rem 0.65rem;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #d9ddd6;
  text-align: left;
  font-size: 0.79rem;
  font-weight: 750;
  line-height: 1.2;
}

.mm-mega-menu__roots [role="tab"] small { color: #7e8579; font-size: 0.62rem; }
.mm-mega-menu__roots [role="tab"] b { justify-self: end; }
.mm-mega-menu__roots [role="tab"]:hover { background: #1d211b; }
.mm-mega-menu__roots [role="tab"][aria-selected="true"] { background: var(--mm-lime); color: var(--mm-ink); }
.mm-mega-menu__roots [role="tab"][aria-selected="true"] small { color: #4f6120; }

.mm-mega-menu__help {
  margin: 1.1rem 0.55rem 0;
  padding-top: 1rem;
  border-top: 1px solid #2c302a;
  color: #959b91;
  font-size: 0.65rem;
  line-height: 1.45;
}
.mm-mega-menu__help strong { display: block; margin-bottom: 0.2rem; color: #fff; }

.mm-mega-menu__panels { min-width: 0; padding: 1.7rem 2rem 1.25rem; }
.mm-mega-menu__panel { display: flex; min-height: 100%; flex-direction: column; }
.mm-mega-menu__panel[hidden] { display: none; }
.mm-mega-menu__panel > header { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; padding-bottom: 1rem; border-bottom: 1px solid var(--mm-line); }
.mm-mega-menu__panel > header span { color: #7b8177; font-size: 0.62rem; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; }
.mm-mega-menu__panel h2 { margin: 0.3rem 0 0; font-size: 1.5rem; letter-spacing: -0.04em; line-height: 1; }
.mm-mega-menu__panel > header > a { display: inline-flex; align-items: center; gap: 0.5rem; color: #34420f; font-size: 0.75rem; font-weight: 800; text-decoration: none; }
.mm-mega-menu__panel > header > a b { display: grid; width: 1.75rem; height: 1.75rem; place-items: center; border-radius: 50%; background: var(--mm-lime-soft); }
.mm-mega-menu__grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 1.4rem 1.8rem; padding-top: 1.2rem; }
.mm-mega-menu__branch h3 { margin: 0 0 0.55rem; font-size: 0.82rem; line-height: 1.25; }
.mm-mega-menu__branch h3 a { color: var(--mm-text); text-decoration: none; }
.mm-mega-menu__branch ul { margin: 0; padding: 0; list-style: none; }
.mm-mega-menu__branch li { margin: 0 0 0.42rem; }
.mm-mega-menu__branch li a { color: var(--mm-muted); font-size: 0.74rem; line-height: 1.3; text-decoration: none; }
.mm-mega-menu__branch a:hover { color: #617e0c; }
.mm-mega-menu__note { margin: auto 0 0; padding-top: 0.9rem; border-top: 1px solid var(--mm-line); color: #747a70; font-size: 0.65rem; }

.mm-mobile-categories,
.mm-mobile-categories__backdrop { display: none; }

@media (max-width: 1100px) {
  .mm-header__bar { grid-template-columns: auto auto minmax(12rem,1fr) auto; }
  .mm-header__wordmark { display: none; }
  .mm-mega-menu { grid-template-columns: 260px minmax(0,1fr); }
  .mm-mega-menu__grid { gap: 1.1rem; }
}

@media (max-width: 782px) {
  .mm-header__bar {
    grid-template-columns: 44px minmax(0,1fr) auto;
    gap: 0.55rem;
    padding-block: 0.5rem;
  }
  .mm-header__category-trigger,
  .mm-mega-menu { display: none !important; }
  .mm-header__menu-toggle { display: inline-grid; grid-row: 1; place-items: center; }
  .mm-header__menu-toggle:hover { border-color: rgba(155, 197, 30, 0.78); background: rgba(255,255,255,0.08); color: #fff; }
  .mm-header__logo { grid-row: 1; }
  .mm-header__logo img { width: 40px; height: 40px; }
  .mm-search { grid-column: 1/-1; grid-row: 2; }
  .mm-header__actions { grid-column: 3; grid-row: 1; }

  .mm-mobile-categories {
    position: fixed;
    z-index: 82;
    inset: 0 auto 0 0;
    display: flex;
    width: min(92vw, 24rem);
    flex-direction: column;
    background: var(--mm-paper);
    color: var(--mm-text);
    box-shadow: 18px 0 55px rgba(0,0,0,0.28);
  }
  .mm-mobile-categories[hidden] { display: none; }
  .mm-mobile-categories__backdrop {
    position: fixed;
    z-index: 81;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
    min-height: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: rgba(5,5,5,0.68);
  }
  .mm-mobile-categories__backdrop:hover,
  .mm-mobile-categories__backdrop:focus,
  .mm-mobile-categories__backdrop:active {
    border-color: transparent;
    background: rgba(5,5,5,0.68);
    color: transparent;
  }
  .mm-mobile-categories__backdrop[hidden] { display: none; }
  .mm-mobile-categories__head { display: grid; min-height: 68px; grid-template-columns: 44px 1fr 44px; align-items: center; gap: 0.5rem; padding: 0.65rem 0.8rem; border-bottom: 1px solid var(--mm-line); }
  .mm-mobile-categories__head [data-mm-mobile-back] { grid-column: 1; }
  .mm-mobile-categories__head strong { grid-column: 2; min-width: 0; white-space: nowrap; text-align: center; font-size: 1rem; }
  .mm-mobile-categories__head [data-mm-mobile-close] { grid-column: 3; }
  .mm-mobile-categories__head button { width: 44px; height: 44px; padding: 0; border: 1px solid var(--mm-line); border-radius: 50%; background: #fff; color: var(--mm-text); }
  .mm-mobile-categories__body { overflow-y: auto; padding: 0.5rem 1rem 2rem; }
  .mm-mobile-categories__level[hidden] { display: none; }
  .mm-mobile-categories__level > a,
  .mm-mobile-categories__level > button { display: grid; width: 100%; min-height: 54px; grid-template-columns: 1fr auto; align-items: center; gap: 0.75rem; padding: 0.65rem 0; border: 0; border-bottom: 1px solid var(--mm-line); border-radius: 0; background: transparent; color: var(--mm-text); text-align: left; font-size: 0.9rem; font-weight: 750; text-decoration: none; }
}
