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

body {
  font-family: Poppins, sans-serif;
  background: #f8fafc;
  line-height: 1;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Filter Section */
.filter-section {
  background: white;
  border-radius: 16px;
  padding: 24px;
  margin: 20px 0;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  border: 1px solid #e2e8f0;
}

.filter-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.filter-title {
  font-size: 20px;
  font-weight: 600;
  color: #2d3748;
}

.filter-toggle {
  display: none;
}

.filter-content {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 12px 16px; /* row gap | column gap */
  align-items: start; /* align items to top for uniform space from search bar */
}

.filter-search { /* search row spans full width */
  grid-column: 1 / -1;
}

.filter-category {
  margin-bottom: 0; /* use grid gap instead */
  grid-column: span 4; /* 3-up on desktop */
  min-width: 0; /* allow children to shrink within grid cell */
}

.button-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 20px;
  margin-top: 8px;
}

.filter-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border: 2px solid #e2e8f0;
  border-radius: 25px;
  background: white;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  color: #4a5568;
}

.filter-btn:hover {
  border-color: #3182ce;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(49, 130, 206, 0.2);
}

.filter-btn.active {
  background: #3182ce;
  color: white;
  border-color: #3182ce;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(49, 130, 206, 0.3);
}

.filter-btn .filter-icon {
  font-size: 16px;
  line-height: 1;
}

/* Status specific styles */
.status-available.active {
  background: #10b981;
  border-color: #10b981;
  color: white;
}

.status-occupied.active {
  background: #ef4444;
  border-color: #ef4444;
  color: white;
}

.status-maintenance.active {
  background: #f59e0b;
  border-color: #f59e0b;
  color: white;
}

/* Property type specific hover colors */
.type-office:hover {
  border-color: #8b5cf6;
}
.type-office.active {
  background: #8b5cf6;
  border-color: #8b5cf6;
}

.type-retail:hover {
  border-color: #06b6d4;
}
.type-retail.active {
  background: #06b6d4;
  border-color: #06b6d4;
}

.type-warehouse:hover {
  border-color: #10b981;
}
.type-warehouse.active {
  background: #10b981;
  border-color: #10b981;
}

.type-restaurant:hover {
  border-color: #f59e0b;
}
.type-restaurant.active {
  background: #f59e0b;
  border-color: #f59e0b;
}

.type-coworking:hover {
  border-color: #ec4899;
}
.type-coworking.active {
  background: #ec4899;
  border-color: #ec4899;
}

.type-medical:hover {
  border-color: #ef4444;
}
.type-medical.active {
  background: #ef4444;
  border-color: #ef4444;
}

.type-showroom:hover {
  border-color: #6366f1;
}
.type-showroom.active {
  background: #6366f1;
  border-color: #6366f1;
}

.type-salon:hover {
  border-color: #ec4899;
}
.type-salon.active {
  background: #ec4899;
  border-color: #ec4899;
}

.type-gym:hover {
  border-color: #22c55e;
}
.type-gym.active {
  background: #22c55e;
  border-color: #22c55e;
}

.type-training:hover {
  border-color: #f59e0b;
}
.type-training.active {
  background: #f59e0b;
  border-color: #f59e0b;
}

.type-bookstore:hover {
  border-color: #a16207;
}
.type-bookstore.active {
  background: #a16207;
  border-color: #a16207;
}

.type-supermarket:hover {
  border-color: #0d9488;
}
.type-supermarket.active {
  background: #0d9488;
  border-color: #0d9488;
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.filter-label {
  font-size: 14px;
  font-weight: 500;
  color: #4a5568;
}

.filter-input,
.filter-select {
  padding: 12px 16px;
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  font-size: 15px;
  transition: all 0.3s ease;
  background: white;
  width: 100%;
}

/* Keep price min/max in one row */
.price-dropdowns {display:flex;gap:12px;align-items:center;flex-wrap:wrap;width: 80%;}
.price-dropdowns .filter-select { width:auto; min-width:140px; flex:1 1 140px; max-width:100%; }
.price-dropdowns .range-sep { color:#4a5568; font-size:14px; }
.price-dropdowns #resetPriceBtn { flex:0 0 auto; }

.filter-input:focus,
.filter-select:focus {
  outline: none;
  border-color: #3182ce;
  box-shadow: 0 0 0 3px rgba(49, 130, 206, 0.1);
}

.filter-input::placeholder {
  color: #a0aec0;
}

.filter-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 0;
  grid-column: 1 / -1;
}

.btn-filter {
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
}

.btn-primary {
  background: #3182ce;
  color: white;
}

.btn-primary:hover {
  background: #2c5aa0;
}

.btn-secondary {
  background: #e2e8f0;
  color: #4a5568;
}

.btn-secondary:hover {
  background: #cbd5e0;
}

.results-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 20px 0;
  padding: 0 4px;
}

