/* =========================================
   FOOTER
   ========================================= */
.main-footer {
    background: var(--gradient-dark);
    color: var(--text-white);
}

.footer-content {
    padding: 60px 0 30px;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1.5fr;
    gap: 40px;
}

.footer-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.footer-logo-img {
    width: 60px;
    height: 50px;
    border-radius: 40%;
}

.footer-brand {
    font-family: var(--font-heading);
    font-size: 24px;
    font-weight: 700;
}

.footer-brand .the,
.footer-brand .factory {
    color: var(--TCFFontcolor);
}

.footer-brand .car {
    color: var(--TCFFontcolor);
}

.footer-desc {
    color: rgba(255, 255, 255, 0.7);
    font-size: 15px;
    line-height: 1.7;
    margin-bottom: 25px;
}

.footer-social {
    display: flex;
    gap: 12px;
}

.social-link {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    color: var(--text-white);
    transition: var(--transition-fast);
}

.social-link:hover {
    background: var(--primary-color);
    transform: translateY(-3px);
}

.social-link.whatsapp:hover {
    background: #25d366;
}

.footer-title {
    font-family: var(--font-heading);
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 20px;
    position: relative;
    padding-bottom: 12px;
}

.footer-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 50px;
    height: 3px;
    background: var(--primary-color);
    border-radius: 2px;
}

.footer-links li {
    margin-bottom: 12px;
}

.footer-links a {
    color: rgba(255, 255, 255, 0.7);
    font-size: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: var(--transition-fast);
}

.footer-links a:hover {
    color: var(--primary-color);
    padding-left: 5px;
}

.footer-links i {
    font-size: 12px;
}

.footer-contact li {
    margin-bottom: 15px;
    display: flex;
    gap: 12px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 15px;
    line-height: 1.6;
}

.footer-contact i {
    color: var(--primary-color);
    margin-top: 3px;
    flex-shrink: 0;
}

.footer-contact a {
    color: rgba(255, 255, 255, 0.7);
    transition: var(--transition-fast);
}

.footer-contact a:hover {
    color: var(--primary-color);
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding: 25px 0;
}

.footer-bottom-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.6);
}

.credits i {
    color: var(--primary-color);
    margin: 0 3px;
}

/* =========================================
   WHATSAPP FLOATING BUTTON
   ========================================= */
.whatsapp-float {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    background: #25d366;
    color: var(--text-white);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    box-shadow: 0 4px 12px rgba(37, 211, 102, 0.4);
    z-index: 999;
    transition: var(--transition-fast);
    animation: pulse 2s infinite;
}

.whatsapp-float:hover {
    background: #20ba5a;
    transform: scale(1.1);
}

@keyframes pulse {
    0%, 100% {
        box-shadow: 0 4px 12px rgba(37, 211, 102, 0.4);
    }
    50% {
        box-shadow: 0 4px 20px rgba(37, 211, 102, 0.7);
    }
}

/* =========================================
   BACK TO TOP BUTTON
   ========================================= */
.back-to-top {
    position: fixed;
    bottom: 30px;
    left: 30px;
    width: 50px;
    height: 50px;
    background: var(--gradient-primary);
    color: var(--text-white);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    box-shadow: var(--shadow-md);
    opacity: 0;
    visibility: hidden;
    transition: var(--transition-fast);
    z-index: 999;
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    transform: translateY(-5px);
}

/* =========================================
   NO CARS MESSAGE
   ========================================= */
.no-cars-message {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    color: var(--text-light);
    font-size: 18px;
}

/* =========================================
   UTILITY CLASSES
   ========================================= */
.text-center {
    text-align: center;
}

.text-left {
    text-align: left;
}

.text-right {
    text-align: right;
}

.mt-10 { margin-top: 10px; }
.mt-20 { margin-top: 20px; }
.mt-30 { margin-top: 30px; }
.mt-40 { margin-top: 40px; }
.mt-50 { margin-top: 50px; }

.mb-10 { margin-bottom: 10px; }
.mb-20 { margin-bottom: 20px; }
.mb-30 { margin-bottom: 30px; }
.mb-40 { margin-bottom: 40px; }
.mb-50 { margin-bottom: 50px; }

.pt-10 { padding-top: 10px; }
.pt-20 { padding-top: 20px; }
.pt-30 { padding-top: 30px; }
.pt-40 { padding-top: 40px; }
.pt-50 { padding-top: 50px; }

