/* ============================================================
   SEARCH PAGE STICKY SIDEBAR FIXES
   Moved from inline styles in search.php for clean SEO
   ============================================================ */

/* ============================================================
   SEARCH PAGE ENHANCEMENTS
   ============================================================ */

/* Convert listing images from background-image to <img> tags */
.search-page .listing-card .listing-image .image {
    width: 100% !important;
    height: auto !important;
    aspect-ratio: 4 / 3 !important;
    object-fit: cover !important;
    object-position: center center !important;
    display: block !important;
    background: none !important;
}

/* Results Header */
.search-results-header {
    margin-bottom: 20px;
    padding: 15px 0;
    border-bottom: 1px solid #e0e0e0;
}

.search-results-header .results-count {
    font-size: 16px;
    color: #333;
    margin-bottom: 15px;
}

.search-results-header .results-count strong {
    font-size: 20px;
    color: #08255d;
    font-weight: 700;
}

.search-results-header .showing-range {
    color: #666;
    font-size: 14px;
    margin-left: 8px;
}

/* Active Filter Chips */
.active-filters {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
}

.active-filters .filters-label {
    font-weight: 600;
    color: #333;
    margin-right: 5px;
}

.filter-chip {
    display: inline-flex;
    align-items: center;
    background: #e8f4f8;
    border: 1px solid #60A2D0;
    border-radius: 20px;
    padding: 6px 12px;
    font-size: 14px;
    gap: 8px;
}

.filter-chip .filter-label {
    color: #08255d;
    font-weight: 500;
}

.filter-chip .filter-remove {
    color: #60A2D0;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: rgba(96, 162, 208, 0.1);
    transition: background 0.2s;
}

.filter-chip .filter-remove:hover {
    background: rgba(96, 162, 208, 0.2);
    color: #08255d;
}

.clear-all-filters {
    color: #60A2D0;
    text-decoration: underline;
    font-size: 14px;
    margin-left: 10px;
}

.clear-all-filters:hover {
    color: #08255d;
}

/* Empty State */
.no-results {
    text-align: center;
    padding: 60px 20px;
    background: #f8f9fa;
    border-radius: 8px;
    margin: 40px 0;
}

.no-results-content i {
    font-size: 64px;
    color: #ccc;
    margin-bottom: 20px;
    display: block;
}

.no-results-content h2 {
    font-size: 28px;
    color: #333;
    margin-bottom: 15px;
}

.no-results-content > p {
    font-size: 16px;
    color: #666;
    margin-bottom: 30px;
}

.no-results-suggestions {
    text-align: left;
    max-width: 500px;
    margin: 0 auto 30px;
    background: #fff;
    padding: 20px;
    border-radius: 6px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.no-results-suggestions h3 {
    font-size: 18px;
    color: #08255d;
    margin-bottom: 15px;
}

.no-results-suggestions ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.no-results-suggestions li {
    padding: 8px 0;
    padding-left: 25px;
    position: relative;
    color: #555;
}

.no-results-suggestions li:before {
    content: "•";
    position: absolute;
    left: 10px;
    color: #60A2D0;
    font-weight: bold;
}

.btn-clear-search {
    display: inline-block;
    background: #08255d;
    color: #fff;
    padding: 12px 30px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
    transition: background 0.2s;
}

.btn-clear-search:hover {
    background: #0a377e;
    color: #fff;
}

/* Form Accessibility Improvements */
.search-page form#rfn {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
}

.search-page form#rfn input[type="text"] {
    flex: 1;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.search-page form#rfn button[type="submit"] {
    padding: 10px 20px;
    background: #08255d;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
}

.search-page form#rfn button[type="submit"]:hover {
    background: #0a377e;
}

/* Screen Reader Only */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* Footer Wrapper - Full Width */
.search-page .footer-wrapper {
    position: relative;
    width: 100vw;
    max-width: 100vw;
    margin-left: calc(-50vw + 50%);
    margin-right: calc(-50vw + 50%);
    padding: 0;
    overflow: hidden;
    margin-top: 80px !important;
}

/* Mobile Responsive Styles */
@media (max-width: 991px) {
    .search-results-header {
        padding: 10px 0;
    }
    
    .active-filters {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .filter-chip {
        font-size: 13px;
    }
    
    .no-results {
        padding: 40px 15px;
    }
    
    .no-results-content i {
        font-size: 48px;
    }
    
    .no-results-content h2 {
        font-size: 24px;
    }
    
    .search-page form#rfn {
        flex-direction: column;
    }
    
    .search-page form#rfn button[type="submit"] {
        width: 100%;
        justify-content: center;
    }
}

/* Sticky sidebar for search page */
@media (min-width: 992px) {
    /* Ensure parent containers don't break sticky */
    .search-page .main,
    .search-page #content,
    .search-page .content.full,
    .search-page .container {
        overflow: visible !important;
        height: auto !important;
        position: relative !important;
    }
    
    /* Make sure the row container allows sticky positioning */
    .search-page .container .row {
        display: flex !important;
        flex-wrap: wrap !important;
        align-items: flex-start !important;
        position: relative !important;
        overflow: visible !important;
    }
    
    /* Ensure col-md-9 (article) is positioned correctly on LEFT */
    .search-page .col-md-9,
    .search-page article.col-md-9 {
        overflow: visible !important;
        float: none !important;
        width: 75% !important;
        flex: 0 0 75% !important;
        max-width: 75% !important;
        position: relative !important;
        order: 1 !important;
    }
    
    /* Sticky sidebar - MUST be on the RIGHT side */
    .search-page .sidebar.right-sidebar,
    .search-page aside.sidebar.right-sidebar,
    .search-page .right-sidebar,
    .search-page .col-md-3.sidebar,
    .search-page .row > .col-md-3.sidebar,
    .search-page .row > .sidebar.right-sidebar,
    .search-page .row > aside.col-md-3 {
        position: sticky !important;
        top: 67px !important;
        z-index: 100 !important;
        height: max-content !important;
        margin-top: 0 !important;
        padding-top: 0 !important;
        align-self: flex-start !important;
        float: none !important;
        clear: none !important;
        width: 25% !important;
        max-width: 25% !important;
        flex: 0 0 25% !important;
        order: 2 !important;
    }
    
    /* Override any conflicting styles from style.css */
    .search-page .right-sidebar {
        clear: none !important;
        margin-top: 0 !important;
    }
    
    /* Ensure col-md-3 wrapper allows sticky */
    .search-page .col-md-3 {
        overflow: visible !important;
        position: relative !important;
    }
    
    /* Prevent any conflicting styles */
    .search-page .sidebar.right-sidebar > * {
        position: static !important;
    }
    
    
    /* Ensure row uses flexbox properly */
    .search-page .row {
        display: flex !important;
        flex-direction: row !important;
    }
    
    /* Force column order */
    .search-page .row > article.col-md-9 {
        order: 1 !important;
        flex: 0 0 75% !important;
    }
    
    .search-page .row > aside.col-md-3,
    .search-page .row > .col-md-3.sidebar {
        order: 2 !important;
        flex: 0 0 25% !important;
    }
}
