/* Modern Arama ve Filtreleme Tasarımı - Tamamen Yenilendi */

/* Ana Container */
.search-and-filters {
    margin: 2rem 0;
    padding: 0;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

/* Arama Bölümü */
.search-container {
    position: relative;
    padding: 1.5rem;
    border-bottom: 1px solid #f3f4f6;
}

.search-box {
    position: relative;
    display: flex;
    align-items: center;
    background: #f9fafb;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.2s ease;
    max-width: 600px;
    margin: 0 auto;
}

.search-box:focus-within {
    border-color: #8b5cf6;
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
    background: #ffffff;
}

#productSearch {
    flex: 1;
    padding: 0.875rem 1rem;
    border: none;
    outline: none;
    font-size: 0.95rem;
    background: transparent;
    color: #374151;
}

#productSearch::placeholder {
    color: #9ca3af;
}

.search-btn, .clear-search {
    background: #8b5cf6;
    border: none;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 4px;
    transition: all 0.2s ease;
    font-size: 0.9rem;
}

.search-btn:hover {
    background: #7c3aed;
}

.clear-search {
    background: #ef4444;
}

.clear-search:hover {
    background: #dc2626;
}

/* Modern Kategori Bölümü */
.filter-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    padding: 2rem;
    justify-content: center;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
}

.filter-btn {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border: 1.5px solid #e2e8f0;
    color: #475569;
    padding: 0.75rem 1.25rem;
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    font-weight: 600;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 0.625rem;
    white-space: nowrap;
    position: relative;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    backdrop-filter: blur(10px);
}

.filter-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.6), transparent);
    transition: left 0.6s;
}

.filter-btn:hover::before {
    left: 100%;
}

.filter-btn:hover {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-color: #cbd5e1;
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12);
}

.filter-btn.active {
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 50%, #6d28d9 100%);
    border-color: #8b5cf6;
    color: white;
    transform: translateY(-3px) scale(1.05);
    box-shadow: 
        0 0 30px rgba(139, 92, 246, 0.4),
        0 10px 30px rgba(139, 92, 246, 0.3),
        0 0 0 1px rgba(139, 92, 246, 0.1);
    animation: activeGlow 2s ease-in-out infinite alternate;
}

@keyframes activeGlow {
    0% {
        box-shadow: 
            0 0 20px rgba(139, 92, 246, 0.4),
            0 8px 25px rgba(139, 92, 246, 0.3),
            0 0 0 1px rgba(139, 92, 246, 0.1);
    }
    100% {
        box-shadow: 
            0 0 35px rgba(139, 92, 246, 0.6),
            0 12px 35px rgba(139, 92, 246, 0.4),
            0 0 0 1px rgba(139, 92, 246, 0.2);
    }
}

.filter-btn.active::before {
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
}

.filter-count {
    background: rgba(71, 85, 105, 0.1);
    padding: 0.25rem 0.5rem;
    border-radius: 10px;
    font-size: 0.75rem;
    font-weight: 700;
    min-width: 22px;
    text-align: center;
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.filter-btn.active .filter-count {
    background: rgba(255, 255, 255, 0.25);
    color: white;
    border-color: rgba(255, 255, 255, 0.3);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.filter-btn:not(.active) .filter-count {
    background: rgba(71, 85, 105, 0.08);
    color: #64748b;
    border-color: rgba(71, 85, 105, 0.1);
}

/* Ultra Modern Sıralama Bölümü */
.sort-options {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 1.5rem;
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border-top: 1px solid #e2e8f0;
}

.sort-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: #475569;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.sort-label::before {
    content: '⚡';
    font-size: 1rem;
}

/* Custom Dropdown Container */
.custom-select {
    position: relative;
    min-width: 200px;
}

#sortSelect {
    appearance: none;
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border: 2px solid #e2e8f0;
    border-radius: 14px;
    padding: 0.875rem 3rem 0.875rem 1.25rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: #475569;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    width: 100%;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    position: relative;
    z-index: 1;
}

#sortSelect:hover {
    border-color: #cbd5e1;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

#sortSelect:focus {
    outline: none;
    border-color: #8b5cf6;
    background: #ffffff;
    transform: translateY(-2px);
    box-shadow: 
        0 0 0 3px rgba(139, 92, 246, 0.12),
        0 6px 20px rgba(139, 92, 246, 0.15);
}

/* Custom Arrow */
.custom-select::after {
    content: '';
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 8px solid #8b5cf6;
    pointer-events: none;
    transition: all 0.3s ease;
    z-index: 2;
}

.custom-select:hover::after {
    border-top-color: #7c3aed;
    transform: translateY(-50%) scale(1.1);
}

#sortSelect:focus + .custom-select::after,
.custom-select:focus-within::after {
    transform: translateY(-50%) rotate(180deg);
    border-top-color: #8b5cf6;
}

/* Modern Option Styling */
#sortSelect option {
    background: #ffffff;
    color: #475569;
    padding: 0.75rem;
    font-weight: 500;
    border: none;
}

#sortSelect option:hover {
    background: #f8fafc;
}

#sortSelect option:checked {
    background: linear-gradient(135deg, #8b5cf6, #7c3aed);
    color: white;
}

/* Arama Önerileri - Instant Results Kaldırıldı */
.search-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    max-height: 200px;
    overflow-y: auto;
    display: none;
    margin-top: 4px;
}

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

.suggestion-item {
    padding: 0.75rem 1rem;
    cursor: pointer;
    border-bottom: 1px solid #f3f4f6;
    transition: background 0.2s ease;
}

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

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

/* Instant Results Gizle */
.instant-results {
    display: none !important;
}

/* Mobil Optimizasyon */
@media (max-width: 768px) {
    .search-container {
        padding: 1rem;
    }
    
    .filter-buttons {
        padding: 1rem;
        overflow-x: auto;
        justify-content: flex-start;
        scrollbar-width: thin;
        scrollbar-color: #d1d5db #f9fafb;
    }
    
    .filter-buttons::-webkit-scrollbar {
        height: 4px;
    }
    
    .filter-buttons::-webkit-scrollbar-track {
        background: #f9fafb;
    }
    
    .filter-buttons::-webkit-scrollbar-thumb {
        background: #d1d5db;
        border-radius: 2px;
    }
    
    .filter-btn {
        flex-shrink: 0;
        padding: 0.625rem 1rem;
        font-size: 0.8rem;
        border-radius: 14px;
        gap: 0.5rem;
    }
    
    .filter-btn:hover {
        transform: translateY(-1px) scale(1.01);
    }
    
    .filter-btn.active {
        transform: translateY(-2px) scale(1.03);
    }
    
    .sort-options {
        padding: 0.75rem 1rem;
        flex-direction: column;
        gap: 0.5rem;
    }
    
    #sortSelect {
        width: 100%;
        max-width: 200px;
    }
}

@media (max-width: 480px) {
    .search-box {
        height: 44px;
    }
    
    #productSearch {
        padding: 0.75rem;
        font-size: 0.9rem;
    }
    
    .search-btn, .clear-search {
        width: 36px;
        height: 36px;
        font-size: 0.85rem;
    }
    
    .filter-btn {
        padding: 0.5rem 0.875rem;
        font-size: 0.75rem;
        border-radius: 12px;
    }
    
    .filter-count {
        font-size: 0.7rem;
        padding: 0.15rem 0.35rem;
        border-radius: 8px;
        min-width: 16px;
    }
}
