/* Modern Search Page - Complete Redesign */

/* ============================================
   Container & Layout
   ============================================ */
.search-page-wrapper {
    background: #f8f9fa;
    min-height: 100vh;
}

.search-container {
    padding: 2rem 0 4rem;
}

.container-fluid {
    max-width: 1400px;
}

/* Full width for search form container */
#searchForm .container-fluid {
    max-width: 100%;
}

/* ============================================
   Search Form
   ============================================ */
#searchForm {
    margin-bottom: 2rem;
    width: 100%;
}

#searchForm .bg-primary {
    background: #ffffff !important;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    padding: 2rem;
    width: 100%;
}

#searchForm .form-control,
#searchForm .form-select,
#searchForm .select2-container .select2-selection--single {
    border: 1.5px solid #d0d0d0;
    border-radius: 8px;
    padding: 0.875rem 1.125rem;
    font-size: 1rem;
    transition: all 0.2s ease;
    background: #ffffff;
    color: #333;
    height: auto;
    min-height: 50px;
}

#searchForm .form-control:focus,
#searchForm .form-select:focus,
#searchForm .select2-container--focus .select2-selection--single {
    border-color: #7A1F1F;
    box-shadow: 0 0 0 4px rgba(122, 31, 31, 0.1);
    outline: none;
}

#searchForm .btn-primary {
    background: linear-gradient(to bottom, #6b1c21 0%, #431918 100%);
    border: none;
    border-radius: 8px;
    padding: 0.875rem 2.5rem;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.2s ease;
    height: 50px;
    min-height: 50px;
}

#searchForm .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(122, 31, 31, 0.35);
}

/* ============================================
   Results Header
   ============================================ */
.results-header {
    background: #ffffff;
    border-radius: 12px;
    padding: 1.5rem 2rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    position: relative;
    overflow: visible; /* Allow dropdowns to overflow */
}

.results-header-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1.5rem;
    gap: 1rem;
}

.results-title-section {
    flex: 1;
}

.results-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0;
    line-height: 1.5;
}

.results-title a {
    color: inherit;
    text-decoration: none;
}

/* Ensure breadcrumb styling works within results-title */
.results-title .search-breadcrumb-elegant {
    font-weight: 400;
}
.results-title .breadcrumb-home-link {
    font-weight: 600;
}

.results-count {
    font-size: 0.9375rem;
    color: #374151;
    margin: 0;
    font-weight: 400;
}

.clear-filters-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    background: #f5f5f5;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    color: #374151;
    text-decoration: none;
    font-size: 0.9375rem;
    font-weight: 500;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.clear-filters-text {
    display: inline;
}

.clear-filters-btn:hover {
    background: #eeeeee;
    border-color: #d0d0d0;
    color: #333;
}

/* Post Type Tabs */
.post-type-tabs-wrapper {
    overflow: hidden;
    padding-top: 1rem;
    border-top: 1px solid #f0f0f0;
}

.post-type-tabs {
    display: flex;
    gap: 0.5rem;
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 0.5rem;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: #d0d0d0 transparent;
}

.post-type-tabs::-webkit-scrollbar {
    height: 4px;
}

.post-type-tabs::-webkit-scrollbar-track {
    background: transparent;
}

.post-type-tabs::-webkit-scrollbar-thumb {
    background: #d0d0d0;
    border-radius: 2px;
}

.post-type-tabs::-webkit-scrollbar-thumb:hover {
    background: #b0b0b0;
}

.post-type-tab {
    display: inline-flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.625rem 1.25rem;
    background: #f8f9fa;
    border: 1.5px solid transparent;
    border-radius: 8px;
    color: #374151;
    text-decoration: none;
    font-size: 0.9375rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.post-type-tab:hover {
    background: #eeeeee;
    color: #333;
}

.post-type-tab.active {
    background: #7A1F1F;
    border-color: #7A1F1F;
    color: #ffffff;
}

.tab-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    height: 24px;
    padding: 0 0.5rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}

.tab-badge.badge-primary {
    background: rgba(255, 255, 255, 0.25);
    color: #ffffff;
}

.tab-badge.badge-secondary {
    background: #e0e0e0;
    color: #374151;
}

.post-type-tab.active .tab-badge.badge-secondary {
    background: rgba(255, 255, 255, 0.25);
    color: #ffffff;
}

/* Results Toolbar */
.results-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #f0f0f0;
    margin-top: 1rem;
}

