/* Responsive Grid Layouts for Listing Pages */

/* Base styling for listing grids */
.listing-grid {
  display: flex;
  flex-wrap: wrap;
  margin: 0 -0.5rem;
}

/* Consistent card styling across all listing types */
.listing-item {
  height: 100%;
  display: flex;
}

.listing-item .card {
  width: 100%;
  height: 100%;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  overflow: hidden;
}

/* Card hover effects */
.listing-item .card:hover {
  transform: translateY(-3px);
  box-shadow: 0 0.25rem 0.75rem rgba(0, 0, 0, 0.1) !important;
}

/* Consistent image heights */
.listing-item .card-img-top {
  height: 176px;
  object-fit: cover;
  width: 100%;
}

/* Card body layout */
.listing-item .card-body {
  display: flex;
  flex-direction: column;
  padding: 0.5rem;
}

.listing-item .card-title {
  font-size: 1rem;
  font-weight: 500;
  margin-bottom: 0.25rem;
}

.listing-item p {
  margin-bottom: 0.25rem;
  font-size: 0.875rem;
}

/* Grid sizing adjustments for different screen sizes */
@media (min-width: 576px) {
  .listing-item .card-body {
    padding: 0.75rem;
  }
  
  /* More space between cards on larger screens */
  .row-cols-sm-2 > .col,
  .row-cols-md-3 > .col,
  .row-cols-lg-3 > .col {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
  }
}

@media (min-width: 768px) {
  .listing-item .card-body {
    padding: 1rem;
  }
  
  /* Even more space on tablets and up */
  .row-cols-md-3 > .col,
  .row-cols-lg-3 > .col {
    padding-left: 1rem;
    padding-right: 1rem;
  }
  
  .g-4 {
    --bs-gutter-y: 1.5rem;
  }
}

/* Fix for when map is hidden - adjust column widths */
.col-12 .row-cols-md-4 > .col {
  flex: 0 0 auto;
  width: 25%;
}

@media (max-width: 991.98px) {
  .col-12 .row-cols-md-4 > .col {
    width: 33.333333%;
  }
}

@media (max-width: 767.98px) {
  .col-12 .row-cols-md-4 > .col {
    width: 50%;
  }
  
  .listing-item .card-img-top {
    height: 140px;
  }
}

@media (max-width: 575.98px) {
  .col-12 .row-cols-md-4 > .col,
  .col-12 .row-cols-md-3 > .col {
    width: 100%;
  }
  
  .listing-item .card-img-top {
    height: 160px;
  }
  
  .g-4 {
    --bs-gutter-y: 1rem;
  }
}

/* Spacing between rows */
.row > .col {
  margin-bottom: 1rem;
}

/* Map container responsive handling */
.sticky-top {
  z-index: 100;
  top: 1rem;
}

.h-vh-minus-150 {
  height: calc(100vh - 150px);
  min-height: 400px;
}

@media (max-width: 767.98px) {
  .h-vh-minus-150 {
    height: 400px;
    min-height: 300px;
  }
}
