/* search.css - Styles pour la fonctionnalité de recherche */

/* ===== BARRE DE RECHERCHE ===== */
.search-container {
    min-width: 300px;
    position: relative;
}

.search-input {
    border: 2px solid var(--border-color);
    border-radius: 0.5rem 0 0 0.5rem;
    padding: 0.75rem 1rem;
    font-size: 0.95rem;
    transition: all 0.2s ease;
    background: var(--bg-white);
}

.search-input:focus {
    border-color: #FF6600;
    box-shadow: 0 0 0 3px rgba(255, 102, 0, 0.1);
    outline: none;
}

.search-input::placeholder {
    color: var(--text-light);
    font-weight: 400;
}

.search-container .btn {
    border: 2px solid var(--border-color);
    border-left: none;
    border-radius: 0 0.5rem 0.5rem 0;
    background: var(--bg-white);
    color: var(--text-secondary);
    padding: 0.75rem 1rem;
    transition: all 0.2s ease;
}

.search-container .btn:hover {
    background: #FF6600;
    border-color: #FF6600;
    color: white;
}

/* ===== RÉSULTATS DE RECHERCHE ===== */
.search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    box-shadow: var(--shadow-lg);
    z-index: 1000;
    max-height: 400px;
    overflow-y: auto;
    display: none;
    margin-top: 0.25rem;
}

.search-result-item {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    transition: all 0.2s ease;
}

.search-result-item:last-child {
    border-bottom: none;
}

.search-result-item:hover {
    background: var(--bg-light);
}

.search-result-image {
    width: 50px;
    height: 50px;
    border-radius: 0.375rem;
    object-fit: cover;
    margin-right: 0.75rem;
    flex-shrink: 0;
}

.search-result-image-placeholder {
    width: 50px;
    height: 50px;
    background: var(--bg-light);
    border-radius: 0.375rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-light);
    margin-right: 0.75rem;
    flex-shrink: 0;
}

.search-result-info {
    flex-grow: 1;
    min-width: 0;
}

.search-result-title {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.95rem;
    margin-bottom: 0.25rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.search-result-category {
    font-size: 0.8rem;
    color: var(--text-light);
    font-weight: 500;
}

.search-result-price {
    margin-left: 0.5rem;
    flex-shrink: 0;
    text-align: right;
}

.search-result-price .price-original-small {
    text-decoration: line-through;
    color: #6c757d;
    font-size: 0.8rem;
    font-weight: 400;
    margin-bottom: 0.1rem;
}

.search-result-price .price-current {
    font-weight: 700;
    color: #FF6600;
    font-size: 0.95rem;
}

/* ===== ÉTATS DE RECHERCHE ===== */
.search-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    color: var(--text-light);
}

.search-loading .spinner-border {
    width: 1.5rem;
    height: 1.5rem;
    border-width: 2px;
    color: #FF6600;
}

.search-no-results {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    color: var(--text-light);
    text-align: center;
}

.search-no-results i {
    margin-bottom: 0.5rem;
}

/* ===== RECHERCHE MOBILE ===== */
.mobile-search-container {
    margin-bottom: 1rem;
}

.mobile-search-input {
    border: 2px solid var(--border-color);
    border-radius: 0.5rem 0 0 0.5rem;
    padding: 0.75rem 1rem;
    font-size: 0.95rem;
    background: var(--bg-white);
}

.mobile-search-input:focus {
    border-color: #FF6600;
    box-shadow: 0 0 0 3px rgba(255, 102, 0, 0.1);
    outline: none;
}

.mobile-search-container .btn {
    border: 2px solid var(--border-color);
    border-left: none;
    border-radius: 0 0.5rem 0.5rem 0;
    background: var(--bg-white);
    color: var(--text-secondary);
    padding: 0.75rem 1rem;
}

.mobile-search-container .btn:hover {
    background: #FF6600;
    border-color: #FF6600;
    color: white;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .search-container {
        min-width: auto;
        width: 100%;
        margin: 1rem 0;
        order: 3;
    }

    .search-input {
        height: 40px;
        font-size: 0.85rem;
    }

    .search-results {
        max-height: 300px;
    }
}

/* ===== ANIMATIONS ===== */
@keyframes searchFadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.search-results {
    animation: searchFadeIn 0.2s ease-out;
}

.search-result-item {
    animation: searchFadeIn 0.3s ease-out;
}

/* ===== AMÉLIORATIONS VISUELLES ===== */
.search-container .input-group {
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    border-radius: 0.5rem;
    overflow: hidden;
}

.search-results::-webkit-scrollbar {
    width: 6px;
}

.search-results::-webkit-scrollbar-track {
    background: var(--bg-light);
    border-radius: 3px;
}

.search-results::-webkit-scrollbar-thumb {
    background: #FF6600;
    border-radius: 3px;
}

.search-results::-webkit-scrollbar-thumb:hover {
    background: #E55A00;
}

