/* MMG Storefront: the navigation (docs/superpowers/specs/2026-11-14-menu-train-2-navigation.md).
   Built to the approved mock (docs/superpowers/mocks/2026-11-14-menu-revamp/, v32): the phone header and bottom bar (01, S1, E-capsule-shrunk), the menu sheet
   (09, 09b, 09c), the desktop header (14) and the mega menu (15, 15b). The colours and spacing are custom properties local to this file; no shared token is
   added. Every selector starts with .mmg-nav, except the overrides of the Bricks header and train 1's tab row, which start with body.mmg-nav-on.
   Phone layout below 768px, the header row from 768px (its tablet fit to 1023px, the signed desktop from 1024px). The file is enqueued only where the header prints (preview or the flag). */

.mmg-nav {
  --mmg-nav-cream-50: #fbf6ec;
  --mmg-nav-cream-100: #f0e9de;
  --mmg-nav-cream-200: #e4ddd2;
  --mmg-nav-ink: #2f2c28;
  --mmg-nav-ink-muted: #55504a;
  --mmg-nav-brown: #68442c;
  --mmg-nav-toasted-gold: #d5ae73;
  --mmg-nav-unlocked-green: #1f8a70;
  --mmg-nav-scrim: rgba(47, 44, 40, 0.45);
  --mmg-nav-scroll: rgba(85, 80, 74, 0.4);

  --mmg-nav-body: 'Hanken Grotesk', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mmg-nav-serif: 'Noto Serif', 'Noto Serif Fallback', Georgia, 'Times New Roman', serif;

  box-sizing: border-box;
  color: var(--mmg-nav-ink);
  font-family: var(--mmg-nav-body);
  font-size: 14px;
  line-height: 20px;
}

.mmg-nav *,
.mmg-nav *::before,
.mmg-nav *::after {
  box-sizing: border-box;
}

.mmg-nav[hidden],
.mmg-nav [hidden] {
  display: none !important;
}

.mmg-nav a,
.mmg-nav button {
  -webkit-tap-highlight-color: transparent;
}

/* The theme (Bricks) gives h1-h6, buttons, links and lists its own font, spacing, colour and border. Every link, button, list and heading this module prints
   states those properties itself: this baseline first, then each component's own rules below it (the same specificity, so the later rule wins). */
.mmg-nav-brand,
.mmg-nav-account,
.mmg-nav-cart,
.mmg-nav-link,
.mmg-nav-item,
.mmg-nav-help__link,
.mmg-nav-tile,
.mmg-nav-start,
.mmg-nav-row,
.mmg-nav-chip,
.mmg-nav-bar__menu,
.mmg-nav-bar__shop,
.mmg-nav-pill,
.mmg-nav-plan,
.mmg-nav-toggle,
.mmg-nav-close,
.mmg-nav-label,
.mmg-nav-sheet__title,
.mmg-nav-list,
.mmg-nav-rows,
.mmg-nav-chips,
.mmg-nav-help__links {
  display: block;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: none;
  box-shadow: none;
  font-family: var(--mmg-nav-body);
  font-style: normal;
  line-height: 20px;
  letter-spacing: normal;
  text-align: left;
  text-transform: none;
  text-decoration: none;
  list-style: none;
}

.mmg-nav-pill,
.mmg-nav-plan,
.mmg-nav-toggle,
.mmg-nav-close {
  -webkit-appearance: none;
  appearance: none;
  min-width: 0;
  min-height: 0;
}

.mmg-nav li {
  display: block;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  list-style: none;
}

/* A link takes the colour of its parent, so the theme's link colour never reaches it, hovered or not; the few that differ say so with a.class. */
.mmg-nav a,
.mmg-nav a:hover,
.mmg-nav a:focus,
.mmg-nav a:active,
.mmg-nav a:visited {
  color: inherit;
  text-decoration: none;
}

.mmg-nav a.mmg-nav-brand {
  color: var(--mmg-nav-brown);
}

.mmg-nav a.mmg-nav-row--muted,
.mmg-nav a.mmg-nav-row--plain,
.mmg-nav a.mmg-nav-help__link {
  color: var(--mmg-nav-ink-muted);
}

.mmg-nav button {
  font-family: inherit;
  cursor: pointer;
}

/* One focus ring on every link, button, chip and the search input. */
.mmg-nav a:focus-visible,
.mmg-nav button:focus-visible,
.mmg-nav-search:focus-within {
  outline: 2px solid var(--mmg-nav-brown);
  outline-offset: 2px;
}

/* The sheet and its title take focus when it opens (dialog a11y), and wear no ring for it. */
.mmg-nav-sheet:focus,
.mmg-nav-sheet__title:focus {
  outline: 0;
}

.mmg-nav-svg {
  display: block;
  flex: none;
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.mmg-nav-svg--s {
  width: 18px;
  height: 18px;
}

/* A festive toggle's chevron turns up while its list is open. */
.mmg-nav-toggle[aria-expanded='true'] > .mmg-nav-svg {
  transform: rotate(180deg);
}

/* ---- Overrides of the Bricks header and train 1's tab row (preview or flag only: the file is not loaded otherwise) ------------------------------ */

/* The Bricks main header row steps aside; the promo bar above it stays and scrolls away with the page (the sticky rule has one id and two classes). */
body.mmg-nav-on #brx-header .site-header--main {
  display: none !important;
}

body.mmg-nav-on #brx-header {
  position: static !important;
  top: auto !important;
  transform: none !important;
}

body.mmg-nav-on.mmg-nav-locked {
  overflow: hidden;
}

/* Train 1's menu script reads this from the body's computed style: always a px length, 0px while the header scrolls away (phone), 72px at desktop widths below. */
body.mmg-nav-on {
  --mmg-nav-header-h: 0px;
}

/* The last content clears the bar: its height plus its offset. With the Bricks footer the clearance sits on the footer's last section, so it carries that section's background instead of showing the page background under it. */
@media (max-width: 767px) {
  body.mmg-nav-on {
    padding-bottom: calc(68px + env(safe-area-inset-bottom));
  }

  body.mmg-nav-on:has(#brx-footer > :last-child) {
    padding-bottom: 0;
  }

  body.mmg-nav-on #brx-footer > :last-child {
    padding-bottom: calc(68px + env(safe-area-inset-bottom));
  }
}

/* The header from 768px is sticky and 72px high, so train 1's sticky tab row and its scroll targets sit under it. */
@media (min-width: 768px) {
  body.mmg-nav-on {
    --mmg-nav-header-h: 72px;
  }

  body.mmg-nav-on .mmg-menu-tabs {
    top: var(--mmg-nav-header-h, 0px);
  }

  body.mmg-nav-on .mmg-menu-section {
    scroll-margin-top: calc(92px + var(--mmg-nav-header-h, 0px));
  }
}

/* Logged-in viewers carry WordPress's fixed admin bar: the sticky header (a product page's too) starts below it, and the tab row follows the taller body variable.
   From 783px the bar is 32px high, from 768 to 782px it is 46px, and to 767px it is 46px while the header scrolls away (only train 1's sticky row is offset). */
@media (min-width: 783px) {
  body:is(.mmg-nav-on, .mmg-nav-pdp).admin-bar .mmg-nav-header {
    top: 32px;
  }

  body.mmg-nav-on.admin-bar {
    --mmg-nav-header-h: 104px;
  }
}

@media (min-width: 768px) and (max-width: 782px) {
  body:is(.mmg-nav-on, .mmg-nav-pdp).admin-bar .mmg-nav-header {
    top: 46px;
  }

  body.mmg-nav-on.admin-bar {
    --mmg-nav-header-h: 118px;
  }
}

@media (min-width: 601px) and (max-width: 767px) {
  body.mmg-nav-on.admin-bar {
    --mmg-nav-header-h: 46px;
  }
}

/* ---- Header: the phone row ---------------------------------------------------------------------------------------------------------------------- */

.mmg-nav-header {
  position: relative;
  background: var(--mmg-nav-cream-50);
}

.mmg-nav-header__row {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
  padding: 0 4px 0 16px;
  background: var(--mmg-nav-cream-50);
}

