/* ============ MOBILE NAV (off-canvas) ============ */

.mnav-burger{
    width: 35px;
    height: 35px;
    background: #fff;
    border-radius: 12px;
    display: none;           /* pokažemo na mobile */
    align-items: center;
    justify-content: center;
    padding: 0;
    cursor: pointer;
}

.mnav-burger-lines{
    position: relative;
    width: 23px;
    height: 2px;
    background: #111827;
    border-radius: 2px;
    transition: transform .2s ease, background .2s ease;
    display: block;
}
.mnav-burger-lines:before,
.mnav-burger-lines:after{
    content: "";
    position: absolute;
    left: 0;
    width: 18px;
    height: 2px;
    background: #111827;
    border-radius: 2px;
    transition: transform .2s ease, top .2s ease, opacity .2s ease;
}
.mnav-burger-lines:before{
    top: -6px;
}
.mnav-burger-lines:after{
    top: 6px;
}

/* burger -> X (ko je odprto) */
.is-mnav-open .mnav-burger-lines{
    background: transparent;
}
.is-mnav-open .mnav-burger-lines:before{
    top: 0;
    transform: rotate(45deg);
}
.is-mnav-open .mnav-burger-lines:after{
    top: 0;
    transform: rotate(-45deg);
}

/* overlay */
.mnav-overlay{
    position: fixed;
    inset: 0;
    background: rgba(17, 24, 39, 0.45);
    z-index: 9998;
    opacity: 0;
    transition: opacity .2s ease;
}
.is-mnav-open .mnav-overlay{
    opacity: 1;
}

/* panel */
.mnav{
    position: fixed;
    top: 0;
    right: 0;
    height: 100vh;
    width: min(420px, 92vw);
    background: #fff;
    z-index: 9999;
    transform: translateX(102%);
    transition: transform .25s ease;
    box-shadow: -20px 0 60px rgba(0,0,0,.12);
    display: flex;
    flex-direction: column;
}

.is-mnav-open .mnav{
    transform: translateX(0);
}

/* header */
.mnav-head{
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 16px;
    border-bottom: 1px solid #E5E7EB;
}
.mnav-title{
    font-size: 18px;
    font-weight: 700;
}
.mnav-close{
    width: 20px;
    height: 35px;
    background: #fff;
    border-radius: 12px;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    color: #11112E;
}

/* body */
.mnav-body{
    overflow: auto;
    padding: 10px 10px 24px 10px;
}

/* links */
.mnav-link{
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding: 10px 12px;
    color: #111827;
    text-decoration: none;
    font-weight: 500;
    gap: 8px;
}

.mnav-link img{
    width: 20px;
}

.mnav-link:hover{
    background: #F3F4F6;
}

.mnav-section-label{
    margin: 14px 12px 6px 12px;
    font-size: 12px;
    color: #6B7280;
    text-transform: uppercase;
    letter-spacing: .06em;
}

.mnav-divider{
    height: 1px;
    background: #E5E7EB;
    margin: 12px 12px;
}

/* accordion */
.mnav-acc-item{
    border-top: 1px solid #E5E7EB;
    margin: 0 12px;
}
.mnav-acc-item:first-child{
    border-top: 0;
}
.mnav-acc-trigger{
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: transparent;
    border: 0;
    padding: 8px 0;
    font-weight: 600;
    color: #111827;
    cursor: pointer;
    text-align: left;
}

.mnav-caret{
    width: 10px;
    height: 10px;
    border-right: 2px solid #9CA3AF;
    border-bottom: 2px solid #9CA3AF;
    transform: rotate(45deg);
    transition: transform .2s ease;
    margin-left: 12px;
}
.mnav-acc-item.is-open .mnav-caret{
    transform: rotate(-135deg);
}

.mnav-acc-panel{
    max-height: 0;
    overflow: hidden;
    transition: max-height .25s ease;
}
.mnav-panel-inner{
    padding: 0 0 10px 0;
}

.mnav-sublink{
    display: block;
    padding: 3px 0px;
    margin: 0 0 0px 0;
    text-decoration: none;
    color: #111827;
    font-weight: 500;
    font-size: 14px;
}
.mnav-sublink:hover{
    background: #F3F4F6;
}

/* lock scroll */
.is-mnav-open{
    overflow: hidden;
}


.mnav-divider-profile{
    padding-bottom: 20px;
}


