/* ═══════════════════════════════════════════════
   GearLink — Browse / Listings Page Styles
   ═══════════════════════════════════════════════ */

/* ── PAGE HEADER ── */
.page-hero {
  background: linear-gradient(135deg, var(--blue) 0%, #0a3f74 100%);
  padding: 120px 5vw 4rem;
  position: relative; overflow: hidden;
}
.page-hero::after {
  content: '';
  position: absolute; bottom: -1px; left: 0; right: 0;
  height: 60px;
  background: #fff;
  clip-path: ellipse(55% 100% at 50% 100%);
}
.page-hero h1 { color: #fff; font-size: clamp(2rem,4vw,3rem); margin-bottom: .6rem; }
.page-hero p  { color: rgba(255,255,255,.7); font-size: 1.05rem; }

/* ── BROWSE LAYOUT ── */
.browse-layout {
  display: grid; grid-template-columns: 280px 1fr;
  gap: 2.5rem; padding: 3rem 5vw;
  max-width: 1400px; margin: 0 auto;
}

/* ── SIDEBAR FILTERS ── */
.sidebar { align-self: start; position: sticky; top: 88px; }

.filter-card {
  background: #fff; border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 1.5rem;
  margin-bottom: 1.2rem;
}
.filter-card h3 {
  font-family: var(--font-display); font-weight: 700;
  font-size: .95rem; color: var(--dark);
  margin-bottom: 1rem; padding-bottom: .6rem;
  border-bottom: 1px solid var(--border);
}

.filter-group { margin-bottom: .6rem; }
.filter-group label {
  display: flex; align-items: center; gap: .6rem;
  font-size: .9rem; color: var(--text); cursor: pointer;
  padding: .3rem 0;
}
.filter-group input[type="checkbox"] {
  width: 16px; height: 16px; accent-color: var(--teal);
}
.filter-group input[type="range"] {
  width: 100%; accent-color: var(--teal); margin-top: .4rem;
}
.range-labels {
  display: flex; justify-content: space-between;
  font-size: .78rem; color: var(--muted); margin-top: .3rem;
}

.clear-filters {
  width: 100%; padding: .6rem; border-radius: var(--radius-sm);
  border: 1.5px solid var(--border); background: none;
  font-size: .85rem; color: var(--muted); cursor: pointer;
  transition: all .2s; margin-top: .5rem;
}
.clear-filters:hover { border-color: var(--error); color: var(--error); }

/* ── LISTINGS AREA ── */
.listings-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 1.5rem; flex-wrap: wrap; gap: 1rem;
}
.listings-count { font-size: .9rem; color: var(--muted); }
.listings-count strong { color: var(--dark); font-family: var(--font-display); }

.sort-select {
  padding: .5rem 1rem; border: 1.5px solid var(--border);
  border-radius: var(--radius-sm); font-size: .88rem;
  outline: none; background: #fff; color: var(--text);
  transition: border-color .2s;
}
.sort-select:focus { border-color: var(--teal); }

.view-toggle { display: flex; gap: .4rem; }
.view-btn {
  width: 36px; height: 36px; border-radius: 8px;
  border: 1.5px solid var(--border); background: #fff;
  font-size: 1rem; cursor: pointer; transition: all .2s;
  display: flex; align-items: center; justify-content: center;
}
.view-btn.active { background: var(--teal); border-color: var(--teal); color: #fff; }

/* List view */
.listings-grid.list-view {
  grid-template-columns: 1fr;
}
.listings-grid.list-view .listing-card {
  display: grid; grid-template-columns: 200px 1fr;
}
.listings-grid.list-view .listing-img { height: 100%; min-height: 140px; }

/* ── DB TABLE VIEW ── */
.db-section { background: var(--cream); }

.table-toolbar {
  display: flex; gap: 1rem; margin-bottom: 1.5rem; flex-wrap: wrap; align-items: center;
}
.table-toolbar input,
.table-toolbar select {
  padding: .7rem 1rem; border: 1.5px solid var(--border);
  border-radius: var(--radius-sm); font-size: .9rem; outline: none;
  transition: border-color .2s; background: #fff;
}
.table-toolbar input { flex: 1; min-width: 200px; }
.table-toolbar input:focus,
.table-toolbar select:focus { border-color: var(--teal); }

.table-wrapper {
  overflow-x: auto; border-radius: var(--radius-md);
  border: 1px solid var(--border);
  box-shadow: 0 4px 24px rgba(12,77,139,.06);
}

table { width: 100%; border-collapse: collapse; background: #fff; font-size: .88rem; }

thead { background: var(--blue); }
thead th {
  color: #fff; padding: .9rem 1.2rem;
  font-family: var(--font-display); font-weight: 700;
  text-align: left; white-space: nowrap;
  cursor: pointer; user-select: none;
}
thead th:hover { background: var(--blue-dark); }
thead th .sort-arrow { margin-left: .3rem; opacity: .5; }
thead th.sorted .sort-arrow { opacity: 1; }

tbody tr { border-bottom: 1px solid var(--border); transition: background .2s; }
tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: var(--teal-light); }
tbody td { padding: .85rem 1.2rem; color: var(--text); vertical-align: middle; }

.table-item-cell { display: flex; align-items: center; gap: .7rem; }
.table-item-icon { font-size: 1.4rem; }
.table-item-name { font-weight: 600; color: var(--dark); }
.table-item-cat  { font-size: .75rem; color: var(--muted); }

/* ── RESPONSIVE ── */
@media (max-width: 900px) {
  .browse-layout { grid-template-columns: 1fr; }
  .sidebar { position: static; }
}
@media (max-width: 600px) {
  .listings-grid.list-view .listing-card { grid-template-columns: 1fr; }
}
