.category-page-section {
    font-family: 'Montserrat', sans-serif;
    padding: 1.5rem 0 3rem;
    background:
        radial-gradient(ellipse at 85% 0%, rgba(0, 68, 172, 0.07), transparent 45%),
        radial-gradient(ellipse at 5% 100%, rgba(0, 68, 172, 0.04), transparent 40%),
        linear-gradient(180deg, #f8fbff 0%, #ffffff 55%);
}

.category-page-header {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1.25rem;
    margin-bottom: 1.35rem;
    padding: 1.35rem 1.35rem 1.2rem;
    border: 1px solid rgba(0, 68, 172, 0.08);
    border-radius: 1.15rem;
    background: #ffffff;
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.9) inset,
        0 16px 40px rgba(0, 38, 108, 0.07);
}

.category-page-title-wrap {
    flex: 0 1 auto;
}

.category-page-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    margin-bottom: 0.35rem;
    padding: 0.28rem 0.65rem;
    border-radius: 999px;
    background: rgba(0, 68, 172, 0.08);
    color: #0044ac;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.category-page-eyebrow i {
    font-size: 0.62rem;
}

.category-page-title {
    margin: 0;
    color: #00266c;
    font-size: clamp(1.25rem, 2.4vw, 1.65rem);
    font-weight: 800;
    letter-spacing: -0.01em;
    line-height: 1.2;
}

.category-page-filter {
    flex: 1 1 22rem;
    max-width: 100%;
}

.category-page-filter__row {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 0.75rem;
}

.category-page-filter__field {
    flex: 1 1 15rem;
    min-width: 0;
}

.category-page-filter__label {
    display: block;
    margin-bottom: 0.4rem;
    color: rgba(0, 38, 108, 0.55);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.category-page-filter__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
}

.category-page-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.58rem 1.05rem;
    border-radius: 999px;
    border: 0;
    font-family: inherit;
    font-size: 0.8rem;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
    transition: transform 0.22s ease, box-shadow 0.22s ease, filter 0.22s ease, background 0.22s ease;
}

.category-page-btn--primary {
    background: linear-gradient(145deg, #1e88e5 0%, #0044ac 100%);
    color: #ffffff !important;
    box-shadow: 0 10px 22px rgba(0, 68, 172, 0.24);
}

.category-page-btn--primary:hover {
    color: #ffffff !important;
    filter: brightness(1.06);
    transform: translateY(-2px);
    box-shadow: 0 14px 28px rgba(0, 68, 172, 0.28);
}

.category-page-btn--ghost {
    border: 1px solid rgba(0, 68, 172, 0.18);
    background: #ffffff;
    color: #0044ac !important;
}

.category-page-btn--ghost:hover {
    color: #00266c !important;
    background: rgba(0, 68, 172, 0.06);
    transform: translateY(-2px);
}

.category-page-btn--start {
    padding: 0.72rem 1.45rem;
    font-size: 0.88rem;
}

.category-page-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 1.15rem;
    padding: 0.85rem 1rem;
    border: 1px dashed rgba(0, 68, 172, 0.16);
    border-radius: 0.95rem;
    background: rgba(255, 255, 255, 0.75);
}

.category-page-toolbar__hint {
    margin: 0;
    color: rgba(0, 38, 108, 0.62);
    font-size: 0.8rem;
    font-weight: 600;
}

.category-page-toolbar__hint strong {
    color: #0044ac;
    font-weight: 700;
}

.category-page-notice {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    margin-bottom: 1rem;
    padding: 0.85rem 1rem;
    border-radius: 0.9rem;
    font-size: 0.84rem;
    font-weight: 600;
}

.category-page-notice--warning {
    background: rgba(234, 179, 8, 0.12);
    border: 1px solid rgba(234, 179, 8, 0.22);
    color: #a16207;
}

.category-page-notice--info {
    background: rgba(0, 68, 172, 0.07);
    border: 1px solid rgba(0, 68, 172, 0.12);
    color: #00266c;
}

.category-page-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.1rem;
    align-items: start;
}

.category-card {
    height: auto;
    align-self: start;
    border: 1px solid rgba(0, 68, 172, 0.1);
    border-radius: 1rem;
    background: #ffffff;
    box-shadow: 0 8px 24px rgba(0, 38, 108, 0.05);
    overflow: hidden;
    transition:
        border-color 0.28s ease,
        box-shadow 0.28s ease,
        transform 0.28s ease;
}

.category-card:hover {
    border-color: rgba(0, 68, 172, 0.18);
    box-shadow: 0 14px 32px rgba(0, 38, 108, 0.09);
    transform: translateY(-2px);
}

.category-card.is-expanded {
    border-color: rgba(0, 68, 172, 0.22);
    box-shadow: 0 16px 36px rgba(0, 38, 108, 0.1);
}

