/* =========================================
   1. RESET Y CONFIGURACIÓN GLOBAL
   ========================================= */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Poppins', sans-serif;
}

body { 
    background-color: #f8f1e9; 
    overflow-x: hidden; 
}

/* =========================================
   2. BARRA DE NAVEGACIÓN (NAVBAR)
   ========================================= */
.navbar {
    display: flex; 
    justify-content: space-between; 
    align-items: center;
    padding: 10px 10%; 
    background: #ffffff; 
    position: sticky; 
    top: 0; 
    z-index: 1000;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
}

.logo-container {
    display: flex;
    align-items: center;
    text-decoration: none;
}

.nav-logo {
    height: 70px; 
    width: auto;
    display: block;
    transition: transform 0.3s ease;
}

.nav-logo:hover { transform: scale(1.05); }

.nav-links { 
    list-style: none; 
    display: flex; 
    gap: 25px; 
    align-items: center;
}

.nav-links a { 
    text-decoration: none; 
    color: #555; 
    font-weight: 500; 
    transition: 0.3s; 
}

.nav-links a:hover { color: #d4a373; }

.btn-login { 
    background: #d4a373; 
    color: white !important; 
    padding: 8px 22px; 
    border-radius: 25px; 
    text-decoration: none; 
    font-size: 0.9rem;
    transition: 0.3s;
}

.btn-login:hover { background: #bfa36c; }

/* =========================================
   3. SECCIÓN HERO (VIDEO Y CARRUSEL)
   ========================================= */
.hero-section {
    padding: 50px 20px;
    display: flex;
    justify-content: center;
    height: 85vh;
}

.hero-wrapper {
    max-width: 1200px;
    width: 100%;
    display: flex;
    gap: 30px;
    height: 100%;
}

/* --- VIDEO --- */
.hero-video-box {
    flex: 0 0 38%;
    position: relative;
    border-radius: 30px;
    overflow: hidden;
    background: #000; 
    box-shadow: 0 15px 40px rgba(0,0,0,0.1);
}

.hero-video-box video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    position: relative;
    z-index: 1; 
}

.sound-control {
    position: absolute;
    bottom: 20px; 
    right: 20px;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    border: none;
    padding: 10px 18px;
    border-radius: 30px;
    cursor: pointer;
    z-index: 20;
    font-size: 0.8rem;
    font-weight: 600;
    transition: 0.3s;
}

/* --- CARRUSEL --- */
.hero-carousel-area {
    flex: 1;
    position: relative;
    border-radius: 30px;
    overflow: hidden;
    height: 100%;
    box-shadow: 0 15px 40px rgba(0,0,0,0.1);
}

.carousel-overlay {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: 10;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    padding-top: 80px; 
    text-align: center;
    background: linear-gradient(to bottom, rgba(0,0,0,0.65) 0%, transparent 60%);
    color: white;
    pointer-events: none;
}

.carousel-overlay h1 { 
    font-family: 'Playfair Display', serif; 
    font-size: clamp(1.8rem, 5vw, 3.8rem); 
    line-height: 1.1; 
    text-shadow: 2px 2px 20px rgba(0,0,0,0.7); 
}

.carousel-overlay span { color: #ffccd5; font-style: italic; }

.carousel-track {
    display: flex;
    height: 100%;
    width: calc(500px * 10);
    animation: scrollInfinite 35s linear infinite;
}

.carousel-track img {
    height: 100%;
    width: 500px;
    object-fit: cover;
}

@keyframes scrollInfinite {
    0% { transform: translateX(0); }
    100% { transform: translateX(calc(-500px * 5)); }
}

/* =========================================
   4. FOOTER
   ========================================= */
footer { 
    padding: 30px; 
    text-align: center; 
    color: #888; 
    font-size: 0.8rem; 
}

/* =========================================
   5. RESPONSIVE: TABLETS (iPad, etc)
   ========================================= */
@media (max-width: 1024px) {
    .hero-section {
        height: auto;
        padding: 40px 20px;
    }
    .hero-wrapper { 
        flex-direction: column; 
    }
    .hero-video-box, .hero-carousel-area { 
        width: 100%; 
        height: 450px; 
    }
    .navbar {
        padding: 10px 5%;
    }
}

/* =========================================
   6. RESPONSIVE: CELULARES
   ========================================= */
@media (max-width: 768px) {
    /* Ajuste del Menú */
    .navbar {
        flex-direction: column; 
        gap: 15px;
        padding: 15px 5%;
    }
    .nav-links {
        flex-wrap: wrap; 
        justify-content: center;
        gap: 10px;
    }
    .nav-logo { height: 50px; } 

    /* Ajuste de las Cajas: LA GUILLOTINA */
    .hero-section { padding: 20px 15px; }
    
    .hero-video-box, .hero-carousel-area { 
        height: 600px !important; /* Altura fija para que mande sobre la foto */
        border-radius: 20px; 
        overflow: hidden !important; /* Esconde todo lo que sobrepase los 400px */
    }
    
    .carousel-overlay { padding-top: 40px; }
    .carousel-overlay h1 { font-size: 2rem; }

    /* Ajuste del Carrusel y las Imágenes */
    .carousel-track {
        width: calc(100vw * 10); 
        animation: scrollInfiniteMobile 30s linear infinite;
    }
    
    .carousel-track img {
        width: 100vw; 
        height: 600px !important; /* Igual que la caja, obliga a la foto a medirse */
        object-fit: cover;        /* Recorta la imagen larga para que quepa perfecto */
        object-position: center;  /* Centra el recorte */
        display: block;
    }
}

/* Animación exclusiva para Celulares */
@keyframes scrollInfiniteMobile {
    0% { transform: translateX(0); }
    100% { transform: translateX(calc(-100vw * 5)); } 
}

/* =========================================
   7. SECCIÓN DE CURSOS
   ========================================= */
.courses-section {
    padding: 50px 10%;
    background-color: #f8f1e9; 
    text-align: center;
}

.section-title {
    font-family: 'Playfair Display', serif;
    font-size: 3rem;
    margin-bottom: 50px;
    color: #333;
}

.courses-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr); 
    gap: 20px;
}

