/* Search Suggestions Styles */
.search-suggestions {
    position: absolute;
    top: 100%;
    right: 0;
    width: 400px;
    max-height: 400px;
    background: white;
    border: 1px solid #e1e5e9;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    display: none;
    overflow: hidden;
    animation: fadeIn 0.2s ease-in-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.suggestions-container {
    max-height: 400px;
    overflow-y: auto;
}

.suggestion-item {
    padding: 12px 16px;
    cursor: pointer;
    border-bottom: 1px solid #f3f4f6;
    transition: background-color 0.2s ease;
    display: block;
    text-decoration: none;
    color: #333;
    position: relative;
    z-index: 10;
    pointer-events: auto;
}

.suggestion-item:hover,
.suggestion-item.active {
    background-color: #f8fafc;
    outline: none;
}

.suggestion-item:last-child {
    border-bottom: none;
}

.suggestion-item.loading {
    cursor: default;
    pointer-events: none;
}

.suggestion-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.suggestion-image {
    width: 40px;
    height: 40px;
    border-radius: 6px;
    overflow: hidden;
    flex-shrink: 0;
    border: 1px solid #e5e7eb;
    background-color: #f3f4f6;
}

.suggestion-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.suggestion-text {
    flex: 1;
    min-width: 0;
}

.suggestion-title {
    font-size: 14px;
    font-weight: 500;
    color: #1f2937;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin: 0;
}

.suggestion-subtitle {
    font-size: 12px;
    color: #6b7280;
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Loading spinner styles */
.loading-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid #ffffff;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Enhanced search input styles */
.header-search input[type="text"] {
    width: 100%;
    padding: 12px 45px 12px 16px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    font-size: 14px;
    outline: none;
    transition: all 0.2s ease;
    background-color: white;
    margin-left: 11px;
}

.header-search input[type="text"]:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.header-search button {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: background-color 0.2s ease;
}

.header-search button:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

.header-search button:disabled {
    cursor: not-allowed;
    opacity: 0.5;
}

/* Search results page styles */
.bd-product__result h4 {
    font-size: 18px;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 4px;
}

.bd-product__result p.text-muted {
    font-size: 14px;
    color: #6b7280;
    margin: 0;
}

/* Search form on results page */
.search-form-results {
    margin-bottom: 20px;
    display: flex;
    gap: 10px;
}

.search-form-results input[type="text"] {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    font-size: 14px;
    outline: none;
}

.search-form-results button {
    padding: 12px 24px;
    background-color: #3b82f6;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: background-color 0.2s ease;
}

.search-form-results button:hover {
    background-color: #2563eb;
}

/* Back to search link */
.back-to-search {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #3b82f6;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    padding: 8px 12px;
    border-radius: 6px;
    transition: background-color 0.2s ease;
}

.back-to-search:hover {
    background-color: #f3f4f6;
    text-decoration: none;
    color: #3b82f6;
}

/* Responsive styles */
@media (max-width: 768px) {
    .search-suggestions {
        width: 100%;
        right: 0;
        left: 0;
        max-width: none;
    }
    
    .suggestion-content {
        gap: 8px;
    }
    
    .suggestion-image {
        width: 32px;
        height: 32px;
    }
    
    .suggestion-title {
        font-size: 13px;
    }
    
    .suggestion-subtitle {
        font-size: 11px;
    }
}

/* Scrollbar styling for suggestions */
.suggestions-container::-webkit-scrollbar {
    width: 6px;
}

.suggestions-container::-webkit-scrollbar-track {
    background: #f1f5f9;
}

.suggestions-container::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

.suggestions-container::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* No results message */
.no-suggestions {
    padding: 16px;
    text-align: center;
    color: #6b7280;
    font-size: 14px;
    border-bottom: 1px solid #f3f4f6;
}

/* Product grid improvements for better loading experience */
.product-item {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.product-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Price on request button styling */
/* .price-on-request-btn {
    background-color: #ef4444;
    border-color: #ef4444;
    color: white;
    transition: all 0.2s ease;
}

.price-on-request-btn:hover {
    background-color: #dc2626;
    border-color: #dc2626;
    color: white;
} */

/* Loading overlay for search results */
.search-loading {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.8);
    z-index: 9999;
    justify-content: center;
    align-items: center;
}

.search-loading.active {
    display: flex;
}

.search-loading .spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f4f6;
    border-top: 4px solid #3b82f6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}