/* ===== Выпадающие подсказки поиска ===== */

/* Чтобы #searchSuggest позиционировался относительно формы */
.search-box {
    position: relative;
}

.search-suggest {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.12);
    max-height: 480px;
    overflow-y: auto;
    z-index: 1500;
    padding: 6px 0;
}

.search-suggest[hidden] {
    display: none;
}

/* Заголовок группы (Категории / Товары) */
.search-suggest .ss-section {
    padding: 8px 14px 4px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #888;
}

/* Базовый пункт списка */
.search-suggest .ss-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 14px;
    text-decoration: none;
    color: #222;
    font-size: 14px;
    line-height: 1.3;
    transition: background 0.15s;
}

.search-suggest .ss-item:hover,
.search-suggest .ss-item.active {
    background: #f6f7f9;
}

.search-suggest .ss-text {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    line-height: 1.35;
    word-break: normal;
    overflow-wrap: anywhere;
}

/* Имя — одной строкой с многоточием */
.search-suggest .ss-name {
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: 500;
}

.search-suggest .ss-text small {
    display: block;
    font-size: 12px;
    color: #888;
    font-weight: 400;
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.search-suggest mark {
    background: #fff3a8;
    color: inherit;
    padding: 0 1px;
    border-radius: 2px;
    box-decoration-break: clone;
    -webkit-box-decoration-break: clone;
}

/* Категория — иконка папки */
.search-suggest .ss-cat .ss-icon {
    width: 32px;
    height: 32px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f4f5f7;
    border-radius: 8px;
    font-size: 16px;
}

/* Товар — миниатюра + название + цена */
.search-suggest .ss-prod img {
    width: 44px;
    height: 44px;
    flex-shrink: 0;
    object-fit: cover;
    border-radius: 8px;
    background: #f4f5f7;
    border: 1px solid #eee;
}

.search-suggest .ss-price {
    flex-shrink: 0;
    font-weight: 700;
    color: #111;
    font-size: 13px;
    margin-left: 8px;
    white-space: nowrap;
}

/* "Показать все результаты по запросу..." */
.search-suggest .ss-all {
    display: block;
    margin-top: 4px;
    padding: 10px 14px;
    border-top: 1px solid #eee;
    font-size: 13px;
    font-weight: 600;
    color: #0066cc;
    text-decoration: none;
    text-align: center;
    transition: background 0.15s;
}

.search-suggest .ss-all:hover,
.search-suggest .ss-all.active {
    background: #f0f7ff;
}

/* Пусто */
.search-suggest .ss-empty {
    padding: 16px 14px;
    text-align: center;
    color: #888;
    font-size: 13px;
}

/* Скроллбар внутри выпадашки */
.search-suggest::-webkit-scrollbar {
    width: 6px;
}
.search-suggest::-webkit-scrollbar-thumb {
    background: #d4d4d4;
    border-radius: 6px;
}

/* Мобильная адаптация */
@media (max-width: 768px) {
    .search-suggest {
        max-height: 60vh;
    }
    .search-suggest .ss-prod img {
        width: 40px;
        height: 40px;
    }
}
