/* property-card.css */
.property-card {
  background-color: var(--bg-primary);
  border-radius: var(--border-radius-md); /* Use variable */
  overflow: hidden;
  box-shadow: var(--shadow-sm); /* Use variable */
  transition: var(--transition-base);
  border: 1px solid var(--border-color); /* Add subtle border */
  display: flex; /* Use flexbox for better structure */
  flex-direction: column; /* Stack image and details */
  height: 100%; /* Ensure cards in a grid have same height */
}

.property-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-md); /* Use variable */
}

.property-image {
  position: relative;
  overflow: hidden;
  line-height: 0; /* Remove potential space below image */
  padding-top: 60%; /* Aspect Ratio (e.g., 5:3) - adjust as needed */
  background-color: var(--bg-secondary); /* Placeholder background */
}

.property-image img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease; /* Smoother zoom */
}

.property-card:hover .property-image img {
  transform: scale(1.05); /* Subtle zoom on hover */
}

.property-image .label {
  position: absolute;
  top: var(--spacing-sm); /* Use variable */
  padding: 4px 10px; /* Adjust padding */
  border-radius: var(--border-radius-pill); /* Pill shape */
  font-size: var(--font-size-xs); /* Use variable */
  font-weight: 600;
  z-index: 2;
  text-transform: uppercase; /* Uppercase labels */
  letter-spacing: 0.5px;
  line-height: 1.4; /* Ensure text fits */
}

.property-image .label.featured {
  left: var(--spacing-sm);
  background-color: var(--primary-color);
  color: var(--text-on-primary);
}

.property-image .label.for-sale {
  /* Or for-rent, etc. */
  right: var(--spacing-sm);
  background-color: var(--accent-color); /* Use accent color */
  color: var(--text-light);
}

/* Optional Image Overlay (Example) */
.property-image .image-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(
    to top,
    rgba(0, 0, 0, 0.6) 0%,
    rgba(0, 0, 0, 0) 100%
  );
  padding: var(--spacing-sm);
  color: var(--text-light);
  font-size: var(--font-size-sm);
  z-index: 1;
  display: flex;
  justify-content: flex-end; /* Align icons right */
  gap: var(--spacing-md);
  opacity: 0; /* Hidden by default */
  transition: opacity 0.3s ease;
}

.property-card:hover .image-overlay {
  opacity: 1; /* Show on hover */
}

.image-overlay i {
  margin-right: 4px;
}

.property-details {
  padding: var(--spacing-md); /* Use variable */
  display: flex;
  flex-direction: column;
  flex-grow: 1; /* Allow details section to grow */
}

.property-details h3 {
  color: var(--secondary-color); /* Darker heading */
  font-size: var(--font-size-lg); /* Slightly larger title */
  margin-top: 0;
  margin-bottom: var(--spacing-xs); /* Less space below title */
  line-height: 1.3;
  font-family: var(--font-primary);
  font-weight: 700;
  /* Truncate long titles (optional) */
  display: -webkit-box;
  line-clamp: 2; /* Limit to 2 lines */
  -webkit-line-clamp: 2; /* Limit to 2 lines */
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  min-height: calc(1.3em * 2); /* Ensure space for 2 lines */
}

.property-details .address {
  color: var(--text-secondary);
  font-size: var(--font-size-xs); /* Smaller address font */
  margin-bottom: var(--spacing-sm); /* Reduced space below address */
  display: flex; /* Align icon and text */
  align-items: center;
  gap: var(--spacing-xs);
}
.property-details .address i {
  color: var(--primary-color); /* Color the location icon */
  flex-shrink: 0; /* Prevent icon shrinking */
}

.property-details .specs {
  list-style: none;
  padding: var(--spacing-sm) 0;
  margin: 0 0 var(--spacing-sm) 0; /* Reduced space below specs */
  display: grid; /* Use grid for alignment */
  grid-template-columns: repeat(
    auto-fit,
    minmax(70px, 1fr)
  ); /* Responsive columns, adjust minmax */
  gap: var(--spacing-sm) var(--spacing-md); /* Row and column gap */
  color: var(--text-secondary);
  font-size: var(--font-size-sm);
  text-align: left; /* Align text left within grid items */
  border-top: 1px solid var(--border-color); /* Separator line */
  border-bottom: 1px solid var(--border-color); /* Separator line */
}

.property-details .specs li {
  display: flex;
  align-items: center; /* Align icon and text horizontally */
  justify-content: flex-start; /* Align items left */
  gap: var(--spacing-xs); /* Space between icon and text */
}

.property-details .specs i {
  font-size: 1.1em; /* Adjust icon size relative to text */
  color: var(--primary-color); /* Use primary color for icons */
  width: 20px; /* Fixed width for alignment */
  text-align: center;
  flex-shrink: 0;
}

/* Price and Actions - Push to bottom */
.price-actions {
  margin-top: auto; /* Push to the bottom */
  padding-top: var(--spacing-sm); /* Reduced space above price/actions */
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--spacing-md); /* Add gap between price and actions */
}

.price {
  display: flex;
  flex-direction: column;
  align-items: flex-start; /* Align price left */
  line-height: 1.2; /* Adjust line height for price */
}

.price .original-price {
  font-size: var(--font-size-xs);
  color: var(--text-secondary);
  text-decoration: line-through;
  margin-bottom: 2px; /* Small space */
}

.price .current-price {
  font-size: var(--font-size-lg); /* Prominent price */
  color: var(--primary-color); /* Use primary color for price */
  font-weight: 700;
  font-family: var(--font-primary); /* Use primary font for price */
}

.actions {
  display: flex;
  gap: var(--spacing-sm); /* Space between action buttons */
  flex-shrink: 0; /* Prevent actions shrinking */
}

/* .actions button, .actions a moved to global.css as .action-btn */

/* Optional Agent Profile (If added later) */
/* .agent-profile { ... } */

/* Responsive Adjustments */
@media (max-width: 480px) {
  .property-details h3 {
    font-size: var(--font-size-md); /* Slightly smaller title */
    min-height: calc(1.3em * 2); /* Adjust min height */
  }
  .property-details .specs {
    grid-template-columns: repeat(2, 1fr); /* 2 columns on small mobile */
    font-size: var(--font-size-xs); /* Smaller text */
  }
  .price .current-price {
    font-size: var(--font-size-md); /* Smaller price */
  }
  .actions .action-btn {
    width: 32px;
    height: 32px;
  }
  .actions .action-btn i {
    font-size: var(--font-size-xs);
  }
}
