/* ============================================================
   Practix — Global Styles
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --blue-900: #0a2342;
  --blue-800: #0d3068;
  --blue-700: #1046a0;
  --blue-600: #1a5cd8;
  --blue-500: #2d7cf6;
  --blue-100: #dbeafe;
  --blue-50:  #eff6ff;
  --gray-900: #111827;
  --gray-700: #374151;
  --gray-500: #6b7280;
  --gray-300: #d1d5db;
  --gray-100: #f3f4f6;
  --gray-50:  #f9fafb;
  --white:    #ffffff;
  --green:    #16a34a;
  --sold-red: #dc2626;
  --radius:   10px;
  --shadow:   0 1px 4px rgba(0,0,0,0.08), 0 4px 16px rgba(0,0,0,0.06);
  --shadow-hover: 0 4px 12px rgba(0,0,0,0.12), 0 8px 28px rgba(0,0,0,0.1);
}

html { scroll-behavior: smooth; }
body {
  font-family: 'Inter', system-ui, sans-serif;
  color: var(--gray-900);
  background: var(--gray-50);
  line-height: 1.6;
}

a { color: inherit; text-decoration: none; }
button { cursor: pointer; font-family: inherit; }
input, select { font-family: inherit; }

/* ---- BUTTONS ---- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 20px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  border: 2px solid transparent;
  transition: all 0.18s ease;
  cursor: pointer;
  white-space: nowrap;
}
.btn-primary {
  background: var(--blue-600);
  color: var(--white);
  border-color: var(--blue-600);
}
.btn-primary:hover { background: var(--blue-700); border-color: var(--blue-700); }
.btn-outline {
  background: transparent;
  color: var(--blue-600);
  border-color: var(--blue-600);
}
.btn-outline:hover { background: var(--blue-50); }
.btn-white {
  background: var(--white);
  color: var(--blue-700);
  border-color: var(--white);
}
.btn-white:hover { background: var(--blue-50); }

/* ============================================================
   HEADER
   ============================================================ */
.site-header {
  background: var(--white);
  border-bottom: 1px solid var(--gray-300);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 1px 8px rgba(0,0,0,0.06);
}
.header-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 24px;
  height: 64px;
  display: flex;
  align-items: center;
  gap: 32px;
}

/* Logo */
.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 20px;
  font-weight: 700;
  color: var(--blue-800);
  flex-shrink: 0;
}
.logo-icon { color: var(--blue-600); font-size: 18px; }
.logo-text strong { color: var(--blue-600); }
.logo-light { color: var(--white); }
.logo-light .logo-icon { color: var(--blue-100); }
.logo-light .logo-text strong { color: var(--blue-100); }

/* Nav */
.main-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 1;
}
.nav-link {
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  color: var(--gray-700);
  transition: all 0.15s;
  display: flex;
  align-items: center;
  gap: 6px;
}
.nav-link:hover { background: var(--gray-100); color: var(--gray-900); }
.nav-link.active { color: var(--blue-600); font-weight: 600; }
.nav-link.coming-soon { color: var(--gray-500); }
.badge {
  font-size: 10px;
  font-weight: 700;
  background: var(--blue-100);
  color: var(--blue-700);
  padding: 1px 6px;
  border-radius: 20px;
}
.header-actions { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  font-size: 22px;
  color: var(--gray-700);
  margin-left: auto;
}
.mobile-nav {
  display: none;
  flex-direction: column;
  padding: 12px 24px 16px;
  border-top: 1px solid var(--gray-100);
  gap: 4px;
}
.mobile-nav .nav-link { font-size: 16px; padding: 10px 12px; }
.mobile-nav.open { display: flex; }

@media (max-width: 900px) {
  .main-nav, .header-actions { display: none; }
  .mobile-menu-btn { display: block; }
}

/* ============================================================
   HERO BANNER
   ============================================================ */
.hero-banner {
  background: linear-gradient(135deg, var(--blue-900) 0%, var(--blue-700) 100%);
  color: var(--white);
  padding: 48px 24px;
  text-align: center;
}
.hero-inner { max-width: 700px; margin: 0 auto; }
.hero-banner h1 { font-size: 36px; font-weight: 700; margin-bottom: 12px; }
.hero-banner p { font-size: 17px; color: var(--blue-100); line-height: 1.7; }

/* ============================================================
   LISTINGS PAGE LAYOUT
   ============================================================ */
.listings-page {
  max-width: 1400px;
  margin: 0 auto;
  padding: 32px 24px;
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 28px;
  align-items: start;
}

/* ---- FILTER PANEL ---- */
.filter-panel {
  background: var(--white);
  border: 1px solid var(--gray-300);
  border-radius: var(--radius);
  padding: 20px;
  position: sticky;
  top: 80px;
}
.filter-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}
.filter-header h3 { font-size: 16px; font-weight: 700; color: var(--gray-900); }
.reset-btn {
  background: none;
  border: none;
  color: var(--blue-600);
  font-size: 13px;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 4px;
  transition: background 0.15s;
}
.reset-btn:hover { background: var(--blue-50); }

