/**
 * OpenSearch Smart Search - Mobile Styles
 */

/* Заголовки групп */
.oss-mobile-header {
    padding: 12px 16px !important;
    background: #f8f9fa !important;
    font-size: 12px !important;
    font-weight: 600 !important;
    color: #666 !important;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid #e0e0e0 !important;
    pointer-events: none;
}

.oss-mobile-icon {
    margin-right: 6px;
    font-size: 14px;
}

.oss-mobile-header-text {
    vertical-align: middle;
}

/* Элемент результата */
.oss-mobile-result {
    border-bottom: 1px solid #f0f0f0 !important;
}

.oss-mobile-result:last-child {
    border-bottom: none !important;
}

.oss-mobile-result-link {
    display: flex !important;
    align-items: center;
    padding: 12px 16px;
    text-decoration: none;
    color: inherit;
    transition: background-color 0.2s ease;
}

.oss-mobile-result-link:hover,
.oss-mobile-result-link:active {
    background-color: #f5f5f5;
}

/* Изображение товара */
.oss-mobile-result-image {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: 6px;
    margin-right: 12px;
    flex-shrink: 0;
    border: 1px solid #e0e0e0;
}

.oss-mobile-no-image {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8f9fa;
    font-size: 24px;
}

/* Информация о товаре */
.oss-mobile-result-info {
    flex: 1;
    min-width: 0;
}

.oss-mobile-result-title {
    font-size: 14px;
    font-weight: 500;
    color: #333;
    margin-bottom: 4px;
    line-height: 1.4;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.oss-mobile-result-title strong {
    background-color: #fff3cd;
    font-weight: 600;
    padding: 0 2px;
}

/* Мета информация */
.oss-mobile-result-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 12px;
    color: #666;
    flex-wrap: wrap;
}

.oss-mobile-result-sku {
    background: #e9ecef;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 11px;
}

.oss-mobile-result-price {
    font-weight: 600;
    color: #2c3e50;
}

/* Состояния */
.oss-mobile-loading,
.oss-mobile-no-results,
.oss-mobile-error {
    padding: 20px 16px !important;
    text-align: center;
    color: #666;
    font-size: 14px;
}

.oss-mobile-loading {
    position: relative;
}

.oss-mobile-loading:after {
    content: '';
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #3498db;
    border-radius: 50%;
    animation: oss-mobile-spin 1s linear infinite;
    margin-left: 8px;
    vertical-align: middle;
}

@keyframes oss-mobile-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.oss-mobile-error {
    color: #e74c3c;
}

/* Адаптация для очень маленьких экранов */
@media (max-width: 360px) {
    .oss-mobile-result-image {
        width: 40px;
        height: 40px;
        margin-right: 10px;
    }

    .oss-mobile-result-title {
        font-size: 13px;
    }

    .oss-mobile-result-meta {
        font-size: 11px;
        gap: 8px;
    }

    .oss-mobile-result-sku {
        font-size: 10px;
    }
}

/* Сброс стандартных стилей dropdown при наличии результатов */
.c-search-mobile__main .c-dropdown-menu {
    max-height: none;
    overflow-y: auto;
}

/* Улучшенный скроллбар для мобильной версии */
.c-search-mobile__main .c-dropdown-menu::-webkit-scrollbar {
    width: 6px;
}

.c-search-mobile__main .c-dropdown-menu::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.c-search-mobile__main .c-dropdown-menu::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 3px;
}

.c-search-mobile__main .c-dropdown-menu::-webkit-scrollbar-thumb:hover {
    background: #555;
}