/**
 * Стили для живого поиска с выпадающей панелькой
 */

/* Контейнер формы поиска */
.search-input {
    position: relative;
}

/* Выпадающая панелька результатов */
.search-results-dropdown {
    position: absolute;
    top: calc(100% + 5px);
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    max-height: 500px;
    overflow-y: auto;
}

/* Контент результатов */
.search-results-dropdown__content {
    padding: 10px 0;
}

/* Лоадер */
.search-results-dropdown__loader {
    padding: 30px;
    text-align: center;
    display: none;
}

.search-results-dropdown__loader .spinner {
    animation: rotate 2s linear infinite;
}

.search-results-dropdown__loader .path {
    stroke: #3366ff;
    stroke-linecap: round;
    animation: dash 1.5s ease-in-out infinite;
}

@keyframes rotate {
    100% { transform: rotate(360deg); }
}

@keyframes dash {
    0% {
        stroke-dasharray: 1, 150;
        stroke-dashoffset: 0;
    }
    50% {
        stroke-dasharray: 90, 150;
        stroke-dashoffset: -35;
    }
    100% {
        stroke-dasharray: 90, 150;
        stroke-dashoffset: -124;
    }
}

/* Результаты поиска */
.search-dropdown-results {
    display: flex;
    flex-direction: column;
}

/* Элемент результата */
.search-dropdown-item {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    text-decoration: none;
    color: #333;
    transition: background-color 0.2s ease;
    border-bottom: 1px solid #f5f5f5;
}

.search-dropdown-item:hover {
    background-color: #f9f9f9;
}

.search-dropdown-item:last-child {
    border-bottom: none;
}

/* Изображение товара */
.search-dropdown-item__image {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: 6px;
    margin-right: 12px;
    flex-shrink: 0;
}

.search-dropdown-item__image--empty {
    background: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.search-dropdown-item__image--empty::after {
    content: '📦';
    font-size: 20px;
}

/* Информация о товаре */
.search-dropdown-item__info {
    flex: 1;
    min-width: 0;
}

.search-dropdown-item__title {
    font-size: 14px;
    font-weight: 500;
    color: #333;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.search-dropdown-item__type {
    font-size: 12px;
    color: #888;
}

/* Цена */
.search-dropdown-item__price {
    margin-left: 12px;
    font-size: 18px;
    font-weight: 700;
    color: var(--primary-orange);
    white-space: nowrap;
}

/* Футер с кнопкой "Показать все" */
.search-dropdown-footer {
    display: block;
    padding: 12px 16px;
    text-align: center;
    color: #3366ff;
    font-weight: 500;
    text-decoration: none;
    border-top: 1px solid #f0f0f0;
    transition: background-color 0.2s ease;
}

.search-dropdown-footer:hover {
    background-color: #f9f9f9;
}

/* Пустой результат */
.search-dropdown-empty {
    padding: 40px 20px;
    text-align: center;
}

.search-dropdown-empty__icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.search-dropdown-empty__text {
    font-size: 14px;
    color: #666;
}

/* Сообщение об ошибке */
.search-dropdown-error {
    padding: 20px;
    text-align: center;
    color: #d32f2f;
}

/* Адаптив */
@media (max-width: 768px) {
    .search-results-dropdown {
        max-height: 400px;
    }

    .search-dropdown-item {
        padding: 10px 12px;
    }

    .search-dropdown-item__image {
        width: 40px;
        height: 40px;
    }

    .search-dropdown-item__title {
        font-size: 13px;
    }

    .search-dropdown-item__price {
        font-size: 14px;
    }
}