.category-card__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.85rem;
    padding: 1rem 1.05rem;
    background: linear-gradient(90deg, rgba(0, 68, 172, 0.04) 0%, rgba(255, 255, 255, 0) 100%);
    transition: background 0.28s ease;
}

.category-card.is-expanded .category-card__head {
    background: linear-gradient(90deg, rgba(0, 68, 172, 0.08) 0%, rgba(255, 255, 255, 0) 100%);
}

.category-card__label {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 0;
    min-width: 0;
    cursor: pointer;
}

.category-card__checkbox {
    width: 1.05rem;
    height: 1.05rem;
    accent-color: #0044ac;
    flex-shrink: 0;
    cursor: pointer;
}

.category-card__meta {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    min-width: 0;
}

.category-card__name {
    color: #00266c;
    font-size: 0.94rem;
    font-weight: 700;
    line-height: 1.3;
}

.category-card__count {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    margin-top: 0.15rem;
    padding: 0.18rem 0.55rem;
    border-radius: 999px;
    background: rgba(0, 68, 172, 0.08);
    color: #0044ac;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.01em;
}

.category-card__toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.15rem;
    height: 2.15rem;
    padding: 0;
    border: 1px solid rgba(0, 68, 172, 0.14);
    border-radius: 999px;
    background: #ffffff;
    color: #0044ac;
    flex-shrink: 0;
    cursor: pointer;
    transition: background 0.25s ease, transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.category-card__toggle:hover {
    background: rgba(0, 68, 172, 0.08);
    border-color: rgba(0, 68, 172, 0.28);
    transform: scale(1.06);
}

.category-card__toggle.is-open {
    background: linear-gradient(145deg, #1e88e5 0%, #0044ac 100%);
    border-color: transparent;
    color: #ffffff;
    box-shadow: 0 6px 16px rgba(0, 68, 172, 0.28);
}

.category-card__toggle.is-open i {
    transform: rotate(180deg);
}

.category-card__toggle i {
    font-size: 0.72rem;
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.category-card__subs-wrap {
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows 0.38s cubic-bezier(0.4, 0, 0.2, 1);
}

.category-card__subs-wrap.is-open {
    grid-template-rows: 1fr;
}

.category-card__subs-inner {
    overflow: hidden;
}

.category-card__subs {
    padding: 0.15rem 1rem 1rem 1.15rem;
    border-top: 1px solid transparent;
    opacity: 0;
    transform: translateY(-6px);
    transition:
        opacity 0.28s ease,
        transform 0.32s cubic-bezier(0.4, 0, 0.2, 1),
        border-color 0.28s ease;
}

.category-card__subs-wrap.is-open .category-card__subs {
    border-top-color: rgba(0, 68, 172, 0.08);
    opacity: 1;
    transform: translateY(0);
}

.category-card__subs-list {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    margin: 0.65rem 0 0;
    padding: 0;
    list-style: none;
}

.category-card__sub-item label {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    margin: 0;
    padding: 0.55rem 0.7rem;
    border: 1px solid transparent;
    border-radius: 0.7rem;
    color: rgba(0, 38, 108, 0.85);
    font-size: 0.84rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.category-card__sub-item label:hover {
    background: rgba(0, 68, 172, 0.05);
    border-color: rgba(0, 68, 172, 0.08);
    transform: translateX(2px);
}

.category-card__sub-item span {
    line-height: 1.35;
}

.category-page-section .select2-container--default .select2-selection--multiple {
    min-height: 2.55rem;
    padding: 0.15rem 0.35rem;
    border: 1px solid rgba(0, 68, 172, 0.14);
    border-radius: 0.85rem;
    background: #f8fbff;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.category-page-section .select2-container--default.select2-container--focus .select2-selection--multiple {
    border-color: rgba(0, 68, 172, 0.42);
    box-shadow: 0 0 0 0.22rem rgba(0, 68, 172, 0.1);
}

.category-page-section .select2-container--default .select2-selection--multiple .select2-selection__choice {
    border: 0;
    border-radius: 999px;
    background: rgba(0, 68, 172, 0.12);
    color: #0044ac;
    font-size: 0.75rem;
    font-weight: 600;
}

@media (max-width: 991.98px) {
    .category-page-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 575.98px) {
    .category-page-section {
        padding: 1.15rem 0 2.25rem;
    }

    .category-page-header {
        padding: 1.05rem 1rem;
    }

    .category-page-filter__actions,
    .category-page-toolbar {
        width: 100%;
        flex-direction: column;
        align-items: stretch;
    }

    .category-page-toolbar .category-page-btn,
    .category-page-filter__actions .category-page-btn {
        width: 100%;
    }

    .category-page-toolbar__hint {
        text-align: center;
    }
}

@media (prefers-reduced-motion: reduce) {
    .category-card,
    .category-card__toggle,
    .category-card__toggle i,
    .category-card__subs-wrap,
    .category-card__subs,
    .category-card__sub-item label,
    .category-page-btn {
        transition: none;
    }
}
