/**
 * Modern Vehicle Listing Styles
 * Professional, clean design inspired by modern car listing sites
 */

/* ============================================
   RESET & BASE
   ============================================ */
* {
    box-sizing: border-box;
}

/* ============================================
   HEADER CUSTOMIZATION
   ============================================ */
.site-header {
    padding: 10px 0 !important;
    min-height: auto !important;
    background: linear-gradient(135deg, #0066cc 0%, #004d99 100%);
    border-bottom: none;
    box-shadow: 0 2px 10px rgba(0, 102, 204, 0.15);
    position: relative;
    overflow: hidden;
}

.site-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
    pointer-events: none;
}

.site-header .inside-header {
    padding: 0 20px !important;
    max-width: 1400px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

.site-branding {
    margin: 0 !important;
}

.main-title {
    font-size: 1.8em !important;
    font-weight: 700 !important;
    margin: 0 !important;
    line-height: 1.2 !important;
}

.main-title a {
    color: #ffffff !important;
    text-decoration: none !important;
    transition: all 0.3s ease;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.main-title a:hover {
    color: #e0e7ff !important;
    transform: translateX(2px);
}

.site-description {
    display: none !important;
}

/* Hide navigation menu */
.main-navigation,
.navigation-stick,
.mobile-menu-control-wrapper,
.menu-toggle {
    display: none !important;
}

/* Hide header widget area if not needed */
.header-widget {
    display: none;
}

/* Compact header on mobile */
@media (max-width: 768px) {
    .site-header {
        padding: 12px 0 !important;
    }
    
    .main-title {
        font-size: 1.5em !important;
    }
    
    .main-title a {
        text-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
    }
}

.velocity-homepage {
    min-height: 100vh;
    overflow-x: hidden; /* Prevent horizontal scroll */
    /* Ensure sticky positioning works */
    position: relative;
}

/* Override GeneratePress container constraints for full-width hero */
.site-content .velocity-homepage,
.content-area .velocity-homepage,
.site-main .velocity-homepage,
.grid-container .velocity-homepage {
    max-width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
    width: 100% !important;
    overflow: visible !important; /* Ensure sticky positioning works */
}

/* Ensure parent containers don't break sticky */
.site-content,
.content-area,
.site-main,
.grid-container {
    overflow: visible !important;
}

/* Force sticky to work - override any conflicting styles */
.velocity-homepage .main-content-wrapper,
.velocity-homepage .container,
.velocity-homepage .main-layout {
    overflow: visible !important;
}

/* Additional fix for sticky positioning */
.filters-sidebar {
    position: -webkit-sticky !important; /* Safari */
    position: sticky !important;
}

/* Override sticky on mobile - will be handled by media query */
@media (max-width: 1024px) {
    .filters-sidebar {
        position: fixed !important;
    }
}

/* Ensure hero breaks out of any container */
.velocity-homepage .hero-section {
    position: relative;
    width: 100vw !important;
    max-width: 100vw !important;
    margin-left: calc(-50vw + 50%) !important;
    margin-right: calc(-50vw + 50%) !important;
    left: 0 !important;
    right: 0 !important;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
    position: relative;
}

/* ============================================
   MINIMAL HERO SECTION - SAME STYLE AS FILTERS
   ============================================ */
.hero-section-minimal {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 6px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.08);
    margin-bottom: 20px;
    padding: 15px 20px;
}

.hero-minimal-content {
    display: flex;
    align-items: center;
    gap: 25px;
    flex-wrap: nowrap;
}

.hero-title-minimal {
    font-size: 1.8em;
    font-weight: 700;
    margin: 0;
    color: white;
    letter-spacing: -0.5px;
    white-space: nowrap;
    flex-shrink: 0;
}

.hero-search-minimal {
    flex: 1;
    min-width: 400px;
    max-width: 700px;
}

.search-input-group-minimal {
    display: flex;
    align-items: center;
    background: white;
    border-radius: 8px;
    padding: 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    overflow: hidden;
    gap: 0;
    width: 100%;
}

.search-icon {
    color: #999;
    /* margin-left: 16px; */
    flex-shrink: 0;
    width: 20px;
    height: 20px;
}

.search-input-minimal {
    flex: 1;
    border: none;
    padding: 14px 16px;
    font-size: 1em;
    outline: none;
    color: #333;
    background: transparent;
    min-width: 0;
}

.search-input-minimal::placeholder {
    color: #999;
}

.search-btn-minimal {
    background: #1a1a1a;
    border: none;
    padding: 14px 28px;
    color: white;
    font-weight: 600;
    font-size: 1em;
    cursor: pointer;
    transition: background 0.2s;
    white-space: nowrap;
    margin: 0;
    flex-shrink: 0;
}

.search-btn-minimal:hover {
    background: #333;
}

/* ============================================
   MAIN CONTENT
   ============================================ */
.main-content-wrapper {
    padding-bottom: 30px;
    position: relative;
    /* Ensure sticky positioning works */
    overflow: visible;
}

/* ============================================
   MINIMAL FILTERS SECTION
   ============================================ */
.filters-section-minimal {
    background: white;
    border-radius: 6px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.08);
    margin-bottom: 20px;
    padding: 15px 20px;
}

.filters-form-minimal {
    width: 100%;
}

.filters-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
    margin-bottom: 12px;
}

.filter-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.filter-field label {
    font-weight: 500;
    margin: 0;
    color: #555;
    font-size: 0.85em;
}

.filter-field input,
.filter-field select {
    padding: 8px 12px;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    font-size: 0.9em;
    transition: all 0.2s;
    background: white;
    color: #333;
}

.filter-field input:focus,
.filter-field select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.1);
}

.filters-actions-minimal {
    display: flex;
    gap: 10px;
    padding-top: 12px;
    border-top: 1px solid #f0f0f0;
    margin-top: 8px;
}

