/* ================================================
   МИНИМАЛИСТИЧНОЕ ПОИСКОВОЕ ПОЛЕ - ЧИСТЫЙ ДИЗАЙН
   ================================================ */

.clean-search-section {
    background: #f8f9fc;
    padding: 40px 0;
    border-bottom: 1px solid #e5e7eb;
}

.clean-search-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 20px;
}

.clean-search-form {
    position: relative;
}

/* Основное поле ввода */
.search-input-wrapper {
    display: flex;
    align-items: center;
    background: white;
    border: 1px solid #d1d5db;
    border-radius: 16px;
    padding: 4px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.search-input-wrapper:hover {
    border-color: #9ca3af;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.08);
}

.search-input-wrapper:focus-within {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1),
                0 4px 8px rgba(0, 0, 0, 0.08);
}

/* Иконка поиска слева */
.search-icon-left {
    color: #9ca3af;
    padding: 0 18px 0 22px;
    font-size: 18px;
    transition: color 0.3s ease;
}

.search-input-wrapper:focus-within .search-icon-left {
    color: #3b82f6;
}

/* Поле ввода */
.clean-search-input {
    flex: 1;
    border: none;
    outline: none;
    padding: 20px 14px;
    font-size: 16px;
    color: #1f2937;
    background: transparent;
    font-family: inherit;
}

.clean-search-input::placeholder {
    color: #9ca3af;
    transition: color 0.3s ease;
}

.clean-search-input:focus::placeholder {
    color: #d1d5db;
}

/* Кнопка очистки */
.search-clear-btn {
    position: absolute;
    right: 70px;
    top: 50%;
    transform: translateY(-50%);
    width: 24px;
    height: 24px;
    border: none;
    background: #f3f4f6;
    color: #6b7280;
    border-radius: 50%;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    transition: all 0.2s ease;
}

.search-clear-btn:hover {
    background: #e5e7eb;
    color: #374151;
}

.search-clear-btn.visible {
    display: flex;
}

/* Кнопка поиска */
.clean-search-btn {
    background: #3b82f6;
    color: white;
    border: none;
    border-radius: 12px;
    padding: 16px 20px;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 56px;
}

.clean-search-btn:hover {
    background: #2563eb;
    transform: translateY(-1px);
}

.clean-search-btn:active {
    transform: translateY(0);
}

/* Подсказки поиска */
.clean-search-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15), 0 4px 12px rgba(0, 0, 0, 0.08);
    z-index: 1000;
    max-height: 450px;
    overflow-y: auto;
    margin-top: 8px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
}

/* Состояния для показа подсказок */
.clean-search-suggestions.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.suggestion-item {
    padding: 16px 20px;
    cursor: pointer;
    transition: all 0.2s ease;
    border-bottom: 1px solid #f3f4f6;
    display: flex;
    align-items: center;
    gap: 12px;
}

.suggestion-item:hover,
.suggestion-item.active {
    background-color: #f8fafc;
    border-color: #e2e8f0;
}

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

.suggestion-icon {
    color: #3b82f6;
    font-size: 14px;
    width: 16px;
    text-align: center;
    flex-shrink: 0;
}

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

.suggestion-text div {
    font-size: 14px;
    font-weight: 500;
    color: #1f2937;
    line-height: 1.4;
}

.suggestion-text small {
    display: block;
    font-size: 12px;
    color: #6b7280;
    margin-top: 2px;
    line-height: 1.3;
}

.suggestion-category {
    font-size: 12px;
    color: #3b82f6;
    background: #eff6ff;
    padding: 4px 8px;
    border-radius: 6px;
    white-space: nowrap;
    flex-shrink: 0;
}

.search-results-count {
    padding: 12px 20px;
    background: #f8fafc;
    border-bottom: 1px solid #e5e7eb;
    font-size: 13px;
    color: #6b7280;
    font-weight: 500;
    text-align: center;
}

.no-suggestions {
    padding: 40px 20px;
    text-align: center;
    color: #6b7280;
}

.no-suggestions i {
    font-size: 24px;
    color: #d1d5db;
    margin-bottom: 12px;
    display: block;
}

.no-suggestions div {
    font-size: 14px;
    font-weight: 500;
    color: #374151;
    margin-bottom: 8px;
}

.no-suggestions small {
    font-size: 12px;
    color: #9ca3af;
    line-height: 1.4;
}

/* Мобильная адаптация */
@media (max-width: 768px) {
    .clean-search-section {
        padding: 30px 0;
    }
    
    .clean-search-container {
        padding: 0 16px;
    }
    
    .search-input-wrapper {
        border-radius: 14px;
    }
    
    .clean-search-input {
        padding: 18px 14px;
        font-size: 16px; /* Предотвращает зум на iOS */
    }
    
    .search-icon-left {
        padding: 0 16px 0 20px;
        font-size: 16px;
    }
    
    .clean-search-btn {
        padding: 14px 18px;
        border-radius: 10px;
        min-width: 48px;
    }
    
    .clean-search-suggestions {
        border-radius: 10px;
        max-height: 300px;
    }
}