.mnav-acc .user-data {
    display: flex;
    flex-direction: row;
    width: 100%;
    padding: 15px;
    gap: 10px;
    align-items: center;
    margin-bottom: 20px;
    border-bottom: 1px solid #E5E7EB;
}

.mnav-acc .user-data .img-box {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    overflow: hidden;
    display: flex;
}

.mnav-acc .user-data .user-data-title {
    font-weight: 700;
    font-size: 14px;
}

.mnav-acc .user-data  .user-data-company {
    font-size: 12px;
    margin-bottom: 5px;
}

.mnav-acc .user-data  .user-data-company a {
    font-size: 14px;
    color: #555f6e;
}

.mnav-acc .user-data .img-box img {
    height: 100%;
    width: 100%;
    object-fit: cover;
}

/* --- Mobile filter open button (hidden on desktop) --- */
.btn-filter-open{
    display:none;
    border:1px solid #e6e6e6;
    background:#fff;
    border-radius:12px;
    padding:10px 14px;
    font-weight:600;
    cursor:pointer;
    color: #111111;
}

.btn-filter-open img{
    width: 20px;
}

.mobile-sticky-actions{
    display: none;
}

/* --- Overlay + modal hidden by default --- */
.filters-overlay{
    position:fixed;
    inset:0;
    background:rgba(0,0,0,.45);
    opacity:0;
    pointer-events:none;
    transition:opacity .2s ease;
    z-index:9998;
}

.filters-modal{
    position:fixed;
    inset:0;
    display:flex;
    align-items:flex-end; /* sheet style */
    justify-content:center;
    opacity:0;
    pointer-events:none;
    transition:opacity .2s ease;
    z-index:9999;
}

.filters-modal-inner{
    width:100%;
    max-width:520px;
    height:92vh;
    background:#fff;
    border-radius:18px 18px 0 0;
    overflow:hidden;
    transform:translateY(16px);
    transition:transform .2s ease;
    display:flex;
    flex-direction:column;
}

.filters-modal-header{
    display: none;
}

/* Header */


.filters-modal-title{
    font-size:18px;
    font-weight:700;
}

.filters-modal-x{
    border:0;
    background:transparent;
    font-size:28px;
    line-height:1;
    cursor:pointer;
    padding: 0 1px;
    color: #111111;
}

/* Body scroll */
.filters-modal-body{
    flex:1;
    overflow:auto;
    -webkit-overflow-scrolling:touch;
    padding:12px 14px 90px; /* prostor za footer */
}

/* Footer (sticky) */
.filters-modal-footer{
    position:relative;
    border-top:1px solid #eee;
    padding:12px 14px;
    background:#fff;
}

.btn-filter-close{
    width:100%;
    border:1px solid #e6e6e6;
    background:#fff;
    border-radius:14px;
    font-weight:700;
    cursor:pointer;
    color: #111111;
    height: 40px;
    margin-top: 10px;
}

/* Open state */
body.filters-open{
    overflow:hidden;
}

body.filters-open .filters-overlay{
    opacity:1;
    pointer-events:auto;
}

body.filters-open .filters-modal{
    opacity:1;
    pointer-events:auto;
}

body.filters-open .filters-modal-inner{
    transform:translateY(0);
}




