.af-home-courses {
    padding: 32px 0 72px;
    background: #ffffff;
}

.af-home-courses__header {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 28px;
}

.af-home-courses__eyebrow {
    display: inline-block;
    margin-bottom: 10px;
    color: #a435f0;
    font-size: 0.95rem;
    font-weight: 700;
}

.af-home-courses__title {
    margin: 0 0 10px;
    color: #1d1f23;
    font-size: clamp(1.8rem, 3vw, 2.5rem);
    font-weight: 800;
}

.af-home-courses__description {
    margin: 0;
    max-width: 720px;
    color: #5b5e66;
    font-size: 1rem;
    line-height: 1.9;
}

.af-home-courses__link {
    flex-shrink: 0;
    color: #1d1f23;
    text-decoration: none;
    font-weight: 700;
    border-bottom: 2px solid rgba(164, 53, 240, 0.25);
    transition: color 0.2s ease, border-color 0.2s ease;
}

.af-home-courses__link:hover {
    color: #a435f0;
    border-color: #a435f0;
}

.af-home-courses__grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 22px;
}

.af-course-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    border: 1px solid #e7e9ee;
    border-radius: 22px;
    overflow: hidden;
    background: #ffffff;
    box-shadow: 0 10px 26px rgba(18, 24, 40, 0.06);
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.af-course-card:hover {
    transform: translateY(-4px);
    border-color: rgba(164, 53, 240, 0.22);
    box-shadow: 0 18px 36px rgba(18, 24, 40, 0.1);
}

.af-course-card__cover-link {
    display: block;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    background: #f3f4f8;
    position: relative;
}

@keyframes pulseText {
    0%, 100% {
        font-size: 0.85rem;
    }
    50% {
        font-size: 1rem;
    }
}

.af-course-card__discount-badge {
    position: absolute;
    top: 20px;
    left: -40px;
    background: #ff4d4f;
    color: white;
    padding: 6px 50px;
    font-size: 0.85rem;
    font-weight: 800;
    z-index: 10;
    transform: rotate(-45deg);
    text-align: center;
    animation: pulseText 2s infinite;
}

.af-course-card__cover {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.af-course-card:hover .af-course-card__cover {
    transform: scale(1.03);
}

.af-course-card__body {
    display: flex;
    flex: 1;
    flex-direction: column;
    padding: 18px;
}

.af-course-card__title {
    display: -webkit-box;
    margin: 0 0 16px;
    overflow: hidden;
    color: #1d1f23;
    font-size: 1.02rem;
    font-weight: 800;
    line-height: 1.9;
    text-decoration: none;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.af-course-card__meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: auto;
    padding: 12px 0;
    border-top: 1px solid #eceef4;
    border-bottom: 1px solid #eceef4;
}

.af-course-card__meta-item {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #5b5e66;
    font-size: 0.92rem;
    font-weight: 600;
}

.af-course-card__meta-item i {
    color: #a435f0;
    font-size: 1rem;
}

.af-course-card__price-row {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding-top: 16px;
}

.af-course-card__buttons {
    display: flex;
    gap: 8px;
    width: 100%;
}

.af-course-card__buttons .af-course-card__cta {
    flex: 1;
}

.af-course-card__cta--register {
    background: #52c41a;
}

.af-course-card__cta--register:hover {
    background: #389e0d;
}

.af-course-card__price-wrap {
    display: flex;
    flex-direction: row;
    gap: 8px;
    align-items: center;
}

.af-course-card__price {
    color: #1d1f23;
    font-size: 1.05rem;
    font-weight: 800;
}

.af-course-card__old-price {
    color: #ff4d4f;
    font-size: 0.88rem;
    text-decoration: line-through;
}

.af-course-card__cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 16px;
    border-radius: 12px;
    background: #1d1f23;
    color: #ffffff;
    text-decoration: none;
    font-size: 0.92rem;
    font-weight: 700;
    transition: background-color 0.2s ease;
}

.af-course-card__cta:hover {
    background: #a435f0;
}

.af-home-courses__empty {
    padding: 28px;
    text-align: center;
    border: 1px dashed #d8dce6;
    border-radius: 20px;
    color: #62646a;
    background: #fafbff;
}

@media (max-width: 1199.98px) {
    .af-home-courses__grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 991.98px) {
    .af-home-courses__header {
        flex-direction: column;
        align-items: start;
    }

    .af-home-courses__grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 575.98px) {
    .af-home-courses {
        padding-bottom: 48px;
    }

    .af-home-courses__grid {
        grid-template-columns: 1fr;
    }

    .af-course-card__price-row {
        flex-direction: column;
        align-items: stretch;
    }

    .af-course-card__cta {
        width: 100%;
    }
}
