/* В файл local-filters2.css добавьте: */
.no-filters-msg {
    grid-column: 1 / -1;
    text-align: center;
    padding: 40px;
    color: #6c757d;
    font-size: 16px;
    background: #f8f9fa;
    border-radius: 8px;
    margin: 20px 0;
}
/* ============================================
   POPUP ФИЛЬТРЫ ЛОКАЛЬНЫХ АТРИБУТОВ
   ============================================ */

/* Кнопка открытия фильтров */
.filter-toggle-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 9998;
    background: linear-gradient(90deg, #D30000 0%, #6D0000 100%);
    color: white;
    border: none;
    border-radius: 50px;
    padding: 15px 25px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
}

.filter-toggle-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
}

.filter-toggle-btn .filter-icon {
    font-size: 20px;
}

.filter-toggle-btn .filter-count {
    background: linear-gradient(90deg, #D30000 0%, #6D0000 100%);
    color: white;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
}

/* Popup контейнер */
.filter-popup-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 9999;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.filter-popup-overlay.active {
    display: block;
    opacity: 1;
}

.filter-popup-container {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    width: 90%;
    max-width: 1200px;
    max-height: 85vh;
    /*background: white;*/
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    opacity: 0;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
}

.filter-popup-container.active {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
}

/* Заголовок popup */
.filter-popup-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 11px 22px;
    /*background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);*/
    background-image: linear-gradient(90deg, #D30000 0%, #6D0000 100%);
    color: white;
}

.filter-popup-title {
    margin: 0;
    font-size: 24px;
    font-weight: 700;
}

.filter-popup-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 24px;
    line-height: 20px;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    transition: background 0.3s ease;
}

.filter-popup-close:hover {
    background: rgba(255, 255, 255, 0.3);
    /*transform: rotate(90deg);*/
}

/* Основное содержимое */
.filter-popup-content {
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    padding: 0;
}

/* Секция групп фильтров */
.filter-groups-container {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
    background: #171717;
}

/* Контейнер групп фильтров в 3 колонки */
.filter-groups-grid {
    display: flex;
    flex-direction: column;
    grid-template-columns: repeat(3, 1fr);
    gap: 0px;
}

/* Загрузка */
.filter-loading {
    grid-column: 1 / -1;
    text-align: center;
    padding: 40px;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 15px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Одна группа фильтров */
.filter-group {
    background: #3c3c47;
    border-radius: 12px;
    border: 1px solid #d30000;
    overflow: hidden;
    transition: all 0.3s ease;
    width: 100% !important;
}

.filter-group:hover {
    /*border-color: #667eea;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.1);*/
}

/* Заголовок группы */
.filter-group-header {
    padding: 6px 10px;
    background: #3c3c47;
    border-bottom: 1px solid #d30000;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background 0.3s ease;
}

.filter-group-header:hover {
    background: #d3000069;
}

.filter-group-header.active {
    background: #d30000;
    color: white;
}

.filter-group-name {
    font-weight: 600;
    font-size: 16px;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    color: #fff;
}

.filter-group-toggle {
    font-weight: bold;
    font-size: 20px;
    color: #6c757d;
    transition: all 0.3s ease;
}

.filter-group-header.active .filter-group-toggle {
    color: white;
}

/* Контент группы - 3 колонки для значений */
.filter-group-content {
    padding: 10px;
    display: none;
}

.filter-group-content.active {
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: #3c3c47;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Чекбокс с равной шириной */
.filter-checkbox-item {
    display: flex;
    align-items: center;
    padding: 5px 12px;
    background: #3c3c47;
    border: 1px solid #ffffff36;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    min-height: 40px;
    width: 100%;
    box-sizing: border-box;
    margin-bottom: 5px;
}

.filter-checkbox-item:hover {
    border-color: #d30000;
    background: #3c3c47;
}

.filter-checkbox-item.checked {
    border-color: #d30000;
    background: #3c3c47;
    position: relative;
    overflow: hidden;
}

.filter-checkbox-item.checked::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 0 30px 30px 0;
    border-color: transparent #d30000 transparent transparent;
}

.filter-checkbox-item.checked::after {
    content: '✓';
    position: absolute;
    top: 2px;
    right: 4px;
    color: white;
    font-size: 12px;
    font-weight: bold;
}

.filter-checkbox {
    display: none;
}

.filter-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    cursor: pointer;
    margin: 0;
}

.filter-text {
    flex: 1;
    font-size: 14px;
    color: #fff;
    font-weight: 400;
    /*white-space: nowrap;*/
    overflow: hidden;
    text-overflow: ellipsis;
    margin-right: 10px;
}

.filter-checkbox-item.checked .filter-text {
    color: #fff;
    font-weight: 300;
}

/* Количество товаров - фиксированная ширина */
.filter-count {
    /*min-width: 50px;*/
    width: fit-content;
    text-align: right;
    font-size: 12px;
    color: #6c757d;
    background: #f8f9fa;
    padding: 4px 8px;
    border-radius: 12px;
    transition: all 0.2s ease;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.filter-checkbox-item:hover .filter-count {
    background: #e9ecef;
}

.filter-checkbox-item.checked .filter-count {
    background: #d30000;
    color: white;
}

/* Диапазон значений */
.filter-range-group {
    grid-column: 1 / -1;
    background: #3c3c47;
    padding: 20px;
    border-radius: 12px;
    border: 1px solid #ffffff36;
}

.range-title {
    font-weight: 400;
    margin-bottom: 16px;
    color: #fff;
    font-size: 15px;
}

.range-inputs {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
}

.range-input-wrapper {
    flex: 1;
    position: relative;
}

.range-input-wrapper::before {
    content: attr(data-label);
    position: absolute;
    top: -20px;
    left: 0;
    font-size: 12px;
    color: #6c757d;
}

.range-input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.3s ease;
}

