/* =============================================
   CURSOS — CARD COMPARTIDO
   (listado, relacionados y cualquier otro uso)
   ============================================= */

/* ---------- Contenedor de card ---------- */
.related-card {
    transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
    overflow: hidden;
}

.related-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 28px rgba(0, 0, 0, .08) !important;
}

.related-card .stretched-link {
    z-index: 2;
    border-radius: 16px;
}

.related-card .card-body,
.related-card .card-img-top {
    position: relative;
    z-index: 1;
    pointer-events: none;
}

/* ---------- Imagen + badges ---------- */
.course-card__image {
    position: relative;
    overflow: hidden;
    height: 160px;
}

.course-card__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.course-card__badge {
    position: absolute;
    top: 8px;
    left: 12px;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: bold;
    text-transform: uppercase;
    color: #fff;
    z-index: 2;
}
.course-card__badge--warn { background: #cd9422; }
.course-card__badge--info { background: #6c757d; }
.course-card__badge--new  { background: var(--cat-color, #fb9423); left: auto; right: 12px; }

/* ---------- Título ---------- */
.course-card__title {
    font-weight: 700;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ---------- Precio (pill) ---------- */
.related-price {
    display: inline-flex;
    align-items: baseline;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 999px;
    background: #fff;
    border: 1.5px solid rgba(251, 148, 35, .35);
    font-weight: 700;
    line-height: 1;
    transition: all .2s ease;
}

.related-price--simple { border-color: rgba(0, 0, 0, .08); }

.related-price__final {
    color: #212529;
    font-size: 1.05rem;
    letter-spacing: -.01em;
    line-height: 1;
}

.related-price__old {
    color: #adb5bd;
    font-size: .8rem;
    font-weight: 500;
    text-decoration: line-through;
    text-decoration-thickness: 1.5px;
    line-height: 1;
}

/* ---------- Footer: precio + botón ---------- */
.related-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: 0;
    padding-top: 12px;
    border-top: 1px dashed rgba(0, 0, 0, .06);
    flex-wrap: wrap;
}

.related-footer__btn {
    white-space: nowrap;
    flex-shrink: 0;
    border-radius: 8px;
    font-weight: 500;
    padding: 6px 12px;
    transition: all .2s ease;
}

/* ---------- Bloque acreditación ---------- */
.related-accreditation {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;

    min-height: 68px;
    padding: 10px 12px;
    margin: auto 0 12px;

    background: #f8f9fa;
    border: 1px solid rgba(0, 0, 0, .04);
    border-radius: 10px;

    text-align: center;
    transition: background .2s ease, border-color .2s ease;
}

.related-accreditation__logo {
    max-height: 34px;
    max-width: 90%;
    width: auto;
    object-fit: contain;
    display: block;
    filter: saturate(.9);
    opacity: .9;
    transition: opacity .2s ease, filter .2s ease;
}

.related-accreditation__name {
    font-size: .72rem;
    line-height: 1.25;
    font-weight: 500;
    color: #6c757d;
    letter-spacing: .01em;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.related-accreditation--text-only .related-accreditation__name {
    font-size: .76rem;
    color: #495057;
    -webkit-line-clamp: 3;
}

/* ---------- Estados hover (todos juntos) ---------- */
.related-card:hover .related-price {
    border-color: rgba(251, 148, 35, .65);
    background: #fffaf3;
}

.related-card:hover .related-footer__btn {
    background: #28a745;
    border-color: #28a745;
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(40, 167, 69, .28);
}

.related-card:hover .related-accreditation {
    background: #fffaf3;
    border-color: rgba(251, 148, 35, .18);
}

.related-card:hover .related-accreditation__logo {
    opacity: 1;
    filter: saturate(1);
}

/* ---------- Responsive de columnas ---------- */
@media (max-width: 575px) { .custom-col { flex: 0 0 100%; max-width: 100%; } }
@media (min-width: 575px) and (max-width: 992px)  { .custom-col { flex: 0 0 50%;      max-width: 50%; } }
@media (min-width: 992px) and (max-width: 1423px) { .custom-col { flex: 0 0 33.3333%; max-width: 33.3333%; } }
@media (min-width: 1424px) { .custom-col { flex: 0 0 25%; max-width: 25%; } }

/* ---------- Ajustes móvil ---------- */
@media (max-width: 575.98px) {
    .related-price__final { font-size: .95rem; }
    .related-price__old   { font-size: .75rem; }
    .related-footer__btn  { padding: 6px 10px; font-size: .78rem; }
    .course-card__image   { height: 140px; }
}

/* =============================================
   CARD DE PACK (variante del card de curso)
   ============================================= */

.course-card__image--pack {
    display: block;
    padding: 0;
    background: #f8f9fa;
}

.course-card__image--pack img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    border-radius: 0;
    box-shadow: none;
}

/* Placeholder si no se puede generar el collage */
.course-card__image--pack .pack-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #fff5e6 0%, #fefaf5 100%);
    color: #fb9423;
    font-size: 2.5rem;
}

/* Badge PACK */
.course-card__badge--pack {
    background: #fb9423;
    color: #fff;
    letter-spacing: .08em;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: .68rem;
    font-weight: 700;
    text-transform: uppercase;
    z-index: 3;
}

/* Hover del pack = igual que el resto de tarjetas */
.related-card--pack:hover .related-price {
    border-color: rgba(251, 148, 35, .65);
    background: #fffaf3;
}

.related-card--pack:hover .related-footer__btn {
    background: #28a745;
    border-color: #28a745;
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(40, 167, 69, .28);
}

/* =============================================
   AJUSTE: footer del pack empuja al fondo
   ============================================= */

.related-card--pack .related-footer {
    margin-top: auto;
}

/* =============================================
   BADGE PACK — estilo clásico rojo redondeado
   ============================================= */

.course-card__badge--pack {
    position: absolute;
    top: 0;
    right: 0;
    left: auto;

    background: #e41d1d;
    color: #fff;
    padding: 4px 10px;

    font-size: .9rem;
    font-weight: 700;
    letter-spacing: .02em;

    border-radius: 0 0 0 8px;
    text-transform: uppercase;
    z-index: 3;
}

/* =============================================
   BADGE DE VALORACIÓN EN LA IMAGEN
   ============================================= */

.course-card__rating {
    position: absolute;
    bottom: 8px;
    right: 8px;
    z-index: 3;

    display: inline-flex;
    align-items: center;
    gap: 4px;

    padding: 4px 10px;
    border-radius: 999px;

    background: rgba(255, 255, 255, .95);
    backdrop-filter: blur(4px);

    color: #212529;
    font-size: .78rem;
    font-weight: 700;
    line-height: 1;
    letter-spacing: -.01em;

    box-shadow: 0 2px 8px rgba(0, 0, 0, .12);
}

.course-card__rating i {
    color: #fb9423;
    font-size: .72rem;
}

/* Hover: se intensifica ligeramente */
.related-card:hover .course-card__rating {
    background: #fff;
    box-shadow: 0 4px 12px rgba(251, 148, 35, .28);
}

/* =============================================
   BLOQUE DESTACADO: Nº DE CURSOS EN EL PACK
   ============================================= */

.pack-courses-highlight {
    position: relative;
    display: flex;
    align-items: center;
    gap: 14px;

    padding: 14px 16px;
    margin: 6px 0 16px;

    background: linear-gradient(135deg, #fff8ed 0%, #fffaf3 100%);
    border: 1px solid rgba(251, 148, 35, .2);
    border-radius: 12px;

    overflow: hidden;
    transition: background .2s ease, border-color .2s ease;
}

.related-card--pack:hover .pack-courses-highlight {
    background: linear-gradient(135deg, #fff3e0 0%, #fff8ed 100%);
    border-color: rgba(251, 148, 35, .4);
}

/* Número grande a la izquierda */
.pack-courses-highlight__number {
    flex-shrink: 0;
    font-size: 2.1rem;
    font-weight: 800;
    line-height: 1;
    color: #fb9423;
    letter-spacing: -.03em;
    font-family: "Inter", sans-serif;
}

/* Texto descriptivo */
.pack-courses-highlight__text {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
    min-width: 0;
}

.pack-courses-highlight__text strong {
    font-size: .88rem;
    font-weight: 700;
    color: #212529;
}

.pack-courses-highlight__text span {
    font-size: .74rem;
    color: #6c757d;
    margin-top: 2px;
}

/* Icono decorativo grande translúcido en el fondo */
.pack-courses-highlight__icon {
    position: absolute;
    right: -8px;
    bottom: -10px;
    font-size: 4.5rem;
    color: rgba(251, 148, 35, .08);
    pointer-events: none;
    transition: color .25s ease, transform .25s ease;
}

.related-card--pack:hover .pack-courses-highlight__icon {
    color: rgba(251, 148, 35, .14);
    transform: scale(1.05) rotate(-5deg);
}

.course-card__badge--bestseller {
  background: linear-gradient(135deg, #ff5722, #e53935);
  color: #fff;
  font-weight: 700;
  letter-spacing: .3px;
  box-shadow: 0 2px 6px rgba(229, 57, 53, .35);
}

.course-card__badge--bestseller .fa-fire {
  margin-right: 4px;
  font-size: .85em;
}

/* Móvil */
@media (max-width: 575.98px) {
    .pack-courses-highlight {
        padding: 12px 14px;
        gap: 10px;
        margin-bottom: 12px;
    }
    .pack-courses-highlight__number {
        font-size: 1.8rem;
    }
    .pack-courses-highlight__text strong {
        font-size: .82rem;
    }
    .pack-courses-highlight__text span {
        font-size: .7rem;
    }
    .pack-courses-highlight__icon {
        font-size: 3.5rem;
    }
}