/**
 * Vanzy marketplace — white-first, OLX/Autovit-style platform chrome.
 * Professional listing site; NOT mobile app clone.
 */
:root {
  --mp-bg: #ffffff;
  --mp-surface: #f7f8f9;
  --mp-border: #e4e7eb;
  --mp-border-strong: #d0d5dc;
  --mp-ink: #1a1f26;
  --mp-ink-soft: #3d4654;
  --mp-muted: #6b7280;
  --mp-accent: #0d7377;
  --mp-accent-hover: #095456;
  --mp-accent-soft: rgba(13, 115, 119, 0.08);
  --mp-green: #16a34a;
  --mp-radius: 8px;
  --mp-radius-lg: 12px;
  --mp-shadow: 0 1px 3px rgba(26, 31, 38, 0.06);
  --mp-shadow-md: 0 4px 16px rgba(26, 31, 38, 0.08);
  --mp-max: 1200px;
  --mp-sidebar: 260px;
  --mp-font: 'Manrope', system-ui, -apple-system, sans-serif;
  --mp-display: 'Manrope', system-ui, sans-serif;
}

/* ── Page shell ── */
body.page-marketplace {
  font-family: var(--mp-font);
  color: var(--mp-ink);
  background: var(--mp-bg);
  padding-bottom: 0 !important;
}

body.page-marketplace .app-bottom-nav,
body.page-marketplace .app-download-banner,
body.page-marketplace #app-download-banner-spacer {
  display: none !important;
}

body.page-production {
  background: var(--mp-bg);
}

body.page-production .site-header,
body.page-marketplace .site-header {
  background: #fff;
  border-bottom: 1px solid var(--mp-border);
  box-shadow: none;
}

body.page-marketplace .site-header.scrolled {
  box-shadow: var(--mp-shadow-md);
}

/* ── Page header (replaces dark inner-hero) ── */
.mp-page-header {
  background: var(--mp-bg);
  border-bottom: 1px solid var(--mp-border);
  padding: 24px 0 20px;
}

.mp-page-header .container {
  width: min(100% - 32px, var(--mp-max));
  margin: 0 auto;
}

.mp-page-header h1 {
  margin: 0 0 6px;
  font-family: var(--mp-display);
  font-size: clamp(1.5rem, 3vw, 1.85rem);
  font-weight: 700;
  color: var(--mp-ink);
  letter-spacing: -0.02em;
}

.mp-page-header p {
  margin: 0;
  color: var(--mp-muted);
  font-size: 0.95rem;
  max-width: 56ch;
  line-height: 1.5;
}

.mp-page-header__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.mp-breadcrumb {
  font-size: 0.82rem;
  color: var(--mp-muted);
  margin-bottom: 8px;
}

.mp-breadcrumb a {
  color: var(--mp-accent);
  text-decoration: none;
}

.mp-breadcrumb a:hover {
  text-decoration: underline;
}

/* ── Layout: sidebar + main ── */
.mp-layout {
  width: min(100% - 32px, var(--mp-max));
  margin: 0 auto;
  padding: 24px 0 48px;
  display: grid;
  gap: 24px;
}

@media (min-width: 960px) {
  .mp-layout {
    grid-template-columns: var(--mp-sidebar) 1fr;
    align-items: start;
  }
}

.mp-sidebar {
  display: grid;
  gap: 16px;
}

.mp-sidebar__panel {
  background: var(--mp-bg);
  border: 1px solid var(--mp-border);
  border-radius: var(--mp-radius-lg);
  padding: 16px;
}

.mp-sidebar__panel h2 {
  margin: 0 0 12px;
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--mp-ink-soft);
}

.mp-main {
  min-width: 0;
}

/* ── Filters ── */
.mp-filters label {
  display: grid;
  gap: 5px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--mp-ink-soft);
  margin-bottom: 10px;
}

.mp-filters input,
.mp-filters select {
  min-height: 42px;
  padding: 8px 12px;
  border: 1px solid var(--mp-border-strong);
  border-radius: var(--mp-radius);
  font: inherit;
  background: #fff;
  color: var(--mp-ink);
}

.mp-filters input:focus,
.mp-filters select:focus {
  outline: none;
  border-color: var(--mp-accent);
  box-shadow: 0 0 0 3px var(--mp-accent-soft);
}

.filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.filter-chips .chip {
  padding: 7px 14px;
  border: 1px solid var(--mp-border-strong);
  border-radius: 999px;
  background: #fff;
  color: var(--mp-ink-soft);
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
}

.filter-chips .chip:hover {
  border-color: var(--mp-accent);
  color: var(--mp-accent);
}

.filter-chips .chip.active {
  background: var(--mp-accent);
  border-color: var(--mp-accent);
  color: #fff;
}

