/* Generico Modal */
/* ============================================================
   MODALES UNIFICADOS Y RESPONSIVE
   ============================================================ */

/* 1. Base del Overlay (Fondo oscuro) */
.modal-overlayT, 
.modal-overlayCP, 
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    display: none; /* Oculto por defecto */
    align-items: center;
    justify-content: center;
    padding: 15px; /* Espacio para que no toque los bordes en móvil */
    z-index: 10000;
    backdrop-filter: blur(6px);
}

/* 2. Clase Activa (La que activa el JS) */
.modal-overlayT.active, 
.modal-overlayCP.active, 
.modal-overlay.active {
    display: flex !important;
    animation: fadeIn .25s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* 3. Contenedor del Modal */
.modal-container {
    background: #ffffff;
    width: 100%;
    max-width: 650px;
    max-height: 90vh; /* Ocupa máximo el 90% del alto de pantalla */
    border-radius: 20px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 20px 50px rgba(0,0,0,0.3);
}

/* 4. Cuerpo con Scroll interno (Vital para Responsive) */
.modal-body {
    padding: 20px;
    overflow-y: auto; /* Permite scroll si hay muchas clases */
    flex: 1;
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 20px;
    background: #f0f0f0; /* Un fondo sutil circular */
    border: none;
    font-size: 24px;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #333;
    transition: all 0.2s ease;
    z-index: 10;
}

.modal-close:hover {
    background: #e0e0e0;
    color: var(--secondary-color);
    transform: rotate(90deg); /* Efecto visual divertido al pasar el mouse */
}
/* 5. ACORDEÓN (Lógica Limpia) */
.accordion-item {
    border: 1px solid #eee;
    border-radius: 12px;
    margin-bottom: 10px;
    overflow: hidden;
}

.accordion-header {
    width: 100%;
    padding: 15px;
    border: none;
    background: #f8f9fa;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background 0.3s;
}

.accordion-header:hover {
    background: #f0f1f2;
}

.accordion-content {
    display: none; /* JS controla esto */
    padding: 15px;
    background: #fff;
    border-top: 1px solid #eee;
}

.accordion-content.active {
    display: block !important;
}
.accordion-content.open {
  display: block;
}

/* 6. Ajustes de Lecciones */
.lesson {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 0;
    border-bottom: 1px solid #fafafa;
    font-size: 14px;
}

.lesson:last-child { border: none; }
.lesson.locked { color: #999; }

/* 7. Footer del Modal */
.modal-footer {
    padding: 20px;
    background: #fff;
    border-top: 1px solid #eee;
}

.modal-header {
    position: relative; /* Esto permite que la 'X' se ubique respecto al header */
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 25px 20px;
    border-bottom: 1px solid #eee;
}
/* ============================================================
   AJUSTES RESPONSIVE ADICIONALES
   ============================================================ */

@media (max-width: 480px) {
    .modal-container {
        max-height: 95vh;
        border-radius: 15px;
    }
    
    .modal-header h2 { font-size: 1.2rem; }
    
    .commonBtn, .commonBtp, .btn-inscribirme {
        padding: 12px 20px;
        font-size: 14px;
    }

    .heroHeading { font-size: 1.8rem; }
}