/* =========================================
   1. VARIABLES Y BASE
   ========================================= */
:root {
    --azul-claro: #325a9f;
    --azul-oscuro: #213977;
    --accent: #4CC9F0;
    --gray-100: #F5F7FA;
    --gray-300: #CBD5E0;
    --dark-card: #1A202C;
    --font-bebas: 'Bebas Neue', sans-serif;
    --font-main: 'Poppins', sans-serif;
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: var(--font-main);
    color: var(--gray-100);
    background: linear-gradient(135deg, var(--azul-oscuro), var(--azul-claro), var(--azul-oscuro));
    overflow-x: hidden;
}

.container { width: 90%; max-width: 1200px; margin: 0 auto; padding: 0 20px; }
a { text-decoration: none; transition: 0.3s; }
ul { list-style: none; }

/* =========================================
   2. HEADER Y NAVEGACIÓN
   ========================================= */
header {
    position: fixed; top: 0; left: 0; width: 100%; z-index: 1000;
    background: rgba(165, 164, 164, 0.29);
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.2);
}

nav { display: flex; align-items: center; padding: 10px 0; }
.logo-container { margin-right: 50px; }
.nav-links { display: flex; margin-right: auto; }
.nav-links li { margin-left: 40px; }
.nav-links a { color: var(--gray-100); font-weight: 500; font-size: 1.1rem; }
.nav-links a:hover { color: var(--accent); }

.btn-login {
    padding: 8px 25px; border: 2px solid white; color: white;
    border-radius: 30px; font-weight: 600; display: inline-flex;
    align-items: center; gap: 10px; font-size: 0.9rem;
}
.btn-login:hover { background: white; color: var(--azul-oscuro); }

/* =========================================
   3. LAYOUT DE DETALLES DEL CURSO
   ========================================= */
.details-wrapper {
    padding-top: 130px; padding-bottom: 80px; min-height: 100vh;
}

.course-grid {
    display: grid; grid-template-columns: 1fr 380px; gap: 40px; align-items: start;
}

/* Columna Izquierda */
.course-title-main {
    font-family: var(--font-bebas); font-size: 4rem; color: white;
    line-height: 1; margin-bottom: 20px; text-shadow: 0 4px 10px rgba(0,0,0,0.3);
}

.main-image-container {
    width: 100%; height: auto; min-height: 300px; max-height: 450px;
    border-radius: 20px; overflow: hidden;
    box-shadow: 0 20px 40px rgba(0,0,0,0.4);
    border: 1px solid rgba(255,255,255,0.1);
    background: rgba(0,0,0,0.2);
    display: flex; align-items: center; justify-content: center;
    margin-bottom: 40px;
}
.main-image-container img { width: 100%; height: 100%; object-fit: cover; }

.description-section {
    background: rgba(255,255,255,0.05); padding: 30px;
    border-radius: 15px; color: rgba(255,255,255,0.9);
    font-size: 1rem; line-height: 1.8;
}
.description-section h3 {
    font-family: var(--font-bebas); font-size: 2rem; margin-bottom: 15px;
    color: white; border-bottom: 2px solid var(--accent); display: inline-block;
}

/* Columna Derecha (Sidebar Sticky) */
.sidebar-sticky { position: sticky; top: 110px; z-index: 90; }

.buy-card {
    background: linear-gradient(145deg, rgba(33, 57, 119, 0.9) 0%, rgba(26, 32, 44, 0.95) 100%);
    border-radius: 20px; padding: 30px;
    border: 1px solid rgba(255,255,255,0.1);
    box-shadow: 0 15px 35px rgba(0,0,0,0.4);
    position: relative; overflow: hidden; color: white;
}

