
/* ══════════════════════════════════════════════════════════
   TTDX PREMIUM BROWSE — Horizontal pills on all devices
══════════════════════════════════════════════════════════ */
:root {
  --primary:  #0077ff;
  --primary-dark: #0063db;
  --primary-light: rgba(0, 119, 255, 0.4);
  --primary-glow: rgba(0, 119, 255, 0.25);
  --navy: #0D1B2A;
  --slate: #1B2B3D;
  --ink: #1a1a2e;
  --muted: #6B7A8D;
  --light: #F4F6FA;
  --white: #ffffff;
  --border: rgba(0,0,0,0.07);
  --border-strong: rgba(0,0,0,0.12);
  --card-shadow: 0 2px 16px rgba(0,0,0,0.07), 0 0 0 1px rgba(0,0,0,0.04);
  --card-shadow-hover: 0 16px 48px rgba(0,0,0,0.14), 0 0 0 1px rgba(0, 119, 255, 0.12);
  --radius: 20px;
  --radius-sm: 12px;
  --radius-xs: 8px;
  --ff-head: 'Outfit', sans-serif;
  --ff-body: 'DM Sans', sans-serif;
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: var(--ff-body);
  background: var(--light);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}

/* ── PAGE WRAPPER ── */
.browse-wrapper {
  max-width: 1360px;
  margin: 0 auto;
  padding: 0 24px 80px;
}

/* ── HERO SEARCH STRIP ── */
.browse-hero {
  background: linear-gradient(135deg, var(--navy) 0%, var(--slate) 60%, #1e3a5f 100%);
  padding: 40px 0 0;
  margin-bottom: 0;
  position: relative;
  overflow: hidden;
}
.browse-hero::before {
  content: '';
  position: absolute;
  top: -60px; right: -60px;
  width: 380px; height: 380px;
  background: radial-gradient(circle, var(--primary-glow) 0%, transparent 70%);
  pointer-events: none;
}
.browse-hero::after {
  content: '';
  position: absolute;
  bottom: -40px; left: 10%;
  width: 280px; height: 280px;
  background: radial-gradient(circle, rgba(255,107,53,0.12) 0%, transparent 70%);
  pointer-events: none;
}
.hero-inner {
  max-width: 1360px;
  margin: 0 auto;
  padding: 0 24px 32px;
  position: relative;
  z-index: 1;
}
.hero-label {
  font-family: var(--ff-head);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--primary);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.hero-label::before {
  content: '';
  display: block;
  width: 20px;
  height: 2px;
  background: var(--primary);
  border-radius: 2px;
}
.hero-title {
  font-family: var(--ff-head);
  font-size: clamp(26px, 4vw, 42px);
  font-weight: 800;
  color: var(--white);
  line-height: 1.15;
  margin-bottom: 24px;
}
.hero-title span {
  background: linear-gradient(90deg, var(--primary), #ff9a5a);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero-search-box {
  display: flex;
  background: var(--white);
  border-radius: 60px;
  overflow: hidden;
  box-shadow: 0 8px 40px rgba(0,0,0,0.3);
  max-width: 720px;
}
.hero-search-box input[type="text"] {
  flex: 1;
  border: none;
  outline: none;
  padding: 16px 24px;
  font-family: var(--ff-body);
  font-size: 15px;
  color: var(--ink);
  background: transparent;
}
.hero-search-box input::placeholder { color: #aaa; }
.hero-search-box button {
  background: var(--primary);
  border: none;
  color: white;
  padding: 0 28px;
  font-family: var(--ff-head);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
  border-radius: 0 60px 60px 0;
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}
.hero-search-box button:hover { background: var(--primary-dark); }

/* ── FILTER TOP BAR (horizontal pills, visible on all devices) ── */
.filter-top-bar {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 4px 20px rgba(0,0,0,0.06);
  position: sticky;
  top: 0;
  z-index: 200;
}
.filter-bar-inner {
  max-width: 1360px;
  margin: 0 auto;
  padding: 0 24px;
  position: relative;
}
.filter-scroll {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 12px 0;
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
}
.filter-scroll::-webkit-scrollbar { height: 4px; }
.filter-scroll::-webkit-scrollbar-track { background: #e0e0e5; border-radius: 4px; }
.filter-scroll::-webkit-scrollbar-thumb { background: var(--primary); border-radius: 4px; }

.filter-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 16px;
  border-radius: 60px;
  border: 1.5px solid var(--border-strong);
  background: var(--white);
  font-family: var(--ff-body);
  font-size: 13px;
  font-weight: 500;
  color: var(--ink);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.18s;
  user-select: none;
  flex-shrink: 0;
}
.filter-pill:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-light);
}
.filter-pill.active {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
  box-shadow: 0 4px 14px var(--primary-glow);
}
.filter-pill .pill-icon { width: 16px; font-size: 12px; }
.filter-pill .pill-chevron { font-size: 10px; opacity: 0.6; transition: transform 0.2s; }
.filter-pill.active .pill-chevron { transform: rotate(180deg); }
.filter-pill .pill-badge {
  background: white;
  color: var(--primary);
  border-radius: 50%;
  width: 18px; height: 18px;
  font-size: 10px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Dropdown panel overlay */
.filter-panel-overlay {
  position: fixed;
  inset: 0;
  z-index: 198;
  display: none;
}
.filter-panel-overlay.show { display: block; }

.filter-panel {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 199;
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: 0 20px 60px rgba(0,0,0,0.16), 0 0 0 1px var(--border);
  padding: 22px;
  min-width: 280px;
  max-width: 340px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px) scale(0.98);
  transform-origin: top left;
  transition: opacity 0.18s ease, transform 0.18s ease, visibility 0s linear 0.18s;
  pointer-events: none;
}
.filter-panel.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
  transition: opacity 0.18s ease, transform 0.18s ease;
  pointer-events: auto;
}
.panel-title {
  font-family: var(--ff-head);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 12px;
}
.panel-section { margin-bottom: 18px; }
.panel-section:last-of-type { margin-bottom: 0; }
.panel-input {
  width: 100%;
  padding: 9px 14px;
  border: 1.5px solid var(--border-strong);
  border-radius: var(--radius-sm);
  font-family: var(--ff-body);
  font-size: 13px;
  color: var(--ink);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  background: var(--white);
}
.panel-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}
.price-inputs { display: flex; gap: 10px; }
.price-inputs .panel-input { flex: 1; }
.check-list { display: flex; flex-direction: column; gap: 8px; }
.check-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: var(--radius-xs);
  border: 1.5px solid var(--border);
  cursor: pointer;
  transition: all 0.15s;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink);
}
.check-item:hover { border-color: var(--primary); background: var(--primary-light); }
.check-item input[type="checkbox"] { display: none; }
.check-box {
  width: 18px; height: 18px;
  border-radius: 5px;
  border: 2px solid var(--border-strong);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
  flex-shrink: 0;
}
.check-item input:checked ~ .check-box {
  background: var(--primary);
  border-color: var(--primary);
}
.check-item input:checked ~ .check-box::after {
  content: '✓';
  color: white;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
}
.check-item input:checked ~ span { color: var(--primary); font-weight: 600; }
.panel-apply {
  width: 100%;
  padding: 11px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 60px;
  font-family: var(--ff-head);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  margin-top: 16px;
  transition: all 0.18s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.panel-apply:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px var(--primary-glow);
}

