/*
   CURSOS · Hub /cursos (grilla de cursos)
   Se apoya en ../index.css (variables, header, orbes, .container, .gradient-text).
   Ojo: no usar la clase .btn en enlaces que no sean de conversión;
   pixel-events.js dispara el evento Lead en cualquier a.btn.
*/

:root {
    --acc-cyan: 34, 211, 238;
    --acc-violet: 192, 132, 252;
    --acc-emerald: 52, 211, 153;
    --acc-amber: 251, 191, 36;
    /* Color por defecto: los .is-* lo reemplazan. No declarar --accent en los componentes: pisaría a los .is-* */
    --accent: var(--acc-cyan);
}

.is-cyan {
    --accent: var(--acc-cyan);
}

.is-violet {
    --accent: var(--acc-violet);
}

.is-emerald {
    --accent: var(--acc-emerald);
}

.is-amber {
    --accent: var(--acc-amber);
}

h1,
h2,
h3 {
    text-wrap: balance;
}

p {
    text-wrap: pretty;
}

a,
button {
    touch-action: manipulation;
}

:where(a, button):focus-visible {
    outline: 2px solid rgb(var(--acc-cyan));
    outline-offset: 3px;
}

/* --- HERO --- */
.hub-hero {
    padding-top: 160px;
    padding-bottom: clamp(40px, 6vw, 72px);
    text-align: center;
}

.hub-badge {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 28px;
    padding: 8px 16px;
    border-radius: 100px;
    font-size: 0.875rem;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.16);
    backdrop-filter: blur(6px);
}

.hub-badge i {
    color: rgb(var(--acc-cyan));
}

.hub-hero h1 {
    max-width: 14em;
    margin: 0 auto 22px;
    font-size: clamp(2.4rem, 5.6vw, 4.4rem);
    font-weight: 700;
    line-height: 1.05;
    letter-spacing: -0.03em;
}

.hub-lead {
    max-width: 38em;
    margin: 0 auto 36px;
    font-size: clamp(1.05rem, 1.6vw, 1.25rem);
    color: var(--text-gray);
}

.hub-acciones {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 16px;
}

.eyebrow {
    display: inline-block;
    margin-bottom: 14px;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: rgb(var(--acc-cyan));
}

.hub-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 16px 32px;
    border: 1px solid transparent;
    border-radius: 100px;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: transform 0.25s ease, background 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.hub-btn--solido {
    color: #000;
    background: #fff;
}

.hub-btn--solido:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(0, 198, 251, 0.25);
}

.hub-btn--ghost {
    color: #fff;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.18);
    backdrop-filter: blur(10px);
}

.hub-btn--ghost:hover {
    transform: translateY(-3px);
    background: rgba(255, 255, 255, 0.14);
    border-color: rgba(255, 255, 255, 0.32);
}

@media (prefers-reduced-motion: no-preference) {

    .hub-badge,
    .hub-hero h1,
    .hub-lead,
    .hub-acciones {
        animation: fadeUp 0.9s ease-out backwards;
    }

    .hub-hero h1 {
        animation-delay: 0.1s;
    }

    .hub-lead {
        animation-delay: 0.2s;
    }

    .hub-acciones {
        animation-delay: 0.3s;
    }
}

/* --- GRILLA --- */
.hub-listado {
    padding-block: clamp(24px, 4vw, 48px) clamp(56px, 8vw, 96px);
    scroll-margin-top: 40px;
}

.cursos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr));
    gap: 24px;
}

.curso-card {
    position: relative;
    isolation: isolate;
    display: flex;
    flex-direction: column;
    padding: clamp(26px, 3.5vw, 36px);
    border-radius: 28px;
    overflow: hidden;
    color: inherit;
    text-decoration: none;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    transition: transform 0.35s ease, border-color 0.35s ease, background 0.35s ease, box-shadow 0.35s ease;
}

.curso-card::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background: radial-gradient(520px circle at 0% 0%, rgba(var(--accent), 0.18), transparent 62%);
}

.curso-card:hover {
    transform: translateY(-6px);
    border-color: rgba(var(--accent), 0.5);
    background: var(--glass-hover);
    box-shadow: 0 24px 50px rgba(0, 0, 0, 0.45);
}

.curso-card__top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 24px;
}

.curso-card__icono {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 60px;
    border-radius: 18px;
    font-size: 1.5rem;
    color: rgb(var(--accent));
    background: rgba(var(--accent), 0.12);
    border: 1px solid rgba(var(--accent), 0.28);
}

.curso-card__tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    border-radius: 100px;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    color: rgb(var(--accent));
    background: rgba(var(--accent), 0.1);
    border: 1px solid rgba(var(--accent), 0.3);
}

.curso-card__tag--mio {
    --accent: var(--acc-emerald);
}

.curso-card h2 {
    margin-bottom: 12px;
    font-size: clamp(1.45rem, 2.4vw, 1.8rem);
    letter-spacing: -0.01em;
}

.curso-card__resumen {
    margin-bottom: 22px;
    color: var(--text-gray);
}

