/* MundaApp — the market units shelf.
 *
 * Three objects live here: the hint that tells a producer they can open a
 * unit, the locality rail that keeps the page local, and the unit card itself
 * with its state and its backing row. Everything else on the market page is
 * the app's own chrome and is left alone.
 */

/* ------------------------------------------------- retired market chrome
 * The picture now opens the market page, so the board-prices strip, the
 * "Within 50 km of me" button and the FRA / check-a-bag quick links are not
 * rendered. Hiding rather than deleting the markup keeps the app's own
 * render intact: it rebuilds that strip on every pass, so removing the node
 * would only bring it back. Nothing else in the app uses these three
 * class names.
 */
.price-strip,
.nearme-row,
.quick-links { display: none !important; }

/* ---------------------------------------------------------------- the hint */
.mu-hint {
  display: flex; align-items: center; gap: 11px;
  margin: 0 0 12px; padding: 11px 12px;
  background: linear-gradient(180deg, #FFFDF6, #FFFFFF);
  border: 1px solid var(--line);
  border-left: 3px solid var(--gold);
  border-radius: 13px;
  box-shadow: var(--shadow-1);
}
.mu-hint-ic {
  flex: 0 0 auto; width: 34px; height: 34px; border-radius: 10px;
  display: grid; place-items: center;
  background: var(--gold-soft); color: #8A5A12;
}
.mu-hint-ic svg { width: 18px; height: 18px; }
.mu-hint-t { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.mu-hint-t b { font-size: 13px; font-weight: 650; color: var(--ink); letter-spacing: -.005em; }
.mu-hint-t span { font-size: 11.5px; line-height: 1.45; color: var(--muted); }
.mu-hint-go {
  flex: 0 0 auto; margin-left: auto;
  padding: 8px 11px; border-radius: 9px;
  background: var(--green-700); color: #fff;
  font-size: 11.5px; font-weight: 650; text-decoration: none;
  white-space: nowrap;
}
.mu-hint-go:active { transform: translateY(1px); }

@media (max-width: 430px) {
  .mu-hint { flex-wrap: wrap; }
  .mu-hint-go { margin-left: 45px; }
}

/* ------------------------------------------------------------- locality */
.mu-locality { margin: 0 0 12px; }
.mu-rail {
  display: flex; gap: 8px; overflow-x: auto;
  padding: 2px 2px 6px; margin: 0 -2px;
  scrollbar-width: none; -webkit-overflow-scrolling: touch;
}
.mu-rail::-webkit-scrollbar { display: none; }
.mu-chip {
  flex: 0 0 auto; display: flex; flex-direction: column; gap: 1px;
  padding: 8px 12px; border-radius: 12px; cursor: pointer;
  background: var(--card); border: 1px solid var(--line);
  text-align: left; color: var(--ink);
}
.mu-chip b { font-size: 12.5px; font-weight: 650; line-height: 1.2; }
.mu-chip span { font-size: 10.5px; color: var(--muted); }
.mu-chip.on { background: var(--green-700); border-color: var(--green-700); color: #fff; }
.mu-chip.on span { color: rgba(255, 255, 255, .8); }

.mu-districts {
  margin: 4px 0 8px; padding: 6px;
  background: var(--card); border: 1px solid var(--line); border-radius: 13px;
}
.mu-districts-head {
  padding: 7px 8px 9px; font-size: 10.5px; letter-spacing: .06em;
  text-transform: uppercase; color: var(--muted); font-weight: 650;
}
.mu-district {
  display: grid; grid-template-columns: 1fr auto; gap: 1px 10px;
  width: 100%; padding: 9px 9px; border: 0; border-radius: 9px;
  background: transparent; text-align: left; cursor: pointer; color: var(--ink);
}
.mu-district + .mu-district { border-top: 1px solid var(--line-soft); }
.mu-district:active { background: var(--green-50); }
.mu-district.on { background: var(--green-50); }
.mu-d-name { font-size: 13px; font-weight: 600; }
.mu-d-meta { grid-column: 1; font-size: 11px; color: var(--muted); }
.mu-d-km { grid-row: 1 / span 2; align-self: center; font-size: 11px; color: var(--faint); font-variant-numeric: tabular-nums; }

.mu-rail-note {
  display: flex; flex-wrap: wrap; gap: 2px 10px; align-items: baseline;
  padding: 0 2px; font-size: 11px; color: var(--muted);
}
.mu-peak { color: var(--green-700); }

/* ------------------------------------------------------------ the sections */
.mu-sections { display: block; }
.mu-sec { margin-bottom: 18px; }
.mu-sec-head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 10px;
  padding: 0 2px 8px;
}
.mu-sec-head b {
  font-family: var(--display); font-size: 17px; font-weight: 600;
  letter-spacing: -.015em; color: var(--ink);
}
.mu-sec-head span { font-size: 11px; color: var(--muted); }

.mu-market { margin-bottom: 12px; }
.mu-market-head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 8px;
  padding: 0 2px 7px;
}
.mu-mk-name { font-size: 12.5px; font-weight: 650; color: var(--ink-2); }
.mu-mk-meta { font-size: 10.5px; color: var(--faint); }

.mu-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 720px) { .mu-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1040px) { .mu-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

/* --------------------------------------------------------------- the unit */
.mu-lot { position: relative; }
.mu-lot .lot-media { position: relative; }
.mu-lot .lot-media img { width: 100%; height: 100%; object-fit: cover; display: block; }

.mu-state {
  position: absolute; top: 8px; right: 8px;
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 8px; border-radius: 999px;
  font-size: 10px; font-weight: 750; letter-spacing: .04em; text-transform: uppercase;
  background: rgba(255, 255, 255, .94); color: #1B5A3A;
  box-shadow: 0 1px 3px rgba(10, 30, 20, .18);
}
.mu-state i {
  width: 6px; height: 6px; border-radius: 50%;
  background: #17A35F; box-shadow: 0 0 0 0 rgba(23, 163, 95, .55);
  animation: mu-live 2.4s ease-out infinite;
}
.mu-state.is-closed { color: #7A6A55; background: rgba(250, 247, 240, .95); }
.mu-state.is-closed i { background: #B9AC96; animation: none; box-shadow: none; }

@keyframes mu-live {
  0%   { box-shadow: 0 0 0 0 rgba(23, 163, 95, .5); }
  70%  { box-shadow: 0 0 0 6px rgba(23, 163, 95, 0); }
  100% { box-shadow: 0 0 0 0 rgba(23, 163, 95, 0); }
}
@media (prefers-reduced-motion: reduce) {
  .mu-state i { animation: none; }
}

.mu-comm {
  position: absolute; left: 8px; bottom: 8px;
  padding: 4px 8px; border-radius: 999px;
  background: linear-gradient(180deg, #F4CE86, #DFA03C);
  color: #3B2405; font-size: 9.5px; font-weight: 750;
  letter-spacing: .05em; text-transform: uppercase;
  border: 1px solid #A9711B;
}

.mu-line {
  margin-top: 3px; font-size: 11px; color: var(--muted);
  display: flex; align-items: center; flex-wrap: wrap; gap: 2px;
}
.mu-line .dotsep { width: 3px; height: 3px; border-radius: 50%; background: #C6C0AE; display: inline-block; margin: 0 5px; }

.mu-backrow {
  display: flex; align-items: center; gap: 8px;
  margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--line-soft);
}
.mu-backbtn {
  flex: 0 0 auto; cursor: pointer;
  padding: 6px 9px; border-radius: 8px;
  border: 1px solid #D8E5DA; background: var(--green-50); color: var(--green-700);
  font-size: 11px; font-weight: 650; line-height: 1;
}
.mu-backbtn:active { transform: translateY(1px); }
.mu-backbtn.on {
  background: var(--green-700); border-color: var(--green-700); color: #fff;
}
/* The count sits beside the button, not under it: at half a phone's width
   "No backers yet" was breaking onto a second line and pushing the card open. */
.mu-count {
  flex: 1 1 auto; min-width: 0; text-align: right;
  font-size: 10.5px; color: var(--muted); line-height: 1.25;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.mu-count b { color: var(--ink-2); font-weight: 700; }

/* Ten backings is the point where a price speaks for the community, so the
   card shows how far the price has to travel rather than a bare number. */
.mu-meter {
  position: relative; height: 3px; margin: 8px 0 5px;
  border-radius: 999px; background: #ECE6D6; overflow: hidden;
}
.mu-meter i {
  position: absolute; inset: 0 auto 0 0; display: block;
  border-radius: 999px;
  background: linear-gradient(90deg, #12915A, #0C6E42);
  transition: width .35s ease;
}
.mu-meter.is-full i { background: linear-gradient(90deg, #DFA03C, #C98A22); }
.mu-meter-k {
  font-size: 9.5px; letter-spacing: .01em; color: #7A8A80;
  line-height: 1.3; margin-bottom: 1px;
}
.mu-meter-k.is-full { color: #9A6C14; font-weight: 650; }

.mu-strong .lot-media::after {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  border-radius: inherit; box-shadow: inset 0 0 0 2px rgba(223, 160, 60, .55);
}

.mu-empty {
  padding: 22px 16px; text-align: center;
  background: var(--card); border: 1px dashed var(--line); border-radius: 14px;
}
.mu-empty b { display: block; font-size: 14px; margin-bottom: 4px; }
.mu-empty p { margin: 0 0 12px; font-size: 12.5px; color: var(--muted); line-height: 1.5; }

/* ------------------------------------------------------------- the hero
 * The market opens on a photograph, built the same way as the Community
 * Intelligence card: the flag ribbon on the top edge, the app's mark in a
 * warm tile, the product name in Fraunces, and one gold badge. Colour is
 * doing work: green for the shelf, gold for the market, red nowhere.
 */
.mu-hero {
  position: relative; display: block; overflow: hidden;
  margin: 0 0 14px; border-radius: 22px;
  background: #06251A; min-height: 268px;
  box-shadow: 0 22px 40px -28px rgba(6, 30, 20, .95), 0 2px 6px rgba(10, 30, 20, .14);
  text-decoration: none; color: #fff;
  isolation: isolate;
}
.mu-hero-photo { position: absolute; inset: 0; }
.mu-hero-photo img {
  width: 100%; height: 100%; object-fit: cover; object-position: 50% 46%;
  filter: saturate(1.04) contrast(1.02);
  transform: scale(1.02);
}
.mu-hero-photo:after {
  content: ''; position: absolute; inset: 0;
  background:
    linear-gradient(178deg, rgba(4, 26, 18, .62) 0%, rgba(4, 30, 20, .74) 46%, rgba(3, 22, 15, .95) 100%),
    radial-gradient(86% 64% at 92% 6%, rgba(223, 160, 60, .2), transparent 62%);
}
/* the app's ribbon, the same four bands as the CI card */
.mu-flag { position: absolute; top: 0; left: 0; right: 0; height: 5px; display: flex; z-index: 3; }
.mu-flag i:nth-child(1) { flex: 0 0 58%; background: #198A00; }
.mu-flag i:nth-child(2) { flex: 0 0 14%; background: #DE2010; }
.mu-flag i:nth-child(3) { flex: 0 0 14%; background: #111; }
.mu-flag i:nth-child(4) { flex: 1 1 auto; background: #EF7D00; }

.mu-hero-in { position: relative; z-index: 2; padding: 24px 18px 18px; display: flex; flex-direction: column; }
.mu-hero-top { display: flex; align-items: center; gap: 10px; }
.mu-logo {
  width: 42px; height: 42px; border-radius: 13px; overflow: hidden; flex: 0 0 auto;
  background: #F7F1DF;
  box-shadow: 0 10px 22px -12px rgba(0, 0, 0, .85), inset 0 0 0 1px rgba(255, 255, 255, .5);
}
.mu-logo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.mu-hero-mark { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.mu-hero-mark b {
  font-family: var(--display); font-size: 16px; font-weight: 600;
  letter-spacing: -.015em; color: #FFFDF6;
  text-shadow: 0 1px 10px rgba(0, 0, 0, .5);
}
.mu-hero-mark span {
  font-size: 9px; letter-spacing: .2em; text-transform: uppercase;
  font-weight: 600; color: rgba(247, 230, 190, .8); margin-top: 2px;
}
.mu-badge {
  margin-left: auto; flex: 0 0 auto;
  font: 700 10.5px/1 var(--display); letter-spacing: .08em;
  padding: 7px 9px; border-radius: 9px; color: #2A1500;
  background: linear-gradient(150deg, #FFC061, #DFA03C 68%, #B9831F);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .55), 0 8px 16px -10px rgba(0, 0, 0, .9);
}
.mu-hero h2 {
  margin: 18px 0 8px;
  font-family: var(--display); font-size: 22px; line-height: 1.18;
  font-weight: 600; letter-spacing: -.022em; color: #FFFDF6;
  text-shadow: 0 2px 18px rgba(0, 0, 0, .45);
}
.mu-hero p {
  margin: 0; font-size: 12.5px; line-height: 1.55;
  color: rgba(248, 252, 246, .88); max-width: 42ch;
}
.mu-hero-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 13px; }
.mu-pill {
  font-size: 9.5px; font-weight: 650; letter-spacing: .05em; text-transform: uppercase;
  padding: 5px 9px; border-radius: 999px; color: #FFFDF6;
  background: rgba(255, 255, 255, .16);
  border: 1px solid rgba(255, 255, 255, .24);
  backdrop-filter: blur(6px);
}
.mu-pill.ghost { background: rgba(255, 255, 255, .07); color: rgba(255, 253, 246, .9); }
.mu-hero-foot { display: flex; align-items: center; gap: 10px; margin-top: 15px; flex-wrap: wrap; }
.mu-hero-go {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 9px 13px; border-radius: 999px;
  background: #FFFDF6; color: #0B4029;
  font-size: 12px; font-weight: 700; text-decoration: none;
  box-shadow: 0 10px 20px -12px rgba(0, 0, 0, .9);
}
.mu-hero-go svg { width: 14px; height: 14px; }
.mu-hero-go:active { transform: translateY(1px); }
.mu-hero-cred {
  margin-left: auto; font-size: 8.5px; letter-spacing: .02em;
  color: rgba(255, 253, 246, .5);
}

/* ------------------------------------------------- province, always visible
 * Its own row under the chips: inside the scrolling rail it slid off the
 * right edge on a 360px phone, which is why the choice could not be found.
 * A native select sits invisibly over the whole card, so the tap target is
 * the card itself and the look is ours.
 */
.mu-look {
  position: relative; display: grid; grid-template-columns: 34px 1fr 18px;
  align-items: center; gap: 10px;
  margin: 4px 0 10px; padding: 10px 12px;
  background: linear-gradient(180deg, #FFFDF6, #FFFBF0);
  border: 1px solid #EDDFBE; border-radius: 14px;
  box-shadow: 0 1px 2px rgba(23, 40, 30, .04);
  cursor: pointer;
}
.mu-look.away { background: linear-gradient(180deg, #FFFBF0, #FDF3DC); border-color: #E4CF9C; }
.mu-look-ic {
  width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center;
  background: var(--gold-soft); color: #8A5A12;
}
.mu-look-ic svg { width: 17px; height: 17px; }
.mu-look-t { min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.mu-look-k {
  font-size: 9px; letter-spacing: .16em; text-transform: uppercase;
  font-weight: 700; color: #9A6C14;
}
.mu-look-t b {
  font-family: var(--display); font-size: 15px; font-weight: 600;
  letter-spacing: -.01em; line-height: 1.25; color: var(--ink);
}
.mu-look-s { font-size: 10.5px; line-height: 1.4; color: var(--muted); }
.mu-look-chev { width: 16px; height: 16px; color: #9A6C14; justify-self: end; }
.mu-look select {
  position: absolute; inset: 0; width: 100%; height: 100%;
  opacity: 0; border: 0; padding: 0; margin: 0;
  font-size: 16px; /* stops iOS zoom-on-focus */
  -webkit-appearance: none; appearance: none;
  cursor: pointer;
}
.mu-look:active { transform: translateY(1px); }
.mu-look:focus-within { outline: 2px solid #B4831F; outline-offset: 2px; }

.mu-none { margin: 6px 8px 10px; font-size: 12px; line-height: 1.5; color: var(--muted); }

/* ============================================================ the unit frame
 * A market unit is a stall, so the card is built like a printed photograph
 * with a striped binding: the app ribbon runs along the top edge, the picture
 * sits inside a cream mount, and the price hangs off it as a paper tag with a
 * punched hole rather than floating white text on the image.
 */
.mu-lot {
  position: relative;
  padding: 7px 7px 0;
  border-radius: 18px;
  border: 1px solid #E2D8C2;
  background: linear-gradient(180deg, #FFFDF7 0%, #FFFDFB 100%);
  box-shadow: 0 16px 28px -26px rgba(10, 30, 20, .65), 0 1px 2px rgba(10, 30, 20, .05);
}
.mu-lot:before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 4px; z-index: 4;
  border-radius: 18px 18px 0 0;
  background: linear-gradient(90deg, #198A00 0 58%, #DE2010 58% 72%, #111 72% 86%, #EF7D00 86% 100%);
}
.mu-lot .lot-media {
  border-radius: 12px;
  box-shadow: inset 0 0 0 1px rgba(10, 60, 34, .12);
}
/* Two cards in a row are equal height, so the seller sits on the floor of
   each one: without this the shorter card ends in a band of empty white. */
.mu-lot .lot-body {
  padding: 10px 3px 11px; gap: 3px;
  display: flex; flex-direction: column;
}
.mu-lot .lot-title { font-family: var(--display); font-size: 14px; font-weight: 600; letter-spacing: -.018em; line-height: 1.24; }
.mu-lot .lot-where { font-size: 10.5px; color: #56655D; }
.mu-lot .lot-where svg { width: 11px; height: 11px; }
.mu-lot .mu-line { font-size: 10.5px; }

/* the price, as a tag */
.mu-lot .lot-price-tag {
  left: 9px; right: auto; bottom: 9px;
  display: inline-flex; align-items: baseline; gap: 3px;
  max-width: calc(100% - 18px);
  padding: 5px 10px 5px 13px;
  border-radius: 3px 9px 9px 3px;
  background: #FFFDF6; color: #0B4029;
  font-size: 15px; font-weight: 600; letter-spacing: -.015em;
  text-shadow: none;
  box-shadow: 0 12px 20px -16px rgba(0, 0, 0, .9);
  clip-path: polygon(0 50%, 7px 0, 100% 0, 100% 100%, 7px 100%);
}
.mu-lot .lot-price-tag:before {
  content: ''; position: absolute; left: 5px; top: 50%; width: 3px; height: 3px;
  transform: translateY(-50%); border-radius: 50%; background: #CFC6AF;
}
.mu-lot .lot-price-tag small {
  font-size: 9px; font-weight: 600; letter-spacing: .01em; color: #63726A;
}

/* open / closed, as a stamp */
.mu-lot .mu-state {
  top: 9px; right: 9px;
  padding: 4px 7px; border-radius: 6px;
  font-size: 8.5px; letter-spacing: .13em; font-weight: 750;
  background: rgba(255, 253, 246, .95);
  border: 1px solid rgba(120, 100, 70, .22);
  color: #6E5F4A; box-shadow: none;
  -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px);
}
.mu-lot .mu-state.is-open {
  color: #10603B; background: rgba(236, 247, 239, .95); border-color: rgba(23, 122, 76, .3);
}

/* the back row closes the card like the foot of a tag */
.mu-lot .mu-backrow { margin-top: 9px; padding-top: 9px; border-top: 1px dashed rgba(120, 100, 70, .22); }
.mu-lot .mu-backbtn {
  border-radius: 999px; font-size: 10.5px; font-weight: 700; letter-spacing: .01em;
  padding: 7px 12px; border-color: #CFE6D6;
  box-shadow: 0 1px 1px rgba(10, 60, 34, .06);
}
.mu-lot .mu-backbtn.on { box-shadow: 0 4px 10px -8px rgba(10, 60, 34, .9); }
.mu-lot .lot-seller { margin-top: auto; padding-top: 7px; font-size: 11px; }
