/* Layout */
.property-grid-container {
  display: flex;
  gap: 20px;
  margin: 2rem;
  position: relative;
}

.filters {
  flex: 0 0 250px;      /* sidebar fixed width */
  max-width: 250px;
}

.property-grid-wrapper {
  flex: 1;              /* grid takes remaining space */
  min-height: 340px;
}

.property-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  grid-auto-flow: dense; /* backfill gaps when items hide */
}

@media (max-width: 1200px) {
  .property-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 900px) {
  .property-grid-container {
    flex-direction: column;   /* stack filters on top */
  }
  .filters {
    flex: none;
    width: 100%;
    max-width: 100%;
    margin-bottom: 1rem;
  }
  .property-grid-wrapper {
    flex: none;
    width: 100%;
  }
  .property-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
  .property-grid { grid-template-columns: repeat(1, 1fr); }
}

/* Card */
.property-card {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  height: 400px;
  background-size: cover;
  background-position: center center;
  opacity: 1;
  transform: scale(1);
  transition: opacity .28s ease, transform .28s ease;
}

.property-card::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(to bottom, rgba(0,0,0,.38), rgba(0,0,0,.1));
  transition: opacity .25s ease;
}

.property-card:hover::before { opacity: 0; }
.property-card:hover { transform: scale(1.02); }

.property-card.will-hide { opacity: 0; transform: scale(.96); }
.property-card.is-hidden { display: none !important; }

.property-title {
  position: absolute;
  top: .75rem;
  left: .75rem;
  z-index: 2;
  color: #fff;
  font-size: 1.5rem !important;
  line-height: 1.2;
  margin: 0;
}

.buttons {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 1rem;
  position: absolute;
  left: 0;
  right: 0;
  bottom: .25rem;
  z-index: 2;
}

.buttons a,
.buttons button {
  padding: .45rem 1rem;
  border: none;
  border-radius: 999px;
  font-size: .9rem;
  cursor: pointer;
  text-decoration: none;
  transition: background-color .25s ease, color .25s ease, transform .2s ease;
}

/* Details */
.buttons a {
  background: #fff;
  color: #7a7a7a;
}
.buttons a:hover { color: #202020; }

/* Let */
.buttons button.let {
  background: rgb(255,220,220);
  color: #202020;
}
.buttons button.let:hover {
  background: rgb(255,84,84);
}

/* Available */
.buttons button.available {
  background: rgb(205,239,255);
  color: #202020;
}
.buttons button.available:hover {
  background: rgb(125,214,255);
}

/* Preloader */
.property-preloader {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f7f7f7;
  z-index: 5;
  opacity: 1;
  transition: opacity .3s ease;
  pointer-events: auto;
}
.property-preloader.is-hidden {
  opacity: 0;
  pointer-events: none;
}
.spinner {
  width: 44px;
  height: 44px;
  border: 4px solid #cfcfcf;
  border-top-color: #444;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Empty */
.property-empty {
  padding: 2rem;
  text-align: center;
  color: #555;
}
