/* Enhanced Search Filter Styles - Complete Code */
.search-box {
    position: relative;
    display: flex;
    align-items: center;
    max-width: 600px;
    margin: 0 auto 0 calc(50%);
    transform: translateX(-50%);
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    overflow: hidden;
    background: white;
}

/* Search Input */
#productSearch {
    flex: 1;
    padding: 12px 16px;
    border: none;
    font-size: 16px;
    outline: none;
    background: transparent;
    color: var(--text-primary, #333);
}

#productSearch::placeholder {
    color: #999;
}

.search-box:focus-within {
    border-color: var(--blue-primary, #2981f9);
    box-shadow: 0 0 0 3px rgba(41, 129, 249, 0.1);
}

/* Search Button */
.search-btn {
    padding: 12px 16px;
    background: var(--blue-primary, #2981f9);
    color: white;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 48px;
    height: 48px;
}

.search-btn:hover {
    background: var(--blue-secondary, #1e6fd8);
}

.search-btn svg {
    width: 20px;
    height: 20px;
    stroke: currentColor;
}

/* Clear Button */
.search-clear-btn {
    position: absolute;
    right: 60px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    font-size: 18px;
    color: #999;
    cursor: pointer;
    padding: 4px;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 10;
}

.search-clear-btn.active {
    opacity: 1;
    visibility: visible;
}

.search-clear-btn:hover {
    background: rgba(0, 0, 0, 0.1);
    color: #666;
}

/* Search Suggestions */
.search-suggestions,
.search-suggestions.enhanced {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #e1e5e9;
    border-top: none;
    border-radius: 0 0 8px 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    max-height: 300px;
    overflow-y: auto;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
}

.search-suggestions.active,
.search-suggestions.enhanced.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.suggestion-item {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    cursor: pointer;
    border-bottom: 1px solid #f5f5f5;
    transition: all 0.2s ease;
}

.suggestion-item:last-child {
    border-bottom: none;
}

.suggestion-item:hover,
.suggestion-item.selected {
    background: rgba(41, 129, 249, 0.05);
    border-left: 3px solid var(--blue-primary, #2981f9);
}

.suggestion-icon {
    margin-right: 12px;
    font-size: 14px;
    opacity: 0.6;
}

.suggestion-content {
    flex: 1;
}

.suggestion-text {
    font-weight: 500;
    color: var(--text-primary, #333);
    margin-bottom: 2px;
}

.suggestion-text strong,
.highlight {
    background: rgba(41, 129, 249, 0.2);
    padding: 1px 2px;
    border-radius: 2px;
}

.suggestion-category {
    font-size: 12px;
    color: #666;
}

.suggestion-arrow {
    color: #999;
    font-size: 14px;
}

/* Search Results Overlay */
.search-results-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9998;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    backdrop-filter: blur(2px);
}

.search-results-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Search Results Container */
.search-results-container {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    width: 90%;
    max-width: 900px;
    max-height: 85vh;
    background: white;
    border-radius: 12px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

.search-results-container.active {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, -50%) scale(1);
}

/* Search Results Header */
.search-results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid #e1e5e9;
    background: #f8f9fa;
    position: sticky;
    top: 0;
    z-index: 10;
}

.search-results-title {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary, #333);
    margin: 0;
}

.search-results-close {
    background: none;
    border: none;
    font-size: 28px;
    color: #666;
    cursor: pointer;
    padding: 4px;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    line-height: 1;
}

.search-results-close:hover {
    background: rgba(0, 0, 0, 0.1);
    color: #333;
}

/* Search Results Content */
.search-results-content {
    padding: 24px;
    max-height: calc(85vh - 80px);
    overflow-y: auto;
}

/* Search Results Summary */
.search-results-summary {
    text-align: center;
    padding: 16px 0;
    border-bottom: 1px solid #e1e5e9;
    margin-bottom: 24px;
}

.search-results-summary p {
    margin: 0;
    font-size: 16px;
    color: #666;
}

/* Search Results List */
.search-results-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Individual Search Result Item */
.search-result-item {
    background: white;
    border: 1px solid #e1e5e9;
    border-radius: 8px;
    padding: 20px;
    transition: all 0.3s ease;
    cursor: pointer;
}

.search-result-item:hover {
    border-color: var(--blue-primary, #2981f9);
    box-shadow: 0 4px 12px rgba(41, 129, 249, 0.1);
    transform: translateY(-2px);
}

/* Result Item Header */
.result-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}

.result-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary, #333);
    margin: 0 0 4px 0;
    line-height: 1.3;
}

.result-category {
    background: var(--blue-primary, #2981f9);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
}

/* Result Content */
.result-subcategory {
    color: #666;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 8px;
}

.result-description {
    color: #555;
    font-size: 14px;
    line-height: 1.5;
    margin-bottom: 16px;
}

/* Result Actions */
.result-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.result-action-btn,
.result-quote-btn {
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.result-action-btn {
    background: #f8f9fa;
    color: var(--text-primary, #333);
    border: 1px solid #e1e5e9;
}

.result-action-btn:hover {
    background: #e9ecef;
    transform: translateY(-1px);
}

.result-quote-btn {
    background: var(--blue-primary, #2981f9);
    color: white;
}

.result-quote-btn:hover {
    background: var(--blue-secondary, #1e6fd8);
    transform: translateY(-1px);
}

/* No Results Page */
.no-results-page {
    text-align: center;
    padding: 60px 20px;
}

.no-results-icon {
    font-size: 64px;
    margin-bottom: 20px;
    opacity: 0.5;
}

.no-results-title {
    font-size: 24px;
    color: #333;
    margin-bottom: 12px;
    font-weight: 600;
}

.no-results-description {
    font-size: 16px;
    color: #666;
    margin-bottom: 30px;
    line-height: 1.5;
}

/* Light Blur-based Highlighting - No Elevation */
.product-highlight,
.section-highlight {
    backdrop-filter: blur(0.5px) !important;
    position: relative !important;
    z-index: 2 !important;
    border-radius: 8px !important;
    border: 1px solid transparent !important;
    transition: all 0.6s ease !important;
    transform: none !important;
}

.product-highlight::before,
.section-highlight::before {
    content: '';
    position: absolute;
    border-radius: 10px;
    z-index: -1;
    filter: blur(2px);
}

/* Product Highlighting - Light Effect */
.product-highlight {
    animation: lightBlurHighlight 4s ease-in-out;
    box-shadow: 0 0 12px 4px rgba(41, 129, 249, 0.08), 
                0 0 24px 8px rgba(41, 129, 249, 0.04) !important;
    background: rgba(41, 129, 249, 0.01) !important;
}

.product-highlight::before {
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, 
        rgba(41, 129, 249, 0.05), 
        rgba(41, 129, 249, 0.02), 
        rgba(41, 129, 249, 0.05));
    opacity: 0.3;
    animation: lightGradientShift 4s ease-in-out;
}

@keyframes lightBlurHighlight {
    0%, 100% { 
        box-shadow: 0 0 12px 4px rgba(41, 129, 249, 0.08), 
                    0 0 24px 8px rgba(41, 129, 249, 0.04);
        border-color: rgba(41, 129, 249, 0.2);
        backdrop-filter: blur(0.5px);
        background: rgba(41, 129, 249, 0.01);
    }
    50% { 
        box-shadow: 0 0 16px 6px rgba(41, 129, 249, 0.12), 
                    0 0 32px 12px rgba(41, 129, 249, 0.06);
        border-color: rgba(30, 111, 216, 0.3);
        backdrop-filter: blur(1px);
        background: rgba(41, 129, 249, 0.02);
    }
}

@keyframes lightGradientShift {
    0%, 100% {
        background: linear-gradient(45deg, 
            rgba(41, 129, 249, 0.04), 
            rgba(41, 129, 249, 0.01), 
            rgba(41, 129, 249, 0.04));
        opacity: 0.2;
    }
    50% {
        background: linear-gradient(45deg, 
            rgba(41, 129, 249, 0.08), 
            rgba(41, 129, 249, 0.04), 
            rgba(41, 129, 249, 0.08));
        opacity: 0.4;
    }
}

/* Section Highlighting - Light Effect, No Elevation */
.section-highlight {
    animation: lightSectionHighlight 3s ease-in-out !important;
    box-shadow: 0 0 10px 3px rgba(41, 129, 249, 0.06), 
                0 0 20px 6px rgba(41, 129, 249, 0.03) !important;
    background: rgba(41, 129, 249, 0.008) !important;
}

.section-highlight::before {
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, 
        rgba(41, 129, 249, 0.04), 
        rgba(41, 129, 249, 0.01), 
        rgba(41, 129, 249, 0.04));
    border-radius: 10px;
    filter: blur(2px);
    opacity: 0.25;
    animation: lightSectionGradient 3s ease-in-out;
}

@keyframes lightSectionHighlight {
    0%, 100% { 
        box-shadow: 0 0 10px 3px rgba(41, 129, 249, 0.06), 
                    0 0 20px 6px rgba(41, 129, 249, 0.03);
        border-color: rgba(41, 129, 249, 0.15);
        backdrop-filter: blur(0.5px);
        background: rgba(41, 129, 249, 0.008);
    }
    50% { 
        box-shadow: 0 0 14px 5px rgba(41, 129, 249, 0.09), 
                    0 0 28px 10px rgba(41, 129, 249, 0.045);
        border-color: rgba(30, 111, 216, 0.25);
        backdrop-filter: blur(0.8px);
        background: rgba(41, 129, 249, 0.015);
    }
}

@keyframes lightSectionGradient {
    0%, 100% {
        background: linear-gradient(45deg, 
            rgba(41, 129, 249, 0.03), 
            rgba(41, 129, 249, 0.008), 
            rgba(41, 129, 249, 0.03));
        opacity: 0.15;
    }
    50% {
        background: linear-gradient(45deg, 
            rgba(41, 129, 249, 0.06), 
            rgba(41, 129, 249, 0.02), 
            rgba(41, 129, 249, 0.06));
        opacity: 0.3;
    }
}

/* Search Status Messages */
.search-status {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    z-index: 10001;
    opacity: 0;
    visibility: hidden;
    transform: translateX(100px);
    transition: all 0.3s ease;
    max-width: 350px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.search-status.active {
    opacity: 1;
    visibility: visible;
    transform: translateX(0);
}

.search-status.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.search-status.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.search-status.info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* Categories Block */
.categories-block {
    max-width: 800px;
    margin: 20px auto 0;
    padding: 0 20px;
}

.categories-title {
    text-align: center;
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary, #333);
    margin-bottom: 16px;
}

.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
    justify-content: center;
}

.category-item {
    background: white;
    border: 1px solid #e1e5e9;
    border-radius: 8px;
    padding: 12px 16px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary, #333);
}

.category-item:hover {
    border-color: var(--blue-primary, #2981f9);
    background: rgba(41, 129, 249, 0.05);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(41, 129, 249, 0.15);
}

/* Scrollbar Styling */
.search-suggestions::-webkit-scrollbar,
.search-results-content::-webkit-scrollbar {
    width: 6px;
}

.search-suggestions::-webkit-scrollbar-track,
.search-results-content::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.search-suggestions::-webkit-scrollbar-thumb,
.search-results-content::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.search-suggestions::-webkit-scrollbar-thumb:hover,
.search-results-content::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Body scroll lock when overlay is active */
body.search-overlay-active {
    overflow: hidden;
}

/* Responsive Design */
@media (max-width: 768px) {
    .search-box {
        max-width: calc(100% - 32px);
        margin: 0 auto;
        left: 50%;
        transform: translateX(-50%);
        position: relative;
    }
    
    #productSearch {
        padding: 10px 12px;
        font-size: 16px;
    }
    
    .search-btn {
        padding: 10px 12px;
        min-width: 44px;
        height: 44px;
    }
    
    .search-clear-btn {
        right: 56px;
    }
    
    .search-results-container {
        width: 95%;
        max-height: 90vh;
        margin: 0;
    }
    
    .search-results-content {
        padding: 16px;
    }
    
    .search-result-item {
        padding: 16px;
    }
    
    .result-title {
        font-size: 16px;
    }
    
    .result-actions {
        flex-direction: column;
    }
    
    .result-action-btn,
    .result-quote-btn {
        width: 100%;
        justify-content: center;
    }
    
    .categories-block {
        margin: 20px 16px 0;
        padding: 0;
    }
    
    .categories-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        gap: 10px;
    }
    
    .category-item {
        padding: 10px 12px;
        font-size: 13px;
    }
    
    .search-status {
        right: 16px;
        left: 16px;
        max-width: none;
        transform: translateY(-100px);
    }
    
    .search-status.active {
        transform: translateY(0);
    }
}

@media (max-width: 480px) {
    .search-box {
        max-width: calc(100% - 24px);
        margin: 0 auto;
        left: 50%;
        transform: translateX(-50%);
        position: relative;
    }
    
    .search-results-container {
        width: 98%;
        max-height: 95vh;
    }
    
    .search-results-header {
        padding: 16px 20px;
    }
    
    .search-results-title {
        font-size: 18px;
    }
    
    .search-results-close {
        width: 32px;
        height: 32px;
        font-size: 24px;
    }
    
    .search-results-content {
        padding: 12px;
    }
    
    .search-result-item {
        padding: 12px;
    }
    
    .result-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .result-category {
        align-self: flex-start;
    }
}