.mmg-nav-brand {
  display: flex;
  align-items: center;
  gap: 6px;
  font: 600 19px/24px var(--mmg-nav-body);
  letter-spacing: -0.2px;
  white-space: nowrap;
}

.mmg-nav-brand__mark {
  display: block;
  width: 32px;
  height: 32px;
  margin-left: -4px;
  object-fit: contain;
}

/* A site logo takes the mark's place, at its own aspect ratio: 28px high, up to 200px wide, no negative margin. */
.mmg-nav-brand--logo .mmg-nav-brand__mark {
  width: auto;
  height: 28px;
  max-width: 200px;
  margin-left: 0;
  object-fit: contain;
}

.mmg-nav-account,
.mmg-nav-cart {
  position: relative;
  display: grid;
  flex: none;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 999px;
  color: var(--mmg-nav-ink);
}

/* The cart item: the count badge on the bag. No badge at 0; the script decides from the span's text once it runs, and wins over the first-paint rule. */
.mmg-nav-cart__count {
  position: absolute;
  top: 4px;
  right: 2px;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border-radius: 9px;
  background: var(--mmg-nav-brown);
  color: var(--mmg-nav-cream-50);
  font: 600 12px/18px var(--mmg-nav-body);
  text-align: center;
}

.mmg-nav-cart__count[data-item-count='0'],
.mmg-nav-cart .mmg-nav-cart__count.is-off {
  display: none;
}

.mmg-nav-cart .mmg-nav-cart__count.is-on {
  display: block;
}

/* The cart total (train 5, delta mock): beside the bag in the desktop header (15/20 500), under it in the bar (12/16 500, below). Empty and hidden until the script has a figure. */
.mmg-nav-cart__total {
  color: var(--mmg-nav-ink);
  font: 500 15px/20px var(--mmg-nav-body);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* The desktop parts stay out of the phone header: the search, the Plan entry and the cart (in the bar) and the links. */
.mmg-nav-main,
.mmg-nav-search,
.mmg-nav-plan,
.mmg-nav-header .mmg-nav-cart,
.mmg-nav-mega {
  display: none;
}

/* ---- Header: the row from 768px ----------------------------------------------------------------------------------------------------------------- */

@media (min-width: 768px) {
  .mmg-nav-header {
    position: sticky;
    top: 0;
    z-index: 40;
  }

  /* The panel and its scrim print inside the header, so their own z-index only orders them there: the header itself goes above the page while it is open. */
  .mmg-nav-header.is-open {
    z-index: 990;
  }

  .mmg-nav-header__row {
    justify-content: flex-start;
    gap: 32px;
    height: 72px;
    padding: 0 max(40px, calc((100% - 1200px) / 2));
  }

  .mmg-nav-brand {
    gap: 8px;
    min-height: 44px;
    font-size: 20px;
  }

  .mmg-nav-brand__mark {
    width: 36px;
    height: 36px;
    margin-left: 0;
  }

  .mmg-nav-main {
    display: flex;
    gap: 4px;
  }

  .mmg-nav-pill,
  .mmg-nav-plan,
  .mmg-nav-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 44px;
    padding: 0 14px;
    border: 0;
    border-radius: 999px;
    background: none;
    color: var(--mmg-nav-ink);
    font: 500 15px/20px var(--mmg-nav-body);
    white-space: nowrap;
  }

  .mmg-nav-pill:focus,
  .mmg-nav-pill:active,
  .mmg-nav-plan:focus,
  .mmg-nav-plan:active,
  .mmg-nav-link:focus,
  .mmg-nav-link:active {
    border: 0;
    background: none;
    box-shadow: none;
    color: var(--mmg-nav-ink);
  }

  /* The header Plan entry gets the focus back, for a pointer user, after the planner panel closes (script: focusQuiet): no ring; a key keeps it. */
  .mmg-nav-plan.no-ring:focus,
  .mmg-nav-plan.no-ring:focus-visible {
    outline: none;
  }

  .mmg-nav-pill:hover,
  .mmg-nav-plan:hover,
  .mmg-nav-link:hover {
    border: 0;
    background: var(--mmg-nav-cream-100);
    box-shadow: none;
    color: var(--mmg-nav-ink);
  }

  /* The pill takes its fill and the brand colour while the mega menu is open (15); the Plan entry takes the fill and ink while its panel is open. */
  .mmg-nav-pill[aria-expanded='true'] {
    border: 0;
    background: var(--mmg-nav-cream-100);
    box-shadow: none;
    color: var(--mmg-nav-brown);
  }

  .mmg-nav-plan[aria-expanded='true'] {
    border: 0;
    background: var(--mmg-nav-cream-100);
    box-shadow: none;
    color: var(--mmg-nav-ink);
  }

  /* The Plan entry: the calendar and "Plan" while nothing is set, the day and time (the planner's capsule text, child spans) when something is. */
  .mmg-nav-plan {
    flex: none;
    gap: 8px;
  }

  .mmg-nav-plan .mmg-nav-svg {
    width: 26px;
    height: 26px;
  }

  .mmg-nav-plan.has-text .mmg-nav-plan__label {
    display: none;
  }

  /* From 768px one line: the day (the short word for tomorrow), no time. Wider screens add the time (see below). */
  .mmg-nav-plan__text {
    display: block;
    max-width: 200px;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
  }

  .mmg-nav-plan__text .mmg-nav-plan__short,
  .mmg-nav-plan__text .mmg-nav-plan__month,
  .mmg-nav-plan__text .mmg-nav-plan__comma,
  .mmg-nav-plan__text .mmg-nav-plan__time {
    display: none;
  }

  .mmg-nav-plan__text.has-short .mmg-nav-plan__lead {
    display: none;
  }

  .mmg-nav-plan__text.has-short .mmg-nav-plan__short {
    display: inline;
  }

  .mmg-nav-search {
    display: flex;
    flex: 0 1 300px;
    align-items: center;
    gap: 10px;
    min-width: 200px;
    height: 44px;
    margin: 0 0 0 auto;
    padding: 0 16px;
    border-radius: 999px;
    background: var(--mmg-nav-cream-100);
    color: var(--mmg-nav-ink-muted);
  }

  .mmg-nav-search__input {
    flex: 1;
    min-width: 0;
    height: 100%;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    outline: 0;
    background: none;
    box-shadow: none;
    color: var(--mmg-nav-ink);
    font: 400 15px/20px var(--mmg-nav-body);
    letter-spacing: normal;
    text-transform: none;
    -webkit-appearance: none;
    appearance: none;
  }

  .mmg-nav-search__input:hover,
  .mmg-nav-search__input:focus,
  .mmg-nav-search__input:active {
    border: 0;
    outline: 0;
    background: none;
    box-shadow: none;
  }

  .mmg-nav-search__input::placeholder {
    color: var(--mmg-nav-ink-muted);
    opacity: 1;
  }

  /* The bag keeps its 44px box (the badge on its top right), so the total beside it starts clear of the badge (delta mock 6a). */
  .mmg-nav-header .mmg-nav-cart {
    display: flex;
    width: auto;
    min-width: max-content;
    padding: 0 0 0 11px;
  }

  .mmg-nav-header .mmg-nav-cart .mmg-nav-svg {
    margin-right: 11px;
  }

  .mmg-nav-header .mmg-nav-cart__count {
    right: auto;
    left: 24px;
  }

  .mmg-nav-header .mmg-nav-cart__total {
    margin-left: 6px;
    padding-right: 12px;
  }

  .mmg-nav-mega {
    display: block;
  }

  /* Optical offset (approved mock 2026-11-16-desktop-nav-polish): the logo's wordmark sits low in its image, so the items step down 3px, only where the header carries
     the logo image (a text brand has no low-sitting wordmark). `translate`, not top/margin: the header stays 72px and no layout moves; the whole item moves, fills
     included. It is set on the items, never on .mmg-nav-main: a translated box becomes the containing block of the mega panel and would shrink it to the pill. */
  .mmg-nav-header:has(.mmg-nav-brand--logo) .mmg-nav-header__row > :is(.mmg-nav-search, .mmg-nav-plan, .mmg-nav-account, .mmg-nav-cart),
  .mmg-nav-header:has(.mmg-nav-brand--logo) .mmg-nav-main > .mmg-nav-pill {
    translate: 0 3px;
  }
}

