/* Shop mega menu (desktop) and Shop accordion (mobile panel).
   Markup lives in header template 29350 (elements labelled "EM mega" / "EM mobile");
   behaviour in js/mega-menu.js. Owned by Stream C. */

/* ---------- Desktop trigger ---------- */
.navlinks .em-mega-item {
  display: flex;
  align-items: center;
  gap: 4px;
}
.em-mega-toggle {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  margin: 0 -6px 0 0;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: none;
  color: var(--ink-soft);
  cursor: pointer;
  transition: color .25s, background-color .25s;
}
.em-mega-toggle svg,
.em-macc__toggle svg {
  width: 11px;
  height: 11px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform .3s cubic-bezier(.2,.7,.2,1);
}
.em-mega-toggle:hover,
.em-mega-item.is-open .em-mega-toggle {
  color: var(--ink);
  background: var(--cream-2);
}
.em-mega-toggle[aria-expanded="true"] svg,
.em-macc__toggle[aria-expanded="true"] svg {
  transform: rotate(180deg);
}
/* Keep the Shop link underlined while its panel is open. */
.navlinks .em-mega-item.is-open > a { color: var(--ink); }
.navlinks .em-mega-item.is-open > a::after { width: 100%; }

/* ---------- Desktop panel ---------- */
/* Positioned against the sticky <header> (0bwhvi), so it spans the full
   viewport under the nav bar and never pushes content down. */
.em-mega {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 5;
  background: var(--cream);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 30px 50px -30px rgba(32, 33, 29, .28);
  text-transform: none;
  letter-spacing: 0;
  font-family: var(--body);
  font-size: 14px;
  font-weight: 400;
  cursor: auto;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: opacity .2s ease, transform .28s cubic-bezier(.2,.7,.2,1), visibility 0s linear .28s;
}
.em-mega.is-open {
  opacity: 1;
  visibility: visible;
  transform: none;
  transition: opacity .22s ease, transform .32s cubic-bezier(.2,.7,.2,1), visibility 0s;
}
/* Hover bridge over the gap between the Shop link and the panel. */
.em-mega::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 100%;
  height: 26px;
}
/* Soft scrim over the page while the panel is open (never catches clicks). */
.em-mega::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  height: 100vh;
  background: rgba(32, 33, 29, .16);
  pointer-events: none;
}
@media (prefers-reduced-motion: reduce) {
  .em-mega, .em-mega.is-open { transform: none; transition: none; }
}

.em-mega .em-mega__in {
  display: grid;
  grid-template-columns: minmax(150px, .95fr) repeat(4, minmax(0, 1fr)) minmax(230px, 1.3fr);
  gap: 36px;
  padding-top: 42px;
  padding-bottom: 46px;
}
/* The panel sits inside .navlinks, so undo its link treatment. */
.navlinks .em-mega a {
  position: static;
  padding: 0;
  color: var(--ink-soft);
}
.navlinks .em-mega a::after { content: none; }

.em-mega__lead {
  padding-right: 32px;
  border-right: 1px solid var(--line);
}
.em-mega__kicker,
.em-mega .em-mega__h {
  display: block;
  margin: 0 0 18px;
  font-family: var(--disp);
  text-transform: uppercase;
  letter-spacing: .2em;
  font-size: 10.5px;
  font-weight: 600;
  line-height: 1.4;
}
.em-mega__kicker { color: var(--taupe); }
.navlinks .em-mega .em-mega__h { color: var(--taupe-deep); transition: color .25s; }
.navlinks .em-mega .em-mega__h:hover { color: var(--ink); }

.navlinks .em-mega .em-mega__big {
  display: block;
  width: fit-content;
  font-family: var(--serif);
  font-weight: 500;
  font-size: 30px;
  line-height: 1.12;
  letter-spacing: -.005em;
  color: var(--ink);
  padding: 3px 0;
  transition: color .25s, transform .35s cubic-bezier(.2,.7,.2,1);
}
.navlinks .em-mega .em-mega__big:hover { color: var(--taupe); transform: translateX(4px); }

.em-mega__col--stack {
  display: flex;
  flex-direction: column;
  gap: 32px;
}
.em-mega .em-mega__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 11px;
}
.em-mega .em-mega__list li { margin: 0; padding: 0; }
.navlinks .em-mega .em-mega__list a {
  display: inline-block;
  font-size: 14.5px;
  line-height: 1.4;
  text-decoration: underline;
  text-decoration-color: transparent;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
  transition: color .25s, text-decoration-color .25s;
}
.navlinks .em-mega .em-mega__list a:hover {
  color: var(--ink);
  text-decoration-color: var(--taupe);
}
.navlinks .em-mega .em-mega__list a.em-mega__all {
  display: inline-block;
  margin-top: 6px;
  font-family: var(--disp);
  text-transform: uppercase;
  letter-spacing: .16em;
  font-size: 10.5px;
  font-weight: 600;
  color: var(--taupe);
}

