/* ==========================================================================
   1. GLOBAL VARIABLES & BASE
   ========================================================================== */
:root {
    --rlp-red: #e3003a;
    --rlp-blue: #004274;
    --text-dark: #333333;
    --text-light: #666666;
    --bg-gray: #f9f9fc;
    --border: #e1e0e4;
}

* { box-sizing: border-box; }
body { font-family: 'Roboto', sans-serif; margin: 0; padding: 0; color: var(--text-dark); background: var(--bg-gray); }
a { text-decoration: none; color: inherit; transition: color 0.2s; }
img { max-width: 100%; height: auto; display: block; }

/* ==========================================================================
   2. HEADER & NAVIGATION
   ========================================================================== */
.site-header { 
    background: #fff; 
    box-shadow: 0 2px 10px rgba(0,0,0,0.05); 
    position: sticky; 
    top: 0px; 
    z-index: 1000; 
}

.header-container { 
    max-width: 1400px; 
    margin: 0 auto; 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    padding: 15px 20px;
    position: relative; /* Needed for mobile menu */
}

.logo img { height: 45px; }

.main-nav { 
    display: flex; 
    gap: 20px; 
    align-items: center; 
    font-weight: 500; 
    font-size: 0.9rem; 
    text-transform: uppercase; 
    color: var(--rlp-blue); 
}
.main-nav a:hover { color: var(--rlp-red); }

.header-contact { 
    display: flex; 
    align-items: center; 
    gap: 15px; 
    font-weight: 500; 
    color: var(--rlp-blue); 
}

/* Hide the mobile toggle button on desktop */
.mobile-menu-toggle {
    display: none;
    background: transparent;
    border: none;
    font-size: 1.8rem;
    color: #333;
    cursor: pointer;
}

/* ==========================================================================
   3. REUSABLE SECTIONS & CATEGORY GRIDS
   ========================================================================== */
.section-wrapper { max-width: 1400px; margin: 60px auto; padding: 0 20px; }
.section-title { font-size: 1.8rem; font-weight: 400; margin-bottom: 20px; color: var(--text-dark); }

.category-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 20px; }

/* Standard Property Grid (For search results pages) */
.property-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 25px; }

