/* Search Results Specific Styles */
* {
    font-family: 'Poppins', sans-serif;
}

.search-query-highlight {
    background: linear-gradient(135deg, #ffeb3b, #ffc107);
    color: #333;
    padding: 0.3rem 0.6rem;
    border-radius: 8px;
    font-weight: 600;
    box-shadow: 0 2px 4px rgba(255, 193, 7, 0.3);
    display: inline-block;
    margin: 0 0.2rem;
}

/* Ensure search results page uses full width */
.search-results-page .container-fluid {
    max-width: 100%;
    width: 100%;
    padding: 0 30px;
}

@media (max-width: 768px) {
    .search-results-page .container-fluid {
        padding: 0 15px;
    }
}

/* Search suggestions styling */
.search-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #e5e5e5;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    z-index: 1051;
    display: none;
    margin-top: 0.5rem;
    overflow: hidden;
    backdrop-filter: blur(10px);
    background: rgba(255, 255, 255, 0.95);
}

.suggestions-header {
    padding: 1rem 1.5rem 0.5rem;
    border-bottom: 1px solid #f0f0f0;
}

.suggestions-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: #666666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.suggestions-list {
    padding: 0.5rem 0;
}

.suggestion-item {
    padding: 0.75rem 1.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.95rem;
    color: #333333;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    border-bottom: 1px solid #f5f5f5;
}

.suggestion-item:last-child {
    border-bottom: none;
}

.suggestion-text {
    flex: 1;
    font-weight: 500;
}

.suggestion-category {
    font-size: 0.8rem;
    color: #666;
    background: #f0f0f0;
    padding: 0.2rem 0.5rem;
    border-radius: 12px;
    font-weight: 400;
}