.results-count {
  font-size: 14px;
  color: #4a5568;
}

.sort-dropdown {
  padding: 8px 12px;
  border: 2px solid #e2e8f0;
  border-radius: 8px;
  font-size: 14px;
  background: white;
}

/* Properties Section */
.properties {
  padding: 40px 0 80px 0;
  background: #f8fafc;
}

.section-title {
  text-align: center;
  margin-top: 60px;
  margin-bottom: 40px;
}

.section-title h2 {
  font-size: 32px;
  font-weight: 600;
  margin-bottom: 16px;
  color: #2d3748;
}

.section-title p {
  font-size: 16px;
  color: #4a5568;
  max-width: 600px;
  margin: 0 auto;
  line-height: 1.6;
}

.property-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
  margin-bottom: 50px;
  align-items: stretch;
}

.property-card {
  background: white;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  transition: all 0.3s ease;
  border: 1px solid #e2e8f0;
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
  min-width: 0;
}

.property-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
}

.property-card.hidden {
  display: none;
}

.property-image {
  width: 100%;
  height: 200px;
  background-size: cover;
  background-position: center;
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
}

.status-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  z-index: 2;
}

.status-available {
  background: #10b981;
  color: white;
}

.status-occupied {
  background: #ef4444;
  color: white;
}

.status-maintenance {
  background: #f59e0b;
  color: white;
}

.status-reserved {
  background: #fbbf24;
  color: white;
}

.property-info {
  /* Make card content layout consistent across varying text lengths */
  display: grid;
  grid-template-rows: auto 1fr auto; /* header | details | actions */
  flex: 1 1 auto;
  padding: 20px;
}

.property-header {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}

.property-title {
  font-size: 20px;
  font-weight: 700;
  color: #1a202c;
  margin-bottom: 4px;
  word-break: break-word;
  line-height: 1.3;
  /* Clamp to 2 lines for consistency */
  display: -webkit-box;
  line-clamp: 2;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: calc(1.3em * 2);
}

.property-desc {
  color: #718096;
  font-size: 12px;
  display: -webkit-box; /* allow clamping */
  line-clamp: 1;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.3;
  min-height: 1.3em; /* reserve space even if short */
}

