/* Manticore Search — live suggest (Ozon / Yandex Market style) */

.mcs-suggest {
    position: absolute;
    z-index: 10050;
    left: 0;
    right: 0;
    top: calc(100% + 6px);
    background: #fff;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 12px;
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.12), 0 2px 6px rgba(0, 0, 0, 0.06);
    overflow: hidden;
    font: 14px / 1.35 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
}

.mcs-overflow {
    overflow-y: auto;
    color: #1a1a1a;
    max-height: 34rem;
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 0, 0, 0.2) transparent;
}

.mcs-overflow::-webkit-scrollbar {
    width: 5px;
}

.mcs-overflow::-webkit-scrollbar-track {
    background: transparent;
    margin: 10px 0;
}

.mcs-overflow::-webkit-scrollbar-thumb {
    background-color: rgba(0, 0, 0, 0.16);
    border-radius: 999px;
}

.mcs-overflow::-webkit-scrollbar-thumb:hover {
    background-color: rgba(0, 0, 0, 0.28);
}

.mcs-overflow::-webkit-scrollbar-thumb:active {
    background-color: rgba(0, 0, 0, 0.36);
}

.mcs-suggest__list {
    padding: 6px 0;
}

.mcs-suggest__item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 14px;
    text-decoration: none;
    color: inherit;
    transition: background 0.12s ease;
}

.mcs-suggest__item:hover,
.mcs-suggest__item.is-active {
    background: #f5f7fa;
}

.mcs-suggest__image {
    flex: 0 0 56px;
    width: 56px;
    height: 56px;
    border-radius: 8px;
    background: #f3f4f6;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mcs-suggest__image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.mcs-suggest__body {
    flex: 1 1 auto;
    min-width: 0;
}

.mcs-suggest__title {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-size: 14px;
    font-weight: 400;
    color: #1a1a1a;
}

.mcs-suggest__price {
    margin-top: 4px;
    font-size: 15px;
    font-weight: 700;
    color: #1a1a1a;
}

.mcs-suggest__footer {
    border-top: 1px solid #eef0f3;
    padding: 10px 14px;
    background: #fafbfc;
}

.mcs-suggest__all {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    font-weight: 600;
    color: #005bff;
    text-decoration: none;
}

.mcs-suggest__all:hover {
    color: #0047cc;
}

.mcs-suggest__empty {
    padding: 16px 14px;
    color: #6b7280;
    font-size: 14px;
}

.mcs-suggest__loading {
    padding: 14px;
    color: #9ca3af;
    font-size: 13px;
}

.mcs-suggest__section {
    padding: 6px 0;
}

.mcs-suggest__section + .mcs-suggest__section {
    border-top: 1px solid #eef0f3;
}

.mcs-suggest__section-title {
    padding: 6px 14px 4px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #9ca3af;
}

.mcs-suggest__history-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 14px;
    text-decoration: none;
    color: inherit;
    transition: background 0.12s ease;
}

.mcs-suggest__history-item:hover,
.mcs-suggest__history-item.is-active {
    background: #f5f7fa;
}

.mcs-suggest__history-icon {
    flex: 0 0 16px;
    width: 16px;
    height: 16px;
    opacity: 0.45;
    background: center / contain no-repeat url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2'%3E%3Cpath d='M3 12a9 9 0 1 0 3-6.7'/%3E%3Cpolyline points='3 4 3 9 8 9'/%3E%3C/svg%3E");
}

.mcs-suggest__history-icon--popular {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2'%3E%3Cpath d='M12 2l2.4 7.4H22l-6 4.6 2.3 7-6.3-4.6L5.7 21l2.3-7-6-4.6h7.6z'/%3E%3C/svg%3E");
}

.mcs-suggest__history-text {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 14px;
}

.mcs-suggest__history-count {
    flex: 0 0 auto;
    font-size: 12px;
    color: #9ca3af;
    white-space: nowrap;
}

.mcs-suggest__query-item,
.mcs-suggest__entity-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 14px;
    text-decoration: none;
    color: inherit;
    transition: background 0.12s ease;
}

.mcs-suggest__query-item:hover,
.mcs-suggest__query-item.is-active,
.mcs-suggest__entity-item:hover,
.mcs-suggest__entity-item.is-active {
    background: #f5f7fa;
}

.mcs-suggest__query-icon {
    flex: 0 0 16px;
    width: 16px;
    height: 16px;
    opacity: 0.45;
    background: center / contain no-repeat url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2.5'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cline x1='16.5' y1='16.5' x2='21' y2='21'/%3E%3C/svg%3E");
}

.mcs-suggest__query-text {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 14px;
}

.mcs-suggest__query-text strong {
    font-weight: 700;
}

.mcs-suggest__query-count {
    flex: 0 0 auto;
    font-size: 12px;
    color: #9ca3af;
    white-space: nowrap;
}

.mcs-suggest__entity-item .mcs-suggest__image {
    flex: 0 0 40px;
    width: 40px;
    height: 40px;
    border-radius: 8px;
}

.mcs-suggest__brand-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    font-size: 16px;
    font-weight: 700;
    color: #6b7280;
    background: #eef0f3;
}

.mcs-suggest__meta {
    display: block;
    margin-top: 2px;
    font-size: 12px;
    color: #9ca3af;
}

.mcs-suggest__footer--history {
    text-align: right;
}

.mcs-suggest__clear {
    border: 0;
    background: none;
    color: #6b7280;
    font-size: 13px;
    cursor: pointer;
    padding: 0;
}

.mcs-suggest__clear:hover {
    color: #005bff;
}

.mcs-suggest-wrap {
    position: relative;
}

.header-search,
.header-search__form.mcs-suggest-form,
.mcs-suggest-form {
    overflow: visible;
}

.mcs-suggest-form {
    position: relative;
}

@media (max-width: 767px) {
    .mcs-suggest {
        position: fixed;
        left: 12px;
        right: 12px;
        top: auto;
    }

    .mcs-overflow {
        max-height: 70vh;
    }
}
