/**
 * Enhanced Product Search Styles
 */

/* Search input wrapper */
.search-input-wrapper {
    position: relative;
    margin-bottom: 10px;
}

/* Search suggestions dropdown */
.search-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #e5e7eb;
    border-top: none;
    border-radius: 0 0 8px 8px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    max-height: 400px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
}

.search-suggestions.active {
    display: block;
}

/* Suggestion item */
.suggestion-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    text-decoration: none;
    color: #374151;
    border-bottom: 1px solid #f3f4f6;
    transition: background-color 0.15s ease;
}

.suggestion-item:hover,
.suggestion-item.selected {
    background-color: #f9fafb;
}

.suggestion-item:last-of-type {
    border-bottom: none;
}

/* Suggestion image */
.suggestion-image {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid #e5e7eb;
    flex-shrink: 0;
}

.suggestion-image-placeholder {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
    border-radius: 6px;
    flex-shrink: 0;
}

/* Suggestion content */
.suggestion-content {
    flex: 1;
    min-width: 0;
}

.suggestion-name {
    font-size: 14px;
    font-weight: 500;
    color: #111827;
    margin-bottom: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.suggestion-name strong {
    color: #6366f1;
    font-weight: 600;
}

.suggestion-meta {
    font-size: 12px;
    color: #6b7280;
}

/* Suggestion right side */
.suggestion-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
    flex-shrink: 0;
}

.suggestion-price {
    font-size: 14px;
    font-weight: 600;
    color: #059669;
}

.suggestion-stock {
    font-size: 11px;
    padding: 2px 6px;
}

/* Suggestion footer */
.suggestion-footer {
    padding: 10px 12px;
    text-align: center;
    border-top: 1px solid #e5e7eb;
    background: #f9fafb;
}

.btn-link-primary {
    background: none;
    border: none;
    color: #6366f1;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    padding: 6px 12px;
    border-radius: 6px;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.btn-link-primary:hover {
    background: #eef2ff;
    color: #4f46e5;
}

/* Advanced search toggle */
.advanced-search-toggle {
    margin: 10px 0;
    text-align: center;
}

.btn-link {
    background: none;
    border: none;
    color: #6366f1;
    font-size: 13px;
    cursor: pointer;
    padding: 6px 0;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: color 0.2s ease;
}

.btn-link:hover {
    color: #4f46e5;
}

.btn-link svg {
    transition: transform 0.3s ease;
}

/* Advanced search options */
.advanced-search-options {
    padding: 12px;
    background: #f9fafb;
    border-radius: 6px;
    margin-bottom: 12px;
}

.advanced-search-options .form-group {
    margin-bottom: 12px;
}

.advanced-search-options .form-group:last-child {
    margin-bottom: 0;
}

.filter-label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: #374151;
    margin-bottom: 6px;
}

.filter-select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    color: #374151;
    background: white;
    cursor: pointer;
    transition: border-color 0.2s ease;
}

.filter-select:focus {
    outline: none;
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

/* Price filter */
.price-filter-form {
    margin: 0;
}

.price-inputs {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    margin-bottom: 12px;
}

.price-input-group {
    flex: 1;
}

.filter-label-small {
    display: block;
    font-size: 12px;
    font-weight: 500;
    color: #6b7280;
    margin-bottom: 4px;
}

.filter-input-small {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    color: #374151;
}

.filter-input-small:focus {
    outline: none;
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.price-separator {
    font-size: 18px;
    font-weight: 600;
    color: #9ca3af;
    padding-bottom: 8px;
}

/* Stock badges */
.stock-badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.stock-badge.stock-in {
    background: #d1fae5;
    color: #065f46;
}

.stock-badge.stock-out {
    background: #fee2e2;
    color: #991b1b;
}

.stock-badge.stock-backorder {
    background: #fef3c7;
    color: #92400e;
}

/* Button styles */
.btn-secondary {
    background: #6b7280;
    color: white;
    border: none;
    padding: 10px 16px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s ease;
}

.btn-secondary:hover {
    background: #4b5563;
}

.btn-sm {
    padding: 8px 14px;
    font-size: 13px;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .search-suggestions {
        max-height: 300px;
    }

    .suggestion-item {
        padding: 8px 10px;
        gap: 10px;
    }

    .suggestion-image,
    .suggestion-image-placeholder {
        width: 40px;
        height: 40px;
    }

    .suggestion-name {
        font-size: 13px;
    }

    .suggestion-meta {
        font-size: 11px;
    }

    .suggestion-price {
        font-size: 13px;
    }

    .price-inputs {
        flex-direction: column;
        gap: 12px;
    }

    .price-separator {
        display: none;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .search-suggestions {
        background: #1f2937;
        border-color: #374151;
    }

    .suggestion-item {
        color: #e5e7eb;
        border-bottom-color: #374151;
    }

    .suggestion-item:hover,
    .suggestion-item.selected {
        background-color: #374151;
    }

    .suggestion-name {
        color: #f9fafb;
    }

    .suggestion-meta {
        color: #9ca3af;
    }

    .suggestion-footer {
        background: #111827;
        border-top-color: #374151;
    }

    .advanced-search-options {
        background: #111827;
    }

    .filter-select,
    .filter-input-small {
        background: #1f2937;
        border-color: #374151;
        color: #e5e7eb;
    }
}