/* The three text links stay out of the row from 768px at every width: with a plan set and a cart total they never fit the 1200px container, and the Menu pill and
   the mega menu cover them (Same-day delivery is in the Help list). The markup stays. */
@media (min-width: 768px) {
  .mmg-nav-link {
    display: none;
  }
}

/* ---- Header: the tablet fit, 768 to 1023px (the one-column mega menu is with the mega menu below) ------------------------------------------------- */

@media (min-width: 768px) and (max-width: 1023px) {
  .mmg-nav-header__row {
    gap: 8px;
    padding: 0 40px;
  }

  .mmg-nav-brand {
    margin-right: 4px;
  }

  .mmg-nav-brand--logo .mmg-nav-brand__mark {
    height: 24px;
  }

  /* The search is an icon until it is pressed: the input sits invisible over the 44px form (opacity, so a press still focuses it and the combobox opens), and it
     spreads over the whole row while open or focused. The rest of the row goes out of sight by opacity and pointer-events, never visibility: it stays in the Tab order,
     so Tab out of the popover lands on Plan and Shift+Tab from the field reaches Menu. The input is 16px so iOS does not zoom on focus. */
  .mmg-nav-search {
    position: relative;
    flex: none;
    justify-content: center;
    width: 44px;
    min-width: 44px;
    padding: 0;
    background: none;
  }

  .mmg-nav-search:hover {
    background: var(--mmg-nav-cream-100);
  }

  .mmg-nav-search .mmg-nav-search__input {
    position: absolute;
    inset: 0;
    width: 100%;
    opacity: 0;
    font-size: 16px;
    cursor: pointer;
  }

  .mmg-nav-search.is-search-open,
  .mmg-nav-search:focus-within {
    position: absolute;
    top: 14px;
    right: 40px;
    left: 40px;
    z-index: 3;
    flex: none;
    justify-content: flex-start;
    width: auto;
    min-width: 0;
    padding: 0 16px;
    background: var(--mmg-nav-cream-50);
    box-shadow: inset 0 0 0 1.5px var(--mmg-nav-brown);
    color: var(--mmg-nav-ink);
  }

  .mmg-nav-search.is-search-open .mmg-nav-search__input,
  .mmg-nav-search:focus-within .mmg-nav-search__input {
    position: static;
    opacity: 1;
    cursor: text;
  }

  .mmg-nav-header__row:has(.mmg-nav-search.is-search-open, .mmg-nav-search:focus-within) > :not(.mmg-nav-search) {
    opacity: 0;
    pointer-events: none;
  }

  /* The sticky tab row of the menu page (44px) sits under the header, so the pill hangs under it: it would cover the Brownies and Cookies tabs. */
  body.mmg-nav-on:has(.mmg-menu-tabs) .mmg-nav-line--header {
    top: calc(100% + 52px);
  }

  .mmg-nav-plan__text {
    max-width: 100px;
    overflow: hidden;
    text-overflow: ellipsis;
  }
}

/* ---- The Plan entry's words from 1024px: the day over the time; from 1200px one line ----------------------------------------------------------------- */

@media (min-width: 1024px) {
  .mmg-nav-plan__text {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    font-size: 12px;
    line-height: 14px;
  }

  .mmg-nav-plan__text .mmg-nav-plan__lead {
    font-weight: 600;
  }

  /* The whole word again ("Tomorrow"): the 768px rule above hides it for the short one, and has the same weight of selector. */
  .mmg-nav-plan__text.has-short .mmg-nav-plan__lead {
    display: inline;
  }

  .mmg-nav-plan__text.has-short .mmg-nav-plan__short {
    display: none;
  }

  .mmg-nav-plan__text .mmg-nav-plan__time {
    display: block;
    font-weight: 400;
  }
}

/* The Plan entry grew with its words, so from 1024 to 1199px the search field may give up some of its room to it (it is never clipped). */
@media (min-width: 1024px) and (max-width: 1199px) {
  .mmg-nav-search {
    min-width: 120px;
  }
}

@media (min-width: 1200px) {
  .mmg-nav-plan__text {
    flex-direction: row;
    align-items: center;
    font-size: 15px;
    line-height: 20px;
  }

  .mmg-nav-plan__text .mmg-nav-plan__lead {
    font-weight: 400;
  }

  .mmg-nav-plan__text .mmg-nav-plan__month,
  .mmg-nav-plan__text .mmg-nav-plan__time {
    display: inline;
  }

  .mmg-nav-plan__text .mmg-nav-plan__comma {
    display: inline;
    white-space: pre;
  }

  /* A flex item drops the space the month starts with ("Sun 22 Nov"), so the space is kept. */
  .mmg-nav-plan__text .mmg-nav-plan__month {
    white-space: pre;
  }
}

/* ---- Mega menu (desktop) ------------------------------------------------------------------------------------------------------------------------ */

.mmg-nav-scrim {
  position: fixed;
  inset: 0;
  background: var(--mmg-nav-scrim);
}

.mmg-nav-scrim--mega {
  z-index: 0;
}

.mmg-nav-scrim--sheet {
  z-index: 999;
  touch-action: none;
}

/* One fade for the three desktop scrims: the search scrim's, 220ms in and 140ms out, ease-in. The script adds .has-motion and reveals the mega scrim like the
   search's; reduced motion keeps the plain 120ms fade the other two have. */
@media (min-width: 768px) and (prefers-reduced-motion: no-preference) {
  .mmg-nav-scrim--mega.has-motion {
    opacity: 0;
    transition: opacity 140ms ease-in;
  }

  .mmg-nav-scrim--mega.has-motion.is-open {
    opacity: 1;
    transition: opacity 220ms ease-in;
  }
}

@media (min-width: 768px) and (prefers-reduced-motion: reduce) {
  .mmg-nav-scrim--mega.has-motion {
    opacity: 0;
    transition: opacity 120ms linear;
  }

  .mmg-nav-scrim--mega.has-motion.is-open {
    opacity: 1;
  }
}

.mmg-nav-mega {
  position: absolute;
  top: 100%;
  right: 0;
  left: 0;
  z-index: 2;
  overflow-y: auto;
  padding: 32px max(40px, calc((100% - 1200px) / 2)) 36px;
  background: var(--mmg-nav-cream-50);
}

.mmg-nav-mega__inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  align-items: start;
  column-gap: 40px;
}

.mmg-nav-mega__aside {
  padding-top: 8px;
}

.mmg-nav-mega__main > :first-child {
  margin-top: 0;
}

/* The headings (h2, h3) say everything themselves, at two classes of specificity: a theme rule such as :root h3 or body h2 must not reach them. */
.mmg-nav .mmg-nav-label {
  display: block;
  margin: 0 0 8px;
  padding: 0;
  border: 0;
  background: none;
  box-shadow: none;
  color: var(--mmg-nav-brown);
  font: 600 12px/16px var(--mmg-nav-body);
  letter-spacing: 1.2px;
  text-align: left;
  text-transform: uppercase;
}

.mmg-nav .mmg-nav-label--quiet {
  margin: 0;
  color: var(--mmg-nav-ink-muted);
}

/* The tile row: 4:3 photos, the category name under each; a long name wraps. */
.mmg-nav-tiles {
  display: grid;
  grid-template-columns: repeat(var(--mmg-nav-cols, 6), minmax(0, 1fr));
  column-gap: 16px;
}

.mmg-nav-tile__photo {
  position: relative;
  display: block;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: 12px;
  background: var(--mmg-nav-cream-100);
  margin-bottom: 8px;
}

.mmg-nav-tile__img {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.mmg-nav-tile__name {
  display: inline;
  font: 500 14px/20px var(--mmg-nav-body);
}

/* The band under the tiles: one grid on the tile row's columns, so the groups sit on the tile edges. */
.mmg-nav-band {
  display: grid;
  grid-template-columns: repeat(var(--mmg-nav-cols, 6), minmax(0, 1fr));
  align-items: start;
  column-gap: 16px;
  margin-top: 40px;
}

.mmg-nav-group--need {
  grid-column: 1;
}

.mmg-nav-group--season {
  grid-column: 2;
}

.mmg-nav-group--taste {
  grid-column: 3 / span 2;
}

.mmg-nav-group--festive {
  grid-column: 5 / span 2;
}

.mmg-nav-group--taste .mmg-nav-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 16px;
}

