/* Dukkapu — market.css */
/* Auto-extracted from index.html */

/* ── Reset ──────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
img { display: block; max-width: 100%; }
button, input, select { font: inherit; }
a { color: inherit; text-decoration: none; }

/* ── Tokens ─────────────────────────────────────────────────── */
:root {
  --navy:      #0a2a6e;
  --blue:      #0d3a8a;
  --accent:    #006699;
  --cyan:      #00aacc;
  --base:      #f8f7f4;
  --panel:     #ffffff;
  --border:    #e2e0da;
  --text:      #1a1a2e;
  --muted:     #6b6b80;
  --success:   #00875a;
  --warning:   #c47d00;
  --danger:    #c0392b;

  /* Category colours */
  --cat-goods:    #1a5276;
  --cat-services: #1e8449;
  --cat-digital:  #6c3483;
  --cat-agri:     #7d6608;
  --cat-build:    #784212;
  --cat-logistics:#17202a;

  --r:  6px;
  --r2: 12px;
  --sh: 0 1px 4px rgba(10,42,110,0.08);

  font-size: 16px;
}

body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--base);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* ── Header ─────────────────────────────────────────────────── */
.site-header {
  position: sticky; top: 0; z-index: 200;
  background: var(--navy);
  padding: env(safe-area-inset-top, 0) 0 0;
}

.header-inner {
  max-width: 1280px; margin: auto;
  padding: 0 1.5rem;
  height: 56px;
  display: flex; align-items: center; gap: 1.5rem;
}

.brand {
  white-space: nowrap; flex-shrink: 0; line-height: 0;
}
.brand img {
  display: block; height: 36px; width: auto; max-width: 180px;
  filter: brightness(0) invert(1);
  opacity: 0.92;
}

/* Inline search in header */
.header-search {
  flex: 1; max-width: 520px;
  display: flex; align-items: center;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: var(--r);
  overflow: hidden;
}
.header-search input {
  flex: 1; background: transparent; border: none; outline: none;
  padding: 0.45rem 0.85rem;
  font-size: 0.85rem; color: #fff;
}
.header-search input::placeholder { color: rgba(255,255,255,0.45); }
.header-search button {
  background: var(--accent); border: none; cursor: pointer;
  padding: 0.45rem 0.85rem; color: #fff; font-size: 0.8rem; font-weight: 600;
  transition: background 0.15s;
}
.header-search button:hover { background: var(--blue); }

.header-nav {
  display: flex; align-items: center; gap: 0.25rem; margin-left: auto; flex-shrink: 0;
}
.nav-link {
  color: rgba(255,255,255,0.65); font-size: 0.8rem; font-weight: 500;
  padding: 0.4rem 0.65rem; border-radius: var(--r);
  transition: color 0.15s, background 0.15s;
}
.nav-link:hover { color: #fff; background: rgba(255,255,255,0.08); }

#nav-account {
  display: flex; align-items: center; gap: 0.4rem; margin-left: 0.25rem;
}

/* ── Hero CTAs ────────────────────────────────────────────────── */
#hero-cta a, #hero-cta-auth a {
  transition: opacity 0.15s, transform 0.12s;
}
#hero-cta a:hover, #hero-cta-auth a:hover { opacity: 0.88; transform: translateY(-1px); }

/* ── Hero ───────────────────────────────────────────────────── */
.hero {
  background: var(--navy);
  padding: 1.75rem 1.5rem 1.5rem;
}

.hero-inner {
  max-width: 680px; margin: auto; text-align: center;
}

.hero h1 {
  font-family: 'Fraunces', Georgia, serif;
  font-size: clamp(1.75rem, 4vw, 2.75rem);
  font-weight: 700; line-height: 1.15;
  color: #fff; margin-bottom: 0.5rem;
}
.hero h1 i { font-style: italic; color: var(--cyan); }

.hero p {
  color: rgba(255,255,255,0.6);
  font-size: 0.95rem; margin-bottom: 1.5rem; line-height: 1.6;
}

/* Main search bar */
.hero-search {
  display: flex; align-items: stretch;
  background: #fff; border-radius: var(--r2);
  overflow: hidden;
  box-shadow: 0 4px 24px rgba(0,0,0,0.2);
}

