/* =========================================================
   MOBILE HEADER / HERO FIX
   BikeMart.lk
   ========================================================= */

/* Remove old mobile search area completely */
.mobile-search-wrapper,
.mobile-search {
    display: none !important;
}


/* =========================================================
   MOBILE HEADER
   ========================================================= */

@media (max-width: 767px) {

    .main-header {
        height: auto !important;
        min-height: 0 !important;
    }

    .header-inner {
        min-height: 58px;
        height: 58px;
        box-sizing: border-box;
    }

    .hero {
        top: 58px !important;
    }

    .hero-content {
        margin-top: 0 !important;
    }

    .mobile-search-wrapper,
    .mobile-search-wrapper::before,
    .mobile-search-wrapper::after {
        height: 0 !important;
        min-height: 0 !important;
        margin: 0 !important;
        padding: 0 !important;
        border: 0 !important;
        overflow: hidden !important;
    }
}


/* =========================================================
   VERY SMALL PHONES
   ========================================================= */

@media (max-width: 380px) {

    .header-inner {
        height: 56px;
        min-height: 56px;
    }

    .hero {
        top: 56px !important;
    }

    .filter-sheet {
        max-height: 92vh;
    }

    .mobile-filters {
        padding: 14px 13px 18px;
    }
}


/* =========================================================
   MODEL AUTOCOMPLETE
   ========================================================= */

.model-autocomplete-wrapper,
.input-wrapper {
    position: relative;
}

.model-suggestions {
    position: absolute;
    left: 0;
    right: 0;
    top: calc(100% + 4px);
    width: 100%;
    max-height: 190px;
    overflow-y: auto;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 9px;
    box-shadow: 0 8px 25px rgba(0,0,0,.12);
    z-index: 10000;
    display: none;
    box-sizing: border-box;
}

.model-suggestion-item {
    display: block;
    width: 100%;
    padding: 10px 12px;
    background: #fff;
    border: 0;
    text-align: left;
    font-size: 13px;
    cursor: pointer;
    box-sizing: border-box;
}

.model-suggestion-item:hover {
    background: #f5f5f5;
}


/* =========================================================
   MOBILE FILTER SHEET
   ========================================================= */

@media (max-width: 767px) {

    .filter-overlay {
        position: fixed;
        inset: 0;
        width: 100%;
        height: 100%;
        background: rgba(0,0,0,.55);
        z-index: 9999;
        display: none;
        align-items: flex-end;
        overflow: hidden;
    }

    .filter-overlay.active {
        display: flex;
    }

    .filter-sheet {
        width: 100%;
        max-width: 100%;
        max-height: 88vh;
        background: #fff;
        border-radius: 18px 18px 0 0;
        padding: 0;
        display: flex;
        flex-direction: column;
        overflow: hidden;
        box-sizing: border-box;
    }

    .filter-sheet-header {
        flex: 0 0 auto;
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 16px 18px 13px;
        border-bottom: 1px solid #eee;
        background: #fff;
        box-sizing: border-box;
    }

    .mobile-filters {
        width: 100%;
        box-sizing: border-box;
        padding: 16px 16px 20px;
        overflow-y: auto;
        overflow-x: hidden;
        -webkit-overflow-scrolling: touch;
    }

    .mobile-filter-field {
        width: 100%;
        margin-bottom: 15px;
        box-sizing: border-box;
    }

    .mobile-filter-field label {
        display: block;
        margin-bottom: 7px;
        font-size: 12px;
        font-weight: 600;
    }

    .mobile-filter-field .select-wrapper,
    .mobile-filter-field .input-wrapper {
        position: relative;
        width: 100%;
        box-sizing: border-box;
    }

    .mobile-filter-field select,
    .mobile-filter-field input {
        width: 100%;
        max-width: 100%;
        height: 46px;
        box-sizing: border-box;
        border: 1px solid #ddd;
        border-radius: 9px;
        background: #fff;
        font-family: inherit;
        font-size: 13px;
        outline: none;
    }

    .mobile-filter-field select {
        appearance: none;
        -webkit-appearance: none;
        padding: 0 38px 0 13px;
    }

    .mobile-filter-field input {
        padding: 0 12px 0 40px;
    }

    .range-fields {
        width: 100%;
        display: grid;
        grid-template-columns: minmax(0,1fr) 25px minmax(0,1fr);
        align-items: center;
        box-sizing: border-box;
    }

    .range-fields input {
        width: 100%;
        min-width: 0;
        padding: 0 10px;
    }

    .filter-sheet-buttons {
        width: 100%;
        display: grid;
        grid-template-columns: 90px minmax(0,1fr);
        gap: 9px;
        margin-top: 5px;
        box-sizing: border-box;
    }
}


/* =========================================================
   HEADER
   ========================================================= */

.main-header .header-inner {
    display: flex !important;
    align-items: center !important;
}

.main-header .logo {
    flex-shrink: 0 !important;
}

.main-header .header-actions {
    margin-left: auto !important;
    display: flex !important;
    align-items: center !important;
    gap: 20px !important;
}