@media (max-width: 992px){
    .filters-modal-header{
    display:flex;
    align-items:center;
    justify-content:space-between;
    padding:14px 16px;
    border-bottom:1px solid #eee;
}


    .header-nav{
        display: none;
    }
    .mnav-burger{
        display: inline-flex;
    }

    .header .header-actions{
        display: none;
    }

    .header .header-actions{
        width: 185px;
    }


    .hero{
        height: 225px;
    }

    .hero-search-single .single-row .select-box{
        flex: 0 0 48%;
        width: 47%;
    }

    .hero-search-single .single-row .select-box.select-box-register, .hero-search-single .single-row .select-box.select-box-regions{
        flex: 1;
        width: 100%;
    }

    .hero-search-row .single-row{
        flex-wrap: wrap;
        gap: 10px;
    }

    .hero-search .hero-search-buttons{
        flex-direction: column;
    }

    .hero-search .hero-search-buttons .buttons-box{
        justify-content: space-between;
        padding-top: 30px;
        flex-wrap: wrap;
    }

    .dealer-cars-carousel .dealer-cars-carousel-inner{
        flex-direction: column;
    }

    /* vehicle-grid inside dealer section is now handled by the JS carousel */
    .dealer-cars-carousel .dealer-cars-carousel-inner .vehicle-carousel{
        width: 100%;
        min-width: 0;
    }

    .dealer-cars-carousel .dealer-cars-carousel-inner .deal-cards-company{
        height: auto;
        padding: 20px;
        width: 100%;
    }

    .dealer-cars-carousel .dealer-cars-carousel-inner .deal-cards-company .location{
        /*        display: none;*/
    }

    .dealer-cars-carousel .vehicle-card .img-box{
        height: 130px;
    }

    .header .header-inner{
        padding: 12px 15px;
    }

    .shapes .shapes-item img{
        max-height: 150px;
    }


    .brands .brands-inner{
        padding: 15px;
    }
    /*
        .shapes-carousel .shapes-item{
            max-width: 155px;
        }*/

    h2.main{
        font-size: 25px;
    }

    h3.main{
        font-size: 17px;
    }

    .about{
        font-size: 14px;
    }

    .about .about-content{
        width: 100%;
    }

    .about .about-stats{
        gap: 6px;
        display: grid;
        grid-template-columns: 1fr 1fr;
    }

    .about .about-stat .content .number{
        font-size: 20px;
    }

    .about .about-stat .content{
        font-size: 12px;
    }

    .vehicle-card .content{
        padding: 10px;
    }

    .dealer-cars-carousel .vehicle-card .content h4{
        font-size: 14px;
    }

    .vehicle-card .content .price{
        font-size: 18px;
    }

    .vehicle-card .content .price .old{
        font-size: 13px;
    }

    .select-box label{
        font-size: 13px;
    }

    .products-page{
        flex-direction: column;
    }

    .products-page .hero-search-box{
        flex: 1;
        width: 100%;
        display: none;
    }

    .products-page .products-box{
        width: 100%;
    }

    .products-box .vehicle-card{
        flex-direction: column;
    }

    .products-box .vehicle-card .img-box, .dealers-main-center .vehicle-grid .vehicle-card .img-box{
        width: 100%;
        flex: unset;
        height: 200px;
    }

    .products-box .vehicle-card .img-box img{
        width: 100%;
        height: 100%;
        border-radius: 0;
    }

    .products-box .vehicle-card .content{
        width: 100%;
    }

    .footer .footer-inner{
        flex-direction: column;
    }

    .footer .footer-col .footer-col-inside{
        flex-direction: column;
    }

    .footer .footer-col .footer-col-inside .footer-col-inside-col .links{

    }

    .footer .footer-col .footer-col-inside .footer-col-inside-col .links li{
        display: inline-block;
        width: 49%;
    }

    .footer-col-inside-brand{
        display: flex;
        align-items: center;
        gap: 10px;
        text-align: left;
        /* justify-content: center; */
    }

    .footer .logo-brand img{
        max-width: 140px;
    }

    .footer .company-data{
        text-align: left;
    }

    .auth-inner{
        flex-direction: column;
        align-items: unset;
        justify-content: unset;
        min-height: auto;
    }

    .auth-left{
        justify-content: unset;
        align-items: unset;
        min-height: auto;
        align-items: flex-start;
    }

    .auth-right{

    }

    .auth-right-inner{
        padding: 30px;
    }

    .auth-heading h2{
        font-size: 22px;
        font-weight: 700;
    }

    .auth-tabs{
        width: 100%;
    }

    .auth-card{
        max-width: 86% !important;
        margin: 0 auto;
    }

    .products-page .products-box .top-header{
        flex-direction: column;
        align-items: baseline;
    }

    .products-page .products-box .top-header .title{
        display: flex;
                width: 100%;
        justify-content: center;
    }

    .btn-filter-open,
    .products-page .products-box .top-header .ordery-by{
        display: none;
    }

    .mobile-sticky-actions{
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 10030;
        display: grid;
        grid-template-columns: 1fr 1fr;
        background: #ffffff;
        border-top: 1px solid rgb(224 224 225);
        padding-bottom: env(safe-area-inset-bottom);
    }

    .mobile-sticky-actions .mobile-sticky-action{
        height: 46px;
        border: 0;
        background: transparent;
        color: #111111;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
        font-size: 16px;
    }

    .mobile-sticky-actions .mobile-sticky-action + .mobile-sticky-action{
        border-left: 1px solid rgb(224 224 225);
    }

    .mobile-sticky-actions .mobile-sticky-action img{
        width: 20px;
        height: 20px;
    }

    .mobile-sticky-actions .mobile-sticky-action .sort-icon{
        line-height: 1;
        font-size: 15px;
    }

    body.filters-open .mobile-sticky-actions,
    body.sort-open .mobile-sticky-actions{
        opacity: 0;
        pointer-events: none;
        visibility: hidden;
    }

    .products-page{
        padding-bottom: calc(72px + env(safe-area-inset-bottom));
    }

    .sort-modal .sort-modal-inner{
        max-width: 520px;
        height: auto;
        max-height: 78vh;
        border-radius: 18px 18px 0 0;
    }

    .sort-modal .sort-modal-body{
        padding: 8px 14px 18px;
    }

    .sort-options-list{
        display: flex;
        flex-direction: column;
        gap: 6px;
    }

    .sort-option-row{
        margin-bottom: 0;
        border: 1px solid #E5E7EB;
        border-radius: 10px;
        padding: 6px 35px;
        background: #fff;
    }

    .sort-modal .sort-modal-footer{
        border-top: 1px solid #eee;
        padding: 12px 14px;
    }

    body.sort-open{
        overflow: hidden;
    }

    body.sort-open #js-sort-overlay{
        opacity: 1;
        pointer-events: auto;
    }

    body.sort-open #js-sort-modal{
        opacity: 1;
        pointer-events: auto;
    }

    body.sort-open #js-sort-modal .sort-modal-inner{
        transform: translateY(0);
    }

    /* Na mobile ne prikazuj sidebar filtrov normalno */
    #js-vehicle-filters{
        display:none;
    }

    /* Ko je modal odprt: pokaži dejanski form in ga postavi v modal body */
    body.filters-open #js-vehicle-filters{
        display:block;
        position:fixed;
        left:50%;
        bottom:0;
        transform:translateX(-50%);
        width:100%;
        max-width:520px;
        height:92vh;
        overflow:auto;
        -webkit-overflow-scrolling:touch;

        /* da se ujema z modal “okvirjem” */
        background:#fff;
        border-radius:18px 18px 0 0;
        z-index:10000;

        /* malo paddinga + prostor za footer gumb */
        padding: 18px 14px 90px;
        box-sizing:border-box;
        top: 19px;
    }

    /* Skrij naš “prazni” modal inner, ker dejanski form zdaj prevzame UI */
    body.filters-open #js-filters-modal{
        opacity:1;
        pointer-events:auto;
    }
    body.filters-open #js-filters-modal .filters-modal-inner{
        display:none; /* ker form je realen modal */
    }

    .mc-compare-left {
        display: none;
    }
    .mc-compare-card, .mc-compare-slot {
        min-width: 220px;
    }


    .hero-search{
        margin-top: -25px;
    }

    .hero .hero-title{
        font-size: 25px;
        margin: 0;
    }

    .hero .hero-inner{
        padding: 0px;
        gap: 0;
    }

    .hero .hero-subtitle{
        font-size: 18px;
    }

    .gsr-slider{
        min-height: 200px;
    }

    .hero-search .hero-search-buttons .hero-btn-primary{
        width: 100%;
        font-size: 16px;
        flex: 0 0 100%;
        text-align: center;
        justify-content: center;
        margin-top: 10px;
    }

    .hero-search .last-100{
        justify-content: center;
        width: 100%;
        margin: 0px;
        order: 2;
        margin-top: 5px;
    }

    .container{
        padding: 0 15px;
    }

    .brands .brands-item .img-box{
        height: 90px;
        width: 90px;
    }


    .vehicle-card .vehicle-card-inner{
        flex-direction: column;
    }

    .news-page .header{
        padding-top: 35px;
        padding-bottom: 20px;
    }

    .news-page h1{
        font-size: 25px;
    }

    .news-page .header h2{
        width: 90%;
        font-size: 16px;
    }

    .dealers-page .dealers-main{
        flex-direction: column;
    }

    .dealers-page .right-side{
        flex: 1;
        width: 100%;
    }

    .dealers-page .header .data-box{
        flex-direction: column;
        gap: 20px;
        align-items: baseline;
    }

    .vehicle-card .content .specs{
        display: block;
    }

    .select-box{
                width: 100%;
    }

    .select-box select{

    }

    .products-page .products-box h1{
        text-align: center;
    }

    .sort-options-list .container-radiobox .checkmark{
        top: 5px;
        left: 5px;
    }


    .btn-filter-apply{
        width: 100%;;
    }

    .single-row .input-box{
        width: 100%;
    }

    .ambassadors-cards .ambassadors-card{
        flex-direction: column;    
    }

    .ambassadors-cards .ambassadors-card .img-box img{
                width: 100%;
    }

    .hero-search .hero-search-buttons .categories-box button{
        padding: 0 12px;
        font-size: 10px;
    }

    .hero-search .hero-search-buttons .categories-box button img{
        width: 15px;
    }
    
}

