/* MMG Storefront: the search (docs/superpowers/specs/2026-11-15-menu-train-3-search.md).
   Built to the approved mock docs/superpowers/mocks/2026-11-15-menu-search/ (v3: the phone screens P0 to P4, 07 and 08, the desktop popover D1 to D4b and 16) and the
   approved motion pack docs/superpowers/mocks/2026-11-15-menu-motion/. The colours and spacing are custom properties local to this file; no shared token is added.
   Everything printed by the script sits under .mmg-search; the rest is the bottom bar's Search item and the header field's open and clear parts, which the
   navigation's own stylesheet does not know. Phone layout below 768px, desktop from 768px. Enqueued only where the navigation prints (preview or the flag). */

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

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

  --mmg-search-ease-out: cubic-bezier(.22, .8, .2, 1);
  --mmg-search-ease-sheet: cubic-bezier(.32, .72, 0, 1);
  --mmg-search-ease-in: cubic-bezier(.4, 0, 1, 1);

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

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

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

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

/* The theme (Bricks) gives links, buttons, inputs, lists and headings its own display, spacing, colour, border, font and size. Every one of them that 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-search__input,
.mmg-search__chip,
.mmg-search__achip,
.mmg-search__clear,
.mmg-search__cancel,
.mmg-search__link,
.mmg-search__crit,
.mmg-search__row,
.mmg-search__sg,
.mmg-search__foot-link,
.mmg-search__list,
.mmg-search__group,
.mmg-search__title,
.mmg-search__label,
.mmg-search__msg,
.mmg-search__sub,
.mmg-search__count,
.mmg-nav-bar__search,
.mmg-nav-search .mmg-search__clear {
  display: block;
  min-width: 0;
  min-height: 0;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: none;
  box-shadow: none;
  color: var(--mmg-search-ink, var(--mmg-nav-ink));
  font-family: var(--mmg-search-body, var(--mmg-nav-body));
  font-size: 14px;
  font-style: normal;
  font-weight: 400;
  line-height: 20px;
  letter-spacing: normal;
  text-align: left;
  text-transform: none;
  text-decoration: none;
  list-style: none;
}

.mmg-search a,
.mmg-search a:hover,
.mmg-search a:focus,
.mmg-search a:active,
.mmg-search a:visited {
  color: inherit;
  text-decoration: none;
}

.mmg-search button {
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
}

/* One focus ring: 2px in the brand brown, on every link and button. The phone field is not ringed: its own brown line is its focus mark (the mock draws one line). */
.mmg-search a:focus-visible,
.mmg-search button:focus-visible {
  outline: 2px solid var(--mmg-search-brown);
  outline-offset: 2px;
}

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

/* ---- The shells ----------------------------------------------------------------------------------------------------------------------------------- */

.mmg-search--screen {
  position: fixed;
  inset: 0;
  z-index: 1001;
  background: var(--mmg-search-cream-50);
}

/* Keep the cream surface under the keyboard and its accessory bar. Only
   the scrolling content follows the visible part of the screen. */
.mmg-search__viewport {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  overflow: auto;
  overscroll-behavior: contain;
}

/* Match the compact scrollbar used in the navigation panels. */
.mmg-search__viewport,
.mmg-search--pop .mmg-search__body {
  scrollbar-width: thin;
  scrollbar-color: var(--mmg-search-scroll) transparent;
}

.mmg-search__viewport::-webkit-scrollbar,
.mmg-search--pop .mmg-search__body::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

.mmg-search__viewport::-webkit-scrollbar-track,
.mmg-search--pop .mmg-search__body::-webkit-scrollbar-track {
  background: transparent;
}

.mmg-search__viewport::-webkit-scrollbar-thumb,
.mmg-search--pop .mmg-search__body::-webkit-scrollbar-thumb {
  border-radius: 3px;
  background: var(--mmg-search-scroll);
}