/* Dark Overlay Cards (e.g. Popular Neighbourhoods) */
.card { position: relative; border-radius: 6px; overflow: hidden; aspect-ratio: 16/9; display: block; }
.card img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.3s; }
.card:hover img { transform: scale(1.05); }
.card-overlay { position: absolute; bottom: 0; left: 0; right: 0; background: linear-gradient(to top, rgba(0,0,0,0.8), transparent); padding: 30px 15px 15px; color: #fff; pointer-events: none; }
.card-title { font-weight: 600; font-size: 1rem; margin-bottom: 5px; }
.card-count { font-size: 0.85rem; font-weight: 300; }

/* ==========================================================================
   4. HORIZONTAL PROPERTY SLIDER
   ========================================================================== */
.slider-wrapper { position: relative; display: flex; align-items: center; width: 100%; }

.property-track { 
    display: flex; 
    gap: 20px; 
    overflow-x: auto; 
    scroll-behavior: smooth; 
    scroll-snap-type: x mandatory; 
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE/Edge */
    padding: 15px 5px 25px 5px; /* Extra padding to prevent box-shadow clipping */
    width: 100%; 
}
.property-track::-webkit-scrollbar { display: none; /* Chrome/Safari */ }

/* Arrow Buttons */
.slider-btn { position: absolute; z-index: 10; background: white; border: 1px solid var(--border); border-radius: 50%; width: 45px; height: 45px; display: flex; align-items: center; justify-content: center; cursor: pointer; box-shadow: 0 2px 8px rgba(0,0,0,0.1); color: var(--rlp-blue); font-size: 1.2rem; transition: all 0.2s; }
.slider-btn:hover { background: var(--rlp-red); color: white; border-color: var(--rlp-red); }
.prev-btn { left: -22px; }
.next-btn { right: -22px; }

/* ==========================================================================
   5. PROPERTY CARDS
   ========================================================================== */
.property-card { 
    background: #fff; 
    border-radius: 8px; 
    overflow: hidden; 
    box-shadow: 0 4px 10px rgba(0,0,0,0.06); 
    border: 1px solid var(--border);
    transition: transform 0.2s, box-shadow 0.2s; 
    scroll-snap-align: start; 
    
    /* Flexbox used to push metadata to the bottom of the card */
    display: flex; 
    flex-direction: column; 
    
    /* Default (Large Desktop) Sizing: Try to be 25%, but NEVER get smaller than 280px */
    flex: 0 0 calc(25% - 15px);
    max-width: calc(25% - 15px);
    min-width: 280px; 
    width: 100%;
}

.property-card:hover { transform: translateY(-5px); box-shadow: 0 10px 20px rgba(0,0,0,0.12); }
.property-card img { width: 100%; height: 220px; object-fit: cover; }

.property-info { padding: 20px 15px; display: flex; flex-direction: column; flex-grow: 1; }
.property-info .price { font-size: 1.6rem; font-weight: 700; color: var(--rlp-red); margin-bottom: 8px; letter-spacing: -0.5px;}
.property-info .address { font-size: 0.95rem; font-weight: 500; color: var(--text-dark); margin-bottom: 4px; line-height: 1.4; min-height: 40px; }
.property-info .listed-by { font-size: 0.75rem; color: #888; font-style: italic; margin-bottom: 15px; min-height: 18px; }
.property-info .meta { display: flex; justify-content: space-between; font-size: 0.85rem; color: #666; border-top: 1px solid var(--border); padding-top: 15px; margin-top: auto; }
.property-info .meta span { display: flex; align-items: center; gap: 6px; }
.property-info .meta i { color: var(--rlp-blue); font-size: 0.9rem; }

/* Responsive Adjustments for Slider Cards */
@media (max-width: 1200px) {
    .property-card { flex: 0 0 calc(33.333% - 14px); max-width: calc(33.333% - 14px); }
}
@media (max-width: 992px) {
    .property-card { flex: 0 0 calc(50% - 10px); max-width: calc(50% - 10px); }
}
@media (max-width: 600px) {
    /* 1. Default: All cards take up full width (Fixes the Search Results Page) */
    .property-card { 
        flex: 0 0 100% !important; 
        max-width: 100% !important; 
        min-width: 100% !important; 
    }

    /* 2. Exception: ONLY cards inside the horizontal slider get the 85% peek effect (Fixes the Homepage) */
    .property-track .property-card { 
        flex: 0 0 85% !important; 
        max-width: 85% !important; 
        min-width: 85% !important; 
        scroll-snap-align: center; 
    }
    
    .property-track {
        padding-right: 20px !important;
    }
}
/* ==========================================================================
   6. FOOTER
   ========================================================================== */
.footer-top { background: var(--rlp-red); color: #fff; padding: 60px 20px; }
.footer-grid { max-width: 1400px; margin: 0 auto; display: grid; grid-template-columns: 1fr 1fr 2fr; gap: 40px; }
.footer-top h3 { font-size: 1.2rem; font-weight: 400; margin-top: 0; margin-bottom: 20px; }
.footer-top ul { list-style: none; padding: 0; margin: 0; }
.footer-top li { margin-bottom: 12px; font-size: 0.95rem; }
.footer-top a:hover { text-decoration: underline; }

.footer-bottom { background: #000; color: #fff; padding: 20px; font-size: 0.85rem; }
.footer-bottom-inner { max-width: 1400px; margin: 0 auto; display: flex; justify-content: space-between; align-items: center; }
.footer-logo img { height: 40px; filter: brightness(0) invert(1); }

/* ==========================================================================
   7. GLOBAL MOBILE RESPONSIVENESS (Max Width: 992px)
   ========================================================================== */
@media (max-width: 992px) {
    /* Header Mobile Menu Logic */
    .mobile-menu-toggle { display: block; }
    
    .main-nav, .header-contact { display: none; flex-direction: column; width: 100%; background-color: #fff; }
    .main-nav { position: absolute; top: 100%; left: 0; box-shadow: 0 4px 6px rgba(0,0,0,0.1); z-index: 1000; padding-bottom: 10px; }
    .main-nav.active { display: flex; }
    .main-nav a { padding: 15px 20px; border-bottom: 1px solid #eee; display: flex; justify-content: space-between; align-items: center; }
    
    .header-contact.active { display: flex; position: absolute; top: calc(100% + 280px); left: 0; padding: 15px 20px; border-bottom: 1px solid #eee; flex-direction: row; gap: 15px; z-index: 1000; box-shadow: 0 4px 6px rgba(0,0,0,0.1); }
    
    /* Footer Logic */
    .footer-grid { grid-template-columns: 1fr; }
    .footer-bottom-inner { flex-direction: column; gap: 15px; text-align: center; }
    
    /* Hide Slider Arrows on Touch Devices */
    .slider-btn { display: none; }
}



/* Convert Category and Agent grids into horizontal swipers on mobile */
@media (max-width: 992px) {
    .category-grid, .agents-grid {
        display: flex !important; /* Override the grid */
        flex-wrap: nowrap !important; /* Force them onto one line */
        overflow-x: auto !important; /* Allow horizontal scrolling */
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch; /* Smooth iOS scrolling */
        padding-bottom: 15px; /* Room for the scrollbar */
        gap: 15px;
        
        /* Hide scrollbars for a cleaner look */
        scrollbar-width: none; 
        -ms-overflow-style: none;
    }
    
    .category-grid::-webkit-scrollbar, 
    .agents-grid::-webkit-scrollbar { 
        display: none; 
    }

    /* Force the cards inside to shrink and snap into place */
    .category-grid > *, .agents-grid > * {
        flex: 0 0 75%; /* Cards take up 75% of screen, allowing the next card to peek */
        scroll-snap-align: start;
    }
}
/* --- VIEW ALL BUTTON --- */
.btn-view-all {
    display: inline-block;
    background-color: var(--rlp-red, #e3003a);
    color: #ffffff;
    padding: 12px 35px;
    font-size: 1rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-radius: 4px;
    text-decoration: none;
    box-shadow: 0 4px 10px rgba(227, 0, 58, 0.2);
    transition: all 0.2s ease;
}

.btn-view-all:hover {
    background-color: #a30029; /* A slightly darker red for hover */
    color: #ffffff;
    transform: translateY(-3px); /* Lifts the button up slightly */
    box-shadow: 0 6px 15px rgba(227, 0, 58, 0.3);
}
/* ==========================================================================
   APP-STYLE LAYOUT FIXES
   ========================================================================== */

/* --- 1. HEADER: DESKTOP DEFAULTS --- */
/* Make sure the hamburger is explicitly hidden on large desktops */
.mobile-menu-toggle {
    display: none; 
}
.main-nav, .header-contact {
    display: flex;
}

/* --- 2. MOBILE OVERRIDES (Max Width: 992px) --- */
@media (max-width: 992px) {
    
    /* ----- Header Mobile Overrides ----- */
    .header-container { flex-wrap: wrap !important; }
    .mobile-menu-toggle { display: block !important; }
    
    .main-nav, .header-contact {
        display: none !important; 
        flex-direction: column;
        width: 100%;
        background-color: #fff;
    }

    .main-nav.active {
        display: flex !important;
        position: static !important; 
        order: 3; 
        width: 100%;
        max-height: calc(100vh - 80px); 
        overflow-y: auto; 
        border-top: 1px solid #eee;
        margin-top: 15px; 
    }

    .main-nav.active > a, 
    .main-nav.active .dropdown-toggle {
        padding: 15px 20px;
        border-bottom: 1px solid #eee;
        width: 100%;
    }

    .header-contact.active {
        display: flex !important;
        position: static !important; 
        order: 4; 
        width: 100%;
        padding: 20px;
        background: var(--bg-gray, #f9f9fc); 
        border-bottom: 1px solid #eee;
        flex-direction: row;
        justify-content: center; 
        gap: 25px;
        box-shadow: 0 4px 6px rgba(0,0,0,0.05); 
    }
    
    /* ----- Search Page Mobile Overrides ----- */
    /* Hide the bulky desktop inline filters on phones */
    .top-bar-right.desktop-only {
        display: none !important;
    }
    
    /* Make the Search Box & Filter Button span the full width */
    .top-bar-container {
        display: block !important;
    }
    .top-bar-left {
        display: flex !important;
        width: 100%;
        gap: 10px;
        justify-content: space-between;
    }
    .filter-input-wrap {
        flex-grow: 1;
        width: 100%;
    }
    .top-filter-btn.master-filter-btn {
        display: flex !important;
        white-space: nowrap;
        align-items: center;
        gap: 8px;
    }
}
/* ==========================================================================
   DYNAMIC DROPDOWN MENU STYLES
   ========================================================================== */
.nav-dropdown {
    position: relative;
    display: inline-block; /* FIX: Prevents squishing on desktop */
}

/* Force top-level links to never wrap awkwardly (e.g. OUR \n LISTINGS) */
.main-nav > a, .nav-dropdown {
    white-space: nowrap;
}

/* Desktop Behavior: Show on Hover */
@media (min-width: 993px) {
    .nav-dropdown:hover .dropdown-menu {
        display: block !important;
    }
}

.dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background-color: #ffffff;
    min-width: 260px;
    box-shadow: 0 8px 20px rgba(0,0,0,0.08);
    z-index: 1001;
    border-radius: 4px;
    border: 1px solid var(--border);
    overflow: hidden;
}

/* Clean up the links inside the box */
.dropdown-menu a {
    display: block !important;
    padding: 12px 20px !important;
    color: var(--text-dark) !important;
    border-bottom: 1px solid #f4f5f7 !important;
    font-size: 0.9rem !important;
    text-transform: none !important;
    transition: all 0.2s;
    white-space: normal; /* Allow long submenu text to wrap normally */
}

.dropdown-menu a:last-child {
    border-bottom: none !important;
}

.dropdown-menu a:hover {
    background-color: var(--bg-gray) !important;
    color: var(--rlp-red) !important;
    padding-left: 25px !important;
}

/* Mobile Overrides */
@media (max-width: 992px) {
    .nav-dropdown {
        width: 100%; /* Only take up 100% width on small screens */
        display: block;
    }
    
    .dropdown-menu {
        position: static;
        box-shadow: none;
        border: none;
        border-radius: 0;
        background-color: var(--bg-gray);
        width: 100%;
    }
    
    .dropdown-menu.mobile-show {
        display: block !important; 
    }
    
    .dropdown-menu a {
        padding: 12px 40px !important;
        border-bottom: 1px solid #eee !important;
    }
}
/* --- HOME SPECIFIC: HERO BANNER --- */
.hero { position: relative; height: 500px; display: flex; align-items: center; justify-content: center; background-size: cover; background-position: center; }
.hero::before { content: ''; position: absolute; inset: 0; background: rgba(0, 0, 0, 0.4); }
.hero-content { position: relative; z-index: 2; text-align: center; color: #fff; width: 100%; max-width: 700px; padding: 0 20px; }
.hero h1 { font-size: 2.5rem; font-weight: 500; margin-bottom: 10px; }
.hero p { font-size: 1.2rem; margin-bottom: 30px; }

.search-form { display: flex; background: #fff; border-radius: 4px; overflow: hidden; padding: 5px; }
.search-form input { flex-grow: 1; border: none; padding: 15px; font-size: 1rem; outline: none; }
.search-form button { background: #00aeef; color: #fff; border: none; padding: 0 30px; font-weight: bold; cursor: pointer; border-radius: 4px; transition: background 0.2s; }
.search-form button:hover { background: #008fca; }

/* --- HOME SPECIFIC: AGENTS GRID --- */
.agents-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 30px; margin-top: 30px; }
.agent-card { background: #fff; padding: 30px 20px; text-align: center; border-radius: 8px; box-shadow: 0 4px 15px rgba(0,0,0,0.03); border: 1px solid var(--border); }
.agent-card img { width: 130px; height: 130px; border-radius: 50%; object-fit: cover; margin-bottom: 15px; margin-left: auto; margin-right: auto; }
.agent-name { color: var(--rlp-red); font-weight: 600; font-size: 1.1rem; margin-bottom: 5px; }
.agent-title { font-size: 0.85rem; font-weight: 600; margin-bottom: 15px; }
.agent-bio { font-size: 0.9rem; color: var(--text-light); line-height: 1.6; margin-bottom: 20px; }
.agent-link { color: var(--rlp-red); font-weight: 600; }
.agent-link:hover { text-decoration: underline; }

@media (max-width: 992px) {
    .hero h1 { font-size: 2rem; }
}

/* Custom jQuery UI Autocomplete Styling */
.ui-autocomplete {
    position: absolute;
    z-index: 9999 !important;
    background: #fff;
    border: 1px solid #ccc;
    border-radius: 0 0 4px 4px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    max-height: 400px;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 0;
    list-style: none;
}
.ui-autocomplete li {
    margin: 0;
    padding: 0;
    cursor: pointer;
}

/* OVERRIDE JQUERY UI'S DEFAULT BLUE HOVER */
.ui-menu .ui-menu-item-wrapper.ui-state-active,
.ui-menu .ui-menu-item-wrapper:hover {
    background-color: #f4f5f7 !important; /* Soft grey */
    color: var(--rlp-red, #e3003a) !important; /* Change text to your brand red on hover */
    border: none !important;
    margin: 0 !important;
}

.ui-helper-hidden-accessible {
    display: none;
}

/* ==========================================================================
   1. SEARCH PAGE MAIN LAYOUT
   ========================================================================== */
.search-container { max-width: 1400px; margin: 40px auto; padding: 0 20px; display: grid; grid-template-columns: 3fr 1fr; gap: 40px; }

.search-top-bar { grid-column: 1 / -1; margin-bottom: 10px; }
.search-breadcrumbs { font-size: 0.9rem; color: #888; margin-bottom: 15px; }
.search-breadcrumbs a { color: var(--rlp-red); text-decoration: none; }
.search-breadcrumbs a:hover { text-decoration: underline; }

.search-header { display: flex; justify-content: space-between; align-items: flex-end; border-bottom: 1px solid var(--border); padding-bottom: 15px; margin-bottom: 25px; }
.search-header h1 { font-size: 2rem; color: var(--rlp-red); margin: 0; font-weight: 400; }

.search-controls { display: flex; gap: 15px; align-items: center; color: #666; font-size: 1.2rem; }
.search-controls i { cursor: pointer; transition: color 0.2s; }
.search-controls i:hover, .search-controls i.active { color: var(--rlp-red); }

.search-meta { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; color: #666; font-size: 0.95rem; }
.sort-dropdown { border: none; background: transparent; color: var(--text-dark); font-weight: 500; font-size: 0.95rem; cursor: pointer; outline: none; }

/* MAIN GRID OVERRIDES */
/* Since .property-card has slider widths in global.css, we override them here for the grid */
.property-grid .property-card { width: 100% !important; flex: auto; margin-bottom: 0; }

/* ==========================================================================
   2. NON-FILTER SIDEBAR WIDGETS
   ========================================================================== */
.sidebar-widget { background: #fff; padding: 30px 25px; border-radius: 8px; border: 1px solid var(--border); margin-bottom: 30px; box-shadow: 0 4px 10px rgba(0,0,0,0.02); }
.sidebar-widget h3 { font-size: 1.2rem; font-weight: 400; color: var(--text-dark); margin-top: 0; margin-bottom: 20px; }

.sidebar-list { list-style: none; padding: 0; margin: 0; }
.sidebar-list li { margin-bottom: 15px; font-size: 0.95rem; }
.sidebar-list li:last-child { margin-bottom: 0; }
.sidebar-list a { color: var(--rlp-red); text-decoration: none; display: flex; align-items: center; gap: 10px; font-weight: 500; transition: color 0.2s; }
.sidebar-list a i { font-size: 0.8rem; }
.sidebar-list a:hover { color: #a30029; }


/* ==========================================================================
   3. STICKY TOP FILTER BAR
   ========================================================================== */
.sticky-filter-wrapper {
    position: sticky;
    top: 0; /* Adjust this if you have a sticky header above it (e.g., top: 75px;) */
    z-index: 1000;
    background: #fff;
    border-bottom: 1px solid var(--border);
    box-shadow: 0 4px 15px rgba(0,0,0,0.03);
}

.top-bar-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

.top-bar-left { display: flex; align-items: center; gap: 12px; }

/* 1. Apply the 42px height to BOTH the left and right sides */
.top-bar-left, .top-bar-right { 
    display: flex; 
    align-items: center; 
    gap: 12px; 
    height: 42px; /* Forces uniform height across the whole bar */
}

/* 2. Fix the Search Input to match the height */
.filter-input-wrap { 
    display: flex; 
    align-items: center; 
    border: 1px solid #ccc; 
    border-radius: 4px; 
    overflow: hidden; 
    background: #fff; 
    height: 100%; /* Fill the 42px height */
    box-sizing: border-box;
}
.top-search-input { 
    border: none; 
    padding: 0 15px; 
    width: 280px; 
    outline: none; 
    font-size: 0.95rem; 
    height: 100%; /* Fill the container */
    background: transparent;
}
.search-icon { 
    padding: 0 15px; 
    color: #666; 
    cursor: pointer; 
    display: flex;
    align-items: center;
    height: 100%;
}

/* 3. CRITICAL: Make the popover wrapper fill the height so the buttons inside can stretch! */
.popover-wrapper { 
    position: relative; 
    height: 100%; 
}
/* Standard Top Bar Dropdown Buttons */
.top-filter-btn {
    background: #fff; border: 1px solid #ccc; padding: 0 15px; height: 100%; border-radius: 4px;
    font-size: 0.95rem; font-weight: 500; color: var(--text-dark); cursor: pointer;
    display: flex; align-items: center; justify-content: center; gap: 8px; transition: 0.2s; box-sizing: border-box;
}
.top-filter-btn:hover, .top-filter-btn.active { background: #f0f0f0; border-color: #999; }

/* Save Search Button */
.btn-save-search { 
    background: #006aff; color: #fff; border: none; padding: 0 20px; height: 100%; border-radius: 4px; 
    font-weight: 600; font-size: 0.95rem; cursor: pointer; transition: 0.2s; display: flex; align-items: center; box-sizing: border-box;
}
.btn-save-search:hover { background: #005ce6; }

/* Inline Radio Toggles (For Sale / Lease) */
.top-inline-group.connected-group { display: flex; border: 1px solid #ccc; border-radius: 4px; overflow: hidden; margin: 0; height: 100%; box-sizing: border-box; }
.top-inline-group label { margin: 0; display: flex; height: 100%; }
.top-inline-group input[type="radio"] { display: none; }
.top-inline-group span { display: flex; align-items: center; justify-content: center; padding: 0 15px; font-size: 0.95rem; font-weight: 500; cursor: pointer; transition: 0.2s; height: 100%; box-sizing: border-box; }
.top-inline-group input[type="radio"]:checked + span { background: #004274; color: #fff; }


/* ==========================================================================
   4. DESKTOP POPOVER PANELS
   ========================================================================== */
.popover-wrapper { position: relative; }
.popover-panel {
    position: absolute; top: calc(100% + 10px); left: 0; background: #fff; border: 1px solid var(--border);
    border-radius: 8px; padding: 25px; box-shadow: 0 10px 30px rgba(0,0,0,0.1); min-width: 350px; z-index: 1001; display: none; 
}
.popover-panel.show { display: block; } 

/* Price Popover Specifics */
.price-min-max-container { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; }
.price-field { display: flex; flex-direction: column; flex: 1; }
.price-field label { font-size: 0.9rem; font-weight: 600; color: var(--text-dark); margin-bottom: 6px; }
.price-field input { width: 100%; padding: 10px 12px; border: 1px solid #ccc; border-radius: 4px; font-size: 0.95rem; outline: none; transition: all 0.2s; }
.price-field input:focus { border-color: #006aff; box-shadow: 0 0 0 3px rgba(0, 106, 255, 0.15); }
.price-field input::placeholder { color: #888; }
.price-separator { color: #666; margin-top: 24px; }
.btn-apply-filter { width: 100%; background: #006aff; color: #fff; border: none; padding: 12px; border-radius: 4px; font-weight: 600; font-size: 1rem; cursor: pointer; transition: background 0.2s; }
.btn-apply-filter:hover { background: #005ce6; }


/* ==========================================================================
   5. OFF-CANVAS DRAWER
   ========================================================================== */
.sidebar {
    position: fixed; top: 0; right: 0; width: 100%; max-width: 400px; height: 100vh; background: #fff; z-index: 9999;
    overflow-y: auto; padding: 0; box-shadow: -5px 0 25px rgba(0,0,0,0.1); transform: translateX(100%); transition: transform 0.3s cubic-bezier(0.4, 0.0, 0.2, 1);
}
.sidebar.open { transform: translateX(0); }

.filter-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 9998; backdrop-filter: blur(2px); }
.filter-overlay.active { display: block; }

.filter-header { display: flex; justify-content: space-between; align-items: center; padding: 20px; border-bottom: 1px solid var(--border); position: sticky; top: 0; background: #fff; z-index: 10; }
.filter-header h3 { margin: 0; font-size: 1.2rem; }
.close-sidebar-btn { background: none; border: none; cursor: pointer; color: #333; font-size: 1.5rem; }
.reset-btn { background: none; border: none; color: var(--rlp-red); font-weight: 600; cursor: pointer; }

.drawer-body { padding: 25px 20px; }
.filter-footer { padding: 20px; border-top: 1px solid var(--border); position: sticky; bottom: 0; background: #fff; }
.btn-view-results { width: 100%; background: #006aff; color: white; border: none; padding: 12px; font-size: 1rem; font-weight: 600; border-radius: 4px; cursor: pointer; }

/* Filter Group Spacing & Typography */
.filter-group { margin-bottom: 30px; }
.filter-group .heading { display: block; font-size: 1.05rem; font-weight: 600; color: var(--text-dark, #333); margin-bottom: 12px; }

/* Unified Form Controls (Selects & Custom Dropdowns) */
.form-control, .dropdown-header {
    width: 100%; padding: 12px 15px; border: 1px solid #d1d1d5; border-radius: 6px; background-color: #fff;
    font-size: 0.95rem; color: var(--text-dark); outline: none; transition: all 0.2s ease; cursor: pointer;
    display: flex; justify-content: space-between; align-items: center;
}
select.form-control {
    -webkit-appearance: none; -moz-appearance: none; appearance: none;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="%23666" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M6 9l6 6 6-6"/></svg>');
    background-repeat: no-repeat; background-position: right 15px center; padding-right: 40px;
}
.form-control:focus, .form-control:hover, .dropdown-header:hover { border-color: #006aff; }
select.form-control:focus { box-shadow: 0 0 0 3px rgba(0, 106, 255, 0.1); }

/* Min/Max Select Rows */
.min-max-row { display: flex; align-items: center; gap: 12px; }
.min-max-row .form-control { flex: 1; }
.range-dash { color: #888; font-weight: 500; }


/* ==========================================================================
   6. CUSTOM UI INPUTS (Radios, Checkboxes & City Dropdown)
   ========================================================================== */
/* Square Radio Buttons (Beds/Baths) */
.square-radio-group { display: flex; gap: 6px; flex-wrap: nowrap; margin-bottom: 20px; width: 100%; }
.square-radio-group input[type="radio"] { display: none; }
.square-radio-group label.radio-btn { margin: 0; cursor: pointer; flex: 1; }
.square-radio-group span { display: flex; align-items: center; justify-content: center; width: 100%; height: 42px; border: 1px solid #d1d1d5; border-radius: 6px; background: #fff; color: var(--text-dark); font-weight: 500; font-size: 0.9rem; transition: all 0.2s ease; padding: 0; user-select: none; }
.square-radio-group label.radio-btn:hover span { border-color: #006aff; color: #006aff; }
.square-radio-group input[type="radio"]:checked + span { background: #006aff; color: #fff; border-color: #006aff; box-shadow: 0 2px 6px rgba(0, 106, 255, 0.2); }

.square-radio-group label.any-btn span { background: #f4f5f7; color: #555; }
.square-radio-group label.any-btn input[type="radio"]:checked + span { background: #444; border-color: #444; color: #fff; box-shadow: none; }

/* Custom Checkboxes (Property Types & Features) */
.checkbox-group { display: flex; flex-direction: column; gap: 12px; }
.custom-checkbox { display: flex; align-items: center; gap: 12px; cursor: pointer; margin: 0; user-select: none; }
.custom-checkbox input[type="checkbox"] { display: none; }
.custom-checkbox .checkmark { width: 22px; height: 22px; border: 2px solid #ccc; border-radius: 4px; background: #fff; display: flex; align-items: center; justify-content: center; transition: all 0.2s ease; }
.custom-checkbox:hover .checkmark { border-color: #006aff; }
.custom-checkbox input[type="checkbox"]:checked + .checkmark { background: #006aff; border-color: #006aff; }
.custom-checkbox input[type="checkbox"]:checked + .checkmark::after { content: ''; width: 6px; height: 11px; border: solid white; border-width: 0 2px 2px 0; transform: rotate(45deg); margin-bottom: 2px; }
.custom-checkbox .label-text { font-size: 0.95rem; color: var(--text-dark); font-weight: 500; }
.custom-checkbox .text-muted { color: #888; font-size: 0.85rem; font-weight: 400; }

/* City Dropdown UI */
.dropdown-panel { display: none; border: 1px solid var(--border); border-top: none; border-radius: 0 0 4px 4px; background: #fff; max-height: 300px; overflow-y: auto; padding: 10px; box-shadow: 0 4px 10px rgba(0,0,0,0.05); }
.dropdown-panel.show { display: block; }
.custom-checkbox input[type="checkbox"]:checked + .green-check { background: #28a745; border-color: #28a745; }
.city-item { padding: 8px 10px; border-radius: 4px; transition: background 0.2s; margin-bottom: 2px; }
.city-item:hover { background: #f8f9fa; }


/* ==========================================================================
   7. PAGINATION
   ========================================================================== */
.pagination-container { margin-top: 40px; padding-top: 20px; border-top: 1px solid var(--border); display: flex; justify-content: center; grid-column: 1 / -1; }
.pagination { display: flex; gap: 8px; align-items: center; }
.page-btn { display: inline-flex; align-items: center; justify-content: center; min-width: 40px; height: 40px; padding: 0 12px; border: 1px solid var(--border); border-radius: 4px; background: #fff; color: var(--text-dark); font-weight: 500; font-size: 0.95rem; transition: all 0.2s; text-decoration: none; }
.page-btn:hover { background: #f0f0f0; border-color: #ccc; }
.page-btn.active { background: var(--rlp-red); color: #fff; border-color: var(--rlp-red); pointer-events: none; }
.page-dots { color: #888; font-weight: 600; padding: 0 5px; }


/* ==========================================================================
   8. RESPONSIVE MEDIA QUERIES
   ========================================================================== */

/* Mobile Master Filter Button */
.meta-controls { display: flex; align-items: center; gap: 15px; }
.btn-mobile-filter { display: none; background: #fff; border: 1px solid var(--border); padding: 8px 15px; border-radius: 4px; font-weight: 600; color: var(--text-dark); cursor: pointer; }
.btn-mobile-filter i { color: var(--rlp-red); margin-right: 5px; }

@media (max-width: 1024px) {
    .desktop-only { display: none !important; }
    .top-search-input { width: 100%; }
    .top-bar-left { width: 100%; justify-content: space-between; }
}

@media (max-width: 992px) {
    .search-container { grid-template-columns: 1fr; }
    .search-header { flex-direction: column; align-items: flex-start; gap: 15px; }
    
    /* Reveal mobile filter button and hide sidebars */
    .btn-mobile-filter { display: block; } 
    #sidebar-popular-searches, #sidebar-metro-cities { display: none; }
}

@media (max-width: 768px) {
    .page-btn { min-width: 35px; height: 35px; padding: 0 10px; font-size: 0.85rem; }
}
/* --- ACTIVE FILTER CHIPS --- */
.active-filters-wrapper {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
    grid-column: 1 / -1; /* Ensures it spans the full width of the grid area */
}

.filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px 6px 16px;
    background: #fff5f5; /* Very subtle light red background */
    border: 1px solid var(--rlp-red, #e3003a);
    border-radius: 20px; /* Pill shape */
    color: var(--rlp-red, #e3003a);
    font-size: 0.9rem;
    font-weight: 500;
}

.filter-chip .remove-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: rgba(227, 0, 58, 0.1); /* Soft red background for the X */
    cursor: pointer;
    transition: all 0.2s ease;
}

.filter-chip .remove-btn:hover {
    background: var(--rlp-red, #e3003a);
    color: #fff;
}

.filter-chip .remove-btn i {
    font-size: 0.75rem;
}
/* --- MOBILE DRAWER FILTERS --- */
/* Hide them on desktop */
.mobile-only-drawer-filters {
    display: none; 
}

/* Show them in the drawer once the top-bar versions disappear */
@media (max-width: 1024px) {
    .mobile-only-drawer-filters {
        display: block;
    }
}