.hero-search-cat {
  border: none; border-right: 1px solid var(--border);
  background: transparent; padding: 0 1rem;
  font-size: 0.82rem; color: var(--muted); cursor: pointer;
  outline: none; flex-shrink: 0;
}

.hero-search input {
  flex: 1; border: none; outline: none;
  padding: 0.9rem 1rem;
  font-size: 0.95rem; color: var(--text);
  background: transparent;
}
.hero-search input::placeholder { color: #aaa; }

.hero-search-btn {
  background: var(--accent); border: none; cursor: pointer;
  padding: 0 1.5rem; color: #fff;
  font-size: 0.85rem; font-weight: 700;
  transition: background 0.15s; flex-shrink: 0;
}
.hero-search-btn:hover { background: var(--blue); }

.hero-stats {
  display: flex; justify-content: center; gap: 2rem;
  margin-top: 1.5rem;
}
.hero-stat { text-align: center; }
.hero-stat strong {
  display: block; font-size: 1.25rem; font-weight: 700; color: #fff;
}
.hero-stat span { font-size: 0.75rem; color: rgba(255,255,255,0.5); }

/* ── Category rail ──────────────────────────────────────────── */
.cat-rail-wrap {
  background: var(--panel);
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
  scrollbar-width: none;
}
.cat-rail-wrap::-webkit-scrollbar { display: none; }

.cat-rail {
  max-width: 1280px; margin: auto;
  padding: 0 1.5rem;
  display: flex; gap: 0.25rem; align-items: center;
  height: 52px;
}

.cat-pill {
  display: inline-flex; align-items: center; gap: 0.4rem;
  padding: 0.35rem 0.85rem; border-radius: 20px;
  font-size: 0.78rem; font-weight: 600;
  border: 1.5px solid var(--border);
  background: transparent; color: var(--muted);
  cursor: pointer; white-space: nowrap;
  transition: all 0.15s;
}
.cat-pill:hover { border-color: var(--accent); color: var(--accent); }
.cat-pill.active {
  background: var(--navy); color: #fff; border-color: var(--navy);
}
.cat-pill .dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: currentColor; opacity: 0.6;
}

/* ── Main layout ────────────────────────────────────────────── */
.main-wrap {
  max-width: 1280px; margin: auto;
  padding: 1.5rem;
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 1.5rem;
  align-items: start;
}

/* ── Sidebar filters ─────────────────────────────────────────── */
.sidebar { position: sticky; top: 72px; }

.filter-block {
  background: var(--panel); border: 1px solid var(--border);
  border-radius: var(--r2); overflow: hidden; margin-bottom: 1rem;
}

.filter-title {
  font-size: 0.72rem; font-weight: 700; color: var(--muted);
  padding: 0.75rem 1rem 0.5rem;
  border-bottom: 1px solid var(--border);
  letter-spacing: 0.04em; text-transform: uppercase;
}

.filter-body { padding: 0.65rem 1rem; }

.filter-option {
  display: flex; align-items: center; gap: 0.55rem;
  padding: 0.3rem 0; cursor: pointer; font-size: 0.82rem; color: var(--text);
}
.filter-option input[type="checkbox"] {
  width: 15px; height: 15px; accent-color: var(--accent); cursor: pointer;
}
.filter-option .count {
  margin-left: auto; font-size: 0.7rem; color: var(--muted);
}

.price-inputs {
  display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem;
  margin-top: 0.25rem;
}
.price-inputs input {
  border: 1px solid var(--border); border-radius: var(--r);
  padding: 0.4rem 0.5rem; font-size: 0.8rem; width: 100%; outline: none;
}
.price-inputs input:focus { border-color: var(--accent); }

.filter-apply {
  width: 100%; background: var(--accent); color: #fff; border: none;
  border-radius: var(--r); padding: 0.55rem;
  font-size: 0.8rem; font-weight: 600; cursor: pointer; margin-top: 0.65rem;
  transition: background 0.15s;
}
.filter-apply:hover { background: var(--blue); }

