/* VM Live Search */
.vm-livesearch {
    position: relative;
    width: 100%;
    max-width: 700px;
    margin: 0 auto;
}

.vm-livesearch__form {
    position: relative;
    display: flex;
    align-items: center;
}

.vm-livesearch__input {
    width: 100%;
    padding: 8px 36px 8px 14px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
    color: #333;
    background: #fff;
    outline: none;
    transition: border-color .2s;
    box-sizing: border-box;
}

.vm-livesearch__input:focus {
    border-color: #73b844;
}

.vm-livesearch__input::placeholder {
    color: #999;
}

/* Spinner */
.vm-livesearch__spinner {
    display: none;
    position: absolute;
    right: 10px;
    top: 50%;
    margin-top: -8px;
    width: 16px;
    height: 16px;
    border: 2px solid #ddd;
    border-top-color: #73b844;
    border-radius: 50%;
    animation: vls-spin .6s linear infinite;
}

.vm-livesearch--loading .vm-livesearch__spinner {
    display: block;
}

@keyframes vls-spin {
    to { transform: rotate(360deg); }
}

/* Dropdown */
.vm-livesearch__dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 9999;
    max-height: 520px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #ccc transparent;
    background: #fff;
    border: 1px solid #ddd;
    border-top: none;
    border-radius: 0 0 6px 6px;
    box-shadow: 0 6px 20px rgba(0,0,0,.15);
}

.vm-livesearch__dropdown--open {
    display: block;
}

/* Result item */
.vm-livesearch__item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    text-decoration: none;
    color: #333;
    border-bottom: 1px solid #f0f0f0;
    transition: background .15s;
}

.vm-livesearch__item:last-child {
    border-bottom: none;
}

.vm-livesearch__item:hover {
    background: #f7f7f7;
    text-decoration: none;
    color: #333;
}

/* Image */
.vm-livesearch__img {
    flex-shrink: 0;
    width: 50px;
    height: 50px;
    object-fit: contain;
    border-radius: 4px;
    background: #fafafa;
}

/* Text block */
.vm-livesearch__info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.vm-livesearch__title {
    font-size: 13px;
    line-height: 1.3;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
}

.vm-livesearch__meta {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    color: #999;
    line-height: 1.2;
}

.vm-livesearch__meta-sep {
    color: #ccc;
}

.vm-livesearch__sku {
    font-family: monospace;
    color: #888;
}

.vm-livesearch__category {
    color: #999;
}

/* Price */
.vm-livesearch__price {
    flex-shrink: 0;
    font-size: 14px;
    font-weight: 600;
    color: #333;
    white-space: nowrap;
    padding-left: 8px;
}

/* Highlight matched text */
.vm-livesearch__highlight {
    background: #fff3cd;
    border-radius: 2px;
    padding: 0 1px;
}

/* No results */
.vm-livesearch__empty {
    padding: 16px;
    text-align: center;
    color: #999;
    font-size: 13px;
}

/* "Показать все результаты" */
.vm-livesearch__all {
    display: block;
    padding: 10px 14px;
    text-align: center;
    font-size: 13px;
    font-weight: 500;
    color: #73b844;
    text-decoration: none;
    border-top: 1px solid #eee;
    background: #fafafa;
    border-radius: 0 0 6px 6px;
    transition: background .15s, color .15s;
}

.vm-livesearch__all:hover {
    background: #f0f0f0;
    color: #5a9435;
    text-decoration: none;
}

/* Responsive */
@media (max-width: 767px) {
    .vm-livesearch__img {
        width: 40px;
        height: 40px;
    }

    .vm-livesearch__title {
        font-size: 12px;
    }

    .vm-livesearch__price {
        font-size: 13px;
    }

    .vm-livesearch__dropdown {
        max-height: 70vh;
    }
}
