*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --navy:     #0B1D3E;
  --blue:     #1A56DB;
  --orange:   #E85D26;
  --white:    #FFFFFF;
  --gray-50:  #F8F9FB;
  --gray-100: #F0F2F5;
  --gray-200: #E2E6ED;
  --gray-300: #CDD3DC;
  --gray-400: #9AA3B0;
  --gray-600: #5A6478;
  --gray-700: #3D4658;
  --gray-800: #1E2533;
  --green:    #059669;
  --radius:   12px;
  --shadow-sm: 0 1px 4px rgba(0,0,0,.07);
  --shadow-md: 0 4px 16px rgba(0,0,0,.11);
  --font:     'Inter', sans-serif;
  --font-d:   'Manrope', sans-serif;
  --t:        .2s ease;
  --app-sidebar-w: 72px;
  --app-sidebar-expanded: 230px;
  --filter-sidebar-w: 272px;
  --topbar-h: 58px;
}

html { scroll-behavior: smooth; }
body { font-family: var(--font); color: var(--gray-800); background: var(--gray-50); -webkit-font-smoothing: antialiased; display: flex; min-height: 100vh; }
a { text-decoration: none; color: inherit; }
img { display: block; max-width: 100%; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }

/* ── APP SIDEBAR (nav) ───────────────────────── */
.app-sidebar {
  position: fixed;
  top: 0; left: 0;
  height: 100vh;
  width: var(--app-sidebar-w);
  background: var(--navy);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px 0 24px;
  z-index: 200;
  transition: width .28s cubic-bezier(.4,0,.2,1);
  overflow: hidden;
}
.app-sidebar:hover, .app-sidebar.expanded {
  width: var(--app-sidebar-expanded);
  align-items: flex-start;
}
.app-sidebar-logo {
  display: flex; align-items: center; gap: 10px;
  padding: 0 18px; margin-bottom: 36px;
  flex-shrink: 0; white-space: nowrap; overflow: hidden;
}
.app-sidebar-logo img { height: 36px; width: auto; flex-shrink: 0; filter: brightness(0) invert(1); }
.app-sidebar-nav { width: 100%; flex: 1; }
.app-sidebar-group { margin-bottom: 6px; }
.app-sidebar-label {
  font-size: .65rem; font-weight: 700; letter-spacing: .1em;
  text-transform: uppercase; color: rgba(255,255,255,.3);
  padding: 10px 20px 4px; white-space: nowrap;
  opacity: 0; transition: opacity .2s;
}
.app-sidebar:hover .app-sidebar-label,
.app-sidebar.expanded .app-sidebar-label { opacity: 1; }
.app-sidebar-link {
  display: flex; align-items: center; gap: 13px;
  padding: 11px 18px; color: rgba(255,255,255,.65);
  font-size: .875rem; font-weight: 500; white-space: nowrap;
  transition: background var(--t), color var(--t); position: relative;
}
.app-sidebar-link:hover { background: rgba(255,255,255,.08); color: var(--white); }
.app-sidebar-link.active { background: rgba(26,86,219,.25); color: var(--white); }
.app-sidebar-link.active::before {
  content: ''; position: absolute; left: 0; top: 6px; bottom: 6px;
  width: 3px; background: var(--blue); border-radius: 0 2px 2px 0;
}
.app-sidebar-icon { width: 20px; height: 20px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; }
.app-sidebar-text { opacity: 0; transition: opacity .18s; }
.app-sidebar:hover .app-sidebar-text,
.app-sidebar.expanded .app-sidebar-text { opacity: 1; }
.app-sidebar-bottom { width: 100%; border-top: 1px solid rgba(255,255,255,.08); padding-top: 16px; margin-top: 8px; }

/* ── MAIN WRAPPER ────────────────────────────── */
.main-wrapper {
  margin-left: var(--app-sidebar-w);
  flex: 1; min-width: 0;
  display: flex; flex-direction: column;
  transition: margin-left .28s cubic-bezier(.4,0,.2,1);
}