/* ── Listings area ───────────────────────────────────────────── */
.listings-area {}

.listings-toolbar {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 1rem; gap: 1rem;
}

.listings-count {
  font-size: 0.82rem; color: var(--muted);
}
.listings-count strong { color: var(--text); font-weight: 600; }

.toolbar-right { display: flex; align-items: center; gap: 0.5rem; }

.sort-select {
  border: 1px solid var(--border); border-radius: var(--r);
  padding: 0.4rem 0.65rem; font-size: 0.8rem; color: var(--text);
  background: var(--panel); outline: none; cursor: pointer;
}

.view-toggle { display: flex; border: 1px solid var(--border); border-radius: var(--r); overflow: hidden; }
.view-btn {
  background: var(--panel); border: none; padding: 0.4rem 0.65rem;
  font-size: 0.85rem; cursor: pointer; color: var(--muted); transition: all 0.12s;
}
.view-btn.active { background: var(--navy); color: #fff; }

/* ── Listing grid ────────────────────────────────────────────── */
.listing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
}

.listing-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--r2);
  overflow: hidden;
  transition: box-shadow 0.18s, transform 0.18s;
  display: flex; flex-direction: column;
}
.listing-card:hover {
  box-shadow: 0 6px 24px rgba(10,42,110,0.12);
  transform: translateY(-2px);
}

.card-img {
  width: 100%; aspect-ratio: 4/3; object-fit: cover;
  background: var(--base);
}

