/* ═══════════════════════════════════════════════════════════════
   BLOQUE DE CIERRE DE TARJETA / FICHA  (GoClass)

   Dos modos con el mismo peso visual para que la cuadrícula no
   tenga huecos:

   1) CURSO GRATUITO → oferta de adquisición completa:
      recibo ancla ($0.00 curso + $99.00 paquete = $99.00 total),
      CTA primario y fila secundaria (WhatsApp + ver curso gratis).
   2) CURSO DE PAGO → precio del curso + lo que incluye
      (las herramientas Pro vienen en su precio).

   En la ficha y en el hero se muestra además el desglose de las
   cuatro herramientas y la nota de pago único.
   ═══════════════════════════════════════════════════════════════ */

.cpo {
    display: block;
    margin-top: 12px;
}

/* ── Recibo de precio (0 + 99) ─────────────────────────────── */
.cpo-receipt {
    background: rgba(255, 255, 255, .75);
    border: 1px dashed #c7d2fe;
    border-radius: 12px;
    padding: 9px 11px;
}
.cpo-receipt-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
    padding: 3px 0;
    font-size: 12.5px;
}
.cpo-receipt-lbl {
    color: #64748b;
    font-weight: 600;
    line-height: 1.35;
}
.cpo-receipt-free {
    color: #059669;
    font-weight: 800;
    white-space: nowrap;
}
.cpo-receipt-pack {
    color: #4338ca;
    font-weight: 800;
    white-space: nowrap;
}
.cpo-receipt-total {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
    margin-top: 7px;
    padding-top: 8px;
    border-top: 1px solid #e2e8f0;
    font-size: 12px;
    color: #475569;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .4px;
}
.cpo-receipt-total b {
    font-size: 26px;
    font-weight: 900;
    color: #4338ca;
    letter-spacing: -1px;
    line-height: 1;
    text-transform: none;
    white-space: nowrap;
}
.cpo-receipt-total b small {
    font-size: 12px;
    font-weight: 800;
    color: #6366f1;
    letter-spacing: 0;
}

