/* Marketplace hub and store pages. Builds on style.css tokens (--navy,
   --cyan, --border, --text-muted, --light-bg) and design-system.css. */

.mp-wrap { max-width: 1120px; margin: 0 auto; padding: 22px 16px 96px; }
.mp-back { display: inline-block; font-size: 13.5px; font-weight: 700; color: var(--cyan); text-decoration: none; margin-bottom: 14px; }
.mp-back:hover { text-decoration: underline; }

.mp-hero h1 { font-size: clamp(1.6rem, 4.4vw, 2.3rem); font-weight: 800; color: var(--navy); margin: 0 0 6px; letter-spacing: -0.01em; }
.mp-hero p { color: var(--text-muted); font-size: 15.5px; line-height: 1.6; margin: 0 0 20px; max-width: 660px; }

/* Search */
.mp-search { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.mp-search input, .mp-search select {
  min-height: 48px; border: 1.5px solid var(--border); border-radius: 12px; padding: 0 14px;
  font-size: 15.5px; background: #fff; color: var(--text-dark); font-family: inherit;
}
.mp-search input { flex: 1 1 260px; }
.mp-search select { flex: 0 1 190px; }
.mp-search input:focus, .mp-search select:focus { outline: none; border-color: var(--cyan); box-shadow: 0 0 0 3px rgba(12,169,199,.2); }

/* Filter chips */
.mp-chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 12px; margin-bottom: 14px; scrollbar-width: none; }
.mp-chips::-webkit-scrollbar { display: none; }
.mp-chip {
  flex: 0 0 auto; min-height: 40px; padding: 0 16px; border-radius: 999px; border: 1.5px solid var(--border);
  background: #fff; color: var(--text-dark); font-weight: 700; font-size: 13.5px; cursor: pointer; font-family: inherit; white-space: nowrap;
}
.mp-chip:hover { border-color: var(--navy); }
.mp-chip[aria-pressed="true"] { background: var(--navy); border-color: var(--navy); color: #fff; }
.mp-chip-sep { flex: 0 0 1px; background: var(--border); margin: 6px 4px; }

.mp-section-title { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 26px 0 12px; }
.mp-section-title h2 { font-size: 19px; font-weight: 800; color: var(--navy); margin: 0; }
.mp-section-title span { font-size: 13px; color: var(--text-muted); }

/* Shop cards */
.mp-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.mp-shop {
  display: flex; flex-direction: column; border: 1.5px solid var(--border); border-radius: 16px; background: #fff;
  padding: 18px; text-decoration: none; color: inherit; transition: border-color .15s, box-shadow .15s;
}
.mp-shop:hover { border-color: var(--navy); box-shadow: 0 8px 24px rgba(24,43,73,.08); }
.mp-shop-top { display: flex; gap: 12px; align-items: center; margin-bottom: 12px; }
.mp-logo {
  width: 52px; height: 52px; border-radius: 12px; flex: 0 0 52px; background: var(--navy); color: #fff;
  display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 20px; overflow: hidden;
}
.mp-logo img { width: 100%; height: 100%; object-fit: cover; }
.mp-logo-lg { width: 76px; height: 76px; flex-basis: 76px; border-radius: 16px; font-size: 28px; }
.mp-shop h3 { font-size: 17px; font-weight: 800; color: var(--navy); margin: 0 0 2px; line-height: 1.25; }
.mp-where { font-size: 13px; color: var(--text-muted); }
.mp-about { font-size: 13.5px; color: var(--text-muted); line-height: 1.55; margin: 0 0 12px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.mp-shop-foot { margin-top: auto; padding-top: 12px; border-top: 1px solid var(--border); display: flex; gap: 10px; align-items: center; flex-wrap: wrap; font-size: 12.5px; color: var(--text-muted); }
.mp-shop-foot strong { color: var(--text-dark); }
.mp-go { margin-left: auto; font-weight: 800; font-size: 13.5px; color: var(--cyan); white-space: nowrap; }

/* Badges */
.mp-badges { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.mp-badge { font-size: 11px; font-weight: 800; padding: 4px 9px; border-radius: 999px; letter-spacing: .02em; white-space: nowrap; }
.mp-b-verified { background: #e3f6f9; color: #0a7d92; }
.mp-b-premium { background: #182b49; color: #fff; }
.mp-b-top_rated { background: #fdf3e0; color: #8a5a0b; }
.mp-b-fast_response { background: #e6f5ef; color: #0f7a5f; }
.mp-b-reliable { background: #e6f5ef; color: #0f7a5f; }
.mp-b-popular { background: #fbe8ed; color: #a8243f; }
.mp-b-featured { background: #fff; color: var(--navy); border: 1.5px solid var(--navy); padding: 2.5px 8px; }
.mp-b-own { background: var(--light-bg); color: var(--text-dark); border: 1px solid var(--border); }

/* Service cards */
.mp-services { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.mp-service {
  border: 1.5px solid var(--border); border-radius: 14px; background: #fff; overflow: hidden; display: flex; flex-direction: column;
  cursor: pointer; text-align: left; padding: 0; font-family: inherit; color: inherit; transition: border-color .15s, box-shadow .15s;
}
.mp-service:hover { border-color: var(--navy); box-shadow: 0 8px 24px rgba(24,43,73,.08); }
.mp-service:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(12,169,199,.45); }
.mp-service-img { height: 128px; background: var(--light-bg); display: flex; align-items: center; justify-content: center; }
.mp-service-img img { width: 100%; height: 100%; object-fit: cover; }
.mp-service-body { padding: 13px 14px 14px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.mp-service-name { font-weight: 800; font-size: 14.5px; color: var(--text-dark); line-height: 1.3; }
.mp-service-by { font-size: 12.5px; color: var(--text-muted); }
.mp-service-meta { font-size: 12px; color: var(--text-muted); }
.mp-price { margin-top: auto; padding-top: 8px; font-weight: 800; font-size: 15px; color: var(--navy); }
.mp-price small { font-weight: 600; font-size: 12px; color: var(--text-muted); }
.mp-price-quote { font-size: 13px; color: var(--cyan); }

/* Panels on the store page */
.mp-panel { border: 1.5px solid var(--border); border-radius: 16px; background: #fff; padding: 22px; margin-bottom: 16px; }
.mp-panel h2 { font-size: 16.5px; font-weight: 800; color: var(--navy); margin: 0 0 14px; }
.mp-store-head { display: flex; gap: 18px; align-items: flex-start; flex-wrap: wrap; }
.mp-store-head h1 { font-size: clamp(1.45rem, 3.8vw, 2rem); font-weight: 800; color: var(--navy); margin: 0 0 4px; }
.mp-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; margin-top: 18px; }
.mp-stat { background: var(--light-bg); border-radius: 12px; padding: 12px 14px; }
.mp-stat b { display: block; font-size: 18px; color: var(--navy); font-weight: 800; }
.mp-stat span { font-size: 12px; color: var(--text-muted); }
.mp-tabs { display: flex; gap: 4px; overflow-x: auto; margin: 4px 0 16px; border-bottom: 1.5px solid var(--border); scrollbar-width: none; }
.mp-tabs::-webkit-scrollbar { display: none; }
.mp-tab { background: none; border: 0; border-bottom: 3px solid transparent; padding: 12px 14px; font-weight: 800; font-size: 14px; color: var(--text-muted); cursor: pointer; font-family: inherit; white-space: nowrap; margin-bottom: -1.5px; }
.mp-tab[aria-selected="true"] { color: var(--navy); border-bottom-color: var(--cyan); }
.mp-kv { display: grid; grid-template-columns: minmax(120px, 190px) 1fr; gap: 8px 16px; font-size: 14px; }
.mp-kv dt { color: var(--text-muted); }
.mp-kv dd { margin: 0; color: var(--text-dark); }
.mp-photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.mp-photos img { width: 100%; height: 120px; object-fit: cover; border-radius: 10px; border: 1px solid var(--border); }
.mp-review { border-top: 1px solid var(--border); padding: 13px 0; font-size: 14px; }
.mp-review:first-child { border-top: 0; padding-top: 0; }
.mp-review p { color: var(--text-muted); margin: 4px 0 0; line-height: 1.6; }
.mp-stars { color: #c98a0b; letter-spacing: 1px; }
.mp-empty { text-align: center; padding: 38px 16px; color: var(--text-muted); font-size: 15px; line-height: 1.6; }
.mp-empty b { display: block; color: var(--navy); font-size: 17px; margin-bottom: 4px; }

/* "Let the marketplace find a shop" band */
.mp-band { margin-top: 30px; border-radius: 18px; background: var(--navy); color: #fff; padding: 24px; display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.mp-band h2 { font-size: 19px; font-weight: 800; margin: 0 0 4px; color: #fff; }
.mp-band p { margin: 0; font-size: 14.5px; opacity: .85; line-height: 1.55; max-width: 560px; }
.mp-band button { margin-left: auto; background: #fff; color: var(--navy); border: 0; border-radius: 999px; min-height: 46px; padding: 0 24px; font-weight: 800; font-size: 15px; cursor: pointer; font-family: inherit; }

/* Dialog (service detail and the request form) */
.mp-overlay { position: fixed; inset: 0; background: rgba(15,23,42,.55); display: flex; align-items: flex-end; justify-content: center; z-index: 1000; }
.mp-dialog { background: #fff; width: 100%; max-width: 620px; max-height: 92vh; overflow-y: auto; border-radius: 20px 20px 0 0; padding: 22px 20px 26px; }
@media (min-width: 680px) { .mp-overlay { align-items: center; padding: 20px; } .mp-dialog { border-radius: 20px; } }
.mp-dialog-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 14px; }
.mp-dialog h2 { font-size: 20px; font-weight: 800; color: var(--navy); margin: 0; line-height: 1.25; }
.mp-close { background: var(--light-bg); border: 0; width: 38px; height: 38px; border-radius: 50%; font-size: 20px; cursor: pointer; color: var(--text-dark); flex: 0 0 38px; }
.mp-form label { display: block; font-size: 13px; font-weight: 700; color: var(--text-dark); margin: 12px 0 5px; }
.mp-form input, .mp-form textarea, .mp-form select {
  width: 100%; min-height: 46px; border: 1.5px solid var(--border); border-radius: 10px; padding: 10px 12px;
  font-size: 15.5px; font-family: inherit; color: var(--text-dark); background: #fff; box-sizing: border-box;
}
.mp-form textarea { min-height: 92px; resize: vertical; }
.mp-form input:focus, .mp-form textarea:focus { outline: none; border-color: var(--cyan); box-shadow: 0 0 0 3px rgba(12,169,199,.2); }
.mp-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (max-width: 480px) { .mp-row { grid-template-columns: 1fr; } }
.mp-to { background: var(--light-bg); border-radius: 12px; padding: 11px 14px; font-size: 13.5px; color: var(--text-dark); line-height: 1.5; }
.mp-error { background: #fbe8ed; color: #c22b4d; padding: 10px 12px; border-radius: 10px; font-size: 13.5px; font-weight: 600; margin-top: 12px; }
.mp-files { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.mp-file { font-size: 12.5px; background: var(--light-bg); border: 1px solid var(--border); border-radius: 8px; padding: 5px 8px; display: inline-flex; gap: 6px; align-items: center; }
.mp-file button { border: 0; background: none; cursor: pointer; color: #c22b4d; font-weight: 800; font-size: 14px; padding: 0 2px; }
.mp-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; }
.mp-actions .ds-btn { flex: 1 1 180px; }
.mp-note { font-size: 12.5px; color: var(--text-muted); line-height: 1.55; margin-top: 12px; }
.mp-taglist { display: flex; gap: 6px; flex-wrap: wrap; }
.mp-tag { font-size: 12px; font-weight: 600; background: var(--light-bg); border: 1px solid var(--border); border-radius: 8px; padding: 5px 10px; color: var(--text-dark); }

/* Dark theme: surfaces follow the site's dark tokens. */
html[data-theme="dark"] .mp-shop, html[data-theme="dark"] .mp-service, html[data-theme="dark"] .mp-panel,
html[data-theme="dark"] .mp-dialog, html[data-theme="dark"] .mp-chip, html[data-theme="dark"] .mp-search input,
html[data-theme="dark"] .mp-search select, html[data-theme="dark"] .mp-form input, html[data-theme="dark"] .mp-form textarea {
  background: #121a2b; border-color: #263349; color: #e8edf6;
}
html[data-theme="dark"] .mp-chip[aria-pressed="true"] { background: #2a4a73; border-color: #2a4a73; }
html[data-theme="dark"] .mp-stat, html[data-theme="dark"] .mp-to, html[data-theme="dark"] .mp-tag,
html[data-theme="dark"] .mp-file, html[data-theme="dark"] .mp-service-img, html[data-theme="dark"] .mp-close { background: #1a2438; border-color: #263349; color: #e8edf6; }
html[data-theme="dark"] .mp-band { background: #1a2b47; }
html[data-theme="dark"] .mp-b-featured, html[data-theme="dark"] .mp-b-own { background: transparent; color: #a9c6ec; border-color: #3a475e; }

.mp-service-img:empty { display: none; }
