.course-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
    gap: 28px;
    align-items: stretch;
}

.course-card {
    display: flex;
    flex-direction: column;
    background: linear-gradient(145deg, #2a1637, #341b46);
    border: 1px solid rgba(216, 178, 110, 0.14);
    border-radius: 24px;
    overflow: hidden;
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.28);
    transition: all 0.35s ease;
    height: 100%;
}

.course-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 24px 55px rgba(0, 0, 0, 0.38);
}

.card-image {
    position: relative;
    overflow: hidden;
}

.card-image img {
    width: 100%;
    height: 210px;
    object-fit: cover;
    display: block;
}

.card-content {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 20px 20px 22px;
    flex: 1;
}

.card-header-compact h3 {
    margin: 0 0 10px;
    font-size: 1.22rem;
    line-height: 1.3;
    font-weight: 800;
    color: #fff;
}

.course-description {
    margin: 0;
    color: rgba(255, 255, 255, 0.74);
    font-size: 0.95rem;
    line-height: 1.55;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 2.95em;
}

.course-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 16px;
    font-size: 0.86rem;
    color: rgba(255, 255, 255, 0.72);
}

.course-meta span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.course-bottom {
    margin-top: auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.course-price-box {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(216, 178, 110, 0.12);
    border-radius: 18px;
    padding: 14px 16px;
}

.course-price-box small {
    display: block;
    margin-bottom: 6px;
    color: rgba(255, 255, 255, 0.60);
    font-size: 0.76rem;
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

.course-price-box strong {
    display: block;
    color: #d8b26e;
    font-size: 1.2rem;
    font-weight: 800;
    line-height: 1.2;
}

.course-price-box span {
    display: block;
    margin-top: 4px;
    color: rgba(255, 255, 255, 0.70);
    font-size: 0.88rem;
}

.card-actions {
    display: flex;
    gap: 12px;
    align-items: stretch;
}

.card-actions > a,
.card-actions > form {
    flex: 1;
}

.btn-card-secondary,
.btn-card-primary {
    width: 100%;
    min-height: 46px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    font-weight: 700;
    transition: all 0.3s ease;
}

.btn-card-secondary {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.16);
    color: #fff;
}

.btn-card-secondary:hover {
    background: rgba(255, 255, 255, 0.06);
}

.btn-card-primary {
    background: linear-gradient(135deg, #7c36cf, #5c24a5);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: #fff;
    box-shadow: 0 12px 24px rgba(111, 45, 189, 0.28);
}

.btn-card-primary:hover {
    transform: translateY(-2px);
    background: linear-gradient(135deg, #8c45df, #6b2db8);
}

@media (max-width: 767px) {
    .course-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .card-image img {
        height: 200px;
    }

    .card-actions {
        flex-direction: column;
    }
}