.mmg-nav-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.mmg-nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 30px;
  font: 500 15px/20px var(--mmg-nav-body);
}

.mmg-nav-item__count {
  color: var(--mmg-nav-ink-muted);
  font-weight: 400;
}

.mmg-nav-help {
  display: flex;
  align-items: baseline;
  gap: 24px;
  margin-top: 24px;
}

.mmg-nav-help__links {
  display: flex;
  gap: 24px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.mmg-nav-help__link {
  display: block;
  padding: 5px 0;
  font: 400 15px/20px var(--mmg-nav-body);
}

/* The start-here card: top-aligned, a fixed photo, so it keeps its size when the festive list opens. */
.mmg-nav-start {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 280px;
  padding: 16px;
  border-radius: 12px;
  background: var(--mmg-nav-cream-100);
}

.mmg-nav-start__photo {
  display: block;
  width: 248px;
  height: 186px;
  overflow: hidden;
  border-radius: 12px;
  background: var(--mmg-nav-cream-200);
}

.mmg-nav-start__img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.mmg-nav-start__text {
  display: block;
}

.mmg-nav-start__label {
  display: block;
  color: var(--mmg-nav-brown);
  font: 600 12px/16px var(--mmg-nav-body);
  letter-spacing: 1.2px;
  text-transform: uppercase;
}

.mmg-nav-start__title {
  display: block;
  margin-top: 4px;
  font: 400 20px/26px var(--mmg-nav-serif);
}

.mmg-nav-start__line {
  display: block;
  color: var(--mmg-nav-ink-muted);
  font: 400 14px/20px var(--mmg-nav-body);
}

/* ---- Festive and occasions, and the rows of the sheet ------------------------------------------------------------------------------------------- */

.mmg-nav-rows {
  margin: 0;
  padding: 0;
  list-style: none;
}

.mmg-nav-row {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 40px;
  font: 500 16px/22px var(--mmg-nav-body);
}

.mmg-nav-row__text {
  display: flex;
  flex-direction: column;
  min-width: 0;
  font: 500 16px/22px var(--mmg-nav-body);
}

.mmg-nav-row__meta {
  color: var(--mmg-nav-ink-muted);
  font: 400 14px/20px var(--mmg-nav-body);
}

.mmg-nav-row--current {
  min-height: 56px;
}

/* An available row with no order-by date has no meta line: it is a plain one-line row. A row with the photo keeps the photo height. */
.mmg-nav-row--nometa:not(.mmg-nav-row--photo) {
  min-height: 40px;
}

.mmg-nav-row--muted {
  font-weight: 400;
}

.mmg-nav-row--muted .mmg-nav-row__text {
  font-weight: 400;
}

.mmg-nav-row--plain {
  font: 400 16px/22px var(--mmg-nav-body);
}

/* A coming-soon row is plain text in the list, not a link: no click cursor. */
.mmg-nav-row--soon {
  cursor: default;
}

.mmg-nav-thumb {
  display: block;
  flex: none;
  width: 40px;
  height: 40px;
  overflow: hidden;
  border-radius: 8px;
  background: var(--mmg-nav-cream-200);
}

.mmg-nav-thumb__img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* A category with no thumbnail falls back to a cream tile. */
.mmg-nav-row--category {
  min-height: 48px;
}

.mmg-nav-row--category .mmg-nav-thumb {
  background: var(--mmg-nav-cream-100);
}

.mmg-nav-row--category .mmg-nav-row__name {
  flex: 1;
  min-width: 0;
}

/* The toggle that opens the out-of-season pages: "All festive and occasion pages", then "Show fewer". */
.mmg-nav-toggle {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 40px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--mmg-nav-brown);
  font: 600 16px/22px var(--mmg-nav-body);
  text-align: left;
}

.mmg-nav-toggle:hover,
.mmg-nav-toggle:focus,
.mmg-nav-toggle:active {
  background: none;
  box-shadow: none;
  color: var(--mmg-nav-brown);
}

/* The 40px rows have 44px hit areas. */
.mmg-nav-row--nometa::after,
.mmg-nav-row--muted::after,
.mmg-nav-row--plain::after,
.mmg-nav-toggle::after {
  position: absolute;
  inset: -2px 0;
  content: '';
}

/* ---- Menu sheet (phone) ------------------------------------------------------------------------------------------------------------------------- */

.mmg-nav-sheet {
  position: fixed;
  top: 20px;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  border-radius: 12px 12px 0 0;
  background: var(--mmg-nav-cream-50);
}

.mmg-nav-sheet__handle {
  position: relative;
  display: block;
  flex: none;
  width: 100%;
  height: 32px;
  border-radius: inherit;
  touch-action: none;
}

.mmg-nav-sheet__handle::before {
  position: absolute;
  top: 8px;
  left: calc(50% - 18px);
  width: 36px;
  height: 3px;
  border-radius: 2px;
  background: var(--mmg-nav-cream-200);
  pointer-events: none;
  content: '';
}

.mmg-nav-sheet__head {
  display: flex;
  flex: none;
  align-items: center;
  justify-content: space-between;
  height: 48px;
  padding: 4px 4px 0 16px;
}

.mmg-nav .mmg-nav-sheet__title {
  display: block;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  box-shadow: none;
  color: var(--mmg-nav-ink);
  font: 400 20px/26px var(--mmg-nav-serif);
  letter-spacing: 0;
  text-align: left;
  text-transform: none;
}

.mmg-nav-close {
  display: grid;
  flex: none;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: none;
  color: var(--mmg-nav-ink);
}

.mmg-nav-close:hover,
.mmg-nav-close:focus,
.mmg-nav-close:active {
  background: none;
  box-shadow: none;
  color: var(--mmg-nav-ink);
}

.mmg-nav-sheet__body {
  flex: 1;
  min-height: 0;
  padding: 0 16px calc(8px + env(safe-area-inset-bottom));
  overflow-y: auto;
  overscroll-behavior: contain;
}

/* The two panels that scroll inside themselves (the sheet's body, the mega menu at short heights) never show the native scrollbar: a thin one in the ink-muted
   colour, a rounded 6px thumb and no arrows. scrollbar-width and scrollbar-color are the standard pair; the ::-webkit-scrollbar rules are for Safari. */
.mmg-nav-sheet__body,
.mmg-nav-mega {
  scrollbar-width: thin;
  scrollbar-color: var(--mmg-nav-scroll) transparent;
}

.mmg-nav-sheet__body::-webkit-scrollbar,
.mmg-nav-mega::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

.mmg-nav-sheet__body::-webkit-scrollbar-track,
.mmg-nav-mega::-webkit-scrollbar-track {
  background: transparent;
}

.mmg-nav-sheet__body::-webkit-scrollbar-thumb,
.mmg-nav-mega::-webkit-scrollbar-thumb {
  border-radius: 3px;
  background: var(--mmg-nav-scroll);
}

.mmg-nav-sheet__body::-webkit-scrollbar-button,
.mmg-nav-mega::-webkit-scrollbar-button {
  display: none;
  width: 0;
  height: 0;
}

/* 48px between groups; the first group is 8px under the title. */
.mmg-nav-sheet .mmg-nav-group {
  padding-top: 48px;
}

.mmg-nav-sheet .mmg-nav-group:first-child {
  padding-top: 8px;
}

.mmg-nav-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.mmg-nav-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 44px;
  padding: 0 14px;
  border-radius: 999px;
  background: var(--mmg-nav-cream-100);
  font: 500 14px/20px var(--mmg-nav-body);
}

.mmg-nav-chip__count {
  color: var(--mmg-nav-ink-muted);
  font-weight: 400;
}

/* ---- Desktop festive rows (30px grid; two-line rows 60px, the photo 56px) ------------------------------------------------------------------------ */