.btn-apply-minimal {
    background: #667eea;
    color: white;
    border: none;
    padding: 8px 20px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.9em;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-apply-minimal:hover {
    background: #5568d3;
}

.btn-reset-minimal {
    background: #f8f9fa;
    color: #666;
    border: 1px solid #e0e0e0;
    padding: 8px 20px;
    border-radius: 6px;
    font-weight: 500;
    font-size: 0.9em;
    text-decoration: none;
    display: inline-block;
    transition: all 0.2s;
}

.btn-reset-minimal:hover {
    background: #e9ecef;
    border-color: #d0d0d0;
}

/* ============================================
   RESULTS SECTION - COMPACT
   ============================================ */
.results-section {
    margin-top: 15px;
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    flex-wrap: wrap;
    gap: 12px;
}

.results-count h2 {
    margin: 0 0 2px 0;
    font-size: 1.3em;
    color: #333;
    font-weight: 700;
}

.count-text {
    margin: 0;
    color: #666;
    font-size: 0.85em;
}

.results-sort {
    display: flex;
    align-items: center;
    gap: 10px;
}

.results-sort label {
    font-weight: 500;
    color: #666;
}

.sort-select {
    padding: 8px 12px;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    font-size: 0.9em;
    background: white;
    cursor: pointer;
    transition: border-color 0.2s;
}

.sort-select:focus {
    outline: none;
    border-color: #667eea;
}

/* ============================================
   VEHICLE GRID - COMPACT CARWOW STYLE
   ============================================ */
.vehicles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
    position: relative;
}

/* ============================================
   COMPACT VEHICLE CARD - CARWOW STYLE
   ============================================ */
.vehicle-card-compact {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    transition: all 0.2s ease;
    position: relative;
    display: flex;
    flex-direction: column;
}

.vehicle-card-compact:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    transform: translateY(-2px);
}

/* Image Section */
.vehicle-image-compact {
    position: relative;
    width: 100%;
    padding-top: 65%;
    overflow: hidden;
    background: #f5f5f5;
}

.image-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.vehicle-main-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: opacity 0.3s ease;
}

/* Image Navigation */
.image-navigation {
    position: absolute;
    bottom: 12px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(4px);
    padding: 4px 8px;
    border-radius: 20px;
    z-index: 3;
}

.img-nav-btn {
    background: transparent;
    border: none;
    color: white;
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: background 0.2s;
    width: 24px;
    height: 24px;
}

.img-nav-btn:hover {
    background: rgba(255,255,255,0.2);
}

.img-nav-btn svg {
    width: 14px;
    height: 14px;
}

.image-counter {
    color: white;
    font-size: 0.75em;
    font-weight: 500;
    min-width: 35px;
    text-align: center;
}

/* Rating Badge */
.rating-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    background: #10b981;
    color: white;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.75em;
    font-weight: 600;
    z-index: 2;
    display: flex;
    align-items: center;
    gap: 6px;
}

.rating-score {
    font-weight: 700;
}

.rating-link {
    color: white;
    text-decoration: underline;
    font-weight: 400;
    font-size: 0.9em;
}

.rating-link:hover {
    text-decoration: none;
}