.filter-group { margin-bottom: 22px; }
.filter-label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--gray-500);
  margin-bottom: 10px;
}

/* Toggle */
.toggle-row { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--gray-700); }
.toggle { position: relative; width: 40px; height: 22px; flex-shrink: 0; }
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute; inset: 0;
  background: var(--gray-300);
  border-radius: 22px;
  transition: 0.2s;
  cursor: pointer;
}
.toggle-slider::before {
  content: '';
  position: absolute;
  width: 16px; height: 16px;
  left: 3px; top: 3px;
  background: var(--white);
  border-radius: 50%;
  transition: 0.2s;
}
.toggle input:checked + .toggle-slider { background: var(--blue-600); }
.toggle input:checked + .toggle-slider::before { transform: translateX(18px); }

/* Checkboxes */
.checkbox-list { display: flex; flex-direction: column; gap: 8px; }
.checkbox-list label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--gray-700);
  cursor: pointer;
}
.checkbox-list input[type="checkbox"] { accent-color: var(--blue-600); width: 15px; height: 15px; }

/* Range inputs */
.range-inputs { display: flex; flex-direction: column; gap: 8px; width: 100%; }
.range-inputs .range-sep { text-align: center; }
.range-field {
  display: flex;
  align-items: center;
  border: 1px solid var(--gray-300);
  border-radius: 6px;
  overflow: hidden;
  flex: 1;
  min-width: 0;
}
.currency-prefix {
  padding: 0 8px;
  background: var(--gray-50);
  color: var(--gray-500);
  font-size: 13px;
  border-right: 1px solid var(--gray-300);
  height: 40px;
  display: flex;
  align-items: center;
  flex-shrink: 0;
}
.range-field input {
  border: none;
  outline: none;
  width: 100%;
  min-width: 0;
  padding: 10px 8px;
  font-size: 13px;
  color: var(--gray-900);
}
.range-sep { color: var(--gray-500); font-size: 13px; flex-shrink: 0; }

/* Operatory buttons */
.operatory-buttons { display: flex; gap: 6px; flex-wrap: wrap; }
.op-btn {
  width: 38px; height: 38px;
  border: 1.5px solid var(--gray-300);
  border-radius: 6px;
  background: var(--white);
  font-size: 13px;
  font-weight: 600;
  color: var(--gray-700);
  transition: all 0.15s;
}
.op-btn:hover { border-color: var(--blue-500); color: var(--blue-600); }
.op-btn.active { background: var(--blue-600); border-color: var(--blue-600); color: var(--white); }

/* Select */
.select-input {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--gray-300);
  border-radius: 6px;
  font-size: 14px;
  color: var(--gray-900);
  background: var(--white);
  outline: none;
  cursor: pointer;
}
.select-input:focus { border-color: var(--blue-500); }

.apply-btn { width: 100%; justify-content: center; margin-top: 4px; }

/* Multiselect dropdown */
.multiselect { position: relative; }
.multiselect-btn { text-align: left; }
.multiselect-panel {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  z-index: 20;
  background: var(--white);
  border: 1px solid var(--gray-300);
  border-radius: 6px;
  box-shadow: var(--shadow-hover);
  padding: 10px 12px;
  max-height: 220px;
  overflow-y: auto;
}
.multiselect-panel.open { display: block; }
.multiselect-panel label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--gray-700);
  padding: 5px 0;
  cursor: pointer;
}
.multiselect-panel input[type="checkbox"] { accent-color: var(--blue-600); width: 15px; height: 15px; }
.multiselect-select-all {
  display: block;
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  border-bottom: 1px solid var(--gray-200);
  color: var(--blue-600);
  font-size: 13px;
  font-weight: 600;
  padding: 4px 0 8px;
  margin-bottom: 6px;
  cursor: pointer;
}
.multiselect-select-all:hover { color: var(--blue-700); }

/* ---- LISTINGS AREA ---- */
.listings-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 12px;
}
.results-count { font-size: 18px; font-weight: 700; color: var(--gray-900); }
.toolbar-right { display: flex; align-items: center; gap: 10px; }
.sort-select {
  padding: 8px 12px;
  border: 1px solid var(--gray-300);
  border-radius: 6px;
  font-size: 13px;
  background: var(--white);
  color: var(--gray-700);
  outline: none;
  cursor: pointer;
}
.filter-toggle-btn {
  display: none;
  padding: 8px 14px;
  border: 1px solid var(--gray-300);
  border-radius: 6px;
  background: var(--white);
  font-size: 13px;
  font-weight: 600;
  color: var(--gray-700);
}

/* ---- LISTING CARDS ---- */
.listings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 24px;
}

.listing-card {
  background: var(--white);
  border: 1px solid var(--gray-300);
  border-radius: var(--radius);
  overflow: hidden;
  transition: box-shadow 0.2s, transform 0.2s;
  cursor: pointer;
  display: flex;
  flex-direction: column;
}
.listing-card:hover {
  box-shadow: var(--shadow-hover);
  transform: translateY(-2px);
}

