/**
 * SEARCH COMPONENT STYLES
 * 
 * This file contains styles for the search functionality.
 * Benefits:
 * - Consistent search styling across all pages
 * - Better user experience with smooth animations
 * - Responsive design for mobile and desktop
 * - Professional appearance for search results
 */

/* Search Container */
.search-container {
    position: relative;
    display: none;
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    min-width: 300px;
    max-width: 400px;
}

.search-container.show {
    display: block;
    animation: slideDown 0.3s ease-out;
}

.search-container.hide {
    animation: slideUp 0.3s ease-in;
}

/* Search Input */
#searchInput {
    width: 100%;
    padding: 12px 16px;
    border: none;
    border-radius: 8px 8px 0 0;
    font-size: 14px;
    outline: none;
    background: transparent;
}

#searchInput:focus {
    background: #f8f9fa;
}

/* Search Results */
#searchResults {
    max-height: 300px;
    overflow-y: auto;
    border-top: 1px solid #eee;
    background: white;
    border-radius: 0 0 8px 8px;
}

/* Search Result Items */
.search-result-item {
    padding: 12px 16px;
    border-bottom: 1px solid #f0f0f0;
    transition: background-color 0.2s ease;
    cursor: pointer;
}

.search-result-item:hover {
    background-color: #f8f9fa;
}

.search-result-item:last-child {
    border-bottom: none;
}

.search-result-item img {
    width: 40px;
    height: 40px;
    object-fit: cover;
    border-radius: 4px;
    border: 1px solid #eee;
}

.search-result-item .product-info {
    flex: 1;
    margin-left: 12px;
}

.search-result-item .product-name {
    font-weight: 500;
    color: #333;
    margin-bottom: 2px;
    font-size: 14px;
}

.search-result-item .product-category {
    font-size: 12px;
    color: #666;
    margin-bottom: 4px;
}

.search-result-item .product-price {
    font-weight: 600;
    color: #ff6b00;
    font-size: 14px;
}

/* Loading State */
.search-loading {
    padding: 20px;
    text-align: center;
    color: #666;
    font-size: 14px;
}

/* Error State */
.search-error {
    padding: 16px;
    text-align: center;
    color: #dc3545;
    font-size: 14px;
    background: #f8d7da;
    border-radius: 0 0 8px 8px;
}

/* No Results State */
.search-no-results {
    padding: 20px;
    text-align: center;
    color: #666;
    font-size: 14px;
    font-style: italic;
}

/* Animations */
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideUp {
    from {
        opacity: 1;
        transform: translateY(0);
    }
    to {
        opacity: 0;
        transform: translateY(-10px);
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .search-container {
        min-width: 280px;
        max-width: 350px;
    }
    
    #searchInput {
        padding: 10px 14px;
        font-size: 16px; /* Prevents zoom on iOS */
    }
    
    .search-result-item {
        padding: 10px 14px;
    }
    
    .search-result-item img {
        width: 35px;
        height: 35px;
    }
}

/* Scrollbar Styling */
#searchResults::-webkit-scrollbar {
    width: 6px;
}

#searchResults::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

#searchResults::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

#searchResults::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
} 