/* ============================================
   Listing Cards - Smooth Initial Render
   ============================================ */

/* Prevent flash during initial render */
.showcaseidx-results-grid,
.idx-listing-grid,
.property-grid,
.sidx-grid,
.sidx-search-results {
  min-height: 400px;
}

/* Smooth fade-in for grids */
.showcaseidx-results-grid,
.idx-listing-grid,
.property-grid,
.sidx-grid {
  animation: fadeInUp 0.6s ease-out;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ============================================
   Card Images & Layout
   ============================================ */

/* Main listing images */
.showcaseidx-results-grid img,
.idx-listing-grid img,
.property-grid img,
.sidx-grid img,
.sidx-search-result-grid-item img {
  width: 100%;
  height: auto;
  display: block;
}

/* Property card images should have consistent height */
.showcaseidx-results-grid .property-image img,
.idx-listing-grid .property-image img,
.property-grid .property-image img {
  height: 250px;
  object-fit: cover;
}

/* Prevent individual cards from jumping */
.showcaseidx-results-grid > div,
.idx-listing-grid > div,
.property-grid > div,
.sidx-grid > div,
.sidx-search-result-grid-item {
  will-change: transform;
  backface-visibility: hidden;
  transform: translateZ(0);
}

/* MLS/Brokerage logos should remain crisp and contained */
.showcaseidx-results-grid .broker-logo img,
.idx-listing-grid .broker-logo img,
.property-grid .broker-logo img,
.sidx-search-result-grid-item img[src*="logo"],
.sidx-search-result-grid-item img[src*="mireal"],
.sidx-search-result-grid-item img[alt*="MLS"],
.sidx-search-result-grid-item img[alt*="Real"],
img[src*="logo"],
img[alt*="MLS"],
img[alt*="Realtor"] {
  image-rendering: -webkit-optimize-contrast;
  image-rendering: crisp-edges;
  height: auto
  width: auto !important;
  max-width: 150px;
  max-height: 50px;
  object-fit: contain !important;
  background: transparent !important;
}

/* Maps fade in smoothly */
.sidx-map-container,
.showcaseidx-map,
.showcaseidx-results-map {
  animation: fadeInUp 0.8s ease-out;
}

/* ============================================
   Listing Card Structure
   ============================================ */

/* Ensure cards have proper spacing and structure */
.showcaseidx-results-grid > div,
.property-grid > div {
  background: white;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s;
}

.showcaseidx-results-grid > div:hover,
.property-grid > div:hover {
  transform: translateY(-4px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

/* Card content padding */
.showcaseidx-results-grid .property-details,
.property-grid .property-details {
  padding: 15px;
}

/* Price styling */
.showcaseidx-results-grid .property-price,
.property-grid .property-price {
  font-size: 1.5em;
  font-weight: bold;
  color: #333;
  margin-bottom: 10px;
}

/* Address styling */
.showcaseidx-results-grid .property-address,
.property-grid .property-address {
  font-size: 1.1em;
  color: #666;
  margin-bottom: 8px;
}

/* ============================================
   Our Listings Page - Prevent Flash
   ============================================ */

/* Hide the entire IDX container briefly on initial load */
body.page .sidx-widget-wrapper {
  animation: delayedFadeIn 1.2s ease-out;
}

@keyframes delayedFadeIn {
  0%, 40% {
    opacity: 0;
  }
  100% {
    opacity: 1;
  }
}