.listing-archive-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

.listing-archive-header {
    text-align: center;
    margin-bottom: 3rem;
}

.listing-archive-header h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: #333;
}

.listing-count {
    font-size: 1.1rem;
    color: #666;
    margin-bottom: 1.5rem;
}

/* New layout with sidebar */
.listing-content-wrapper {
    display: flex;
    gap: 2rem;
    align-items: flex-start;
}

.listing-main-content {
    flex: 1;
    min-width: 0; /* Prevents flex items from growing beyond container */
}

.listing-filters-sidebar {
    flex: 0 0 300px; /* Fixed width sidebar */
    background: #fff;
    border: 1px solid #e1e1e1;
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 2rem; /* Back to normal positioning */
    max-height: calc(100vh - 4rem);
    overflow-y: auto;
    order: 2; /* Sidebar on the right */
    align-self: flex-start;
}

/* Filter Sidebar Styles */
.filter-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #eee;
}

.filter-header h3 {
    margin: 0;
    font-size: 1.2rem;
    color: #333;
}

.clear-filters {
    color: #719430;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
}

.clear-filters:hover {
    text-decoration: underline;
}

.filters-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.filter-group label {
    font-weight: 600;
    color: #333;
    font-size: 0.9rem;
}

.filter-group input[type="text"],
.filter-group select {
    padding: 0.7rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.9rem;
    background: #fff;
    transition: border-color 0.3s ease;
}

.filter-group input[type="text"]:focus,
.filter-group select:focus {
    outline: none;
    border-color: #719430;
    box-shadow: 0 0 0 2px rgba(113, 148, 48, 0.1);
}

/* Price range inputs */
.price-range-inputs {
    display: flex;
    gap: 0.5rem;
}

.price-range-inputs select {
    flex: 1;
}

/* Property-specific filters */
.property-specific-filters {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid #eee;
}

/* Filter submit button */
.filter-submit {
    margin-top: 1rem;
    padding-top: 1rem;
}

.filter-submit-btn {
    width: 100%;
    padding: 0.8rem 1.5rem;
    background-color: #719430;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.filter-submit-btn:hover {
    background-color: #5a7628;
}

/* Adjust main grid to work with sidebar */
.listing-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.listing-card {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: box-shadow 0.3s ease;
    max-width: 320px;
    margin: 0 auto;
}

.listing-card:hover {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.listing-image {
    position: relative;
    padding-top: 75%; /* 4:3 aspect ratio */
    overflow: hidden;
    background: #f5f5f5;
}

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

.listing-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.listing-image.no-image {
    display: flex;
    align-items: center;
    justify-content: center;
}

.listing-image.no-image i {
    font-size: 3rem;
    color: #ccc;
}

.listing-content {
    padding: 1.25rem;
}

.listing-title {
    margin: 0 0 0.75rem;
    font-size: 1.1rem;
}

.listing-title a {
    color: #333;
    text-decoration: none;
    transition: color 0.3s ease;
}

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

.listing-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 0.75rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #eee;
}

.listing-type,
.listing-region {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.85rem;
    color: #666;
}

.listing-type i,
.listing-region i {
    font-size: 0.8rem;
    color: #719430;
}

.listing-type span {
    background: #f0f6e8;
    color: #719430;
    padding: 0.2rem 0.5rem;
    border-radius: 12px;
    font-weight: 500;
    font-size: 0.75rem;
}

/* Default price styling - shows after location */
.listing-price {
    font-size: 1.5rem;
    font-weight: bold;
    color: #719430;
    text-align: right;
}

/* Desktop price in bottom row - hidden by default */
.listing-price-desktop {
    display: none; /* No longer needed */
}

/* Mobile price in bottom row - hidden by default */
.listing-price-mobile {
    display: none; /* No longer needed */
}

/* Desktop list view: hide main price, show desktop price */
@media (min-width: 769px) {
    .listing-archive-container .list-view .listing-content {
        flex-direction: column;
        justify-content: space-between;
        padding: 1.5rem;
    }
    
    .listing-archive-container .list-view .listing-price {
        display: block !important;
        font-size: 1.5rem !important;
    }
    
    .listing-archive-container .list-view .listing-price-desktop {
        display: none !important; /* No longer needed */
    }
    
    /* Hide mobile price on desktop with higher specificity */
    .listing-archive-container .listing-price-mobile {
        display: none !important;
    }
}

