/* Property card styling fixes */

/* Fix for stretching cards */
.listing-item {
  display: flex;
}

.listing-item .card {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.listing-item .card .card-body {
  flex: 1 0 auto;
  display: flex;
  flex-direction: column;
  padding: 1rem; /* Default padding */
}

.listing-item .card .card-footer {
  margin-top: auto;
}

/* Card image defaults: do not force a global fixed height here.
   Let component classes (e.g., h-176) control height to avoid
   inconsistent spacing in grids. */
.card-img-top {
  object-fit: cover;
  width: 100%;
}

/* Height utility classes - used by rental and shortstay cards */
.h-176 {
  height: 176px; /* Default height for desktop */
}

.h-137 {
  height: 137px; /* Default height for smaller cards */
}

/* Card title text handling */
.card-title.text-truncate,
.text-truncate {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

/* Spacing for property details */
.property-details {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

/* Make touch targets bigger */
.card a, 
.card-body .d-flex > div,
.property-details span {
  min-height: 32px;
  display: flex;
  align-items: center;
}

/* Responsive adjustments */
@media (max-width: 991.98px) {
  .h-176 {
    height: 160px; /* Slightly shorter on tablet */
  }
  
  .h-137 {
    height: 130px;
  }
  
  .card-img-top {
    height: auto; /* Let the height be determined by the container */
  }
  
  .card-body p {
    margin-bottom: 0.35rem;
  }
}

/* Mobile adjustments */
@media (max-width: 767.98px) {
  .h-176 {
    height: 140px; /* Even shorter on mobile */
  }
  
  .h-137 {
    height: 120px;
  }
  
  .listing-item .card .card-body {
    padding: 0.75rem; /* Less padding on mobile */
  }
  
  .card-title {
    font-size: 0.9rem; /* Smaller font on mobile */
  }
  
  /* Simplify property details on very small screens */
  .property-details {
    gap: 0.35rem;
  }
}

/* Small mobile screens */
@media (max-width: 480px) {
  .h-176 {
    height: 120px; /* Shortest on smallest screens */
  }
  
  .h-137 {
    height: 100px;
  }
  
  .listing-item .card .card-body {
    padding: 0.5rem; /* Minimal padding on smallest screens */
  }
  
  .card-body p {
    margin-bottom: 0.25rem;
    font-size: 0.8rem;
  }
  
  /* Hide some less important info on very small screens */
  .d-sm-none {
    display: none !important;
  }
}

/* Card hover effects */
.hover-lift:hover {
  transform: translateY(-3px);
  box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15) !important;
  transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

/* Ensure cards have proper border-radius throughout */
.rounded-12 {
  border-radius: 12px !important;
}

/* Ensure all card shadows are consistent */
.shadow-sm {
  box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075) !important;
}