@media (max-width: 480px) {
    .clean-search-section {
        padding: 20px 0;
    }
    
    .clean-search-input {
        padding: 16px 12px;
        font-size: 15px;
    }
    
    .search-icon-left {
        padding: 0 14px 0 18px;
        font-size: 15px;
    }
    
    .clean-search-btn {
        padding: 12px 16px;
        min-width: 44px;
    }
}

/* Состояния загрузки */
.clean-search-form.loading .clean-search-btn {
    background: #9ca3af;
    cursor: not-allowed;
}

.clean-search-form.loading .clean-search-btn i {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Улучшенная прокрутка */
.clean-search-suggestions::-webkit-scrollbar {
    width: 6px;
}

.clean-search-suggestions::-webkit-scrollbar-track {
    background: #f9fafb;
    border-radius: 3px;
}

.clean-search-suggestions::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 3px;
}

.clean-search-suggestions::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}

/* Секция результатов поиска */
#searchResultsSection {
    background: #f8f9fc;
    padding: 40px 0;
    min-height: 300px;
}

#searchResultsSection h2 {
    color: #1f2937;
    font-size: 28px;
    font-weight: 600;
    margin-bottom: 30px;
    text-align: center;
}

/* Сетка товаров с оптимизацией производительности */
#searchResultsContainer.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
    padding: 20px 0;
    /* Оптимизация рендеринга */
    contain: layout style paint;
    will-change: transform;
}

/* Стили для отсутствия результатов */
.no-products {
    text-align: center;
    padding: 60px 20px;
    color: #6b7280;
}

.no-products h3 {
    color: #374151;
    font-size: 24px;
    margin-bottom: 12px;
    font-weight: 600;
}

.no-products p {
    color: #6b7280;
    font-size: 16px;
    margin-bottom: 8px;
    line-height: 1.5;
}

/* Индикатор загрузки пагинации */
.search-loading-indicator {
    display: none;
    text-align: center;
    padding: 40px 20px;
    background: #f8f9fc;
    position: relative;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s ease;
}

.search-loading-indicator.visible {
    opacity: 1;
    transform: translateY(0);
}

.loading-spinner {
    display: inline-flex;
    align-items: center;
    gap: 16px;
    color: #3b82f6;
    font-size: 16px;
    font-weight: 500;
}

.spinner-icon {
    display: flex;
    align-items: center;
    justify-content: center;
}

.spinner-icon i {
    font-size: 24px;
    animation: spin 1s linear infinite;
    color: #3b82f6;
}

.loading-text {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
}

.loading-message {
    font-size: 16px;
    font-weight: 600;
    color: #1f2937;
}

.loading-hint {
    font-size: 14px;
    color: #6b7280;
    font-weight: 400;
}

/* Сообщение о завершении загрузки */
.search-end-message {
    display: none;
    text-align: center;
    padding: 30px 20px;
    background: #f8f9fc;
    position: relative;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s ease;
    border-top: 1px solid #e5e7eb;
}

.search-end-message.visible {
    opacity: 1;
    transform: translateY(0);
}

.end-message-content {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    color: #059669;
    font-size: 15px;
    font-weight: 500;
    background: white;
    padding: 16px 24px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    border: 1px solid #d1fae5;
}

.end-message-content i {
    font-size: 18px;
    color: #059669;
}

.end-message-content span {
    color: #065f46;
    font-weight: 600;
}

.end-message-content small {
    color: #6b7280;
    font-size: 13px;
    font-weight: 400;
    margin-left: 8px;
}

/* Улучшения для мобильных устройств */
@media (max-width: 768px) {
    #searchResultsContainer.products-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 16px;
        padding: 16px 0;
    }
    
    #searchResultsSection h2 {
        font-size: 24px;
        margin-bottom: 20px;
    }
    
    .search-loading-indicator {
        padding: 30px 16px;
    }
    
    .loading-spinner {
        font-size: 14px;
        gap: 12px;
        flex-direction: column;
        text-align: center;
    }
    
    .spinner-icon i {
        font-size: 20px;
    }
    
    .loading-text {
        align-items: center;
    }
    
    .loading-message {
        font-size: 15px;
    }
    
    .loading-hint {
        font-size: 13px;
    }
    
    .search-end-message {
        padding: 20px 16px;
    }
    
    .end-message-content {
        flex-direction: column;
        gap: 8px;
        padding: 12px 20px;
        font-size: 14px;
    }
    
    .end-message-content small {
        margin-left: 0;
        margin-top: 4px;
    }
}

.search-results-grid .product-card {
    /* Специфичные стили только для результатов поиска, если нужны */
} 