.listings-toolbar {
  display: grid;
  gap: 12px;
  margin-bottom: 16px;
}

.listings-status-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.listings-status {
  font-size: 0.84rem;
  color: var(--mp-muted);
  display: flex;
  align-items: center;
  gap: 8px;
}

.listings-status.is-live::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--mp-green);
}

.listings-status.is-error {
  color: #dc2626;
}

.btn-refresh {
  width: 36px;
  height: 36px;
  border: 1px solid var(--mp-border);
  border-radius: var(--mp-radius);
  background: #fff;
  color: var(--mp-ink-soft);
  cursor: pointer;
  font-size: 1.1rem;
}

.btn-refresh:hover {
  border-color: var(--mp-accent);
  color: var(--mp-accent);
}

.search-bar input,
.mp-search input {
  width: 100%;
  min-height: 44px;
  padding: 10px 14px;
  border: 1px solid var(--mp-border-strong);
  border-radius: var(--mp-radius);
  font: inherit;
  background: #fff;
}

.search-bar input:focus,
.mp-search input:focus {
  outline: none;
  border-color: var(--mp-accent);
  box-shadow: 0 0 0 3px var(--mp-accent-soft);
}

.mp-toolbar-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.mp-sort label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--mp-muted);
}

.mp-sort select {
  min-height: 38px;
  padding: 6px 10px;
  border: 1px solid var(--mp-border);
  border-radius: var(--mp-radius);
  font: inherit;
  background: #fff;
}

/* ── Listing grid (OLX-style) ── */
.listing-grid,
.dir-grid {
  display: grid;
  gap: 12px;
}

@media (min-width: 640px) {
  .listing-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1100px) {
  .listing-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 720px) {
  .dir-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1100px) {
  .dir-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Override app-clone listing cards */
body.page-marketplace .listing-card,
body.page-production.page-public-listing .listing-card {
  background: #fff;
  border: 1px solid var(--mp-border);
  border-radius: var(--mp-radius-lg);
  box-shadow: var(--mp-shadow);
  overflow: hidden;
  transition: box-shadow 0.15s, border-color 0.15s;
}

body.page-marketplace .listing-card::before,
body.page-marketplace .listing-card:hover {
  box-shadow: var(--mp-shadow-md);
  border-color: var(--mp-border-strong);
}

body.page-marketplace .listing-card::before {
  display: none;
}

body.page-marketplace .listing-media {
  height: 160px;
  background: var(--mp-surface);
  border-bottom: 1px solid var(--mp-border);
}

body.page-marketplace .listing-media::after {
  display: none;
}

body.page-marketplace .listing-badge {
  background: rgba(255, 255, 255, 0.95);
  color: var(--mp-ink-soft);
  border: 1px solid var(--mp-border);
  box-shadow: var(--mp-shadow);
  font-size: 0.72rem;
}

body.page-marketplace .listing-price {
  background: var(--mp-accent);
  border: none;
  box-shadow: none;
  font-size: 0.95rem;
}

body.page-marketplace .listing-body {
  padding: 14px 16px 16px;
}

body.page-marketplace .listing-body h3 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--mp-ink);
}

body.page-marketplace .listing-body h3 a:hover {
  color: var(--mp-accent);
}

body.page-marketplace .listing-chip {
  background: var(--mp-surface);
  border: 1px solid var(--mp-border);
  color: var(--mp-ink-soft);
  font-size: 0.72rem;
}

body.page-marketplace .listing-desc {
  color: var(--mp-muted);
  font-size: 0.82rem;
}

body.page-marketplace .listing-card__cta {
  width: 100%;
  margin-top: 10px;
  padding: 10px;
  border: 1px solid var(--mp-accent);
  border-radius: var(--mp-radius);
  background: #fff;
  color: var(--mp-accent);
  font-weight: 700;
  font-size: 0.88rem;
  cursor: pointer;
}

body.page-marketplace .listing-card__cta:hover {
  background: var(--mp-accent);
  color: #fff;
}

body.page-marketplace .carrier-mini {
  text-decoration: none;
  color: inherit;
}

body.page-marketplace .carrier-avatar {
  background: var(--mp-accent-soft);
  color: var(--mp-accent);
  font-weight: 700;
}

/* ── Directory cards ── */
.dir-card {
  background: #fff;
  border: 1px solid var(--mp-border);
  border-radius: var(--mp-radius-lg);
  overflow: hidden;
  transition: box-shadow 0.15s;
}

.dir-card:hover {
  box-shadow: var(--mp-shadow-md);
  border-color: var(--mp-border-strong);
}

.dir-card__link {
  display: flex;
  gap: 14px;
  padding: 16px;
  text-decoration: none;
  color: inherit;
}

