/* Minh Tâm Bảo - Global header search V1 */
.mtb-header-search {
    position: relative;
    margin-left: 10px;
}

.mtb-header-search__form {
    width: 230px;
    height: 40px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 10px;
    border: 1px solid rgba(20,45,39,.14);
    border-radius: 12px;
    background: #f8f9f7;
    transition: border-color .2s ease, box-shadow .2s ease, background .2s ease;
}

.mtb-header-search__form:focus-within {
    border-color: #b99552;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(185,149,82,.12);
}

.mtb-header-search__icon {
    flex: 0 0 auto;
    color: #9b7a3e;
    font-size: .9rem;
}

.mtb-header-search__input {
    width: 100%;
    min-width: 0;
    border: 0;
    outline: 0;
    padding: 0;
    background: transparent;
    color: #142d27;
    font-size: .84rem;
}

.mtb-header-search__input::placeholder {
    color: #84938e;
}

.mtb-header-search__submit,
.mtb-header-search__mobile-toggle {
    border: 0;
    background: transparent;
    color: #17392f;
    cursor: pointer;
}

.mtb-header-search__submit {
    display: none;
}

.mtb-header-search__results {
    position: absolute;
    z-index: 1200;
    top: calc(100% + 10px);
    right: 0;
    width: min(430px, calc(100vw - 24px));
    max-height: min(70vh, 620px);
    overflow-y: auto;
    border: 1px solid rgba(20,45,39,.10);
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 22px 60px rgba(20,45,39,.18);
}

.mtb-header-search__results[hidden] {
    display: none !important;
}

.mtb-search-state {
    padding: 18px;
    color: #65756f;
    font-size: .88rem;
    text-align: center;
}

.mtb-search-group + .mtb-search-group {
    border-top: 1px solid rgba(20,45,39,.08);
}

.mtb-search-group__title {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px 7px;
    color: #9b7a3e;
    font-size: .72rem;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.mtb-search-result {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 10px 14px;
    color: #17392f;
    text-decoration: none;
    transition: background .18s ease;
}

.mtb-search-result:hover,
.mtb-search-result:focus {
    background: #f7f5ef;
    color: #17392f;
}

.mtb-search-result__image {
    width: 54px;
    height: 54px;
    flex: 0 0 54px;
    object-fit: cover;
    border-radius: 11px;
    background: #f3f1e9;
}

.mtb-search-result__body {
    min-width: 0;
    flex: 1;
}

.mtb-search-result__title {
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    font-size: .88rem;
    font-weight: 700;
    line-height: 1.35;
}

.mtb-search-result__meta {
    margin-top: 4px;
    color: #7b8a84;
    font-size: .75rem;
}

.mtb-search-result__price {
    color: #9b7a3e;
    font-weight: 800;
}

.mtb-search-view-all {
    display: block;
    padding: 12px 14px;
    border-top: 1px solid rgba(20,45,39,.08);
    color: #17392f;
    text-align: center;
    font-size: .82rem;
    font-weight: 800;
    text-decoration: none;
}

.mtb-search-view-all:hover {
    color: #9b7a3e;
    background: #fbfaf6;
}

.mtb-header-search__mobile-toggle {
    display: none;
    width: 40px;
    height: 40px;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: #f7f8f6;
    border: 1px solid rgba(20,45,39,.12);
}

.mtb-header-search-mobile-panel {
    display: none;
}

@media (max-width: 1199px) and (min-width: 992px) {
    .mtb-header-search__form {
        width: 170px;
    }

    .mtb-navbar__nav {
        gap: 0;
    }

    .mtb-navbar__link {
        padding-left: 9px;
        padding-right: 9px;
        font-size: .9rem;
    }

    .mtb-language-switcher {
        margin-left: 7px;
        padding-left: 7px;
    }

    .mtb-language-switcher select {
        max-width: 125px;
    }
}

@media (max-width: 991px) {
    .mtb-header-search--desktop {
        display: none;
    }

    .mtb-header-search__mobile-toggle {
        display: inline-flex;
    }

    .mtb-header-search-mobile-panel {
        position: absolute;
        z-index: 1190;
        top: 100%;
        left: 0;
        right: 0;
        padding: 12px 16px 16px;
        background: #fff;
        border-top: 1px solid rgba(20,45,39,.08);
        box-shadow: 0 14px 28px rgba(20,45,39,.12);
    }

    .mtb-header-search-mobile-panel.is-open {
        display: block;
    }

    .mtb-header-search-mobile-panel .mtb-header-search {
        margin: 0;
    }

    .mtb-header-search-mobile-panel .mtb-header-search__form {
        width: 100%;
        height: 46px;
    }

    .mtb-header-search-mobile-panel .mtb-header-search__results {
        position: static;
        width: 100%;
        max-height: 58vh;
        margin-top: 8px;
        box-shadow: none;
        border-radius: 14px;
    }
}

@media (max-width: 575px) {
    .mtb-header-search__mobile-toggle {
        width: 38px;
        height: 38px;
    }

    .mtb-header-search-mobile-panel {
        padding: 10px 10px 14px;
    }
}
