.ajf-tac,
.ajf-tac * {
    box-sizing: border-box;
}

.ajf-tac {
    --ajf-tac-text: #07112d;
    --ajf-tac-muted: #33405f;
    --ajf-tac-soft: #f5f7fb;
    --ajf-tac-line: #e4e9f2;
    --ajf-tac-accent: #ff9800;
    --ajf-tac-radius: 16px;
    --ajf-tac-card-radius: 14px;
    --ajf-tac-columns: 4;
    --ajf-tac-tablet-columns: 2;
    --ajf-tac-mobile-columns: 1;
    --ajf-tac-image-height: 224px;
    --ajf-tac-gap: 34px;
    --ajf-tac-sidebar-width: 332px;
    display: flex;
    align-items: flex-start;
    gap: var(--ajf-tac-gap);
    width: 100%;
    color: var(--ajf-tac-text);
    font-family: inherit;
}

.ajf-tac--notice {
    display: block;
    padding: 22px 24px;
    border: 1px solid #f1d99a;
    background: #fff8e6;
    border-radius: 12px;
}

.ajf-tac__sidebar {
    flex: 0 0 var(--ajf-tac-sidebar-width);
    width: var(--ajf-tac-sidebar-width);
    background: #fff;
    border: 1px solid rgba(15, 32, 75, .08);
    border-radius: 16px;
    box-shadow: 0 15px 40px rgba(12, 23, 55, .09);
    padding: 24px;
    position: sticky;
    top: 24px;
}

.ajf-tac__main {
    min-width: 0;
    flex: 1 1 auto;
}

.ajf-tac__filter-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 20px;
}

.ajf-tac__filter-head h3 {
    margin: 0;
    color: var(--ajf-tac-text);
    font-size: 22px;
    line-height: 1.15;
    font-weight: 800;
    letter-spacing: -.02em;
}

.ajf-tac__clear {
    appearance: none;
    border: 0;
    background: transparent;
    padding: 0;
    color: #0b48ff;
    cursor: pointer;
    font-size: 14px;
    line-height: 1;
    font-weight: 700;
}

.ajf-tac__clear:hover,
.ajf-tac__clear:focus {
    color: #002dba;
    outline: none;
}

.ajf-tac__filter-group {
    border-bottom: 1px solid var(--ajf-tac-line);
    padding: 0 0 18px;
    margin: 0 0 18px;
}

.ajf-tac__filter-group:last-of-type {
    margin-bottom: 26px;
}

.ajf-tac__filter-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    appearance: none;
    border: 0;
    background: transparent;
    padding: 0 0 12px;
    cursor: pointer;
    color: var(--ajf-tac-text);
    font-size: 16px;
    line-height: 1.2;
    font-weight: 800;
    text-align: left;
}

.ajf-tac__chevron {
    color: var(--ajf-tac-text);
    font-size: 22px;
    line-height: 1;
    transform: translateY(2px) rotate(0deg);
    transition: transform .18s ease;
}

.ajf-tac__filter-group.is-collapsed .ajf-tac__chevron {
    transform: rotate(180deg);
}

.ajf-tac__filter-group.is-collapsed .ajf-tac__filter-body {
    display: none;
}

.ajf-tac__check {
    display: flex;
    align-items: center;
    gap: 11px;
    min-height: 32px;
    margin: 0;
    color: var(--ajf-tac-muted);
    cursor: pointer;
    font-size: 15px;
    line-height: 1.35;
    font-weight: 500;
}

.ajf-tac__check input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.ajf-tac__box {
    position: relative;
    flex: 0 0 17px;
    width: 17px;
    height: 17px;
    border: 1.6px solid #b8c3d6;
    border-radius: 3px;
    background: #fff;
    transition: all .18s ease;
}

.ajf-tac__box::after {
    content: "";
    position: absolute;
    left: 4px;
    top: 1px;
    width: 5px;
    height: 9px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg) scale(0);
    transition: transform .14s ease;
}

