/* =====================================================================
   PasarKita — stylesheet halaman publik (katalog iklan)
   Palet & tipografi dipilih khusus untuk marketplace barang bekas/baru:
   navy sebagai warna dasar kepercayaan, amber sebagai aksen harga/CTA.
   Spacing dibuat rapat sesuai permintaan (line-height & padding kecil).
   ===================================================================== */

:root {
  --navy-900: #14243A;
  --navy-800: #1F3A5F;
  --navy-700: #2C5183;
  --amber-500: #E8A33D;
  --amber-600: #C9862A;
  --bg: #F5F6F8;
  --surface: #FFFFFF;
  --border: #E4E7EC;
  --text-900: #1C222B;
  --text-600: #57606E;
  --text-400: #8A93A1;
  --green-ok: #2D6A4F;
  --red-sold: #B3261E;

  --radius-sm: 6px;
  --radius-md: 10px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text-900);
  font-family: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 14px;
  line-height: 1.35;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

.container {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 16px;
}

/* ---------- Topbar ---------- */
.topbar {
  background: var(--navy-900);
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 20;
}
.topbar-inner {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 10px 16px;
}
.brand {
  font-weight: 800;
  font-size: 18px;
  letter-spacing: -0.02em;
  color: #fff;
  white-space: nowrap;
}
.brand span { color: var(--amber-500); }

.search-form {
  flex: 1;
  display: flex;
  max-width: 560px;
}
.search-form select[name="kota"] {
  flex: none;
  border: none;
  border-right: 1px solid rgba(0,0,0,.08);
  border-radius: var(--radius-sm) 0 0 var(--radius-sm);
  padding: 8px 10px;
  font-size: 12.5px;
  max-width: 130px;
  background: #EFF2F6;
  color: var(--text-900);
  outline: none;
}
.search-form input[type="text"] {
  flex: 1;
  border: none;
  border-radius: 0;
  padding: 8px 12px;
  font-size: 13px;
  outline: none;
  min-width: 0;
}
.search-form button {
  border: none;
  background: var(--amber-500);
  color: var(--navy-900);
  font-weight: 700;
  padding: 0 16px;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  cursor: pointer;
  font-size: 13px;
}
.search-form button:hover { background: var(--amber-600); }