/* ── TOP BAR ─────────────────────────────────── */
.topbar {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255,255,255,.97);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--gray-200);
  display: flex; align-items: center; gap: 14px;
  padding: 0 24px; height: var(--topbar-h);
}
.topbar-search {
  flex: 1; display: flex; align-items: center;
  background: var(--gray-100); border: 1.5px solid var(--gray-200);
  border-radius: 10px; overflow: hidden;
  transition: border-color var(--t), box-shadow var(--t);
  max-width: 560px;
}
.topbar-search:focus-within {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(26,86,219,.1);
}
.topbar-search-icon { padding: 0 10px 0 14px; color: var(--gray-400); display: flex; align-items: center; }
.topbar-search-input {
  flex: 1; border: none; outline: none; background: transparent;
  font-family: var(--font); font-size: .875rem; color: var(--gray-800);
  padding: 10px 0;
}
.topbar-search-input::placeholder { color: var(--gray-400); }
.topbar-search-btn {
  background: var(--blue); color: white;
  font-size: .82rem; font-weight: 700;
  padding: 10px 18px; white-space: nowrap;
  transition: opacity var(--t);
}
.topbar-search-btn:hover { opacity: .88; }
.topbar-actions { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.btn-outline {
  background: var(--white); color: var(--blue);
  font-size: .82rem; font-weight: 600;
  padding: 7px 16px; border-radius: 8px;
  border: 1.5px solid var(--blue);
  transition: background var(--t); white-space: nowrap;
}
.btn-outline:hover { background: rgba(26,86,219,.05); }
.btn-primary {
  background: var(--blue); color: var(--white);
  font-size: .82rem; font-weight: 700;
  padding: 7px 16px; border-radius: 8px;
  transition: opacity var(--t); white-space: nowrap;
}
.btn-primary:hover { opacity: .88; }

/* ── PAGE BODY ───────────────────────────────── */
.page-body {
  display: flex; flex: 1; min-height: 0;
}

/* ── FILTER SIDEBAR ──────────────────────────── */
.filter-sidebar {
  width: var(--filter-sidebar-w);
  flex-shrink: 0;
  background: var(--white);
  border-right: 1px solid var(--gray-200);
  overflow-y: auto;
  padding: 20px 0 40px;
  position: sticky;
  top: var(--topbar-h);
  height: calc(100vh - var(--topbar-h));
}
.filter-sidebar::-webkit-scrollbar { width: 4px; }
.filter-sidebar::-webkit-scrollbar-thumb { background: var(--gray-200); border-radius: 4px; }

.filter-sidebar-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 20px 16px; border-bottom: 1px solid var(--gray-100);
  margin-bottom: 4px;
}
.filter-sidebar-title { font-weight: 800; font-size: .95rem; font-family: var(--font-d); }
.filter-clear-all {
  font-size: .78rem; color: var(--blue); font-weight: 600;
  transition: opacity var(--t);
}
.filter-clear-all:hover { opacity: .75; }

/* Active filter tags */
.active-filters {
  display: flex; flex-wrap: wrap; gap: 6px;
  padding: 12px 20px 4px;
  min-height: 0;
}
.active-tag {
  display: inline-flex; align-items: center; gap: 5px;
  background: rgba(26,86,219,.08); color: var(--blue);
  font-size: .72rem; font-weight: 600;
  padding: 4px 9px; border-radius: 20px;
}
.active-tag button {
  display: flex; align-items: center;
  color: var(--blue); opacity: .7;
  transition: opacity var(--t);
}
.active-tag button:hover { opacity: 1; }

/* Filter sections */
.filter-section { border-bottom: 1px solid var(--gray-100); }
.filter-section-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 20px; cursor: pointer;
  transition: background var(--t);
}
.filter-section-header:hover { background: var(--gray-50); }
.filter-section-title { font-size: .85rem; font-weight: 600; color: var(--gray-700); }
.chevron { color: var(--gray-400); transition: transform .2s; flex-shrink: 0; }
.filter-section-header.collapsed .chevron { transform: rotate(-90deg); }
.filter-section-body { padding: 4px 20px 16px; }
.filter-section-body.hidden { display: none; }

