/* =========================================================
   MYM ARCHIVE AJAX SEARCH
   Dropdown enhancement only — existing archive layout untouched
========================================================= */

.mym-ajax-search-host {
    position: relative !important;
    overflow: visible !important;
}

.mym-ajax-search-dropdown[hidden] {
    display: none !important;
}

.mym-ajax-search-dropdown {
    position: absolute;
    z-index: 999999;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    width: 100%;
    max-height: min(620px, 72vh);
    overflow: auto;
    overscroll-behavior: contain;
    border: 1px solid #dbe5ed;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 24px 60px rgba(3, 31, 57, .20);
    -webkit-overflow-scrolling: touch;
}

.mym-ajax-search-results {
    display: block;
}

.mym-ajax-search-result {
    display: grid;
    grid-template-columns: 66px minmax(0, 1fr) auto;
    align-items: center;
    gap: 14px;
    min-height: 86px;
    padding: 10px 14px;
    border-bottom: 1px solid #edf2f5;
    color: #071c33 !important;
    text-decoration: none !important;
    background: #fff;
    transition: background-color .18s ease, transform .18s ease;
}

.mym-ajax-search-result:hover,
.mym-ajax-search-result:focus {
    background: #f3f9fd;
    outline: none;
}

.mym-ajax-search-result__image {
    display: grid;
    place-items: center;
    width: 66px;
    height: 66px;
    overflow: hidden;
    border: 1px solid #e5edf2;
    border-radius: 9px;
    background: #f8fafc;
}

.mym-ajax-search-result__image img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.mym-ajax-search-result__copy {
    min-width: 0;
}

.mym-ajax-search-result__copy strong {
    display: block;
    overflow: hidden;
    color: #071c33;
    font-size: 13px;
    line-height: 1.35;
    font-weight: 850;
    text-overflow: ellipsis;
}

.mym-ajax-search-result__copy small {
    display: block;
    margin-top: 5px;
    color: #6f7f8c;
    font-size: 9px;
    line-height: 1.25;
    font-weight: 800;
    letter-spacing: .04em;
}

.mym-ajax-search-result__side {
    min-width: 105px;
    text-align: right;
}

.mym-ajax-search-result__price {
    display: block;
    color: #005da3;
    font-size: 12px;
    line-height: 1.2;
    font-weight: 900;
}

.mym-ajax-search-result__price .amount,
.mym-ajax-search-result__price bdi {
    color: inherit !important;
    font-weight: inherit !important;
}

.mym-ajax-search-result__stock {
    display: inline-block;
    margin-top: 6px;
    padding: 4px 7px;
    border-radius: 999px;
    font-size: 7px;
    line-height: 1;
    font-weight: 900;
    letter-spacing: .06em;
}

.mym-ajax-search-result__stock.is-in-stock {
    color: #08743a;
    background: #eaf8f0;
}

.mym-ajax-search-result__stock.is-out-of-stock {
    color: #a20e15;
    background: #fff0f1;
}

.mym-ajax-search-state {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 78px;
    padding: 18px;
    color: #08233f;
    text-align: center;
}

.mym-ajax-search-state strong {
    font-size: 10px;
    font-weight: 900;
    letter-spacing: .06em;
}

.mym-ajax-search-state--empty {
    flex-direction: column;
    gap: 5px;
}

.mym-ajax-search-state--empty small {
    color: #7b8995;
    font-size: 10px;
}

.mym-ajax-search-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid #d9e8f3;
    border-top-color: #0084ff;
    border-radius: 50%;
    animation: mymAjaxSearchSpin .7s linear infinite;
}

.mym-ajax-search-view-all {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    min-height: 48px;
    padding: 12px 16px;
    border: 0;
    border-radius: 0 0 13px 13px;
    background: #061f3a;
    color: #fff;
    cursor: pointer;
    font-size: 9px;
    font-weight: 900;
    letter-spacing: .06em;
    text-align: left;
}

.mym-ajax-search-view-all:hover,
.mym-ajax-search-view-all:focus {
    background: #005da3;
    color: #fff;
    outline: none;
}

.mym-ajax-search-view-all b {
    font-size: 18px;
    line-height: 1;
}

@keyframes mymAjaxSearchSpin {
    to { transform: rotate(360deg); }
}

@media (max-width: 767px) {
    .mym-ajax-search-dropdown {
        max-height: min(540px, 68vh);
        border-radius: 12px;
    }

    .mym-ajax-search-result {
        grid-template-columns: 56px minmax(0, 1fr);
        gap: 11px;
        min-height: 76px;
        padding: 10px;
    }

    .mym-ajax-search-result__image {
        width: 56px;
        height: 56px;
    }

    .mym-ajax-search-result__copy strong {
        font-size: 11px;
    }

    .mym-ajax-search-result__side {
        grid-column: 2;
        min-width: 0;
        margin-top: -3px;
        text-align: left;
    }

    .mym-ajax-search-result__price,
    .mym-ajax-search-result__stock {
        display: inline-block;
        margin-right: 7px;
    }
}