.main-header .login-btn,
.main-header [data-auth-login] {
    white-space: nowrap !important;
}

.main-header .post-bike-btn,
.main-header [data-auth-post] {
    white-space: nowrap !important;
}

@media (max-width: 767px) {

    .main-header .header-inner {
        padding-left: 16px !important;
        padding-right: 16px !important;
    }

    .main-header .header-actions {
        margin-left: auto !important;
        gap: 8px !important;
    }
}


/* =========================================================
   HERO SEARCH
   ========================================================= */

.hero-desktop-filters {
    padding: 12px 18px !important;
    gap: 14px !important;
}

.hero-desktop-filters .filter-field > label {
    color: #fff !important;
    font-size: 15px !important;
    font-weight: 600 !important;
    margin-bottom: 7px !important;
}

.hero-desktop-filters input,
.hero-desktop-filters select {
    font-size: 15px !important;
}

.hero-desktop-filters input::placeholder {
    font-size: 15px !important;
    color: #777 !important;
    opacity: 1 !important;
}

.hero-desktop-filters .range-fields input::placeholder {
    font-size: 15px !important;
}

.hero-desktop-filters .filter-search-btn {
    font-size: 15px !important;
}


/* =========================================================
   DESKTOP AUTOCOMPLETE
   ========================================================= */

.hero-desktop-filters .model-suggestions {
    position: absolute !important;
    left: 0 !important;
    right: 0 !important;
    top: calc(100% + 4px) !important;

    background: #fff !important;
    border: 1px solid #ddd !important;
    border-radius: 8px !important;

    box-shadow: 0 8px 25px rgba(0,0,0,.12) !important;

    max-height: 280px !important;
    overflow-y: auto !important;

    z-index: 99999 !important;
}

.hero-desktop-filters .model-suggestion-item {
    padding: 11px 14px !important;

    color: #111 !important;
    background: #fff !important;

    font-size: 15px !important;
    font-weight: 500 !important;

    cursor: pointer !important;

    border-bottom: 1px solid #eee !important;
}

.hero-desktop-filters .model-suggestion-item:hover {
    background: #f5f5f5 !important;
}

.hero-desktop-filters .model-suggestion-item strong {
    font-weight: 700 !important;
}

.autocomplete-loading,
.autocomplete-no-results {
    padding: 12px 14px !important;
    color: #555 !important;
    font-size: 14px !important;
}

.autocomplete-loading i {
    margin-right: 6px;
}


/* =========================================================
   MOBILE AUTOCOMPLETE
   ========================================================= */

.mobile-filter-field .model-suggestions {
    position: absolute !important;
    left: 0 !important;
    right: 0 !important;
    top: calc(100% + 4px) !important;

    background: #fff !important;
    border: 1px solid #ddd !important;
    border-radius: 8px !important;

    box-shadow: 0 8px 25px rgba(0,0,0,.12) !important;

    max-height: 250px !important;
    overflow-y: auto !important;

    z-index: 99999 !important;
}

.mobile-filter-field .model-suggestion-item {
    padding: 11px 14px !important;
    color: #111 !important;
    background: #fff !important;
    font-size: 15px !important;
    cursor: pointer !important;
    border-bottom: 1px solid #eee !important;
}

.mobile-filter-field .model-suggestion-item:hover {
    background: #f5f5f5 !important;
}


/* =========================================================
   MOBILE FILTER FONT SIZE
   ========================================================= */

@media (max-width: 767px) {

    .mobile-filter-field label {
        font-size: 15px !important;
        font-weight: 600 !important;
    }

    .mobile-filter-field input,
    .mobile-filter-field select {
        font-size: 16px !important;
    }

    .mobile-filter-field input::placeholder {
        font-size: 15px !important;
    }

    .mobile-filter-field .range-fields input {
        font-size: 15px !important;
    }

    .mobile-filter-field .model-suggestion-item {
        font-size: 16px !important;
        padding: 12px 14px !important;
    }

    .mobile-filter-field .autocomplete-loading,
    .mobile-filter-field .autocomplete-no-results {
        font-size: 15px !important;
    }

    .mobile-filter-field button,
    .mobile-filter-actions button {
        font-size: 16px !important;
    }
}

/* =========================================================
   HOME LATEST MOTORBIKES
   DESKTOP - 2 EQUAL COLUMNS
   ========================================================= */