.dir-card__avatar {
  width: 64px;
  height: 64px;
  border-radius: var(--mp-radius);
  background: var(--mp-surface);
  border: 1px solid var(--mp-border);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
  font-weight: 700;
  color: var(--mp-accent);
  font-size: 1.25rem;
}

.dir-card__avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.dir-card__body h3 {
  margin: 0 0 4px;
  font-size: 1rem;
  font-weight: 700;
  color: var(--mp-ink);
}

.dir-card__meta {
  margin: 0 0 6px;
  font-size: 0.82rem;
  color: var(--mp-muted);
}

.dir-card__desc {
  margin: 0 0 8px;
  font-size: 0.84rem;
  color: var(--mp-ink-soft);
  line-height: 1.45;
}

.dir-card__routes {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 8px;
}

.dir-card__routes span {
  padding: 3px 8px;
  background: var(--mp-surface);
  border: 1px solid var(--mp-border);
  border-radius: 4px;
  font-size: 0.72rem;
  color: var(--mp-ink-soft);
}

.dir-card__badges {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.pp-badge {
  padding: 3px 8px;
  background: var(--mp-accent-soft);
  color: var(--mp-accent);
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 600;
}

.dir-pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 24px;
  font-size: 0.9rem;
  color: var(--mp-muted);
}

/* ── Empty state ── */
.empty-state {
  padding: 40px 24px;
  text-align: center;
  background: var(--mp-surface);
  border: 1px dashed var(--mp-border-strong);
  border-radius: var(--mp-radius-lg);
}

.empty-state p {
  margin: 0 0 8px;
  color: var(--mp-ink-soft);
}

.platform-cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* ── Buttons (marketplace override) ── */
body.page-marketplace .btn-primary,
body.page-production .btn-primary {
  background: var(--mp-accent) !important;
  color: #fff !important;
  border: none;
  border-radius: var(--mp-radius);
  font-weight: 700;
  box-shadow: none !important;
}

body.page-marketplace .btn-primary:hover,
body.page-production .btn-primary:hover {
  background: var(--mp-accent-hover) !important;
}

body.page-marketplace .btn-secondary,
body.page-production .btn-secondary {
  background: #fff !important;
  color: var(--mp-ink-soft) !important;
  border: 1px solid var(--mp-border-strong) !important;
  border-radius: var(--mp-radius);
  font-weight: 600;
  box-shadow: none !important;
}

body.page-marketplace .btn-secondary:hover {
  border-color: var(--mp-accent) !important;
  color: var(--mp-accent) !important;
}

/* ── Platform search (homepage) ── */
.prod-platform-search {
  background: var(--mp-bg);
  border-bottom: 1px solid var(--mp-border);
  padding: 32px 0 28px;
}

.prod-platform-search__grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(2, 1fr);
}

@media (min-width: 720px) {
  .prod-platform-search__grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.prod-platform-search__card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 20px 16px;
  background: #fff;
  border: 1px solid var(--mp-border);
  border-radius: var(--mp-radius-lg);
  text-decoration: none;
  color: var(--mp-ink);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.prod-platform-search__card:hover {
  border-color: var(--mp-accent);
  box-shadow: var(--mp-shadow-md);
}

.prod-platform-search__card strong {
  font-size: 1rem;
  font-weight: 700;
}

.prod-platform-search__card span {
  font-size: 0.82rem;
  color: var(--mp-muted);
  line-height: 1.4;
}

.prod-platform-search__icon {
  width: 36px;
  height: 36px;
  border-radius: var(--mp-radius);
  background: var(--mp-accent-soft);
  color: var(--mp-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  margin-bottom: 4px;
}

/* White hero variant */
.prod-hero--white {
  min-height: auto;
  color: var(--mp-ink);
  background: var(--mp-bg);
  border-bottom: 1px solid var(--mp-border);
}

.prod-hero--white .prod-hero__media,
.prod-hero--white .prod-hero__shade {
  display: none;
}

.prod-hero--white .prod-hero__inner {
  padding: 32px 0 28px;
}

.prod-hero--white .prod-hero__brand .logo-text-van {
  color: var(--mp-ink);
}

.prod-hero--white .prod-hero__brand .logo-text-zy {
  color: var(--mp-accent);
}

.prod-hero--white .prod-hero__brand img {
  box-shadow: var(--mp-shadow);
}

.prod-hero--white .prod-hero__title {
  max-width: none;
  color: var(--mp-ink);
  font-size: clamp(1.6rem, 4vw, 2.2rem);
}

.prod-hero--white .prod-hero__lead {
  max-width: 52ch;
  color: var(--mp-muted);
}

.prod-hero--white .prod-hero__actions .btn-ghost {
  color: var(--mp-ink-soft);
  border-color: var(--mp-border-strong);
  background: #fff;
}

.prod-hero--white .prod-hero__actions .btn-ghost:hover {
  border-color: var(--mp-accent);
  color: var(--mp-accent);
  background: var(--mp-accent-soft);
}

.prod-hero--white .prod-hero__meta {
  color: var(--mp-muted);
}

.prod-hero--white .prod-hero__meta a {
  color: var(--mp-accent);
}

/* Hide inner-hero dark overlays on marketplace pages */
body.page-marketplace .inner-hero {
  display: none;
}

body.page-marketplace .page-feed-bg {
  background: var(--mp-bg);
}

body.page-marketplace .page-section {
  padding: 0;
}

body.page-marketplace .container {
  width: min(100% - 32px, var(--mp-max));
  margin: 0 auto;
}

/* Profile pages */
body.page-public-profile .pp-hero,
body.page-public-profile .pp-section {
  border-color: var(--mp-border);
}

body.page-public-profile .pp-hero {
  background: var(--mp-bg);
}

body.page-public-profile .pp-card {
  background: #fff;
  border: 1px solid var(--mp-border);
  border-radius: var(--mp-radius-lg);
}

/* CTA box at bottom of directory pages */
body.page-marketplace .home-cta__box,
body.page-marketplace .plan-highlight {
  background: var(--mp-surface);
  border: 1px solid var(--mp-border);
  border-radius: var(--mp-radius-lg);
  padding: 24px;
  margin-top: 32px;
}

body.page-marketplace .home-cta__box h2,
body.page-marketplace .plan-highlight h2 {
  font-size: 1.15rem;
  margin: 0 0 8px;
}

body.page-marketplace .section-label {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--mp-accent);
}

/* ── Vanzy Mapbox maps ── */
.vanzy-map-section h2 {
  margin: 0 0 12px;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--mp-ink);
}

