/**
 * Listing archive and search results: filter sidebar, toolbar, grid.
 * (Moved from the inline <style> block in archive.php, search.php.)
 */

:root {
  --forest:     #1b4332;
  --leaf:       #2d6a4f;
  --vibrant:    #40916c;
  --mint:       #d8f3dc;
  --pale:       #f0faf2;
  --text-dark:  #0d1f17;
  --text-mid:   #3a5244;
  --text-light: #6b8f7a;
  --border:     #e0ede5;
  --white:      #ffffff;
  --gold:       #f59e0b;
}

/* ── Hero ── */
.listing-hero {
  position: relative; min-height: 200px; display: flex; align-items: center;
  background:
    linear-gradient(160deg, rgba(10,40,20,.82) 0%, rgba(27,67,50,.75) 100%),
    url('../../imgs/hero-bg.webp') center/cover no-repeat;
}
.listing-hero h1 {
  font-family: 'Playfair Display', serif;
  font-size: clamp(1.7rem, 3.5vw, 2.4rem); font-weight: 900;
  color: #fff; margin-bottom: 8px; letter-spacing: -.4px;
}
.listing-hero p { color: rgba(255,255,255,.68); font-size: .9rem; margin: 0; }

/* ══ SIDEBAR ══ */
.listing-sidebar-filter {
  background: var(--white); border-radius: 14px;
  border: 1.5px solid var(--border); overflow: hidden;
  position: sticky; top: 20px;
}
.sidebar-filter-head {
  background: var(--forest); padding: 15px 20px;
  display: flex; align-items: center; justify-content: space-between;
}
.sidebar-filter-head h5 {
  font-family: 'Playfair Display', serif; font-size: .95rem; font-weight: 700;
  color: #fff; margin: 0; display: flex; align-items: center; gap: 8px;
}
.sidebar-filter-head h5 i { color: #74c69d; font-size: .88rem; }
.btn-clear-all {
  font-size: .72rem; color: rgba(255,255,255,.55); background: none;
  border: none; cursor: pointer; font-family: 'DM Sans', sans-serif;
  transition: color .2s; padding: 0;
}
.btn-clear-all:hover { color: #74c69d; }

.sidebar-inner { padding: 16px 18px; }

.filter-box {
  padding-bottom: 16px; margin-bottom: 16px;
  border-bottom: 1.5px solid var(--mint);
}
.filter-box:last-of-type { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }

.filter-title {
  font-size: .72rem; font-weight: 700; letter-spacing: 1.5px;
  text-transform: uppercase; color: var(--text-mid); margin-bottom: 12px;
  display: flex; align-items: center; gap: 7px;
}
.filter-title::before {
  content: ''; width: 3px; height: 13px; border-radius: 2px;
  background: var(--vibrant); display: block; flex-shrink: 0;
}

/* Business type */
.btype-wrap { display: flex; gap: 8px; }
.btype-wrap label {
  flex: 1; border: 1.5px solid var(--border); border-radius: 9px;
  padding: 9px 8px; cursor: pointer; transition: all .18s;
  display: flex; align-items: center; justify-content: center; gap: 6px;
  font-size: .82rem; font-weight: 600; color: var(--text-mid); background: #fafcfb;
}
.btype-wrap label:has(input:checked) {
  border-color: var(--vibrant); background: var(--mint); color: var(--forest);
  box-shadow: 0 0 0 2px rgba(64,145,108,.1);
}
.btype-wrap label input { display: none; }

/* Scrollable lists */
.filter-scroll { max-height: 190px; overflow-y: auto; padding-right: 4px; }
.filter-scroll::-webkit-scrollbar { width: 3px; }
.filter-scroll::-webkit-scrollbar-track { background: var(--pale); border-radius: 4px; }
.filter-scroll::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
.filter-scroll::-webkit-scrollbar-thumb:hover { background: var(--vibrant); }
.filter-check:hover span { color: var(--forest); }
.filter-check input[type="checkbox"] {
  width: 15px; height: 15px; accent-color: var(--forest); flex-shrink: 0; cursor: pointer;
}
.filter-check span { font-size: .84rem; color: var(--text-mid); line-height: 1.3; }

/* Rating */
.rating-option {
  display: flex; align-items: center; gap: 8px; padding: 6px 0; cursor: pointer;
}
.rating-option input[type="radio"] { display: none; }
.stars { display: flex; align-items: center; gap: 3px; }
.stars i { font-size: .8rem; color: #d1d5db; }
.stars i.bi-star-fill { color: var(--gold); }
.stars small { font-size: .75rem; color: var(--text-light); margin-left: 4px; }
.rating-option:has(input:checked) .stars i { color: var(--gold); }
.rating-option:has(input:checked) .stars small { color: var(--forest); font-weight: 600; }

/* Toggle (verified / premium) */
.toggle-row {
  display: flex; align-items: center; justify-content: space-between; padding: 8px 0;
}
.toggle-row .form-check-label {
  font-size: .84rem; color: var(--text-mid); font-weight: 500;
  cursor: pointer; display: flex; align-items: center; gap: 7px;
}
.form-check-input[type="checkbox"] {
  accent-color: var(--forest); cursor: pointer;
}

/* Apply button */
.btn-apply {
  width: 100%; background: var(--forest); color: #fff; border: none;
  border-radius: 9px; padding: 11px; font-weight: 700; font-size: .87rem;
  cursor: pointer; transition: background .2s; margin-top: 16px;
  display: flex; align-items: center; justify-content: center; gap: 7px;
  font-family: 'DM Sans', sans-serif;
}
.btn-apply:hover { background: var(--leaf); }

/* ══ RESULTS ══ */
.results-toolbar {
  background: var(--white); border-radius: 12px; border: 1.5px solid var(--border);
  padding: 12px 16px; display: flex; align-items: center;
  justify-content: space-between; flex-wrap: wrap; gap: 10px; margin-bottom: 20px;
}
.results-count { font-size: .84rem; color: var(--text-light); }
.results-count strong { color: var(--forest); font-size: .95rem; }

/* No results */
.no-listings {
  background: var(--white); border-radius: 14px; border: 1.5px solid var(--border);
  padding: 60px 20px; text-align: center;
}
.no-results-icon { font-size: 3rem; color: var(--border); display: block; margin-bottom: 16px; }
.no-listings h5 {
  font-family: 'Playfair Display', serif; font-size: 1.3rem; font-weight: 700;
  color: var(--text-dark); margin-bottom: 8px;
}
.no-listings p { color: var(--text-light); font-size: .88rem; max-width: 300px; margin: 0 auto 20px; }
.btn-reset {
  background: var(--forest); color: #fff; border: none; border-radius: 9px;
  padding: 10px 24px; font-size: .87rem; font-weight: 600;
  cursor: pointer; font-family: 'DM Sans', sans-serif; transition: background .2s;
}
.btn-reset:hover { background: var(--leaf); }

/* Pagination */
.archive-pagination {
  display: flex; justify-content: center; gap: 6px; margin-top: 28px; flex-wrap: wrap;
}
.archive-pagination a, .archive-pagination span {
  width: 38px; height: 38px; border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  font-size: .84rem; font-weight: 600; border: 1.5px solid var(--border);
  background: var(--white); color: var(--text-mid); text-decoration: none; transition: all .18s;
}
.archive-pagination a:hover,
.archive-pagination .current { background: var(--forest); color: #fff; border-color: var(--forest); }
.archive-pagination .prev-next { width: auto; padding: 0 14px; gap: 5px; }

/* Mobile sidebar */
.mobile-filter-btn {
  display: none; width: 100%; background: var(--forest); color: #fff;
  border: none; border-radius: 9px; padding: 11px 18px;
  font-size: .87rem; font-weight: 600; gap: 8px;
  align-items: center; cursor: pointer; margin-bottom: 16px;
  font-family: 'DM Sans', sans-serif;
}
.sidebar-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 998; }

@media (max-width: 991px) {
  .mobile-filter-btn { display: flex; }
  .listing-sidebar-filter {
    position: fixed; top: 0; left: -100%; width: 290px; height: 100vh;
    z-index: 999; border-radius: 0; overflow-y: auto; transition: left .3s ease;
  }
  .listing-sidebar-filter.open { left: 0; }
  .sidebar-overlay.open { display: block; }
}