.range-input:focus {
    border-color: #667eea;
    outline: none;
}

.range-divider {
    color: #adb5bd;
    font-weight: bold;
}

/* Слайдер диапазона */
.range-slider-container {
    margin-top: 24px;
}

.range-slider {
    height: 6px;
    background: #e9ecef;
    border-radius: 3px;
    position: relative;
    margin: 20px 0 30px;
}

.range-track {
    position: absolute;
    height: 100%;
    background: linear-gradient(90deg, #D30000 0%, #6D0000 100%);
    border-radius: 3px;
}

.range-handle {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    background: white;
    border: 3px solid #d30000;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
    z-index: 1;
    transition: transform 0.2s ease;
}

.range-handle:hover {
    transform: translateY(-50%) scale(1.2);
}

.range-handle.min-handle {
    left: 0;
}

.range-handle.max-handle {
    right: 0;
}

/* Панель выбранных фильтров */
.selected-filters-panel {
    background: #171717;
    border-top: 1px solid #e9ecef;
    padding: 20px 32px;
    margin-top: auto;
}

.selected-filters-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 16px;
    color: #495057;
    display: flex;
    align-items: center;
    gap: 8px;
}

.selected-filters-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    min-height: 40px;
}

.selected-filter-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #3c3c47;
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 400;
    animation: badgeAppear 0.3s ease;
}
.selected-filter-badge span
{
    max-width: 200px;
    text-overflow: ellipsis;
    white-space: nowrap;
    overflow: hidden;
}

@keyframes badgeAppear {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.selected-filter-badge .remove-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
}

.selected-filter-badge .remove-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

/* Панель действий */
.filter-actions-panel {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 32px;
    background: #171717;
    /*border-top: 1px solid #e9ecef;*/
    gap: 16px;
}

.clear-filters-btn {
    background: #6c757d;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.clear-filters-btn:hover {
    background: #5a6268;
    transform: translateY(-2px);
}

.apply-filters-btn {
    background: linear-gradient(90deg, #D30000 0%, #6D0000 100%);
    color: white;
    border: none;
    padding: 12px 32px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 200px;
    justify-content: center;
}

.apply-filters-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgb(143 0 0 / 67%);
}
.apply-icon
{
    display: none;
}
.apply-filters-btn:active {
    transform: translateY(0);
}

/* ============================================
   АДАПТИВНОСТЬ
   ============================================ */

/* Планшеты (768px - 1024px) - 2 КОЛОНКИ */
@media (max-width: 1024px) {
    .filter-popup-container {
        width: 95%;
        max-height: 90vh;
    }
    
    .filter-groups-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .filter-group-content.active {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .filter-popup-header {
        padding: 20px 24px;
    }
    
    .filter-groups-container {
        padding: 24px;
    }
}

/* Мобильные устройства (до 768px) - 1 КОЛОНКА */
@media (max-width: 768px) {
    .filter-popup-container {
        width: 100%;
        height: 100vh;
        max-height: 100vh;
        border-radius: 0;
        top: 0;
        left: 0;
        transform: translate(0, 0) scale(1);
    }
    
    .filter-popup-container.active {
        transform: translate(0, 0) scale(1);
    }
    
    .filter-groups-grid {
        grid-template-columns: 1fr;
        gap: 5px;
    }
    
    .filter-group-content.active {
        grid-template-columns: 1fr;
    }
    
    .filter-popup-header {
        padding: 16px 20px;
    }
    
    .filter-groups-container {
        padding: 20px;
        overflow-y: auto;
    }
    
    .filter-toggle-btn {
        bottom: 20px;
        right: 20px;
        padding: 12px 20px;
        font-size: 14px;
    }
    
    .filter-actions-panel {
        flex-direction: column;
        padding: 16px 20px;
    }
    
    .apply-filters-btn,
    .clear-filters-btn {
        width: 100%;
        justify-content: center;
    }
    
    .selected-filters-panel {
        padding: 16px 20px;
    }
    
    .selected-filters-list {
        max-height: 120px;
        overflow-y: auto;
    }
    
    .filter-range-group {
        padding: 16px;
    }
    
    .range-inputs {
        /*flex-direction: column;*/
        gap: 12px;
    }
    
    .range-divider {
        display: none;
    }
}

/* Маленькие мобильные (до 480px) */
@media (max-width: 480px) {
    .filter-group-content.active
    {
        gap: 5px;
    }
    .filter-group-header {
        padding: 14px 16px;
    }
    
    .filter-group-content {
        padding: 16px;
    }
    
    .filter-checkbox-item {
        padding: 8px 10px;
        min-height: 44px;
    }
    
    .filter-text {
        font-size: 13px;
    }
    
    .filter-count {
        min-width: 40px;
        width: 40px;
        font-size: 11px;
        padding: 3px 6px;
    }
    
    .filter-popup-title {
        font-size: 20px;
    }
}