/* Consumer Marketplace surface. Extends the shared vendored stylesheet. */

body.mk { padding-bottom: 24px; }

/* ── Marketplace chrome ───────────────────────────────────────────────────────
   The Marketplace is its own consumer product. It shares DADCARE's tokens and
   icons so it still looks like the same family, and shares nothing else: no
   business navigation, no management surfaces, no tenant vocabulary. */

.mk-top {
  position: sticky; top: 0; z-index: 20;
  background: var(--surface); border-bottom: 1px solid var(--border);
}
.mk-top-in {
  display: flex; align-items: center; gap: 10px;
  flex-wrap: wrap; row-gap: 8px;
  padding: 10px 16px; margin: 0 auto; max-width: 1200px;
}
/* The header carries a brand and up to two links. On a narrow phone they wrap
   onto a second line rather than pushing the page sideways, and the brand
   gives up its own width first. */
.mk-brand {
  font-weight: 700; color: var(--text); font-size: 16px;
  min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  display: inline-flex; align-items: center; gap: 8px;
}
.mk-brand span { color: var(--brand); }
.mk-top .spacer { flex: 1; }
.mk-switch { min-height: 38px; padding: 8px 12px; font-size: 14px; white-space: nowrap; }

/* Desktop navigation. Hidden on phones, where the page itself is the
   navigation and a second row of links would only cost height. */
.mk-nav { display: none; gap: 4px; align-items: center; }
.mk-nav a {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 12px; border-radius: 999px; font-size: 14px; font-weight: 600;
  color: var(--muted); white-space: nowrap;
}
.mk-nav a .ic { width: 18px; height: 18px; }
.mk-nav a[aria-current="page"] { color: var(--brand); background: var(--brand-soft); }
@media (hover: hover) { .mk-nav a:hover { color: var(--text); } }
@media (min-width: 860px) { .mk-nav { display: flex; } }

/* One content column, centred, so a desktop Marketplace is not a stretched
   phone page. */
.mk-shell { max-width: 1200px; margin: 0 auto; }

/* ── Discovery ───────────────────────────────────────────────────────────── */

/* A factual introduction. It states what the Marketplace is and promises
   nothing the platform does not actually do — no delivery, no protection, no
   verification, because none of those exist to promise. */
.mk-hero {
  background: var(--brand-soft); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 18px 16px; margin-bottom: 14px;
}
.mk-hero h1 { font-size: 20px; line-height: 1.25; margin: 0; color: var(--text); }
.mk-hero p { margin: 6px 0 0; color: var(--muted); font-size: 14px; line-height: 1.45; }
@media (min-width: 860px) {
  .mk-hero { padding: 28px 24px; }
  .mk-hero h1 { font-size: 28px; }
  .mk-hero p { font-size: 15px; }
}

.mk-search { display: flex; gap: 8px; margin-bottom: 14px; position: relative; }
.mk-search .ic {
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  width: 20px; height: 20px; color: var(--muted); pointer-events: none;
}
.mk-search input {
  flex: 1; min-height: 46px; padding: 10px 12px 10px 40px; font-size: 16px;
  border: 1px solid var(--border); border-radius: 999px;
  background: var(--surface); color: var(--text);
}
.mk-search input:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }

/* Chips scroll inside their own strip. The document never widens. */
.chips {
  display: flex; gap: 8px; overflow-x: auto; padding-bottom: 8px;
  margin-bottom: 14px; scrollbar-width: none;
}
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; padding: 8px 14px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--border); background: var(--surface);
  color: var(--text); font-size: 14px; min-height: 38px; white-space: nowrap;
}
.chip.active { background: var(--brand); border-color: var(--brand);
  color: var(--on-brand); font-weight: 600; }

/* A real count of real results, or nothing. */
.mk-head { display: flex; align-items: baseline; gap: 10px; margin: 2px 0 10px; }
.mk-head h2 { flex: 1; margin: 0; font-size: 17px; }
.mk-count { color: var(--muted); font-size: 13px; white-space: nowrap; }
@media (min-width: 860px) { .mk-head h2 { font-size: 22px; } }

.mk-grid { display: grid; gap: 12px; grid-template-columns: repeat(2, 1fr); }
@media (min-width: 640px) { .mk-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 960px) { .mk-grid { grid-template-columns: repeat(4, 1fr); gap: 16px; } }