.ajf-tac__check input:checked + .ajf-tac__box {
    border-color: #0b5cff;
    background: #0b5cff;
}

.ajf-tac__check input:checked + .ajf-tac__box::after {
    transform: rotate(45deg) scale(1);
}

.ajf-tac__label {
    display: inline-flex;
    gap: 3px;
    align-items: baseline;
}

.ajf-tac__muted {
    color: var(--ajf-tac-muted);
}

.ajf-tac__favorites {
    width: 100%;
    min-height: 58px;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    gap: 11px;
    padding: 14px 18px;
    border: 1.5px solid #f39a1f;
    border-radius: 7px;
    background: #fff;
    color: #e88900;
    font-size: 16px;
    line-height: 1;
    font-weight: 800;
    cursor: pointer;
    transition: all .2s ease;
}

.ajf-tac__favorites:hover,
.ajf-tac__favorites.is-active {
    background: #fff6e5;
    transform: translateY(-1px);
}

.ajf-tac__star {
    color: var(--ajf-tac-accent);
    font-size: 20px;
    line-height: 1;
}

.ajf-tac__toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 18px;
}

.ajf-tac__count {
    color: var(--ajf-tac-text);
    font-size: 18px;
    line-height: 1.3;
    font-weight: 500;
}

.ajf-tac__sort-wrap {
    display: inline-flex;
    align-items: center;
    gap: 15px;
    margin: 0;
    color: var(--ajf-tac-text);
    font-size: 16px;
    font-weight: 500;
    white-space: nowrap;
}

.ajf-tac__sort {
    appearance: none;
    min-width: 178px;
    height: 45px;
    border: 1px solid #dfe6f1;
    border-radius: 7px;
    background-color: #fff;
    color: var(--ajf-tac-text);
    font-size: 14px;
    line-height: 1;
    font-weight: 800;
    padding: 0 42px 0 17px;
    cursor: pointer;
    background-image: linear-gradient(45deg, transparent 50%, var(--ajf-tac-text) 50%), linear-gradient(135deg, var(--ajf-tac-text) 50%, transparent 50%);
    background-position: calc(100% - 18px) 19px, calc(100% - 13px) 19px;
    background-size: 5px 5px, 5px 5px;
    background-repeat: no-repeat;
}

.ajf-tac__sort:focus {
    border-color: #0b5cff;
    outline: none;
    box-shadow: 0 0 0 3px rgba(11, 92, 255, .12);
}

.ajf-tac__results-shell {
    position: relative;
    min-height: 180px;
}

.ajf-tac__grid {
    display: grid;
    grid-template-columns: repeat(var(--ajf-tac-columns), minmax(0, 1fr));
    gap: 24px 28px;
    transition: opacity .16s ease;
}

.ajf-tac.is-loading .ajf-tac__grid {
    opacity: .38;
    pointer-events: none;
}

.ajf-tac__loader {
    position: absolute;
    left: 50%;
    top: 70px;
    transform: translateX(-50%);
    z-index: 6;
    display: none;
    align-items: center;
    gap: 10px;
    min-height: 44px;
    padding: 10px 18px;
    border-radius: 999px;
    background: #fff;
    color: var(--ajf-tac-text);
    box-shadow: 0 14px 40px rgba(12, 23, 55, .13);
    font-size: 14px;
    font-weight: 700;
}

.ajf-tac.is-loading .ajf-tac__loader {
    display: inline-flex;
}

.ajf-tac__loader span {
    width: 18px;
    height: 18px;
    border: 3px solid #d9e3f4;
    border-top-color: #0b5cff;
    border-radius: 50%;
    animation: ajfTacSpin .8s linear infinite;
}

@keyframes ajfTacSpin {
    to { transform: rotate(360deg); }
}