/* ===== MOBILE ===== */
@media (max-width: 640px){
    .vehicle-carousel{
        --gap: 14px;
        --perView: 1.12;
    }

    .vehicle-carousel .carousel-viewport{
        padding-right: 18%;
    }

    .vehicle-carousel .carousel-arrow{
        display: none !important;
    }

    .vehicle-carousel .carousel-dots{
        margin-top: 18px;
    }

    .vehicle-carousel .vehicle-card{
        min-width: calc((100% - (var(--gap) * (var(--perView) - 1))) / var(--perView));
        max-width: calc((100% - (var(--gap) * (var(--perView) - 1))) / var(--perView));
    }

    
}

/* ===== TABLET ===== */
@media (min-width: 641px) and (max-width: 1024px){
    .vehicle-carousel{
        --gap: 18px;
        --perView: 2;
    }

    .vehicle-carousel .carousel-arrow.prev{
        left: -10px;
    }

    .vehicle-carousel .carousel-arrow.next{
        right: -10px;
    }

}

@media (max-width: 992px){
    .wish-list .vehicle-grid {
        grid-template-columns: 1fr;
    }
}

/* ── Dealer sekcija na TELEFONU: kartica trgovca LEVO, scroller z avti DESNO (ena vrsta) ──
   Prepiše zgornji column-layout (@max 992px) samo za telefone. */