@media (min-width: 768px) {
  .mmg-nav-mega .mmg-nav-row {
    align-items: flex-start;
    min-height: 30px;
    font: 500 15px/20px var(--mmg-nav-body);
  }

  .mmg-nav-mega .mmg-nav-row__text {
    padding-top: 5px;
    font: 500 15px/20px var(--mmg-nav-body);
  }

  .mmg-nav-mega .mmg-nav-row--current {
    min-height: 60px;
  }

  .mmg-nav-mega .mmg-nav-row--nometa:not(.mmg-nav-row--photo) {
    min-height: 30px;
  }

  .mmg-nav-mega .mmg-nav-thumb {
    width: 56px;
    height: 56px;
    border-radius: 12px;
  }

  .mmg-nav-mega .mmg-nav-row--muted {
    align-items: flex-start;
    font: 400 15px/20px var(--mmg-nav-body);
  }

  /* A long out-of-season name wraps inside its column instead of running into the gutter. */
  .mmg-nav-mega .mmg-nav-row--muted .mmg-nav-row__text {
    padding: 5px 0;
    font: 400 15px/20px var(--mmg-nav-body);
    overflow-wrap: anywhere;
  }

  /* The out-of-season pages in one column. */
  .mmg-nav-mega .mmg-nav-rows--off {
    display: block;
  }

  .mmg-nav-mega .mmg-nav-toggle {
    justify-content: flex-start;
    gap: 6px;
    min-height: 30px;
    font: 600 15px/20px var(--mmg-nav-body);
  }
}

/* The mega menu, 768 to 1023px (mock 05 and 06 at 768 and 834): one column. The tile row is five columns, the band four (need, season, taste over two, the festive group on
   its own row of two columns), and the start-here card moves under everything as a wide card. */
@media (min-width: 768px) and (max-width: 1023px) {
  .mmg-nav-mega {
    padding: 28px 40px 32px;
  }

  .mmg-nav-mega__inner {
    grid-template-columns: minmax(0, 1fr);
    row-gap: 28px;
  }

  .mmg-nav-mega__aside {
    padding-top: 0;
  }

  .mmg-nav-tiles {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    column-gap: 12px;
  }

  .mmg-nav-band {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    row-gap: 32px;
    margin-top: 32px;
  }

  .mmg-nav-group--festive {
    grid-column: 1 / -1;
  }

  .mmg-nav-group--festive .mmg-nav-rows {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 24px;
  }

  .mmg-nav-group--festive .mmg-nav-rows--off {
    display: block;
  }

  .mmg-nav-start {
    flex-direction: row;
    align-items: center;
    gap: 20px;
    width: 100%;
  }

  .mmg-nav-start__photo {
    flex: none;
    width: 160px;
    height: 120px;
  }
}

/* ---- Bottom bar (phone) ------------------------------------------------------------------------------------------------------------------------- */

.mmg-nav-bar {
  position: fixed;
  right: 16px;
  bottom: calc(12px + env(safe-area-inset-bottom));
  left: 16px;
  z-index: 40;
  max-width: 343px;
  margin: 0 auto;
}

.mmg-nav-bar__cap {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  grid-template-rows: minmax(0, 1fr);
  align-items: center;
  width: 100%;
  max-width: 343px;
  height: 56px;
  margin: 0 auto;
  padding: 4px;
  border: 1px solid var(--mmg-nav-cream-200);
  border-radius: 999px;
  background: rgba(251, 246, 236, 0.94);
  -webkit-backdrop-filter: blur(20px) saturate(1.1);
  backdrop-filter: blur(20px) saturate(1.1);
  box-shadow: 0 2px 10px rgba(47, 44, 40, 0.07);
  transition: max-width 0.2s ease, height 0.2s ease;
}

/* Equal grid tracks keep the five controls evenly spaced. */
.mmg-nav-bar__menu,
.mmg-nav-bar__shop,
.mmg-nav-bar__empty,
.mmg-nav-bar__pdp-plan,
.mmg-nav-bar .mmg-nav-cart {
  display: flex;
  flex: 1 1 0;
  align-items: center;
  justify-content: center;
  min-width: 0;
  width: auto;
  height: 48px;
  padding: 0 4px;
  border-radius: 999px;
  transition: height 0.2s ease;
}

.mmg-nav-bar__menu {
  position: relative;
  background: transparent;
  color: var(--mmg-nav-ink);
}

.mmg-nav-bar__shop {
  background: transparent;
  color: var(--mmg-nav-ink);
  touch-action: manipulation;
  transition: height 200ms ease, scale 180ms var(--mmg-nav-ease-out), filter 180ms ease-out;
}

.mmg-nav-bar__shop[aria-current="page"] {
  background: var(--mmg-nav-cream-200);
}

.mmg-nav-bar__shop:active {
  scale: 0.96;
  filter: brightness(0.96);
  transition-duration: 200ms, 80ms, 80ms;
}

.mmg-nav-bar__plan {
  position: relative;
}

.mmg-nav-bar__plan[aria-describedby="mmg-nav-plan-details-needed"]::after {
  position: absolute;
  top: calc(50% - 14px);
  left: calc(50% + 9px);
  width: 6px;
  height: 6px;
  border: 1px solid var(--mmg-nav-brown);
  border-radius: 50%;
  background: var(--mmg-nav-toasted-gold);
  pointer-events: none;
  content: '';
}

.mmg-nav-bar__plan.has-text[aria-describedby="mmg-nav-plan-details-needed"]::after {
  top: 3px;
}

/* The total remains centered under the bag, within the cart track. */
.mmg-nav-bar .mmg-nav-cart {
  flex-direction: column;
}

.mmg-nav-bar .mmg-nav-cart__total {
  font-size: 12px;
  line-height: 16px;
}

/* Below 375px the reward pill's inline inset is smaller so its copy fits at 320px. */
.mmg-nav-line {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  max-width: calc(100vw - 32px);
  margin: 0;
  padding: 2px 14px;
  border: 1px solid var(--mmg-nav-cream-200);
  border-radius: 999px;
  background: rgba(251, 246, 236, 0.94);
  -webkit-backdrop-filter: blur(20px) saturate(1.1);
  backdrop-filter: blur(20px) saturate(1.1);
  box-shadow: 0 2px 10px rgba(47, 44, 40, 0.07);
  color: var(--mmg-nav-ink);
  font: 500 13px/17px var(--mmg-nav-body);
  text-align: center;
  transform: translateX(-50%);
  white-space: nowrap;
}

@media (max-width: 374px) {
  .mmg-nav-line {
    max-width: calc(100vw - 16px);
    padding-inline: 8px;
  }
}

/* The header's pill: the same line, hung under the sticky header at the right, from 768px; it steps aside (is-covered) while a panel is open or it would cover the planner. */
.mmg-nav-line--header {
  display: none;
}

@media (min-width: 768px) {
  .mmg-nav-line--header {
    top: calc(100% + 8px);
    right: max(40px, calc((100% - 1200px) / 2));
    bottom: auto;
    left: auto;
    display: block;
    max-width: none;
    transform: none;
  }

  .mmg-nav-line--header.is-covered {
    visibility: hidden;
  }
}

/* At rest, align with the planner cards on the menu and the title on landing pages. Keep the stuck rule after the menu's at-rest rule so it wins the tie. */
@media (min-width: 1024px) {
  body.mmg-nav-on:has(.mmg-menu:not(.mmg-menu--fold) > .mmg-planner--row) .mmg-nav-line--header {
    top: calc(100% + 12px);
  }

  body.mmg-nav-on.page:has(.mmg-landing--head) .mmg-nav-line--header {
    /* The heading starts 24px below the header. Its letterforms start a further 10px down. */
    top: calc(100% + 34px);
  }

  body.mmg-nav-on:has(.mmg-menu .mmg-menu-tabs.is-stuck) .mmg-nav-line--header {
    top: 100%;
  }
}

/* The badge sits on the bag's top right; the bar's is the quiet one, as drawn. */
.mmg-nav-bar .mmg-nav-cart__count {
  top: 6px;
  right: auto;
  left: calc(50% + 2px);
  border: 1px solid var(--mmg-nav-cream-50);
  background: var(--mmg-nav-cream-200);
  color: var(--mmg-nav-ink);
}

/* Scrolling down shrinks it to icons only, centred (E-capsule-shrunk); scrolling up restores it. */
.mmg-nav-bar.is-shrunk .mmg-nav-bar__cap {
  max-width: 284px;
  height: 52px;
}