/* Vehicle Info */
.vehicle-info-compact {
    padding: 16px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.vehicle-title-compact {
    margin: 0;
    font-size: 1.1em;
    font-weight: 600;
    line-height: 1.3;
}

.vehicle-title-compact a {
    color: #1a1a1a;
    text-decoration: none;
    transition: color 0.2s;
}

.vehicle-title-compact a:hover {
    color: #667eea;
}

.vehicle-description-compact {
    margin: 0;
    font-size: 0.9em;
    color: #666;
    line-height: 1.4;
}

/* Savings Badge */
.savings-badge {
    background: #10b981;
    color: white;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.8em;
    font-weight: 600;
    display: inline-block;
    width: fit-content;
}

/* Pricing */
.vehicle-pricing-compact {
    margin: 4px 0;
}

.price-main {
    font-size: 1.4em;
    font-weight: 700;
    color: #1a1a1a;
    line-height: 1.2;
}

.price-monthly {
    font-size: 0.85em;
    color: #666;
    margin-top: 2px;
}

/* Quick Specs Chips */
.vehicle-quick-specs-compact {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 4px 0;
}

.spec-chip {
    background: #f3f4f6;
    color: #4b5563;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.8em;
    font-weight: 500;
}

/* Action Button */
.vehicle-action-btn {
    position: absolute;
    bottom: 16px;
    right: 16px;
    width: 40px;
    height: 40px;
    background: #1a1a1a;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: all 0.2s;
    z-index: 2;
}

.vehicle-action-btn:hover {
    background: #667eea;
    transform: scale(1.1);
}

.vehicle-action-btn svg {
    width: 20px;
    height: 20px;
}

/* ============================================
   PAGINATION - COMPACT
   ============================================ */
.pagination-wrapper {
    margin-top: 30px;
    text-align: center;
}

.pagination-wrapper .page-numbers {
    display: inline-flex;
    gap: 8px;
    list-style: none;
    padding: 0;
    margin: 0;
    flex-wrap: wrap;
    justify-content: center;
}

.pagination-wrapper .page-numbers li {
    display: inline-block;
}

.pagination-wrapper .page-numbers a,
.pagination-wrapper .page-numbers span {
    display: block;
    padding: 8px 14px;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    text-decoration: none;
    color: #666;
    font-weight: 500;
    font-size: 0.9em;
    transition: all 0.2s;
    min-width: 40px;
    text-align: center;
}

.pagination-wrapper .page-numbers a:hover {
    background: #667eea;
    color: white;
    border-color: #667eea;
    transform: translateY(-2px);
}

.pagination-wrapper .page-numbers .current {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: transparent;
}

/* ============================================
   NO RESULTS
   ============================================ */
.no-results {
    text-align: center;
    padding: 80px 20px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
}

.no-results-icon {
    font-size: 4em;
    margin-bottom: 20px;
}

.no-results h3 {
    font-size: 1.8em;
    color: #333;
    margin: 0 0 15px 0;
}

.no-results p {
    font-size: 1.1em;
    color: #666;
    margin: 0 0 30px 0;
}

.btn-primary {
    display: inline-block;
    padding: 14px 30px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 1em;
    transition: all 0.3s;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
}

/* ============================================
   SINGLE VEHICLE PAGE
   ============================================ */
.vehicle-single-wrapper {
    padding: 40px 20px;
    max-width: 1400px;
    margin: 0 auto;
}

.vehicle-breadcrumb {
    margin-bottom: 30px;
    font-size: 0.9em;
    color: #666;
}

.vehicle-breadcrumb a {
    color: #667eea;
    text-decoration: none;
    transition: color 0.3s;
}

.vehicle-breadcrumb a:hover {
    color: #764ba2;
    text-decoration: underline;
}

.vehicle-breadcrumb .separator {
    margin: 0 10px;
    color: #ccc;
}

.vehicle-content-wrapper {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 50px;
    margin-bottom: 60px;
}

.vehicle-images-column {
    position: sticky;
    top: 20px;
    height: fit-content;
}

.vehicle-main-image {
    width: 100%;
    margin-bottom: 20px;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
    background: #f8f9fa;
}

.vehicle-main-image img {
    width: 100%;
    height: auto;
    display: block;
}

.vehicle-thumbnails {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
    gap: 12px;
}

.thumbnail-item {
    cursor: pointer;
    border-radius: 8px;
    overflow: hidden;
    border: 3px solid transparent;
    transition: all 0.3s;
    opacity: 0.7;
    aspect-ratio: 1;
    background: #f8f9fa;
}

.thumbnail-item:hover,
.thumbnail-item.active {
    border-color: #667eea;
    opacity: 1;
    transform: scale(1.05);
}

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

.vehicle-details-column {
    padding-left: 30px;
}

.vehicle-header {
    margin-bottom: 30px;
    padding-bottom: 25px;
    border-bottom: 2px solid #f0f0f0;
}

.vehicle-header .vehicle-title {
    font-size: 2.2em;
    margin-bottom: 15px;
    color: #1a1a1a;
    font-weight: 700;
    line-height: 1.2;
}

.vehicle-price-main {
    font-size: 2.8em;
    font-weight: 800;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.vehicle-quick-specs {
    margin-bottom: 30px;
}

.specs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 15px;
}

.spec-box {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 18px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 10px;
    transition: transform 0.3s;
}

.spec-box:hover {
    transform: translateY(-3px);
}

.spec-box .spec-icon {
    font-size: 1.8em;
}

.spec-box .spec-label {
    display: block;
    font-size: 0.85em;
    color: #888;
    margin-bottom: 4px;
    font-weight: 500;
}

.spec-box .spec-value {
    display: block;
    font-weight: 700;
    color: #333;
    font-size: 1.05em;
}

.vehicle-contact {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 30px;
    border-radius: 12px;
    margin-top: 30px;
    color: white;
}

.vehicle-contact h3 {
    margin-top: 0;
    color: white;
    font-size: 1.5em;
}

.vehicle-contact p {
    opacity: 0.95;
    margin-bottom: 20px;
}

.contact-info {
    margin: 20px 0;
    padding: 20px;
    background: rgba(255,255,255,0.15);
    border-radius: 8px;
    backdrop-filter: blur(10px);
}

.contact-info p {
    margin: 10px 0;
    color: white;
}

.btn-enquiry {
    width: 100%;
    text-align: center;
    margin-top: 15px;
    background: white;
    color: #667eea;
}

.btn-enquiry:hover {
    background: #f8f9fa;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.vehicle-details-tabs {
    margin-top: 50px;
    border-top: 2px solid #f0f0f0;
    padding-top: 40px;
}

.tabs-nav {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
    border-bottom: 2px solid #f0f0f0;
    flex-wrap: wrap;
}

.tab-btn {
    padding: 14px 28px;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    font-size: 1em;
    color: #666;
    font-weight: 500;
    transition: all 0.3s;
    margin-bottom: -2px;
}

.tab-btn:hover,
.tab-btn.active {
    color: #667eea;
    border-bottom-color: #667eea;
}

.tab-pane {
    display: none;
}

.tab-pane.active {
    display: block;
}

.tab-pane h3 {
    margin-top: 0;
    color: #333;
    margin-bottom: 25px;
    font-size: 1.5em;
}

.specs-table {
    display: flex;
    flex-direction: column;
    gap: 0;
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.spec-row {
    display: grid;
    grid-template-columns: 220px 1fr;
    padding: 18px 25px;
    border-bottom: 1px solid #f0f0f0;
    transition: background 0.3s;
}

.spec-row:hover {
    background: #f8f9fa;
}

.spec-row:last-child {
    border-bottom: none;
}

.spec-row .spec-label {
    font-weight: 600;
    color: #666;
}

.spec-row .spec-value {
    color: #333;
    font-weight: 500;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 15px;
}

.feature-item {
    padding: 12px 18px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 8px;
    color: #333;
    font-weight: 500;
    transition: transform 0.3s;
}

.feature-item:hover {
    transform: translateX(5px);
}

.vehicle-description {
    line-height: 1.9;
    color: #555;
    font-size: 1.05em;
}

.vehicle-video {
    margin-top: 20px;
    padding: 25px;
    background: #f8f9fa;
    border-radius: 12px;
}

.vehicle-video h3 {
    margin-top: 0;
    margin-bottom: 20px;
}

.vehicle-video iframe {
    border-radius: 8px;
    width: 100%;
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */
@media (max-width: 1024px) {
    .vehicle-content-wrapper {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .vehicle-images-column {
        position: static;
    }

    .vehicle-details-column {
        padding-left: 0;
    }

    .hero-title {
        font-size: 2.5em;
    }
}

@media (max-width: 768px) {
    .mobile-filter-button-wrapper {
        padding: 0 15px;
        margin-top: 12px;
    }
    
    .mobile-filter-button-wrapper .mobile-filter-toggle {
        width: 100%;
        max-width: 100%;
    }
    
    .vehicles-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .hero-section-minimal {
        padding: 15px 0;
    }

    .hero-minimal-content {
        flex-direction: column;
        align-items: stretch;
        gap: 15px;
    }

    .hero-title-minimal {
        font-size: 1.4em;
        text-align: center;
    }

    .hero-search-minimal {
        min-width: 100%;
        max-width: 100%;
    }

    .search-input-group-minimal {
        flex-direction: row;
        border-radius: 8px;
    }

    .search-icon {
        display: block;
        margin-left: 12px;
    }

    .search-input-minimal {
        padding: 12px 12px;
        font-size: 0.95em;
    }

    .search-btn-minimal {
        padding: 12px 20px;
        font-size: 0.95em;
    }

    .filters-section-minimal {
        padding: 12px 15px;
    }

    .filters-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .filters-actions-minimal {
        flex-direction: column;
    }

    .btn-apply-minimal,
    .btn-reset-minimal {
        width: 100%;
        text-align: center;
    }

    .results-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .specs-grid {
        grid-template-columns: 1fr;
    }

    .tabs-nav {
        flex-direction: column;
    }

    .tab-btn {
        width: 100%;
        text-align: left;
    }

    .spec-row {
        grid-template-columns: 1fr;
        gap: 5px;
    }

    .features-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .hero-title-minimal {
        font-size: 1.1em;
    }

    .vehicle-price-main {
        font-size: 2.2em;
    }

    .vehicle-header .vehicle-title {
        font-size: 1.6em;
    }

    .container {
        padding: 0 15px;
    }

    .filters-grid {
        grid-template-columns: 1fr;
    }
}

/* ============================================
   ARCHIVE PAGE (Legacy Support)
   ============================================ */
.vehicle-archive-wrapper {
    padding: 40px 20px;
    max-width: 1400px;
    margin: 0 auto;
}

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Loading animation */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.vehicle-card {
    animation: fadeIn 0.5s ease-out;
}

/* ============================================
   NEW LAYOUT - SIDEBAR + RESULTS
   ============================================ */

/* Search Section */
.search-section {
    margin-top: 20px;
    margin-bottom: 30px;
    text-align: center;
}

.mobile-filter-button-wrapper {
    display: none; /* Hidden on desktop */
    margin-top: 15px;
    text-align: center;
    padding: 0 20px;
}

.mobile-filter-button-wrapper .mobile-filter-toggle {
    width: 100%;
    max-width: 100%;
    justify-content: center;
    box-sizing: border-box;
}

.search-title {
    font-size: 1.8em;
    font-weight: 700;
    color: #333;
    margin: 0 0 20px 0;
    letter-spacing: 0.5px;
}

.search-form {
    max-width: 800px;
    margin: 0 auto;
}

.search-input-wrapper {
    display: flex;
    align-items: center;
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border: 2px solid #e2e8f0;
    border-radius: 16px;
    padding: 4px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08), 0 1px 3px rgba(0, 0, 0, 0.05);
    overflow: visible;
    margin-bottom: 10px;
    position: relative;
    gap: 8px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.search-input-wrapper:focus-within {
    border-color: #0066cc;
    box-shadow: 0 6px 25px rgba(0, 102, 204, 0.15), 0 2px 8px rgba(0, 102, 204, 0.1);
    transform: translateY(-1px);
}

.search-icon-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
    margin-left: 4px;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
    transition: all 0.3s ease;
}

.search-input-wrapper:focus-within .search-icon-wrapper {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.search-icon {
    color: white;
    width: 22px;
    height: 22px;
}

.search-input {
    flex: 1;
    border: none;
    padding: 12px 16px;
    font-size: 1.05em;
    outline: none;
    color: #1e293b;
    background: transparent;
    font-weight: 500;
    transition: all 0.2s ease;
    min-width: 0;
}

.search-input:focus {
    color: #0f172a;
}

.search-input::placeholder {
    color: #94a3b8;
    font-weight: 400;
    opacity: 0.8;
}

.location-filter-wrapper {
    position: relative;
    flex-shrink: 0;
}

.location-filter {
    position: relative;
    display: flex;
    align-items: center;
    padding: 8px 14px;
    background: #f1f5f9;
    border-radius: 12px;
    cursor: pointer;
    user-select: none;
    min-height: 44px;
    gap: 8px;
    transition: all 0.2s ease;
    border: 2px solid transparent;
}

.location-filter:hover {
    background: #e2e8f0;
    border-color: #cbd5e1;
}

.location-filter.active {
    background: #e0e7ff;
    border-color: #0066cc;
}

.location-icon {
    color: #0066cc;
    flex-shrink: 0;
    width: 16px;
    height: 16px;
}

.location-text {
    font-size: 0.88em;
    color: #475569;
    white-space: nowrap;
    font-weight: 500;
}

.dropdown-arrow {
    color: #64748b;
    flex-shrink: 0;
    width: 12px;
    height: 12px;
    transition: transform 0.2s ease;
    margin-left: 4px;
}

.location-filter.active .dropdown-arrow {
    transform: rotate(180deg);
    color: #0066cc;
}

.location-name {
    font-weight: 600;
    color: #0066cc;
}

.distance-value {
    font-weight: 600;
    color: #0066cc;
}

.distance-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    right: 0;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
    min-width: 160px;
    z-index: 1000;
    display: none;
    overflow: hidden;
    animation: dropdownFadeIn 0.2s ease-out;
}

@keyframes dropdownFadeIn {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.location-filter.active .distance-dropdown {
    display: block;
}

.distance-option {
    display: block;
    width: 100%;
    padding: 12px 16px;
    border: none;
    background: white;
    text-align: left;
    cursor: pointer;
    font-size: 0.9em;
    color: #333;
    transition: all 0.2s ease;
    position: relative;
    font-weight: 500;
    border-bottom: 1px solid #f5f5f5;
}

.distance-option:last-child {
    border-bottom: none;
}

.distance-option:hover {
    background: #f8fafc;
    color: #0066cc;
    padding-left: 20px;
}

.distance-option.active {
    background: #eff6ff;
    color: #0066cc;
    font-weight: 600;
    padding-left: 20px;
}

.distance-option.active::after {
    content: '✓';
    position: absolute;
    right: 16px;
    color: #0066cc;
    font-weight: bold;
    font-size: 1em;
}

.search-button {
    background: linear-gradient(135deg, #0066cc 0%, #004d99 100%);
    border: none;
    padding: 0 24px;
    height: 44px;
    border-radius: 12px;
    color: white;
    font-weight: 600;
    font-size: 0.95em;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    gap: 8px;
    box-shadow: 0 4px 12px rgba(0, 102, 204, 0.3);
    position: relative;
    overflow: hidden;
}

.search-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.search-button:hover {
    background: linear-gradient(135deg, #0052a3 0%, #003d7a 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 102, 204, 0.4);
}

.search-button:hover::before {
    left: 100%;
}

.search-button:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(0, 102, 204, 0.3);
}

.search-button-text {
    font-weight: 600;
    letter-spacing: 0.3px;
}

.search-button-icon {
    width: 18px;
    height: 18px;
    stroke-width: 2.5;
    transition: transform 0.3s ease;
}

.search-button:hover .search-button-icon {
    transform: translateX(2px);
}

.distance-filter {
    font-size: 0.85em;
    color: #666;
    text-align: left;
    padding-left: 4px;
}

/* ============================================
   MOBILE SEARCH - MINIMAL DESIGN
   ============================================ */
@media (max-width: 768px) {
    .search-section {
        padding: 0 15px;
        margin-bottom: 20px;
    }
    
    .search-title {
        font-size: 1.3em;
        margin-bottom: 16px;
        font-weight: 600;
    }
    
    /* Completely restructure search wrapper for mobile */
    .search-input-wrapper {
        display: flex;
        flex-direction: column;
        gap: 12px;
        background: transparent;
        border: none;
        padding: 0;
        box-shadow: none;
        margin-bottom: 12px;
        position: relative;
    }
    
    /* Hide desktop icon wrapper */
    .search-input-wrapper .search-icon-wrapper {
        display: none;
    }
    
    /* Mobile search input - clean and minimal with icon inside */
    .search-input {
        width: 100%;
        padding: 14px 16px 14px 48px;
        font-size: 16px; /* Prevents zoom on iOS */
        border: 2px solid #e2e8f0;
        border-radius: 12px;
        background: white;
        color: #1e293b;
        font-weight: 400;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
        transition: all 0.2s ease;
    }
    
    .search-input:focus {
        outline: none;
        border-color: #0066cc;
        box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.1);
    }
    
    .search-input::placeholder {
        color: #94a3b8;
        font-weight: 400;
    }
    
    /* Add search icon inside input using pseudo-element */
    .search-input-wrapper::before {
        content: '';
        position: absolute;
        left: 15px;
        top: 14px;
        width: 20px;
        height: 20px;
        background-image: url("data:image/svg+xml,%3Csvg width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z'%3E%3C/path%3E%3C/svg%3E");
        background-repeat: no-repeat;
        background-position: center;
        pointer-events: none;
        z-index: 2;
    }
    
    /* Location filter - separate row, minimal style */
    .location-filter-wrapper {
        width: 100%;
        order: 2;
        margin-top: 0;
    }
    
    .location-filter {
        width: 100%;
        padding: 12px 16px;
        min-height: 48px;
        border-radius: 12px;
        background: #f8fafc;
        border: 2px solid #e2e8f0;
        gap: 10px;
        justify-content: flex-start;
    }
    
    .location-filter:hover {
        background: #f1f5f9;
        border-color: #cbd5e1;
    }
    
    .location-icon {
        width: 20px;
        height: 20px;
        flex-shrink: 0;
        color: #0066cc;
    }
    
    .location-text {
        font-size: 0.9em;
        color: #475569;
        white-space: normal;
        line-height: 1.4;
        flex: 1;
    }
    
    .dropdown-arrow {
        width: 16px;
        height: 16px;
        margin-left: auto;
        flex-shrink: 0;
        color: #64748b;
    }
    
    /* Search button - full width, prominent */
    .search-button {
        width: 100%;
        order: 3;
        padding: 0;
        height: 50px;
        border-radius: 12px;
        margin-top: 0;
        justify-content: center;
        font-size: 1em;
        font-weight: 600;
        box-shadow: 0 4px 12px rgba(0, 102, 204, 0.25);
    }
    
    .search-button-text {
        font-size: 1em;
    }
    
    .search-button-icon {
        width: 20px;
        height: 20px;
        margin-left: 8px;
    }
    
    /* Remove focus effects on wrapper for mobile */
    .search-input-wrapper:focus-within {
        transform: none;
        box-shadow: none;
    }
    
    .search-input-wrapper:focus-within .search-icon-wrapper {
        transform: none;
    }
}

/* Extra small mobile devices */
@media (max-width: 480px) {
    .search-section {
        padding: 0 10px;
    }
    
    .search-title {
        font-size: 1.2em;
        margin-bottom: 12px;
    }
    
    .search-icon-wrapper {
        width: 40px;
        height: 40px;
    }
    
    .search-icon {
        width: 18px;
        height: 18px;
    }
    
    .search-input {
        padding: 12px 14px 12px 44px;
        font-size: 16px;
        border-radius: 10px;
    }
    
    .search-input-wrapper::before {
        left: 12px;
        top: 12px;
        width: 18px;
        height: 18px;
    }
    
    .search-button {
        height: 48px;
        border-radius: 10px;
    }
    
    .location-filter {
        padding: 10px 14px;
        min-height: 46px;
        border-radius: 10px;
    }
    
    .location-text {
        font-size: 0.85em;
    }
    
    
    .location-text {
        font-size: 0.82em;
    }
    
    .search-button {
        order: 2;
        margin-left: auto;
        padding: 0 20px;
        height: 40px;
        font-size: 0.9em;
    }
    
    /* .search-button-text {
        display: none;
    } */
    
    .search-button-icon {
        margin: 0;
    }
}

/* Main Layout */
.main-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 30px;
    align-items: start;
    position: relative;
    /* Ensure sticky works - no overflow on parent */
    overflow: visible;
}

/* Filters Sidebar */
.filters-sidebar {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    padding: 20px;
    position: -webkit-sticky; /* Safari support */
    position: sticky;
    top: 20px;
    align-self: start;
    height: fit-content;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    overflow-x: hidden;
    z-index: 10;
    will-change: transform; /* Optimize for sticky */
}

/* Custom Scrollbar for Filters Sidebar */
.filters-sidebar::-webkit-scrollbar {
    width: 6px;
}

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

.filters-sidebar::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.filters-sidebar::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

.filters-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #f0f0f0;
}

.filters-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.filters-header h2 {
    margin: 0;
    font-size: 1.3em;
    font-weight: 700;
    color: #333;
}

.filter-refresh {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    color: #666;
    transition: color 0.2s;
    display: flex;
    align-items: center;
}

.filter-refresh:hover {
    color: #0066cc;
}

.mobile-filter-close {
    display: none; /* Hidden on desktop */
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
    color: #666;
    transition: color 0.2s, background-color 0.2s;
    border-radius: 4px;
    align-items: center;
    justify-content: center;
}

.mobile-filter-close:hover {
    color: #0066cc;
    background-color: rgba(0, 102, 204, 0.1);
}

.mobile-filter-toggle {
    display: none; /* Hidden on desktop */
}

.filter-group {
    margin-bottom: 20px;
    border-bottom: 1px solid #f0f0f0;
    padding-bottom: 15px;
}

.filter-group:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.filter-group-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    cursor: pointer;
    user-select: none;
    padding: 8px 12px;
    margin-left: -12px;
    margin-right: -12px;
    border-radius: 6px;
    transition: all 0.2s ease;
    position: relative;
}

.filter-group-header::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, rgba(0, 102, 204, 0.05) 0%, transparent 100%);
    border-radius: 6px;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.filter-group-header:hover {
    background-color: #f8fafc;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04);
    transform: translateX(2px);
}

