/* ==========================================================================
   Releve MLS Listings Styles - Combined & Refined
   ========================================================================== */

/* ==========================================================================
   Global & Base Styles (Example - Add theme overrides if needed)
   ========================================================================== */
/* Add any general base styles or resets specific to the plugin elements if necessary */
/* Global Reset for Plugin Elements to prevent theme conflicts */
[class^="releve-"], [class*=" releve-"] {
    box-sizing: border-box;
}


/* ==========================================================================
   Listing Grid & Cards (Used across Search, Neighborhoods, Similar, Agent)
   ========================================================================== */
.listings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); /* Default grid - reduced min width for mobile */
    gap: 20px;
    margin-bottom: 20px; /* Added margin */
}

.releve-listing-card {
    border: 1px solid #ddd;
    border-radius: 5px;
    overflow: hidden;
    background-color: #fff;
    transition: box-shadow 0.3s ease;
    position: relative; /* For overlays */
    display: flex; /* Use flexbox for vertical alignment */
    flex-direction: column; /* Stack image and content */
    text-decoration: none; /* Ensure card link has no underline */
    color: inherit; /* Inherit text color */
}

.releve-listing-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.releve-listing-image-wrapper {
    position: relative;
    width: 100%;
    height: 200px; /* Consistent height */
    overflow: hidden;
}

.releve-listing-image-container {
    position: relative;
    width: 100%;
    height: 100%;
}

.releve-listing-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease; /* Add subtle zoom on hover */
}

.releve-listing-card:hover .releve-listing-image {
     transform: scale(1.03); /* Zoom effect */
}

.releve-listing-content {
    padding: 15px;
    flex-grow: 1; /* Allow content to grow and push footer down */
    display: flex;
    flex-direction: column; /* Stack content items */
}

.releve-listing-title {
    font-size: 1.1em; /* Adjusted size */
    font-weight: 600; /* Slightly bolder */
    margin-bottom: 8px;
    color: #333;
    line-height: 1.3;
}

.releve-listing-subdivision {
    font-size: 0.9em;
    color: #666;
    margin-bottom: 8px;
}

/* .releve-listing-price { ... } /* This class seemed unused in favor of overlay */

.releve-listing-details {
    font-size: 0.9em;
    color: #555;
    margin-bottom: 8px;
    line-height: 1.4;
}

.releve-listing-company {
    margin-top: auto; /* Push to bottom */
    padding-top: 10px; /* Space above */
    font-size: 0.75em; /* Smaller text */
    color: #777; /* Lighter color */
    font-style: italic;
    border-top: 1px solid #eee;
    /* pointer-events: none; /* Removed this - might be clickable */
}

/* Card Overlays */
.releve-price-overlay {
    position: absolute;
    bottom: 10px;
    left: 10px;
    background: rgba(0, 0, 0, 0.75); /* Slightly darker */
    color: white;
    padding: 5px 10px;
    border-radius: 4px;
    font-weight: bold;
    font-size: 1em; /* Relative size */
    z-index: 3;
    pointer-events: none;
}

.releve-photo-count-overlay {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.75);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    z-index: 2;
    font-size: 0.8em;
    display: flex; /* Align icon and text */
    align-items: center;
    gap: 4px;
}

.releve-status-overlay {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 4; /* Above price/photo count */
    color: white;
    padding: 4px 9px;
    border-radius: 4px;
    font-size: 0.8em;
    font-weight: bold;
    text-transform: uppercase;
    /* Background colors defined below */
}

.releve-status-overlay.releve-sold {
    background-color: #dc3545; /* Red */
}

.releve-status-overlay.releve-pending {
    background-color: #ffc107; /* Yellow */
    color: #333; /* Darker text for yellow */
}

.releve-status-overlay.releve-active { /* Optional: Add active badge */
     background-color: #28a745; /* Green */
}

