/* Enhanced Search Styles - Updated for existing class structure */
.search-container {
    flex: 1;
    max-width: 500px;
    margin: 0 20px;
    position: relative;
}

.search-form {
    display: flex;
    position: relative;
    width: 100%;
}

.search-input-wrapper {
    position: relative;
    flex: 1;
}

.search-input {
    flex: 1;
    padding: 12px 20px;
    border: 2px solid #e0e0e0;
    border-radius: 25px;
    font-size: 0.95rem;
    outline: none;
    transition: all 0.3s;
    font-family: 'Poppins', sans-serif;
    width: 100%;
    box-sizing: border-box;
}

.search-input:focus {
    border-color: #1a5f7a;
    box-shadow: 0 0 0 3px rgba(26, 95, 122, 0.1);
}

.search-btn {
    position: absolute;
    right: 5px;
    top: 5px;
    background: #1a5f7a;
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    transition: background 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
}

.search-btn:hover {
    background: #154d63;
}

/* Search Suggestions Dropdown */
.search-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
    z-index: 1000;
    max-height: 350px;
    overflow-y: auto;
    display: none;
    margin-top: 8px;
    border: 1px solid #e0e0e0;
}

.search-suggestions.active {
    display: block;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.search-suggestions .suggestion-item {
    padding: 12px 15px;
    border-bottom: 1px solid #f5f5f5;
    cursor: pointer;
    transition: background 0.2s ease;
    display: flex;
    align-items: center;
    gap: 12px;
}

.search-suggestions .suggestion-item:hover {
    background: #f8f9fa;
}

.search-suggestions .suggestion-item:last-child {
    border-bottom: none;
}

.search-suggestions .suggestion-item.highlighted {
    background: #e8f4ff;
    border-left: 3px solid #1a5f7a;
}

.search-suggestions .suggestion-image {
    width: 45px;
    height: 45px;
    border-radius: 6px;
    object-fit: cover;
    flex-shrink: 0;
    border: 1px solid #eee;
}

.search-suggestions .suggestion-content {
    flex: 1;
    min-width: 0;
}

.search-suggestions .suggestion-title {
    font-weight: 600;
    color: #333;
    margin-bottom: 3px;
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.search-suggestions .suggestion-brand {
    color: #666;
    font-size: 0.8rem;
    margin-bottom: 3px;
}

.search-suggestions .suggestion-price {
    color: #1a5f7a;
    font-weight: 600;
    font-size: 0.85rem;
}

.search-suggestions .no-results {
    padding: 20px;
    text-align: center;
    color: #666;
    font-style: italic;
}

.search-suggestions .suggestion-header {
    padding: 10px 15px;
    background: #f8f9fa;
    font-weight: 600;
    color: #333;
    border-bottom: 1px solid #eee;
    font-size: 0.85rem;
    position: sticky;
    top: 0;
    z-index: 1;
}

/* Mobile responsive search */
@media (max-width: 768px) {
    .search-container {
        max-width: 100%;
        margin: 0 10px;
    }
    
    .search-suggestions {
        position: fixed;
        top: auto;
        left: 0;
        right: 0;
        bottom: 0;
        max-height: 60vh;
        border-radius: 15px 15px 0 0;
        margin-top: 0;
    }
    
    .search-input {
        padding: 10px 15px;
        font-size: 0.85rem;
    }
    
    .search-btn {
        width: 36px;
        height: 36px;
        top: 3px;
    }
    
    .search-suggestions .suggestion-item {
        padding: 10px 12px;
    }
    
    .search-suggestions .suggestion-image {
        width: 40px;
        height: 40px;
    }
}

/* Tablet responsive */
@media (min-width: 769px) and (max-width: 1024px) {
    .search-container {
        max-width: 400px;
    }
}

/* Desktop improvements */
@media (min-width: 1025px) {
    .search-input {
        padding: 14px 20px;
        font-size: 1rem;
    }
    
    .search-btn {
        width: 42px;
        height: 42px;
        top: 4px;
        right: 4px;
    }
    
    .search-suggestions {
        max-height: 400px;
    }
}

/* Animation for suggestions */
.search-suggestions::-webkit-scrollbar {
    width: 6px;
}

.search-suggestions::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.search-suggestions::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.search-suggestions::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Ensure search input stays within container on focus */
.search-input:focus + .search-btn {
    background: #154d63;
}