/**
 * Yoginee Elasticsearch Frontend Search
 *
 * Compatible with:
 * - PrestaShop 1.7.6+
 * - Responsive desktop/mobile themes
 */

.yoginee-elastic-search {
    position: relative;
    width: 100%;
    max-width: 760px;
    z-index: 1000;
}

.yoginee-elastic-search__form {
    position: relative;
    width: 100%;
    margin: 0;
}

.yoginee-elastic-search__field {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
    min-height: 46px;
    border: 1px solid #d9dee7;
    border-radius: 8px;
    background: #fff;
    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease;
}


.yoginee-elastic-search__timing {
    min-height: 18px;
    margin-top: 5px;
    padding-right: 4px;
    color: #5f6b76;
    font-size: 11px;
    line-height: 16px;
    text-align: right;
}

.yoginee-elastic-search__timing strong {
    color: #2b879b;
    font-weight: 700;
}

.yoginee-elastic-search__timing.is-fast strong {
    color: #2e8b57;
}

.yoginee-elastic-search__field:focus-within {
    border-color: #2fb5d2;
    box-shadow: 0 0 0 3px rgba(47, 181, 210, 0.14);
}

.yoginee-elastic-search__input {
    width: 100%;
    min-width: 0;
    height: 44px;
    padding: 0 92px 0 16px;
    border: 0;
    outline: 0;
    color: #232323;
    background: transparent;
    font-size: 14px;
    line-height: 44px;
    box-shadow: none;
}

.yoginee-elastic-search__input::-webkit-search-cancel-button,
.yoginee-elastic-search__input::-webkit-search-decoration {
    display: none;
    appearance: none;
}

.yoginee-elastic-search__input::placeholder {
    color: #8b929d;
    opacity: 1;
}

.yoginee-elastic-search__clear,
.yoginee-elastic-search__submit {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    border: 0;
    outline: 0;
    cursor: pointer;
}

.yoginee-elastic-search__clear {
    right: 50px;
    width: 30px;
    height: 30px;
    align-items: center;
    justify-content: center;
    padding: 0;
    border-radius: 50%;
    color: #6c757d;
    background: transparent;
    font-size: 23px;
    line-height: 1;
}

.yoginee-elastic-search__clear:hover,
.yoginee-elastic-search__clear:focus {
    color: #232323;
    background: #f1f3f6;
}

.yoginee-elastic-search__submit {
    right: 4px;
    width: 42px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border-radius: 6px;
    color: #fff;
    background: #2fb5d2;
    transition:
        background-color 0.2s ease,
        transform 0.2s ease;
}

.yoginee-elastic-search__submit:hover,
.yoginee-elastic-search__submit:focus {
    color: #fff;
    background: #2598b1;
}

.yoginee-elastic-search__submit:active {
    transform: translateY(-50%) scale(0.96);
}

.yoginee-elastic-search__submit .material-icons {
    font-size: 22px;
    line-height: 1;
}

.yoginee-elastic-search__dropdown {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    overflow: hidden;
    border: 1px solid #e3e6eb;
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 16px 40px rgba(30, 41, 59, 0.16);
}

.yoginee-elastic-search__loading {
    min-height: 68px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 18px;
    color: #69707a;
    font-size: 14px;
}

.yoginee-elastic-search__spinner {
    width: 20px;
    height: 20px;
    display: inline-block;
    border: 2px solid #d9dee7;
    border-top-color: #2fb5d2;
    border-radius: 50%;
    animation: yoginee-elastic-search-spin 0.7s linear infinite;
}

@keyframes yoginee-elastic-search-spin {
    to {
        transform: rotate(360deg);
    }
}

.yoginee-elastic-search__message {
    padding: 18px;
    color: #68707c;
    text-align: center;
    font-size: 14px;
}

.yoginee-elastic-search__message--error {
    color: #a94442;
    background: #fff5f5;
}

.yoginee-elastic-search__message--empty {
    color: #7a6316;
    background: #fffdf1;
}