.mmg-search__viewport::-webkit-scrollbar-button,
.mmg-search--pop .mmg-search__body::-webkit-scrollbar-button {
  display: none;
  width: 0;
  height: 0;
}

.mmg-search--pop,
.mmg-search--scrim {
  display: none;
}

html.mmg-search-locked {
  overflow: hidden;
  overscroll-behavior: none;
}

html.mmg-search-locked.mmg-search-reserve-gutter {
  scrollbar-gutter: stable;
}

html.mmg-search-screen-locked body {
  position: fixed;
  top: var(--mmg-search-page-top, 0px);
  right: auto;
  left: var(--mmg-search-page-left, 0px);
  width: 100%;
  overflow: hidden;
}

/* ---- The field and its bar (phone) ---------------------------------------------------------------------------------------------------------------- */

.mmg-search__bar {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  flex: none;
  align-items: center;
  gap: 4px;
  padding: 10px 8px 6px 16px;
  background: var(--mmg-search-cream-50);
}

.mmg-search__field {
  display: flex;
  flex: 1;
  align-items: center;
  gap: 10px;
  min-width: 0;
  height: 48px;
  padding: 0 14px;
  border: 1.5px solid var(--mmg-search-brown);
  border-radius: 999px;
  background: var(--mmg-search-cream-50);
}

.mmg-search__input {
  flex: 1;
  height: 100%;
  min-height: 0;
  outline: 0;
  background: none;
  color: var(--mmg-search-ink);
  font: 400 16px/24px var(--mmg-search-body);
  -webkit-appearance: none;
  appearance: none;
}

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

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

.mmg-search__input::-webkit-search-cancel-button,
.mmg-search__input::-webkit-search-decoration,
.mmg-nav-search__input::-webkit-search-cancel-button {
  display: none;
  -webkit-appearance: none;
}

.mmg-search__clear {
  display: grid;
  flex: none;
  place-items: center;
  width: 44px;
  min-width: 44px;
  height: 44px;
  min-height: 44px;
  margin-right: -10px;
  color: var(--mmg-search-ink-muted);
}

.mmg-search__cancel {
  display: inline-flex;
  flex: none;
  align-items: center;
  min-height: 44px;
  padding: 0 4px;
  color: var(--mmg-search-brown);
  font: 600 15px/20px var(--mmg-search-body);
}

.mmg-search__body {
  display: block;
  padding-bottom: 24px;
}

/* ---- Sections, titles, chips ---------------------------------------------------------------------------------------------------------------------- */

.mmg-search__section {
  display: block;
  padding: 14px 16px 0;
}

.mmg-search__label,
.mmg-search__title--label {
  margin: 0 0 8px;
  color: var(--mmg-search-ink-muted);
  font: 500 12px/16px var(--mmg-search-body);
  letter-spacing: 1.2px;
  text-transform: uppercase;
}

.mmg-search__title--label {
  margin: 0;
  padding: 20px 16px 8px;
}

.mmg-search__body > .mmg-search__list:first-child > .mmg-search__group:first-child > .mmg-search__title--label {
  padding-top: 14px;
}

.mmg-search__section + .mmg-search__title--label,
.mmg-search__section + .mmg-search__list > .mmg-search__group:first-child > .mmg-search__title--label {
  padding-top: 34px;
}

.mmg-search__group + .mmg-search__group > .mmg-search__title--label {
  padding-top: 12px;
}

.mmg-search__title--plain {
  padding: 20px 16px 0;
  color: var(--mmg-search-ink-muted);
  font: 400 14px/20px var(--mmg-search-body);
}