.card-img-placeholder {
  width: 100%; aspect-ratio: 4/3;
  background: linear-gradient(135deg, #e8eef5 0%, #d0dae8 100%);
  display: flex; align-items: center; justify-content: center;
  font-size: 2.5rem;
}

.card-body { padding: 0.85rem; flex: 1; display: flex; flex-direction: column; }

.card-meta {
  display: flex; align-items: center; gap: 0.5rem;
  margin-bottom: 0.45rem;
}

.type-badge {
  font-size: 0.62rem; font-weight: 700; padding: 0.18rem 0.5rem;
  border-radius: 3px; letter-spacing: 0.04em; text-transform: uppercase;
}
.type-physical { background: #dbeafe; color: #1e3a8a; }
.type-service  { background: #d1fae5; color: #065f46; }
.type-digital  { background: #ede9fe; color: #4c1d95; }

.verified-badge {
  font-size: 0.62rem; color: var(--success); font-weight: 600;
  display: flex; align-items: center; gap: 2px;
}

.card-org {
  font-size: 0.72rem; color: var(--muted); margin-left: auto;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100px;
}

.card-title {
  font-size: 0.9rem; font-weight: 600; line-height: 1.3;
  margin-bottom: 0.35rem; color: var(--text);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}

.card-desc {
  font-size: 0.78rem; color: var(--muted); line-height: 1.45;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  margin-bottom: 0.65rem; flex: 1;
}

.card-specs {
  display: flex; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 0.65rem;
}
.spec-tag {
  font-size: 0.68rem; background: var(--base);
  border: 1px solid var(--border); border-radius: 3px;
  padding: 0.18rem 0.45rem; color: var(--muted);
}

.card-footer {
  display: flex; align-items: center; justify-content: space-between;
  padding-top: 0.65rem; border-top: 1px solid var(--border); gap: 0.5rem;
}

.card-price {
  font-size: 0.82rem; color: var(--text); flex: 1;
}
.card-price strong {
  font-size: 1rem; font-weight: 700; color: var(--navy); display: block; line-height: 1.2;
}
.card-price span { font-size: 0.68rem; color: var(--muted); }

.btn-rfq {
  background: var(--accent); color: #fff; border: none;
  padding: 0.45rem 0.85rem; border-radius: var(--r);
  font-size: 0.75rem; font-weight: 700; cursor: pointer;
  white-space: nowrap; transition: background 0.15s;
  flex-shrink: 0;
}
.btn-rfq:hover { background: var(--blue); }
.btn-atc {
  background: var(--green, #16a34a); color: #fff; border: none;
  padding: 0.45rem 0.85rem; border-radius: var(--r);
  font-size: 0.75rem; font-weight: 700; cursor: pointer;
  white-space: nowrap; transition: background 0.15s;
  flex-shrink: 0;
}
.btn-atc:hover { background: #15803d; }
.btn-atc:disabled { background: #6b7280; cursor: default; }

/* ── List view ───────────────────────────────────────────────── */
.listing-list { display: flex; flex-direction: column; gap: 0.65rem; }

.list-card {
  background: var(--panel); border: 1px solid var(--border);
  border-radius: var(--r2); display: flex; gap: 0;
  overflow: hidden; transition: box-shadow 0.15s;
}
.list-card:hover { box-shadow: 0 4px 16px rgba(10,42,110,0.10); }

.list-card-img {
  width: 120px; flex-shrink: 0;
  background: linear-gradient(135deg, #e8eef5 0%, #d0dae8 100%);
  display: flex; align-items: center; justify-content: center;
  font-size: 2rem;
}

.list-card-body {
  flex: 1; padding: 0.85rem 1rem; display: flex; gap: 1rem; align-items: center;
}

.list-card-info { flex: 1; min-width: 0; }

.list-card-actions {
  display: flex; flex-direction: column; align-items: flex-end;
  gap: 0.5rem; flex-shrink: 0;
}

/* ── Seller spotlight ────────────────────────────────────────── */
.spotlight-wrap {
  max-width: 1280px; margin: auto;
  padding: 0 1.5rem 2rem;
}
.spotlight-title {
  font-size: 0.72rem; font-weight: 700; color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.05em;
  margin-bottom: 1rem;
}
.seller-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.75rem;
}
.seller-card {
  background: var(--panel); border: 1px solid var(--border);
  border-radius: var(--r2); padding: 1rem; text-align: center;
  transition: box-shadow 0.15s; cursor: pointer;
}
.seller-card:hover { box-shadow: var(--sh); }
.seller-logo {
  width: 52px; height: 52px; border-radius: 50%;
  background: var(--navy); margin: 0 auto 0.65rem;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem; font-weight: 700; color: #fff;
}
.seller-name { font-size: 0.85rem; font-weight: 600; color: var(--text); margin-bottom: 0.2rem; }
.seller-meta { font-size: 0.7rem; color: var(--muted); margin-bottom: 0.5rem; }
.seller-stars { color: var(--warning); font-size: 0.8rem; }

/* ── Rating stars ───────────────────────────────────────────── */
.stars { color: var(--warning); font-size: 0.72rem; letter-spacing: 0.05em; }

/* ── Empty state ─────────────────────────────────────────────── */
.empty-state {
  text-align: center; padding: 3rem 1rem;
  color: var(--muted); grid-column: 1/-1;
}
.empty-state .icon { font-size: 3rem; margin-bottom: 0.75rem; }
.empty-state p { font-size: 0.9rem; }

/* ── Pagination ──────────────────────────────────────────────── */
.pagination {
  display: flex; justify-content: center; align-items: center;
  gap: 0.35rem; padding: 2rem 0;
}
.page-btn {
  width: 34px; height: 34px; border-radius: var(--r);
  border: 1px solid var(--border); background: var(--panel);
  font-size: 0.82rem; color: var(--muted); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.12s;
}
.page-btn:hover { border-color: var(--accent); color: var(--accent); }
.page-btn.active { background: var(--navy); color: #fff; border-color: var(--navy); }

/* ── Footer ──────────────────────────────────────────────────── */
.site-footer {
  background: var(--navy);
  padding: 1rem 1.5rem calc(1rem + env(safe-area-inset-bottom, 0px));
  margin-top: 2rem;
}
.footer-inner {
  max-width: 1280px; margin: auto;
  display: flex; justify-content: space-between; align-items: center;
  gap: 1rem; flex-wrap: wrap;
}
/* ── Footer rows ────────────────────────────────────────────── */
.footer-inner { display: flex; flex-direction: column; gap: 0.9rem; }

.footer-row { display: flex; align-items: center; }

/* Row 1: logo left · nav centre · socials right */
.footer-row-top {
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

/* Row 2: copyright centred */
.footer-row-bottom {
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding-top: 0.6rem;
  border-top: 1px solid rgba(255,255,255,0.08);
  font-size: 0.72rem;
  color: rgba(255,255,255,0.4);
}

.footer-brand { line-height: 0; flex-shrink: 0; }
.footer-brand img {
  display: block; height: 24px; width: auto; max-width: 120px;
  filter: brightness(0) invert(1);
  opacity: 0.7;
}

.footer-links { display: flex; gap: 1.25rem; flex-wrap: wrap; }
.footer-links a { color: rgba(255,255,255,0.5); font-size: 0.78rem; transition: color 0.12s; text-decoration: none; }
.footer-links a:hover { color: #fff; }

.footer-socials { display: flex; gap: 0.9rem; align-items: center; flex-shrink: 0; }
.footer-socials a {
  color: rgba(255,255,255,0.5);   /* same tone as nav links */
  display: flex; align-items: center;
  transition: color 0.15s, transform 0.15s;
}
.footer-socials a:hover { color: #fff; transform: translateY(-2px); }

.footer-tel { color: rgba(255,255,255,0.5); text-decoration: none; transition: color 0.15s; font-size: 0.78rem; }
.footer-tel:hover { color: #fff; }
.footer-sep { opacity: 0.3; }

/* ── Modal overlay (RFQ) ─────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(10,26,80,0.55);
  z-index: 500; display: flex; align-items: center; justify-content: center;
  padding: 1rem; opacity: 0; pointer-events: none; transition: opacity 0.2s;
}
.modal-overlay.open { opacity: 1; pointer-events: all; }

.modal {
  background: var(--panel); border-radius: var(--r2);
  width: 100%; max-width: 520px; max-height: 90vh; overflow-y: auto;
  box-shadow: 0 16px 48px rgba(0,0,0,0.25);
  transform: translateY(12px); transition: transform 0.2s;
}
.modal-overlay.open .modal { transform: translateY(0); }

.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1.1rem 1.25rem; border-bottom: 1px solid var(--border);
}
.modal-header h3 { font-size: 1rem; font-weight: 700; color: var(--navy); }
.modal-close {
  background: none; border: none; font-size: 1.2rem; cursor: pointer;
  color: var(--muted); line-height: 1; padding: 0.25rem;
}

.modal-body { padding: 1.25rem; }

.mfield { margin-bottom: 1rem; }
.mfield label {
  display: block; font-size: 0.72rem; font-weight: 600; color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 0.3rem;
}
.mfield input, .mfield select, .mfield textarea {
  width: 100%; border: 1px solid var(--border); border-radius: var(--r);
  padding: 0.55rem 0.75rem; font-size: 0.875rem; color: var(--text);
  background: var(--base); outline: none; transition: border-color 0.15s;
}
.mfield input:focus, .mfield select:focus, .mfield textarea:focus { border-color: var(--accent); }
.mfield textarea { resize: vertical; min-height: 80px; font-family: inherit; }
.mfield-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }

.modal-footer {
  padding: 1rem 1.25rem; border-top: 1px solid var(--border);
  display: flex; gap: 0.65rem; justify-content: flex-end;
}
.btn-cancel {
  background: var(--base); border: 1px solid var(--border);
  color: var(--muted); border-radius: var(--r);
  padding: 0.55rem 1.1rem; font-size: 0.82rem; font-weight: 600;
  cursor: pointer; transition: border-color 0.15s;
}
.btn-cancel:hover { border-color: var(--accent); color: var(--accent); }
.btn-submit {
  background: var(--accent); color: #fff; border: none;
  border-radius: var(--r); padding: 0.55rem 1.4rem;
  font-size: 0.82rem; font-weight: 700; cursor: pointer;
  transition: background 0.15s;
}
.btn-submit:hover { background: var(--blue); }

/* ── Toast ───────────────────────────────────────────────────── */
.toast {
  position: fixed; bottom: 1.5rem; right: 1.5rem;
  background: var(--navy); color: #fff;
  padding: 0.7rem 1.1rem; border-radius: var(--r);
  font-size: 0.82rem; box-shadow: 0 4px 16px rgba(10,42,110,0.2);
  z-index: 9999; opacity: 0; transform: translateY(8px);
  transition: opacity 0.2s, transform 0.2s; pointer-events: none; max-width: 320px;
}
.toast.show { opacity: 1; transform: translateY(0); }

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 900px) {
  .main-wrap { grid-template-columns: 1fr; }
  .sidebar { position: static; display: none; }
  .listing-grid { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
}
@media (max-width: 600px) {
  .header-inner { gap: 0.75rem; }
  .header-search { display: none; }
  .nav-link { display: none; }
  .hero { padding: 1.25rem 1rem 1rem; }
  .hero-stats { gap: 1rem; }
  .main-wrap { padding: 1rem; }
  .list-card-img { width: 80px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ── Quick Sale strip ─────────────────────────────────────────────── */
.qs-section {
  background: var(--base);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 0.65rem 0; margin: 0;
}
.qs-inner {
  max-width: 1280px; margin: 0 auto; padding: 0 1.5rem;
}
.qs-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 0.6rem;
}
.qs-title {
  display: flex; align-items: center; gap: 0.65rem;
  font-size: 0.85rem; font-weight: 800; color: var(--navy); letter-spacing: 0.01em;
}
.qs-badge {
  background: #ff3b30; color: #fff;
  font-size: 0.65rem; font-weight: 800; padding: 0.2rem 0.55rem;
  border-radius: 4px; letter-spacing: 0.06em; animation: qs-pulse 1.5s ease-in-out infinite;
}
@keyframes qs-pulse {
  0%,100% { opacity: 1; } 50% { opacity: 0.6; }
}
.qs-countdown {
  font-size: 0.72rem; color: var(--muted);
  display: flex; align-items: center; gap: 0.35rem;
}
.qs-time {
  background: #e8eef5; border-radius: 4px;
  padding: 0.12rem 0.4rem; font-weight: 700; font-variant-numeric: tabular-nums;
  color: var(--navy); font-size: 0.78rem;
}

.qs-scroller {
  position: relative; display: flex; align-items: center; gap: 0.5rem;
}
.qs-scroll-btn {
  flex-shrink: 0; width: 32px; height: 32px; border-radius: 50%;
  background: #fff; border: 1.5px solid var(--border);
  font-size: 1.1rem; line-height: 1; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: var(--navy); transition: all 0.15s; box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}
.qs-scroll-btn:hover { background: var(--navy); color: #fff; border-color: var(--navy); }
.qs-rail {
  display: flex; gap: 0.85rem; overflow-x: auto; padding-bottom: 0.25rem;
  scroll-behavior: smooth; scroll-snap-type: x mandatory;
  scrollbar-width: none; flex: 1;
}
.qs-rail::-webkit-scrollbar { display: none; }

.qs-card {
  background: var(--panel); border: 1px solid var(--border);
  border-radius: var(--r2); min-width: 190px; flex-shrink: 0; padding: 0.75rem;
  cursor: pointer; transition: box-shadow 0.15s, transform 0.15s;
  position: relative; overflow: hidden; scroll-snap-align: start;
}
.qs-card:hover { box-shadow: 0 4px 12px rgba(10,42,110,0.1); transform: translateY(-2px); }
.qs-discount {
  position: absolute; top: 0.6rem; right: 0.6rem;
  background: #ff3b30; color: #fff;
  font-size: 0.68rem; font-weight: 800; padding: 0.15rem 0.45rem;
  border-radius: 4px; letter-spacing: 0.02em;
}
.qs-emoji { font-size: 1.6rem; margin-bottom: 0.45rem; }
.qs-img {
  display: block; width: 100%; height: 84px; object-fit: cover;
  border-radius: 6px; margin-bottom: 0.5rem; background: var(--border);
}
.qs-name {
  font-size: 0.8rem; font-weight: 700; color: var(--text);
  margin-bottom: 0.2rem; line-height: 1.3;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.qs-seller { font-size: 0.68rem; color: var(--muted); margin-bottom: 0.5rem; }
.qs-prices { display: flex; align-items: baseline; gap: 0.4rem; }
.qs-sale-price { font-size: 0.95rem; font-weight: 800; color: var(--navy); }
.qs-orig-price {
  font-size: 0.7rem; color: var(--muted);
  text-decoration: line-through;
}
.qs-unit { font-size: 0.67rem; color: var(--muted); margin-top: 0.1rem; }
.qs-cta {
  margin-top: 0.6rem; width: 100%;
  background: var(--base); border: 1px solid var(--border);
  color: var(--accent); border-radius: 6px; padding: 0.35rem 0;
  font-size: 0.72rem; font-weight: 700; cursor: pointer;
  transition: background 0.12s, border-color 0.12s; font-family: inherit; letter-spacing: 0.02em;
}
.qs-cta:hover { background: var(--accent); color: #fff; border-color: var(--accent); }
.qs-empty {
  color: rgba(255,255,255,0.5); font-size: 0.82rem; padding: 0.5rem 0;
}
/* ── Category rows (discovery layout) ───────────────────────────── */
#cat-rows-section {
  background: var(--base);
  padding: 0.5rem 0 1.5rem;
  border-bottom: 1px solid var(--border);
}
.cat-rows-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}
.cr-row { }
.cr-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.85rem;
}
.cr-emoji { font-size: 1.2rem; line-height: 1; }
.cr-cat-name {
  font-size: 1rem;
  font-weight: 700;
  color: var(--navy);
  flex: 1;
}
.cr-see-all {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.25rem 0.5rem;
  border-radius: 6px;
  transition: background 0.12s;
  font-family: inherit;
}
.cr-see-all:hover { background: rgba(217,119,6,0.08); }

.cr-rail {
  display: flex;
  gap: 0.85rem;
  overflow-x: auto;
  padding-bottom: 0.5rem;
  scroll-behavior: smooth;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}
.cr-rail::-webkit-scrollbar { display: none; }

.cr-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  min-width: 200px;
  max-width: 200px;
  flex-shrink: 0;
  cursor: pointer;
  overflow: hidden;
  transition: box-shadow 0.15s, transform 0.15s;
  scroll-snap-align: start;
}
.cr-card:hover {
  box-shadow: 0 6px 16px rgba(10,42,110,0.1);
  transform: translateY(-2px);
}
.cr-img {
  width: 100%;
  aspect-ratio: 4/3;
  overflow: hidden;
}
.cr-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.cr-img-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  background: linear-gradient(135deg, #e8eef5 0%, #f5f8fc 100%);
}
.cr-body {
  padding: 0.7rem 0.75rem 0.8rem;
}
.cr-org {
  font-size: 0.68rem;
  color: var(--muted);
  margin-bottom: 0.2rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cr-vtick {
  color: #22c55e;
  font-size: 0.65rem;
  font-weight: 700;
}
.cr-title {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 0.4rem;
}
.cr-price {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--navy);
}

@media (max-width: 640px) {
  .cr-card { min-width: 160px; max-width: 160px; }
  .cat-rows-inner { padding: 0 0.85rem; }
}

/* ── Spec chips (on listing cards) ───────────────────────────────── */
.spec-chip {
  cursor: pointer;
  font-family: inherit;
  transition: background 0.12s, color 0.12s, border-color 0.12s;
}
.spec-chip:hover {
  background: var(--navy);
  color: #fff;
  border-color: var(--navy);
}
.spec-chip.spec-active,
.spec-filter-chip.spec-active {
  background: var(--accent) !important;
  color: #fff !important;
  border-color: var(--accent) !important;
}

/* ── Sidebar spec filter chips ───────────────────────────────────── */
.spec-filter-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  padding-top: 0.25rem;
}
.spec-filter-chip {
  font-family: inherit;
  font-size: 0.75rem;
  padding: 0.25rem 0.6rem;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: var(--base);
  color: var(--text);
  cursor: pointer;
  transition: background 0.12s, color 0.12s, border-color 0.12s;
  display: flex;
  align-items: center;
  gap: 0.3rem;
  white-space: nowrap;
}
.spec-filter-chip:hover {
  border-color: var(--navy);
  background: var(--navy);
  color: #fff;
}
.spec-count {
  font-size: 0.67rem;
  opacity: 0.65;
}
