/* === Variables CSS === */
:root {
    --primary-color: #2c3e50;
    --secondary-color: #007bff;
    --accent-color: #fd7e14;
    --light-bg-color: #f0f0f0;
    --text-color: #212529;
    --light-text-color: #ffffff;
    --body-bg-color: #ffffff;
    --bg-section-nosotros: #f0f0f0;
    --bg-section-videos: #fff5e8;
    --heading-font: 'Poppins', sans-serif;
    --body-font: 'Open Sans', sans-serif;
    --border-radius: 8px;
    --box-shadow: 0 5px 15px rgba(0, 0, 0, 0.07);
}

/* Reset básico */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--body-font);
    line-height: 1.7;
    color: var(--text-color);
    background-color: var(--body-bg-color);
}

.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
}

/* Tipografía general */
h1, h2, h3, h4 {
    font-family: var(--heading-font);
    color: var(--primary-color);
    margin-bottom: 0.75em;
    font-weight: 700;
}

h1 {
    font-size: clamp(2.5rem, 5vw, 3.8rem);
    color: var(--light-text-color);
    line-height: 1.2;
}

h2 {
    font-size: clamp(1.8rem, 4vw, 2.5rem);
    text-align: center;
    margin-bottom: 1em;
    font-weight: 700;
}

h3 {
    font-size: clamp(1.2rem, 2.5vw, 1.5rem);
    font-weight: 600;
}

p {
    margin-bottom: 1.2em;
    font-size: clamp(0.95rem, 1.5vw, 1.05rem);
    font-weight: 400;
}

a {
    text-decoration: none;
    color: var(--secondary-color);
    transition: color 0.3s ease;
}

a:hover {
    color: var(--accent-color);
}

.subtitle {
    text-align: center;
    font-size: clamp(1rem, 2vw, 1.15rem);
    color: #555;
    margin-bottom: 2.5em;
    max-width: 750px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.5;
}

.section-padding {
    padding: clamp(40px, 8vw, 80px) 0;
}

.alt-bg {
    background-color: var(--light-bg-color);
}

/* === Cabecera === */
header {
    background-color: var(--light-bg-color);
    color: var(--text-color);
    padding: 1em 0;
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: background-color 0.4s ease;
}

header.scrolled {
    background-color: rgba(240, 240, 240, 0.992);
}

header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-right-content {
    display: flex;
    align-items: center;
}

.nav-right-content ul {
    display: flex;
    gap: 25px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav-right-content ul li a {
    font-family: var(--heading-font);
    font-weight: 500;
    font-size: clamp(0.9rem, 1.5vw, 1rem);
    padding: 8px 12px;
    border-radius: 4px;
    transition: background-color 0.3s ease, color 0.3s ease;
    color: var(--text-color);
}

header nav ul li a:hover,
header nav ul li a.active {
    background-color: var(--accent-color);
    color: var(--light-text-color);
}

.menu-toggle {
    display: none;
    cursor: pointer;
    padding: 10px;
}

.menu-toggle span {
    display: block;
    width: 25px;
    height: 3px;
    background-color: var(--text-color);
    margin: 5px 0;
    transition: all 0.3s ease;
}

/* Logo - Tamaño ajustado para móviles */
.logo-img {
    max-height: 60px; /* Altura máxima para evitar desbordamiento */
    height: auto;
    width: auto;
    object-fit: contain;
}

/* === Hero Section === */
#hero {
    background-color: var(--primary-color);
    color: var(--light-text-color);
    min-height: 100vh;
    position: relative;
    margin-top: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

#hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.3), rgba(0, 0, 0, 0.6));
    z-index: 0;
}

/* === Carrusel Horizontal Responsivo === */
.carousel-container {
    position: relative;
    width: 100%;
    overflow: hidden;
    height: 100vh;
}

.carousel-wrapper {
    display: flex;
    transition: transform 0.8s ease-in-out;
    will-change: transform;
}

.carousel-slide {
    width: 100vw;
    height: 100vh;
    min-width: 100vw;
    background-size: cover;
    background-position: center;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    text-align: center;
    flex-shrink: 0;
}

.carousel-slide img.slide-img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 0;
}

.carousel-slide .slide-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.3), rgba(0, 0, 0, 0.6));
    z-index: 1;
}

.carousel-slide .slide-text {
    position: relative;
    z-index: 2;
    max-width: 90%;
    padding: 0 20px;
    text-align: center;
}

