/* AJAX Search Suggestions */
.search-box-fixed {
    position: relative;
}

.search-box-fixed .field-search {
    /* Оставляем оригинальные стили поля поиска */
}

.search-submit-icon {
    /* Оставляем оригинальные стили иконки поиска */
}

.ajax-search-suggestions {
    position: absolute;
    bottom: calc(100% + 16px);
    left: -50px;
    right: -50px;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    max-height: 480px;
    overflow-y: auto;
    z-index: 9999;
    display: none;
    box-shadow: 0 -25px 50px rgba(0, 0, 0, 0.18);
    animation: slideUpFade 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(10px);
    min-width: 400px;
}

@keyframes slideUpFade {
    from {
        opacity: 0;
        transform: translateY(15px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.ajax-suggestion-item {
    padding: 16px 18px;
    cursor: pointer;
    border-bottom: 1px solid #f7fafc;
    display: flex;
    align-items: center;
    gap: 14px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.ajax-suggestion-item:hover,
.ajax-suggestion-item.selected {
    background: linear-gradient(135deg, #f8fafc, #edf2f7);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    border-radius: 12px;
    margin: 0 8px;
    border-bottom: 1px solid transparent;
}

.ajax-suggestion-item:last-child {
    border-bottom: none;
}

/* Новый дизайн с аватарами и тегами */
.ajax-suggestion-avatar {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    overflow: hidden;
    flex-shrink: 0;
    position: relative;
    background: linear-gradient(135deg, #e2e8f0, #cbd5e0);
    display: flex;
    align-items: center;
    justify-content: center;
}

.suggestion-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 12px;
}

.suggestion-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 600;
    color: #4a5568;
    background: linear-gradient(135deg, #e2e8f0, #cbd5e0);
    border-radius: 12px;
}

.ajax-suggestion-content {
    flex: 1;
    min-width: 0;
}

.ajax-suggestion-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 4px;
    gap: 12px;
}

.ajax-suggestion-title {
    font-weight: 600;
    color: #2d3748;
    font-size: 0.9rem;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
}

.ajax-suggestion-tag {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    flex-shrink: 0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.ajax-suggestion-tag.category {
    background: linear-gradient(135deg, #48bb78, #38a169);
    color: white;
}

.ajax-suggestion-tag.supplier {
    background: linear-gradient(135deg, #ed8936, #dd6b20);
    color: white;
}

.ajax-suggestion-tag.leaflet {
    background: linear-gradient(135deg, #9f7aea, #805ad5);
    color: white;
}

.ajax-suggestion-tag.product {
    background: linear-gradient(135deg, #4299e1, #3182ce);
    color: white;
}

.ajax-suggestion-tag.default {
    background: linear-gradient(135deg, #718096, #4a5568);
    color: white;
}

.ajax-suggestion-desc {
    color: #718096;
    font-size: 0.8rem;
    line-height: 1.4;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 2px;
}

.ajax-search-no-results {
    padding: 20px;
    text-align: center;
    color: #a0aec0;
    font-size: 0.9rem;
    font-weight: 500;
}

.ajax-search-loading {
    padding: 20px;
    text-align: center;
    color: #4299e1;
    font-size: 0.9rem;
    font-weight: 500;
    position: relative;
}

.ajax-search-loading::after {
    content: '';
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid #e2e8f0;
    border-top: 2px solid #4299e1;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-left: 8px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Mobile adjustments */
@media (max-width: 768px) {
    .ajax-search-suggestions {
        max-height: 350px;
        border-radius: 16px;
        bottom: calc(100% + 10px);
        left: -20px;
        right: -20px;
        min-width: 320px;
    }
    
    .ajax-suggestion-item {
        padding: 14px 16px;
        gap: 12px;
    }
    
    .ajax-suggestion-avatar {
        width: 48px;
        height: 48px;
    }
    
    .suggestion-placeholder {
        font-size: 1.3rem;
    }
    
    .ajax-suggestion-title {
        font-size: 0.85rem;
    }
    
    .ajax-suggestion-desc {
        font-size: 0.75rem;
    }
    
    .ajax-suggestion-tag {
        padding: 3px 8px;
        font-size: 0.65rem;
    }
}

@media (max-width: 480px) {
    .ajax-search-suggestions {
        max-height: 300px;
        border-radius: 14px;
        bottom: calc(100% + 8px);
        left: -10px;
        right: -10px;
        min-width: 280px;
    }
    
    .ajax-suggestion-item {
        padding: 12px 14px;
        gap: 10px;
    }
    
    .ajax-suggestion-avatar {
        width: 44px;
        height: 44px;
        border-radius: 10px;
    }
    
    .suggestion-placeholder {
        font-size: 1.2rem;
        border-radius: 10px;
    }
    
    .ajax-suggestion-title {
        font-size: 0.8rem;
    }
    
    .ajax-suggestion-desc {
        font-size: 0.7rem;
    }
    
    .ajax-suggestion-tag {
        padding: 2px 6px;
        font-size: 0.6rem;
        border-radius: 10px;
    }
    
    .ajax-search-no-results {
        padding: 16px;
        font-size: 0.85rem;
    }
}