.mk-card {
  display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden; color: var(--text);
  transition: box-shadow .2s ease, transform .2s ease;
}
@media (hover: hover) {
  .mk-card:hover { box-shadow: var(--shadow); }
  .mk-card:hover .media img { transform: scale(1.04); }
}
.mk-card .media {
  position: relative; aspect-ratio: 1 / 1; background: var(--surface-2);
  display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.mk-card .media img {
  width: 100%; height: 100%; object-fit: cover; display: block;
  transition: transform .4s ease;
}
/* No photo yet — a neutral mark, never a stand-in product image. */
.mk-card .media .ph { color: var(--muted); display: flex; }
.mk-card .media .ph .ic { width: 32px; height: 32px; opacity: .55; }
/* Video indicator only. The grid never loads a <video> element. */
.mk-card .play {
  position: absolute; right: 8px; bottom: 8px;
  background: var(--overlay); color: var(--on-overlay); border-radius: 999px;
  font-size: 11px; padding: 4px 10px 4px 6px; font-weight: 600;
  display: inline-flex; align-items: center; gap: 4px;
}
.mk-card .play .ic { width: 14px; height: 14px; }
.mk-card .body {
  padding: 12px; display: flex; flex-direction: column; flex: 1; min-width: 0;
}
.mk-card .t {
  font-weight: 500; font-size: 14px; line-height: 1.35;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; overflow-wrap: anywhere;
}
/* Price is the loudest thing on the card after the picture. */
.mk-card .p {
  font-weight: 700; font-size: 17px; color: var(--brand);
  margin-top: auto; padding-top: 8px; overflow-wrap: anywhere;
}
/* Seller attribution, separated by a rule so it reads as a different fact
   from the product. The mark is the seller's own initial — a rendering of
   their real name, never a stand-in photograph. */
.mk-card .s {
  display: flex; align-items: center; gap: 6px; min-width: 0;
  color: var(--muted); font-size: 12px;
  margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--border);
}
.mk-card .s .who {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0;
}
.mk-initial {
  width: 20px; height: 20px; flex: none; border-radius: 999px;
  background: var(--brand-soft); color: var(--brand-dark);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; text-transform: uppercase;
}
.mk-card .badge { align-self: flex-start; margin-top: 8px; }

.mk-detail .hero { border-radius: var(--radius); overflow: hidden; background: var(--surface);
  border: 1px solid var(--border); }
.mk-detail .hero img, .mk-detail .hero video { width: 100%; display: block; }
.mk-detail .thumbs { display: flex; gap: 8px; overflow-x: auto; margin-top: 8px; }
.mk-detail .thumbs img { width: 64px; height: 64px; object-fit: cover; border-radius: 8px;
  border: 1px solid var(--border); flex: none; }
.mk-detail .price { font-size: 24px; font-weight: 700; }
.videobox { position: relative; }
.videobox button.playbtn {
  position: absolute; inset: 0; width: 100%; border: 0; cursor: pointer;
  background: transparent; display: flex; align-items: center; justify-content: center;
}
.videobox button.playbtn span {
  background: var(--overlay); color: var(--on-overlay); border-radius: 999px;
  padding: 12px 20px; font-size: 15px; font-weight: 600;
  display: inline-flex; align-items: center; gap: 8px;
}
.videobox button.playbtn .ic { width: 20px; height: 20px; }
.mk-foot { text-align: center; color: var(--muted); font-size: 12px; padding: 20px 12px 30px; }

/* ── Shop discovery and storefronts ───────────────────────────────────────── */
.mk-row-head { display: flex; align-items: baseline; gap: 10px; }
.mk-row-head .section { flex: 1; }
.mk-more-link { color: var(--brand); font-size: 14px; font-weight: 600; }