.filter-group-header:hover::before {
    opacity: 1;
}

.filter-group-header:active {
    transform: translateX(1px);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
}

.filter-label {
    font-weight: 600;
    color: #333;
    font-size: 0.95em;
    margin: 0;
    pointer-events: none; /* Allow clicks to pass through to header */
    flex: 1;
}

.filter-toggle {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    color: #6b7280;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    position: relative;
    z-index: 1;
    border-radius: 4px;
}

.filter-toggle:hover {
    color: #0066cc;
    background: rgba(0, 102, 204, 0.1);
}

.filter-toggle:active {
    transform: scale(0.95);
}

.filter-toggle svg {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.filter-group.collapsed .filter-toggle svg {
    transform: rotate(180deg);
}

.filter-group:not(.collapsed) .filter-toggle svg {
    transform: rotate(0deg);
}

.filter-group.collapsed .filter-group-content {
    max-height: 0 !important;
    padding-top: 0 !important;
    margin-bottom: 0 !important;
}

.filter-group-content {
    display: block;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1), padding 0.4s cubic-bezier(0.4, 0, 0.2, 1), margin-bottom 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    padding-top: 0;
    margin-bottom: 0;
    opacity: 0;
}

.filter-group:not(.collapsed) .filter-group-content {
    max-height: 2000px;
    padding-top: 12px;
    margin-bottom: 0;
    opacity: 1;
    transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1), padding 0.4s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease-in 0.1s;
}

