/* Main Layout */
.sfp-property-listing {
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

/* Filters */
.sfp-filters-container {
    flex: 0 0 300px;
}

.sfp-filters {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    padding: 20px;
    position: sticky;
    top: 20px;
}

.sfp-filters h3 {
    margin-top: 0;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
    color: #333;
}

.sfp-filter-group {
    margin-bottom: 20px;
}

.sfp-filter-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #444;
}

.sfp-input,
.sfp-select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.sfp-price-range,
.sfp-land-area,
.sfp-building-area {
    display: flex;
    align-items: center;
    gap: 10px;
}

.sfp-price-range input,
.sfp-land-area input,
.sfp-building-area input {
    flex: 1;
}

.sfp-button {
    display: inline-block;
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.sfp-button-primary {
    background-color: #2563eb;
    color: white;
}

.sfp-button-primary:hover {
    background-color: #1d4ed8;
}

.sfp-button-secondary {
    background-color: #f3f4f6;
    color: #374151;
    margin-left: 10px;
}

.sfp-button-secondary:hover {
    background-color: #e5e7eb;
}

/* Properties Grid */
.sfp-properties-container {
    flex: 1;
    min-width: 0;
}

/* Sorting - Simple and effective */
.sfp-sorting {
    text-align: right;
    margin-bottom: 20px;
}

.sfp-sorting select {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background-color: white;
    min-width: 150px;
    cursor: pointer;
}

.sfp-properties-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 25px;
    clear: both;
}

/* Property Card */
.sfp-property-card {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.sfp-property-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.15);
}

.sfp-property-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

.sfp-property-thumbnail {
    position: relative;
    padding-top: 75%;
    /* 4:3 aspect ratio */
    background-size: cover;
    background-position: center;
    overflow: hidden;
}

.sfp-property-price {
    position: absolute;
    top: 15px;
    left: 0;
    background: rgba(37, 99, 235, 0.9);
    color: white;
    padding: 5px 15px;
    font-weight: 600;
    font-size: 16px;
    border-top-right-radius: 4px;
    border-bottom-right-radius: 4px;
    z-index: 2;
}

/* Updated Overlay Styles */
.sfp-property-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent);
    color: white;
    padding: 20px;
    transform: translateY(0);
    transition: all 0.3s ease;
    padding-top: 40px;
}

.sfp-property-title {
    margin: 0 0 10px 0;
    font-size: 18px;
    line-height: 1.3;
    opacity: 1;
    transform: none;
}

.sfp-property-excerpt {
    font-size: 14px;
    opacity: 0.9;
    margin-bottom: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    max-height: 40px;
    transition: all 0.3s ease;
}

.sfp-property-details {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 15px;
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transition: all 0.3s ease;
}

.sfp-property-card:hover .sfp-property-details {
    max-height: 100px;
    opacity: 1;
    margin-top: 15px;
}

.sfp-property-detail {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.2);
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 12px;
}

.sfp-detail-icon {
    margin-right: 5px;
}

.sfp-property-location {
    padding: 12px 15px;
    font-size: 14px;
    color: #4b5563;
    border-top: 1px solid #f3f4f6;
}

/* Pagination */
.sfp-pagination {
    margin-top: 30px;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 5px;
}

.page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 10px;
    margin: 0 2px;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    color: #4a5568;
    text-decoration: none !important;
    transition: all 0.2s ease;
}

.page-numbers.current {
    background-color: #2563eb;
    color: white;
    border-color: #2563eb;
}

.page-numbers:hover:not(.current) {
    background-color: #f7fafc;
    border-color: #cbd5e0;
}

.page-numbers.prev,
.page-numbers.next {
    padding: 0 15px;
}

.page-numbers.dots {
    border: none;
    pointer-events: none;
}

/* Select2 styles for grouped options */
.select2-results__group {
    display: block;
    padding: 8px 10px;
    font-weight: 600;
    color: #555;
    background-color: #f8f9fa;
    border-bottom: 1px solid #eee;
}

.select2-results__option {
    padding: 8px 20px;
}

.select2-container--default .select2-results__option[aria-selected=true] {
    background-color: #f8f9fa;
}

.select2-container--default .select2-results__option--highlighted[aria-selected] {
    background-color: #007cba;
    color: white;
}

/* Responsive */
@media (max-width: 992px) {
    .sfp-property-listing {
        flex-direction: column;
    }

    .sfp-filters-container {
        flex: 0 0 auto;
        margin-bottom: 30px;
    }

    .sfp-filters {
        position: static;
    }
}

@media (max-width: 768px) {
    .sfp-properties-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    }
}

/* Loading State */
.sfp-loading {
    position: relative;
    min-height: 200px;
}

.sfp-loading:before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 30px;
    height: 30px;
    margin: -15px 0 0 -15px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #2563eb;
    border-radius: 50%;
    animation: sfp-spin 1s linear infinite;
}

@keyframes sfp-spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}