.mk-shops { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 4px; }
.mk-shop {
  flex: none; width: 116px; display: flex; flex-direction: column; align-items: center;
  gap: 6px; text-align: center; padding: 12px 8px; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius); color: var(--text);
}
.mk-shop-ico {
  width: 52px; height: 52px; border-radius: 999px; overflow: hidden;
  background: var(--surface-2); color: var(--muted);
  display: flex; align-items: center; justify-content: center;
}
.mk-shop-ico img { width: 100%; height: 100%; object-fit: cover; }
.mk-shop-ico .ic { width: 24px; height: 24px; }
.mk-shop-t { font-size: 13px; font-weight: 600; line-height: 1.25;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.mk-shop-s { font-size: 11px; color: var(--muted); }

.sf-cover {
  height: 132px; border-radius: var(--radius); overflow: hidden;
  background: var(--surface-2); border: 1px solid var(--border);
}
@media (min-width: 860px) { .sf-cover { height: 220px; } }
.sf-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.sf-bar { display: flex; align-items: center; gap: 12px; margin-top: -26px;
  padding: 0 12px; position: relative; }
.sf-logo {
  width: 64px; height: 64px; flex: none; border-radius: 16px; overflow: hidden;
  background: var(--surface); border: 2px solid var(--surface); color: var(--muted);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 8px rgb(0 0 0 / .12);
}
.sf-logo.sm { width: 40px; height: 40px; border-radius: 10px; box-shadow: none;
  border: 1px solid var(--border); }
.sf-logo img { width: 100%; height: 100%; object-fit: cover; }
.sf-logo .ic { width: 26px; height: 26px; }
.sf-logo.sm .ic { width: 18px; height: 18px; }
.sf-name { font-size: 18px; font-weight: 700; line-height: 1.2; }
.sf-meta { color: var(--muted); font-size: 13px; margin-top: 2px; }
.sf-about { color: var(--text); font-size: 14px; line-height: 1.5; margin: 12px 2px 0; }
.sf-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.sf-actions .btn { flex: 1 1 140px; }

/* A seller recognises their own listings by sight, so each row carries the
   same picture the shopper sees. When there is genuinely no photo the mark
   stays a mark — nothing is substituted to make the row look complete. */
.mk-thumb {
  width: 52px; height: 52px; flex: none; border-radius: 10px; overflow: hidden;
  background: var(--surface-2); border: 1px solid var(--border); color: var(--muted);
  display: flex; align-items: center; justify-content: center;
}
.mk-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.mk-thumb .ic { width: 20px; height: 20px; }

/* A row of the photos a listing actually has. Large enough to judge a picture
   by, and the main one is marked rather than merely first. */
.mk-media { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; }
.mk-thumb.lg { width: 84px; height: 84px; border-radius: 12px; flex: none; }
.mk-thumb.primary { border-color: var(--brand); border-width: 2px; }
.mk-thumb.lg { position: relative; cursor: pointer; }
.mk-thumb-x {
  position: absolute; top: -6px; right: -6px;
  width: 24px; height: 24px; border-radius: 50%; line-height: 1;
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
  font-size: 16px; padding: 0; cursor: pointer;
}


/* ── Detail ──────────────────────────────────────────────────────────────── */
/* On a wide screen the picture and the facts sit side by side instead of the
   facts being pushed a screenful below the fold. */
@media (min-width: 860px) {
  .mk-detail { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
    gap: 24px; align-items: start; }
  .mk-detail .hero { grid-column: 1; }
  .mk-detail .thumbs { grid-column: 1; }
  .mk-detail .mk-facts { grid-column: 2; grid-row: 1 / span 3; margin-top: 0; }
}
.mk-detail .hero { aspect-ratio: 1 / 1; display: flex; align-items: center;
  justify-content: center; }
.mk-detail .hero img, .mk-detail .hero video { height: 100%; object-fit: cover; }
.mk-detail .hero .ph { color: var(--muted); }
.mk-detail .hero .ph .ic { width: 48px; height: 48px; opacity: .55; }
.mk-facts h2 { font-size: 20px; line-height: 1.3; margin: 0; overflow-wrap: anywhere; }
.mk-facts .price { font-size: 26px; font-weight: 700; color: var(--brand);
  margin: 8px 0; }
.mk-facts .about { white-space: pre-wrap; line-height: 1.55; margin: 12px 0 0;
  overflow-wrap: anywhere; }
/* The seller of this product, as a way through to their shop. */
.mk-seller-row {
  display: flex; align-items: center; gap: 10px; margin-top: 14px;
  padding: 12px; border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface); color: var(--text);
}
.mk-seller-row .grow { flex: 1; min-width: 0; }
.mk-seller-row .name { font-weight: 600; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap; }
.mk-seller-row .meta { color: var(--muted); font-size: 13px; }
.mk-initial.lg { width: 40px; height: 40px; font-size: 16px; }

/* ── Empty and loading states ────────────────────────────────────────────── */
.mk-empty {
  text-align: center; color: var(--muted); padding: 40px 16px;
  border: 1px dashed var(--border); border-radius: var(--radius);
}
.mk-empty .ic { width: 34px; height: 34px; opacity: .5; display: block;
  margin: 0 auto 10px; }
