/* =========================
   MOBILE NAVBAR
========================= */
@media (max-width:768px){

.navbar{
    position: sticky;
    top:0;
    z-index:1000;

    display:flex;
    flex-wrap:wrap;
    align-items:center;
    justify-content:space-between;

    width:100%;
    height:auto;
    min-height:120px;

    padding:12px 10px;

    box-shadow:0 2px 8px rgba(0,0,0,.12);

    gap:10px;
}
.page-wrap{
        width: 100%;
        max-width: none;
        margin: 0;
        padding: 0;
    }


/* Logo area */
.navbar .logo{
    flex:1;
    max-width:50%;
}













/* Right buttons */
.navbar .nav-links,
.navbar .nav-buttons{
    display:flex;
    gap:6px;
    align-items:center;
}

    .navbar .nav-search {
        display: none !important;
    }


.navbar .nav-search input{
    width:100%;
    height:42px;
    font-size:14px;
}


/* Buttons */
.navbar button,
.navbar a{
    font-size:13px;
}


/* Hide desktop menu if needed */
.navbar .desktop-menu{
    display:none;
}

/* =========================================
   MOBILE SEARCH SLIDE
========================================= */

@media (max-width:768px){

    .navbar{
        position: sticky;
        top: 0;
        z-index: 1000;
    }

    .navbar .nav-search{
        order: 3;
        flex-basis: 100%;
        width: 100%;

        max-height: 50px;
        opacity: 1;
        overflow: hidden;

        transform: translateY(0);
        transition:
            max-height .35s ease,
            opacity .25s ease,
            transform .35s ease,
            margin .35s ease;
    }

    /* HIDDEN */
    .navbar .nav-search.search-hidden{
        max-height: 0;
        opacity: 0;

        transform: translateY(-15px);

        margin-top: 0;
        margin-bottom: 0;

        pointer-events: none;
    }

    .navbar .nav-search input{
        width: 100%;
        height: 42px;
        box-sizing: border-box;
    }

}



/* ==========================================
   MOBILE SUB NAVBAR SCROLL
==========================================*/


.sub-navbar{
    position: relative;
    display:flex;
    flex-wrap:nowrap;
    overflow-x:auto;
    overflow-y:visible;
    white-space:nowrap;
    top:0;
margin-top:0;

    gap:8px;
    padding:10px;

    -webkit-overflow-scrolling:touch;
   
        /* Hide scrollbar */
        scrollbar-width:none;      /* Firefox */
        -ms-overflow-style:none;   /* IE & Edge */
}



/* Scrollbar */
.sub-navbar::-webkit-scrollbar{
    height:5px;
}

.sub-navbar::-webkit-scrollbar-thumb{
    background:#c7c7c7;
    border-radius:10px;
}

/* Menu Items */
.sub-navbar a,
.drop-btn{
    flex:0 0 auto;
    white-space:nowrap;

    padding:8px 14px;
    font-size:14px;
    border-radius:20px;
}
.dropdown{
    position:relative;
    flex:0 0 auto;
}
.dropdown-content{
    position:fixed;

    left:-300px;
    top:120px !important;       /* touches navbar bottom */

    width:280px;

    background:#fff;

    display:flex;
    flex-direction:column;

    transition:left .35s ease;

    z-index:999999;

    box-shadow:4px 0 20px rgba(0,0,0,.25);

    overflow-y:auto;

    height:calc(100vh - 60px);
}

.dropdown-content.active{
    left:0;
}

.drawer-header{
    display:flex;
    justify-content:space-between;
    align-items:center;
    background:#009688;
    color:#fff;
    padding:16px;
    font-size:18px;
    font-weight:600;
}

.drawer-header button{
    background:none;
    border:none;
    color:#fff;
    font-size:30px;
    cursor:pointer;
}

.dropdown-content a{
    display:block;
    padding:15px 20px;
    color:#333;
    text-decoration:none;
    border-bottom:1px solid #eee;
}

.services-overlay{
    position:fixed;
    inset:0;
    background:rgba(0,0,0,.45);
    opacity:0;
    visibility:hidden;
    transition:.3s;
    z-index:1000;
}

.services-overlay.active{
    opacity:1;
    visibility:visible;
}


.right-tools{
        display:none !important;
    }





/* PAGE */
.page-layout{
    display:flex;
    flex-direction:column;
     width:100%;
        padding-left:2px;
        padding-right:2px;
        gap:15px;
}






.drawer-anchor{
    position:fixed;
    top:70px;       /* height of your navbar */
    left:0;
    width:100%;
    height:0;       /* invisible */
    z-index:999998;
}






















/* =====================================================
   MOBILE CATEGORY INLINE DROPDOWN (768px and below)
===================================================== */
.category-section .category-header {
        display: none !important;
    }

    /* Wrapper keeps button on top and section below */
    .category-wrapper {
        display: flex;
        flex-direction: column;
        width: 100%;
        margin-bottom: 15px !important;
    }









    /* 1. Toggle Button (STAYS AT THE TOP) */
    .category-toggle {
        order: 1; /* Guarantees button renders FIRST */
        display: flex;
        align-items: center;
        justify-content:center;
        width: 100%;
        padding: 12px 18px;
        background:lightseagreen;
        color: #1e293b;
        border: 1px solid #53c7f8;
        border-radius: 10px;
        font-weight: 700;
        font-size: 15px;
        cursor: pointer;
        margin-bottom: 10px;
        box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
    }

    /* Rotate arrow on toggle */
    .category-toggle .material-symbols-outlined {
        transition: transform 0.3s ease;
    }

    .category-toggle.active .material-symbols-outlined {
        transform: rotate(180deg);
    }

    /* 2. Expanding Section (RENDERS BELOW THE BUTTON) */
    .category-section {
        order: 2; /* Guarantees section renders SECOND */
        position: static;
        width: 100%;
        max-height: 0;
        overflow: hidden;
        background: transparent;
        margin: 0;
        padding: 0;
        opacity: 0;
        transition: max-height 0.4s ease, opacity 0.3s ease, margin 0.3s ease;
    }

    /* Expanded State */
    .category-section.active,
    .category-section.open {
        max-height: 1200px;
        opacity: 1;
        margin-bottom: 16px;
    }

    .close-category {
        display: none !important;
    }





/* ===================================
   MOBILE CATEGORY BUTTON ANIMATION
=================================== */


.category-toggle{

    animation:categoryPulse 2.5s infinite;

}



/* Browse by Type text shake */

.category-toggle span:first-child{

    display:inline-block;

    animation:browseShake 2.5s infinite;

}



/* TEXT LEFT RIGHT SHAKE */

@keyframes browseShake{


0%,70%,100%{

    transform:translateX(0);

}


75%{

    transform:translateX(-6px);

}


80%{

    transform:translateX(6px);

}


85%{

    transform:translateX(-4px);

}


90%{

    transform:translateX(4px);

}


95%{

    transform:translateX(0);

}


}



/* BUTTON EXPANDING EFFECT */

@keyframes categoryPulse{


0%{

    transform:scale(1);

    box-shadow:0 0 0 0 rgba(83,199,248,.5);

}


50%{

    transform:scale(1.04);

    box-shadow:0 0 0 10px rgba(83,199,248,0);

}


100%{

    transform:scale(1);

    box-shadow:0 0 0 0 rgba(83,199,248,0);

}


}






/* =========================================================
   MOBILE CATEGORY SYSTEM
   768px AND BELOW
   INLINE DROPDOWN
   NO FIXED HEIGHT
   NO LARGE GAP
========================================================= */

@media screen and (max-width: 768px) {


    /* =====================================================
       CATEGORY WRAPPER
    ===================================================== */

    .category-wrapper {

        display: flex !important;
        flex-direction: column !important;

        width: 100% !important;
        height: auto !important;
        min-height: 0 !important;

        margin: 0 !important;
        padding: 0 !important;

        gap: 0 !important;

        position: relative !important;
    }


    /* =====================================================
       CATEGORY TOGGLE
    ===================================================== */

.category-toggle {
    order: 1 !important;

    display: flex !important;
    align-items: center !important;
    justify-content: center !important;

    position: relative !important;

    width: 100% !important;
    height: auto !important;
    min-height: 46px !important;

    margin: 0 !important;
    padding: 10px 15px !important;

    box-sizing: border-box !important;

    background: #e8f5e9 !important;

    color: #1e293b !important;

    border: 1px solid #4caf50 !important;
    border-radius: 10px !important;

    font-size: 15px !important;
    font-weight: 700 !important;

    line-height: 1.2 !important;

    text-align: center !important;

    box-shadow: 0 2px 6px rgba(0,0,0,.06) !important;

    cursor: pointer;

    flex-shrink: 0 !important;

    z-index: 10 !important;
}

/* =========================
   ARROW - RIGHT SIDE
========================= */

.category-toggle .material-symbols-outlined {

    position: absolute !important;

    right: 15px !important;
    top: 50% !important;

    font-size: 22px !important;

    transform: translateY(-50%) !important;

    transition: transform .25s ease !important;
}


/* =========================
   ARROW - OPEN
========================= */

.category-toggle.active .material-symbols-outlined {

    transform: translateY(-50%) rotate(180deg) !important;
}


    /* =====================================================
       CATEGORY SECTION - CLOSED
    ===================================================== */

    .category-section {

        order: 2 !important;

        position: relative !important;

        top: auto !important;
        left: auto !important;
        right: auto !important;
        bottom: auto !important;

        display: block !important;

        width: 100% !important;

        height: auto !important;
        min-height: 0 !important;

        max-height: 0 !important;

        margin: 0 !important;
        padding: 0 !important;

        overflow: hidden !important;

        opacity: 0 !important;

        background: transparent !important;

        transform: none !important;

        box-shadow: none !important;

        transition:
            max-height .35s ease,
            opacity .25s ease !important;

        box-sizing: border-box !important;
    }


    /* =====================================================
       CATEGORY SECTION - OPEN
    ===================================================== */

    .category-section.active,
    .category-section.open {

        max-height: 5000px !important;

        height: auto !important;
        min-height: 0 !important;

        margin: 0 !important;

        padding: 4px 3px 8px !important;

        opacity: 1 !important;

        overflow: visible !important;
    }


    /* =====================================================
       HIDE DESKTOP HEADER
    ===================================================== */

    .category-section .category-header {

        display: none !important;
    }


    /* =====================================================
       ALL VEHICLES
       AND SIMPLE CATEGORY LINKS
    ===================================================== */

    .category-section > a:not(.main-cat) {

        display: flex !important;

        align-items: center !important;
        justify-content: space-between !important;

        width: 100% !important;
        min-height: 46px !important;

        margin: 4px 0 !important;
        padding: 10px 14px !important;

        box-sizing: border-box !important;

        color: #1e293b !important;

        text-decoration: none !important;

        background: linear-gradient(
            to bottom,
            #ffffff,
            #f1f5f9,
            #ffffff
        ) !important;

        border: 1px solid #dbe3ea !important;

        border-radius: 13px !important;

        box-shadow:
            0 2px 7px rgba(0,0,0,.07),
            inset 0 1px 2px rgba(255,255,255,.9) !important;

        font-size: 14px !important;
        font-weight: 600 !important;

        transition:
            transform .2s ease,
            background .2s ease,
            color .2s ease !important;
    }


    /* Category count */

    .category-section > a:not(.main-cat) b {

        min-width: 25px !important;

        text-align: center !important;

        font-size: 13px !important;

        color: white !important;
    }


    /* =====================================================
       CATEGORY ITEM
    ===================================================== */

    .category-section .cat-item {

        display: block !important;

        width: 100% !important;

        margin: 0 !important;
        padding: 0 !important;

        box-sizing: border-box !important;
    }


    /* =====================================================
       MAIN CATEGORY
    ===================================================== */

    .category-section .cat-item > .main-cat {

        position: relative !important;

        display: flex !important;

        align-items: center !important;
        justify-content: space-between !important;

        width: 100% !important;
        min-height: 50px !important;
        height: auto !important;

        margin: 5px 0 !important;
        padding: 12px 15px !important;

        box-sizing: border-box !important;

        color: #1e293b !important;

        text-decoration: none !important;

        background: linear-gradient(
            to bottom,
            #ffffff 0%,
            #f1f5f9 50%,
            #ffffff 100%
        ) !important;

        border: 1px solid #dbe3ea !important;

        border-radius: 15px !important;

        box-shadow:
            0 3px 9px rgba(0,0,0,.08),
            inset 0 1px 2px rgba(255,255,255,.9) !important;

        font-size: 15px !important;
        font-weight: 600 !important;

        transition:
            transform .2s ease,
            background .2s ease,
            color .2s ease,
            box-shadow .2s ease !important;
    }


    /* =====================================================
       MAIN CATEGORY COUNT
    ===================================================== */

    .category-section .main-cat b {

        min-width: 28px !important;

        text-align: center !important;

        color: #95a2b4 !important;

        font-size: 13px !important;
    }


    /* =====================================================
       ACTIVE CATEGORY
    ===================================================== */

    .category-section .main-cat.active-category {

        color: #16a34a !important;

        background: linear-gradient(
            to bottom,
            #f0fdf4,
            #dcfce7,
            #f0fdf4
        ) !important;

        border-color: #86efac !important;

        transform: scale(1.015) !important;

        box-shadow:
            0 5px 15px rgba(22,163,74,.15),
            inset 0 1px 3px rgba(255,255,255,.9) !important;

        font-weight: 700 !important;
    }


    .category-section .main-cat.active-category b {

        color: #16a34a !important;
    }


    /* =====================================================
       CYLINDER EFFECT
    ===================================================== */

    .category-section .main-cat::after {

        content: "" !important;

        position: absolute !important;

        left: 10% !important;
        right: 10% !important;
        bottom: -5px !important;

        height: 8px !important;

        border-radius: 50% !important;

        background: rgba(0,0,0,.10) !important;

        filter: blur(4px) !important;

        opacity: .30 !important;

        pointer-events: none !important;

        z-index: -1 !important;
    }


    /* =====================================================
       SUB CATEGORY CLOSED
    ===================================================== */

    .category-section .sub-category {

        display: block !important;

        width: 100% !important;

        height: auto !important;

        max-height: 0 !important;

        margin: 0 !important;
        padding: 0 !important;

        overflow: hidden !important;

        opacity: 0 !important;

        transform: translateY(-4px) !important;

        box-sizing: border-box !important;

        transition:
            max-height .35s ease,
            opacity .25s ease,
            transform .25s ease !important;
    }


    /* =====================================================
       SUB CATEGORY OPEN
    ===================================================== */

    .category-section .sub-category.show {

        max-height: 3000px !important;

        margin: 0 !important;

        padding: 2px 5px 7px !important;

        opacity: 1 !important;

        overflow: visible !important;

        transform: translateY(0) !important;
    }


    /* =====================================================
       SUB CATEGORY LINKS
    ===================================================== */

    .category-section .sub-category a {

        display: flex !important;

        align-items: center !important;
        justify-content: space-between !important;

        width: 100% !important;

        min-height: 40px !important;

        margin: 3px 0 !important;
        padding: 8px 12px !important;

        box-sizing: border-box !important;

        color: #475569 !important;

        background: #f8fafc !important;

        border: 1px solid #e2e8f0 !important;

        border-radius: 9px !important;

        text-decoration: none !important;

        font-size: 13px !important;
        font-weight: 500 !important;

        transition:
            transform .2s ease,
            background .2s ease,
            color .2s ease !important;
    }


    /* Sub count */

    .category-section .sub-category a span {

        font-size: 12px !important;

        color: #64748b !important;

        margin-left: 8px !important;
    }


    /* =====================================================
       SUB CATEGORY HOVER / TOUCH
    ===================================================== */

    .category-section .sub-category a:hover {

        background: #f0fdf4 !important;

        border-color: #bbf7d0 !important;

        color: #16a34a !important;

        transform: translateX(3px) !important;
    }


    /* =====================================================
       CLOSE BUTTON
    ===================================================== */

    .close-category {

        display: none !important;
    }





















    /* =====================================================
       REMOVE UNWANTED SPACING FROM PARENT
    ===================================================== */

    .page-layout {

        width: 100% !important;

        height: auto !important;
        min-height: 0 !important;

        margin: 0 !important;
        padding: 0 !important;

        gap: 0 !important;
    }


    /* =====================================================
       CATEGORY WRAPPER POSITION
    ===================================================== */

    .page-layout > .category-wrapper {

        margin-top: 0 !important;
        margin-bottom: 0 !important;

        padding-top: 0 !important;

        align-self: stretch !important;
    }


    /* =====================================================
       RIGHT CONTENT
       PREVENT IT FROM CREATING SPACE ABOVE CATEGORY
    ===================================================== */

    .right-content {

        width: 100% !important;

        margin-top: 0 !important;
        padding-top: 0 !important;

        min-height: 0 !important;
    }

}











    .right-content{
        margin-top:0;   /* Adjust as needed */
    }







/* FILTER */
.filter-bar{
    border:1px solid #d6d9df !important;
    border-radius:5px;

    display:grid;
    grid-template-columns:repeat(2, 1fr);
    gap:10px;

    margin-bottom:15px;
    margin-left:5px;
    margin-right:5px;

    padding:2px !important;
    box-sizing:border-box;
}

/* INPUTS + SELECT */
.filter-bar input,
.filter-bar select{
    width:calc(100% - 4px) !important;
    height:30px;

    margin-left:2px;
    margin-right:2px;

    border:1px solid #cfd8dc !important;
    border-radius:6px;

    padding:0 8px;
    box-sizing:border-box;
    background:#fff;
    outline:none;
}

/* BUTTON */
.filter-bar button{
    grid-column:1 / -1;

    width:calc(100% - 4px) !important;
    height:30px;

    margin-left:2px;
    margin-right:2px;

    background-color:#009688;

    color:#fff;
    cursor:pointer;

    border:none;
    border-radius:6px;

    box-sizing:border-box;
}

/* FOCUS */
.filter-bar input:focus,
.filter-bar select:focus{
    border-color:#009688 !important;
    box-shadow:0 0 0 2px rgba(0,150,136,.10);
}












/* ==========================
   ADS CONTAINER
========================== */
.ads-container{
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 14px;
    width: 100%;
}

/* ==========================
   AD CARD
========================== */
.ad-row{
    display: flex;
    align-items: flex-start;

    width: 100%;

    height: 140px;

    background: #fff;

    border: 1px solid #e5e5e5;

    border-radius: 10px;

    overflow: hidden;

    box-sizing: border-box;
}
/* ==========================
   IMAGE
========================== */
.ad-row-img{
    flex:0 0 28% !important;
    width:28% !important;
    max-width:28% !important;
    height:140px;
    overflow:hidden;
}

.ad-row-img img{
    width:100%;
    height:100%;
    object-fit:cover;
    display:block;
}










/* ==========================
   CONTENT
========================== */
/* CONTENT */
.ad-row-content{
    flex:1;
    padding:4px 10px 0 10px !important;
    display:flex;
    flex-direction:column;
    align-items:flex-start;
    justify-content:flex-start !important;
    gap:0 !important;
}

.ad-row-content .title{
    margin:0 !important;
    padding:0 !important;
    transform:translateY(-2px);

    font-size:12px;
    line-height:20px;   /* reduce space between title lines */

    display:-webkit-box;
    -webkit-line-clamp:2;
    -webkit-box-orient:vertical;
    overflow:hidden;
}

/* Price */
.price{
    font-size:13px;
    font-weight:700;
    margin:0;
    color:#111;
    line-height:20px;
}

.specs{
        display:flex !important;
        flex-direction:column !important;
        align-items:flex-start !important;
        gap:0;
        width:100%;
        line-height:15px;
    }








    .year-info,
    .mileage-info,
    .location{
        display:flex !important;
        align-items:center !important;
        justify-content:flex-start !important;
        width:100%;
        font-size:11px;
        line-height:15px;
        color:#666;
    }

.time{
   
    font-size:8px;
    line-height:40px;
    white-space:nowrap;
}

/* Reduce Material Symbols icon size */
.material-symbols-outlined{
    font-size:11px !important;
    width: 11px;
    height:11px;
    line-height:14px;
    vertical-align:middle;
    margin-right:3px;
}

/* DATE TIME BOTTOM */
.ad-footer{
    margin-top:auto;
    width:100%;
    display:flex;
    justify-content:flex-end;
    align-items:center;
     padding-bottom:5px;

}













/* PAGINATION */
.pagination{
    justify-content:center;
    flex-wrap:wrap;
}

/* FOOTER */
.footer-container{
    display:flex;
    flex-direction:column;
    text-align:center;
}












}