/* Featured tile */
.navlinks .em-mega .em-mega__feature {
  position: relative;
  display: block;
  min-height: 250px;
  border-radius: 3px;
  overflow: hidden;
  background: var(--cream-2);
  color: #fff;
}
.em-mega__media { position: absolute; inset: 0; }
.em-mega__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 18%;
  transition: transform .9s cubic-bezier(.2,.7,.2,1);
}
.em-mega__feature:hover .em-mega__media img { transform: scale(1.04); }
.em-mega__media::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(32,33,29,0) 34%, rgba(32,33,29,.72) 100%);
}
.em-mega__cap {
  position: absolute;
  left: 22px;
  right: 22px;
  bottom: 20px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  text-align: left;
}
.em-mega__cap .k {
  margin-bottom: 6px;
  padding: 6px 10px;
  border-radius: 2px;
  background: rgba(255, 255, 255, .94);
  font-family: var(--disp);
  text-transform: uppercase;
  letter-spacing: .18em;
  font-size: 9.5px;
  font-weight: 600;
  line-height: 1.2;
  color: var(--taupe-deep);
}
.em-mega__cap .t {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 32px;
  line-height: 1.05;
}
.em-mega__cap .s { font-size: 13.5px; opacity: .92; }
.em-mega__cap .s span { display: inline-block; margin-left: 4px; transition: transform .35s; }
.em-mega__feature:hover .em-mega__cap .s span { transform: translateX(4px); }

/* Narrow desktop: drop the image tile, tighten the columns. */
@media (max-width: 1199px) {
  .em-mega .em-mega__in {
    grid-template-columns: minmax(120px, .85fr) repeat(4, minmax(0, 1fr));
    gap: 28px;
  }
  .navlinks .em-mega .em-mega__feature { display: none; }
  .em-mega__lead { padding-right: 24px; }
  .navlinks .em-mega .em-mega__big { font-size: 26px; }
}

/* ---------- Mobile accordion ---------- */
.em-macc { display: none; }
@media (max-width: 940px) {
  .em-macc { display: block; }
  /* The panel grows with the accordion: fill the viewport below the header and scroll inside. */
  #brx-header .mobnav.open.open {
    max-height: calc(100vh - var(--em-mobnav-top, 124px));
    max-height: calc(100dvh - var(--em-mobnav-top, 124px));
    overflow-y: auto;
    overscroll-behavior: contain;
  }
  .em-macc__toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    margin: 0;
    padding: 14px var(--gutter);
    border: 0;
    border-bottom: 1px solid var(--cream-2);
    background: none;
    font-family: var(--disp);
    text-transform: uppercase;
    letter-spacing: .14em;
    font-size: 12px;
    font-weight: 500;
    line-height: inherit;
    color: var(--ink-soft);
    text-align: left;
    cursor: pointer;
  }
  .em-macc__toggle[aria-expanded="true"] { color: var(--ink); }
  .em-macc__toggle svg { width: 12px; height: 12px; }

  .em-macc__panel {
    display: grid;
    grid-template-rows: 0fr;
    visibility: hidden;
    transition: grid-template-rows .35s cubic-bezier(.2,.7,.2,1), visibility 0s linear .35s;
  }
  .em-macc__panel.is-open {
    grid-template-rows: 1fr;
    visibility: visible;
    transition: grid-template-rows .35s cubic-bezier(.2,.7,.2,1), visibility 0s;
  }
  .em-macc__inner { overflow: hidden; min-height: 0; }
  .em-macc__body {
    padding: 18px var(--gutter) 24px;
    background: var(--cream);
    border-bottom: 1px solid var(--line);
  }
  .em-macc__lead {
    display: flex;
    gap: 22px;
    padding-bottom: 16px;
    margin-bottom: 18px;
    border-bottom: 1px solid var(--line);
  }
  #mobnav .em-macc__lead a {
    display: inline-block;
    padding: 0;
    border: 0;
    font-family: var(--serif);
    text-transform: none;
    letter-spacing: 0;
    font-size: 24px;
    font-weight: 500;
    line-height: 1.1;
    color: var(--ink);
  }
  .em-macc__groups {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 22px 20px;
  }
  .em-macc__groups .em-mega__col--stack { gap: 22px; }
  #mobnav .em-macc__groups a {
    display: block;
    padding: 5px 0;
    border: 0;
    font-family: var(--body);
    text-transform: none;
    letter-spacing: 0;
    font-size: 14.5px;
    font-weight: 400;
    line-height: 1.35;
    color: var(--ink-soft);
  }
  #mobnav .em-macc__groups a.em-mega__h {
    margin: 0 0 4px;
    padding: 0 0 4px;
    font-family: var(--disp);
    text-transform: uppercase;
    letter-spacing: .18em;
    font-size: 10.5px;
    font-weight: 600;
    color: var(--taupe-deep);
  }
  #mobnav .em-macc__groups a.em-mega__all {
    font-family: var(--disp);
    text-transform: uppercase;
    letter-spacing: .14em;
    font-size: 10.5px;
    font-weight: 600;
    color: var(--taupe);
  }
  .em-macc__groups .em-mega__list { list-style: none; margin: 0; padding: 0; }
  @media (prefers-reduced-motion: reduce) {
    .em-macc__panel, .em-macc__panel.is-open { transition: none; }
  }
}

/* A closing panel must not catch the pointer while it fades out. */
.em-mega:not(.is-open) { pointer-events: none; }

/* Keep "t-shirts" from breaking at its hyphen. */
.em-nw { white-space: nowrap; }

/* Round focus ring to match the round chevron button. */
.em-mega-toggle:focus-visible { border-radius: 50%; outline-offset: 2px; }
@media (max-width: 940px) {
  #mobnav .em-macc__groups a.em-mega__all { margin-top: 6px; }
}
