/* ==========================================================================
   Product / Search Results — Justdial-style listing page
   ========================================================================== */

/* ---------------- Head: breadcrumb + title + filter bar ---------------- */
.jd-head { background: #fff; border-bottom: 1px solid var(--border); padding: 16px 0 14px; }

.jd-crumb { font-size: 12px; color: var(--text-muted); display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 10px; }
.jd-crumb a { color: var(--text-muted); }
.jd-crumb a:hover { color: var(--orange); text-decoration: underline; }
.jd-crumb i { font-size: 9px; opacity: 0.6; }

.jd-title { font-size: 24px; font-weight: 700; color: var(--navy); line-height: 1.3; margin: 0 0 16px; }
@media (max-width: 576px) { .jd-title { font-size: 19px; } }

/* Shown only when the buyer's city had no match and results were widened. */
.jd-widened {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  margin: -8px 0 16px; padding: 10px 14px;
  background: #FFF3E0; border: 1px solid #FFD9A8; border-radius: var(--radius-sm);
  font-size: 13.5px; color: #8A5200;
}
.jd-widened strong { color: #6B3F00; }

/* Filter bar: pill dropdowns + toggle chips + All Filters, Justdial layout */
.jd-filterbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }

.jd-dd { position: relative; }
.jd-dd > summary {
  list-style: none; cursor: pointer; user-select: none;
  display: inline-flex; align-items: center; gap: 8px;
  border: 1px solid var(--border); background: #fff; border-radius: var(--radius-sm);
  font-size: 13.5px; font-weight: 600; color: var(--text); padding: 9px 14px; transition: all 0.15s;
}
.jd-dd > summary::-webkit-details-marker { display: none; }
.jd-dd > summary::after {
  content: ""; width: 6px; height: 6px; border-right: 1.6px solid currentColor; border-bottom: 1.6px solid currentColor;
  transform: translateY(-2px) rotate(45deg);
}
.jd-dd > summary:hover { border-color: var(--navy); }
.jd-dd.on > summary, .jd-dd[open] > summary { border-color: #1A5FB4; color: #1A5FB4; }
.jd-dd[open] > summary { border-bottom-left-radius: 0; border-bottom-right-radius: 0; }

.jd-pop {
  position: absolute; z-index: 40; top: calc(100% - 1px); left: 0; min-width: 200px; max-height: 340px; overflow-y: auto;
  background: #fff; border: 1px solid #1A5FB4; border-radius: 0 var(--radius-sm) var(--radius-sm) var(--radius-sm);
  padding: 8px; box-shadow: var(--shadow-md); display: flex; flex-direction: column; gap: 2px;
}
.jd-opt {
  display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: var(--radius-sm);
  font-size: 13.5px; color: var(--text); cursor: pointer;
}
.jd-opt:hover { background: #F4F7FA; }
.jd-opt input { position: absolute; opacity: 0; pointer-events: none; }
.jd-opt span { flex: 1; }
.jd-opt .star { color: #F59E0B; font-size: 10px; }
.jd-opt > i.bi-check-circle-fill { color: #1A5FB4; font-size: 15px; visibility: hidden; }
.jd-opt:has(input:checked) > i.bi-check-circle-fill { visibility: visible; }
.jd-opt:has(input:checked) { color: #1A5FB4; font-weight: 600; }
.jd-pop-apply, .jd-pop-close {
  margin-top: 6px; border-radius: var(--radius-sm); font-size: 13px; font-weight: 700; padding: 8px 10px; cursor: pointer;
}
.jd-pop-apply { border: none; background: #1A5FB4; color: #fff; }
.jd-pop-close { border: 1px solid #1A5FB4; background: #fff; color: #1A5FB4; }

.jd-chip {
  display: inline-flex; align-items: center; gap: 7px; cursor: pointer;
  border: 1px solid var(--border); background: #fff; border-radius: var(--radius-sm);
  font-size: 13.5px; font-weight: 600; color: var(--text); padding: 9px 14px; transition: all 0.15s; margin: 0;
}
.jd-chip i { font-size: 12px; }
.jd-chip .star { color: #F59E0B; }
.jd-chip:hover { border-color: var(--navy); color: var(--navy); }
.jd-chip.on { border-color: #1A5FB4; color: #1A5FB4; background: #F2F7FD; }

.jd-allfilters {
  display: inline-flex; align-items: center; gap: 7px; cursor: pointer;
  border: 1px solid var(--border); background: #fff; border-radius: var(--radius-sm);
  font-size: 13.5px; font-weight: 700; color: var(--text); padding: 9px 14px; box-shadow: var(--shadow-sm);
}
.jd-allfilters:hover { border-color: var(--navy); }
.jd-badge { background: #1A5FB4; color: #fff; font-size: 11px; border-radius: 999px; padding: 1px 7px; }

/* All Filters drawer — right side on desktop, full screen on mobile */
.jd-drawer { position: fixed; inset: 0; z-index: 1080; display: flex; justify-content: flex-end; }
.jd-drawer[hidden] { display: none; }
.jd-drawer-backdrop { position: absolute; inset: 0; background: rgba(15,23,42,0.45); }
.jd-drawer-panel {
  position: relative; width: 420px; max-width: 100%; height: 100%;
  background: #fff; display: flex; flex-direction: column; box-shadow: -8px 0 30px rgba(0,0,0,0.15);
}
.jd-drawer-head { display: flex; align-items: center; gap: 12px; padding: 16px 18px; border-bottom: 1px solid var(--border); }
.jd-drawer-head h5 { flex: 1; text-align: center; font-size: 15px; font-weight: 700; letter-spacing: 0.04em; color: var(--navy); margin: 0; }
.jd-drawer-x { border: none; background: none; font-size: 16px; color: var(--text); cursor: pointer; padding: 0; }
.jd-reset-link { font-size: 13.5px; font-weight: 600; color: #1A5FB4; }

.jd-drawer-body { flex: 1; overflow-y: auto; padding: 18px; display: flex; flex-direction: column; gap: 22px; }
.jd-sec h6 { font-size: 14.5px; font-weight: 700; color: var(--navy); margin: 0 0 12px; }
.jd-sec-chips { display: flex; flex-wrap: wrap; gap: 10px; }
.jd-sec-chips .jd-chip { font-size: 13px; padding: 8px 13px; }

.jd-drawer-foot { display: flex; gap: 12px; padding: 14px 18px; border-top: 1px solid var(--border); }
.jd-btn-ghost, .jd-btn-primary {
  flex: 1; text-align: center; border-radius: var(--radius-sm); font-size: 14px; font-weight: 700;
  padding: 11px 16px; cursor: pointer;
}
.jd-btn-ghost { border: 1px solid var(--border); background: #fff; color: var(--text); }
.jd-btn-primary { border: none; background: #1A5FB4; color: #fff; }

@media (max-width: 640px) {
  .jd-drawer-panel { width: 100%; }
  .jd-filterbar { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
  .jd-filterbar::-webkit-scrollbar { display: none; }
  .jd-filterbar > * { flex: 0 0 auto; }
}

/* ---------------- Layout ---------------- */
.jd-body { background: var(--bg); padding: 20px 0 48px; }
.jd-layout { display: grid; grid-template-columns: 1fr 330px; gap: 22px; align-items: start; }
@media (max-width: 1024px) { .jd-layout { grid-template-columns: 1fr; } }

.jd-aside { display: flex; flex-direction: column; gap: 16px; position: sticky; top: 88px; }
@media (max-width: 1024px) { .jd-aside { position: static; } }

.jd-panel { background: #fff; border: 1px solid var(--border); border-radius: var(--radius-md); padding: 18px; }
.jd-panel h6 { font-size: 16px; font-weight: 700; color: var(--navy); margin: 0 0 4px; display: flex; align-items: center; gap: 8px; }
.jd-panel-sub { font-size: 12.5px; color: var(--text-muted); margin: 0 0 14px; }

.jd-picks { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.jd-pick { display: flex; flex-direction: column; gap: 5px; }
.jd-pick-media { display: block; border-radius: var(--radius-sm); overflow: hidden; }
.jd-pick-media img { width: 100%; height: 90px; object-fit: cover; background: var(--bg); display: block; }
.jd-pick-name { font-size: 12px; font-weight: 700; color: var(--text); display: flex; align-items: center; gap: 5px; line-height: 1.3; }
.jd-pick-name i { color: #fff; background: var(--navy); font-size: 8px; padding: 3px; border-radius: 50%; flex-shrink: 0; }
.jd-pick-meta { font-size: 11px; color: var(--text-muted); display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.jd-pick-rating { display: inline-flex; align-items: center; gap: 3px; background: #16A34A; color: #fff; font-size: 11px; font-weight: 700; padding: 2px 6px; border-radius: 5px; }
.jd-pick-rating i { font-size: 8px; }
.jd-pick-pickup { font-size: 10.5px; font-weight: 700; color: #F59E0B; display: flex; align-items: center; gap: 4px; }
.jd-pick-actions { display: flex; flex-direction: column; gap: 6px; margin-top: 2px; }
.jd-pick-call, .jd-pick-wa {
  display: inline-flex; align-items: center; justify-content: center; gap: 5px;
  font-size: 11px; font-weight: 700; padding: 7px; border-radius: var(--radius-sm); color: #fff; white-space: nowrap;
}
.jd-pick-call { background: #16A34A; }
.jd-pick-wa { background: #1A5FB4; }

.lead-card { border-color: var(--orange); background: #FFF8F3; }
.lead-card-radios { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; }
.lead-card-radios label { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text); cursor: pointer; }

.filter-list { list-style: none; margin: 0; padding: 0; }
.filter-list li { margin-bottom: 10px; font-size: 13.5px; }
.filter-list a { color: var(--text-muted); transition: color 0.2s; }
.filter-list a:hover { color: var(--orange); }
.filter-list.scrollable { max-height: 300px; overflow-y: auto; padding-right: 6px; }
.filter-list.scrollable::-webkit-scrollbar { width: 5px; }
.filter-list.scrollable::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

/* ---------------- Listing cards (goods) ---------------- */
.listing-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
@media (max-width: 1400px) { .listing-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 576px) { .listing-grid { grid-template-columns: 1fr; } }

.listing-card {
  position: relative; background: #fff; border: 1px solid var(--border); border-radius: var(--radius-lg);
  overflow: hidden; display: flex; flex-direction: column; box-shadow: var(--shadow-xs);
  transition: box-shadow 0.25s var(--ease), transform 0.25s var(--ease), border-color 0.25s var(--ease);
}
.listing-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-4px); border-color: #F3D9C4; }
.listing-card-media { position: relative; display: block; aspect-ratio: 4/3; background: var(--bg); overflow: hidden; }
.listing-card-media img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s var(--ease); }
.listing-card:hover .listing-card-media img { transform: scale(1.06); }
.listing-card-media::after {
  content: ""; position: absolute; inset: auto 0 0 0; height: 55%; pointer-events: none;
  background: linear-gradient(to top, rgba(11,27,58,0.28), rgba(11,27,58,0));
}
.listing-card-verified-flag {
  position: absolute; left: 12px; bottom: 12px; z-index: 1; display: inline-flex; align-items: center; gap: 4px;
  background: rgba(255,255,255,0.94); backdrop-filter: blur(4px); color: #16A34A; font-size: 10.5px; font-weight: 800;
  padding: 4px 10px; border-radius: var(--radius-pill); box-shadow: var(--shadow-xs);
}
.listing-card-body { padding: 16px; display: flex; flex-direction: column; gap: 9px; flex: 1; }
.listing-card-title {
  font-size: 14.5px; font-weight: 700; color: var(--navy); line-height: 1.4;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.listing-card-title:hover { color: var(--orange); }
.listing-card-price-row { display: flex; align-items: baseline; gap: 7px; }
.listing-card-price { font-size: 20px; font-weight: 800; color: var(--orange); letter-spacing: -0.01em; }
.listing-card-moq { font-size: 12px; font-weight: 600; color: var(--text-muted); }

.listing-card-spec-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.listing-spec-tag { font-size: 10.5px; font-weight: 600; background: #F8FAFC; border: 1px solid var(--border); color: var(--text-muted); padding: 4px 9px; border-radius: var(--radius-pill); }

.listing-card-supplier { display: flex; align-items: flex-start; gap: 9px; margin-top: auto; padding-top: 12px; border-top: 1px dashed var(--border); text-decoration: none; }
.listing-card-supplier::before {
  content: attr(data-initial); flex-shrink: 0; width: 28px; height: 28px; border-radius: 50%;
  background: var(--navy); color: #fff; font-size: 12px; font-weight: 800; display: flex; align-items: center; justify-content: center;
}
.listing-card-supplier-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.listing-card-supplier strong { font-size: 13px; color: var(--navy); font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.listing-card-supplier:hover strong { color: var(--orange); }
.listing-card-supplier-meta { font-size: 11.5px; color: var(--text-muted); display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.listing-card-supplier-meta i.bi-patch-check-fill { color: #16A34A; }
.listing-card-supplier-meta .dot { color: var(--border); }

.listing-card-actions { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 4px; }
.listing-btn-call, .listing-btn-whatsapp, .listing-btn-contact {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: 6px;
  font-size: 11.5px; font-weight: 700; padding: 9px 8px; border-radius: var(--radius-pill); transition: all 0.2s var(--ease); white-space: nowrap;
}
.listing-btn-call { background: var(--navy); color: #fff; }
.listing-btn-call:hover { background: var(--navy-3); color: #fff; }
.listing-btn-whatsapp { background: #25D366; color: #fff; }
.listing-btn-whatsapp:hover { background: #1DAE55; color: #fff; }
.listing-btn-contact { border: 1.5px solid var(--orange); color: var(--orange); background: #fff; }
.listing-btn-contact:hover { background: var(--orange); color: #fff; }

/* ---------------- Listing cards (services) ---------------- */
.service-list { display: flex; flex-direction: column; gap: 14px; }
.service-card {
  position: relative;
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius-md);
  padding: 16px; display: flex; gap: 16px; transition: box-shadow 0.2s var(--ease);
}
.svc-flag {
  position: absolute; top: -1px; right: 14px;
  background: #fff; border: 1px solid var(--border); border-top: none; border-radius: 0 0 6px 6px;
  font-size: 11.5px; color: var(--text-muted); padding: 3px 9px;
}
.service-card:hover { box-shadow: var(--shadow-sm); }
.service-card-media { flex-shrink: 0; width: 180px; height: 175px; border-radius: var(--radius-sm); overflow: hidden; display: block; background: var(--bg); }
.service-card-media img { width: 100%; height: 100%; object-fit: cover; }
.service-card-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 8px; }

.service-card-head { font-size: 19px; font-weight: 700; line-height: 1.3; margin: 0; display: flex; align-items: center; gap: 8px; }
.service-card-head a { color: var(--navy); }
.service-card-head a:hover { color: var(--orange); }
.jd-verified { color: #1A5FB4; font-size: 15px; }

.service-card-badges { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.svc-rating-pill { display: inline-flex; align-items: center; gap: 4px; background: #16A34A; color: #fff; font-size: 13px; font-weight: 700; padding: 3px 9px; border-radius: 5px; }
.svc-rating-pill i { font-size: 10px; }
.svc-badge { font-size: 12.5px; font-weight: 600; color: var(--text-muted); display: inline-flex; align-items: center; gap: 4px; }
.svc-badge.top-rated { color: #0F8B6C; background: #ECFDF5; padding: 3px 9px; border-radius: var(--radius-pill); font-size: 11.5px; }

.service-card-loc, .service-card-meta { font-size: 13px; color: var(--text-muted); display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.service-card-loc i { color: var(--text-muted); }
.service-card-meta .dot, .service-card-loc .dot { color: var(--border); }
.service-card-service { color: var(--text); font-weight: 600; }
.service-card-service:hover { color: var(--orange); }
.service-card-price { color: var(--navy); font-weight: 700; }
.svc-pickup { display: inline-flex; align-items: center; gap: 5px; font-weight: 700; color: var(--text); }
.svc-pickup i { color: #F59E0B; }
.svc-opens { color: #16A34A; font-weight: 600; }

.service-card-quote { font-size: 12.5px; color: var(--text-muted); font-style: italic; }
.service-card-quote i { color: var(--orange); margin-right: 2px; }
.service-card-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.svc-tag { font-size: 11.5px; background: #F1F5F9; color: var(--text-muted); padding: 3px 8px; border-radius: 6px; }

.service-card-actions-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: auto; padding-top: 6px; }
.svc-btn-outline, .svc-btn-solid, .svc-btn-call {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 10px 18px; border-radius: var(--radius-sm); font-size: 13.5px; font-weight: 700;
  cursor: pointer; white-space: nowrap;
}
.svc-btn-call { border: none; background: #16A34A; color: #fff; }
.svc-btn-call:hover { background: #128A3C; color: #fff; }
.svc-btn-outline { border: 1px solid #1A5FB4; color: #1A5FB4; background: #fff; }
.svc-btn-outline:hover { background: #F2F7FD; color: #1A5FB4; }
.svc-btn-solid { border: none; background: #1A5FB4; color: #fff; }
.svc-btn-solid:hover { background: #164E93; color: #fff; }

.no-results { font-size: 14px; color: var(--text-muted); padding: 30px 0; }

@media (max-width: 640px) {
  .service-card { flex-direction: column; }
  .service-card-media { width: 100%; height: 190px; }
  .service-card-head { font-size: 17px; }
  .service-card-actions-row > * { flex: 1; }
}

/* ---------------- Products / Suppliers view toggle ---------------- */
.jd-view-tabs { display: flex; gap: 8px; margin-bottom: 16px; }
.jd-view-tab {
  display: inline-flex; align-items: center; gap: 7px; padding: 9px 18px; border-radius: var(--radius-sm);
  font-size: 13.5px; font-weight: 700; color: var(--text); border: 1px solid var(--border); background: #fff;
}
.jd-view-tab:hover { border-color: var(--navy); }
.jd-view-tab.on { background: var(--navy); border-color: var(--navy); color: #fff; }

/* ---------------- Suppliers list (goods flow) ---------------- */
.sup-list { display: flex; flex-direction: column; gap: 14px; }
.sup-card {
  position: relative; background: #fff; border: 1px solid var(--border); border-radius: var(--radius-md);
  padding: 16px; display: flex; gap: 16px; flex-wrap: wrap; transition: box-shadow 0.2s var(--ease);
}
.sup-card:hover { box-shadow: var(--shadow-sm); }
.sup-card-stretch-link { position: absolute; inset: 0; z-index: 1; }
.sup-card-actions-row, .sup-card-actions-row * { position: relative; z-index: 2; }

.sup-card-media { flex-shrink: 0; width: 150px; height: 120px; border-radius: var(--radius-sm); overflow: hidden; background: var(--bg); }
.sup-card-media img { width: 100%; height: 100%; object-fit: cover; }

.sup-card-body { flex: 1; min-width: 240px; display: flex; flex-direction: column; gap: 6px; }
.sup-card-name { font-size: 17px; font-weight: 700; color: var(--navy); margin: 0; }
.sup-verified { color: #1A5FB4; font-size: 13px; margin-left: 4px; }

.sup-card-badges { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.sup-rating-pill { display: inline-flex; align-items: center; gap: 4px; background: #16A34A; color: #fff; font-size: 12.5px; font-weight: 700; padding: 3px 8px; border-radius: 5px; }
.sup-rating-pill i { font-size: 9px; }
.sup-badge { font-size: 11.5px; font-weight: 600; color: var(--text-muted); background: #F1F5F9; padding: 3px 8px; border-radius: 6px; }
.sup-badge.verified { color: #16A34A; background: #ECFDF5; display: inline-flex; align-items: center; gap: 4px; }

.sup-card-products { font-size: 12.5px; color: var(--text); }
.sup-card-loc { font-size: 12.5px; color: var(--text-muted); }
.sup-card-loc .dot { color: var(--border); }
.sup-card-price { font-size: 15px; font-weight: 700; color: var(--navy); }

.sup-card-actions-row { width: 100%; display: flex; flex-wrap: wrap; gap: 10px; margin-top: 6px; padding-top: 10px; border-top: 1px dashed var(--border); }
.sup-btn-call, .sup-btn-outline, .sup-btn-solid {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 9px 15px; border-radius: var(--radius-sm); font-size: 13px; font-weight: 700; cursor: pointer; white-space: nowrap;
}
.sup-btn-call { border: none; background: #16A34A; color: #fff; }
.sup-btn-call:hover { background: #128A3C; color: #fff; }
.sup-btn-outline { border: 1px solid #1A5FB4; color: #1A5FB4; background: #fff; }
.sup-btn-outline:hover { background: #F2F7FD; color: #1A5FB4; }
.sup-btn-solid { border: none; background: #1A5FB4; color: #fff; }
.sup-btn-solid:hover { background: #164E93; color: #fff; }

@media (max-width: 640px) {
  .sup-card-media { width: 100%; height: 160px; }
  .sup-card-actions-row > * { flex: 1; }
}