.ajf-tac-card {
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 1px solid rgba(15, 32, 75, .07);
    border-radius: 14px;
    box-shadow: 0 13px 34px rgba(15, 32, 75, .08);
    min-width: 0;
    transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}

.ajf-tac-card:hover {
    transform: translateY(-3px);
    border-color: rgba(15, 32, 75, .12);
    box-shadow: 0 18px 42px rgba(15, 32, 75, .12);
}

.ajf-tac-card__media {
    position: relative;
    display: block;
    height: var(--ajf-tac-image-height);
    overflow: hidden;
    background: #061029 url('../img/course-placeholder.svg') center/cover no-repeat;
    border-radius: 14px 14px 0 0;
    text-decoration: none;
    font-size: 0;
}

.ajf-tac-card__media img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .3s ease;
}

.ajf-tac-card__media img.is-fallback {
    object-fit: cover;
}

.ajf-tac-card:hover .ajf-tac-card__media img {
    transform: scale(1.035);
}

.ajf-tac-card__badge {
    position: absolute;
    left: 12px;
    top: 12px;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    padding: 0 11px;
    border-radius: 6px;
    color: #fff;
    font-size: 13px;
    line-height: 1;
    font-weight: 900;
    letter-spacing: -.02em;
    box-shadow: 0 8px 18px rgba(0, 0, 0, .18);
}

.ajf-tac-card__badge--popular {
    background: #ef3131;
}

.ajf-tac-card__badge--new {
    background: #32ad55;
}

.ajf-tac-card__bookmark {
    position: absolute;
    top: 14px;
    right: 14px;
    z-index: 3;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 31px;
    height: 37px;
    padding: 0;
    appearance: none;
    border: 0;
    background: transparent;
    color: #fff;
    cursor: pointer;
    filter: drop-shadow(0 8px 18px rgba(0, 0, 0, .25));
}

.ajf-tac-card__bookmark svg {
    display: block;
    width: 31px;
    height: 37px;
    fill: rgba(3, 6, 18, .34);
    stroke: #fff;
    stroke-width: 1.75px;
    transition: all .2s ease;
}

.ajf-tac-card__bookmark:hover svg,
.ajf-tac-card__bookmark.is-active svg {
    fill: rgba(255, 152, 0, .88);
    stroke: #fff;
}

.ajf-tac-card__body {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    padding: 18px 20px 19px;
}

.ajf-tac-card__title {
    margin: 0 0 14px;
    min-height: 58px;
    color: var(--ajf-tac-text);
    font-size: 22px;
    line-height: 1.18;
    font-weight: 900;
    letter-spacing: -.03em;
}

.ajf-tac-card__title a {
    color: inherit;
    text-decoration: none;
}

.ajf-tac-card__title a:hover {
    color: #0b5cff;
}

.ajf-tac-card__author {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 18px;
    color: var(--ajf-tac-muted);
    font-size: 14px;
    line-height: 1.2;
    font-weight: 500;
}

.ajf-tac-card__author img {
    width: 27px;
    height: 27px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #061029;
}

.ajf-tac-card__meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: auto;
    margin-bottom: 18px;
    min-width: 0;
    color: var(--ajf-tac-muted);
    font-size: 14px;
    line-height: 1.2;
    font-weight: 600;
}

.ajf-tac-card__rating {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: var(--ajf-tac-accent);
    white-space: nowrap;
}

.ajf-tac-card__rating-star {
    color: var(--ajf-tac-accent);
    font-size: 18px;
    line-height: 1;
}

.ajf-tac-card__rating-count {
    color: var(--ajf-tac-muted);
    font-weight: 500;
}

.ajf-tac-card__duration {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: var(--ajf-tac-muted);
    white-space: nowrap;
}

.ajf-tac-card__duration svg {
    width: 15px;
    height: 15px;
    fill: currentColor;
    opacity: .8;
}