@media (max-width: 768px) {
    .listing-archive-container {
        padding: 0.75rem;
    }

    .listing-archive-container .listing-archive-header h1 {
        font-size: 2rem;
    }

    /* Mobile: Stack sidebar below main content */
    .listing-content-wrapper {
        flex-direction: column;
        gap: 1.5rem;
    }

    .listing-filters-sidebar {
        order: 1; /* Show filters first on mobile */
        flex: none;
        width: 100% !important; /* Force full width on mobile */
        position: static;
        max-height: none;
        padding: 0.25rem !important; /* Even more minimal padding */
        margin: 0 0 0.5rem 0 !important; /* Even smaller bottom margin */
    }

    .listing-main-content {
        order: 2;
    }

    /* Mobile filter toggle visibility */
    .mobile-filter-toggle {
        display: block !important;
        margin-top: 0.2rem; /* Reduced margin */
        padding-top: 0.2rem; /* Reduced padding */
    }

    /* Hide additional filters by default on mobile */
    .additional-filters {
        display: none;
        margin-top: 0.3rem; /* Even more reduced margin */
    }

    /* When expanded, show additional filters */
    .listing-filters-sidebar.expanded .additional-filters {
        display: flex;
    }

    /* Hide view toggle on mobile - force grid view only */
    .listing-archive-container .view-toggle {
        display: none;
    }

    /* Mobile-specific spacing reductions with higher specificity */
    .listing-filters-sidebar .filter-header {
        margin-bottom: 0.5rem !important; /* Even smaller margin */
        padding-bottom: 0.3rem !important; /* Even smaller padding */
    }

    .listing-filters-sidebar .filters-form {
        gap: 0.5rem !important; /* Even smaller gaps */
    }

    .listing-filters-sidebar .additional-filters {
        gap: 0.5rem !important; /* Even smaller gaps */
    }

    .listing-filters-sidebar .filter-group {
        gap: 0.2rem !important; /* Even smaller gap */
    }

    /* Mobile filter labels - keep small */
    .listing-filters-sidebar .filter-group label {
        font-size: 0.8rem !important;
        margin-bottom: 0.1rem !important;
    }

    /* Make filter form more mobile-friendly - fix dropdown content size */
    .filter-group input[type="text"],
    .filter-group select {
        padding: 0.4rem !important; /* Slightly reduced padding */
        font-size: 16px !important; /* Larger size for better readability */
    }

    /* Make sure dropdown options are readable */
    .filter-group select option {
        font-size: 16px !important; /* Larger font for dropdown options */
        padding: 0.5rem !important; /* More padding for touch targets */
    }

    /* Additional mobile dropdown styling for better readability */
    .listing-filters-sidebar select {
        font-size: 16px !important;
        line-height: 1.4 !important;
        -webkit-appearance: menulist !important;
        -moz-appearance: menulist !important;
        appearance: menulist !important;
    }

    /* Ensure all select elements have proper sizing */
    .listing-filters-sidebar select,
    .listing-filters-sidebar select option {
        font-size: 16px !important;
        min-height: 44px !important; /* iOS recommended touch target size */
    }

    /* Price range inputs styling for mobile */
    .price-range-inputs {
        flex-direction: column;
        gap: 0.3rem; /* Smaller gap between price inputs */
    }

    /* Force grid view layout on mobile regardless of list-view class */
    .listing-archive-container .listing-grid,
    .listing-archive-container .listing-grid.list-view {
        display: grid;
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    /* Override list view card styling to use grid layout */
    .listing-archive-container .list-view .listing-card,
    .listing-archive-container .listing-card {
        display: block;
        flex-direction: column;
        min-height: auto;
        max-width: none;
        margin: 0 auto;
    }
    
    /* Mobile styles for listing cards continue as before */
    .listing-archive-container .list-view .listing-image,
    .listing-archive-container .listing-image {
        width: 100%;
        flex: none;
        position: relative;
        padding-top: 60%;
        overflow: hidden;
    }
    
    .listing-archive-container .list-view .listing-content,
    .listing-archive-container .listing-content {
        width: 100%;
        flex: 1;
        padding: 1rem;
    }

    /* Mobile specific adjustments */
    .listing-archive-container .listing-features {
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .listing-archive-container .listing-meta-row {
        flex-direction: column;
        gap: 0.5rem;
        align-items: flex-start;
    }

    .listing-archive-container .listing-type-region {
        flex-direction: column;
        gap: 0.3rem;
        align-items: flex-start;
    }

    .listing-archive-container .listing-location {
        margin: 0.5rem 0;
    }

    .listing-archive-container .listing-details-row {
        flex-direction: column;
        gap: 0.3rem;
        align-items: flex-start;
        margin: 0.5rem 0;
    }

    .listing-archive-container .listing-content {
        padding: 1rem;
    }

    .listing-archive-container .listing-price {
        font-size: 1.3rem;
        margin: 0.5rem 0;
        text-align: left;
    }

    .listing-archive-container .listing-bottom-row {
        flex-direction: column;
        gap: 0.8rem;
        align-items: stretch;
    }

    .listing-archive-container .listing-view-more {
        align-self: stretch;
        text-align: center;
    }

    .listing-archive-container .listing-price-desktop {
        display: none !important;
    }
}

/* Tablet breakpoint for sidebar */
@media (max-width: 1024px) and (min-width: 769px) {
    .listing-filters-sidebar {
        flex: 0 0 250px; /* Slightly smaller sidebar on tablets */
    }
    
    .listing-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    }
}

.listing-location {
    color: #666;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.listing-features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
    gap: 1rem;
    margin: 1rem 0;
    padding: 1rem 0;
}

.listing-feature {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.listing-feature i {
    font-size: 1.3rem;
    color: #719430;
    margin-bottom: 0.5rem;
}

.listing-feature span {
    font-size: 1rem;
    font-weight: 500;
    color: #333;
    margin-bottom: 0.25rem;
}

.listing-feature small {
    font-size: 0.75rem;
    color: #666;
}

.listing-view-more {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: #fff;
    color: #719430;
    text-decoration: none;
    border: 2px solid #719430;
    border-radius: 4px;
    transition: all 0.3s ease;
    font-weight: 500;
    white-space: nowrap;
    flex-shrink: 0;
}

.listing-view-more:hover {
    background: #719430;
    color: #fff;
}

.listing-pagination {
    display: flex;
    justify-content: center;
    margin-top: 3rem;
}

/* Clean pagination wrapper without lists */
.listing-pagination .pagination-wrapper {
    display: flex;
    justify-content: center;
    gap: 0.5rem; /* Desktop spacing */
    align-items: center;
    margin: 0;
    padding: 0;
}

.listing-pagination .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 8px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    color: #333;
    text-decoration: none;
    transition: all 0.3s ease;
    line-height: 1;
    margin: 0;
    box-sizing: border-box;
    font-size: 14px;
}

.listing-pagination .page-numbers.current {
    background: #719430;
    color: #fff;
    border-color: #719430;
}

.listing-pagination .page-numbers:hover:not(.current) {
    background: #f5f5f5;
    border-color: #719430;
}

/* Handle dots (...) */
.listing-pagination .page-numbers.dots {
    background: transparent;
    border: none;
    cursor: default;
}

.listing-pagination .page-numbers.dots:hover {
    background: transparent;
    border: none;
}

/* Ensure prev/next buttons have same styling as regular buttons */
.listing-pagination .prev,
.listing-pagination .next {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 8px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    color: #333;
    text-decoration: none;
    transition: all 0.3s ease;
    line-height: 1;
    margin: 0;
    font-size: 28px;
    font-weight: bold;
}

.listing-pagination .prev:hover,
.listing-pagination .next:hover {
    background: #f5f5f5;
    border-color: #719430;
}

.no-listings {
    text-align: center;
    padding: 3rem;
    background: #f9f9f9;
    border-radius: 8px;
}

.no-listings p {
    margin-bottom: 1rem;
    color: #666;
}

.reset-search {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    background: #719430;
    color: #fff;
    text-decoration: none;
    border-radius: 4px;
    transition: background-color 0.3s ease;
}

.reset-search:hover {
    background: #5a7a26;
}

/* List View Styles */
.listing-grid.list-view {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.list-view .listing-card {
    display: flex;
    max-width: none;
    margin: 0;
    min-height: 200px;
}

.list-view .listing-image {
    width: 400px;
    padding-top: 300px;
    flex-shrink: 0;
    border-radius: 8px 0 0 8px;
}

.list-view .listing-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 1.5rem;
}

/* New layout structure for list view */
.listing-meta-row {
    display: flex;
    justify-content: flex-start;
    align-items: flex-start;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #eee;
}

.listing-type-region {
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

.listing-type,
.listing-region {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    color: #666;
}

.listing-type .detail-icon,
.listing-region .detail-icon {
    font-size: 1rem;
}

.listing-type span:last-child {
    background: #f0f6e8;
    color: #719430;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-weight: 500;
    font-size: 0.8rem;
}

.listing-location {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #666;
    margin-bottom: 1rem;
    font-size: 0.95rem;
}

.listing-location .detail-icon {
    font-size: 1rem;
}

.listing-details-row {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    margin: 1rem 0;
    padding: 0.75rem 0;
}

.listing-detail {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    color: #555;
    padding: 0.25rem 0;
}

.listing-detail .detail-icon {
    font-size: 1rem;
}

.list-view .listing-view-more {
    width: auto;
    align-self: flex-start;
    margin-top: auto;
    padding: 0.6rem 1.25rem;
    font-size: 0.95rem;
}

/* List view bottom row - price appears next to button */
.list-view .listing-bottom-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
    gap: 1rem;
}

/* Grid view bottom row - button and price side by side */
.listing-grid:not(.list-view) .listing-bottom-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
    gap: 1rem;
}