.filter-input {
    width: 100%;
    padding: 14px 18px;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    font-size: 0.95em;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    margin-bottom: 10px;
    background: #ffffff;
    color: #1f2937;
    font-weight: 500;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.filter-input::placeholder {
    color: #9ca3af;
    font-weight: 400;
    opacity: 0.8;
}

.filter-input:focus {
    outline: none;
    border-color: #0066cc;
    background: #ffffff;
    box-shadow: 0 0 0 4px rgba(0, 102, 204, 0.1), 0 2px 8px rgba(0, 102, 204, 0.15);
    transform: translateY(-1px);
}

.filter-input:hover:not(:focus) {
    border-color: #d1d5db;
    background: #fafbfc;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
}

.filter-input:active {
    transform: translateY(0);
}

.filter-range {
    display: flex;
    gap: 8px;
}

.filter-range .filter-input {
    flex: 1;
    margin-bottom: 0;
}

/* Year Slider */
.year-slider-wrapper {
    padding: 20px 0;
}

.year-slider-labels {
    display: flex;
    justify-content: space-between;
    margin-bottom: 15px;
    font-weight: 600;
    font-size: 0.95em;
    color: #333;
}

.year-range-slider {
    position: relative;
    height: 6px;
    background: #e5e7eb;
    border-radius: 3px;
    margin: 20px 0;
}

.year-slider-track {
    position: relative;
    width: 100%;
    height: 100%;
    border-radius: 3px;
}

.year-slider-range {
    position: absolute;
    height: 100%;
    background: #0066cc;
    border-radius: 3px;
    left: 0;
    right: 0;
}

.year-slider-handle {
    position: absolute;
    width: 20px;
    height: 20px;
    background: white;
    border: 3px solid #0066cc;
    border-radius: 50%;
    top: 50%;
    transform: translateY(-50%);
    cursor: grab;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    transition: all 0.2s ease;
    z-index: 2;
}

.year-slider-handle:hover {
    transform: translateY(-50%) scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 102, 204, 0.3);
}