/* Results topbar */
.results-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
  flex-wrap: wrap;
  padding-top: 28px;
}
.results-count-pill {
  font-family: var(--ff-head);
  font-size: 14px;
  font-weight: 600;
  background: var(--white);
  padding: 8px 20px;
  border-radius: 60px;
  box-shadow: var(--card-shadow);
  display: flex;
  align-items: center;
  gap: 8px;
}
.results-count-pill strong { color: var(--primary); }
.sort-form { display: flex; align-items: center; gap: 8px; }
.sort-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  white-space: nowrap;
}
.sort-select {
  padding: 9px 18px;
  border-radius: 60px;
  border: 1.5px solid var(--border-strong);
  background: var(--white);
  font-family: var(--ff-body);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
}
/* Active tags */
.active-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
}
.active-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  background: var(--primary-light);
  color: var(--primary);
  border-radius: 60px;
  font-size: 12px;
  font-weight: 600;
  border: 1px solid rgba(255,107,53,0.2);
}
.active-tag a {
  color: var(--primary);
  text-decoration: none;
  opacity: 0.7;
  font-size: 14px;
}
.active-tag a:hover { opacity: 1; }
.clear-all-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 14px;
  background: transparent;
  color: var(--muted);
  border-radius: 60px;
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  border: 1.5px solid var(--border-strong);
}
.clear-all-btn:hover { color: var(--primary); border-color: var(--primary); }