.ajf-tac-card__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.ajf-tac-card__level {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 30px;
    padding: 0 11px;
    border-radius: 6px;
    font-size: 14px;
    line-height: 1;
    font-weight: 800;
}

.ajf-tac-card__level--beginner,
.ajf-tac-card__level--all_levels {
    background: #dceaff;
    color: #0b5cff;
}

.ajf-tac-card__level--intermediate {
    background: #dcf3df;
    color: #05802a;
}

.ajf-tac-card__level--expert {
    background: #ece0ff;
    color: #6717ff;
}

.ajf-tac-card__price {
    color: var(--ajf-tac-text);
    font-size: 23px;
    line-height: 1;
    font-weight: 900;
    letter-spacing: -.03em;
    white-space: nowrap;
}

.ajf-tac__empty {
    grid-column: 1 / -1;
    min-height: 210px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 28px;
    border: 1px dashed #cdd8ea;
    border-radius: 16px;
    background: #fff;
    color: var(--ajf-tac-muted);
    font-size: 17px;
    font-weight: 700;
}

.ajf-tac__pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
    margin-top: 24px;
}

.ajf-tac__page {
    min-width: 42px;
    height: 42px;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    appearance: none;
    border: 1px solid transparent;
    border-radius: 7px;
    background: transparent;
    color: var(--ajf-tac-text);
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
    font-weight: 700;
    transition: all .18s ease;
}

.ajf-tac__page:hover:not(:disabled) {
    background: #f1f5fc;
}

.ajf-tac__page.is-active {
    background: #061338;
    color: #fff;
    box-shadow: 0 8px 18px rgba(6, 19, 56, .18);
}

.ajf-tac__page--arrow {
    border-color: #dfe6f1;
    background: #fff;
    color: #435170;
    font-size: 25px;
    font-weight: 500;
}

.ajf-tac__page:disabled {
    opacity: .45;
    cursor: not-allowed;
}

.ajf-tac__dots {
    color: var(--ajf-tac-text);
    font-weight: 700;
}

@media (max-width: 1199px) {
    .ajf-tac {
        --ajf-tac-columns: var(--ajf-tac-tablet-columns);
        align-items: stretch;
    }

    .ajf-tac__sidebar {
        flex-basis: 292px;
        width: 292px;
        padding: 22px;
    }

    .ajf-tac__grid {
        gap: 22px;
    }
}

@media (max-width: 900px) {
    .ajf-tac {
        flex-direction: column;
    }

    .ajf-tac__sidebar {
        position: static;
        width: 100%;
        flex-basis: auto;
    }
}

@media (max-width: 767px) {
    .ajf-tac {
        --ajf-tac-columns: var(--ajf-tac-mobile-columns);
        --ajf-tac-image-height: 190px;
        gap: 22px;
    }

    .ajf-tac__toolbar {
        align-items: flex-start;
        flex-direction: column;
        gap: 12px;
    }

    .ajf-tac__sort-wrap {
        width: 100%;
        justify-content: space-between;
    }

    .ajf-tac__sort {
        min-width: 176px;
        max-width: 100%;
    }

    .ajf-tac-card__title {
        min-height: auto;
        font-size: 20px;
    }

    .ajf-tac-card__meta {
        flex-wrap: wrap;
    }

    .ajf-tac__pagination {
        gap: 8px;
        flex-wrap: wrap;
    }

    .ajf-tac__page {
        min-width: 38px;
        height: 38px;
    }
}

.ajf-tac-card__bookmark.is-saving {
    opacity: .65;
    pointer-events: none;
}

/* ---------------------------------------------------------
 * Responsive refinements - v1.1.0
 * --------------------------------------------------------- */
.ajf-tac__backdrop,
.ajf-tac__mobile-filter-btn,
.ajf-tac__mobile-close {
    display: none;
}