.year-slider-handle:active {
    cursor: grabbing;
    transform: translateY(-50%) scale(1.15);
}

.year-slider-handle-min {
    left: 0;
}

.year-slider-handle-max {
    right: 0;
}

.filter-checkbox {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    cursor: pointer;
    font-size: 0.9em;
    color: #374151;
    border-radius: 6px;
    transition: all 0.2s ease;
    margin-bottom: 4px;
    user-select: none;
}

.filter-checkbox:hover {
    background: #f3f4f6;
}

.filter-checkbox input[type="checkbox"] {
    margin: 0;
    cursor: pointer;
    width: 18px;
    height: 18px;
    accent-color: #0066cc;
    flex-shrink: 0;
}

.filter-checkbox input[type="checkbox"]:checked {
    accent-color: #0066cc;
}

.filter-checkbox span {
    user-select: none;
    font-weight: 500;
    flex: 1;
}

.filter-checkbox:has(input:checked) {
    background: #eff6ff;
    color: #0066cc;
    font-weight: 600;
}

.load-more-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 12px;
    padding: 8px 16px;
    color: #0066cc;
    text-decoration: none;
    font-size: 0.9em;
    font-weight: 600;
    border: 2px solid #0066cc;
    border-radius: 6px;
    transition: all 0.2s ease;
    background: white;
}