/* Texto estilo tiza - AHORA MÁS GRANDE */
.chalk-text,
.chalk-subtext {
    font-family: 'Permanent Marker', cursive;
    color: #fff;
    text-shadow:
        -1px -1px 0 #000,
        1px -1px 0 #000,
        -1px 1px 0 #000,
        1px 1px 0 #000,
        0 0 4px #000;
    margin-bottom: 0.5em;
    line-height: 1.2;
}

/* Texto del carrusel más grande en todos los dispositivos */
.chalk-text {
    font-size: clamp(3.5rem, 8vw, 6rem); /* Mucho más grande */
}

.chalk-subtext {
    font-size: clamp(2rem, 5vw, 3.5rem); /* Más grande y proporcional */
    color: #ffdd57;
    font-weight: normal;
    margin-bottom: 0;
}

/* Bullets de navegación */
.carousel-bullets {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
    z-index: 3;
    touch-action: pan-x;
}

.bullet {
    width: 12px;
    height: 12px;
    background-color: #fff;
    border-radius: 50%;
    opacity: 0.5;
    cursor: pointer;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.bullet:hover,
.bullet.active {
    opacity: 1;
    background-color: #ff6f61;
    transform: scale(1.3);
}

/* === CTA Button === */
.cta-button {
    display: inline-block;
    background-color: #ff6f61;
    color: var(--light-text-color);
    padding: 15px 35px;
    font-size: clamp(1rem, 2vw, 1.15rem);
    border-radius: var(--border-radius);
    text-align: center;
    font-family: var(--heading-font);
    font-weight: 600;
    box-shadow: 0 6px 15px rgba(255, 0, 0, 0.25);
    transition: background-color 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
    text-decoration: none;
}

.cta-button:hover {
    background-color: #e60000;
    transform: translateY(-5px) scale(1.05);
    box-shadow: 0 8px 20px rgba(255, 0, 0, 0.35);
}

/* === YouTube CTA Section === */
#youtube-cta {
    background-color: var(--light-bg-color);
    text-align: center;
    padding: 40px 0;
}

.youtube-cta-content {
    max-width: 900px;
    margin: 0 auto 3em;
    text-align: center;
}

.youtube-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: clamp(20px, 3vw, 40px);
    margin-bottom: 3em;
}

.youtube-video-preview {
    background-color: var(--light-text-color);
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
    text-align: left;
    border-top: 4px solid #FF0000;
}

.youtube-video-preview:hover {
    transform: translateY(-8px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

.youtube-video-preview a {
    display: block;
    color: var(--text-color);
    position: relative;
}

.youtube-video-preview img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    display: block;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.youtube-video-preview:hover img {
    opacity: 0.8;
    transform: scale(1.03);
}

.youtube-video-preview h4 {
    padding: 15px 20px 0;
    font-size: clamp(1.1rem, 2vw, 1.3rem); /* Escalado responsivo */
    color: var(--primary-color);
    margin: 0;
    line-height: 1.3;
    font-weight: 600;
}

.youtube-video-preview p {
    padding: 0 20px 15px;
    font-size: clamp(0.9rem, 1.4vw, 1rem); /* Escalado responsivo */
    color: #495057;
    line-height: 1.5;
    margin-bottom: 0;
}

/* Icono de Play sobre la imagen */
.play-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: clamp(2.5rem, 4vw, 3.5rem); /* Escalado responsivo */
    color: white;
    background-color: rgba(0, 0, 0, 0.7);
    border-radius: 50%;
    width: clamp(50px, 7vw, 70px);
    height: clamp(50px, 7vw, 70px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
    transition: transform 0.3s ease, opacity 0.3s ease;
    opacity: 0;
    pointer-events: none;
}

.youtube-video-preview:hover .play-icon {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.1);
}

/* Botón de CTA de YouTube */
.youtube-cta-button {
    background-color: #FF0000;
    color: var(--light-text-color);
    padding: 15px 35px;
    font-size: clamp(1rem, 2vw, 1.15rem);
    border-radius: var(--border-radius);
    box-shadow: 0 6px 15px rgba(255, 0, 0, 0.25);
    display: inline-flex;
    align-items: center;
    gap: 12px;
    transition: background-color 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
}

.youtube-cta-button:hover {
    background-color: #e60000;
    transform: translateY(-5px) scale(1.05);
    box-shadow: 0 8px 20px rgba(255, 0, 0, 0.35);
}

.youtube-cta-icon {
    width: clamp(28px, 4vw, 35px);
    height: auto;
}

/* === Sección Cursos - Corrección de tamaño === */
.courses-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: clamp(20px, 3vw, 30px);
    margin-bottom: 2em;
}