.mmg-nav-bar.is-shrunk .mmg-nav-bar__menu,
.mmg-nav-bar.is-shrunk .mmg-nav-bar__shop,
.mmg-nav-bar.is-shrunk .mmg-nav-bar__empty,
.mmg-nav-bar.is-shrunk .mmg-nav-bar__pdp-plan,
.mmg-nav-bar.is-shrunk .mmg-nav-cart {
  height: 44px;
}

@media (prefers-reduced-motion: reduce) {
  .mmg-nav-bar__cap,
  .mmg-nav-bar__menu,
  .mmg-nav-bar__empty,
  .mmg-nav-bar__pdp-plan,
  .mmg-nav-bar .mmg-nav-cart,
  .mmg-nav-bar__shop {
    transition: none;
  }

  .mmg-nav-bar__shop:active {
    scale: 1;
  }
}

/* The bar and its sheet are the phone's navigation: gone from 768px. */
@media (min-width: 768px) {
  .mmg-nav-bar,
  .mmg-nav-sheet,
  .mmg-nav-scrim--sheet {
    display: none !important;
  }
}

/* ---- Product pages: the bottom bar and the Add to Cart pill (docs/superpowers/specs/2026-11-15-menu-train-7-pdp-pill.md), the header ------------ */

/* Phones only: the bar and its sheet are gone from 768px, where the Bricks bar and the desktop order bar stay as they are. */
@media (min-width: 768px) {
  body.mmg-nav-pdp .mmg-nav-bar,
  body.mmg-nav-pdp .mmg-nav-sheet,
  body.mmg-nav-pdp .mmg-nav-scrim--sheet {
    display: none;
  }
}

/* The header from 768px (docs/superpowers/specs/2026-11-15-nav-top-menu.md; below 768px the phone block's class-only rules do the same): the Bricks main row steps aside and the Bricks header stops being sticky, as on the menu
   page (the two rules at the top of this file), so the promo bar scrolls away. Only while the nav header is in the page: a product template that never fires
   bricks_after_header keeps the Bricks header. */
@media (min-width: 768px) {
  body.mmg-nav-pdp:has([data-mmg-nav-header]) #brx-header .site-header--main {
    display: none !important;
  }

  body.mmg-nav-pdp:has([data-mmg-nav-header]) #brx-header {
    position: static !important;
    top: auto !important;
    transform: none !important;
  }

  /* Bricks' bottom bar is z-index 997, over the open mega menu (990) and the search scrim (39): above the page, under the scrim and every panel. */
  body.mmg-nav-pdp .fpb {
    z-index: 38;
  }

  /* Sugar Rush test arm: the pinned gallery and its overlay pin under the 72px header (72 + 28 = 100px, not the 112px of the 84px Bricks header), here and not in
     mmg-sr-pdp-desktop.css, so with the nav switch off the arm is as it was. The admin-bar variant adds the bar. */
  html.mmg-xd-test body.mmg-nav-pdp #brxe-cjspyd,
  html.mmg-xd-test body.mmg-nav-pdp #brxe-66878a > .sr-hero-wrap {
    top: 100px;
  }

  html.mmg-xd-test body.mmg-nav-pdp.admin-bar #brxe-cjspyd,
  html.mmg-xd-test body.mmg-nav-pdp.admin-bar #brxe-66878a > .sr-hero-wrap {
    top: calc(100px + var(--wp-admin--admin-bar--height, 32px));
  }
}