@media (max-width: 640px){
    .dealer-cars-carousel .dealer-cars-carousel-inner{
        flex-direction: row;
        gap: 10px;
        align-items: stretch;   /* kartica trgovca enako visoka kot kartica oglasa */
    }

    /* kartica trgovca — kompaktna, levo (40 %); oglas dobi preostalih ~60 % */
    .dealer-cars-carousel .dealer-cars-carousel-inner .deal-cards-company{
        flex: 0 0 40%;
        max-width: 40%;
        min-width: 0;
        width: auto;
        height: auto;
        padding: 14px 10px;
        justify-content: center;
    }
    .dealer-cars-carousel .dealer-cars-carousel-inner .deal-cards-company .img-box{
        width: 64px;
        height: 64px;
        margin: 4px auto 8px;
    }
    .dealer-cars-carousel .dealer-cars-carousel-inner .deal-cards-company h2{
        font-size: 13px;
        line-height: 1.2;
    }
    .dealer-cars-carousel .dealer-cars-carousel-inner .deal-cards-company .content{
        padding: 0;
    }
    .dealer-cars-carousel .dealer-cars-carousel-inner .deal-cards-company .location{
        font-size: 11px;
        line-height: 1.25;
    }
    .dealer-cars-carousel .dealer-cars-carousel-inner .deal-cards-company a{
        font-size: 12px;
        height: auto;
        min-height: 34px;
        min-width: 0;              /* prepiši desktop min-width:100px */
        width: 100%;               /* prepiši desktop width:max-content (ta je delal overflow) */
        max-width: 100%;
        box-sizing: border-box;
        margin: 10px 0 0;          /* prepiši desktop margin:0 auto */
        padding: 6px 10px;
        white-space: normal;       /* dovoli prelom, če je besedilo predolgo */
        text-align: center;
        line-height: 1.15;
    }

    /* scroller z avti — zapolni preostanek desno (JS carousel, 1-po-1 s prstom/pikami) */
    .dealer-cars-carousel .dealer-cars-carousel-inner .vehicle-carousel{
        flex: 1 1 0;
        min-width: 0;
        width: auto;
    }

    /* MAX 1 vozilo — brez pokuka naslednje kartice. Scoped SAMO na .dealer-cars-carousel
       (vehicle_last scroller ohrani svoj peek). Dva vzroka:
       1) viewport ima padding-right:18% (mobile.css:935) — ravno ta kaže naslednji avto; odstranimo ga.
       2) perView=1 → kartica = 100% viewporta (namesto 1.12). */
    .dealer-cars-carousel .vehicle-carousel{
        --perView: 1 !important;
    }
    .dealer-cars-carousel .vehicle-carousel .carousel-viewport{
        padding-right: 0 !important;
    }
}