.yoginee-elastic-search__suggestions {
    max-height: 440px;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.yoginee-elastic-search__item {
    display: grid;
    grid-template-columns: 58px minmax(0, 1fr) auto;
    gap: 13px;
    align-items: center;
    min-height: 76px;
    padding: 10px 14px;
    border-bottom: 1px solid #edf0f4;
    color: #232323;
    text-decoration: none;
    background: #fff;
    transition:
        background-color 0.16s ease,
        box-shadow 0.16s ease;
}

.yoginee-elastic-search__item:last-child {
    border-bottom: 0;
}

.yoginee-elastic-search__item:hover,
.yoginee-elastic-search__item:focus,
.yoginee-elastic-search__item.is-active {
    color: #232323;
    text-decoration: none;
    background: #f6fbfc;
    box-shadow: inset 3px 0 0 #2fb5d2;
}

.yoginee-elastic-search__image {
    width: 58px;
    height: 58px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border: 1px solid #edf0f4;
    border-radius: 7px;
    background: #f7f8fa;
}

.yoginee-elastic-search__image img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: contain;
}

.yoginee-elastic-search__image-placeholder {
    width: 26px;
    height: 26px;
    display: block;
    border: 2px solid #cfd5dd;
    border-radius: 5px;
    position: relative;
}

.yoginee-elastic-search__image-placeholder::after {
    content: "";
    position: absolute;
    left: 5px;
    right: 5px;
    bottom: 5px;
    height: 8px;
    border-radius: 2px;
    background: #cfd5dd;
    transform: skewX(-18deg);
}

.yoginee-elastic-search__content {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.yoginee-elastic-search__name {
    overflow: hidden;
    color: #232323;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.35;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.yoginee-elastic-search__name mark {
    padding: 0;
    color: inherit;
    background: #fff1a8;
    font-weight: 700;
}

.yoginee-elastic-search__manufacturer,
.yoginee-elastic-search__reference {
    overflow: hidden;
    color: #7b828c;
    font-size: 12px;
    line-height: 1.3;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.yoginee-elastic-search__reference::before {
    content: "SKU: ";
    font-weight: 600;
}

.yoginee-elastic-search__meta {
    min-width: 94px;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 5px;
    text-align: right;
}

.yoginee-elastic-search__price {
    color: #232323;
    font-size: 14px;
    font-weight: 700;
    white-space: nowrap;
}

.yoginee-elastic-search__stock {
    display: inline-flex;
    align-items: center;
    padding: 3px 7px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 700;
    line-height: 1.2;
    white-space: nowrap;
}

.yoginee-elastic-search__stock.is-in-stock {
    color: #157347;
    background: #e8f7ef;
}

.yoginee-elastic-search__stock.is-out-of-stock {
    color: #a23b3b;
    background: #fceaea;
}

.yoginee-elastic-search__view-all {
    min-height: 46px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 11px 16px;
    border-top: 1px solid #e9edf1;
    color: #2b879b;
    text-decoration: none;
    background: #f8fbfc;
    font-size: 13px;
    font-weight: 700;
    transition:
        color 0.16s ease,
        background-color 0.16s ease;
}

.yoginee-elastic-search__view-all:hover,
.yoginee-elastic-search__view-all:focus {
    color: #1d6574;
    text-decoration: none;
    background: #eff8fa;
}

.yoginee-elastic-search__view-all .material-icons {
    font-size: 18px;
}

@media (max-width: 767px) {
    .yoginee-elastic-search {
        max-width: none;
    }

    .yoginee-elastic-search__field {
        min-height: 44px;
        border-radius: 6px;
    }

    .yoginee-elastic-search__input {
        height: 42px;
        padding-left: 13px;
        font-size: 16px;
        line-height: 42px;
    }

    .yoginee-elastic-search__dropdown {
        position: fixed;
        top: auto;
        left: 10px;
        right: 10px;
        max-height: min(70vh, 560px);
    }

    .yoginee-elastic-search__suggestions {
        max-height: calc(min(70vh, 560px) - 48px);
    }

    .yoginee-elastic-search__item {
        grid-template-columns: 52px minmax(0, 1fr);
        min-height: 70px;
        padding: 9px 11px;
    }

    .yoginee-elastic-search__image {
        width: 52px;
        height: 52px;
    }

    .yoginee-elastic-search__meta {
        grid-column: 2;
        min-width: 0;
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        text-align: left;
    }
}

@media (max-width: 420px) {
    .yoginee-elastic-search__manufacturer {
        display: none;
    }

    .yoginee-elastic-search__stock {
        display: none;
    }
}