.mmg-search__chips {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.mmg-search__chips--row {
  margin-top: 12px;
}

.mmg-search__chip {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 14px;
  border-radius: 999px;
  background: var(--mmg-search-cream-100);
  color: var(--mmg-search-ink);
  font: 500 14px/20px var(--mmg-search-body);
  white-space: nowrap;
}

.mmg-search__chip--sel {
  background: var(--mmg-search-brown);
  color: var(--mmg-search-cream-50);
}

.mmg-search__chip--act {
  gap: 8px;
  padding: 0 14px 0 12px;
}

.mmg-search__chip--act .mmg-search__svg {
  width: 18px;
  height: 18px;
  color: var(--mmg-search-brown);
}

.mmg-search__achip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 8px 0 14px;
  border-radius: 999px;
  background: var(--mmg-search-brown);
  color: var(--mmg-search-cream-50);
  font: 500 14px/20px var(--mmg-search-body);
  white-space: nowrap;
}

.mmg-search__achip .mmg-search__svg {
  width: 18px;
  height: 18px;
  opacity: 0.9;
}

.mmg-search__link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 4px;
  color: var(--mmg-search-brown);
  font: 600 15px/20px var(--mmg-search-body);
}

/* The two text links are anchors: the anchor rule above (colour inherited, every state) would make them ink, so they say brown at its own specificity. */
.mmg-search a.mmg-search__link,
.mmg-search a.mmg-search__link:hover,
.mmg-search a.mmg-search__link:focus,
.mmg-search a.mmg-search__link:active,
.mmg-search a.mmg-search__link:visited,
.mmg-search a.mmg-search__foot-link,
.mmg-search a.mmg-search__foot-link:hover,
.mmg-search a.mmg-search__foot-link:focus,
.mmg-search a.mmg-search__foot-link:active,
.mmg-search a.mmg-search__foot-link:visited {
  color: var(--mmg-search-brown);
}

.mmg-search__msg {
  color: var(--mmg-search-ink);
  font: 600 16px/22px var(--mmg-search-body);
}

.mmg-search__sub {
  margin-top: 2px;
  color: var(--mmg-search-ink-muted);
  font: 400 15px/22px var(--mmg-search-body);
}

.mmg-search__count {
  padding: 12px 16px 0;
  color: var(--mmg-search-ink-muted);
  font: 400 14px/20px var(--mmg-search-body);
}

.mmg-search__count b {
  color: var(--mmg-search-ink);
  font-weight: 600;
}

.mmg-search__list {
  display: block;
}

.mmg-search__group {
  display: block;
}

/* ---- Criteria rows (suggestions, and the taste row of the results) -------------------------------------------------------------------------------- */

.mmg-search__crit {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 56px;
  padding: 6px 16px;
  color: var(--mmg-search-ink);
}

.mmg-search__crit .mmg-search__svg {
  color: var(--mmg-search-brown);
}

.mmg-search__crit-label {
  display: block;
  flex: 1;
  min-width: 0;
  font: 500 16px/22px var(--mmg-search-body);
}

.mmg-search__bold {
  font-weight: 600;
}

.mmg-search__crit-count {
  display: block;
  flex: none;
  margin-left: auto;
  color: var(--mmg-search-ink-muted);
  font: 400 14px/20px var(--mmg-search-body);
  white-space: nowrap;
}

/* ---- Product rows: the suggestions' small row and the results' row -------------------------------------------------------------------------------- */

.mmg-search__sg {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 56px;
  padding: 6px 16px;
  color: var(--mmg-search-ink);
}

.mmg-search__row {
  display: flex;
  gap: 12px;
  padding: 12px 16px;
  color: var(--mmg-search-ink);
}

.mmg-search__thumb {
  display: block;
  flex: none;
  width: 72px;
  height: 90px;
  min-width: 72px;
  min-height: 90px;
  overflow: hidden;
  border-radius: 12px;
  background: var(--mmg-search-cream-100);
}

.mmg-search__sg .mmg-search__thumb {
  align-self: flex-start;
  width: 48px;
  height: 60px;
  min-width: 48px;
  min-height: 60px;
  border-radius: 8px;
}

.mmg-search__img {
  display: block;
  width: 100%;
  max-width: none;
  height: 100%;
  margin: 0;
  border: 0;
  border-radius: 0;
  object-fit: cover;
}

.mmg-search__main {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-width: 0;
}