/* =====================================================
   TABLET RESPONSIVE (769px - 1024px)
===================================================== */
@media (min-width:769px) and (max-width:1024px){


/* =========================
   MAIN NAVBAR
========================= */

.navbar{

    height:85px;

    padding:10px 15px;

    gap:10px;

}


/* LOGO */

.logo-word{

    font-size:30px;

}



/* SEARCH */

.nav-search{

    max-width:400px;

    margin:0 10px;

}


.search-category{

    display:none;

}


.search-input{

    font-size:13px;

}



.search-btn{

    padding:0 14px;

}



/* RIGHT BUTTONS */

.nav-right{

    gap:6px;

}


.post-btn{

    padding:7px 10px;

    font-size:13px;

}






/* =====================================================
   SUB NAVBAR TABLET
===================================================== */


.sub-navbar{

    top:85px;

    gap:14px;

    padding:10px 15px;


    overflow-x:auto;

    overflow-y:hidden;

    white-space:nowrap;


    scrollbar-width:none;

}


.sub-navbar::-webkit-scrollbar{

    display:none;

}




.sub-navbar > a,
.drop-btn{

    font-size:13px;

    padding-right:15px;

}




/* SERVICES DROPDOWN */

.dropdown-content{

    position:fixed;

    top:135px;

    left:15px;

    width:300px;

    max-height:70vh;

    overflow-y:auto;

}




/* DESKTOP ACTIONS */

.desktop-actions{

    display:none;

}


.right-tools{

    gap:6px;

}



}









