 .search-section {
    display: flex;
    flex-direction: column;
    margin: 0px 0px 0px 0px;
}

/* Header: Title + Sort */
.search-header {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    flex-wrap: wrap; /* mobile friendly */
    margin-bottom: 20px;
}

.browse-title {
    margin: 0;
    font-size: 20px;
    font-weight: bold;
    flex: 1;
    text-align: center;
}

/* Sort Section */
.sort-container {
    display: flex;
    align-items: center;
    gap: 8px;
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    white-space: nowrap;
    margin-right: 10px;
}

.sort-label {
    font-weight: bold;
    font-size: 14px;
    color: #333;
    min-width: 100px;
}

.sort-icon {
    cursor: pointer;
    width: 24px;
    height: 24px;
    transition: transform 0.2s, opacity 0.2s;
}

.sort-icon.selected { transform: scale(1.2); opacity:1; }
.sort-icon:not(.selected) { opacity: 0.4; }
.sort-icon:hover { transform: scale(1.2); opacity: 0.8; }

/* Listings + Loader */
#listings {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    position: relative;
}

/* Loader centered in listings */
#loader {
   display: flex !important;       /* flex to center contents */
    justify-content: center;        /* horizontal */
    align-items: center;            /* vertical (within min-height) */
    width: 100%;                    /* full width */
    min-height: 150px;              /* optional spacing */
    grid-column: 1 / -1;            /* span all columns in grid */
}

/* Cards */
.card {
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
    transition: box-shadow 0.2s;
}

.card:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.1); }

.property-img-link img { width: 100%; height: 180px; object-fit: cover; }

.info { padding: 12px; }
.price { font-size: 16px; font-weight: bold; color: #222; }
.address { font-size: 14px; color: #555; margin: 4px 0; }
.details { font-size: 13px; color: #777; }
.mls { font-size: 12px; color: #999; margin-top: 4px; }

.badge {
    position: absolute;
    background: #ff4c3b;
    color: #fff;
    padding: 4px 8px;
    font-size: 12px;
    font-weight: bold;
    top: 10px;
    left: 10px;
    border-radius: 4px;
}

/* No Listings */
.no-listings-card {
    text-align: center;
    padding: 40px;
    color: #555;
}
.no-listings-card i { font-size: 40px; margin-bottom: 10px; }

/* Popup */
.popup {
    display: none;
    position: fixed;
    z-index: 999;
    left:0; top:0;
    width:100%; height:100%;
    overflow:auto;
    background-color: rgba(0,0,0,0.6);
}

.popup-content {
    background-color:#fff;
    margin:50px auto;
    padding:20px;
    border-radius:8px;
    width:90%;
    max-width:800px;
    position:relative;
}

.close-btn {
    position:absolute;
    top:12px;
    right:16px;
    font-size:20px;
    cursor:pointer;
    font-weight:bold;
}

/* Responsive */
@media(max-width: 600px){
    .sort-container { position: static; transform: none; margin-top: 10px; justify-content: center; }
}