.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.btn-pasang {
  background: var(--amber-500);
  color: var(--navy-900);
  font-weight: 700;
  font-size: 13px;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  white-space: nowrap;
}
.btn-pasang:hover { background: var(--amber-600); }
.topbar-user { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.topbar-user img { width: 26px; height: 26px; border-radius: 50%; }
.topbar-link { color: #C9D2E0; font-size: 13px; }
.topbar-link:hover { color: #fff; }

/* ---------- Menu kategori (strip horizontal di bawah topbar) ---------- */
.cat-strip {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.cat-strip .container {
  display: flex;
  gap: 6px;
  padding: 8px 16px;
  overflow-x: auto;
  align-items: center;
}
.cat-chip {
  flex: none;
  font-size: 12.5px;
  padding: 5px 11px;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--text-600);
  white-space: nowrap;
}
.cat-chip.active, .cat-chip:hover {
  background: var(--navy-800);
  border-color: var(--navy-800);
  color: #fff;
}
.cat-strip-links {
  margin-left: auto;
  display: flex;
  gap: 10px;
  flex: none;
  font-size: 11.5px;
}
.cat-strip-links a { color: var(--text-400); white-space: nowrap; }
.cat-strip-links a:hover { color: var(--navy-800); }

/* ---------- Page heading ---------- */
.page-head {
  padding: 16px 0 10px;
}
.page-head h1 {
  font-size: 19px;
  margin: 0 0 2px;
  letter-spacing: -0.01em;
}
.page-head p {
  margin: 0;
  color: var(--text-600);
  font-size: 12.5px;
}

/* ---------- Listing grid (gaya feed/postingan, rapat) ---------- */
.listing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
  padding-bottom: 28px;
}

.listing-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: border-color .15s ease, transform .15s ease;
}
.listing-card:hover {
  border-color: var(--navy-700);
  transform: translateY(-2px);
}
.listing-thumb {
  position: relative;
  aspect-ratio: 4 / 3;
  background: var(--bg);
  overflow: hidden;
}
.listing-thumb img { width: 100%; height: 100%; object-fit: cover; }
.badge-sold {
  position: absolute;
  top: 8px; left: 8px;
  background: var(--red-sold);
  color: #fff;
  font-size: 10.5px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 4px;
}
.badge-video {
  position: absolute;
  bottom: 8px; right: 8px;
  background: rgba(20,36,58,.82);
  color: #fff;
  font-size: 10.5px;
  padding: 2px 7px;
  border-radius: 4px;
  display: flex; align-items: center; gap: 4px;
}

.listing-body { padding: 9px 10px 10px; display: flex; flex-direction: column; gap: 3px; flex: 1; }
.listing-title {
  font-size: 13px;
  font-weight: 600;
  line-height: 1.3;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.6em;
}
.listing-price {
  font-size: 14.5px;
  font-weight: 800;
  color: var(--navy-800);
  margin: 1px 0;
}
.listing-price small { font-weight: 500; font-size: 10.5px; color: var(--text-400); }
.listing-meta {
  font-size: 11px;
  color: var(--text-400);
  display: flex;
  justify-content: space-between;
  margin-top: auto;
  padding-top: 4px;
}
.listing-market-tag {
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 4px;
  display: inline-block;
  width: fit-content;
}
.tag-tokopedia { background: #E9F3FF; color: #0A5FBF; }
.tag-shopee    { background: #FFEEEA; color: #D8420B; }
.tag-lainnya   { background: #EEF1F5; color: var(--text-600); }

/* ---------- Pagination ---------- */
.pagination { display: flex; gap: 6px; justify-content: center; padding: 4px 0 32px; }
.pagination a, .pagination span {
  min-width: 30px; height: 30px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  font-size: 12.5px;
  color: var(--text-600);
  background: var(--surface);
}
.pagination a:hover { border-color: var(--navy-700); color: var(--navy-800); }
.pagination .current { background: var(--navy-800); color: #fff; border-color: var(--navy-800); }

/* ---------- Detail listing (mirip halaman post) ---------- */
.detail-wrap { padding: 18px 0 40px; display: grid; grid-template-columns: 1.5fr 1fr; gap: 22px; align-items: start; }
@media (max-width: 860px) { .detail-wrap { grid-template-columns: 1fr; } }

.breadcrumb { font-size: 11.5px; color: var(--text-400); margin-bottom: 10px; }
.breadcrumb a:hover { color: var(--navy-800); }

.gallery-main {
  aspect-ratio: 4/3;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--bg);
  margin-bottom: 8px;
}
.gallery-main img, .gallery-main iframe { width: 100%; height: 100%; object-fit: cover; border: 0; }
.gallery-thumbs { display: flex; gap: 6px; flex-wrap: wrap; }
.gallery-thumbs img, .gallery-thumbs .thumb-video {
  width: 64px; height: 48px; object-fit: cover;
  border-radius: 5px; border: 2px solid transparent; cursor: pointer;
}
.gallery-thumbs img.active, .thumb-video.active { border-color: var(--amber-500); }
.thumb-video {
  background: var(--navy-900); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px;
}

.detail-title { font-size: 20px; font-weight: 700; margin: 4px 0 6px; line-height: 1.3; }
.detail-price { font-size: 24px; font-weight: 800; color: var(--navy-800); margin: 0 0 4px; }
.detail-price small { font-size: 12px; font-weight: 600; color: var(--green-ok); margin-left: 6px; }
.detail-submeta { font-size: 12px; color: var(--text-600); margin-bottom: 14px; display: flex; gap: 12px; flex-wrap: wrap; }
.detail-submeta b { color: var(--text-900); }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px;
  margin-bottom: 12px;
}
.card h3 { font-size: 13px; margin: 0 0 8px; text-transform: none; color: var(--text-900); }
.card p { font-size: 13px; line-height: 1.55; color: var(--text-900); margin: 0; white-space: pre-line; }

.seller-row { display: flex; align-items: center; gap: 10px; }
.seller-row img { width: 40px; height: 40px; border-radius: 50%; background: var(--bg); }
.seller-name { font-weight: 700; font-size: 13px; }
.seller-sub { font-size: 11.5px; color: var(--text-400); }

.btn-block {
  display: block; text-align: center;
  padding: 10px; border-radius: var(--radius-sm);
  font-weight: 700; font-size: 13px; margin-top: 8px;
}
.btn-primary { background: var(--navy-800); color: #fff; }
.btn-primary:hover { background: var(--navy-700); }
.btn-outline { background: #fff; border: 1px solid var(--border); color: var(--text-900); }
.btn-outline:hover { border-color: var(--navy-700); }

.mp-preview {
  display: flex; gap: 10px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  overflow: hidden; margin-top: 8px;
}
.mp-preview img { width: 78px; height: 78px; object-fit: cover; flex: none; }
.mp-preview-body { padding: 8px 10px 8px 0; min-width: 0; }
.mp-preview-body .mp-src { font-size: 10.5px; font-weight: 700; color: var(--text-400); text-transform: uppercase; letter-spacing: .03em; }
.mp-preview-body .mp-title { font-size: 12.5px; font-weight: 600; margin: 2px 0; line-height: 1.3;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.mp-preview-fallback { font-size: 12.5px; padding: 10px; color: var(--text-600); }

.empty-state { text-align: center; padding: 60px 16px; color: var(--text-400); }
.empty-state h3 { color: var(--text-900); font-size: 15px; margin-bottom: 4px; }

footer.site-footer {
  border-top: 1px solid var(--border);
  padding: 18px 0;
  font-size: 12px;
  color: var(--text-400);
  text-align: center;
  line-height: 1.8;
}
footer.site-footer a { color: var(--text-600); }
footer.site-footer a:hover { color: var(--navy-800); }