/* =====================================================
   MOBILE - CONSISTENT LEFT / RIGHT SPACE
===================================================== */

@media (max-width:768px){

    /* Main content area */
    .page-layout{
        width:100% !important;
        padding-left:15px !important;
        padding-right:15px !important;
        margin:0 !important;
        box-sizing:border-box !important;
    }


    /* Right content */
    .right-content{
        width:100% !important;
        margin:0 !important;
        padding:0 !important;
        box-sizing:border-box !important;
    }


    /* CATEGORY */
    .category-wrapper{
        width:100% !important;
        margin:0 !important;
        padding:0 !important;
        box-sizing:border-box !important;
    }


    .category-toggle{
        width:100% !important;
        margin-left:0 !important;
        margin-right:0 !important;
        box-sizing:border-box !important;
    }


    /* FILTER */
    .filter-bar{
        width:100% !important;
        margin-left:0 !important;
        margin-right:0 !important;
        padding-left:0 !important;
        padding-right:0 !important;
        box-sizing:border-box !important;
    }


    /* ADS */
    .ads-container{
        width:100% !important;
        margin-left:0 !important;
        margin-right:0 !important;
        padding-left:0 !important;
        padding-right:0 !important;
        box-sizing:border-box !important;
    }


    /* AD CARD */
    .ads-container .ad-row{
        width:100% !important;
        margin-left:0 !important;
        margin-right:0 !important;
        box-sizing:border-box !important;
    }








}



/* =====================================================
   FORCE MOBILE CATEGORY BUTTON COLOR
===================================================== */

@media screen and (max-width: 768px) {

    html body .category-wrapper .category-toggle {
        background: #fff7e6 !important;
        background-color: #fff7e6 !important;

        border: 1px solid #e6c98a !important;
        color: #222222 !important;

        box-shadow: 0 2px 6px rgba(0,0,0,0.06) !important;
         margin-bottom: 15px !important;
    }

}