.load-more-link:hover {
    background: #0066cc;
    color: white;
    text-decoration: none;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 102, 204, 0.2);
}

/* Active Filters Chips */
.active-filters {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
    padding: 15px 20px;
    background: #f9fafb;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
}

.active-filters-label {
    font-weight: 600;
    color: #374151;
    font-size: 0.9em;
    margin-right: 8px;
}

.active-filters-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    background: #0066cc;
    color: white;
    border-radius: 20px;
    font-size: 0.85em;
    font-weight: 500;
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-10px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.filter-chip-label {
    white-space: nowrap;
}

.filter-chip-remove {
    background: rgba(255, 255, 255, 0.3);
    border: none;
    color: white;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.filter-chip-remove:hover {
    background: rgba(255, 255, 255, 0.5);
    transform: scale(1.1);
}

.filter-chip-remove svg {
    width: 12px;
    height: 12px;
}

/* Results Section */
.results-section {
    min-width: 0;
    position: relative;
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    flex-wrap: wrap;
    gap: 15px;
}

.results-title-section {
    display: flex;
    align-items: baseline;
    gap: 15px;
}

.results-title {
    margin: 0;
    font-size: 1.8em;
    font-weight: 700;
    color: #333;
}

.results-count {
    font-size: 0.95em;
    color: #666;
}

.results-controls {
    display: flex;
    align-items: center;
    gap: 15px;
}

.mobile-filter-toggle {
    display: none;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.95em;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.mobile-filter-toggle:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.mobile-filter-toggle:active {
    transform: translateY(0);
}

.mobile-filter-toggle svg {
    width: 18px;
    height: 18px;
    stroke-width: 2.5;
}

.sort-control {
    display: flex;
    align-items: center;
    gap: 8px;
}

.sort-control label {
    font-weight: 500;
    color: #666;
    font-size: 0.9em;
}

.sort-select {
    padding: 8px 12px;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    font-size: 0.9em;
    background: white;
    cursor: pointer;
    min-width: 150px;
}

.sort-select:focus {
    outline: none;
    border-color: #0066cc;
}

.view-toggle {
    display: flex;
    gap: 4px;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 4px;
    background: white;
}

/* Hide view toggle on mobile */
@media (max-width: 768px) {
    .view-toggle {
        display: none;
    }
}

.view-btn {
    background: none;
    border: none;
    padding: 6px 8px;
    cursor: pointer;
    color: #666;
    border-radius: 4px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.view-btn.active {
    background: #0066cc;
    color: white;
}

/* Hide view toggle on mobile */
@media (max-width: 768px) {
    .view-toggle {
        display: none !important;
    }
}

/* Shimmer Loading Skeleton */
.shimmer-card {
    opacity: 1;
    pointer-events: none;
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.shimmer {
    background: linear-gradient(90deg, #f0f0f0 25%, #e8e8e8 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s ease-in-out infinite;
    border-radius: 4px;
}

@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

.shimmer-card .image-container {
    position: relative;
    width: 100%;
    overflow: hidden;
}

.shimmer-image {
    width: 100%;
    height: 200px;
    border-radius: 8px 8px 0 0;
    margin-bottom: 0;
}

.shimmer-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 50px;
    height: 24px;
    border-radius: 12px;
    z-index: 1;
}

.shimmer-line {
    height: 16px;
    margin-bottom: 8px;
    border-radius: 4px;
}

.shimmer-tag {
    display: inline-block;
    width: 60px;
    height: 24px;
    border-radius: 12px;
    margin-right: 8px;
    margin-top: 8px;
    vertical-align: middle;
}

.shimmer-card .vehicle-specs-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 12px;
}

.shimmer-button {
    width: 100%;
    height: 40px;
    border-radius: 6px;
    margin-top: 16px;
}

/* Grid view shimmer */
.vehicles-grid.grid-view .shimmer-card .vehicle-pricing-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    gap: 8px;
    flex-wrap: wrap;
}

.vehicles-grid.grid-view .shimmer-card .vehicle-pricing-row .shimmer-line {
    margin-bottom: 0;
    flex-shrink: 0;
}

.vehicles-grid.grid-view .shimmer-card .vehicle-pricing-row .shimmer-line:first-child {
    flex: 1;
    min-width: 100px;
}

.vehicles-grid.grid-view .shimmer-card .vehicle-pricing-row .shimmer-line:nth-child(2) {
    width: 70px;
}

.vehicles-grid.grid-view .shimmer-card .vehicle-pricing-row .shimmer-line:nth-child(3) {
    width: 90px;
}

/* List view shimmer adjustments */
.vehicles-grid.list-view .shimmer-card {
    display: flex;
    flex-direction: row;
}

.vehicles-grid.list-view .shimmer-card .vehicle-image-compact {
    width: 300px;
    flex-shrink: 0;
}

.vehicles-grid.list-view .shimmer-image {
    width: 100%;
    height: 200px;
    border-radius: 8px 0 0 8px;
}

.vehicles-grid.list-view .shimmer-card .vehicle-info-compact {
    flex: 1;
    padding: 20px;
    display: flex;
    flex-direction: column;
}

.vehicles-grid.list-view .shimmer-card .vehicle-pricing-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    gap: 12px;
}

.vehicles-grid.list-view .shimmer-button {
    width: 150px;
    margin-top: auto;
    align-self: flex-start;
}

.vehicles-grid.loading {
    position: relative;
}

/* Updated Vehicle Card */
.vehicle-card-compact {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: all 0.2s ease;
    position: relative;
    display: flex;
    flex-direction: column;
}

.vehicle-card-compact:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
    transform: translateY(-2px);
}

