/* ============================================================
   AJAX SEARCH
============================================================ */

.search-bar {
    position: relative;
}

.telecom-search-form {
    width: 100%;
    display: flex;
    align-items: center;
}

.telecom-search-form input {
    width: 100%;
}

/* Lock background when search dropdown is open */
body.search-dropdown-open {
    overflow: hidden;
}

/* Search results can still scroll */
.search-results {
    max-height: calc(100vh - 180px);
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}

/* ============================================================
   SEARCH DROPDOWN
============================================================ */

.search-results-dropdown {
    position: absolute;

    top: calc(100% + 10px);
    left: 0;
    right: 0;

    background: #fff;

    border: 1px solid #e5e7eb;
    border-radius: 14px;

    box-shadow:
        0 15px 40px rgba(0, 0, 0, 0.12);

    overflow: hidden;

    z-index: 99999;

    display: none;

    max-height: 520px;
    overflow-y: auto;
}

.search-results-dropdown.active {
    display: block;
}


/* ============================================================
   PRODUCT RESULT
============================================================ */

.ajax-search-product {
    display: flex;

    align-items: center;

    gap: 14px;

    padding: 13px 15px;

    text-decoration: none;

    color: inherit;

    border-bottom: 1px solid #f0f0f0;

    transition:
        background .15s ease;
}

.ajax-search-product:hover {
    background: #f7f7f7;
}


/* ============================================================
   IMAGE
============================================================ */

.ajax-search-image {
    width: 55px;
    height: 55px;

    flex: 0 0 55px;

    display: flex;

    align-items: center;
    justify-content: center;

    background: #f7f7f7;

    border-radius: 8px;

    overflow: hidden;
}

.ajax-search-image img {
    width: 100%;
    height: 100%;

    object-fit: contain;
}


/* ============================================================
   INFO
============================================================ */

.ajax-search-info {
    min-width: 0;
    flex: 1;
}

.ajax-search-name {
    font-size: 14px;
    font-weight: 600;

    color: #222;

    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ajax-search-brand {
    margin-top: 3px;

    font-size: 12px;

    color: #777;
}

.ajax-search-specs {
    margin-top: 3px;

    font-size: 11px;

    color: #999;
}


/* ============================================================
   PRICE
============================================================ */

.ajax-search-price {
    flex-shrink: 0;

    font-size: 13px;

    font-weight: 700;

    color: #F37835;
}


/* ============================================================
   VIEW ALL
============================================================ */

.ajax-search-view-all {
    display: flex;

    align-items: center;
    justify-content: space-between;

    gap: 10px;

    padding: 15px;

    text-decoration: none;

    color: #F37835;

    font-size: 13px;

    font-weight: 500;

    background: #fff;
}

.ajax-search-view-all:hover {
    background: #f8f8f8;
}

.ajax-search-view-all i {
    font-size: 12px;
}


/* ============================================================
   LOADING
============================================================ */

.search-loading {
    display: flex;

    align-items: center;

    justify-content: center;

    gap: 10px;

    padding: 25px;

    color: #777;

    font-size: 13px;
}


/* ============================================================
   NO RESULTS
============================================================ */

.search-no-results {
    display: flex;

    align-items: center;

    justify-content: center;

    gap: 10px;

    padding: 30px;

    color: #777;

    font-size: 13px;
}


/* ============================================================
   MOBILE
============================================================ */

@media (max-width: 767px) {
    body.search-dropdown-open {
        overflow: hidden;
    }

    #telecomSearchResults {
        max-height: calc(100vh - 280px);
        overflow-y: auto;
        overscroll-behavior: contain;
        -webkit-overflow-scrolling: touch;
    }


    .search-results-dropdown {
        position: fixed;

        top: 150px;

        left: 12px;
        right: 12px;

        width: auto;

        max-height: calc(100vh - 90px);
    }

    .ajax-search-product {
        padding: 12px;
    }

    .ajax-search-image {
        width: 48px;
        height: 48px;

        flex-basis: 48px;
    }

    .ajax-search-price {
        font-size: 12px;
    }

}