.curso-card__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 20px;
    margin-bottom: 28px;
    list-style: none;
    font-size: 0.92rem;
    color: rgba(255, 255, 255, 0.82);
}

.curso-card__meta li {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.curso-card__meta i {
    color: rgb(var(--accent));
}

.curso-card__pie {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-top: auto;
    padding-top: 22px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.curso-card__precio {
    font-family: var(--font-display);
    font-size: 1.7rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.curso-card__precio--mio {
    font-size: 1.15rem;
    color: rgb(var(--acc-emerald));
}

.curso-card__ir {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    color: rgb(var(--accent));
    transition: gap 0.25s ease;
}

.curso-card:hover .curso-card__ir {
    gap: 14px;
}

/* Tarjeta de sugerencias */
.curso-card--idea {
    justify-content: center;
    background: transparent;
    border-style: dashed;
    border-color: rgba(255, 255, 255, 0.18);
}

.curso-card--idea::before {
    display: none;
}

.curso-card--idea .curso-card__icono {
    margin-bottom: 22px;
}

.curso-card--idea .curso-card__ir {
    margin-top: 6px;
}

.hub-vacio {
    padding: 64px 24px;
    text-align: center;
    border-radius: 28px;
    background: var(--glass-bg);
    border: 1px dashed rgba(255, 255, 255, 0.18);
}

.hub-vacio i {
    margin-bottom: 18px;
    font-size: 2.4rem;
    color: rgb(var(--acc-emerald));
}

.hub-vacio h2 {
    margin-bottom: 8px;
    font-size: 1.6rem;
}

.hub-vacio p {
    color: var(--text-gray);
}

/* --- CÓMO FUNCIONA --- */
.hub-pasos {
    padding-block: clamp(32px, 5vw, 56px) clamp(72px, 9vw, 112px);
}

.hub-pasos__titulo {
    margin-bottom: 36px;
    text-align: center;
    font-size: clamp(1.7rem, 3.4vw, 2.3rem);
    letter-spacing: -0.02em;
}

.hub-pasos__lista {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;
    list-style: none;
}

.hub-pasos__lista li {
    display: flex;
    align-items: flex-start;
    gap: 18px;
    padding: 26px;
    border-radius: 22px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
}

.hub-pasos__num {
    display: flex;
    flex: none;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-family: var(--font-display);
    font-weight: 700;
    color: rgb(var(--acc-cyan));
    background: rgba(var(--acc-cyan), 0.12);
    border: 1px solid rgba(var(--acc-cyan), 0.3);
}

.hub-pasos__lista strong {
    display: block;
    margin-bottom: 4px;
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-weight: 500;
}

.hub-pasos__lista p {
    font-size: 0.95rem;
    color: var(--text-gray);
}

/* --- CHECKOUT --- */
.cx {
    padding-top: 140px;
    padding-bottom: clamp(56px, 8vw, 96px);
}

.cx-volver {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 28px;
    font-size: 0.95rem;
    color: var(--text-gray);
    text-decoration: none;
    transition: color 0.2s ease;
}

.cx-volver:hover {
    color: #fff;
}

.cx-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
    gap: 28px;
    align-items: start;
}

.cx-card {
    padding: clamp(26px, 4vw, 44px);
    border-radius: 28px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
}

.cx-card h1 {
    margin-bottom: 12px;
    font-size: clamp(1.9rem, 4vw, 2.6rem);
    letter-spacing: -0.02em;
}

.cx-sub {
    margin-bottom: 28px;
    color: var(--text-gray);
}

.cx-campo {
    margin-bottom: 20px;
}

.cx-campo label {
    display: block;
    margin-bottom: 8px;
    font-size: 0.92rem;
    font-weight: 600;
}

.cx-campo input {
    width: 100%;
    padding: 15px 16px;
    border-radius: 14px;
    font: inherit;
    font-size: 1rem;
    color: #fff;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.14);
    transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.cx-campo input:focus {
    outline: none;
    border-color: rgb(var(--acc-cyan));
    background: rgba(255, 255, 255, 0.07);
    box-shadow: 0 0 0 3px rgba(var(--acc-cyan), 0.18);
}

.cx-campo small {
    display: block;
    margin-top: 7px;
    font-size: 0.85rem;
    color: var(--text-gray);
}

.cx-opcional {
    font-weight: 400;
    color: var(--text-gray);
}

.cx-trampa {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.cx-pagar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    margin-top: 8px;
    padding: 18px 28px;
    border: none;
    border-radius: 100px;
    font: inherit;
    font-size: 1.05rem;
    font-weight: 700;
    color: #000;
    background: #fff;
    cursor: pointer;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.cx-pagar:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(0, 198, 251, 0.3);
}

.cx-pagar:disabled {
    opacity: 0.75;
    cursor: progress;
}

.cx-seguro {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-top: 16px;
    font-size: 0.88rem;
    color: var(--text-gray);
}

.cx-seguro i {
    margin-top: 3px;
    color: rgb(var(--acc-emerald));
}

.cx-ayuda {
    margin-top: 22px;
    font-size: 0.92rem;
    color: var(--text-gray);
}

.cx-ayuda a,
.cx-aviso a {
    color: rgb(var(--acc-cyan));
    text-decoration: underline;
    text-underline-offset: 3px;
}

.cx-aviso {
    margin-bottom: 22px;
    padding: 14px 16px;
    border-radius: 14px;
    font-size: 0.95rem;
}

.cx-aviso p+p {
    margin-top: 6px;
}

.cx-aviso--error {
    color: #ffb4b4;
    background: rgba(255, 77, 77, 0.1);
    border: 1px solid rgba(255, 77, 77, 0.3);
}

.cx-aviso--info,
.cx-aviso--ok {
    color: #cdeffb;
    background: rgba(var(--acc-cyan), 0.1);
    border: 1px solid rgba(var(--acc-cyan), 0.3);
}

.cx-resumen {
    position: sticky;
    top: 110px;
}

.cx-curso {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    margin: 16px 0 22px;
}

.cx-curso__icono {
    display: flex;
    flex: none;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    border-radius: 16px;
    font-size: 1.4rem;
    color: rgb(var(--accent));
    background: rgba(var(--accent), 0.12);
    border: 1px solid rgba(var(--accent), 0.28);
}

.cx-curso h2 {
    margin-bottom: 6px;
    font-size: 1.25rem;
}

.cx-curso p {
    font-size: 0.92rem;
    color: var(--text-gray);
}

.cx-incluye {
    display: grid;
    gap: 12px;
    padding: 20px 0;
    list-style: none;
    border-block: 1px solid rgba(255, 255, 255, 0.1);
}

.cx-incluye li {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.88);
}

.cx-incluye i {
    width: 1.2em;
    text-align: center;
    color: rgb(var(--accent));
}

.cx-total {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-top: 20px;
}

.cx-total span {
    font-weight: 600;
}

.cx-total small {
    display: block;
    font-weight: 400;
    color: var(--text-gray);
}

.cx-total strong {
    font-family: var(--font-display);
    font-size: 2rem;
    letter-spacing: -0.02em;
}

/* --- RETORNO / PASARELA SIMULADA --- */
.rt {
    display: flex;
    justify-content: center;
    padding-top: 150px;
    padding-bottom: clamp(56px, 8vw, 96px);
}

.rt-card {
    --estado: var(--acc-cyan);
    width: 100%;
    max-width: 620px;
    padding: clamp(30px, 5vw, 52px);
    border-radius: 32px;
    text-align: center;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
}

.rt-card--ok {
    --estado: var(--acc-emerald);
    border-color: rgba(var(--acc-emerald), 0.35);
}

.rt-card--error {
    --estado: 255, 107, 107;
    border-color: rgba(255, 107, 107, 0.35);
}

.rt-card--espera {
    --estado: var(--acc-amber);
}

.rt-icono {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 84px;
    height: 84px;
    margin-bottom: 24px;
    border-radius: 50%;
    font-size: 2.2rem;
    color: rgb(var(--estado));
    background: rgba(var(--estado), 0.12);
    border: 1px solid rgba(var(--estado), 0.35);
}

.rt-card h1 {
    margin-bottom: 14px;
    font-size: clamp(1.8rem, 4vw, 2.4rem);
    letter-spacing: -0.02em;
}

.rt-texto {
    max-width: 30em;
    margin: 0 auto 26px;
    color: var(--text-gray);
}

.rt-texto strong {
    color: #fff;
}

.rt-datos {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px 36px;
    margin: 0 auto 30px;
    padding: 18px 22px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.rt-datos dt {
    font-size: 0.78rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-gray);
}

.rt-datos dd {
    margin-top: 2px;
    font-weight: 600;
}

.rt-acciones,
.sim-botones {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 14px;
}

.sim-banda {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 22px;
    padding: 6px 14px;
    border-radius: 100px;
    font-size: 0.8rem;
    font-weight: 600;
    color: rgb(var(--acc-amber));
    background: rgba(var(--acc-amber), 0.1);
    border: 1px solid rgba(var(--acc-amber), 0.3);
}

/* --- RESPONSIVE --- */
@media (max-width: 900px) {
    .hub-hero {
        padding-top: 130px;
    }

    .hub-pasos__lista {
        grid-template-columns: 1fr;
    }

    .cx {
        padding-top: 120px;
    }

    .cx-grid {
        grid-template-columns: 1fr;
    }

    .cx-resumen {
        position: static;
        order: -1;
    }

    .rt {
        padding-top: 120px;
    }
}

@media (max-width: 600px) {
    .hub-acciones {
        flex-direction: column;
    }

    .hub-btn {
        width: 100%;
    }

    .curso-card__precio {
        font-size: 1.5rem;
    }
}

@media (prefers-reduced-motion: reduce) {

    .curso-card:hover,
    .hub-btn:hover {
        transform: none;
    }
}