/* Product grid – minimum 2 columns on mobile */
.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 20px;
}
@media (max-width: 640px) {
  .products-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }
}
@media (max-width: 400px) {
  .products-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Product card (same as before) */
.product-card {
  background: var(--white);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--card-shadow);
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  transition: transform 0.22s cubic-bezier(0.4,0,0.2,1), box-shadow 0.22s;
  position: relative;
}
.product-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--card-shadow-hover);
}
.card-wishlist {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  width: 34px; height: 34px;
  border-radius: 50%;
  background: rgba(255,255,255,0.85);
  backdrop-filter: blur(4px);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  color: var(--muted);
  transition: all 0.15s;
  text-decoration: none;
}
.card-wishlist:hover { background: white; color: #e74c3c; transform: scale(1.1); }
.card-image {
  aspect-ratio: 4/3;
  overflow: hidden;
  background: linear-gradient(135deg, #e8ecf0, #d0d6de);
  position: relative;
  flex-shrink: 0;
}
.card-image img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 0.35s cubic-bezier(0.4,0,0.2,1);
}
.product-card:hover .card-image img { transform: scale(1.07); }
.card-image-placeholder {
  width: 100%; height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #e8ecf0, #d0d6de);
  font-size: 40px;
  opacity: 0.4;
}
.card-badges {
  position: absolute;
  top: 12px; left: 12px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.badge {
  padding: 4px 10px;
  border-radius: 60px;
  font-family: var(--ff-head);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  backdrop-filter: blur(6px);
}
.badge-featured { background: linear-gradient(135deg, #f59e0b, #f97316); color: white; }
.badge-new      { background: linear-gradient(135deg, #3b82f6, #2563eb); color: white; }
.badge-used     { background: rgba(100,116,139,0.85); color: white; }
.badge-refurb   { background: linear-gradient(135deg, #8b5cf6, #7c3aed); color: white; }
.card-price-ribbon {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.55), transparent);
  padding: 28px 14px 12px;
  color: white;
}
.ribbon-price {
  font-family: var(--ff-head);
  font-size: 20px;
  font-weight: 800;
  line-height: 1;
}
.ribbon-neg {
  font-size: 11px;
  font-weight: 600;
  color: #6ee7b7;
  margin-top: 2px;
}
.card-body {
  padding: 14px 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}
.card-title {
  font-family: var(--ff-head);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
}
.card-location {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  color: var(--muted);
  font-weight: 500;
}
.card-location i { color: var(--primary); font-size: 10px; }
.card-time {
  font-size: 11px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 4px;
}
.card-seller {
  font-size: 11px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 5px;
  font-weight: 500;
  border-top: 1px solid var(--border);
  padding-top: 8px;
  margin-top: 4px;
}
.seller-dot {
  width: 20px; height: 20px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), #ff9a5a);
  color: white;
  font-family: var(--ff-head);
  font-size: 10px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
/* Mobile-specific styles for product cards and grid (2 ads per line) */
@media (max-width: 640px) {
  .product-card {
    border-radius: 12px;
  }
  .card-badges .badge {
    font-size: 8px;
    padding: 2px 6px;
  }
  .card-price-ribbon {
    padding: 14px 8px 6px;
  }
  .ribbon-price {
    font-size: 14px;
  }
  .ribbon-neg {
    font-size: 9px;
  }
  .card-body {
    padding: 6px 8px;
    gap: 4px;
  }
  .card-title {
    font-size: 12px;
  }
  .card-meta-row {
    font-size: 10px;
  }
  .card-location, .card-time, .card-seller {
    font-size: 9px;
  }
  .seller-dot {
    width: 14px; height: 14px;
    font-size: 7px;
  }
  .card-wishlist {
    width: 26px; height: 26px;
    font-size: 10px;
  }
}
.empty-state {
  text-align: center;
  padding: 80px 24px;
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--card-shadow);
}
.empty-icon { font-size: 64px; margin-bottom: 20px; display: block; }
.empty-title { font-family: var(--ff-head); font-size: 22px; font-weight: 700; margin-bottom: 10px; }
.empty-sub { color: var(--muted); font-size: 15px; margin-bottom: 28px; }
.btn-browse-all {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--primary);
  color: white;
  padding: 12px 28px;
  border-radius: 60px;
  text-decoration: none;
  font-family: var(--ff-head);
  font-weight: 600;
  font-size: 14px;
  transition: all 0.18s;
  box-shadow: 0 6px 20px var(--primary-glow);
}
.btn-browse-all:hover { background: var(--primary-dark); transform: translateY(-2px); }
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 48px;
}
.pag-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--white);
  border: 1.5px solid var(--border-strong);
  text-decoration: none;
  color: var(--ink);
  font-family: var(--ff-head);
  font-size: 13px;
  font-weight: 600;
  transition: all 0.15s;
}
.pag-btn:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-light); }
.pag-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
  box-shadow: 0 4px 12px var(--primary-glow);
}
/* Responsive: always show filter bar, no drawer */
@media (max-width: 900px) {
  .filter-top-bar { display: block; }
  .hero-title { font-size: 22px; }
}
@media (max-width: 640px) {
  .browse-wrapper { padding: 0 16px 60px; }
  .hero-inner { padding: 0 16px 24px; }
  .results-topbar { padding-top: 20px; }
  .sort-label { display: none; }
  .filter-bar-inner { padding: 0 16px; }
}
/* Fade-in animation */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}
.products-grid .product-card {
  animation: fadeUp 0.4s ease both;
}
