:root {
    --primary: #005eff;
    --primary-light: #eef4ff;
    --secondary: #6c757d;
    --success: #198754;
    --light: #f8f9fa;
    --border: #e2e8f0;
    --card-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    --hover-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    --radius: 12px;
    --transition: all 0.2s ease;
}

body {
    font-family: 'Inter', sans-serif;
    color: black;
    line-height: 1.6;
}

main {
    max-width: 1200px;
    margin: 80px auto 120px;
    padding: 48px 24px;
}

.catalog__hero {
    text-align: center;
    margin-bottom: 48px;
}

.catalog__title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 12px;
    color: black;
    letter-spacing: -0.5px;
}

.catalog__subtitle {
    font-size: 1.125rem;
    color: var(--secondary);
    max-width: 600px;
    margin: 0 auto;
    font-weight: 400;
}

.catalog__tools {
    background: white;
    padding: 24px;
    border-radius: var(--radius);
    box-shadow: var(--card-shadow);
    margin-bottom: 32px;
}

.catalog__search {
    position: relative;
    margin-bottom: 20px;
}

    .catalog__search input {
        width: 100%;
        height: 52px;
        border: 2px solid var(--border);
        border-radius: var(--radius);
        padding: 0 20px 0 48px;
        font-size: 1rem;
        font-family: 'Inter', sans-serif;
        transition: var(--transition);
    }

        .catalog__search input:focus {
            outline: none;
            border-color: var(--primary);
            box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.15);
        }

    .catalog__search svg {
        position: absolute;
        left: 16px;
        top: 50%;
        transform: translateY(-50%);
        opacity: 0.5;
    }

.catalog__filters {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
}

.catalog__chips {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: 1px solid var(--border);
    background: white;
    border-radius: 100px;
    padding: 10px 18px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

.chip__label {
    min-width: 0;
}

.chip__count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    height: 22px;
    padding: 0 7px;
    border-radius: 100px;
    background: var(--primary-light);
    color: var(--primary);
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1;
}

    .chip:hover {
        background: var(--primary-light);
        border-color: var(--primary);
        color: var(--primary);
    }

    .chip.is-active {
        background: var(--primary);
        border-color: var(--primary);
        color: white;
    }

        .chip.is-active .chip__count {
            background: rgba(255, 255, 255, 0.22);
            color: white;
        }

.catalog__select {
    position: relative;
}

    .catalog__select select {
        height: 44px;
        border: 2px solid var(--border);
        border-radius: var(--radius);
        padding: 0 40px 0 16px;
        font-size: 0.875rem;
        font-family: 'Inter', sans-serif;
        appearance: none;
        background: white url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236c757d' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 16px center;
        transition: var(--transition);
    }

        .catalog__select select:focus {
            outline: none;
            border-color: var(--primary);
            box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.15);
        }

.catalog__grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 24px;
}
.card {
    display: flex;
    flex-direction: column;
    gap: 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: white;
    padding: 24px;
    box-shadow: var(--card-shadow);
    transition: var(--transition);
    height: 100%;
}

    .card:hover {
        box-shadow: var(--hover-shadow);
    }

    .card,
    .card * {
        min-width: 0;
    }

.card__title {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0;
    line-height: 1.4;
    color: black;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card__desc {
    color: var(--secondary);
    font-size: 0.9375rem;
    margin: 0;
    flex-grow: 1;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    overflow-wrap: anywhere;
}

.card__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.badge {
    font-size: 0.75rem;
    border: 1px solid;
    border-radius: 100px;
    padding: 6px 12px;
    font-weight: 500;
    flex: 0 1 auto;
    max-width: 180px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.badge--type {
    background: var(--primary-light);
    border-color: rgba(67, 97, 238, 0.3);
    color: var(--primary);
}

.badge--subject {
    background: rgba(25, 135, 84, 0.1);
    border-color: rgba(25, 135, 84, 0.3);
    color: var(--success);
}

.badge--fmt {
    background: rgba(108, 117, 125, 0.1);
    border-color: rgba(108, 117, 125, 0.3);
    color: var(--secondary);
}

.card__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 8px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

.price {
    font-weight: 700;
    font-size: 1.25rem;
    color: black;
}

.actions {
    display: flex;
    gap: 8px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    border-radius: var(--radius);
    border: 2px solid transparent;
    padding: 8px 16px;
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
    transition: var(--transition);
    font-family: 'Inter', sans-serif;
}

.btn--primary {
    background: var(--primary);
    color: white;
}

    .btn--primary:hover {
        background: #0044bf;
        transform: translateY(-1px);
    }

.btn--ghost {
    background: white;
    color: var(--primary);
    border-color: var(--border);
}

    .btn--ghost:hover {
        background: var(--primary-light);
        border-color: var(--primary);
    }

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}
/* Адаптивность */
@media (max-width: 768px) {
    main {
        padding: 32px 16px;
    }

    .catalog__title {
        font-size: 2rem;
    }

    .catalog__subtitle {
        font-size: 1rem;
    }

    .catalog__filters {
        flex-direction: column;
        align-items: stretch;
    }

    .catalog__chips {
        justify-content: center;
    }

    .catalog__select {
        width: 100%;
    }

        .catalog__select select {
            width: 100%;
        }

    .card__footer {
        flex-direction: column;
        align-items: stretch;
    }

    .actions {
        width: 100%;
    }

    .btn {
        flex: 1;
    }
}

@media (max-width: 480px) {
    .catalog__chips {
        overflow-x: auto;
        padding-bottom: 8px;
        justify-content: flex-start;
    }

    .chip {
        white-space: nowrap;
    }
}
/* Стили пагинации */
.pagination {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-top: 40px;
    padding: 20px 0;
}

.pagination__container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.pagination__btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    background: white;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.2s ease;
}

    .pagination__btn:hover:not(:disabled) {
        border-color: #005eff;
        color: #005eff;
    }

    .pagination__btn:disabled {
        opacity: 0.5;
        cursor: not-allowed;
    }

.pagination__pages {
    display: flex;
    gap: 4px;
}

.pagination__page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 12px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    background: white;
    color: #374151;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

    .pagination__page:hover {
        border-color: #005eff;
        color: #005eff;
    }

    .pagination__page.active {
        background: #005eff;
        border-color: #005eff;
        color: white;
    }

    .pagination__page.ellipsis {
        border: none;
        background: transparent;
        cursor: default;
    }

        .pagination__page.ellipsis:hover {
            border: none;
            color: #374151;
        }

.pagination__info {
    color: #6b7280;
    font-size: 14px;
}
.is-active {
    background: #005eff;
    color:white;
}
/* Адаптивность */
@media (max-width: 768px) {
    .pagination {
        margin-top: 30px;
        gap: 15px;
    }

    .pagination__container {
        gap: 6px;
    }

    .pagination__btn,
    .pagination__page {
        width: 36px;
        height: 36px;
        min-width: 36px;
    }

    .pagination__page {
        padding: 0 8px;
        font-size: 14px;
    }

    .pagination__info {
        font-size: 13px;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .pagination__pages {
        gap: 2px;
    }

    .pagination__btn,
    .pagination__page {
        width: 32px;
        height: 32px;
        min-width: 32px;
        font-size: 13px;
    }

    .mobile-hidden {
        display: none;
    }
}