.mmg-search__sg .mmg-search__main {
  align-self: center;
}

.mmg-search__name {
  display: block;
  color: var(--mmg-search-ink);
  font: 500 16px/22px var(--mmg-search-serif);
  letter-spacing: normal;
  text-align: left;
}

.mmg-search__line {
  display: block;
  color: var(--mmg-search-ink-muted);
  font: 400 14px/20px var(--mmg-search-body);
  letter-spacing: normal;
  text-align: left;
}

.mmg-search__sizes {
  display: flex;
  align-items: center;
  margin-top: 2px;
  color: var(--mmg-search-ink-muted);
  font: 400 14px/20px var(--mmg-search-body);
  white-space: nowrap;
}

.mmg-search__sizes--out {
  color: var(--mmg-search-ink);
  font-weight: 500;
}

.mmg-search__size {
  display: inline;
  white-space: nowrap;
}

.mmg-search__sep {
  display: block;
  flex: none;
  width: 1px;
  height: 14px;
  margin: 0 8px;
  background: rgba(47, 44, 40, 0.22);
}

.mmg-search__price {
  display: inline;
  color: var(--mmg-search-ink-muted);
  font: 600 15px/20px var(--mmg-search-body);
  font-variant-numeric: tabular-nums;
}

.mmg-search__main > .mmg-search__price {
  display: block;
  margin-top: 2px;
}

.mmg-search__vegan {
  display: inline-block;
  align-self: flex-start;
  margin: 4px 0 2px;
  padding: 3px 8px;
  border-radius: 4px;
  background: var(--mmg-search-green);
  color: var(--mmg-search-cream-50);
  font: 600 12px/16px var(--mmg-search-body);
  letter-spacing: 1.2px;
  text-transform: uppercase;
}

.mmg-search__row.is-dim .mmg-search__thumb,
.mmg-search__sg.is-dim .mmg-search__thumb {
  opacity: 0.45;
}

.mmg-search__sg.is-dim .mmg-search__name {
  color: var(--mmg-search-ink-muted);
}

.mmg-search__crit:hover,
.mmg-search__row:hover,
.mmg-search__sg:hover,
.mmg-search__row.is-active,
.mmg-search__sg.is-active,
.mmg-search__crit.is-active {
  background: rgba(47, 44, 40, 0.04);
}

/* ---- Loading: two skeleton rows with the real thumbs, no caption ---------------------------------------------------------------------------------- */

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

.mmg-search__bone {
  display: block;
  height: 20px;
  margin-bottom: 8px;
  border-radius: 6px;
}

.mmg-search__bone:nth-child(1) {
  width: 80%;
  height: 22px;
}

.mmg-search__bone:nth-child(2) {
  width: 45%;
}

.mmg-search__bone:nth-child(3) {
  width: 60%;
}

@media (prefers-reduced-motion: no-preference) {
  .mmg-search__list.is-revealing {
    animation: mmg-search-reveal 160ms var(--mmg-search-ease-out);
  }

  .mmg-search__img.is-revealing {
    --mmg-search-reveal-opacity: 0;
    animation: mmg-search-reveal 160ms var(--mmg-search-ease-out);
  }
}

@keyframes mmg-search-reveal {
  from { opacity: var(--mmg-search-reveal-opacity, .72); }
}

/* ---- The bottom bar's Search item (the navigation's stylesheet knows only its own slots) --------------------------------------------------------- */

.mmg-nav-bar__search {
  display: flex;
  flex: 1 1 0;
  align-items: center;
  justify-content: center;
  width: auto;
  height: 48px;
  padding: 0 4px;
  border-radius: 999px;
  color: var(--mmg-nav-ink);
  transition: height 0.2s ease;
}

.mmg-nav-bar.is-shrunk .mmg-nav-bar__search {
  height: 44px;
}

.mmg-nav-bar__search:focus-visible {
  outline: 2px solid var(--mmg-nav-brown);
  outline-offset: 2px;
}

