/* Card layout fixes for mobile responsiveness */

/* Card grid alignment */
.row-cols-2 > .col.listing-item {
  padding-right: 0.5rem;
  padding-left: 0.5rem;
  margin-bottom: 1rem;
}

/* Card container */
.listing-item {
  display: flex;
  break-inside: avoid;
}

/* Card structure */
.card {
  width: 100%;
  overflow: hidden;
}

/* Image container */
.card-img-container {
  position: relative;
  width: 100%;
  height: 176px;
  overflow: hidden;
}

/* Card image top */
.card-img-top {
  width: 100%;
  height: 176px !important;
  object-fit: cover;
}

/* Fallback for missing images */
.card-img-top.bg-light {
  width: 100%;
  height: 176px !important;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Property details container */
.property-details {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  margin-top: auto;
}

/* Property detail item */
.property-details span {
  display: flex;
  align-items: center;
  white-space: nowrap;
}

/* Card hover effects */
.hover-lift {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.hover-lift:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 20px rgba(0,0,0,0.1) !important;
}

/* Media query fixes */
@media (max-width: 575.98px) {
  .row-cols-2 > .col.listing-item {
    padding-right: 0.25rem;
    padding-left: 0.25rem;
    margin-bottom: 0.5rem;
  }
  
  .card-img-top,
  .card-img-container,
  .card-img-top.bg-light {
    height: 140px !important;
  }
  
  .card-body {
    padding: 0.75rem !important;
  }
  
  .card-title {
    font-size: 0.875rem !important;
  }
  
  .property-details {
    gap: 0.25rem 0.75rem;
  }
  
  .property-details span {
    font-size: 0.75rem;
  }
}

/* Make sure lazily loaded images maintain structure */
.lazy-image {
  opacity: 0.2;
  transition: opacity 0.3s ease;
  min-height: 100px;
}

.lazy-image.loaded {
  opacity: 1;
}
