/* STEM Product Search Widget Styles */

.stem-search-widget {
    margin: 40px 0;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

/* Search Container */
.stem-search-container {
    position: relative;
}

/* Search Bar Styles */
.stem-search-bar {
    display: flex;
    align-items: center;
    background: #ffffff;
    border: 2px solid #e2e8f0;
    border-radius: 25px;
    padding: 8px 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.stem-search-bar:hover {
    border-color: #667eea;
    box-shadow: 0 15px 50px rgba(102, 126, 234, 0.15);
}

.stem-search-bar:focus-within {
    border-color: #667eea;
    box-shadow: 0 15px 50px rgba(102, 126, 234, 0.2);
    transform: translateY(-2px);
}

/* Search Icon */
.stem-search-icon {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    color: #718096;
    transition: color 0.3s ease;
}

.stem-search-bar:focus-within .stem-search-icon {
    color: #667eea;
}

/* Search Input */
.stem-search-input {
    flex: 1;
    border: none;
    outline: none;
    padding: 12px 16px;
    font-size: 1.1rem;
    font-weight: 400;
    background: transparent;
    color: #2d3748;
}

.stem-search-input::placeholder {
    color: #a0aec0;
    font-style: italic;
}

/* Category Filter */
.stem-category-filter {
    border: none;
    outline: none;
    padding: 10px 16px;
    margin-right: 12px;
    background: #f7fafc;
    border-radius: 15px;
    color: #4a5568;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
    cursor: pointer;
}

.stem-category-filter:hover {
    background: #edf2f7;
}

.stem-category-filter:focus {
    background: #e2e8f0;
}

/* Search Submit Button */
.stem-search-submit {
    background: linear-gradient(135deg, var(--e-global-color-astglobalcolor0) 0%, var(--e-global-color-astglobalcolor1) 100%);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.stem-search-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}

.stem-search-submit:active {
    transform: translateY(0);
}

/* Advanced Filters */
.stem-advanced-filters {
    display: flex;
    gap: 20px;
    margin-top: 20px;
    padding: 20px;
    background: #f8fafc;
    border-radius: 16px;
    border: 1px solid #e2e8f0;
}

.stem-filter-group {
    flex: 1;
}

.stem-filter-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: #4a5568;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stem-price-range {
    display: flex;
    align-items: center;
    gap: 8px;
}

.stem-price-min,
.stem-price-max,
.stem-age-filter {
    padding: 10px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: white;
    color: #2d3748;
    font-size: 0.9rem;
    outline: none;
    transition: border-color 0.3s ease;
}

.stem-price-min:focus,
.stem-price-max:focus,
.stem-age-filter:focus {
    border-color: #667eea;
}

.stem-age-filter {
    width: 100%;
}

/* Search Suggestions */
.stem-search-suggestions {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.stem-suggestions-label {
    font-size: 0.9rem;
    color: #718096;
    font-weight: 500;
    white-space: nowrap;
}

.stem-suggestion-tag {
    background: #edf2f7;
    color: #4a5568;
    border: none;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.stem-suggestion-tag:hover {
    background: #667eea;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

/* Search Results */
.stem-search-results {
    margin-top: 30px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.stem-results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
}

.stem-results-count {
    font-weight: 600;
    color: #2d3748;
}

.stem-clear-search {
    background: none;
    border: none;
    color: #667eea;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    text-decoration: underline;
}

.stem-clear-search:hover {
    color: #5a67d8;
}

.stem-results-grid {
    padding: 24px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
}

/* Loading State */
.stem-results-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    color: #718096;
}

.stem-loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #e2e8f0;
    border-top: 3px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 16px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* No Results State */
.stem-no-results {
    text-align: center;
    padding: 60px 20px;
    color: #718096;
}

.stem-no-results-icon {
    font-size: 3rem;
    margin-bottom: 16px;
    opacity: 0.5;
}

.stem-no-results h3 {
    font-size: 1.25rem;
    color: #2d3748;
    margin: 0 0 8px 0;
}

.stem-no-results p {
    font-size: 0.95rem;
    margin: 0;
}

/* Style Variations */

/* Modern Hero Search */
.stem-search-style-modern .stem-search-bar {
    background: linear-gradient(145deg, #ffffff 0%, #f8fafc 100%);
    border: 2px solid #e2e8f0;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.1);
}

.stem-search-style-modern .stem-search-submit {
    /* background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); */
}

/* Minimal Clean */
.stem-search-style-minimal .stem-search-bar {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    border-radius: 12px;
}

.stem-search-style-minimal .stem-search-submit {
    background: #2d3748;
    border-radius: 8px;
}

.stem-search-style-minimal .stem-suggestion-tag:hover {
    background: #2d3748;
}

/* Playful STEM */
.stem-search-style-playful .stem-search-bar {
    background: linear-gradient(145deg, #fff5f5 0%, #fed7d7 100%);
    border: 3px solid #feb2b2;
    border-radius: 30px;
}

.stem-search-style-playful .stem-search-submit {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a52 100%);
    border-radius: 25px;
}

.stem-search-style-playful .stem-suggestion-tag {
    background: linear-gradient(135deg, #ffeaa7, #fdcb6e);
    color: #2d3748;
    border-radius: 25px;
}

.stem-search-style-playful .stem-suggestion-tag:hover {
    background: linear-gradient(135deg, #ff6b6b, #ee5a52);
    color: white;
}

/* Advanced Style */
.stem-search-style-advanced .stem-search-container {
    background: white;
    padding: 30px;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.1);
    border: 1px solid #e2e8f0;
}

/* Responsive Design */
@media (max-width: 768px) {
    .stem-search-widget {
        margin: 20px 0;
    }
    
    .stem-search-bar {
        flex-direction: column;
        gap: 12px;
        padding: 16px;
        border-radius: 16px;
    }
    
    .stem-search-input {
        width: 100%;
        text-align: center;
    }
    
    .stem-category-filter {
        width: 100%;
        margin-right: 0;
    }
    
    .stem-search-submit {
        width: 100%;
        justify-content: center;
        padding: 14px 24px;
    }
    
    .stem-advanced-filters {
        flex-direction: column;
        gap: 16px;
    }
    
    .stem-search-suggestions {
        justify-content: center;
    }
    
    .stem-suggestions-label {
        width: 100%;
        text-align: center;
        margin-bottom: 8px;
    }
    
    .stem-results-header {
        flex-direction: column;
        gap: 12px;
        text-align: center;
    }
    
    .stem-results-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 16px;
        padding: 16px;
    }
}

@media (max-width: 480px) {
    .stem-search-bar {
        padding: 12px;
    }
    
    .stem-search-input {
        font-size: 1rem;
        padding: 10px 12px;
    }
    
    .stem-search-submit {
        padding: 12px 20px;
        font-size: 0.85rem;
    }
    
    .stem-suggestion-tag {
        font-size: 0.8rem;
        padding: 6px 12px;
    }
    
    .stem-results-grid {
        grid-template-columns: 1fr;
    }
}

/* Focus and Accessibility */
.stem-search-input:focus,
.stem-category-filter:focus,
.stem-search-submit:focus,
.stem-suggestion-tag:focus {
    outline: 3px solid rgba(102, 126, 234, 0.3);
    outline-offset: 2px;
}

/* Animation for search bar */
@keyframes searchPulse {
    0% { box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1); }
    50% { box-shadow: 0 15px 50px rgba(102, 126, 234, 0.15); }
    100% { box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1); }
}

.stem-search-bar.searching {
    animation: searchPulse 2s ease-in-out infinite;
}