.course-card {
    position: relative;
    height: 400px;
    border-radius: 25px;
    overflow: hidden;
    box-shadow: 0 10px 20px rgba(0,0,0,0.05);
    transition: transform 0.4s ease;
    cursor: pointer;
}

.course-card:hover {
    transform: translateY(-10px); 
}

.course-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.course-card:hover img {
    transform: scale(1.1); 
}

.course-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 40%; 
    background: linear-gradient(to top, rgba(0,0,0,0.8) 0%, transparent 100%);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding-bottom: 25px;
    color: white;
}

.course-overlay h3 {
    font-family: 'Poppins', sans-serif;
    font-size: 1.2rem;
    font-weight: 500;
    text-shadow: 2px 2px 10px rgba(0,0,0,0.5);
}

/* =========================================
   RESPONSIVE PARA CURSOS (TABLETS Y MÓVIL)
   ========================================= */

@media (max-width: 1100px) {
    .courses-grid {
        grid-template-columns: repeat(3, 1fr); 
    }
}

@media (max-width: 768px) {
    .courses-section {
        padding: 50px 5%;
    }
    .section-title {
        font-size: 2.2rem;
    }
    .courses-grid {
        grid-template-columns: repeat(1, 1fr); 
        gap: 30px;
    }
    .course-card {
        height: 300px; 
    }
}

/* =========================================
   8. BANNER PORTAFOLIO (ANCHO TOTAL)
   ========================================= */
.portfolio-cta {
    grid-column: 1 / -1; 
    width: 100vw;
    position: relative;
    left: 50%;
    right: 50%;
    margin-left: -50vw;
    margin-right: -50vw;
    height: 500px;
    background-image: url('./imagenes/portada.jpg');
    background-attachment: fixed; 
    background-position: center;
    background-size: cover;
    margin-top: 40px;
}

.cta-overlay {
    width: 100%; 
    height: 100%;
    background: rgba(0, 0, 0, 0.4); 
    display: flex;
    align-items: center;
    justify-content: center;
}

.cta-content {
    text-align: center;
    color: white;
    max-width: 700px;
    padding: 0 20px;
}

.cta-content span {
    text-transform: uppercase;
    letter-spacing: 4px;
    font-size: 0.8rem;
    color: #ffccd5;
    margin-bottom: 10px;
    display: block;
}

.cta-content h2 {
    font-family: 'Playfair Display', serif;
    font-size: clamp(2.5rem, 5vw, 3.5rem);
    margin-bottom: 20px;
}

.btn-cta {
    display: inline-block;
    padding: 15px 40px;
    background-color: #d4a373;
    color: white;
    text-decoration: none;
    border-radius: 50px;
    font-weight: 600;
    transition: 0.4s;
    box-shadow: 0 10px 20px rgba(0,0,0,0.2);
}

.btn-cta:hover {
    background-color: white;
    color: #d4a373;
    transform: scale(1.05);
}

/* =========================================
   9. RESPONSIVE (CELULARES Y TABLETS)
   ========================================= */
@media (max-width: 1024px) {
    .courses-grid { grid-template-columns: repeat(3, 1fr); } 
}

@media (max-width: 768px) {
    .courses-grid { grid-template-columns: repeat(1, 1fr); } 
    .course-card { height: 300px; }
    
    .portfolio-cta { 
        height: 400px; 
        background-attachment: scroll; 
        width: 100vw;
        margin-left: -50vw;
    }
    
    .section-title { font-size: 2.2rem; }
}

/* =========================================
   10. BOTONES FLOTANTES (REDES SOCIALES)
   ========================================= */
.floating-social {
    position: fixed;
    right: 20px;
    top: 50%;
    transform: translateY(-50%); 
    display: flex;
    flex-direction: column;
    gap: 15px; 
    z-index: 2000; 
}

.social-btn {
    width: 55px;
    height: 55px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    text-decoration: none;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    transition: all 0.3s ease;
}

.social-btn:hover {
    transform: scale(1.1) translateX(-5px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.3);
}

.whatsapp { background-color: #25D366; }

.instagram { 
    background: radial-gradient(circle at 30% 107%, #fdf497 0%, #fdf497 5%, #fd5949 45%, #d6249f 60%, #285AEB 90%); 
}

.tiktok { background-color: #000000; }

@media (max-width: 768px) {
    .floating-social {
        right: 10px; 
        gap: 10px;
    }
    
    .social-btn {
        width: 45px;
        height: 45px;
    }
    
    .social-btn svg {
        width: 20px;
        height: 20px;
    }
}