/* Фильтры и сортировка */

.filters-section {
    background: transparent;
    border-bottom: none;
    padding: 16px 0;
    position: relative;
    z-index: 10;
    margin-top: -20px;
}

.filters-container {
    max-width: 1920px;
    margin: 0 auto;
    padding: 0 40px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    position: relative;
}

/* Фильтры по категориям */
.category-filters {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    flex: 1;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.category-filters::-webkit-scrollbar {
    display: none;
}

.filter-chip {
    padding: 8px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    background: white;
    color: #374151;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    flex-shrink: 0;
    min-width: 80px;
    text-align: center;
}

.filter-chip:hover {
    border-color: #3b82f6;
    color: #3b82f6;
    background: #eff6ff;
    transform: translateY(-1px);
}

.filter-chip.active {
    background: #3b82f6;
    color: white;
    border-color: #3b82f6;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
}

/* Сортировка */
.sort-dropdown {
    flex-shrink: 0;
}

.sort-select {
    padding: 8px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    background: white;
    color: #374151;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke-width='2' stroke='%233b82f6'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M8.25 15L12 18.75 15.75 15m-7.5-6L12 5.25 15.75 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 18px;
    padding-right: 38px;
    min-width: 180px;
}

.sort-select:hover {
    border-color: var(--primary);
}

.sort-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Кнопка фильтров для мобильных */
.mobile-filters-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    background: #3b82f6;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    width: 100%;
    transition: all 0.2s ease;
}

.mobile-filters-toggle:active {
    background: #2563eb;
    transform: scale(0.98);
}

.mobile-filters-toggle svg {
    width: 20px;
    height: 20px;
}

/* Выпадающее меню фильтров */
.mobile-filters-dropdown {
    display: none;
    flex-direction: column;
    gap: 10px;
    padding: 12px;
    background: rgba(18, 18, 18, 0.95);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin-top: 8px;
    z-index: 1000;
}

.mobile-filters-dropdown.active {
    display: flex;
}

/* Мобильная адаптация */
@media (max-width: 768px) {
    .filters-section {
        padding: 12px 0;
    }
    
    .filters-container {
        padding: 0 20px;
        flex-direction: column;
        align-items: stretch;
    }
    
    /* Показываем кнопку фильтров */
    .mobile-filters-toggle {
        display: flex;
    }
    
    /* Скрываем фильтры по умолчанию */
    .category-filters,
    .sort-dropdown {
        display: none;
    }
    
    /* Показываем фильтры в выпадающем меню */
    .mobile-filters-dropdown .category-filters,
    .mobile-filters-dropdown .sort-dropdown {
        display: flex;
    }
    
    .mobile-filters-dropdown .category-filters {
        flex-direction: column;
        gap: 8px;
        width: 100%;
    }
    
    .mobile-filters-dropdown .filter-chip {
        width: 100%;
        font-size: 14px;
        padding: 12px 16px;
        min-width: auto;
        background: rgba(255, 255, 255, 0.95);
        border: 1px solid rgba(255, 255, 255, 0.2);
    }
    
    .mobile-filters-dropdown .filter-chip.active {
        background: #3b82f6;
        color: white;
        border-color: #3b82f6;
    }
    
    .mobile-filters-dropdown .filter-chip:active {
        transform: scale(0.98);
    }
    
    .mobile-filters-dropdown .sort-dropdown {
        width: 100%;
    }
    
    .mobile-filters-dropdown .sort-select {
        width: 100%;
        font-size: 14px;
        padding: 12px 40px 12px 16px;
        min-width: auto;
        background: rgba(255, 255, 255, 0.95);
        border: 1px solid rgba(255, 255, 255, 0.2);
        text-align: center;
        text-align-last: center;
    }
}

@media (max-width: 480px) {
    .filters-container {
        padding: 0 16px;
    }
    
    .mobile-filters-toggle {
        font-size: 14px;
        padding: 10px 16px;
    }
    
    .mobile-filters-dropdown {
        padding: 10px;
        gap: 8px;
    }
    
    .mobile-filters-dropdown .filter-chip {
        font-size: 13px;
        padding: 11px 14px;
    }
    
    .mobile-filters-dropdown .sort-select {
        font-size: 13px;
        padding: 11px 38px 11px 14px;
        text-align: center;
        text-align-last: center;
    }
}