@media (max-width: 767px) {
  /* Phones always have the bar (mark_product_printed), so the class alone decides, at first paint; the nav header follows #brx-header in the stream and a :has()
     on it could paint the Bricks row first. Same declarations as the body.mmg-nav-on rules at the top of the file. */
  body.mmg-nav-pdp #brx-header .site-header--main {
    display: none !important;
  }

  body.mmg-nav-pdp #brx-header {
    position: static !important;
    top: auto !important;
    transform: none !important;
  }

  body.mmg-nav-pdp.mmg-nav-locked {
    overflow: hidden;
  }

  body.mmg-nav-pdp {
    padding-bottom: calc(136px + env(safe-area-inset-bottom));
  }

  body.mmg-nav-pdp:has(#brx-footer > :last-child) {
    padding-bottom: 0;
  }

  /* !important: the product template's Bricks CSS has .bottom-footer { padding-bottom: 72px !important }. */
  body.mmg-nav-pdp #brx-footer > :last-child {
    padding-bottom: calc(136px + env(safe-area-inset-bottom)) !important;
  }

  body.mmg-nav-pdp .mmg-nav-line {
    display: none;
  }

  .mmg-nav-bar__pdp-plan:disabled {
    visibility: hidden;
  }

  .mmg-nav-bar__pdp-plan.no-ring:focus,
  .mmg-nav-bar__pdp-plan.no-ring:focus-visible {
    outline: none;
    box-shadow: none;
  }

  .mmg-nav-pdp-sheet-locked,
  .mmg-nav-pdp-sheet-locked body {
    overflow: hidden;
    overscroll-behavior: none;
  }

  .mmg-nav-pdp-sheet-locked body {
    position: fixed;
    top: var(--mmg-nav-pdp-scroll-top, 0px);
    width: 100%;
  }

  .mmg-nav-pdp-sheet {
    inset: auto 0 0;
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 0;
    border: 0;
    color: var(--mmg-planner-ink);
  }

  .mmg-nav-pdp-sheet:not([open]) {
    display: none;
  }

  .mmg-nav-pdp-sheet::backdrop {
    background: rgba(47, 44, 40, 0.45);
    touch-action: none;
  }

  .mmg-nav-pdp-sheet:is(.is-opening, .is-closing)::backdrop {
    opacity: 0;
  }

  .mmg-nav-pdp-sheet.is-closing {
    pointer-events: none;
  }

  .mmg-nav-pdp-sheet .mmg-planner__title {
    margin: 0;
  }

  .mmg-nav-pdp-sheet .mmg-planner__title:focus {
    outline: 0;
  }

  /* Planner Train 2c: the sheet is the planner panel's single view. No title and no close button on screen (the title still names the dialog; the close button is seen only while it
     has focus, as in the planner's own panel), no rule above Done, and Done is ink. The sheet grows to fit and never shrinks while it is open (--mmg-pdp-rest-height, set by the script). */
  .mmg-nav-pdp-sheet .mmg-planner__head {
    display: contents;
  }

  .mmg-nav-pdp-sheet .mmg-planner__title {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }

  .mmg-nav-pdp-sheet .mmg-planner__close {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 2;
    width: 1px;
    min-width: 1px;
    height: 1px;
    min-height: 1px;
    overflow: hidden;
    border-radius: 22px;
    clip-path: inset(50%);
  }

  .mmg-nav-pdp-sheet .mmg-planner__close:focus {
    width: 44px;
    min-width: 44px;
    height: 44px;
    min-height: 44px;
    overflow: visible;
    background: var(--mmg-planner-cream-200);
    clip-path: none;
  }

  .mmg-nav-pdp-sheet:not(.is-address-keyboard) {
    min-height: min(var(--mmg-pdp-rest-height, 0px), calc(100vh - 20px));
    min-height: min(var(--mmg-pdp-rest-height, 0px), calc(100dvh - 20px));
  }

  .mmg-nav-pdp-sheet .mmg-planner__foot {
    padding-top: 8px;
    border-top: 0;
  }

  /* The planner picker's own button rule (.mmg-fd .mmg-planner__action, brown with 8px above) reaches this Done, so it is named once more. */
  .mmg-nav-pdp-sheet.mmg-planner--panel .mmg-planner__foot .mmg-planner__action {
    margin-top: 0;
    background-color: var(--mmg-planner-ink);
    box-shadow: none;
    color: var(--mmg-planner-cream-50);
  }

  .mmg-nav-pdp-sheet:not(.is-short-address-keyboard) .mmg-planner__foot {
    padding-bottom: max(12px, env(safe-area-inset-bottom));
  }

  .mmg-nav-pdp-sheet.is-address-keyboard {
    top: calc(var(--mmg-pdp-visible-top) + 8px);
    bottom: auto;
    height: calc(var(--mmg-pdp-visible-height) - 8px);
    max-height: calc(var(--mmg-pdp-visible-height) - 8px);
  }

  /* Only the results scroll in the mobile product sheet. Keep them under the field. */
  body.mmg-nav-pdp .mmg-fd[data-mmg-fd-style="planner"].mmg-fd--product > .mmg-nav-pdp-sheet[open] .mmg-planner__suggest:not(.is-plain) {
    position: absolute;
    top: 44px;
    margin-top: 8px;
    max-height: var(--mmg-pdp-address-list-height, 120px);
    overflow: hidden auto;
    overscroll-behavior-y: contain;
    scrollbar-width: none;
  }

  /* The open no-match block is in the sheet's flow under the field, whole: no cap, no scroll of its own. */
  body.mmg-nav-pdp .mmg-fd[data-mmg-fd-style="planner"].mmg-fd--product > .mmg-nav-pdp-sheet[open] .mmg-planner__suggest:not(.is-plain).is-nomatch {
    position: static;
    margin-top: 8px;
    max-height: none;
    overflow: visible;
  }

  body.mmg-nav-pdp .mmg-fd[data-mmg-fd-style="planner"].mmg-fd--product > .mmg-nav-pdp-sheet .mmg-planner__suggest .mmg-planner__attr {
    position: sticky;
    bottom: 0;
    background: #fff;
  }

  /* Safari's translucent keyboard controls can show the page below the
     shortened sheet. Continue the cream surface there without extending its scroll box. */
  .mmg-nav-pdp-sheet.is-address-keyboard::backdrop {
    --mmg-pdp-keyboard-edge: calc(var(--mmg-pdp-visible-top) + var(--mmg-pdp-visible-height));
    background: linear-gradient(
      to bottom,
      rgba(47, 44, 40, 0.45) var(--mmg-pdp-keyboard-edge),
      var(--mmg-planner-cream-50, #fbf6ec) var(--mmg-pdp-keyboard-edge)
    );
  }

  .mmg-nav-pdp-sheet.is-address-keyboard:not(.is-short-address-keyboard) .mmg-planner__foot {
    padding-bottom: 12px;
  }

  /* On the short keyboard Done is the top-row pill at the 16px right edge, with 8px of space below it above the field (the planner's own panel keeps 52px, mmg-planner.css). */
  .mmg-nav-pdp-sheet.mmg-planner--panel.is-short-address-keyboard .mmg-planner__foot {
    right: 16px;
  }

  .mmg-nav-pdp-sheet.mmg-planner--panel.is-short-address-keyboard .mmg-planner__body {
    padding-top: 8px;
  }

  .mmg-nav-pdp-sheet.is-address-keyboard [data-mmg-fd-part="types"],
  .mmg-nav-pdp-sheet.is-address-keyboard [data-mmg-fd-part="date"],
  .mmg-nav-pdp-sheet.is-address-keyboard [data-mmg-fd-part="occasion"] {
    display: none;
  }

  /* The picker's own card rules (the toggle is a grid) are more specific than the hide above, so the card is named once more. */
  body.mmg-nav-pdp .mmg-fd[data-mmg-fd-style="planner"].mmg-fd--product > .mmg-nav-pdp-sheet.is-address-keyboard .mmg-fd-card :is([data-mmg-fd-part="types"], [data-mmg-fd-part="date"], [data-mmg-fd-part="occasion"]) {
    display: none;
  }

  /* Bricks' sticky bar loses its look and becomes a transparent box from the pill's top to the viewport bottom (76 + 52), so the test arm's step-aside still reads
     "cards above the pill". It never takes a tap: the capsule under it stays tappable. The box owns the visibility, never the button, so sr-fpb-hide still hides
     the pill. No display here: Bricks' sold-out display:none must win. */
  body.mmg-nav-pdp .fpb {
    height: calc(128px + env(safe-area-inset-bottom));
    border: 0;
    background: transparent !important;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    box-shadow: none;
    outline: 0;
    pointer-events: none;
    transform: none;
    visibility: hidden;
    transition: opacity 200ms ease, visibility 0s linear 200ms;
  }

  body.mmg-nav-pdp .fpb.is-visible {
    visibility: visible;
    transition: opacity 200ms ease, visibility 0s;
  }

  body.mmg-nav-pdp .fpb .fpb__atc {
    position: absolute;
    top: auto;
    right: 0;
    bottom: calc(76px + env(safe-area-inset-bottom));
    left: 0;
    width: min(100% - 32px, 343px);
    margin: 0 auto;
    border: 0;
    border-radius: 999px;
    background: #2f2c28;
    box-shadow: none;
    color: #fff;
    font: 600 16px/24px 'Hanken Grotesk', system-ui, -apple-system, 'Segoe UI', sans-serif;
  }

  body.mmg-nav-pdp .fpb .fpb__atc:not([data-sr-label]) {
    height: 52px;
  }

  body.mmg-nav-pdp .fpb.is-visible .fpb__atc:not(.is-loading) {
    pointer-events: auto;
  }

  /* "Adding…": the fill stays opaque; the label and the spinner dim through the colour. */
  body.mmg-nav-pdp .fpb .fpb__atc.is-loading {
    opacity: 1;
    color: rgba(255, 255, 255, 0.7);
  }

  /* Disabled: the same, so the pill is never see-through over the page (Bricks fades it to .45 and desaturates it). */
  body.mmg-nav-pdp .fpb .fpb__atc.is-disabled {
    opacity: 1;
    filter: none;
    color: rgba(255, 255, 255, 0.45);
  }

  body.mmg-nav-pdp .fpb .fpb__atc:focus-visible {
    outline: 2px solid #68442c;
    outline-offset: 2px;
  }
}

@media (max-width: 767px) and (prefers-reduced-motion: reduce) {
  body.mmg-nav-pdp .fpb,
  body.mmg-nav-pdp .fpb.is-visible {
    transition: none;
  }
}

/* The product page's Bricks breadcrumb takes the footer's inner edges (MMG-295): 16px on the phone, 40px or the 1200px inner edge from 768px. No Bricks id: the
   class pair beats Bricks' .spacing.brxe-woocommerce-breadcrumbs padding; where the nav is not prepared the body class is absent and Bricks' padding stays. */
@media (max-width: 767px) {
  body.mmg-nav-pdp .brxe-woocommerce-breadcrumbs.spacing { padding-left: 16px; padding-right: 16px; }
}
@media (min-width: 768px) {
  body.mmg-nav-pdp .brxe-woocommerce-breadcrumbs.spacing {
    padding-left: max(40px, calc((100% - 1200px) / 2));
    padding-right: max(40px, calc((100% - 1200px) / 2));
  }
}

/* ---- Journey motion (docs/superpowers/specs/2026-11-16-journey-motion.md, D.2, D.3, D.5; approved mock 2026-11-16-journey-motion) ------------------------------------- */

/* The pack's tokens for the bar, the header and the product page (the pack declares its own on .mmg-menu, which they sit outside). Every override below wins by one more class than the
   shipped rule it names, never by load order, so it holds wherever this file prints. */
body.mmg-nav-on, body.mmg-nav-pdp { --mmg-nav-ease-out: cubic-bezier(.22, .8, .2, 1); --mmg-nav-ease-in: cubic-bezier(.4, 0, 1, 1); --mmg-nav-ease-sheet: cubic-bezier(.32, .72, 0, 1); }

/* Press: down 80ms, release 180ms, `scale`. The bar's cart keeps its `height 0.2s ease` (over `.mmg-nav-bar .mmg-nav-cart`, above); the header's Plan changes tone by snapping, as its siblings do. */
.mmg-nav-bar.mmg-nav-bar .mmg-nav-cart { touch-action: manipulation; transition: scale 180ms var(--mmg-nav-ease-out), opacity 180ms var(--mmg-nav-ease-out), background-color 180ms var(--mmg-nav-ease-out), color 180ms var(--mmg-nav-ease-out), height 0.2s ease; }
.mmg-nav-header .mmg-nav-cart { touch-action: manipulation; transition: scale 180ms var(--mmg-nav-ease-out), opacity 180ms var(--mmg-nav-ease-out), background-color 180ms var(--mmg-nav-ease-out), color 180ms var(--mmg-nav-ease-out); }
.mmg-nav-plan { touch-action: manipulation; transition: scale 180ms var(--mmg-nav-ease-out), opacity 180ms var(--mmg-nav-ease-out); }
.mmg-nav-bar.mmg-nav-bar .mmg-nav-cart:active { scale: .96; transition-duration: 80ms, 80ms, 80ms, 80ms, 0.2s; }
.mmg-nav-header .mmg-nav-cart:active, .mmg-nav-plan:active { scale: .96; transition-duration: 80ms; }