/* Price range */
.price-display {
  display: flex; justify-content: space-between;
  font-size: .8rem; font-weight: 700; color: var(--gray-800);
  margin-bottom: 14px;
}
.range-wrap { position: relative; height: 24px; }
.range-input {
  position: absolute; width: 100%; height: 4px;
  -webkit-appearance: none; appearance: none;
  background: transparent; pointer-events: none; top: 10px;
}
.range-input::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--blue); border: 2px solid white;
  box-shadow: 0 1px 4px rgba(0,0,0,.2);
  pointer-events: all; cursor: pointer; position: relative; z-index: 3;
}
.range-track {
  position: absolute; top: 10px; left: 0; right: 0;
  height: 4px; background: var(--gray-200); border-radius: 4px; z-index: 1;
}
.range-fill {
  position: absolute; height: 100%;
  background: var(--blue); border-radius: 4px;
}

/* Chip groups */
.chip-group { display: flex; flex-wrap: wrap; gap: 7px; }
.chip {
  padding: 6px 13px; border-radius: 20px;
  font-size: .78rem; font-weight: 600;
  border: 1.5px solid var(--gray-200);
  color: var(--gray-600); background: var(--white);
  transition: all var(--t);
}
.chip:hover { border-color: var(--blue); color: var(--blue); }
.chip.active {
  background: var(--blue); color: white;
  border-color: var(--blue);
}

/* Check list */
.check-list { display: flex; flex-direction: column; gap: 10px; }
.check-item {
  display: flex; align-items: center; gap: 9px;
  font-size: .83rem; color: var(--gray-600); cursor: pointer;
}
.check-item input[type="checkbox"] {
  width: 15px; height: 15px;
  accent-color: var(--blue);
  border-radius: 4px; cursor: pointer;
}

/* Toggle switches */
.toggle-list { display: flex; flex-direction: column; gap: 14px; }
.toggle-item { display: flex; align-items: center; justify-content: space-between; }
.toggle-label { font-size: .83rem; color: var(--gray-600); font-weight: 500; }
.toggle-switch { position: relative; cursor: pointer; }
.toggle-switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.toggle-track {
  display: block; width: 36px; height: 20px;
  background: var(--gray-200); border-radius: 20px;
  transition: background var(--t); position: relative;
}
.toggle-switch input:checked + .toggle-track { background: var(--blue); }
.toggle-thumb {
  position: absolute; top: 2px; left: 2px;
  width: 16px; height: 16px; border-radius: 50%;
  background: white; box-shadow: 0 1px 3px rgba(0,0,0,.2);
  transition: transform var(--t);
}
.toggle-switch input:checked + .toggle-track .toggle-thumb { transform: translateX(16px); }

.btn-apply-filters {
  margin: 20px 20px 0;
  width: calc(100% - 40px);
  background: var(--blue); color: white;
  font-size: .875rem; font-weight: 700;
  padding: 12px; border-radius: 10px;
  transition: opacity var(--t);
}
.btn-apply-filters:hover { opacity: .88; }

/* ── RESULTS AREA ────────────────────────────── */
.results-area { flex: 1; min-width: 0; padding: 20px 24px 48px; }

.results-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 18px; flex-wrap: wrap; gap: 10px;
}
.results-meta { display: flex; align-items: center; gap: 12px; }
.results-count { font-weight: 700; font-size: .95rem; font-family: var(--font-d); color: var(--gray-800); }
.results-location { display: flex; align-items: center; gap: 5px; font-size: .8rem; color: var(--gray-400); }

.results-controls { display: flex; align-items: center; gap: 10px; }

.btn-filter-mobile {
  display: none; align-items: center; gap: 6px;
  padding: 7px 13px; border-radius: 8px;
  border: 1.5px solid var(--gray-200);
  font-size: .82rem; font-weight: 600; color: var(--gray-700);
  background: var(--white); transition: border-color var(--t);
  position: relative;
}
.btn-filter-mobile:hover { border-color: var(--blue); }
.filter-badge {
  background: var(--blue); color: white;
  font-size: .65rem; font-weight: 700;
  width: 17px; height: 17px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
}

.sort-wrap { display: flex; align-items: center; gap: 7px; }
.sort-label { font-size: .8rem; color: var(--gray-400); white-space: nowrap; }
.sort-select {
  border: 1.5px solid var(--gray-200); border-radius: 8px;
  padding: 7px 10px; font-family: var(--font);
  font-size: .82rem; color: var(--gray-700); font-weight: 600;
  background: var(--white); outline: none; cursor: pointer;
  transition: border-color var(--t);
}
.sort-select:focus { border-color: var(--blue); }