.filter-toggle-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    background: #f5f5f5;
    border: 1.5px solid #e0e0e0;
    border-radius: 8px;
    color: #374151;
    font-size: 0.9375rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.filter-toggle-text {
    display: inline;
}

.filter-toggle-btn:hover {
    background: #eeeeee;
    border-color: #d0d0d0;
    color: #333;
}

.toolbar-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* Sort Dropdown */
.sort-dropdown {
    position: relative;
}

.sort-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    background: #ffffff;
    border: 1.5px solid #e0e0e0;
    border-radius: 8px;
    color: #374151;
    font-size: 0.9375rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.sort-toggle-text {
    display: inline;
}

.sort-toggle:hover {
    border-color: #7A1F1F;
    color: #7A1F1F;
}

.sort-dropdown .dropdown-menu {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
    padding: 0.5rem;
    margin-top: 0.5rem;
    min-width: 200px;
}

.sort-dropdown .dropdown-item {
    padding: 0.75rem 1rem;
    border-radius: 6px;
    transition: all 0.2s ease;
    font-size: 0.9375rem;
}

.sort-dropdown .dropdown-item:hover {
    background: #f5f5f5;
}

.sort-dropdown .dropdown-item.active {
    background: #7A1F1F;
    color: #ffffff;
}

/* View Toggle */
.view-toggle {
    display: inline-flex;
    background: #ffffff;
    border: 1.5px solid #e0e0e0;
    border-radius: 8px;
    padding: 0.25rem;
    gap: 0.25rem;
}

.view-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 6px;
    color: #374151;
    text-decoration: none;
    transition: all 0.2s ease;
    font-size: 1rem;
}

.view-btn:hover {
    background: #f5f5f5;
    color: #333;
}

.view-btn.active {
    background: #7A1F1F;
    color: #ffffff;
}

/* ============================================
   Listing Cards
   ============================================ */
.results-content {
    margin-bottom: 2rem;
}

.listings-grid {
    margin: 0;
}

.listing-card-col {
    margin-bottom: 0;
}

.listing-card {
    background: #ffffff;
    border: 1px solid #e8e8e8;
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    height: 100%;
    display: flex;
    flex-direction: column;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.listing-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    border-color: #d0d0d0;
}

/* Image Section */
.listing-card-image {
    position: relative;
    width: 100%;
    padding-top: 70%;
    overflow: hidden;
    background: #f5f5f5;
}

.listing-card-image .image-link {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: block;
}

.listing-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.listing-card:hover .listing-image {
    transform: scale(1.08);
}

.image-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, transparent 0%, rgba(0, 0, 0, 0.1) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.listing-card:hover .image-overlay {
    opacity: 1;
}

/* Badges */
.listing-badges {
    position: absolute;
    top: 0.75rem;
    left: 0.75rem;
    z-index: 2;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.listing-badge {
    display: inline-block;
    padding: 0.375rem 0.75rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.3px;
    text-transform: uppercase;
}

.badge-featured {
    background: #dc3545;
    color: #ffffff;
}

.image-count {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.375rem 0.625rem;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    border-radius: 6px;
    color: #ffffff;
    font-size: 0.8125rem;
    font-weight: 500;
}

.favorite-btn {
    position: absolute;
    bottom: 0.75rem;
    right: 0.75rem;
    z-index: 2;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 50%;
    color: #374151;
    font-size: 1.125rem;
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 0;
    bottom: auto;
    top: .75rem;
    right: auto;
    left: .75rem;
}

.favorite-btn:hover {
    background: #ffffff;
    border-color: #7A1F1F;
    color: #7A1F1F;
    transform: scale(1.1);
}

.favorite-btn.saved {
    background: #dc3545;
    border-color: #dc3545;
    color: #ffffff;
}

.favorite-btn.saved:hover {
    background: #c82333;
    border-color: #c82333;
}

/* Content Section */
.listing-card-content {
    padding: .75rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    margin: 0 8px;
    margin-top: -10px;
    background-color: #fff;
    position: relative;
    border-radius: 10px 10px 0;
}

.listing-category {
    display: inline-block;
    font-size: 0.8125rem;
    font-weight: 500;
    color: #7A1F1F;
    text-decoration: none;
    margin-bottom: 0.625rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.listing-category:hover {
    text-decoration: underline;
}

.listing-title {
    font-size: 1rem;
    font-weight: 600;
    color: #1a1a1a;
    margin: 0 0 1rem 0;
    line-height: 1.3;
    flex: 1;
}

.listing-title a {
    color: inherit;
    text-decoration: none;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.listing-title a:hover {
    color: #7A1F1F;
}

/* Meta Badges */
.listing-meta-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
    min-width: 0; /* Allow flex children to shrink */
}

.meta-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.375rem 0.75rem;
    background: #f8f5f5;
    border: 1px solid #ead6d6;
    border-radius: 6px;
    font-family: var(--font-family-base, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif);
    font-size: 0.8125rem;
    font-weight: 500;
    color: #374151;
    text-decoration: none;
    transition: all 0.2s ease;
    white-space: nowrap;
    max-width: 100%;
    overflow: hidden;
    flex-shrink: 1;
    min-width: 0;
}

.meta-badge span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 300px; /* Limit category text length on desktop */
    display: inline-block;
}

