/* Основные стили каталога */
.catalog {
    background-color: #ffffff;
}

.catalog-header {
    display: flex;
    flex-direction: column;
    gap: 25px;
    margin-bottom: 40px;
}

.title-catalog {
    margin: 0;
    color: #1a365d;
    font-size: 2.25rem;
    font-weight: 700;
    line-height: 1.2;
}

/* СТИЛЬ ФИЛЬТРА - ОСНОВНЫЕ ИЗМЕНЕНИЯ */
.filter__top {
    background: #0450A0;
    border-radius: 12px;
    padding: 25px 20px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid #01050b;
}

.filter-controls {
    display: grid;
    transition: all 0.3s ease;
}

.filter-select-wrapper {
    position: relative;
    display: flex;
    flex-direction: column;
}

.filter-select-label {
    font-size: 0.85rem;
    color: #ffffff;
    margin-bottom: 8px;
    padding-left: 10px;
    font-weight: 500;
}

/* КНОПКИ - ОСНОВНЫЕ ИЗМЕНЕНИЯ */
.filter-actions {
    display: flex;
    gap: 10px;
    align-items: flex-end;
}

.filter-button {
    padding: 12px 24px;
    background-color: #3182ce;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
    box-shadow: 0 2px 6px rgba(49, 130, 206, 0.3);
}

.filter-button:hover {
    background-color: #2b6cb0;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(49, 130, 206, 0.4);
}

.filter-reset {
    padding: 12px 15px;
    background-color: white;
    color: #4a5568;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.filter-reset:hover {
    background-color: #f7fafc;
    border-color: #cbd5e0;
    color: #2d3748;
}

/* Мобильное меню фильтров */
.mobile-filter-toggle {
    display: none;
    padding: 14px 20px;
    background: white;
    color: #3182ce;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    margin-bottom: 20px;
    width: 100%;
    justify-content: center;
    align-items: center;
    gap: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.mobile-filter-toggle svg {
    transition: transform 0.3s ease;
    stroke: #3182ce;
}

.mobile-filter-toggle.active svg {
    transform: rotate(180deg);
}

/* Стили для чипсов */
.chips-container {
    display: flex;
    flex-wrap: wrap;
    /* Добавляем перенос на новую строку */
    gap: 8px;
    min-height: 40px;
    margin-top: 15px;
}

.chip {
    display: flex;
    align-items: center;
    background: #e2e8f0;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    color: #2d3748;
    max-width: 100%;
}

.chip-remove {
    background: none;
    border: none;
    cursor: pointer;
    margin-left: 6px;
    font-size: 1.1rem;
    line-height: 1;
    color: #718096;
}

/* Стили для кастомных dropdown */
.custom-dropdown {
    position: relative;
    width: 100%;
}

.dropdown-toggle {
    padding: 12px 40px 12px 15px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background-color: white;
    font-size: 0.95rem;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.dropdown-arrow {
    transition: transform 0.3s ease;
}

.dropdown-toggle.active .dropdown-arrow {
    transform: rotate(180deg);
}

.dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    max-height: 300px;
    overflow-y: auto;
    z-index: 100;
    margin-top: 5px;
    padding: 10px 0;
    transition: opacity 0.3s ease, transform 0.3s ease;
    opacity: 0;
    transform: translateY(10px);
    pointer-events: none;
}

.dropdown-menu.show {
    display: block;
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.dropdown-item {
    padding: 8px 15px;
    display: flex;
    align-items: center;
    white-space: normal;
    word-wrap: break-word;
}

.dropdown-item input[type="checkbox"] {
    margin-right: 10px;
    flex-shrink: 0;
}

.dropdown-item label {
    cursor: pointer;
    width: 100%;
    line-height: 1.4;
}

/* Сетка курсов */
.courses-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px;
    margin-bottom: 40px;
}

/* Пагинация */
.catalog-pagination {
    display: flex;
    justify-content: center;
    margin-top: 40px;
}

.catalog-pagination .page-numbers {
    padding: 8px 16px;
    margin: 0 5px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    color: #4a5568;
    text-decoration: none;
    transition: all 0.2s ease;
    font-size: 0.95rem;
}

.catalog-pagination .page-numbers:hover,
.catalog-pagination .page-numbers.current {
    background-color: #3182ce;
    color: white;
    border-color: #3182ce;
}

.catalog-pagination .pagination-arrow {
    display: inline-block;
    transition: transform 0.2s ease;
}

.catalog-pagination a:hover .pagination-arrow {
    transform: translateX(3px);
}

/* Состояние "не найдено" */
.catalog-empty {
    text-align: center;
    padding: 60px 20px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    max-width: 600px;
    margin: 0 auto;
}

.catalog-empty svg {
    margin-bottom: 20px;
    color: #e53e3e;
}

.catalog-empty h3 {
    margin: 0 0 10px;
    color: #2d3748;
    font-size: 1.5rem;
}

.catalog-empty p {
    margin: 0;
    color: #718096;
    font-size: 1.05rem;
}



/* Анимация загрузки */
#response.loading {
    position: relative;
    min-height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
}

#response.loading:after {
    content: '';
    width: 40px;
    height: 40px;
    border: 3px solid rgba(49, 130, 206, 0.1);
    border-top: 3px solid #3182ce;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Адаптивность - ОБНОВЛЕННЫЕ СТИЛИ */
@media (min-width: 769px) {
    .filter__top {
        display: flex;
        flex-direction: column;
        gap: 15px;
    }

    .filter-main-row {
        display: flex;
        justify-content: space-between;
        gap: 20px;
        width: 100%;
    }

    .filter-controls {
        display: grid;
        grid-template-columns: repeat(5, minmax(0, 1fr));
        gap: 15px;
        flex: 1;
    }

    .filter-actions {
        display: flex;
        flex-direction: row-reverse;
        gap: 10px;
        align-items: flex-end;
        justify-content: flex-end;
        width: auto;
        flex-shrink: 0;
    }

    .chips-container {
        justify-content: flex-start;
        margin-top: 0;
    }

    .mobile-filter-toggle {
        display: none !important;
    }
}

@media (max-width: 1200px) and (min-width: 769px) {
    .filter-controls {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 992px) and (min-width: 769px) {
    .filter-controls {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 768px) {
    .catalog-header {
        gap: 20px;
    }

    .title-catalog {
        font-size: 1.8rem;
    }

    .mobile-filter-toggle {
        display: flex;
    }

    .filter__top {
        display: none;
        flex-direction: column;
        padding: 25px 20px;
        margin-top: 10px;
    }

    .filter__top.active {
        display: flex;
    }

    .filter-main-row {
        flex-direction: column;
    }

    .filter-controls {
        grid-template-columns: 1fr;
        width: 100%;
    }

    .filter-actions {
        flex-direction: row;
        justify-content: space-between;
        width: 100%;
        margin-top: 15px;
    }

    .filter-actions .filter-reset,
    .filter-actions .filter-button {
        flex: 1;
    }

    .chips-container {
        margin-top: 20px;
        justify-content: center;
    }
}

@media (max-width: 576px) {
    .catalog {
        padding: 30px 0 50px;
    }

    .title-catalog {
        font-size: 1.6rem;
    }

    .courses-grid {
        gap: 20px;
    }

    .catalog-pagination .page-numbers {
        padding: 6px 12px;
        font-size: 0.9rem;
    }
}