.property-price {
  display: inline-flex;
  align-items: baseline;
  justify-content: center;
  gap: 6px;
  text-align: center;
  margin: 18px 0 0 0;
  padding: 12px 14px;
  border-radius: 12px;
  background: linear-gradient(180deg, #eaf2fd 0%, #dfeafe 100%);
  border: 1px solid #c7dbf8;
  box-shadow: 0 3px 10px rgba(43, 108, 176, 0.09);
  width: 100%;
  box-sizing: border-box;
}
.property-price .price-amount { font-size: 24px; font-weight: 800; color: #1f4e8c; letter-spacing: 0.5px; }
.property-price .price-term { font-size: 13px; font-weight: 600; color: #3b6bb3; opacity: 0.9; }

.property-details {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 16px 0 0 0;
  padding: 14px 12px;
  background: #f7fafc;
  border-radius: 8px;
  /* Reserve a consistent block size for details regardless of content length */
  min-height: 84px;
}

.detail-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 13px;
  color: #4a5568;
  min-height: 20px;
  line-height: 1.3;
  word-break: break-word;
}

.detail-icon {
  width: 18px;
  height: 18px;
  background: #cbd5e0;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  margin-top: 2px;
  flex-shrink: 0;
}

.property-actions {
  margin-top: 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.btn {
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
  flex: 1;
}

.btn-primary {
  background: #3182ce;
  color: white;
}

.btn-primary:hover {
  background: #2c5aa0;
}

.no-results {
  text-align: center;
  padding: 60px 20px;
  color: #4a5568;
}

.no-results h3 {
  font-size: 24px;
  margin-bottom: 12px;
  color: #2d3748;
}

/* Property Images - Extended for 12 units */
.prop-1 {
  background: linear-gradient(
      135deg,
      rgba(102, 126, 234, 0.9) 0%,
      rgba(118, 75, 162, 0.9) 50%,
      rgba(240, 147, 251, 0.9) 100%
    ),
    url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 400 200"><rect width="400" height="200" fill="%23f0f0f0"/><text x="200" y="100" text-anchor="middle" dy=".3em" fill="%23999" font-family="Arial" font-size="16">Office Space</text></svg>');
}
.prop-2 {
  background: linear-gradient(
      135deg,
      rgba(79, 172, 254, 0.9) 0%,
      rgba(0, 242, 254, 0.9) 100%
    ),
    url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 400 200"><rect width="400" height="200" fill="%23f0f0f0"/><text x="200" y="100" text-anchor="middle" dy=".3em" fill="%23999" font-family="Arial" font-size="16">Retail Space</text></svg>');
}
.prop-3 {
  background: linear-gradient(
      135deg,
      rgba(67, 233, 123, 0.9) 0%,
      rgba(56, 249, 215, 0.9) 100%
    ),
    url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 400 200"><rect width="400" height="200" fill="%23f0f0f0"/><text x="200" y="100" text-anchor="middle" dy=".3em" fill="%23999" font-family="Arial" font-size="16">Warehouse</text></svg>');
}
.prop-4 {
  background: linear-gradient(
      135deg,
      rgba(250, 112, 154, 0.9) 0%,
      rgba(254, 225, 64, 0.9) 100%
    ),
    url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 400 200"><rect width="400" height="200" fill="%23f0f0f0"/><text x="200" y="100" text-anchor="middle" dy=".3em" fill="%23999" font-family="Arial" font-size="16">Restaurant</text></svg>');
}
.prop-5 {
  background: linear-gradient(
      135deg,
      rgba(168, 237, 234, 0.9) 0%,
      rgba(254, 214, 227, 0.9) 100%
    ),
    url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 400 200"><rect width="400" height="200" fill="%23f0f0f0"/><text x="200" y="100" text-anchor="middle" dy=".3em" fill="%23999" font-family="Arial" font-size="16">Co-working</text></svg>');
}
.prop-6 {
  background: linear-gradient(
      135deg,
      rgba(255, 154, 158, 0.9) 0%,
      rgba(254, 207, 239, 0.9) 100%
    ),
    url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 400 200"><rect width="400" height="200" fill="%23f0f0f0"/><text x="200" y="100" text-anchor="middle" dy=".3em" fill="%23999" font-family="Arial" font-size="16">Medical Office</text></svg>');
}
.prop-7 {
  background: linear-gradient(
      135deg,
      rgba(99, 102, 241, 0.9) 0%,
      rgba(168, 85, 247, 0.9) 100%
    ),
    url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 400 200"><rect width="400" height="200" fill="%23f0f0f0"/><text x="200" y="100" text-anchor="middle" dy=".3em" fill="%23999" font-family="Arial" font-size="16">Showroom</text></svg>');
}
.prop-8 {
  background: linear-gradient(
      135deg,
      rgba(236, 72, 153, 0.9) 0%,
      rgba(239, 68, 68, 0.9) 100%
    ),
    url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 400 200"><rect width="400" height="200" fill="%23f0f0f0"/><text x="200" y="100" text-anchor="middle" dy=".3em" fill="%23999" font-family="Arial" font-size="16">Salon Space</text></svg>');
}
.prop-9 {
  background: linear-gradient(
      135deg,
      rgba(34, 197, 94, 0.9) 0%,
      rgba(59, 130, 246, 0.9) 100%
    ),
    url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 400 200"><rect width="400" height="200" fill="%23f0f0f0"/><text x="200" y="100" text-anchor="middle" dy=".3em" fill="%23999" font-family="Arial" font-size="16">Gym Space</text></svg>');
}
.prop-10 {
  background: linear-gradient(
      135deg,
      rgba(245, 158, 11, 0.9) 0%,
      rgba(217, 119, 6, 0.9) 100%
    ),
    url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 400 200"><rect width="400" height="200" fill="%23f0f0f0"/><text x="200" y="100" text-anchor="middle" dy=".3em" fill="%23999" font-family="Arial" font-size="16">Training Center</text></svg>');
}
.prop-11 {
  background: linear-gradient(
      135deg,
      rgba(139, 69, 19, 0.9) 0%,
      rgba(180, 83, 9, 0.9) 100%
    ),
    url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 400 200"><rect width="400" height="200" fill="%23f0f0f0"/><text x="200" y="100" text-anchor="middle" dy=".3em" fill="%23999" font-family="Arial" font-size="16">Bookstore</text></svg>');
}
.prop-12 {
  background: linear-gradient(
      135deg,
      rgba(20, 184, 166, 0.9) 0%,
      rgba(13, 148, 136, 0.9) 100%
    ),
    url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 400 200"><rect width="400" height="200" fill="%23f0f0f0"/><text x="200" y="100" text-anchor="middle" dy=".3em" fill="%23999" font-family="Arial" font-size="16">Supermarket</text></svg>');
}

/* Reveal Animation */
.reveal-element {
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.6s ease;
}

.reveal-element.revealed {
  opacity: 1;
  transform: translateY(0);
}

.scale-up {
  transform: scale(0.95) translateY(30px);
}

.scale-up.revealed {
  transform: scale(1) translateY(0);
}

/* Price slider styles */
.price-range { display:flex; flex-direction:column; gap:10px; }
.price-range-labels { display:flex; justify-content:space-between; font-size:14px; color:#2d3748; font-weight:600; }
.price-range-slider { position:relative; height:36px; }
.price-range-slider input[type="range"]{ position:absolute; left:0; right:0; top:8px; width:100%; pointer-events:none; appearance: none; -webkit-appearance:none; background:transparent; height:0; }
.price-range-slider input[type="range"]::-webkit-slider-thumb{ -webkit-appearance:none; pointer-events:auto; width:18px; height:18px; border-radius:50%; background:#3182ce; border:2px solid #fff; box-shadow:0 2px 8px rgba(49,130,206,.35); cursor:pointer; }
.price-range-slider input[type="range"]::-moz-range-thumb{ pointer-events:auto; width:18px; height:18px; border-radius:50%; background:#3182ce; border:2px solid #fff; box-shadow:0 2px 8px rgba(49,130,206,.35); cursor:pointer; }
.price-range-slider input[type="range"]::-webkit-slider-runnable-track{ height:4px; border-radius:8px; background:transparent; }
.price-range-slider input[type="range"]::-moz-range-track{ height:4px; border-radius:8px; background:transparent; }
.price-range-track{ position:absolute; left:0; right:0; top:16px; height:4px; border-radius:8px; background:linear-gradient(90deg, #e2e8f0 0%, #e2e8f0 100%); }
.price-range-track::before{ content:""; position:absolute; height:100%; border-radius:inherit; background:#3182ce; left:0; right:0; transform-origin:left center; }

@media (max-width: 575px){
  .price-range-labels { font-size:13px; }
}

/* ============================= */
/* RESPONSIVE DESIGN */
/* ============================= */

/* Tablets and small desktops (768px - 1024px) */
@media (max-width: 1024px) {
  .filter-content { grid-template-columns: repeat(6, 1fr); }
  .filter-category { grid-column: span 3; }
  .property-grid {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
  }
  
  .section-title h2 {
    font-size: 28px;
  }
  
  .container {
    padding: 0 16px;
  }
}

/* Tablets (768px - 991px) */
@media (max-width: 991px) {
  .filter-content { grid-template-columns: repeat(2, 1fr); }
  .filter-category { grid-column: span 1; }
  .property-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
  }
  
  .filter-section {
    padding: 20px;
  }
  
  .property-info {
    padding: 18px;
  }
}

/* Mobile Landscape & Small Tablets (576px - 767px) */
@media (max-width: 767px) {
  /* On mobile we keep the toggle behavior; stacked layout */
  .filter-content { display: none; }
  .filter-content.active { display: block; margin-top: 12px; }
  .filter-category { margin-bottom: 16px; }
  .property-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .section-title h2 {
    font-size: 24px;
  }
  
  .section-title {
    margin-top: 40px;
    margin-bottom: 30px;
  }

  .properties {
    padding: 20px 0 40px 0;
  }

  .container {
    padding: 0 15px;
  }

  .property-header {
    flex-direction: column;
    gap: 8px;
    align-items: flex-start;
  }

  .results-info {
    flex-direction: column;
    gap: 12px;
    align-items: flex-start;
  }
  
  .sort-dropdown {
    width: 100%;
  }

  .filter-toggle {
    display: block;
    background: #3182ce;
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    width: 100%;
  }
  
  .filter-section {
    padding: 18px;
    margin: 15px 0;
  }
  
  .filter-actions {
    flex-direction: column;
  }
  
  .btn-filter {
    width: 100%;
  }
  
  .property-details {
    flex-direction: row;
    flex-wrap: wrap;
  }
  
  .detail-item {
    flex: 1 1 calc(50% - 6px);
    min-width: 120px;
  }
  
  .property-actions {
    flex-direction: row;
  }
}

/* Mobile Portrait (481px - 575px) */
@media (max-width: 575px) {
  .price-dropdowns { flex-wrap:wrap; }
  .price-dropdowns .filter-select { width:100%; min-width:0; }
  .filter-title {
    font-size: 18px;
  }
  
  .filter-btn {
    font-size: 13px;
    padding: 7px 14px;
  }
  
  .button-filters {
    gap: 6px;
  }
  
  .property-image {
    height: 180px;
  }
  
  .property-price {
    font-size: 22px;
    padding: 8px 0;
  }
  /* On small screens make the price pill take full width and center its content */
  .property-price {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 12px 15px; /* keep pill feel but full width */
    margin: 5px 50px;
    box-sizing: border-box;
  }
  /* Allow details to grow naturally on small screens */
  .property-details { min-height: auto; }
}

/* Small Mobile (max-width: 480px) */
@media (max-width: 480px) {
  .property-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .property-info {
    padding: 16px;
  }

  .section-title h2 {
    font-size: 22px;
  }

  .section-title p {
    font-size: 14px;
    padding: 0 10px;
  }

  .property-title {
    font-size: 18px;
  }

  .property-price {
    font-size: 20px;
    padding: 8px 0;
  }

  .button-filters {
    justify-content: flex-start;
  }

  .property-details {
    grid-template-columns: 1fr;
    flex-direction: column;
  }
  
  .detail-item {
    flex: 1 1 100%;
  }
  
  .property-actions {
    flex-direction: column;
  }
  /* Allow details to grow naturally on very small screens */
  .property-details { min-height: auto; }
  
  .btn {
    width: 100%;
  }
  
  .filter-section {
    padding: 16px;
    border-radius: 12px;
  }
  
  .filter-category {
    margin-bottom: 20px;
  }
  
  .status-badge {
    top: 8px;
    left: 8px;
    padding: 3px 10px;
    font-size: 11px;
  }
  
  .no-results h3 {
    font-size: 20px;
  }
  
  .no-results {
    padding: 40px 20px;
  }
  
  .property-card:hover {
    transform: translateY(-4px);
  }
}

/* Extra Small Mobile (max-width: 360px) */
@media (max-width: 360px) {
  .container {
    padding: 0 12px;
  }
  
  .section-title h2 {
    font-size: 20px;
  }
  
  .section-title p {
    font-size: 13px;
  }
  
  .property-title {
    font-size: 16px;
  }
  
  .property-price {
    font-size: 18px;
  }
  
  .filter-btn {
    font-size: 12px;
    padding: 6px 12px;
  }
  
  .property-image {
    height: 160px;
  }
  
  .detail-item {
    font-size: 12px;
  }
  
  .btn {
    font-size: 12px;
    padding: 10px 14px;
  }
}