.vanzy-map-shell {
  border: 1px solid var(--mp-border);
  border-radius: var(--mp-radius-lg);
  overflow: hidden;
  background: var(--mp-surface);
  box-shadow: var(--mp-shadow);
}

.vanzy-map-shell__frame {
  width: 100%;
  min-height: 320px;
  position: relative;
}

.vanzy-map-shell__frame .mapboxgl-map {
  font-family: var(--mp-font);
}

.vanzy-map-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 280px;
  color: var(--mp-muted);
  font-size: 0.92rem;
}

.vanzy-map-placeholder__spinner {
  width: 18px;
  height: 18px;
  border: 2px solid var(--mp-border);
  border-top-color: var(--mp-accent);
  border-radius: 50%;
  animation: vanzy-map-spin 0.8s linear infinite;
}

@keyframes vanzy-map-spin {
  to { transform: rotate(360deg); }
}

.vanzy-map-caption,
.vanzy-map-meta {
  margin: 0;
  padding: 10px 14px;
  font-size: 0.85rem;
  color: var(--mp-muted);
  border-top: 1px solid var(--mp-border);
  background: #fff;
}

.vanzy-map-meta {
  color: var(--mp-ink-soft);
  font-weight: 600;
}

.vanzy-map-empty {
  margin: 0;
  padding: 28px 16px;
  text-align: center;
  color: var(--mp-muted);
  font-size: 0.92rem;
}

.vanzy-map-pin {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
}

.vanzy-map-shell--empty .vanzy-map-shell__frame {
  min-height: auto;
}

.listings-view-toggle {
  display: inline-flex;
  border: 1px solid var(--mp-border);
  border-radius: var(--mp-radius);
  overflow: hidden;
  background: #fff;
}

.listings-view-toggle button {
  border: 0;
  background: transparent;
  padding: 8px 14px;
  font: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--mp-muted);
  cursor: pointer;
}

.listings-view-toggle button.active {
  background: var(--mp-accent-soft);
  color: var(--mp-accent);
}

.listings-map-panel {
  display: none;
  border: 1px solid var(--mp-border);
  border-radius: var(--mp-radius-lg);
  overflow: hidden;
  min-height: 480px;
  background: var(--mp-surface);
}

.listings-map-panel.is-visible {
  display: block;
}

.listings-map-panel .vanzy-map-shell {
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

body.page-listings.map-view .listing-grid {
  display: none;
}

body.page-listings.map-view .listings-map-panel {
  display: block;
}

.prod-routes-map {
  margin-top: 8px;
}

.prod-routes-map .vanzy-map-shell {
  margin-top: 16px;
}

.mapboxgl-ctrl-attrib {
  font-size: 10px !important;
}

@media (max-width: 640px) {
  .vanzy-map-shell__frame {
    min-height: 260px;
  }
  .listings-map-panel {
    min-height: 360px;
  }
}