.course-card {
    background-color: var(--light-text-color);
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    text-align: left;
}

.course-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

.course-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.course-card h3 {
    padding: 15px 20px 10px;
    margin: 0;
    font-size: clamp(1.1rem, 2vw, 1.3rem); /* Escalado responsivo */
}

.course-card p {
    padding: 0 20px 15px;
    font-size: clamp(0.9rem, 1.4vw, 1.05rem); /* Escalado responsivo */
    color: #495057;
    line-height: 1.5;
    margin-bottom: 0;
}

.btn-secondary {
    display: inline-block;
    background-color: var(--accent-color);
    color: var(--light-text-color);
    padding: 12px 24px;
    margin: 0 20px 20px;
    border-radius: var(--border-radius);
    font-family: var(--heading-font);
    font-weight: 600;
    text-decoration: none;
    transition: background-color 0.3s ease;
}

.btn-secondary:hover {
    background-color: #e65100;
}

/* === Contacto - Telegram no gigante === */
.telegram-contact-group {
    margin-top: 1em;
    text-align: center;
}

.contact-link {
    margin-right: 0.5em;
    vertical-align: middle;
}

.contact-icon {
    width: 18px;
    height: 18px;
    vertical-align: middle;
}

.qr-code-img {
    max-width: 100px;
    height: auto;
    margin-top: 0.5em;
    border: 2px solid #ddd;
    border-radius: 8px;
}

/* === Footer === */
footer {
    background-color: var(--primary-color);
    color: rgba(255, 255, 255, 0.9);
    text-align: center;
    padding: 30px 0;
    margin-top: 40px;
}

footer .footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

footer p {
    margin-bottom: 0;
    font-size: 0.9rem;
    font-weight: 400;
}

/* === Responsive Design === */
@media (max-width: 768px) {
    .menu-toggle {
        display: block;
    }

    .nav-right-content ul {
        display: none;
        flex-direction: column;
        width: 100%;
        position: absolute;
        top: 80px;
        left: 0;
        background-color: var(--light-bg-color);
        padding: 20px 0;
        box-shadow: 0 5px 10px rgba(0, 0, 0, 0.1);
    }

    .nav-right-content ul.active {
        display: flex;
    }

    header nav ul li {
        margin: 0;
        text-align: center;
        padding: 10px 0;
    }

    .logo-img {
        max-height: 50px; /* Aún más pequeño en móviles pequeños */
    }

    .chalk-text {
        font-size: clamp(3rem, 8vw, 5rem); /* Grande pero no desbordado */
    }

    .chalk-subtext {
        font-size: clamp(1.8rem, 5vw, 3rem);
    }

    .carousel-bullets {
        bottom: 20px;
    }

    .youtube-grid,
    .courses-grid {
        grid-template-columns: 1fr;
    }

    .play-icon {
        font-size: clamp(2rem, 6vw, 3rem);
        width: clamp(45px, 7vw, 60px);
        height: clamp(45px, 7vw, 60px);
    }

    .youtube-cta-button {
        padding: 12px 25px;
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .logo-img {
        max-height: 45px; /* Pequeño en pantallas muy pequeñas */
    }

    .chalk-text {
        font-size: clamp(2.5rem, 8vw, 4rem); /* Evita desbordar */
    }

    .chalk-subtext {
        font-size: clamp(1.5rem, 4.5vw, 2.5rem);
    }

    .play-icon {
        font-size: clamp(1.8rem, 6vw, 2.5rem);
        width: clamp(40px, 7vw, 50px);
        height: clamp(40px, 7vw, 50px);
    }

    .youtube-cta-button {
        padding: 10px 20px;
        font-size: 0.95rem;
    }

    .qr-code-img {
        max-width: 80px;
    }
}

/* === Ocultar scrollbars en bullets (opcional) === */
.carousel-bullets::-webkit-scrollbar {
    display: none;
}

.carousel-bullets {
    -ms-overflow-style: none;
    scrollbar-width: none;
}