.pb-10 { padding-bottom: 10px; }
.pb-20 { padding-bottom: 20px; }
.pb-30 { padding-bottom: 30px; }
.pb-40 { padding-bottom: 40px; }
.pb-50 { padding-bottom: 50px; }

/* =========================================
   BADGES
   ========================================= */
.badge {
    display: inline-block;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
}

.badge-success {
    background: #4caf50;
    color: var(--text-white);
}

.badge-danger {
    background: #f44336;
    color: var(--text-white);
}

.badge-warning {
    background: #ff9800;
    color: var(--text-white);
}

.badge-info {
    background: #2196f3;
    color: var(--text-white);
}

.badge-primary {
    background: var(--primary-color);
    color: var(--text-white);
}

.badge-secondary {
    background: #9e9e9e;
    color: var(--text-white);
}

/* =========================================
   BREADCRUMB
   ========================================= */
.breadcrumb {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 15px 0;
    margin: 0;
    list-style: none;
    background: transparent;
}

.breadcrumb-item {
    display: flex;
    align-items: center;
    font-size: 14px;
    color: var(--text-light);
}

.breadcrumb-item::after {
    content: '/';
    margin-left: 8px;
    color: var(--text-light);
}

.breadcrumb-item:last-child::after {
    content: '';
    margin: 0;
}

.breadcrumb-item a {
    color: var(--text-dark);
    transition: var(--transition-fast);
}

.breadcrumb-item a:hover {
    color: var(--primary-color);
}

.breadcrumb-item.active {
    color: var(--primary-color);
}

/* =========================================
   ALERTS
   ========================================= */
.alert {
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.alert i {
    font-size: 20px;
}

.alert-success {
    background: #e8f5e9;
    color: #2e7d32;
    border-left: 4px solid #4caf50;
}

.alert-danger {
    background: #ffebee;
    color: #c62828;
    border-left: 4px solid #f44336;
}

.alert-warning {
    background: #fff3e0;
    color: #e65100;
    border-left: 4px solid #ff9800;
}

.alert-info {
    background: #e3f2fd;
    color: #1565c0;
    border-left: 4px solid #2196f3;
}

/* =========================================
   LOADING SPINNER
   ========================================= */
.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 40px auto;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* =========================================
   IMAGE LAZY LOADING
   ========================================= */
img[loading="lazy"] {
    opacity: 0;
    transition: opacity 0.3s;
}

img[loading="lazy"].loaded {
    opacity: 1;
}

/* =========================================
   SELECTION HIGHLIGHT
   ========================================= */
::selection {
    background: var(--primary-color);
    color: var(--text-white);
}

::-moz-selection {
    background: var(--primary-color);
    color: var(--text-white);
}

/* =========================================
   SCROLLBAR STYLING
   ========================================= */
::-webkit-scrollbar {
    width: 12px;
}

::-webkit-scrollbar-track {
    background: var(--bg-light);
}

::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 6px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-dark);
}

/* =========================================
   PRINT STYLES
   ========================================= */
@media print {
    .main-header,
    .whatsapp-float,
    .back-to-top,
    .slider-nav,
    .slider-dots {
        display: none !important;
    }
    
    body {
        color: #000;
        background: #fff;
    }
}
/* =========================================
   RESPONSIVE BREAKPOINTS
   1024px = Tablet
   768px  = Mobile
   480px  = Small Mobile
   ========================================= */

/* =========================================
   TABLET — max-width: 1024px
   ========================================= */