.view-toggle { display: flex; border: 1.5px solid var(--gray-200); border-radius: 8px; overflow: hidden; }
.view-btn {
  width: 34px; height: 34px; display: flex; align-items: center; justify-content: center;
  color: var(--gray-400); transition: background var(--t), color var(--t);
}
.view-btn.active { background: var(--blue); color: white; }
.view-btn:not(.active):hover { background: var(--gray-50); color: var(--gray-700); }

/* ── CARDS GRID ──────────────────────────────── */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 18px;
}
.cards-grid.list-view {
  grid-template-columns: 1fr;
}

/* Card */
.listing-card {
  background: var(--white);
  border-radius: var(--radius);
  border: 1px solid var(--gray-200);
  overflow: hidden;
  cursor: pointer;
  transition: transform var(--t), box-shadow var(--t);
  display: flex; flex-direction: column;
}
.listing-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }

/* List view card */
.cards-grid.list-view .listing-card {
  flex-direction: row;
  height: 150px;
}
.cards-grid.list-view .card-img-wrap {
  width: 200px; flex-shrink: 0; height: 100%;
}
.cards-grid.list-view .card-img-wrap img {
  height: 100% !important;
}
.cards-grid.list-view .card-body {
  display: flex; flex-direction: column; justify-content: space-between;
  flex: 1; padding: 14px 16px;
}
.cards-grid.list-view .card-footer { padding-top: 0; }

.card-img-wrap {
  position: relative; overflow: hidden;
}
.card-img-wrap img {
  width: 100%; height: 180px; object-fit: cover;
  transition: transform .4s ease;
}
.listing-card:hover .card-img-wrap img { transform: scale(1.04); }

.card-save {
  position: absolute; top: 10px; right: 10px;
  width: 32px; height: 32px; border-radius: 50%;
  background: rgba(255,255,255,.92);
  display: flex; align-items: center; justify-content: center;
  color: var(--gray-400); border: none;
  box-shadow: var(--shadow-sm);
  transition: color var(--t), background var(--t);
  z-index: 2;
}
.card-save:hover, .card-save.saved { color: var(--orange); }

.card-badges {
  position: absolute; bottom: 10px; left: 10px;
  display: flex; gap: 5px; z-index: 2;
}
.card-badge {
  font-size: .65rem; font-weight: 700; letter-spacing: .05em;
  text-transform: uppercase; padding: 3px 8px; border-radius: 20px;
}
.card-badge-verified { background: rgba(26,86,219,.9); color: white; }
.card-badge-available { background: rgba(5,150,105,.9); color: white; }
.card-badge-new { background: rgba(232,93,38,.9); color: white; }