/* The badge's digits ghost: while the pair slides over it (script), its own digits are transparent. */
body.mmg-nav-on.mmg-jm .mmg-nav-cart__count.is-ticking, body.mmg-nav-pdp.mmg-jm .mmg-nav-cart__count.is-ticking { color: transparent; }

/* The "Add RM... more" line's progress: the server's fill (--mmg-line-fill, 0 to 1, set by the add script) behind the text. Information, so it shows without the script (only the move is gated);
   overflow clips it to the pill. The pill is opaque, with a cream track and Toasted Gold fill and outline. The unlocked pill is solid green with white text, matching the meters. */
.mmg-nav-line { overflow: hidden; isolation: isolate; background: var(--mmg-nav-cream-50); border-color: var(--mmg-nav-toasted-gold); -webkit-backdrop-filter: none; backdrop-filter: none; box-shadow: 0 1px 3px rgba(47, 44, 40, 0.08); }
.mmg-nav-line::before { content: ''; position: absolute; inset: 0; z-index: -1; background: var(--mmg-nav-toasted-gold); transform-origin: 0 50%; transform: scaleX(var(--mmg-line-fill, 0)); pointer-events: none; }
body.mmg-nav-on.mmg-jm .mmg-nav-line::before { transition: transform 300ms var(--mmg-nav-ease-out); }
.mmg-nav-line.is-unlocked { background: var(--mmg-nav-unlocked-green); border-color: var(--mmg-nav-unlocked-green); color: #fff; }
.mmg-nav-line.is-unlocked::before { background: transparent; }

/* The product page's pill (Bricks owns its classes; phone only, as every .fpb rule): a press, the label's colour from "Adding…" to "Added to Cart", and a tick wiped in before the label.
   The live pill ships no transition (its computed transition is `all 0s`, read in the render check), so scale and color are the only entries; there is no shipped entry to keep. */
@media (max-width: 767px) {
  body.mmg-nav-pdp .fpb .fpb__atc { touch-action: manipulation; transition: scale 180ms var(--mmg-nav-ease-out), color 180ms var(--mmg-nav-ease-out); }
  body.mmg-nav-pdp .fpb .fpb__atc:not(.is-loading):active { scale: .98; transition-duration: 80ms; }
  body.mmg-nav-pdp .fpb .fpb__atc.is-added::before {
    content: ''; display: inline-block; width: 20px; height: 20px; margin: 0 8px 0 0; vertical-align: -4px; background: currentColor; animation: mmg-nav-tick 220ms var(--mmg-nav-ease-out) backwards;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M5.5 12.5l4.5 4.5 8.5-9' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M5.5 12.5l4.5 4.5 8.5-9' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
  }
}

/* This file's own keyframes (the menu's are not loaded on a product page). */
@keyframes mmg-nav-tick { from { opacity: 0; clip-path: inset(0 100% 0 0); } to { opacity: 1; clip-path: inset(0); } }
@keyframes mmg-nav-fade { from { opacity: 0; } }

/* Reduced motion: no scale, wipe or fill move; presses answer with opacity .85, 80ms linear; the bar's cart keeps having no height transition (as above). */
@media (prefers-reduced-motion: reduce) {
  .mmg-nav-bar.mmg-nav-bar .mmg-nav-cart { transition: none; }
  .mmg-nav-bar.mmg-nav-bar .mmg-nav-cart:active, .mmg-nav-header .mmg-nav-cart:active, .mmg-nav-plan:active { scale: none; opacity: .85; transition: opacity 80ms linear; }
  body.mmg-nav-on.mmg-jm .mmg-nav-line::before { transition: none; }
}

@media (max-width: 767px) and (prefers-reduced-motion: reduce) {
  body.mmg-nav-pdp .fpb .fpb__atc { transition: color 120ms linear; }
  body.mmg-nav-pdp .fpb .fpb__atc:not(.is-loading):active { scale: none; opacity: .85; transition: opacity 80ms linear; }
  body.mmg-nav-pdp .fpb .fpb__atc.is-added::before { animation: mmg-nav-fade 120ms linear backwards; }
}

/* ---- Nav motion (docs/superpowers/specs/2026-11-17-nav-motion-search-a2.md; approved mock 2026-11-17-nav-motion-search) ----------------------------------------------- */

/* The mega panel and the phone sheet open and close like the search and the planner. The script adds .has-motion (only where transitions exist) and .is-open; the closed look sits under
   .has-motion, so a panel the script has not met is never hidden by it. The panel's [hidden] and the header's raised stack go back when the motion has ended. */
@media (min-width: 768px) and (prefers-reduced-motion: no-preference) {
  .mmg-nav-mega.has-motion {
    transform: translateY(-6px);
    opacity: 0;
    pointer-events: none;
    transition: transform 140ms var(--mmg-nav-ease-in), opacity 140ms ease-in;
  }

  .mmg-nav-mega.has-motion.is-open {
    transform: none;
    opacity: 1;
    pointer-events: auto;
    transition: transform 220ms var(--mmg-nav-ease-out), opacity 180ms ease-out;
  }
}

/* Search takes over from the open panel: the panel goes at once (closing only), only the popover fades in. */
@media (min-width: 768px) {
  .mmg-nav-header:has(.mmg-nav-search.is-search-open) .mmg-nav-mega.has-motion:not(.is-open) {
    transition: none;
  }
}

@media (max-width: 767px) and (prefers-reduced-motion: no-preference) {
  .mmg-nav-pdp-sheet[open] {
    transition: transform 300ms var(--mmg-nav-ease-sheet);
  }

  .mmg-nav-pdp-sheet[open]::backdrop {
    transition: opacity 300ms ease-out;
  }

  .mmg-nav-pdp-sheet:is(.is-opening, .is-closing) {
    transform: translateY(var(--mmg-planner-exit-travel, 100%));
  }

  .mmg-nav-pdp-sheet[open].is-closing {
    /* Transition the drag offset back at the same rate as the sheet slides out. */
    transition: transform 200ms var(--mmg-nav-ease-in), translate 200ms var(--mmg-nav-ease-in);
  }

  .mmg-nav-pdp-sheet[open].is-closing::backdrop {
    transition: opacity 200ms ease-in;
  }

  .mmg-nav-sheet.has-motion {
    transform: translateY(100%);
    pointer-events: none;
    transition: transform 200ms var(--mmg-nav-ease-in), translate 200ms var(--mmg-nav-ease-in);
  }

  .mmg-nav-sheet.has-motion.is-open {
    transform: none;
    pointer-events: auto;
    transition: transform 300ms var(--mmg-nav-ease-sheet), translate 160ms ease-out;
  }

  .mmg-nav-sheet.has-motion.is-open.is-handle-dragging {
    transition: none;
  }

  .mmg-nav-scrim--sheet.has-motion {
    opacity: 0;
    transition: opacity 200ms ease-in;
  }

  .mmg-nav-scrim--sheet.has-motion.is-open {
    opacity: 1;
    transition: opacity 300ms ease-out;
  }
}

@media (max-width: 767px) and (prefers-reduced-motion: reduce) {
  .mmg-nav-pdp-sheet[open]::backdrop {
    transition: opacity 120ms linear;
  }
}

@media (prefers-reduced-motion: reduce) {
  .mmg-nav-mega.has-motion,
  .mmg-nav-sheet.has-motion,
  .mmg-nav-scrim--sheet.has-motion {
    transform: none;
    opacity: 0;
    pointer-events: none;
    transition: opacity 120ms linear;
  }

  .mmg-nav-mega.has-motion.is-open,
  .mmg-nav-sheet.has-motion.is-open,
  .mmg-nav-scrim--sheet.has-motion.is-open {
    opacity: 1;
    pointer-events: auto;
    transition: opacity 120ms linear;
  }
}