/* Elementos de la tarjeta de compra */
.ribbon {
    position: absolute; top: 25px; right: -35px;
    background: linear-gradient(45deg, #ff6b6b, #ff4757);
    color: white; padding: 5px 40px; font-size: 0.7rem; font-weight: 800;
    letter-spacing: 1px; text-transform: uppercase; transform: rotate(45deg);
    box-shadow: 0 5px 15px rgba(0,0,0,0.3); z-index: 10;
}

.price-display { text-align: center; margin-bottom: 25px; }
.price-label { font-size: 0.85rem; text-transform: uppercase; color: rgba(255,255,255,0.6); margin-bottom: 5px; }

.final-price {
    font-family: var(--font-bebas); font-size: 3.5rem; color: var(--accent);
    line-height: 1; text-shadow: 0 0 20px rgba(76, 201, 240, 0.3);
}
.final-price span { font-size: 1.5rem; color: white; margin-right: 5px; }
.old-price { text-decoration: line-through; color: rgba(255,255,255,0.4); font-size: 1rem; }

/* NUEVO: ESTILO PARA EL BADGE DE VIGENCIA */
.vigencia-badge {
    background: rgba(255, 71, 87, 0.15);
    border: 1px solid rgba(255, 71, 87, 0.4);
    color: #ff8a8a;
    padding: 10px;
    border-radius: 8px;
    font-size: 0.9rem;
    margin: 15px 0 0 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-weight: 500;
    animation: pulseRed 3s infinite;
}

.vigencia-badge i { font-size: 1.1rem; }

@keyframes pulseRed {
    0% { box-shadow: 0 0 0 0 rgba(255, 71, 87, 0.4); }
    70% { box-shadow: 0 0 0 6px rgba(255, 71, 87, 0); }
    100% { box-shadow: 0 0 0 0 rgba(255, 71, 87, 0); }
}

.details-list { margin: 20px 0; padding: 0; }
.details-list li {
    padding: 10px 0; border-bottom: 1px solid rgba(255,255,255,0.1);
    font-size: 0.9rem; color: rgba(255,255,255,0.9); display: flex; align-items: center;
}
.details-list li:last-child { border-bottom: none; }
.details-list i { color: var(--accent); width: 25px; font-size: 1rem; }

.schedule-mini-box {
    background: rgba(0,0,0,0.3); padding: 15px; border-radius: 10px; margin: 15px 0;
    text-align: center; border: 1px solid rgba(255,255,255,0.1);
}
.schedule-mini-box span { display: block; font-size: 0.85rem; color: white; }

.btn-buy-large {
    display: block; width: 100%; padding: 15px;
    background: linear-gradient(90deg, var(--accent), #3a86ff);
    color: white; text-align: center; font-weight: 700;
    text-transform: uppercase; border: none; border-radius: 12px;
    transition: all 0.3s ease; box-shadow: 0 5px 20px rgba(76, 201, 240, 0.4);
    cursor: pointer; font-size: 1rem;
}
.btn-buy-large:hover { transform: translateY(-3px); box-shadow: 0 10px 30px rgba(76, 201, 240, 0.6); }

/* =========================================
   4. MODAL CORREGIDO Y ESTILIZADO
   ========================================= */
.modal-overlay {
    display: none; /* JS controla esto */
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.85); z-index: 99999;
    justify-content: center; align-items: center;
    backdrop-filter: blur(8px);
}

.modal-content {
    background: linear-gradient(145deg, #1a202c, #2d3748);
    padding: 40px; border-radius: 20px;
    width: 90%; max-width: 480px; position: relative;
    border: 1px solid rgba(255,255,255,0.1);
    box-shadow: 0 25px 50px rgba(0,0,0,0.6);
    animation: slideUp 0.3s ease forwards;
    max-height: 95vh; overflow-y: auto;
}

@keyframes slideUp {
    from { transform: translateY(50px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.close-modal {
    position: absolute; top: 15px; right: 20px;
    font-size: 2rem; color: rgba(255,255,255,0.4);
    cursor: pointer; transition: 0.3s;
}
.close-modal:hover { color: #ff4757; }

.modal-header { text-align: center; margin-bottom: 25px; }
.modal-header h2 {
    font-family: 'Bebas Neue', sans-serif; color: white;
    font-size: 2.2rem; margin-bottom: 5px; letter-spacing: 1px;
}
.modal-header p { color: rgba(255,255,255,0.7); font-size: 0.9rem; }
.modal-header p strong { color: var(--accent); }

/* Inputs del Modal */
.form-group { margin-bottom: 20px; text-align: left; }
.form-group label {
    display: block; color: var(--accent); margin-bottom: 8px;
    font-weight: 600; font-size: 0.9rem;
}


.input-icon-wrapper { position: relative; }
.input-icon-wrapper i {
    position: absolute; left: 15px; top: 50%;
    transform: translateY(-50%); color: rgba(255,255,255,0.5);
}

.form-group select {
    width: 100%; padding: 12px 15px 12px 45px;
    background: rgba(0,0,0,0.2);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 10px; color: white; font-size: 1rem;
    outline: none; transition: all 0.3s;
}


.form-group input {
    width: 100%; padding: 12px 15px 12px 45px;
    background: rgba(0,0,0,0.2);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 10px; color: white; font-size: 1rem;
    outline: none; transition: all 0.3s;
}

.form-group input:focus {
    border-color: var(--accent); background: rgba(0,0,0,0.4);
    box-shadow: 0 0 10px rgba(76, 201, 240, 0.2);
}

/* Caja de envío en el modal */
.shipping-box {
    border-top: 1px solid rgba(255,255,255,0.1);
    margin-top: 20px; padding-top: 20px;
}
.shipping-header {
    color: var(--accent); margin-bottom: 15px;
    font-size: 1.1rem; text-transform: uppercase; letter-spacing: 1px;
}

.btn-modal-submit {
    width: 100%; padding: 15px;
    background: linear-gradient(90deg, var(--accent), #3a86ff);
    color: white; border: none; border-radius: 12px;
    font-weight: 700; font-size: 1.1rem; cursor: pointer;
    text-transform: uppercase; letter-spacing: 1px;
    transition: transform 0.2s, box-shadow 0.2s; margin-top: 10px;
}
.btn-modal-submit:hover { transform: translateY(-2px); box-shadow: 0 10px 20px rgba(76, 201, 240, 0.3); }

/* =========================================
   5. FOOTER
   ========================================= */
footer {
    background: rgba(165, 164, 164, 0.08); color: white; padding: 60px 0 30px;
}
.footer-content {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 40px; margin-bottom: 40px;
}
.footer-column h3 {
    font-family: var(--font-bebas); font-size: 1.5rem; margin-bottom: 20px; color: white;
}
.footer-links a { color: var(--gray-300); }
.footer-links a:hover { color: var(--accent); padding-left: 5px; }
.social-icons { display: flex; gap: 15px; margin-top: 20px; }
.social-icons a {
    color: var(--gray-300); font-size: 1.5rem; width: 40px; height: 40px;
    border-radius: 50%; display: flex; align-items: center; justify-content: center;
    background: rgba(255, 255, 255, 0.1);
}
.social-icons a:hover { color: var(--accent); background: rgba(255, 255, 255, 0.2); }
.footer-bottom {
    text-align: center; padding-top: 30px;
    border-top: 1px solid rgba(165, 164, 164, 0.1); color: var(--gray-300);
}

/* Responsive */
@media (max-width: 900px) {
    .course-grid { grid-template-columns: 1fr; }
    .sidebar-sticky { position: relative; top: 0; margin-top: 40px; }
    .course-title-main { font-size: 3rem; }
    nav { flex-direction: column; gap: 15px; }
    .nav-links { margin-right: 0; }
}