@media (max-width: 1024px) {

    /* Hide top bar on tablet/mobile */
    .header-top { display: none !important; }
    .header-spacer { height: 72px; }
    .header-main { padding: 10px 0; }
    .logo-img  { width: 60px; height: 48px; }
    .logo-text { font-size: 22px; }

    /* Show hamburger */
    .mobile-menu-toggle {
        display: flex !important;
        flex-direction: column;
        gap: 5px;
        cursor: pointer;
        padding: 8px;
        z-index: 1200;
        margin-left: 8px;
        background: none;
        border: none;
    }
    /* Spans must be white — header bg is dark (#141615) */
    .mobile-menu-toggle span {
        background: #ffffff !important;
        width: 26px;
        height: 3px;
        border-radius: 2px;
        display: block;
        transition: all 0.3s ease;
    }
    .mobile-menu-toggle.active span:nth-child(1) { transform: rotate(45deg) translate(6px, 6px); }
    .mobile-menu-toggle.active span:nth-child(2) { opacity: 0; }
    .mobile-menu-toggle.active span:nth-child(3) { transform: rotate(-45deg) translate(6px, -6px); }

    /* Nav becomes full-screen overlay */
    .main-nav {
        position: fixed;
        top: 0; left: 0;
        width: 100%; height: 100vh;
        background: #1a1a1a;
        flex-direction: column;
        justify-content: flex-start;
        padding: 80px 0 30px;
        transform: translateX(-100%);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        z-index: 1050;
        overflow-y: auto;
        flex: unset;
    }
    .main-nav.active { transform: translateX(0); }

    .nav-menu {
        flex-direction: column;
        width: 100%;
        gap: 0;
    }
    .nav-menu > li {
        width: 100%;
        border-bottom: 1px solid rgba(255,255,255,0.07);
    }
    .nav-menu > li > a {
        padding: 16px 24px;
        font-size: 16px;
        color: #fff !important;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }
    .nav-menu > li.active > a,
    .nav-menu > li > a:hover {
        color: #ef5350 !important;
        background: rgba(211,47,47,0.1);
    }

    /* Dropdown inside mobile nav */
    .dropdown-menu {
        position: static !important;
        opacity: 1 !important;
        visibility: visible !important;
        transform: none !important;
        box-shadow: none !important;
        background: rgba(255,255,255,0.05);
        border-radius: 0 !important;
        padding: 0 !important;
        display: none;
        min-width: unset;
    }
    .dropdown.open > .dropdown-menu { display: block; }
    .dropdown-menu li { border-bottom: 1px solid rgba(255,255,255,0.04); }
    .dropdown-menu li a {
        padding: 12px 36px !important;
        color: rgba(255,255,255,0.75) !important;
        font-size: 14px;
    }
    .dropdown-menu li a:hover { color: #fff !important; }
    .divider { display: none; }

    /* Header layout adjustments */
    .header-search { margin-left: auto; margin-right: 4px; }
    .search-toggle { color: #333; }

    /* Stats */
    .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 20px; }

    /* Search section */
    .search-grid { grid-template-columns: repeat(2, 1fr); }

    /* Cars grid */
    .cars-grid { grid-template-columns: repeat(2, 1fr); gap: 20px; }

    /* Features */
    .features-grid { grid-template-columns: repeat(2, 1fr); gap: 20px; }

    /* Footer */
    .footer-grid { grid-template-columns: 1fr 1fr; gap: 30px; }
}


/* =========================================
   MOBILE — max-width: 768px
   ========================================= */
@media (max-width: 768px) {

    .container { padding: 0 16px; }

    /* Header */
    .header-spacer { height: 66px; }
    .logo-img  { width: 48px; height: 38px; }
    .logo-text { font-size: 19px; }

    /* Section headings */
    .section-title    { font-size: 24px; }
    .section-subtitle { font-size: 14px; }

    /* Hero slider */
    .hero-slider { height: 310px; }
    .slide-title    { font-size: 24px; line-height: 1.3; }
    .slide-subtitle { font-size: 13px; margin-bottom: 16px; }
    .slide-buttons  { flex-direction: column; gap: 10px; align-items: flex-start; }
    .slide-buttons .btn {
        width: 100%; max-width: 240px;
        text-align: center; justify-content: center;
        padding: 11px 16px; font-size: 13px;
    }
    .slider-nav { width: 34px; height: 34px; font-size: 13px; }

    /* Stats */
    .stats-section { padding: 36px 0; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
    .stat-card { padding: 18px 12px; }
    .stat-icon   { font-size: 30px; margin-bottom: 8px; }
    .stat-number { font-size: 28px; }
    .stat-label  { font-size: 12px; }

    /* Search section */
    .search-section { padding: 36px 0; }
    .search-box-container { padding: 24px 16px; border-radius: 12px; }
    .search-grid { grid-template-columns: 1fr; gap: 12px; }
    .section-title-white { font-size: 20px; }

    /* Cars grid — single column */
    .featured-cars-section,
    .latest-cars-section { padding: 36px 0; }
    .cars-grid { grid-template-columns: 1fr; gap: 14px; margin-top: 20px; }
    .car-image { height: 200px; }
    .car-info  { padding: 14px; }
    .car-title { font-size: 16px; }
    .price-value { font-size: 19px; }
    .car-footer { flex-direction: column; gap: 10px; align-items: flex-start; }
    .car-details-btn { width: 100%; text-align: center; justify-content: center; }

    /* Why choose / features */
    .why-choose-section,
    .why-us-section { padding: 36px 0; }
    .features-grid,
    .why-grid { grid-template-columns: 1fr; gap: 12px; }
    .feature-card { padding: 22px 18px; }

    /* Testimonials */
    .testimonials-section { padding: 36px 0; }
    .testimonial-track    { flex-direction: column; gap: 14px; overflow: visible; }
    .testimonial-card     { min-width: unset; width: 100%; padding: 18px; }
    .testimonials-grid    { grid-template-columns: 1fr; gap: 14px; }
    .testimonials-slider  { overflow: visible; }

    /* Google reviews */
    .google-reviews-section { padding: 36px 0; }
    .google-rating-summary  { padding: 22px; }
    .rating-score { font-size: 48px; }

    /* Sell car CTA */
    .sell-car-cta { padding: 44px 0; }
    .cta-title { font-size: 24px; }
    .cta-text  { font-size: 13px; }

    /* CTA strip */
    .cta-strip { flex-direction: column; gap: 18px; text-align: center; }
    .cta-strip-buttons { flex-direction: column; align-items: center; gap: 10px; }
    .cta-s-btn { width: 100%; max-width: 260px; justify-content: center; }

    /* Services strip */
    .services-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .service-item  { padding: 14px 10px; }
    .service-item h3 { font-size: 13px; }
    .service-item p  { font-size: 12px; }

    /* Video */
    .video-section iframe { height: 220px; }

    /* Footer */
    .footer-grid { grid-template-columns: 1fr; gap: 22px; }
    .footer-content { padding: 36px 0 20px; }
    .footer-bottom-content { flex-direction: column; text-align: center; gap: 6px; }

    /* WhatsApp & back-to-top */
    .whatsapp-float { width: 50px; height: 50px; font-size: 26px; bottom: 18px; right: 14px; }
    .back-to-top    { width: 40px; height: 40px; font-size: 15px; bottom: 18px; left: 14px; }

    /* Section CTA button */
    .section-cta { margin-top: 22px; }
    .section-cta .btn { width: 100%; max-width: 300px; }

    /* Buy Cars page */
    .buy-cars-layout { grid-template-columns: 1fr !important; }
    
    /* FIX BUY CARS MOBILE */
@media (max-width: 768px) {

    .buy-cars-layout {
        grid-template-columns: 1fr !important;
    }

    /* Sidebar hidden by default */
    .filter-sidebar {
        position: fixed;
        top: 0;
        left: 0;
        width: 85%;
        max-width: 320px;
        height: 100vh;
        z-index: 1200;
        transform: translateX(-100%);
        transition: 0.3s;
        overflow-y: auto;
    }

    .filter-sidebar.open {
        transform: translateX(0);
    }

    /* Cars grid fix */
    .cars-grid-listing {
        grid-template-columns: 1fr !important;
    }

    /* Top bar stacking */
    .listing-topbar {
        flex-direction: column;
        align-items: flex-start;
    }

    .listing-controls {
        width: 100%;
        justify-content: space-between;
    }

}
    .filter-sidebar {
        position: fixed;
        top: 0; left: 0;
        width: 82%; max-width: 320px;
        height: 100vh;
        z-index: 1200;
        border-radius: 0;
        transform: translateX(-110%);
        transition: transform 0.3s ease;
        overflow-y: auto;
    }
    .filter-sidebar.open   { transform: translateX(0); }
    .mobile-filter-btn     { display: flex !important; }

    /* Buy cars header */
    .cars-header { flex-direction: column; gap: 10px; align-items: flex-start; }
    .sort-control label { display: none; }

    /* Car detail page */
    .car-detail-layout { grid-template-columns: 1fr !important; }
    .cd-sticky-wrap    { position: static; }
    .cd-title  { font-size: 22px; }
    .cd-price  { font-size: 28px; }
    .cd-quick-specs { grid-template-columns: repeat(3, 1fr); gap: 10px; }
    .cd-cta    { flex-direction: column; }
    .cd-cta a, .cd-cta button { width: 100%; justify-content: center; }
    .similar-cars-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }

    /* Sell / Exchange forms */
    .sell-car-layout { grid-template-columns: 1fr !important; }
    .form-row        { grid-template-columns: 1fr !important; }

    /* Exchange steps */
    .exchange-steps-row { flex-direction: column; align-items: center; }
    .ex-step-arrow { transform: rotate(90deg); }
    .upgrade-cars-grid { grid-template-columns: 1fr !important; }

    /* Search bar on mobile */
    .search-container { margin: 0 16px; }
    .search-input { font-size: 14px; }
}


/* =========================================
   SMALL MOBILE — max-width: 480px
   ========================================= */
@media (max-width: 480px) {

    /* Header */
    .logo-text { font-size: 17px; }
    .logo-img  { width: 42px; height: 34px; }
    .header-spacer { height: 62px; }

    /* Hero */
    .hero-slider { height: 270px; }
    .slide-title    { font-size: 20px; }
    .slide-subtitle { display: none; }
    .slide-buttons .btn { max-width: 100%; }

    /* Stats */
    .stat-number { font-size: 24px; }

    /* Section title */
    .section-title { font-size: 21px; }

    /* Car footer price + button stack */
    .car-price { flex-direction: column; gap: 2px; }

    /* Services 2-col stays */
    .services-grid { grid-template-columns: 1fr 1fr; }

    /* Car detail specs */
    .cd-quick-specs { grid-template-columns: repeat(2, 1fr); }
    .similar-cars-grid { grid-template-columns: 1fr; }

    /* Buy cars listing */
    .cars-grid-listing { grid-template-columns: 1fr !important; }

    /* Footer */
    .footer-logo  { flex-direction: column; text-align: center; }
    .footer-social { justify-content: center; }
    .footer-title  { font-size: 16px; }

    /* Breadcrumb */
    .breadcrumb    { font-size: 12px; }
    .search-box-container { padding: 18px 14px; }
}


/* =========================================
   VERY SMALL — max-width: 360px
   ========================================= */
@media (max-width: 360px) {
    .logo-text   { display: none; }
    .hero-slider { height: 250px; }
    .slide-title { font-size: 18px; }
    .stats-grid  { grid-template-columns: 1fr; }
    .services-grid { grid-template-columns: 1fr; }
}
/* =========================================
   CAR DETAIL - CLEAN MOBILE FIX (FINAL)
   ========================================= */

@media (max-width: 768px) {

    /* Prevent horizontal scroll */
    body {
        overflow-x: hidden;
    }

    /* Container fix */
    .container {
        width: 100%;
        max-width: 100%;
        padding: 0 12px;
        overflow: hidden;
    }

    /* Layout: 2 column → 1 column */
    .car-detail-layout {
        grid-template-columns: 1fr !important;
        gap: 20px;
    }

    /* Remove sticky */
    .cd-gallery {
        position: relative;
        top: auto;
        width: 100%;
        max-width: 100%;
        overflow: hidden;
    }

    /* MAIN IMAGE WRAPPER */
    .cd-main-image-wrap {
        width: 100% !important;
        max-width: 100% !important;
        height: 220px;
        overflow: hidden;
        border-radius: 10px;
        aspect-ratio: unset !important;
    }

    /* MAIN IMAGE */
    .cd-main-image {
        width: 100% !important;
        max-width: 100% !important;
        height: 100%;
        object-fit: cover;
        display: block;
    }

    /* Thumbnails scroll */
    .cd-thumbnails {
        display: flex;
        overflow-x: auto;
        gap: 8px;
    }

    .cd-thumb {
        flex-shrink: 0;
        width: 60px;
        height: 45px;
    }

    /* CTA buttons */
    .cd-cta {
        display: flex;
        flex-direction: column;
        gap: 10px;
    }

    .cd-cta a,
    .cd-cta button {
        width: 100%;
        justify-content: center;
    }

    /* Title + price */
    .cd-title {
        font-size: 20px;
    }

    .cd-price {
        font-size: 24px;
    }

    /* Quick specs grid */
    .cd-quick-specs {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    /* Reduce spacing */
    .car-detail-section {
        padding: 15px 0 40px;
    }

    /* Similar cars */
    .similar-cars-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

}

/* =========================================
   TABLE RESPONSIVE FIX
   ========================================= */

.table-responsive {
    width: 100%;
    overflow-x: auto;
}

/* Optional: cleaner mobile table view */
@media (max-width: 768px) {

    .cd-specs-table table,
    .cd-specs-table tbody,
    .cd-specs-table tr {
        display: block;
        width: 100%;
    }

    .cd-specs-table tr {
        display: flex;
        justify-content: space-between;
        padding: 10px 0;
        border-bottom: 1px solid #eee;
    }

    .cd-specs-table th {
        font-weight: 600;
    }

    .cd-specs-table td {
        text-align: right;
    }

}

/* ===== FORCE FIX BUY CARS MOBILE ===== */
@media (max-width: 768px) {

    body {
        overflow-x: hidden !important;
    }

    .buy-cars-layout {
        display: block !important;
    }


    .mobile-filter-btn {
        display: flex !important;
    }

    .cars-grid-listing {
        grid-template-columns: 1fr !important;
    }

    .container {
        max-width: 100% !important;
        padding: 0 12px !important;
    }

}

/* ===== BUY CARS TOP BAR MOBILE FIX ===== */
@media (max-width: 768px) {

    .listing-topbar {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    .listing-controls {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
        width: 100%;
    }

    .sort-control {
        width: 100%;
    }

    .sort-select {
        width: 100%;
    }

    .view-toggle {
        display: flex;
        gap: 6px;
    }

    .view-btn {
        flex: 1;
        height: 40px;
    }

    .mobile-filter-btn {
        width: 100%;
        justify-content: center;
    }

}

@media (max-width: 768px) {

    .filter-sidebar {
        position: fixed;
        top: 0;
        left: 0;
        width: 85%;
        max-width: 320px;
        height: 100vh;
        background: #fff;
        z-index: 9999;
        transform: translateX(-100%) !important;
        transition: 0.3s ease;
        overflow-y: auto;
    }

    .filter-sidebar.open {
        transform: translateX(0) !important;
    }

}

/* ===== LIST VIEW FIX ===== */
.cars-grid-listing.list-view {
    grid-template-columns: 1fr !important;
}

.cars-grid-listing.list-view .car-card-listing {
    flex-direction: row;
    height: auto;
}

.cars-grid-listing.list-view .ccl-image {
    width: 40%;
    height: 120px;
}

.cars-grid-listing.list-view .ccl-body {
    width: 60%;
    padding: 10px;
}

/* MOBILE */
@media (max-width: 768px) {

    .cars-grid-listing.list-view .car-card-listing {
        flex-direction: column;
    }

    .cars-grid-listing.list-view .ccl-image {
        width: 100%;
        height: 180px;
    }

    .cars-grid-listing.list-view .ccl-body {
        width: 100%;
    }

}
/* =========================================
   FINAL BUY CARS MOBILE FIX (CLEAN)
   ========================================= */

@media (max-width: 768px) {

    /* Layout fix */
    .buy-cars-layout {
        display: block !important;
    }

    /* Sidebar hidden by default */
    .filter-sidebar {
        position: fixed;
        top: 0;
        left: 0;
        width: 85%;
        max-width: 320px;
        height: 100vh;
        background: #fff;
        z-index: 9999;
        transform: translateX(-100%);
        transition: 0.3s ease;
        overflow-y: auto;
    }

    /* When open */
    .filter-sidebar.open {
        transform: translateX(0);
    }

    /* Show button */
    .mobile-filter-btn {
        display: flex !important;
        width: 100%;
        justify-content: center;
    }

    /* Top bar fix */
    .listing-topbar {
        flex-direction: column;
        gap: 10px;
    }

    .listing-controls {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
        width: 100%;
    }

    .sort-control {
        width: 100%;
    }

    .sort-select {
        width: 100%;
    }

    /* Grid fix */
    .cars-grid-listing {
        grid-template-columns: 1fr !important;
    }

}

@media (max-width: 768px) {
    .view-toggle {
        display: none !important;
    }
}

@media (max-width: 768px) {
    .cars-grid-listing {
        grid-template-columns: 1fr !important;
    }

    .cars-grid-listing.list-view {
        grid-template-columns: 1fr !important;
    }
}