/* ── WRAPPER ── */
.cs-wrap {
    max-width: 1100px;
    margin: 40px auto;
    padding: 0 24px 60px;
}

/* ── GRID ── */
.cs-grid {
    display: grid;
    grid-template-columns: 340px 1fr;
    gap: 40px;
    align-items: start;
}

/* ── COLUMNA IZQUIERDA ── */
.cs-thumb {
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #E8EEF9;
}

.cs-thumb img {
    width: 100%;
    height: 220px;
    object-fit: cover;
    display: block;
}

.cs-titulo {
    font-size: 20px;
    font-weight: 700;
    color: #00246F;
    padding: 16px;
    margin: 0;
}

/* ── VIDEO ── */
.cs-video {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    margin-top: 20px;
    border-radius: 10px;
    overflow: hidden;
}

.cs-video iframe {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    border: none;
}

/* ── COLUMNA DERECHA ── */
.cs-descripcion {
    margin-bottom: 32px;
}

.cs-descripcion h4,
.cs-contenido h4 {
    font-size: 17px;
    font-weight: 700;
    color: #00246F;
    margin-bottom: 12px;
}

.cs-descripcion p {
    font-size: 15px;
    color: #4A5568;
    line-height: 1.7;
}

/* ── ACCORDION ── */
.cs-accordion {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.cs-acc-item {
    border: 1px solid #D6E4FF;
    border-radius: 10px;
    overflow: hidden;
    background: #fff;
}

.cs-acc-item.bloqueada {
    background: #F7F8FA;
    border-color: #E5E5E5;
}

.cs-acc-header {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    background: none;
    border: none;
    cursor: pointer;
    text-align: left;
}

.cs-acc-header.disabled {
    cursor: not-allowed;
    opacity: 0.6;
}

.cs-acc-arrow {
    color: #7A8EAE;
    display: flex;
    align-items: center;
    flex-shrink: 0;
    transition: transform 0.2s;
}

.cs-acc-header[aria-expanded="true"] .cs-acc-arrow,
.cs-acc-body.open ~ .cs-acc-header .cs-acc-arrow {
    transform: rotate(180deg);
}

.cs-acc-titulo {
    flex: 1;
    font-size: 14px;
    font-weight: 500;
    color: #00246F;
}

.cs-acc-item.bloqueada .cs-acc-titulo {
    color: #ADB5BD;
}

/* ── CÍRCULO SVG ── */
.cs-progress-circle {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.cs-track {
    fill: none;
    stroke: #E5E5E5;
    stroke-width: 3;
}

.cs-fill {
    fill: none;
    stroke-width: 3;
    stroke-linecap: round;
    transform: rotate(-90deg);
    transform-origin: 50% 50%;
    transition: stroke-dashoffset 0.4s ease;
}

.fill-green  { stroke: #00D118; }
.fill-yellow { stroke: #FFA500; }
.fill-blue   { stroke: #386AF1; }
.fill-gray   { stroke: #D9D9D9; }

.cs-pct-label {
    position: absolute;
    font-size: 9px;
    font-weight: 700;
}

/* ── CUERPO ACCORDION ── */
.cs-acc-body {
    display: none;
    padding: 0 18px 18px;
}

.cs-acc-body.open {
    display: block;
}

.cs-acc-desc {
    font-size: 14px;
    color: #4A5568;
    line-height: 1.6;
    margin-bottom: 16px;
}

.cs-acc-btn-wrap {
    display: flex;
    justify-content: center;
}

.cs-btn-ingresar {
    display: inline-block;
    padding: 10px 40px;
    border: 1.5px solid #386AF1;
    border-radius: 8px;
    color: #386AF1;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    transition: background 0.2s, color 0.2s;
    background: #fff;
}

.cs-btn-ingresar:hover {
    background: #386AF1;
    color: #fff;
}

.cs-sin-lecciones {
    color: #7A8EAE;
    font-size: 14px;
}

/* ── RESPONSIVE ── */
@media (max-width: 768px) {
    .cs-grid {
        grid-template-columns: 1fr;
    }
    .cs-wrap {
        padding: 0 16px 40px;
    }
}

/* ══════════════════════════════
   LECCIÓN SINGLE (ls- legacy)
══════════════════════════════ */
.ls-wrap {
    max-width: 1100px;
    margin: 40px auto;
    padding: 0 24px 60px;
}

.ls-titulo {
    font-size: 24px;
    font-weight: 700;
    color: #00246F;
    margin-bottom: 24px;
}

.ls-video {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    margin-bottom: 32px;
    border-radius: 10px;
    overflow: hidden;
}

.ls-video iframe {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    border: none;
}

.ls-contenido {
    font-size: 15px;
    color: #4A5568;
    line-height: 1.8;
    margin-bottom: 32px;
}

.ls-acciones {
    display: flex;
    gap: 16px;
    align-items: center;
    flex-wrap: wrap;
}

.ls-btn-volver {
    color: #386AF1;
    text-decoration: none;
    font-size: 14px;
}

.ls-btn-completar {
    padding: 12px 28px;
    background: #386AF1;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
}

.ls-btn-completar:hover    { background: #1f4fd4; }
.ls-btn-completar:disabled { background: #A8C0F8; cursor: not-allowed; }

.ls-completada-badge {
    color: #00791A;
    font-size: 15px;
    font-weight: 500;
}

/* ══════════════════════════════
   LECCIÓN SINGLE (sl-)
══════════════════════════════ */
.sl-wrap * {
    box-sizing: border-box;
}

.sl-wrap h2,
.sl-wrap h3 {
    margin: 0;
    padding: 0;
}

.sl-wrap p:not(.sl-modal-texto) {
    margin: 0;
    padding: 0;
}

.sl-wrap {
    max-width: 1100px;
    margin: 40px auto;
    padding: 0 24px 60px;
}

/* ── Tarjeta superior ── */
.sl-card-top {
    border: 1px solid #E0E0E0;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 40px;
}

.sl-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 24px;
    border-bottom: 1px solid #E0E0E0;
}

.sl-curso-titulo {
    font-size: 20px;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0;
}

.sl-card-row {
    padding: 12px 24px;
    border-bottom: 1px solid #E0E0E0;
}

.sl-card-row:last-child {
    border-bottom: none;
}

.sl-leccion-nombre {
    font-size: 14px;
    color: #1a1a1a;
    font-weight: 400;
}

.sl-duracion {
    font-size: 14px;
    color: #1a1a1a;
}

/* ── Círculo progreso ── */
.sl-progress-circle {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.sl-track {
    fill: none;
    stroke: #E5E5E5;
    stroke-width: 3;
}

.sl-fill {
    fill: none;
    stroke-width: 3;
    stroke-linecap: round;
    transform: rotate(-90deg);
    transform-origin: 50% 50%;
}

.sl-pct-label {
    position: absolute;
    font-size: 9px;
    font-weight: 700;
}

/* ── Cuerpo ── */
.sl-body {
    display: grid;
    grid-template-columns: 160px 1fr;
    gap: 24px;
    align-items: start;
}

/* ── Sidebar ── */
.sl-sidebar-card {
    border: 1px solid #E0E0E0;
    border-radius: 10px;
    padding: 20px 16px;
    text-align: center;
    background: #fff;
}

.sl-sidebar-label {
    font-size: 13px;
    color: #4A5568;
    line-height: 1.4;
    display: block;
    margin-bottom: 10px;
}

.sl-sidebar-count {
    font-size: 18px;
    font-weight: 700;
    color: #1a1a1a;
}

/* ── Contenido principal ── */
.sl-atencion-titulo {
    font-size: 17px;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 6px;
}

.sl-atencion-desc {
    font-size: 13px;
    color: #4A5568;
    margin-bottom: 32px;
}

/* ── Video ── */
.sl-video {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    margin-bottom: 40px;
    margin-top: 40px;
    border-radius: 10px;
    overflow: hidden;
    background: #B0BEC5;
}

.sl-video iframe {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    border: none;
}

/* ── Quiz ── */
.sl-quiz {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 32px;
}

.sl-pregunta {
    border: 1px solid #E0E0E0;
    border-radius: 10px;
    padding: 20px;
    background: #fff;
}

.sl-pregunta-titulo {
    font-size: 14px;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 6px;
    line-height: 1.5;
}

.sl-seleccione {
    font-size: 12px;
    color: #7A8EAE;
    margin-bottom: 14px;
}

.sl-opciones {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.sl-opcion {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    color: #1a1a1a;
    cursor: pointer;
}

.sl-opcion input[type="radio"] {
    accent-color: #386AF1;
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

/* ── Acciones ── */
.sl-acciones {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 16px;
}

.sl-btn-volver {
    color: #386AF1;
    text-decoration: none;
    font-size: 14px;
}

.sl-btn-finalizar {
    padding: 10px 40px;
    border: 1.5px solid #386AF1;
    border-radius: 8px;
    background: #fff;
    color: #386AF1;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}

.sl-btn-finalizar:hover:not(:disabled) {
    background: #386AF1;
    color: #fff;
}

.sl-btn-finalizar:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.sl-completada-badge {
    color: #00791A;
    font-size: 15px;
    font-weight: 500;
}

/* ── Responsive ── */
@media (max-width: 768px) {
    .sl-body {
        grid-template-columns: 1fr;
    }
    .sl-sidebar {
        display: none;
    }
}

/* ── Modal error quiz ── */
.sl-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 36, 111, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.sl-modal-box {
    background: #fff;
    border-radius: 12px;
    padding: 40px 36px;
    max-width: 420px;
    width: 90%;
    text-align: center;
    box-shadow: 0 8px 32px rgba(0,36,111,0.15);
}

.sl-modal-texto {
    font-size: 16px;
    color: #00246F;
    font-weight: 500;
    line-height: 1.6;
    margin-bottom: 40px !important;
}

.sl-modal-btn {
    padding: 10px 32px;
    background: #386AF1;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
}

.sl-modal-btn:hover {
    background: #1f4fd4;
}

/* ── Override Blocksy ── */
.single-mass_leccion .entry-content,
.single-mass_curso .entry-content,
.single-mass_leccion .ct-container,
.single-mass_curso .ct-container,
.single-mass_leccion .ct-container--fullwidth,
.single-mass_curso .ct-container--fullwidth,
.single-mass_leccion .wp-block-post-content,
.single-mass_curso .wp-block-post-content,
.single-mass_leccion main,
.single-mass_curso main {
    max-width: 100% !important;
    width: 100% !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
}

.single-mass_leccion .sl-wrap,
.single-mass_curso .cs-wrap {
    max-width: 1100px !important;
    width: 100% !important;
    margin: 40px auto !important;
    padding: 0 24px 60px !important;
}