.vehicle-image-compact {
    position: relative;
    width: 100%;
    padding-top: 65%;
    overflow: hidden;
    background: #f5f5f5;
}

.image-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.vehicle-main-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: opacity 0.3s ease;
}


.image-count-badge {
    position: absolute;
    bottom: 12px;
    right: 12px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.8em;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 4px;
    z-index: 3;
}

.image-count-badge svg {
    width: 14px;
    height: 14px;
}

.vehicle-info-compact {
    padding: 16px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.vehicle-pricing-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.price-monthly {
    font-size: 1.1em;
    font-weight: 600;
    color: #0066cc;
}

.reference-number {
    font-size: 0.85em;
    color: #666;
    font-weight: 500;
}

.price-total {
    font-size: 1.3em;
    font-weight: 700;
    color: #333;
}

.vehicle-title-compact {
    margin: 0;
    font-size: 1.2em;
    font-weight: 600;
    line-height: 1.3;
}

.vehicle-title-compact a {
    color: #1a1a1a;
    text-decoration: none;
    transition: color 0.2s;
}

.vehicle-title-compact a:hover {
    color: #0066cc;
}

.vehicle-location {
    font-size: 0.9em;
    color: #666;
}

.vehicle-specs-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 4px 0;
}

.spec-tag {
    background: #f3f4f6;
    color: #4b5563;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.8em;
    font-weight: 500;
    white-space: nowrap;
}

.make-enquiry-btn {
    background: #87ceeb;
    color: #333;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.95em;
    text-decoration: none;
    text-align: center;
    display: block;
    transition: all 0.2s;
    margin-top: auto;
}

.make-enquiry-btn:hover {
    background: #6bb6d6;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* List View */
.vehicles-grid.list-view {
    grid-template-columns: 1fr;
}

.vehicles-grid.list-view .vehicle-card-compact {
    flex-direction: row;
    max-width: 100%;
}

.vehicles-grid.list-view .vehicle-image-compact {
    width: 300px;
    min-width: 300px;
    padding-top: 0;
    height: 200px;
}

.vehicles-grid.list-view .vehicle-info-compact {
    flex: 1;
    padding: 20px;
}

/* Responsive */
@media (max-width: 1024px) {
    .main-layout {
        grid-template-columns: 1fr !important;
        position: relative;
        display: grid;
    }
    
    /* Hide sidebar from layout on mobile - it will be shown as overlay when active */
    .main-layout > .filters-sidebar {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        width: 100% !important;
        max-width: 400px !important;
        height: 100vh !important;
        max-height: 100vh !important;
        z-index: 9999 !important;
        transform: translateX(-100%) !important;
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.3s, opacity 0.3s;
        border-radius: 0;
        box-shadow: 2px 0 20px rgba(0, 0, 0, 0.15);
        overflow-y: auto;
        overflow-x: hidden;
        visibility: hidden;
        opacity: 0;
        /* Remove from grid flow completely - fixed positioning takes it out of flow */
        display: block;
        margin: 0 !important;
        padding: 20px;
        /* Ensure it doesn't take up grid space - remove from grid */
        grid-column: unset !important;
        grid-row: unset !important;
        /* Make it not affect layout */
        pointer-events: none;
        /* Override any width constraints */
        min-width: auto !important;
    }
    
    .main-layout > .filters-sidebar.mobile-active {
        transform: translateX(0) !important;
        visibility: visible;
        opacity: 1;
        pointer-events: auto;
    }
    
    /* Ensure results section takes full width and is not affected by sidebar */
    .main-layout > .results-section {
        grid-column: 1 !important;
        grid-row: 1 !important;
        width: 100% !important;
        margin-left: 0 !important;
    }
    
    .mobile-filter-button-wrapper {
        display: block;
    }
    
    .mobile-filter-toggle {
        display: flex;
    }
    
    .mobile-filter-close {
        display: flex;
    }
    
    body.filter-sidebar-open {
        overflow: hidden;
    }
    
    body.filter-sidebar-open::before {
        content: '';
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 9998;
        pointer-events: auto;
        animation: fadeIn 0.3s ease;
    }
    
    @keyframes fadeIn {
        from {
            opacity: 0;
        }
        to {
            opacity: 1;
        }
    }
    
    .vehicles-grid.list-view .vehicle-card-compact {
        flex-direction: column;
    }
    
    .vehicles-grid.list-view .vehicle-image-compact {
        width: 100%;
        min-width: 100%;
        height: auto;
        padding-top: 65%;
    }
}

@media (max-width: 768px) {
    .search-title {
        font-size: 1.4em;
    }
    
    .results-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .results-controls {
        width: 100%;
        justify-content: space-between;
    }
}

/* Apply Form Section */
.apply-form-section {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 9999;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.apply-form-wrapper {
    width: 90vw;
    max-width: 950px;
    height: 90vh;
    max-height: 900px;
    margin: 20px auto;
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    position: relative;
    padding: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

@media (max-width: 1024px) {
    .apply-form-wrapper {
        width: 95vw;
        height: 95vh;
        margin: 10px auto;
    }
}

.close-form-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    color: #6b7280;
    transition: color 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 1000;
    width: 32px;
    height: 32px;
}

.close-form-btn:hover {
    color: #1a1a1a;
}

#apply-form-container {
    min-height: 400px;
}

@media (max-width: 768px) {
    .apply-form-section {
        padding: 10px;
    }
    
    .apply-form-wrapper {
        margin: 20px auto;
        padding: 20px;
    }
    
    .apply-form-header h2 {
        font-size: 1.4em;
    }
}