.meta-badge i {
    font-size: 0.875rem;
    opacity: 0.7;
}

.meta-badge.badge-category {
    background: rgba(122, 31, 31, 0.04);
    border-color: rgba(122, 31, 31, 0.14);
    color: #5a1519;
}

.meta-badge.badge-category:hover {
    background: rgba(122, 31, 31, 0.09);
    border-color: rgba(122, 31, 31, 0.2);
    color: #7A1F1F;
}

.meta-badge.badge-location {
    background: rgba(122, 31, 31, 0.04);
    border-color: rgba(122, 31, 31, 0.14);
    color: #5a1519;
}

.meta-badge.badge-location:hover {
    background: rgba(122, 31, 31, 0.09);
    border-color: rgba(122, 31, 31, 0.2);
    color: #7A1F1F;
}

.meta-badge.badge-date {
    background: rgba(122, 31, 31, 0.03);
    border-color: rgba(122, 31, 31, 0.1);
    color: #555;
}

.meta-badge.badge-type {
    background: rgba(122, 31, 31, 0.04);
    border-color: rgba(122, 31, 31, 0.14);
    color: #5a1519;
}

.meta-badge.badge-package {
    background: rgba(122, 31, 31, 0.06);
    border-color: rgba(122, 31, 31, 0.18);
    color: #5a1519;
}

.listing-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: .5rem;
    margin-top: auto;
}

.listing-price {
    font-size: 1.375rem;
    font-weight: 700;
    color: #4a7206;
    line-height: 1.15;
}

.listing-price .negotiable-indicator,
.compact-price .negotiable-indicator,
.business-card__price .negotiable-indicator,
.fs-4.fw-bold .negotiable-indicator,
.account-listing-card .negotiable-indicator {
    font-size: 0.6875rem;
    font-weight: 600;
    color: #6b8e23;
    background: rgba(74, 114, 6, 0.1);
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
}

.package-badge {
    display: inline-block;
    padding: 0.375rem 0.75rem;
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    color: #856404;
}

/* ============================================
   List View
   ============================================ */
.listings-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.listing-card-list {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    overflow: hidden;
}

.listing-card-list:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
    transform: translateY(-2px);
}

.listing-card-list-wrapper {
    display: flex;
    gap: 1.5rem;
    padding: 1.5rem;
}

/* List View Image */
.listing-image-section {
    position: relative;
    flex-shrink: 0;
    width: 280px;
    min-width: 280px;
    border-radius: 10px;
    overflow: hidden;
    background: #f5f5f5;
}

.listing-image-section .image-link {
    display: block;
    width: 100%;
    height: 100%;
    position: relative;
    padding-top: 75%;
}