.suggestion-item:hover,
.suggestion-item.active {
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    color: #2c3e50;
    transform: translateX(5px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Search results dropdown */
.search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #e5e5e5;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    z-index: 1051;
    display: none;
    margin-top: 0.5rem;
    max-height: 500px;
    overflow-y: auto;
    backdrop-filter: blur(10px);
    background: rgba(255, 255, 255, 0.95);
}

.search-results-header {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    border-radius: 15px 15px 0 0;
}

.results-count {
    font-size: 0.9rem;
    color: #666666;
    font-weight: 500;
}

.view-all-link {
    color: #111111;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    transition: color 0.2s ease;
}

.view-all-link:hover {
    color: #333333;
}

.search-result-item {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
    transition: background-color 0.2s ease;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.search-result-item:hover,
.search-result-item.active {
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    transform: translateX(5px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.search-result-item:last-child {
    border-bottom: none;
}

.result-image {
    width: 50px;
    height: 50px;
    border-radius: 8px;
    overflow: hidden;
    background: #f8f9fa;
    flex-shrink: 0;
}

.result-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.result-info {
    flex: 1;
    min-width: 0;
}

.result-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: #111111;
    margin-bottom: 0.25rem;
    line-height: 1.3;
}

.result-title mark {
    background: #fff3cd;
    color: #111111;
    padding: 0.1rem 0.2rem;
    border-radius: 3px;
    font-weight: 700;
}

.result-brand {
    font-size: 0.8rem;
    color: #6c757d;
    margin-bottom: 0.2rem;
    font-weight: 500;
}

.result-price {
    font-size: 0.85rem;
    color: #28a745;
    font-weight: 600;
    margin-bottom: 0.3rem;
}

.result-details {
    display: flex;
    gap: 0.5rem;
    font-size: 0.75rem;
    color: #6c757d;
}

.result-color,
.result-height {
    background-color: #f8f9fa;
    padding: 0.15rem 0.4rem;
    border-radius: 8px;
    border: 1px solid #e9ecef;
    font-weight: 500;
    font-size: 0.7rem;
}

.result-brand {
    font-size: 0.8rem;
    color: #666666;
    margin-bottom: 0.25rem;
}

.result-price {
    font-size: 0.9rem;
    font-weight: 600;
    color: #111111;
    margin-bottom: 0.25rem;
}

.result-category {
    font-size: 0.75rem;
    color: #999999;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.result-details {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.25rem;
    font-size: 0.75rem;
    color: #6c757d;
}

.result-color,
.result-height {
    background: #e9ecef;
    padding: 0.1rem 0.3rem;
    border-radius: 6px;
}

.search-more-results {
    padding: 1rem 1.5rem;
    border-top: 1px solid #f0f0f0;
    background: #f8f9fa;
}

.more-results-link {
    color: #111111;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: color 0.2s ease;
}

.more-results-link:hover {
    color: #333333;
}

.search-loading,
.search-no-results,
.search-error {
    padding: 2rem 1.5rem;
    text-align: center;
    color: #666666;
}

.search-loading i {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: #111111;
}

.search-no-results i {
    font-size: 2rem;
    margin-bottom: 1rem;
    color: #e5e5e5;
}

.search-error i {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: #dc3545;
}

.search-loading span,
.search-no-results p,
.search-error p {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.search-no-results small,
.search-error small {
    font-size: 0.8rem;
    opacity: 0.8;
}

/* Enhanced Search Features */
.search-suggestions-inline {
    margin-top: 1rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.search-suggestions-inline p {
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #2c3e50;
    font-size: 0.9rem;
}

.suggestion-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.suggestion-tag {
    background: linear-gradient(135deg, #2c3e50, #34495e);
    color: white;
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    font-weight: 500;
}

.suggestion-tag:hover {
    background: linear-gradient(135deg, #34495e, #2c3e50);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

/* Enhanced error states */
.search-error {
    padding: 2rem 1.5rem;
    text-align: center;
    color: #dc3545;
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    border-radius: 8px;
    margin: 1rem;
}

.search-error i {
    font-size: 2rem;
    margin-bottom: 1rem;
    color: #dc3545;
}

.search-error p {
    margin-bottom: 1rem;
    font-weight: 500;
}

.search-error .btn {
    background: #dc3545;
    border-color: #dc3545;
    color: white;
    transition: all 0.3s ease;
}

.search-error .btn:hover {
    background: #c82333;
    border-color: #bd2130;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(220, 53, 69, 0.3);
}

/* Loading state improvements */
.search-loading {
    padding: 2rem 1.5rem;
    text-align: center;
    color: #2c3e50;
}

.search-loading i {
    font-size: 2rem;
    margin-bottom: 1rem;
    color: #2c3e50;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.search-loading span {
    font-weight: 500;
    color: #6c757d;
}

/* Mobile Responsive for Search */
@media (max-width: 768px) {
    .search-suggestions,
    .search-results {
        left: -1rem;
        right: -1rem;
        border-radius: 12px;
    }
    
    .search-result-item {
        padding: 0.75rem 1rem;
        gap: 0.75rem;
    }
    
    .result-image {
        width: 40px;
        height: 40px;
    }
    
    .result-title {
        font-size: 0.9rem;
    }
    
    .result-brand,
    .result-price,
    .result-category {
        font-size: 0.8rem;
    }
    
    .suggestion-tags {
        justify-content: center;
    }
    
    .suggestion-tag {
        font-size: 0.75rem;
        padding: 0.25rem 0.6rem;
    }
    
    .search-suggestions-inline {
        margin: 0.5rem;
        padding: 0.75rem;
    }
}

@media (max-width: 480px) {
    .search-suggestions,
    .search-results {
        left: -0.5rem;
        right: -0.5rem;
        border-radius: 8px;
    }
    
    .search-result-item {
        padding: 0.5rem 0.75rem;
        gap: 0.5rem;
    }
    
    .result-image {
        width: 35px;
        height: 35px;
    }
    
    .result-title {
        font-size: 0.85rem;
    }
    
    .result-brand,
    .result-price,
    .result-category {
        font-size: 0.75rem;
    }
}