.card-status-badge {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 3px 10px;
  border-radius: 20px;
  flex-shrink: 0;
}
.badge-for-sale { background: #dcfce7; color: var(--green); }
.badge-sold { background: #fee2e2; color: var(--sold-red); }
.badge-pending { background: #fef9c3; color: #92400e; }

.card-body { padding: 24px; flex: 1; display: flex; flex-direction: column; gap: 14px; }
.card-top-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.card-location { font-size: 20px; font-weight: 800; color: var(--gray-900); }
.card-specialty { font-size: 13px; font-weight: 600; color: var(--blue-600); text-transform: uppercase; letter-spacing: 0.04em; margin-top: 4px; }

.card-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: auto;
}
.card-stat { display: flex; flex-direction: column; gap: 4px; }
.stat-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--gray-500); }
.stat-value { font-size: 17px; font-weight: 700; color: var(--gray-900); }

.card-footer {
  padding: 18px 24px;
  border-top: 1px solid var(--gray-100);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.card-collections { font-size: 17px; font-weight: 800; color: var(--blue-700); }
.card-collections-label { font-size: 10px; font-weight: 600; color: var(--gray-500); text-transform: uppercase; letter-spacing: 0.05em; }
.card-view-btn {
  font-size: 12px;
  font-weight: 600;
  color: var(--blue-600);
  background: var(--blue-50);
  border: none;
  padding: 6px 12px;
  border-radius: 6px;
  transition: background 0.15s;
}
.card-view-btn:hover { background: var(--blue-100); }

/* ---- PAGINATION ---- */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 36px;
  flex-wrap: wrap;
}
.page-btn {
  width: 38px; height: 38px;
  border: 1px solid var(--gray-300);
  border-radius: 6px;
  background: var(--white);
  font-size: 14px;
  font-weight: 600;
  color: var(--gray-700);
  transition: all 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
}
.page-btn:hover { border-color: var(--blue-500); color: var(--blue-600); }
.page-btn.active { background: var(--blue-600); border-color: var(--blue-600); color: var(--white); }
.page-btn.wide { width: auto; padding: 0 14px; }
.page-ellipsis { color: var(--gray-500); font-size: 14px; padding: 0 4px; }

/* ============================================================
   CTA BANNER
   ============================================================ */
.cta-banner {
  background: linear-gradient(135deg, var(--blue-800) 0%, var(--blue-600) 100%);
  padding: 56px 24px;
  margin-top: 20px;
}
.cta-inner {
  max-width: 1000px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  flex-wrap: wrap;
}
.cta-text h2 { font-size: 26px; font-weight: 700; color: var(--white); margin-bottom: 8px; }
.cta-text p { color: var(--blue-100); font-size: 16px; max-width: 520px; }

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer {
  background: var(--blue-900);
  color: var(--white);
  padding: 56px 24px 0;
}
.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.4fr 2fr;
  gap: 60px;
  padding-bottom: 40px;
}
.footer-brand .logo { margin-bottom: 14px; }
.footer-brand p { color: #93b4d4; font-size: 14px; line-height: 1.7; max-width: 320px; }
.footer-links { display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px; }
.footer-col h4 { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.07em; color: #93b4d4; margin-bottom: 14px; }
.footer-col a { display: block; color: #c8dcf0; font-size: 14px; margin-bottom: 10px; transition: color 0.15s; }
.footer-col a:hover { color: var(--white); }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.1);
  padding: 18px 0;
  text-align: center;
  max-width: 1200px;
  margin: 0 auto;
  color: #93b4d4;
  font-size: 13px;
}

/* ============================================================
   EMPTY / LOADING STATES
   ============================================================ */
.loading-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 60px 20px;
  color: var(--gray-500);
  font-size: 16px;
}

.no-results {
  grid-column: 1 / -1;
  text-align: center;
  padding: 60px 20px;
  color: var(--gray-500);
}
.no-results h3 { font-size: 20px; margin-bottom: 8px; color: var(--gray-700); }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1024px) {
  .listings-page { grid-template-columns: 240px 1fr; }
}

@media (max-width: 768px) {
  .listings-page {
    grid-template-columns: 1fr;
    padding: 20px 16px;
  }
  .filter-panel {
    position: fixed;
    top: 0; left: -100%;
    width: 300px;
    height: 100vh;
    overflow-y: auto;
    z-index: 200;
    border-radius: 0;
    transition: left 0.3s ease;
    box-shadow: 4px 0 20px rgba(0,0,0,0.15);
  }
  .filter-panel.open { left: 0; }
  .filter-toggle-btn { display: flex; }
  .hero-banner h1 { font-size: 26px; }
  .footer-inner { grid-template-columns: 1fr; gap: 32px; }
  .footer-links { grid-template-columns: repeat(2, 1fr); }
  .cta-inner { flex-direction: column; text-align: center; }
}

@media (max-width: 480px) {
  .listings-grid { grid-template-columns: 1fr; }
  .footer-links { grid-template-columns: 1fr; }
}