.listing-image-list {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.listing-card-list:hover .listing-image-list {
    transform: scale(1.05);
}

.image-overlay-list {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, transparent 0%, rgba(0, 0, 0, 0.1) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.listing-card-list:hover .image-overlay-list {
    opacity: 1;
}

.listing-badges-list {
    position: absolute;
    top: 0.75rem;
    left: 0.75rem;
    z-index: 2;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.image-count-list {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.375rem 0.625rem;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    border-radius: 6px;
    color: #ffffff;
    font-size: 0.8125rem;
    font-weight: 500;
}

.favorite-btn-list {
    position: absolute;
    bottom: 0.75rem;
    right: 0.75rem;
    z-index: 2;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 50%;
    color: #374151;
    font-size: 1.125rem;
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 0;
}

.favorite-btn-list:hover {
    background: #ffffff;
    border-color: #7A1F1F;
    color: #7A1F1F;
    transform: scale(1.1);
}

.favorite-btn-list.saved {
    background: #dc3545;
    border-color: #dc3545;
    color: #ffffff;
}

.favorite-btn-list.saved:hover {
    background: #c82333;
    border-color: #c82333;
}

/* List View Content */
.listing-content-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    justify-content: center;
}

.listing-content-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1.5rem;
    margin-bottom: 1rem;
}

.listing-title-list {
    font-size: 1.25rem;
    font-weight: 600;
    color: #1a1a1a;
    margin: 0;
    line-height: 1.3;
    flex: 1;
}

.listing-title-list a {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s ease;
}

.listing-title-list a:hover {
    color: #7A1F1F;
}

.listing-price-list {
    font-size: 1.5rem;
    font-weight: 700;
    color: #7A1F1F;
    line-height: 1.15;
    white-space: nowrap;
}

.listing-meta-badges-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

/* Responsive List View */
@media (max-width: 991.98px) {
    .listing-image-section {
        width: 240px;
        min-width: 240px;
    }
}

@media (max-width: 767.98px) {
    .listing-card-list-wrapper {
        flex-direction: column;
        padding: 1rem;
    }
    
    .listing-image-section {
        width: 100%;
        min-width: 100%;
    }
    
    .listing-content-header {
        flex-direction: column;
        gap: 1rem;
    }
    
    .listing-title-list {
        font-size: 1.125rem;
    }
    
    .listing-price-list {
        font-size: 1.5rem;
        align-self: flex-start;
    }
}

/* ============================================
   Compact View
   ============================================ */
.listings-compact {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.listing-card-compact {
    background: #ffffff;
    border: 1px solid #e8e8e8;
    border-radius: 10px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    overflow: hidden;
}

.listing-card-compact:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
    border-color: #d0d0d0;
}

.listing-compact-wrapper {
    display: flex;
    gap: 1.25rem;
    padding: 1rem 1.25rem;
    align-items: center;
}

/* Compact Image */
.listing-compact-image {
    position: relative;
    flex-shrink: 0;
    width: 120px;
    min-width: 120px;
    height: 90px;
    border-radius: 8px;
    overflow: hidden;
    background: #f5f5f5;
}

.listing-compact-image .image-link {
    display: block;
    width: 100%;
    height: 100%;
}

.compact-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.listing-card-compact:hover .compact-image {
    transform: scale(1.1);
}

.compact-badge {
    position: absolute;
    top: 0.5rem;
    left: 0.5rem;
    z-index: 2;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.3px;
    text-transform: uppercase;
}

.favorite-btn-compact {
    position: absolute;
    bottom: 0.5rem;
    right: 0.5rem;
    z-index: 2;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 50%;
    color: #374151;
    font-size: 0.9375rem;
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 0;
}

.favorite-btn-compact:hover {
    background: #ffffff;
    border-color: #7A1F1F;
    color: #7A1F1F;
    transform: scale(1.15);
}

.favorite-btn-compact.saved {
    background: #dc3545;
    border-color: #dc3545;
    color: #ffffff;
}

.favorite-btn-compact.saved:hover {
    background: #c82333;
    border-color: #c82333;
}

/* Compact Content */
.listing-compact-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    min-width: 0;
}

.compact-content-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
}

.compact-title {
    font-size: 1rem;
    font-weight: 600;
    color: #1a1a1a;
    margin: 0;
    line-height: 1.3;
    flex: 1;
}

.compact-title a {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s ease;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.compact-title a:hover {
    color: #7A1F1F;
}

.compact-price {
    font-size: 1.25rem;
    font-weight: 700;
    color: #7A1F1F;
    line-height: 1.15;
    white-space: nowrap;
}

.compact-meta-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

/* Responsive Compact View */
@media (max-width: 767.98px) {
    .listing-compact-wrapper {
        flex-direction: column;
        padding: 1rem;
    }
    
    .listing-compact-image {
        width: 100%;
        min-width: 100%;
        height: 200px;
    }
    
    .compact-content-header {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .compact-title {
        font-size: 1rem;
    }
    
    .compact-price {
        font-size: 1.25rem;
        align-self: flex-start;
    }
}

/* ============================================
   Empty State
   ============================================ */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    background: #ffffff;
    border-radius: 12px;
    border: 1px solid #e8e8e8;
}

.empty-state-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f5f5f5;
    border-radius: 50%;
    color: #999;
    font-size: 2.5rem;
}

.empty-state h3 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #1a1a1a;
    margin: 0 0 0.75rem 0;
}

.empty-state p {
    font-size: 1rem;
    color: #374151;
    margin: 0;
}

/* ============================================
   Save Search
   ============================================ */
.save-search-section {
    margin: 2rem 0;
    text-align: center;
}