.card-body { padding: 13px 14px 10px; flex: 1; }
.card-name { font-weight: 700; font-size: .9rem; color: var(--gray-800); margin-bottom: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-location { display: flex; align-items: center; gap: 4px; font-size: .75rem; color: var(--gray-400); margin-bottom: 10px; }
.card-meta { display: flex; gap: 12px; }
.card-meta-item { display: flex; align-items: center; gap: 4px; font-size: .75rem; color: var(--gray-600); font-weight: 500; }
.card-meta-item svg { color: var(--blue); }

.card-footer {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 14px 13px; border-top: 1px solid var(--gray-100); margin-top: 8px;
}
.card-price { font-family: var(--font-d); font-size: .95rem; font-weight: 800; color: var(--orange); }
.card-price span { font-size: .72rem; font-weight: 500; color: var(--gray-400); }
.card-dist { font-size: .72rem; color: var(--gray-400); display: flex; align-items: center; gap: 3px; }

/* Skeleton loader */
.skeleton {
  background: var(--white); border-radius: var(--radius);
  border: 1px solid var(--gray-200); overflow: hidden;
}
.skeleton-img { height: 180px; background: linear-gradient(90deg, var(--gray-100) 25%, var(--gray-50) 50%, var(--gray-100) 75%); background-size: 200% 100%; animation: shimmer 1.4s infinite; }
.skeleton-line { height: 12px; border-radius: 6px; background: linear-gradient(90deg, var(--gray-100) 25%, var(--gray-50) 50%, var(--gray-100) 75%); background-size: 200% 100%; animation: shimmer 1.4s infinite; margin: 14px 14px 8px; }
.skeleton-line.short { width: 60%; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* Empty state */
.empty-state {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 80px 20px; text-align: center; gap: 14px;
}
.empty-state h3 { font-family: var(--font-d); font-size: 1.1rem; font-weight: 800; color: var(--gray-700); }
.empty-state p { font-size: .875rem; color: var(--gray-400); }
.btn-reset {
  margin-top: 6px; background: var(--blue); color: white;
  padding: 10px 22px; border-radius: 8px;
  font-size: .875rem; font-weight: 700; transition: opacity var(--t);
}
.btn-reset:hover { opacity: .88; }

/* Pagination */
.pagination {
  display: flex; align-items: center; justify-content: center;
  gap: 8px; margin-top: 36px;
}
.page-btn {
  width: 36px; height: 36px; border-radius: 8px;
  border: 1.5px solid var(--gray-200); background: var(--white);
  display: flex; align-items: center; justify-content: center;
  color: var(--gray-600); transition: all var(--t);
}
.page-btn:hover:not(:disabled) { border-color: var(--blue); color: var(--blue); }
.page-btn:disabled { opacity: .4; cursor: not-allowed; }
.page-number {
  width: 36px; height: 36px; border-radius: 8px;
  border: 1.5px solid var(--gray-200); background: var(--white);
  display: flex; align-items: center; justify-content: center;
  font-size: .85rem; font-weight: 600; color: var(--gray-600);
  cursor: pointer; transition: all var(--t);
}
.page-number:hover { border-color: var(--blue); color: var(--blue); }
.page-number.active { background: var(--blue); border-color: var(--blue); color: white; }

/* ── SCROLL TOP ──────────────────────────────── */
.scroll-top {
  position: fixed; bottom: 26px; right: 26px;
  width: 42px; height: 42px; background: var(--blue);
  color: white; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow-md); opacity: 0; pointer-events: none;
  transition: opacity var(--t); z-index: 900;
}
.scroll-top.visible { opacity: 1; pointer-events: auto; }

/* ── MOBILE TOP BAR ──────────────────────────── */
.mobile-topbar {
  display: none; position: fixed;
  top: 0; left: 0; right: 0; height: 56px;
  background: var(--navy); z-index: 300;
  align-items: center; padding: 0 16px; gap: 14px;
}
.mobile-topbar img { height: 32px; filter: brightness(0) invert(1); }
.hamburger {
  width: 36px; height: 36px; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 5px; margin-left: auto;
}
.hamburger span { width: 20px; height: 2px; background: white; border-radius: 2px; display: block; }
.sidebar-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,.5); z-index: 190;
}
.sidebar-overlay.visible { display: block; }

/* ── RESPONSIVE ──────────────────────────────── */
@media (max-width: 1100px) {
  .cards-grid { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
}

@media (max-width: 900px) {
  .filter-sidebar {
    position: fixed;
    top: 0; left: 0; bottom: 0; z-index: 150;
    transform: translateX(-100%);
    transition: transform .28s cubic-bezier(.4,0,.2,1);
    height: 100vh;
    padding-top: 24px;
    box-shadow: var(--shadow-md);
  }
  .filter-sidebar.open { transform: translateX(0); }
  .btn-filter-mobile { display: flex; }
  .results-area { padding: 16px; }
}

@media (max-width: 768px) {
  .app-sidebar {
    transform: translateX(-100%);
    width: var(--app-sidebar-expanded);
    transition: transform .28s cubic-bezier(.4,0,.2,1);
  }
  .app-sidebar.expanded { transform: translateX(0); }
  .app-sidebar .app-sidebar-text { opacity: 1; }
  .app-sidebar .app-sidebar-label { opacity: 1; }
  .main-wrapper { margin-left: 0; padding-top: 56px; }
  .mobile-topbar { display: flex; }
  .topbar { display: none; }
  .cards-grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
}

@media (max-width: 480px) {
  .cards-grid { grid-template-columns: 1fr; }
  .results-header { flex-direction: column; align-items: flex-start; }
}