@media (min-width: 768px) {

    /* SECTION */
    .home-bikes-section {
        width: 100% !important;
        max-width: 1200px !important;

        margin-left: auto !important;
        margin-right: auto !important;

        box-sizing: border-box !important;
    }


    /* HEADER */
    .home-bikes-section .home-section-header {
        width: 100% !important;
        margin-bottom: 18px !important;
    }


    /* IMPORTANT:
       REMOVE OLD MAX WIDTH
    */
    .home-bikes-section .bike-listing-feed {
        display: grid !important;

        grid-template-columns:
            repeat(2, minmax(0, 1fr)) !important;

        gap: 20px !important;

        width: 100% !important;

        max-width: none !important;

        margin: 0 !important;
        padding: 0 !important;

        box-sizing: border-box !important;
    }


    /* =====================================================
       CARD
       ===================================================== */

    .home-bikes-section .bike-list-item {

        display: flex !important;

        width: 100% !important;
        min-width: 0 !important;

        height: 160px !important;

        box-sizing: border-box !important;

        background: #fff !important;

        border: 1px solid #e1e1e1 !important;
        border-radius: 7px !important;

        overflow: hidden !important;

        text-decoration: none !important;
        color: inherit !important;

        cursor: pointer !important;

        transform: none !important;
        transition: none !important;
        box-shadow: none !important;
    }


    /* NO HOVER ANIMATION */

    .home-bikes-section .bike-list-item:hover {
        transform: none !important;
        box-shadow: none !important;
        border-color: #e1e1e1 !important;
        background: #fff !important;
    }


    /* =====================================================
       IMAGE
       ===================================================== */

    .home-bikes-section .bike-list-image {

        flex: 0 0 32% !important;

        width: 32% !important;

        height: 160px !important;

        min-width: 0 !important;

        position: relative !important;

        overflow: hidden !important;

        background: #f7f7f7 !important;

        display: flex !important;

        align-items: center !important;
        justify-content: center !important;

        box-sizing: border-box !important;
    }


    .home-bikes-section .bike-list-image img {

        display: block !important;

        width: 100% !important;
        height: 100% !important;

        object-fit: contain !important;

        object-position: center !important;

        padding: 3px !important;

        box-sizing: border-box !important;

        transform: none !important;
        transition: none !important;
    }


    .home-bikes-section
    .bike-list-item:hover
    .bike-list-image img {

        transform: none !important;
    }


    /* =====================================================
       DETAILS
       ===================================================== */

    .home-bikes-section .bike-list-details {

        flex: 1 1 auto !important;

        width: 68% !important;

        height: 160px !important;

        min-width: 0 !important;

        padding: 12px 15px !important;

        box-sizing: border-box !important;

        display: flex !important;

        flex-direction: column !important;

        align-items: flex-start !important;
    }


    /* TITLE */

    .home-bikes-section .bike-list-title {

        width: 100% !important;

        margin: 0 0 5px 0 !important;
        padding: 0 !important;

        font-size: 17px !important;

        line-height: 1.25 !important;

        font-weight: 700 !important;

        color: #111 !important;

        white-space: normal !important;

        overflow-wrap: break-word !important;
    }


    /* LOCATION */

    .home-bikes-section .bike-list-location {

        width: 100% !important;

        margin: 0 0 11px 0 !important;
        padding: 0 !important;

        font-size: 13px !important;

        line-height: 1.3 !important;

        color: #777 !important;
    }


    .home-bikes-section .bike-list-location i {
        color: #ed3348 !important;
        margin-right: 4px !important;
    }


    /* SPECS */

    .home-bikes-section .bike-list-specs {

        display: flex !important;

        align-items: center !important;

        flex-wrap: wrap !important;

        gap: 6px 12px !important;

        width: 100% !important;

        margin: 0 !important;
        padding: 0 !important;

        border: 0 !important;
    }


    .home-bikes-section .bike-list-specs span {

        display: inline-flex !important;

        align-items: center !important;

        gap: 4px !important;

        font-size: 12px !important;

        line-height: 1.3 !important;

        color: #666 !important;

        white-space: nowrap !important;
    }


    .home-bikes-section .bike-list-specs i {
        color: #888 !important;
        font-size: 11px !important;
    }


    /* =====================================================
       DATE + PRICE
       ===================================================== */

    .home-bikes-section .bike-list-bottom {

        display: flex !important;

        align-items: center !important;

        justify-content: space-between !important;

        gap: 8px !important;

        width: 100% !important;

        margin-top: auto !important;

        padding-top: 8px !important;

        border-top: 1px solid #eeeeee !important;

        box-sizing: border-box !important;
    }


    .home-bikes-section .bike-posted {

        display: inline-flex !important;

        align-items: center !important;

        gap: 4px !important;

        font-size: 11px !important;

        line-height: 1.2 !important;

        color: #888 !important;

        white-space: nowrap !important;
    }


    .home-bikes-section .bike-posted i {
        font-size: 10px !important;
        color: #999 !important;
    }


    /* PRICE */

    .home-bikes-section .bike-list-price {

        display: block !important;

        width: auto !important;

        margin: 0 !important;
        padding: 0 !important;

        font-size: 16px !important;

        line-height: 1.2 !important;

        font-weight: 700 !important;

        color: #111 !important;

        white-space: nowrap !important;
    }


    /* REMOVE DETAILS LINK */

    .home-bikes-section .bike-view-link {
        display: none !important;
    }


    /* FEATURED */

    .home-bikes-section .featured-badge {

        position: absolute !important;

        top: 7px !important;
        left: 7px !important;

        z-index: 5 !important;

        padding: 3px 6px !important;

        background: #ed3348 !important;

        color: #fff !important;

        border-radius: 3px !important;

        font-size: 9px !important;

        line-height: 1.2 !important;

        font-weight: 700 !important;

        text-transform: uppercase !important;
    }

}