.category-card {
    background: #fff;
    border-radius: 14px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 100%;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    border: 1px solid #f0f0f0;
    transition: transform .25s ease, box-shadow .25s ease;
}
.category-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
}

/* Bandeau image réduit */
.category-thumb {
    position: relative;
    width: 100%;
    height: 110px;
    overflow: hidden;
}
.category-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .4s ease;
}
.category-card:hover .category-thumb img {
    transform: scale(1.05);
}

/* Placeholder neutre quand pas d'image */
.category-thumb-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #eef1f5 0%, #dfe4ea 100%);
}
.category-thumb-placeholder i {
    font-size: 32px;
    color: #9aa5b1;
}

.module-count-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(0,0,0,0.6);
    color: #fff;
    font-size: 11px;
    padding: 3px 9px;
    border-radius: 20px;
}

/* Contenu */
.category-body {
    padding: 16px 18px 18px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}
.category-tag {
    display: inline-block;
    font-size: 12px;
    font-weight: 600;
    color: #2b6cb0;
    background: #eaf2fb;
    padding: 3px 10px;
    border-radius: 20px;
    width: fit-content;
    margin-bottom: 8px;
}
.category-title {
    font-size: 17px;
    font-weight: 700;
    margin-bottom: 6px;
    color: #1a1a1a;
}
.category-desc {
    font-size: 13.5px;
    color: #6b7280;
    line-height: 1.5;
    flex-grow: 1;
    margin-bottom: 14px;
}
.category-link {
    font-size: 14px;
    font-weight: 600;
    color: #2b6cb0;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    transition: gap .2s ease;
}
.category-link:hover {
    gap: 4px;
    color: #1a4d80;
}


.module-card-v5 {
    background: #fff;
    border-radius: 16px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 100%;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    border: 1px solid #f0f0f0;
    transition: transform .25s ease, box-shadow .25s ease;
}
.module-card-v5:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 22px rgba(0,0,0,0.1);
}

/* Ratio plus court = carte moins longue au total */
.module-thumb-v5 {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9; /* au lieu de 4/3, gain d'environ 25% de hauteur */
    overflow: hidden;
    background: #f3f4f6; /* fond visible seulement le temps du chargement */
}
.module-thumb-v5 a,
.module-thumb-v5 img {
    display: block;
    width: 100%;
    height: 100%;
}
.module-thumb-v5 img {
    object-fit: cover;   /* remplit TOUJOURS tout le cadre, quelle que soit la taille/forme de l'image source, en la rognant si besoin */
    object-position: center;
    transition: transform .4s ease;
}
.module-card-v5:hover .module-thumb-v5 img {
    transform: scale(1.06);
}
.module-thumb-placeholder-v5 {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #fdf0e1 0%, #fbe3c6 100%);
}
.module-thumb-placeholder-v5 i {
    font-size: 34px;
    color: #d97706;
}

.module-order-badge-v5 {
    position: absolute;
    bottom: 10px;
    left: 10px;
    background: #d97706;
    color: #fff;
    font-size: 11.5px;
    font-weight: 700;
    padding: 4px 12px;
    border-radius: 20px;
    box-shadow: 0 3px 8px rgba(0,0,0,0.25);
}

/* Contenu resserré */
.module-body-v5 {
    padding: 14px 18px 16px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    flex-grow: 1;
}
.module-tag-v5 {
    display: inline-block;
    font-size: 11.5px;
    font-weight: 600;
    color: #b45309;
    background: #fef3e2;
    padding: 2px 9px;
    border-radius: 20px;
    margin-bottom: 8px;
}
.module-title-v5 {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 0;
    color: #1a1a1a;
}
.module-title-v5 a {
    color: inherit;
    text-decoration: none;
}
.module-title-v5 a:hover {
    color: #d97706;
}

.module-footer-v5 {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 12px;
    border-top: 1px solid #f0f0f0;
    padding-top: 10px;
}
.module-instructor {
    display: flex;
    align-items: center;
    gap: 6px;
}
.module-instructor img {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    object-fit: cover;
}
.module-instructor span {
    font-size: 12px;
    font-weight: 600;
    color: #4b5563;
}
.module-link-v5 {
    font-size: 13px;
    font-weight: 600;
    color: #d97706;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    transition: gap .2s ease;
}
.module-link-v5:hover {
    gap: 4px;
    color: #92400e;
}

.btn-close-custom {
    background: rgba(255,255,255,0.2);
    border: none;
    padding: 6px 16px;
    border-radius: 20px;
    display: inline-flex;
    align-items: center;
    color: #fff;
    font-size: 13.5px;
    font-weight: 600;
    cursor: pointer;
    transition: background .2s ease;
    white-space: nowrap;
}
.btn-close-custom:hover {
    background: rgba(255,255,255,0.35);
    color: #fff;
}

/* Responsive */
@media (max-width: 767px) {
    .module-thumb-v5 {
        aspect-ratio: 16 / 9;
    }
}
@media (max-width: 400px) {
    .module-body-v5 {
        padding: 12px 14px 14px;
    }
    .module-title-v5 {
        font-size: 14.5px;
    }
    .module-footer-v5 {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    .module-link-v5 {
        align-self: flex-end;
    }

    
}