/* Ensure the bottom row exists in both views */
.listing-bottom-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
    gap: 1rem;
}

/* View Toggle Buttons - Now in header */
.view-toggle {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    margin-bottom: 0;
}

.view-button {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: #fff;
    color: #666;
    text-decoration: none;
    border: 1px solid #ddd;
    border-radius: 4px;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.view-button:hover {
    background: #f5f5f5;
    border-color: #719430;
    color: #719430;
}

.view-button.active {
    background: #719430;
    color: #fff;
    border-color: #719430;
}

.view-button i {
    font-size: 0.8rem;
}

.listing-pagination {
    margin-top: 2rem;
}

.listing-pagination .pagination-wrapper {
    gap: 0.0625rem;
}

.listing-pagination .page-numbers {
    min-width: 35px;
    height: 35px;
    padding: 0 6px;
    font-size: 13px; /* Normal size for numbered buttons on mobile */
}

.listing-pagination .prev,
.listing-pagination .next {
    min-width: 35px;
    height: 35px;
    padding: 0 6px;
    font-size: 20px; /* Larger size for arrows on mobile */
    font-weight: bold;
}

/* Increase specificity for Enfold theme compatibility */
.listing-archive-container .listing-pagination {
    margin-top: 2rem;
}

.listing-archive-container .listing-pagination .pagination-wrapper {
    gap: 0.0625rem;
}

.listing-archive-container .listing-pagination .page-numbers {
    min-width: 35px;
    height: 35px;
    padding: 0 6px;
    font-size: 13px; /* Normal size for numbered buttons on mobile */
}

.listing-archive-container .listing-pagination .prev,
.listing-archive-container .listing-pagination .next {
    min-width: 35px !important;
    height: 35px !important;
    padding: 0 6px !important;
    font-size: 20px !important; /* Larger size for arrows on mobile */
    font-weight: bold !important;
}

/* Desktop pagination styling with higher specificity */
@media (min-width: 769px) {
    .listing-archive-container .listing-pagination .page-numbers {
        font-size: 14px; /* Normal size for numbered buttons on desktop */
    }
    
    .listing-archive-container .listing-pagination .prev,
    .listing-archive-container .listing-pagination .next {
        font-size: 28px !important; /* Larger size for arrows on desktop */
    }
}

.listing-archive-container .listing-price-desktop {
    display: none !important;
}

/* Mobile filter toggle */
.mobile-filter-toggle {
    display: none;
    text-align: center;
    margin-top: 0.2rem;
    padding-top: 0.2rem;
}

.expand-filters-text {
    color: #719430;
    font-weight: 600;
    font-size: 0.75rem; /* Even smaller text */
    position: relative;
    display: inline-block;
    padding: 0.1rem 0.3rem; /* Even more minimal padding */
    cursor: pointer;
    border-radius: 3px;
    background: #f8f9fa;
    border: 1px solid #e1e1e1;
    touch-action: manipulation; /* Prevent scroll interference */
    user-select: none; /* Prevent text selection */
}

.expand-filters-text::after {
    content: '▼';
    margin-left: 0.25rem;
    font-size: 0.65rem;
    transition: transform 0.3s ease;
}

.listing-filters-sidebar.expanded .expand-filters-text::after {
    transform: rotate(180deg);
}

/* Additional filters container */
.additional-filters {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* Search field always visible */
.search-always-visible {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
} 