.save-search-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.875rem 2rem;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: 1.5px solid #e0e0e0;
    border-radius: 10px;
    color: #7A1F1F;
    text-decoration: none;
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.2s ease;
}

.save-search-btn:hover {
    background: linear-gradient(135deg, #e9ecef 0%, #dee2e6 100%);
    border-color: #7A1F1F;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(122, 31, 31, 0.15);
}

/* ============================================
   Pagination
   ============================================ */
.pagination-wrapper {
    margin-top: 2rem;
}

.pagination-wrapper .pagination {
    justify-content: center;
}

/* ============================================
   Sidebar (Accordion Style)
   ============================================ */
.sidebar-wrapper {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.sidebar-filter-block {
    background: #ffffff;
    border: 1px solid #e8e8e8;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

/* Accordion Styling */
.sidebar-filter-block .accordion {
    margin: 0;
}

.sidebar-filter-block .accordion-item {
    border: none;
    border-radius: 0;
    background: transparent;
}

.sidebar-filter-block .accordion-header {
    margin: 0;
}

.sidebar-filter-block .accordion-button {
    background: transparent;
    border: none;
    border-bottom: 1px solid #f0f0f0;
    padding: 1rem 1.25rem;
    font-weight: 600;
    font-size: 0.9375rem;
    color: #1a1a1a;
    box-shadow: none;
    border-radius: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.sidebar-filter-block .accordion-button:not(.collapsed) {
    background: #f8f9fa;
    color: #7A1F1F;
    border-bottom-color: #e8e8e8;
}

.sidebar-filter-block .accordion-button::after {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='%23333' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3E%3C/svg%3E");
    width: 1rem;
    height: 1rem;
    transition: transform 0.2s ease;
}

.sidebar-filter-block .accordion-button:not(.collapsed)::after {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='%237A1F1F' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3E%3C/svg%3E");
    transform: rotate(180deg);
}

.filter-title {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    flex: 1;
}

.filter-title i {
    font-size: 1rem;
    opacity: 0.7;
}

.accordion-body {
    padding: 1rem 1.25rem;
}

/* Date Posted (Non-Accordion) */
.filter-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid #f0f0f0;
}

.filter-title-text {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    font-size: 0.9375rem;
    font-weight: 600;
    color: #1a1a1a;
    margin: 0;
}

.filter-title-text i {
    font-size: 1rem;
    opacity: 0.7;
}

.filter-content {
    padding: 1rem 1.25rem;
}

/* Filter Lists */
.filter-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.filter-list-item {
    padding: 0.5rem 0;
    margin: 0;
    font-size: 0.9375rem;
    color: #374151;
    border-bottom: 1px solid #f8f8f8;
}

.filter-list-item:last-child {
    border-bottom: none;
}

.filter-list-item a {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #374151;
    text-decoration: none;
    transition: color 0.2s ease;
}

.filter-list-item a:hover {
    color: #7A1F1F;
}

.filter-list-item.active {
    color: #7A1F1F;
    font-weight: 500;
}

.filter-list-item.active span {
    color: #7A1F1F;
}

.filter-list-item i {
    font-size: 0.875rem;
    opacity: 0.6;
    flex-shrink: 0;
}

.filter-count {
    margin-left: auto;
    font-size: 0.8125rem;
    color: #999;
    font-weight: normal;
}

.filter-list-item.active .filter-count {
    color: #7A1F1F;
}

/* Back Link */
.filter-back-link {
    margin-bottom: 0.75rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #f0f0f0;
}

.filter-back-link a {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: #7A1F1F;
    text-decoration: none;
    font-size: 0.9375rem;
    font-weight: 500;
    transition: color 0.2s ease;
}

.filter-back-link a:hover {
    color: #5a1519;
    text-decoration: underline;
}

/* Radio List (Date Posted) */
.filter-radio-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.filter-radio-item {
    padding: 0.625rem 0;
    margin: 0;
    border-bottom: 1px solid #f8f8f8;
}

.filter-radio-item:last-child {
    border-bottom: none;
}

.filter-radio {
    margin: 0;
    margin-right: 0.625rem;
    cursor: pointer;
    width: 1.125rem;
    height: 1.125rem;
    border: 2px solid #d0d0d0;
    border-radius: 50%;
    appearance: none;
    -webkit-appearance: none;
    position: relative;
    transition: all 0.2s ease;
}

.filter-radio:checked {
    border-color: #7A1F1F;
    background: #ffffff;
}

.filter-radio:checked::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 50%;
    background: #7A1F1F;
}

.filter-radio-label {
    font-size: 0.9375rem;
    color: #374151;
    cursor: pointer;
    margin: 0;
    user-select: none;
    font-weight: 400;
}

.filter-radio:checked + .filter-radio-label {
    color: #7A1F1F;
    font-weight: 500;
}

/* Price Filter */
.filter-price-inputs {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.filter-price-inputs .col-6 {
    flex: 1;
}

.filter-submit-btn {
    width: 100%;
    padding: 0.625rem 1rem;
    background: #7A1F1F;
    border: none;
    border-radius: 6px;
    color: #ffffff;
    font-size: 0.9375rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.filter-submit-btn:hover {
    background: #5a1519;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(122, 31, 31, 0.3);
}

/* Clear Filter Buttons */
.sidebar-filter-block a[href*="clear"] {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #f0f0f0;
    color: #999;
    text-decoration: none;
    font-size: 0.75rem;
    transition: all 0.2s ease;
    opacity: 0.7;
    flex-shrink: 0;
}

.sidebar-filter-block a[href*="clear"]:hover {
    background: #dc3545;
    color: #ffffff;
    opacity: 1;
    transform: scale(1.1);
}

/* Long Lists (Scrollable) */
.long-list {
    max-height: 300px;
    overflow-y: auto;
    padding-right: 0.5rem;
    margin-right: -0.5rem;
}

.long-list::-webkit-scrollbar {
    width: 6px;
}

.long-list::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.long-list::-webkit-scrollbar-thumb {
    background: #c0c0c0;
    border-radius: 3px;
    transition: background 0.2s ease;
}

.long-list::-webkit-scrollbar-thumb:hover {
    background: #7A1F1F;
}

/* Fields (Custom Fields) */
.sidebar-filter-block .vstack {
    gap: 1rem;
}

.sidebar-filter-block .form-control,
.sidebar-filter-block .form-select {
    border: 1.5px solid #d0d0d0;
    border-radius: 6px;
    padding: 0.625rem 0.875rem;
    font-size: 0.9375rem;
    transition: all 0.2s ease;
    background: #fff;
}

.sidebar-filter-block .form-control:focus,
.sidebar-filter-block .form-select:focus {
    border-color: #7A1F1F;
    box-shadow: 0 0 0 3px rgba(122, 31, 31, 0.1);
    outline: none;
}

.sidebar-filter-block .btn-secondary {
    background-color: #374151;
    border-color: #374151;
    border-radius: 6px;
    padding: 0.625rem 1.25rem;
    font-weight: 500;
    transition: all 0.2s ease;
    color: #fff;
}

.sidebar-filter-block .btn-secondary:hover {
    background-color: #555;
    border-color: #555;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.sidebar-filter-block .form-check-input {
    border: 2px solid #d0d0d0;
    border-radius: 4px;
    transition: all 0.2s ease;
    width: 1.125rem;
    height: 1.125rem;
    margin-top: 0.125rem;
    cursor: pointer;
}

.sidebar-filter-block .form-check-input:checked {
    background-color: #7A1F1F;
    border-color: #7A1F1F;
}

.sidebar-filter-block .form-check-label {
    color: #444;
    font-size: 0.9375rem;
    cursor: pointer;
    margin-left: 0.5rem;
}

/* Offcanvas Sidebar */
.offcanvas-header {
    border-bottom: 1px solid #e8e8e8;
    padding: 1.5rem;
    background: #fafafa;
}

.offcanvas-title {
    font-weight: 600;
    color: #1a1a1a;
    font-size: 1.125rem;
}

.offcanvas-body {
    padding: 1.5rem;
    background: #fff;
}

/* ============================================
   Responsive Design
   ============================================ */
@media (max-width: 991.98px) {
    .search-container {
        padding: 1.5rem 0 3rem;
    }
    
    .results-header {
        padding: 1.25rem 1.5rem;
    }
    
    .results-title {
        font-size: 1.5rem;
    }
    
    .results-header-top {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
    }
    
    .clear-filters-btn {
        width: 100%;
        justify-content: center;
    }
    
    .results-toolbar {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
    }
    
    .toolbar-actions {
        justify-content: space-between;
    }
}

@media (max-width: 767.98px) {
    /* Container & Layout */
    .search-page-wrapper {
        background: #f8f9fa;
    }
    
    .search-container {
        padding: 1rem 0 2rem;
    }
    
    .container-fluid {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    /* Search Form */
    #searchForm .bg-primary {
        padding: 1.25rem 1rem;
        border-radius: 10px;
    }
    
    /* Results Header - Mobile Optimized */
    .results-header {
        padding: 1rem;
        border-radius: 10px;
        margin-bottom: 1rem;
    }
    
    .results-header-top {
        flex-direction: column;
        align-items: stretch;
        gap: 0.875rem;
        margin-bottom: 1rem;
    }
    
    .results-title-section {
        width: 100%;
    }
    
    .results-title {
        font-size: 1.25rem;
        font-weight: 700;
        margin-bottom: 0;
        line-height: 1.3;
    }
    
    .results-count {
        font-size: 0.875rem;
        color: #374151;
    }
    
    .clear-filters-btn {
        width: 100%;
        justify-content: center;
        padding: .5rem 0.75rem;
        font-size: 0.875rem;
        border-radius: 8px;
        min-height: auto; /* Better touch target */
    }
    
    .clear-filters-text {
        display: inline;
    }
    
    /* Post Type Tabs - Mobile Scrollable */
    .post-type-tabs-wrapper {
        margin: 0 -1rem;
        padding-left: 1rem;
        padding-right: 1rem;
        padding-top: 0.875rem;
    }
    
    .post-type-tabs {
        gap: 0.5rem;
        padding-bottom: 0.75rem;
        margin-bottom: 0;
    }
    
    .post-type-tab {
        padding: 0.625rem 1rem;
        font-size: 0.875rem;
        white-space: nowrap;
        flex-shrink: 0;
        min-height: 40px;
    }
    
    .tab-label {
        font-size: 0.875rem;
    }
    
    .tab-badge {
        min-width: 22px;
        height: 22px;
        font-size: 0.6875rem;
        padding: 0 0.375rem;
    }
    
    /* Results Toolbar - Mobile Stacked */
    .results-toolbar {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
        padding-top: 0;
        margin-top: 0.875rem;
        border-top: none;
    }
    
    .filter-toggle-btn {
        width: 100%;
        justify-content: center;
        padding: 0.75rem 1rem;
        font-size: 0.875rem;
        min-height: 44px; /* Better touch target */
        border-radius: 8px;
    }
    
    .filter-toggle-text {
        display: inline;
    }
    
    .toolbar-actions {
        display: flex;
        justify-content: space-between;
        align-items: stretch;
        gap: 0.75rem;
        width: 100%;
        flex-wrap: nowrap;
    }
    
    .sort-dropdown {
        flex: 1;
        min-width: 0; /* Allow flex item to shrink */
        position: relative;
    }
    
    .sort-toggle {
        width: 100%;
        justify-content: space-between;
        padding: 0.75rem 1rem;
        font-size: 0.875rem;
        min-height: 44px; /* Better touch target */
        border-radius: 8px;
        white-space: nowrap;
        overflow: hidden;
    }
    
    .sort-toggle i:first-child {
        flex-shrink: 0;
    }
    
    .sort-toggle-text {
        display: inline;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        flex: 1;
        text-align: left;
    }
    
    .sort-toggle i:last-child {
        flex-shrink: 0;
        margin-left: 0.5rem;
    }
    
    .sort-dropdown .dropdown-menu {
        width: 100%;
        min-width: auto;
        max-width: 100%;
        margin-top: 0.5rem;
        border-radius: 8px;
        left: 0 !important;
        right: auto !important;
        transform: none !important;
        position: absolute;
        z-index: 1050;
        max-height: 70vh;
        overflow-y: auto;
    }
    
    .sort-dropdown .dropdown-menu.dropdown-menu-end {
        left: auto !important;
        right: 0 !important;
    }
    
    .sort-dropdown .dropdown-item {
        padding: 0.75rem 1rem;
        font-size: 0.875rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    /* Ensure dropdown is visible on mobile */
    .sort-dropdown.show .dropdown-menu {
        display: block;
        position: absolute;
        top: 100%;
        margin-top: 0.5rem;
    }
    
    .view-toggle {
        display: flex;
        gap: 0.5rem;
        flex-shrink: 0;
        background: #ffffff;
        border: 1.5px solid #e0e0e0;
        border-radius: 8px;
        padding: 0.25rem;
    }
    
    .view-btn {
        width: 40px;
        height: 40px;
        min-width: 40px;
        min-height: 40px;
        display: flex;
        align-items: center;
        justify-content: center;
        border-radius: 6px;
        font-size: 1rem;
        color: #374151;
        text-decoration: none;
        transition: all 0.2s ease;
        background: transparent;
        border: none;
    }
    
    .view-btn:hover {
        background: #f5f5f5;
        color: #7A1F1F;
    }
    
    .view-btn.active {
        background: #7A1F1F;
        color: #ffffff;
    }
    
    /* Results Content */
    .results-content {
        margin-top: 0;
    }
    
    /* Listing Cards - Mobile */
    .listing-card-image {
        padding-top: 60%;
    }
    
    .listing-card-content {
        padding: 1rem;
    }
    
    .listing-title {
        font-size: 0.9375rem;
        line-height: 1.4;
        margin-bottom: 0.5rem;
    }
    
    .listing-title a {
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }
    
    .listing-price {
        font-size: 1.125rem;
        font-weight: 700;
    }
    
    .listing-meta-badges {
        gap: 0.375rem;
        margin-bottom: 0.75rem;
        flex-wrap: wrap;
        min-width: 0;
    }
    
    .meta-badge {
        font-size: 0.75rem;
        padding: 0.25rem 0.5rem;
        max-width: 100%;
        min-width: 0;
        flex-shrink: 1;
    }
    
    .meta-badge span {
        max-width: 200px; /* Limit category text length on mobile */
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        display: inline-block;
    }
    
    /* Empty State */
    .empty-state {
        padding: 3rem 1.5rem;
        text-align: center;
    }
    
    .empty-state-icon {
        font-size: 3rem;
        margin-bottom: 1rem;
    }
    
    .empty-state h3 {
        font-size: 1.125rem;
        margin-bottom: 0.5rem;
    }
    
    .empty-state p {
        font-size: 0.875rem;
        color: #374151;
    }
    
    /* Save Search Button */
    .save-search-section {
        margin-top: 1.5rem;
        padding: 0 0.5rem;
    }
    
    .save-search-btn {
        width: 100%;
        justify-content: center;
        padding: 0.875rem 1rem;
        font-size: 0.875rem;
        min-height: 44px;
        border-radius: 8px;
    }
    
    /* Pagination */
    .pagination-wrapper {
        margin-top: 1.5rem;
        padding: 0 0.5rem;
    }
    
    /* Row spacing */
    .row.g-4 {
        --bs-gutter-y: 1rem;
        --bs-gutter-x: 1rem;
    }
}

/* Extra Small Screens (below 576px) */
@media (max-width: 575.98px) {
    .search-container {
        padding: 0.75rem 0 1.5rem;
    }
    
    .container-fluid {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }
    
    .results-header {
        padding: 0.875rem;
        border-radius: 8px;
        overflow: visible; /* Ensure dropdowns are visible */
    }
    
    .results-title {
        font-size: 1.125rem;
    }
    
    .results-count {
        font-size: 0.8125rem;
    }
    
    .post-type-tabs-wrapper {
        margin: 0 -0.875rem;
        padding-left: 0.875rem;
        padding-right: 0.875rem;
    }
    
    .post-type-tab {
        padding: 0.5rem 0.875rem;
        font-size: 0.8125rem;
    }
    
    .toolbar-actions {
        gap: 0.5rem;
    }
    
    .sort-toggle {
        padding: 0.625rem 0.875rem;
        font-size: 0.8125rem;
    }
    
    .sort-toggle-text {
        font-size: 0.8125rem;
    }
    
    .view-toggle {
        gap: 0.25rem;
        padding: 0.2rem;
    }
    
    .view-btn {
        width: 36px;
        height: 36px;
        min-width: 36px;
        min-height: 36px;
        font-size: 0.9375rem;
    }
    
    .listing-card-content {
        padding: 0.875rem;
    }
    
    .listing-title {
        font-size: 0.875rem;
    }
    
    .listing-price {
        font-size: 1rem;
    }
}

/* Select2 Customization */
.select2-container--default .select2-selection--single {
    border: 1.5px solid #d0d0d0 !important;
    border-radius: 8px !important;
    height: 50px !important;
    padding: 0.5rem;
}

.select2-container--default .select2-selection--single .select2-selection__rendered {
    line-height: 2.5 !important;
    padding-left: 0.5rem;
    color: #333;
}

.select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 48px;
    right: 0.5rem;
}

.select2-container--default.select2-container--focus .select2-selection--single {
    border-color: #7A1F1F !important;
    box-shadow: 0 0 0 4px rgba(122, 31, 31, 0.1) !important;
}

.select2-dropdown {
    border: 1px solid #e0e0e0 !important;
    border-radius: 8px !important;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12) !important;
}