/* ── Título (sólo ficha / hero) ────────────────────────────── */
.cpo-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13.5px;
    font-weight: 800;
    color: #3730a3;
    text-transform: uppercase;
    letter-spacing: .6px;
    margin-bottom: 9px;
}
.cpo-title i { font-size: 16px; color: #4f46e5; }

/* ── Desglose de herramientas (ficha / hero) ───────────────── */
.cpo-tools {
    list-style: none;
    margin: 11px 0 0;
    padding: 0;
    display: grid;
    gap: 7px;
}
.cpo-tools li {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 12.5px;
    color: #334155;
    font-weight: 600;
    line-height: 1.4;
}
.cpo-tools li i {
    color: #4f46e5;
    font-size: 14px;
    line-height: 1.35;
    flex-shrink: 0;
}
.cpo-tools li span { flex: 1 1 auto; }
.cpo-tools li em {
    display: block;
    font-style: normal;
    font-size: 11.5px;
    color: #94a3b8;
    font-weight: 500;
    margin-top: 1px;
}

/* ── Nota de riesgo-bajo (ficha / hero) ───────────────────── */
.cpo-note {
    display: flex;
    align-items: center;
    gap: 7px;
    margin-top: 11px;
    font-size: 11.5px;
    color: #64748b;
    font-weight: 600;
}
.cpo-note i { color: #d97706; font-size: 13px; }

/* ── CTA primario ──────────────────────────────────────────── */
.cpo-cta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    margin-top: 12px;
    padding: 12px 14px;
    border: none;
    border-radius: 12px;
    background: linear-gradient(135deg, #4f46e5 0%, #6366f1 100%);
    color: #ffffff;
    font-size: 14px;
    font-weight: 800;
    text-align: center;
    text-decoration: none;
    letter-spacing: .1px;
    box-shadow: 0 8px 18px rgba(79, 70, 229, .30);
    transition: transform .16s ease, box-shadow .16s ease;
}
.cpo-cta:hover,
.cpo-cta:focus {
    transform: translateY(-2px);
    box-shadow: 0 14px 26px rgba(79, 70, 229, .38);
    color: #ffffff;
    text-decoration: none;
}
.cpo-cta:active { transform: translateY(0); }
.cpo-cta i { font-size: 16px; }

/* ── Fila secundaria (WhatsApp + enlace fantasma) ──────────── */
.cpo-ghost-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: 10px;
}
.cpo-wa {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 11px;
    border: 1px solid #bbf7d0;
    background: #f0fdf4;
    color: #16a34a;
    font-size: 19px;
    text-decoration: none;
    transition: background .15s ease, transform .15s ease;
}
.cpo-wa:hover { background: #dcfce7; transform: translateY(-1px); text-decoration: none; }
.cpo-ghost {
    font-size: 13px;
    font-weight: 700;
    color: #4338ca;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.cpo-ghost:hover { color: #3730a3; text-decoration: underline; }
.cpo-ghost i { font-size: 13px; }

/* ── Píldora "ya incluido / activo" (ficha / hero) ─────────── */
.cpo-included-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    width: 100%;
    padding: 9px 12px;
    margin-top: 12px;
    border-radius: 11px;
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    color: #047857;
    font-size: 12.5px;
    font-weight: 800;
    text-align: center;
}

/* ── Lo que incluye (tarjeta de curso de pago) ─────────────── */
.cpo-includes {
    list-style: none;
    margin: 8px 0 0;
    padding: 0;
    display: grid;
    gap: 5px;
}
.cpo-includes li {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 11.5px;
    font-weight: 600;
    color: #475569;
    line-height: 1.35;
}
.cpo-includes li i { color: #10b981; font-size: 13px; flex-shrink: 0; }
.cpo-includes li:first-child { font-weight: 800; color: #047857; }

/* ── Variantes ─────────────────────────────────────────────── */

/* Tarjeta de listado (portada / buscador): compacto.
   container-type permite adaptar el recibo a tarjetas angostas (buscador). */
.cpo--card {
    container-type: inline-size;
    background: linear-gradient(135deg, #eef2ff 0%, #f8fafc 100%);
    border: 1px solid #c7d2fe;
    border-radius: 14px;
    padding: 10px 11px 11px;
    margin-top: 0;
}
.cpo--card .cpo-receipt { background: rgba(255, 255, 255, .7); padding: 6px 9px; }
.cpo--card .cpo-receipt-row { font-size: 11.5px; padding: 1px 0; }
.cpo--card .cpo-receipt-total { font-size: 11px; margin-top: 4px; padding-top: 5px; }
.cpo--card .cpo-receipt-total b { font-size: 20px; }
.cpo--card .cpo-cta { font-size: 12.5px; padding: 10px 6px; gap: 6px; margin-top: 9px; letter-spacing: -.1px; }
.cpo--card .cpo-ghost-row { margin-top: 8px; }
.cpo--card .cpo-wa { width: 34px; height: 34px; border-radius: 10px; font-size: 17px; }

/* Curso de pago en listado: mismo peso visual que la oferta */
.cpo--paid {
    background: linear-gradient(135deg, #ecfdf5 0%, #f8fafc 100%);
    border-color: #a7f3d0;
}
.cpo--paid .cpo-receipt { background: rgba(255, 255, 255, .75); border-color: #bbf7d0; }
.cpo--paid .cpo-receipt-pack { color: #047857; }

/* Tarjetas angostas (buscador): el total del recibo se apila para no
   partir "Total a pagar hoy" en dos renglones. */
@container (max-width: 259px) {
    .cpo--card .cpo-receipt-total {
        flex-direction: column;
        align-items: flex-start;
        gap: 1px;
    }
    .cpo--card .cpo-receipt-row { align-items: flex-start; gap: 4px; }
    .cpo--card .cpo-receipt-row .cpo-receipt-lbl { font-size: 11px; }
}

/* Sidebar de compra de la ficha */
.cpo--sidebar {
    background: linear-gradient(160deg, #eef2ff 0%, #ffffff 60%);
    border: 1px solid #c7d2fe;
    border-radius: 16px;
    padding: 16px 16px 17px;
    box-shadow: 0 10px 26px rgba(67, 56, 202, .10);
}

/* Tarjeta oscura del hero en móvil */
.cpo--hero {
    background: rgba(255, 255, 255, .12);
    border: 1px solid rgba(255, 255, 255, .28);
    border-radius: 16px;
    padding: 15px;
    backdrop-filter: blur(8px);
}
.cpo--hero .cpo-title { color: #ffffff; }
.cpo--hero .cpo-title i { color: #a5b4fc; }
.cpo--hero .cpo-receipt { background: rgba(15, 23, 42, .35); border-color: rgba(255, 255, 255, .25); }
.cpo--hero .cpo-receipt-lbl { color: #cbd5e1; }
.cpo--hero .cpo-receipt-free { color: #34d399; }
.cpo--hero .cpo-receipt-pack { color: #c7d2fe; }
.cpo--hero .cpo-receipt-total { color: #cbd5e1; border-top-color: rgba(255, 255, 255, .2); }
.cpo--hero .cpo-receipt-total b { color: #ffffff; }
.cpo--hero .cpo-receipt-total b small { color: #c7d2fe; }
.cpo--hero .cpo-tools li { color: #e2e8f0; }
.cpo--hero .cpo-tools li i { color: #a5b4fc; }
.cpo--hero .cpo-tools li em { color: #94a3b8; }
.cpo--hero .cpo-note { color: #cbd5e1; }
.cpo--hero .cpo-note i { color: #fbbf24; }
.cpo--hero .cpo-ghost { color: #c7d2fe; }
.cpo--hero .cpo-ghost:hover { color: #e0e7ff; }

/* ── Pie de tarjeta en modo oferta (vertical) ───────────────
   Nota: el CSS de la tarjeta vive en un <style> inline posterior a
   este enlace, así que aquí se usa doble clase para ganar en
   especificidad (si no, el flex-direction / align-items base manda). */
.home-course-footer-row.home-course-footer-row--offer,
.course-card-bottom-row.course-card-bottom-row--offer {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding-top: 10px;
}
.home-course-footer-row--offer .cpo,
.course-card-bottom-row--offer .cpo {
    margin-top: 0;
}
.home-course-footer-row--offer .home-course-actions-wrap,
.course-card-bottom-row--offer .catalog-course-actions-wrap {
    justify-content: space-between;
    width: 100%;
    margin-top: 8px;
}

/* ── Separación del CTA secundario ────────────────────────────
   "O inscribirmegratis al curso" va justo debajo del bloque de oferta (ficha)
   o de la píldora de incluido: sin este margen queda pegado. */
.cpo + a,
.cpo-included-pill + a {
    margin-top: 16px;
}

/* ── Móvil ─────────────────────────────────────────────────── */
@media (max-width: 575.98px) {
    .cpo-receipt-row { flex-wrap: wrap; gap: 2px 10px; }
}