/* Sold Listing Specific Card Styles (Price Change Colors - Apply to specific elements if needed) */
.releve-sold-listing .price-above { color: #2ecc71; font-weight: bold; }
.releve-sold-listing .price-below { color: #e74c3c; font-weight: bold; }
.releve-sold-listing .price-same { color: #7f8c8d; }

/* Tint overlay for sold listings (Optional visual cue) */
.releve-sold-listing .releve-listing-image-container::after {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background-color: rgba(220, 53, 69, 0.08); /* Subtle red tint */
    pointer-events: none;
    z-index: 1;
}
.releve-sold-listing.price-above .releve-listing-image-container::after {
     background-color: rgba(46, 204, 113, 0.08); /* Subtle green tint */
}


/* ==========================================================================
   Search Forms (Basic & Advanced)
   ========================================================================== */

.releve-search,
.releve-advanced-search {
    margin-bottom: 25px;
    padding: 20px;
    background: #f9f9f9;
    border-radius: 5px;
    border: 1px solid #e9e9e9;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

/* Basic Search Row */
.releve-search-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center; /* Align items vertically */
}

.releve-search input[type="text"],
.releve-search select {
    padding: 10px 12px;
    border: 1px solid #ccc;
    border-radius: 3px;
    font-size: 1em;
    flex-grow: 1; /* Allow inputs to grow */
    min-width: 150px; /* Minimum width for inputs */
    max-width: 100%; /* Prevent overflow on small screens */
}
.releve-search input[name="search_query"] {
    flex-basis: 300px; /* Give search query more space */
}

.releve-search button, /* Search button */
.releve-map-button, /* Map toggle/view button */
.releve-advanced-button { /* Link to advanced search */
    padding: 10px 18px;
    border: none;
    border-radius: 3px;
    font-size: 1em;
    cursor: pointer;
    transition: background-color 0.3s ease, box-shadow 0.2s ease;
    text-decoration: none;
    white-space: nowrap; /* Prevent wrapping */
    line-height: 1.5; /* Ensure consistent height */
}

/* Style specific buttons */
.releve-search button { /* Primary action */
    background-color: #0073aa;
    color: white;
}
.releve-search button:hover {
    background-color: #005d87;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.releve-map-button { /* Secondary/Map action */
    background-color: #5cb85c;
    color: white;
}
.releve-map-button:hover {
    background-color: #4cae4c;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.releve-advanced-button { /* Tertiary/Link action */
    background-color: #f0f0f0;
    color: #337ab7; /* Link color */
    border: 1px solid #ddd;
}
.releve-advanced-button:hover {
    background-color: #e7e7e7;
    border-color: #ccc;
}

/* Advanced Search Layout */
.releve-advanced-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); /* Adjust min size */
    gap: 20px 15px; /* Row and column gap */
    margin-bottom: 20px;
}

.releve-advanced-group {
    display: flex;
    flex-direction: column;
    gap: 10px; /* Space between elements in a group */
}

.releve-advanced-group h3 {
    font-size: 1.1em; /* Smaller heading */
    color: #444;
    margin: 0 0 8px;
    padding-bottom: 5px;
    border-bottom: 1px solid #ddd;
    font-weight: 600;
}
.releve-advanced-group h3 label { cursor: default; }

.releve-advanced-search label {
    font-size: 0.9em;
    color: #555;
    margin-bottom: 3px;
    display: block; /* Make label take full width */
}
.releve-advanced-search label[for] { cursor: pointer; }

.releve-advanced-search input[type="text"],
.releve-advanced-search input[type="number"],
.releve-advanced-search select {
    width: 100%;
    padding: 9px 10px;
    border: 1px solid #ccc;
    border-radius: 3px;
    font-size: 0.95em;
    box-sizing: border-box;
}

/* Checkbox styling */
.releve-advanced-search .checkbox-group {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 5px;
}
.releve-advanced-search input[type="checkbox"] {
    width: auto;
    margin: 0;
    flex-shrink: 0;
}
.releve-advanced-search .checkbox-group label {
    margin: 0;
    font-size: 0.95em;
    font-weight: normal;
    color: #555;
}

.releve-advanced-actions {
    text-align: center;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.releve-advanced-search button[type="submit"] {
    padding: 11px 25px;
    background-color: #0073aa;
    color: white;
    border: none;
    border-radius: 3px;
    font-size: 1.05em;
    cursor: pointer;
    transition: background-color 0.3s ease;
}
.releve-advanced-search button[type="submit"]:hover {
    background-color: #005d87;
}
.releve-reset-button {
    margin-left: 15px;
    padding: 10px 20px;
    background-color: #f5f5f5;
    color: #0073aa;
    text-decoration: none;
    border-radius: 3px;
    border: 1px solid #ddd;
    transition: background-color 0.3s ease;
    font-size: 1em;
}
.releve-reset-button:hover {
    background-color: #e0e0e0;
}

/* Results Info */
.releve-search-results-info {
    margin-bottom: 15px;
    padding: 10px 15px;
    background-color: #eef7ff;
    border: 1px solid #cce3ff;
    border-radius: 4px;
    font-size: 0.95em;
    color: #333;
}


/* ==========================================================================
   Detailed Listing Page
   ========================================================================== */

.releve-detail-page {
    position: relative;
    max-width: 1200px;
    margin: 20px auto;
    padding: 0 15px;
}

/* Share Container */
.releve-share-container {
    position: absolute; /* Positioned via JS/inline styles usually */
    top: 15px;
    right: 15px;
    z-index: 1000; /* High z-index */
}
.releve-share-container .a2a_kit {
    background-color: rgba(255, 255, 255, 0.9);
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    padding: 8px;
    display: flex; /* Modern AddToAny uses flex */
    flex-direction: column; /* Stack icons vertically */
    gap: 5px; /* Space between icons */
}
.releve-share-container .a2a_button_facebook, /* Example selectors */
.releve-share-container .a2a_button_twitter,
.releve-share-container .a2a_button_email,
.releve-share-container .a2a_button_sms {
    margin: 0 !important; /* Override default margins if needed */
    display: inline-flex !important; /* Ensure proper display */
    vertical-align: middle; /* Align icons */
}
.releve-share-container .a2a_kit a { /* General button styling */
    width: 32px; /* Consistent size */
    height: 32px;
    line-height: 32px; /* Center icon */
    text-align: center;
    border-radius: 3px; /* Slightly rounded */
}
.releve-share-container .a2a_kit a:hover { opacity: 0.8; }

@media (max-width: 768px) {
  .releve-share-container {
    top: auto; /* Reset top positioning */
    bottom: 15px; /* Position at the bottom */
    right: 15px; /* Keep right positioning */
  }
}

/* Detail Page Header */
.releve-detail-title {
    font-size: 2.2em;
    margin-bottom: 5px;
    color: #222;
    line-height: 1.2;
}
.releve-detail-price {
    font-size: 1.8em;
    font-weight: bold;
    color: #0073aa;
    margin-bottom: 20px;
}
.price-reduction {
    font-size: 0.7em;
    color: #e74c3c;
    text-decoration: line-through;
    margin-left: 10px;
    display: inline-block;
    font-weight: normal;
}

/* Detail Page Summary Bar */
.releve-detail-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 15px 25px;
    background-color: #f0f5f9;
    padding: 15px 20px;
    border-radius: 5px;
    margin-bottom: 25px;
    border: 1px solid #e0e5e9;
}
.releve-detail-summary p {
    margin: 0;
    font-size: 1em;
    color: #333;
    display: flex;
    align-items: center;
    gap: 8px;
}
.releve-detail-summary p i { /* Font Awesome icons */
    color: #0073aa;
    font-size: 1.2em;
    width: 20px;
    text-align: center;
}

/* Detail Page Gallery */
.releve-detail-gallery {
    position: relative;
    width: 100%;
    box-sizing: border-box;
    margin-bottom: 30px;
}
.releve-main-image-wrapper {
    margin-bottom: 10px;
    border: 1px solid #eee;
    border-radius: 5px;
    overflow: hidden;
    background-color: #f0f0f0; /* Background for contain */
}
.releve-detail-main-image {
    width: 100%;
    max-height: 600px;
    height: auto;
    object-fit: contain; /* Show whole image */
    display: block;
}

/* Thumbnails Container */
.releve-thumbnails-container {
    position: relative;
}
.releve-detail-thumbnails {
    display: flex !important;
    flex-flow: row nowrap !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
    width: 100%;
    padding: 10px;
    white-space: nowrap;
    box-sizing: border-box;
    scroll-behavior: smooth;
    cursor: grab;
    background: #f9f9f9;
    border: 1px solid #eee;
    border-radius: 4px;
}
.releve-detail-thumbnails::-webkit-scrollbar { height: 8px; }
.releve-detail-thumbnails::-webkit-scrollbar-track { background: #f1f1f1; border-radius: 4px; }
.releve-detail-thumbnails::-webkit-scrollbar-thumb { background: #ccc; border-radius: 4px; }
.releve-detail-thumbnails::-webkit-scrollbar-thumb:hover { background: #aaa; }

.releve-detail-thumbnail {
    flex: 0 0 auto;
    width: 100px;
    height: 75px;
    margin-right: 10px;
    object-fit: cover;
    cursor: pointer;
    border: 3px solid transparent;
    border-radius: 3px;
    transition: border-color 0.2s ease, opacity 0.2s ease;
    opacity: 0.8;
}
.releve-detail-thumbnail:last-child { margin-right: 0; }
.releve-detail-thumbnail.active,
.releve-detail-thumbnail:hover {
    border-color: #0073aa;
    opacity: 1;
}

/* Gallery Scroll Arrows */
.releve-gallery-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.6);
    color: white;
    border: none;
    padding: 0;
    cursor: pointer;
    z-index: 10;
    border-radius: 50%;
    width: 34px;
    height: 34px;
    font-size: 20px;
    line-height: 34px;
    text-align: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}
.releve-thumbnails-container:hover .releve-gallery-arrow { opacity: 0.7; }
.releve-gallery-arrow:hover { opacity: 1; }
.releve-gallery-arrow.left { left: -17px; }
.releve-gallery-arrow.right { right: -17px; }

/* Detail Page Main Content Layout */
.releve-main-content-area {
    display: flex;
    flex-wrap: wrap;
    gap: 40px;
    margin-top: 30px;
    margin-bottom: 30px;
}
.releve-content-left {
    flex: 2;
    min-width: 320px;
    order: 1;
}
.releve-content-right { /* Sidebar */
    flex: 1;
    min-width: 300px;
    order: 2;
    position: sticky;
    top: 30px;
    align-self: flex-start;
    max-height: calc(100vh - 60px); /* Adjust as needed */
    overflow-y: auto;
    padding: 20px;
    background-color: #f9f9f9;
    border-radius: 5px;
    border: 1px solid #eee;
}
.releve-content-right::-webkit-scrollbar { width: 6px; }
.releve-content-right::-webkit-scrollbar-thumb { background: #ccc; border-radius: 3px; }

@media (max-width: 992px) { /* Stack columns on medium screens */
    .releve-main-content-area { flex-direction: column; gap: 30px;}
    .releve-content-left { order: 1; }
    .releve-content-right { order: 2; position: static; max-height: none; overflow-y: visible; }
}

/* Detail Sections (Description, Features, etc.) */
.releve-detail-section {
    margin-bottom: 35px;
}
.releve-detail-section h2 {
    font-size: 1.6em;
    margin-bottom: 18px;
    color: #333;
    padding-bottom: 8px;
    border-bottom: 1px solid #eee;
}
.releve-detail-section p {
    font-size: 1em;
    color: #555;
    margin: 8px 0;
    line-height: 1.6;
}
.releve-detail-section p strong { color: #333; }

/* Overview Grid (Inside a Detail Section) */
.releve-details-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 12px 25px;
}
.releve-details-grid p {
    margin: 0;
    padding: 6px 0;
    border-bottom: 1px dotted #eee;
}
.releve-details-grid p:last-child { border-bottom: none; }

/* Detail Page Status Badge (if used in text, e.g., "Status: Active [Badge]") */
.status-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.8em;
    font-weight: bold;
    color: #fff;
    text-transform: uppercase;
    vertical-align: middle;
    margin-left: 8px; /* Space from preceding text */
}
.status-badge.status-active { background-color: #28a745; }
.status-badge.status-pending { background-color: #ffc107; color: #333; }
.status-badge.status-closed,
.status-badge.status-sold { background-color: #dc3545; }


/* Location Section (Map/Directions) */
.releve-location-section h2 { margin-bottom: 15px; }
#releve-detail-map {
    height: 400px;
    width: 100%;
    margin-bottom: 20px;
    border: 1px solid #ccc;
    border-radius: 5px;
}
.releve-directions-button,
.releve-view-map-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
    margin-right: 10px;
    padding: 9px 18px;
    background-color: #0073aa;
    color: white !important;
    text-decoration: none;
    border-radius: 3px;
    font-size: 0.95em;
    transition: background-color 0.3s ease;
    border: none; /* Ensure no default border */
}
.releve-directions-button:hover,
.releve-view-map-button:hover {
    background-color: #005d87;
    color: white !important;
}

/* Mortgage Calculator */
.releve-mortgage-calculator {
    background-color: #fdfdfd;
    border: 1px solid #eee;
    padding: 25px;
    border-radius: 5px;
    margin-top: 25px; /* Space if it's a separate section */
}
.releve-mortgage-calculator h2 { margin-top: 0; margin-bottom: 20px; font-size: 1.4em; }
.calculator-form {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 18px;
    align-items: flex-end; /* Align button nicely */
}
.calc-input-group { display: flex; flex-direction: column; }
.calc-input-group label { font-size: 0.9em; margin-bottom: 5px; color: #555; }
.calc-input-group input[type="text"],
.calc-input-group input[type="number"],
.calc-input-group select {
    padding: 9px 10px;
    border: 1px solid #ccc;
    border-radius: 3px;
    font-size: 1em;
    width: 100%;
    box-sizing: border-box;
}
#calculate-mortgage-btn { /* Example ID */
    padding: 11px 18px;
    width: 100%;
    margin-top: 10px; /* Give space if wrapped */
    background-color: #0073aa; /* Match CTA */
    color: white;
    border: none;
    border-radius: 3px;
    font-size: 1em;
    cursor: pointer;
    transition: background-color 0.3s ease;
}
#calculate-mortgage-btn:hover { background-color: #005d87; }

.calculator-result {
    margin-top: 20px;
    font-size: 1.3em;
    font-weight: bold;
    color: #0073aa;
    padding: 12px 15px;
    background-color: #eef7ff;
    border: 1px solid #cce3ff;
    border-radius: 4px;
    text-align: center;
}
.calculator-disclaimer {
    font-size: 0.8em;
    color: #777;
    margin-top: 15px;
    text-align: center;
    line-height: 1.4;
}

/* Sidebar CTA (Inside .releve-content-right) */
.releve-cta {
    text-align: center;
    margin-bottom: 25px;
}
.releve-cta h3 {
    font-size: 1.4em;
    margin-bottom: 18px;
    color: #333;
}
.releve-cta p { margin: 12px 0; }

.releve-cta-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 12px 18px;
    color: white !important; /* Ensure text is white */
    text-decoration: none;
    border-radius: 4px;
    margin: 10px 0;
    transition: background-color 0.3s ease, transform 0.1s ease, box-shadow 0.2s ease;
    font-size: 1.05em;
    font-weight: 500;
    border: none;
    cursor: pointer;
}
.releve-cta-button i { font-size: 1.1em; }
.releve-cta-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 3px 6px rgba(0,0,0,0.1);
}
/* Specific CTA button colors */
.releve-cta-button.schedule, /* Default/Schedule showing */
.releve-cta-button { /* Fallback if no specific class */
    background-color: #0073aa;
}
.releve-cta-button.schedule:hover,
.releve-cta-button:hover {
    background-color: #005d87;
}
.releve-cta-button.phone { background-color: #5cb85c; } /* Call */
.releve-cta-button.phone:hover { background-color: #4cae4c; }
.releve-cta-button.question { background-color: #f0ad4e; } /* Ask Question */
.releve-cta-button.question:hover { background-color: #ec971f; }

/* Sidebar Agent Info (Inside .releve-content-right) */
.releve-agent-info {
    margin-top: 25px;
    padding: 18px;
    background-color: #fff; /* White background to stand out */
    border: 1px solid #e5e5e5;
    border-radius: 4px;
    text-align: center;
}
.releve-agent-info h4 { margin-top: 0; margin-bottom: 12px; font-size: 1.15em; }
.releve-agent-info p { margin: 6px 0; font-size: 0.95em; }
.releve-agent-info .disclaimer { font-style: italic; color: #666; font-size: 0.85em; margin-top: 12px; }

/* Similar Listings Section */
.releve-similar-listings {
    margin-top: 40px;
    padding-top: 25px;
    border-top: 1px solid #ddd;
    clear: both;
}
.releve-similar-listings h2 {
    font-size: 1.8em;
    margin-bottom: 25px;
    color: #333;
    text-align: center;
}
/* Uses the main .listings-grid styles by default */
/* .releve-similar-listings .listings-grid { ... } /* Add overrides if needed */

/* Ensure overlays work within similar listings context */
.releve-similar-listings .releve-listing-image-container,
.releve-similar-listings .releve-listing-image-wrapper { position: relative; }

/* ADJUSTMENT: Using z-index: 10 from original map CSS for extra safety */
.releve-similar-listings .releve-price-overlay,
.releve-similar-listings .releve-photo-count-overlay,
.releve-similar-listings .releve-status-overlay {
    z-index: 10; /* Ensure visibility above potential layers */
}


/* Back Button & Footer */
.releve-detail-footer-nav {
    margin-top: 40px;
    text-align: center;
}
.releve-back-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 11px 22px;
    background-color: #f5f5f5;
    color: #0073aa !important;
    text-decoration: none;
    border-radius: 4px;
    transition: background-color 0.3s ease;
    border: 1px solid #ddd;
    font-size: 1em;
}
.releve-back-button:hover { background-color: #e0e0e0; }

.releve-disclaimer {
    font-size: 0.85em;
    color: #777;
    text-align: center;
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid #eee;
    line-height: 1.5;
}


/* ==========================================================================
   Sorting & Pagination (Used across Search, Neighborhoods, Agent)
   ========================================================================== */

/* Sort Dropdown Form */
.releve-sort-form {
    margin-bottom: 20px;
    text-align: right;
}
.releve-sort-form label { /* Visually hide label */
     border: 0; clip: rect(1px, 1px, 1px, 1px); height: 1px; margin: -1px; overflow: hidden; padding: 0; position: absolute; width: 1px; white-space: nowrap;
}
.releve-sort-form select {
    padding: 9px 12px;
    font-size: 0.95em;
    border: 1px solid #ccc;
    border-radius: 3px;
    background-color: #fff;
    max-width: 220px;
}

/* Pagination Wrapper */
.releve-pagination-wrapper {
    clear: both;
    margin-top: 30px;
    margin-bottom: 20px;
}
/* Pagination Links (assuming WP paginate_links structure: ul.releve-pagination > li > a/span) */
.releve-pagination {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    padding-left: 0;
    list-style: none;
    text-align: center;
}
.releve-pagination li { margin: 0; }
.releve-pagination a,
.releve-pagination span {
    display: inline-block;
    padding: 8px 14px;
    margin: 0;
    text-decoration: none;
    color: #0073aa;
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 3px;
    transition: background-color 0.2s ease, color 0.2s ease;
    line-height: 1.4;
}
.releve-pagination a:hover {
    background-color: #f5f5f5;
    border-color: #ccc;
    color: #005d87;
}
.releve-pagination .current { /* Current page span */
    background-color: #0073aa;
    color: white;
    border-color: #0073aa;
    font-weight: bold;
    cursor: default;
}
.releve-pagination .dots { /* Ellipsis span */
    border: none;
    background: none;
    padding: 8px 5px;
    cursor: default;
    color: #999;
}


/* ==========================================================================
   Utility & Misc Styles
   ========================================================================== */

/* Error Messages */
.releve-error-message {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    padding: 15px;
    border-radius: 4px;
    margin-bottom: 20px;
}

/* Notices (e.g., fallback, no results) */
.releve-fallback-notice,
.releve-no-listings {
    background-color: #fff3cd;
    color: #856404;
    border: 1px solid #ffeeba;
    padding: 15px;
    border-radius: 4px;
    margin-bottom: 20px;
    text-align: center;
}

/* Font Awesome icon helpers (ensure FA library is loaded) */
/* Add margins/styles if needed globally, but gap property often handles spacing */


/* ==========================================================================
   Mobile Responsiveness (Overrides)
   ========================================================================== */

@media (max-width: 992px) {
    /* Sidebar stacking already handled above */
}

@media (max-width: 768px) {
    .listings-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); /* Slightly smaller min size */
    }
    .releve-similar-listings .listings-grid {
        grid-template-columns: 1fr; /* Single column for similar listings */
    }
    .releve-search-row {
        flex-direction: column; /* Stack basic search items */
        align-items: stretch; /* Full width inputs/buttons */
    }
     .releve-search input[name="search_query"] {
        flex-basis: auto; /* Reset basis */
    }
    .releve-search button,
    .releve-map-button,
    .releve-advanced-button {
        width: 100%; /* Full width buttons */
        margin-left: 0; /* Reset margin */
        justify-content: center; /* Center button text */
    }

    .releve-detail-title { font-size: 1.8em; }
    .releve-detail-price { font-size: 1.5em; }
    .releve-detail-summary { gap: 10px 15px; padding: 12px; }
    .releve-detail-summary p { font-size: 0.95em; } /* Adjusted size */

    #releve-detail-map { height: 300px; } /* Smaller map */

    .releve-advanced-grid {
        grid-template-columns: 1fr; /* Single column advanced search */
     }
}

@media (max-width: 480px) {
     .listings-grid {
        grid-template-columns: 1fr; /* Single column grid */
        gap: 15px;
    }
     .releve-detail-page {
        padding: 0 10px; /* Reduce padding on small screens */
     }
     .releve-detail-title { font-size: 1.6em; }
     .releve-detail-price { font-size: 1.4em; }
     .releve-detail-summary {
         flex-direction: column; /* Stack summary items fully */
         align-items: flex-start;
     }

     .calculator-form {
        grid-template-columns: 1fr; /* Stack calculator inputs */
     }
     .releve-directions-button,
     .releve-view-map-button {
        width: 100%;
        margin-right: 0;
        margin-bottom: 10px; /* Add space between stacked buttons */
        justify-content: center; /* Center button content */
     }
     .releve-back-button {
         width: 100%; /* Full width back button */
         justify-content: center;
     }
     .releve-pagination a,
     .releve-pagination span {
         padding: 6px 10px; /* Smaller pagination buttons */
         font-size: 0.9em;
     }
}