.ajf-tac__filter-actions {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

body.ajf-tac-no-scroll {
    overflow: hidden;
}

@media (max-width: 1024px) {
    .ajf-tac {
        flex-direction: column;
        --ajf-tac-columns: var(--ajf-tac-tablet-columns);
        gap: 24px;
    }

    .ajf-tac__sidebar {
        position: static;
        width: 100%;
        flex: 0 0 auto;
        display: grid;
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 18px 22px;
        padding: 22px;
    }

    .ajf-tac__filter-head,
    .ajf-tac__favorites {
        grid-column: 1 / -1;
    }

    .ajf-tac__filter-group {
        border-bottom: 0;
        padding-bottom: 0;
        margin-bottom: 0;
    }

    .ajf-tac__filter-group:last-of-type {
        margin-bottom: 0;
    }

    .ajf-tac__filter-toggle {
        padding-bottom: 10px;
        font-size: 15px;
    }

    .ajf-tac__check {
        font-size: 14px;
        min-height: 30px;
    }

    .ajf-tac__favorites {
        justify-self: start;
        width: auto;
        min-width: 280px;
        min-height: 52px;
    }

    .ajf-tac__toolbar {
        margin-bottom: 20px;
    }

    .ajf-tac-card__media {
        height: min(var(--ajf-tac-image-height), 210px);
    }

    .ajf-tac-card__title {
        min-height: auto;
        font-size: 21px;
    }
}

@media (max-width: 880px) {
    .ajf-tac__sidebar {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .ajf-tac__grid {
        gap: 22px;
    }
}

@media (max-width: 767px) {
    .ajf-tac {
        --ajf-tac-columns: var(--ajf-tac-mobile-columns);
        --ajf-tac-image-height: 188px;
        gap: 18px;
    }

    .ajf-tac__mobile-filter-btn {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 9px;
        min-height: 44px;
        padding: 0 14px;
        border: 1px solid #dfe6f1;
        border-radius: 8px;
        background: #fff;
        color: var(--ajf-tac-text);
        font-size: 14px;
        line-height: 1;
        font-weight: 800;
        cursor: pointer;
        box-shadow: 0 8px 22px rgba(15, 32, 75, .07);
    }

    .ajf-tac__mobile-filter-icon {
        position: relative;
        width: 17px;
        height: 12px;
        display: inline-block;
        border-top: 2px solid currentColor;
        border-bottom: 2px solid currentColor;
    }

    .ajf-tac__mobile-filter-icon::before {
        content: "";
        position: absolute;
        left: 0;
        top: 3px;
        width: 17px;
        border-top: 2px solid currentColor;
    }

    .ajf-tac__mobile-filter-count {
        min-width: 20px;
        height: 20px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        border-radius: 50%;
        background: var(--ajf-tac-accent);
        color: #fff;
        font-size: 12px;
        font-weight: 900;
    }

    .ajf-tac__backdrop {
        position: fixed;
        inset: 0;
        z-index: 9998;
        width: 100%;
        height: 100%;
        border: 0;
        padding: 0;
        background: rgba(3, 10, 30, .46);
        opacity: 0;
        pointer-events: none;
        transition: opacity .22s ease;
    }

    .ajf-tac.is-filters-open .ajf-tac__backdrop {
        display: block;
        opacity: 1;
        pointer-events: auto;
    }

    .ajf-tac__sidebar {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        z-index: 9999;
        display: block;
        width: min(91vw, 380px);
        height: 100dvh;
        max-height: 100dvh;
        overflow-y: auto;
        padding: 20px 18px 24px;
        border-radius: 0 18px 18px 0;
        transform: translateX(-105%);
        transition: transform .25s ease;
        box-shadow: 16px 0 45px rgba(3, 10, 30, .18);
        -webkit-overflow-scrolling: touch;
    }

    .ajf-tac.is-filters-open .ajf-tac__sidebar {
        transform: translateX(0);
    }

    .ajf-tac__filter-head {
        position: sticky;
        top: -20px;
        z-index: 4;
        background: #fff;
        margin: -20px -18px 18px;
        padding: 20px 18px 16px;
        border-bottom: 1px solid var(--ajf-tac-line);
    }

    .ajf-tac__filter-head h3 {
        font-size: 21px;
    }

    .ajf-tac__mobile-close {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 34px;
        height: 34px;
        border: 1px solid #dfe6f1;
        border-radius: 50%;
        background: #fff;
        color: var(--ajf-tac-text);
        font-size: 26px;
        line-height: 1;
        cursor: pointer;
    }

    .ajf-tac__clear {
        font-size: 13px;
    }

    .ajf-tac__filter-group {
        border-bottom: 1px solid var(--ajf-tac-line);
        padding-bottom: 17px;
        margin-bottom: 17px;
    }

    .ajf-tac__filter-toggle {
        font-size: 15px;
    }

    .ajf-tac__check {
        min-height: 36px;
        font-size: 15px;
    }

    .ajf-tac__favorites {
        width: 100%;
        min-width: 0;
        min-height: 52px;
        margin-top: 6px;
    }

    .ajf-tac__toolbar {
        display: grid;
        grid-template-columns: 1fr auto;
        align-items: center;
        gap: 10px 12px;
        margin-bottom: 16px;
    }

    .ajf-tac__count {
        grid-column: 1 / -1;
        grid-row: 2;
        font-size: 16px;
    }

    .ajf-tac__sort-wrap {
        width: auto;
        justify-content: flex-end;
        gap: 8px;
        font-size: 0;
    }

    .ajf-tac__sort {
        min-width: 152px;
        height: 44px;
        padding-left: 13px;
        padding-right: 34px;
        font-size: 13px;
        background-position: calc(100% - 16px) 19px, calc(100% - 11px) 19px;
    }

    .ajf-tac__grid {
        gap: 18px;
    }

    .ajf-tac-card {
        border-radius: 13px;
        box-shadow: 0 10px 26px rgba(15, 32, 75, .08);
    }

    .ajf-tac-card:hover {
        transform: none;
    }

    .ajf-tac-card__media {
        height: var(--ajf-tac-image-height);
        border-radius: 13px 13px 0 0;
    }

    .ajf-tac-card__badge {
        min-height: 27px;
        padding: 0 9px;
        font-size: 12px;
    }

    .ajf-tac-card__bookmark,
    .ajf-tac-card__bookmark svg {
        width: 28px;
        height: 34px;
    }

    .ajf-tac-card__body {
        padding: 15px 16px 16px;
    }

    .ajf-tac-card__title {
        margin-bottom: 12px;
        min-height: auto;
        font-size: 19px;
        line-height: 1.22;
    }

    .ajf-tac-card__author {
        margin-bottom: 14px;
        font-size: 13px;
    }

    .ajf-tac-card__meta {
        align-items: center;
        flex-wrap: nowrap;
        gap: 10px;
        margin-bottom: 15px;
        font-size: 13px;
    }

    .ajf-tac-card__level {
        min-height: 28px;
        padding: 0 10px;
        font-size: 13px;
    }

    .ajf-tac-card__price {
        font-size: 22px;
    }

    .ajf-tac__pagination {
        gap: 7px;
        margin-top: 22px;
    }

    .ajf-tac__page {
        min-width: 36px;
        height: 36px;
        font-size: 14px;
    }

    .ajf-tac__dots {
        padding: 0 2px;
    }
}

@media (max-width: 420px) {
    .ajf-tac__toolbar {
        grid-template-columns: 1fr;
    }

    .ajf-tac__mobile-filter-btn,
    .ajf-tac__sort-wrap,
    .ajf-tac__sort {
        width: 100%;
    }

    .ajf-tac__sort-wrap {
        justify-content: stretch;
    }

    .ajf-tac-card__meta {
        flex-wrap: wrap;
    }
}