/* ---- Desktop: the header field open, its clear button, the popover and the page scrim ------------------------------------------------------------- */

@media (min-width: 768px) {
  .mmg-search--screen {
    display: none !important;
  }

  /* The open field: the cream fill and the brown line of the mock (one 1.5px line inside the field, which stands in for the focus ring), wider. */
  .mmg-nav-search.is-search-open {
    flex-basis: 560px;
    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:focus-within {
    outline: 0;
  }

  .mmg-nav-search .mmg-search__clear {
    display: grid;
    flex: none;
    place-items: center;
    width: 36px;
    min-width: 36px;
    height: 36px;
    min-height: 36px;
    margin: 0 -8px 0 0;
    border-radius: 999px;
    color: var(--mmg-nav-ink-muted);
  }

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

  .mmg-nav-search .mmg-search__clear:focus-visible {
    outline: 2px solid var(--mmg-nav-brown);
    outline-offset: 2px;
  }

  .mmg-search--scrim {
    position: fixed;
    inset: 0;
    z-index: 39;
    display: block;
    background: var(--mmg-search-scrim);
    pointer-events: none;
  }

  /* Under the header, 760px wide, flush to its bottom edge (no border, square top, rounded bottom: the mega menu's convention); from 1024px the script sets the
     top and centres it on the search field (approved mock 2026-11-16-desktop-nav-polish). */
  .mmg-search--pop {
    position: fixed;
    top: 76px;
    right: max(40px, calc((100% - 1200px) / 2));
    z-index: 45;
    display: flex;
    flex-direction: column;
    width: 760px;
    max-width: calc(100% - 32px);
    overflow: hidden;
    border: 0;
    border-radius: 0 0 12px 12px;
    background: var(--mmg-search-cream-50);
  }

  .mmg-search--pop .mmg-search__body {
    flex: 1 1 auto;
    min-height: 0;
    max-height: 500px;
    padding-bottom: 16px;
    overflow-y: auto;
    overscroll-behavior: contain;
  }

  .mmg-search--pop:has(.mmg-search__foot:not([hidden])) .mmg-search__body {
    padding-bottom: 0;
  }

  .mmg-search--pop .mmg-search__section,
  .mmg-search--pop .mmg-search__title--label,
  .mmg-search--pop .mmg-search__title--plain,
  .mmg-search--pop .mmg-search__crit,
  .mmg-search--pop .mmg-search__sg {
    padding-right: 20px;
    padding-left: 20px;
  }

  .mmg-search--pop .mmg-search__count {
    padding: 8px 20px 4px;
  }

  .mmg-search--pop .mmg-search__section--showing {
    padding: 16px 20px 4px;
  }

  /* The chips say what is applied; the word "Showing" stays for screen readers only. */
  .mmg-search--pop .mmg-search__section--showing .mmg-search__label {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }

  .mmg-search--pop .mmg-search__row {
    padding: 14px 20px;
  }

  .mmg-search--pop .mmg-search__row .mmg-search__thumb {
    width: 84px;
    height: 104px;
    min-width: 84px;
    min-height: 104px;
  }

  .mmg-search--pop .mmg-search__foot {
    display: flex;
    flex: none;
    justify-content: flex-end;
    padding: 12px 20px;
    background: var(--mmg-search-cream-100);
  }

  .mmg-search__foot-link {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    color: var(--mmg-search-brown);
    font: 600 15px/20px var(--mmg-search-body);
  }
}

/* 768 to 1023px: the popover spans the content width, 40px to 40px (a 760px box at a 40px right edge would run off the left of a 768px window). */
@media (min-width: 768px) and (max-width: 1023px) {
  .mmg-search--pop {
    right: 40px;
    left: 40px;
    width: auto;
    max-width: none;
  }
}

@media (max-width: 767px) {
  .mmg-search--pop,
  .mmg-search--scrim {
    display: none !important;
  }

  /* The phone's rhythm of the mock: more air before the Products heading that follows the criteria row, and between the count line and the taste row. */
  .mmg-search--screen .mmg-search__group + .mmg-search__group > .mmg-search__title--label {
    padding-top: 26px;
  }

  .mmg-search--screen .mmg-search__count + .mmg-search__list > .mmg-search__group:first-child > .mmg-search__crit:first-child {
    margin-top: 6px;
  }
}

/* ---- Motion --------------------------------------------------------------------------------------------------------------------------------------- */

/* Built to the approved motion pack (docs/superpowers/mocks/2026-11-15-menu-motion/): the phone screen is the sheet moment, the desktop popover the popover
   moment, the presses are moment 1. The script removes [hidden] (the resting state), then adds .is-open; on close it removes .is-open and sets [hidden] when
   the transition ends. The closed state is under .has-motion, a class the script adds only when the browser runs transitions, so without script the shells
   stay [hidden] and with a script that cannot animate they simply appear and go. */
.mmg-search--screen.has-motion {
  transform: translateY(100%);
  pointer-events: none;
  transition: transform 200ms var(--mmg-search-ease-in);
}

.mmg-search--screen.has-motion.is-open {
  transform: none;
  pointer-events: auto;
  transition: transform 300ms var(--mmg-search-ease-sheet);
}

@media (min-width: 768px) {
  .mmg-search--pop.has-motion {
    transform: translateY(-6px);
    opacity: 0;
    pointer-events: none;
    transition: transform 140ms var(--mmg-search-ease-in), opacity 140ms ease-in;
  }

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

  .mmg-search--scrim.has-motion {
    opacity: 0;
    transition: opacity 140ms ease-in;
  }

  .mmg-search--scrim.has-motion.is-open {
    opacity: 1;
    transition-duration: 220ms;
  }
}

/* Press: down 80ms, release 180ms. `scale`, not `transform`, so it never fights the shell's own slide. Chips and the applied chips dip to .96, the Try again
   chip with them; rows take the card depth .97 after the 70ms delay (a scroll that starts on a row never dips it). */
.mmg-search :is(.mmg-search__chip, .mmg-search__achip, .mmg-search__row, .mmg-search__sg, .mmg-search__crit) {
  touch-action: manipulation;
  transition: scale 180ms var(--mmg-search-ease-out), opacity 180ms var(--mmg-search-ease-out), background-color 180ms var(--mmg-search-ease-out);
}

.mmg-search :is(.mmg-search__chip, .mmg-search__achip):active {
  scale: 0.96;
  transition-duration: 80ms;
}

.mmg-search :is(.mmg-search__row, .mmg-search__sg, .mmg-search__crit):active {
  scale: 0.97;
  transition: scale 80ms 70ms var(--mmg-search-ease-out);
}

/* Reduced motion: no scale or slide. The screen, the popover and the scrim become a plain short fade; presses answer with a tone change. */
@media (prefers-reduced-motion: reduce) {
  .mmg-search :is(.mmg-search__chip, .mmg-search__achip, .mmg-search__row, .mmg-search__sg, .mmg-search__crit):active {
    scale: none;
    opacity: 0.85;
    transition: opacity 80ms linear;
  }

  .mmg-search :is(.mmg-search__row, .mmg-search__sg, .mmg-search__crit):active {
    transition-delay: 70ms;
  }

  .mmg-search--screen.has-motion,
  .mmg-search--screen.has-motion.is-open,
  .mmg-search--pop.has-motion,
  .mmg-search--pop.has-motion.is-open {
    transform: none;
    transition: opacity 120ms linear;
  }

  .mmg-search--screen.has-motion,
  .mmg-search--pop.has-motion {
    opacity: 0;
  }

  .mmg-search--screen.has-motion.is-open,
  .mmg-search--pop.has-motion.is-open {
    opacity: 1;
  }

  .mmg-search--scrim.has-motion,
  .mmg-search--scrim.has-motion.is-open {
    transition-duration: 120ms;
  }

  .mmg-nav-bar__search {
    transition: none;
  }
}
