/* Fichero: /assets/css/style.css (VERSIÓN FINAL CON CABECERA MÓVIL CORREGIDA) */

/* --- Variables y Estilos Globales --- */
:root {
    --color-primario: #0d47a1;      /* Azul oscuro */
    --color-secundario: #1976d2;    /* Azul medio */
    --color-acento: #ff9800;        /* Naranja */
    --color-texto: #333;
    --color-blanco: #ffffff;
    --color-exito: #2e7d32;
    --color-error: #c62828;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    margin: 0;
    color: var(--color-texto);
    line-height: 1.6;
    background-color: #f4f7f9; /* Color de fondo base */
}

body.public-body {
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
}

main {
    padding: 2rem 1rem;
    max-width: 1100px;
    margin: 0 auto;
}

h1, h2, h3, h4 {
    color: var(--color-primario);
    line-height: 1.3;
    margin-bottom: 1rem;
}

p {
    margin-bottom: 1rem;
}

a {
    color: var(--color-secundario);
    text-decoration: none;
}
a:hover {
    text-decoration: underline;
}

.button, button {
    display: inline-block;
    background-color: var(--color-acento);
    color: var(--color-blanco) !important;
    padding: 12px 25px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: bold;
    text-decoration: none;
    text-align: center;
    transition: background-color 0.3s;
}
.button:hover, button:hover {
    background-color: #f57c00;
    text-decoration: none;
    color: white;
}
.button-secondary {
    background-color: #757575;
}
.button-secondary:hover {
    background-color: #616161;
}
button:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}

/* --- Header y Navegación --- */
header {
    background-color: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}
nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    height: 85px;
    padding: 0 1rem;
    transition: height 0.3s ease, padding 0.3s ease;
}
.logo img {
    height: 85px;
    width: auto;
    transition: height 0.3s ease;
}
.nav-links {
    list-style: none;
    display: flex;
    margin: 0;
    padding: 0;
}
.nav-links li a {
    padding: 1rem;
    display: block;
    font-weight: bold;
    color: var(--color-primario);
}
.nav-links li a:hover {
    background-color: rgba(230, 230, 230, 0.5);
    text-decoration: none;
}
.nav-extra {
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: gap 0.3s ease;
}
.cart-icon {
    font-size: 1.5rem;
    position: relative;
}
#cart-count {
    position: absolute;
    top: -5px;
    right: -10px;
    background-color: var(--color-acento);
    color: white;
    border-radius: 50%;
    padding: 2px 6px;
    font-size: 0.75rem;
    font-weight: bold;
}
.burger {
    display: none;
    cursor: pointer;
}
.burger div {
    width: 25px;
    height: 3px;
    background-color: var(--color-primario);
    margin: 5px;
    transition: all 0.3s ease;
}

/* --- Secciones de Contenido semitransparentes --- */
.section { 
    background-color: rgba(255, 255, 255, 0.75);
    -webkit-backdrop-filter: blur(5px);
    backdrop-filter: blur(5px);
    padding: 2rem;
    border-radius: 8px;
    margin-bottom: 2rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

/* --- Formularios y Mensajes --- */
.form-group { margin-bottom: 1.5rem; }
.form-group label { display: block; margin-bottom: 0.5rem; font-weight: bold; }
.form-group input, .form-group select, .form-group textarea { width: 100%; padding: 10px; border: 1px solid #ccc; border-radius: 5px; box-sizing: border-box; }
.honeypot { display: none; }
.feedback-success { padding: 1rem; background-color: #e8f5e9; color: var(--color-exito); border-left: 5px solid var(--color-exito); }
.feedback-error { padding: 1rem; background-color: #ffebee; color: var(--color-error); border-left: 5px solid var(--color-error); }
.feedback-info { background-color: #e3f2fd; padding: 1rem; border-radius: 5px; margin-top: 1.5rem; }
select option:disabled { color: #aaaaaa; background-color: #f4f4f4; }
#calendario-selector { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 1rem; align-items: end; }

/* --- Contacto --- */
.contact-grid { display: grid; grid-template-columns: 1fr 1.5fr; gap: 2rem; align-items: start; }

/* --- Pie de Página (Footer) --- */
footer { color: var(--color-texto); padding: 2.5rem 1rem; margin-top: 3rem; border-top: 1px solid rgba(0, 0, 0, 0.1); background-color: rgba(255, 255, 255, 0.85); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.footer-container, .footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 2rem;
    max-width: 1100px;
    margin: 0 auto;
}
.footer-logo { height: 60px; margin-bottom: 1rem; }
.footer-col h4 { color: var(--color-primario); }
.footer-col ul { list-style: none; padding: 0; }
.footer-col ul li { margin-bottom: 0.5rem; }
.footer-col a { color: var(--color-secundario); font-weight: 500; }
.footer-col a:hover { color: var(--color-primario); }
.footer-brand-name { font-size: 1.1rem; font-weight: bold; color: var(--color-primario); margin-top: 0.5rem; }
.footer-bottom { text-align: center; margin-top: 2.5rem; padding-top: 1.5rem; border-top: 1px solid #e0e0e0; font-size: 0.9em; color: #757575; max-width: 1100px; margin: 2.5rem auto 0 auto;}

/* --- Botón Flotante de WhatsApp --- */
.whatsapp-flotante { position: fixed; width: 60px; height: 60px; bottom: 30px; right: 30px; background-color: #25D366; color: #FFF; border-radius: 50px; text-align: center; font-size: 30px; box-shadow: 2px 2px 6px rgba(0, 0, 0, 0.25); z-index: 1000; display: flex; justify-content: center; align-items: center; transition: transform 0.3s ease; }
.whatsapp-flotante:hover { transform: scale(1.1); text-decoration: none; }

/* --- Pop-up del Carrito --- */
#popup-carrito { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.6); z-index: 2000; display: none; justify-content: center; align-items: center; opacity: 0; visibility: hidden; transition: opacity 0.3s ease, visibility 0.3s ease; }
#popup-carrito.is-visible { display: flex; opacity: 1; visibility: visible; }
.popup-contenido { background: white; padding: 2rem; border-radius: 8px; text-align: center; max-width: 450px; width: 90%; box-shadow: 0 5px 15px rgba(0,0,0,0.3); }
.popup-botones { margin-top: 1.5rem; display: flex; flex-wrap: wrap; justify-content: center; gap: 0.75rem; }

/* --- Selector de Idioma --- */
.language-switcher { display: flex; align-items: center; gap: 0.5rem; margin-right: 1rem; }
.language-switcher a { display: inline-block; padding: 4px; border-radius: 50%; transition: background-color 0.3s, box-shadow 0.3s; line-height: 0; border: 2px solid transparent; }
.language-switcher a:hover { background-color: rgba(230, 230, 230, 0.5); }
.language-switcher a.active { border-color: var(--color-acento); }

/* --- Página de Precios --- */
.course-section h3 { margin-top: 2rem; border-bottom: 2px solid var(--color-secundario); padding-bottom: 0.5rem; margin-bottom: 1.5rem; }
.price-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1.5rem; }
.price-card { border: 1px solid #ddd; border-radius: 8px; padding: 1.5rem; display: flex; flex-direction: column; }
.price-card h4 { margin-top: 0; color: var(--color-primario); flex-grow: 1; }
.price-card .pack-title { font-size: 1.1em; }
.price-tag { font-size: 2.5em; font-weight: bold; color: var(--color-secundario); margin: 0.5rem 0; }
.practice-desc { font-size: 0.9em; color: #555; flex-grow: 1; margin-bottom: 1.5rem; }
.requisito { font-style: italic; color: var(--color-error); font-weight: bold; }
.info-card { border-left: 5px solid var(--color-secundario); }
.info-card h2 { margin-top: 0; }
.info-card h4 { color: var(--color-primario); margin-top: 1.5rem; }
.info-card ul { padding-left: 20px; }
.pricing-table { width: 100%; margin-top: 1.5rem; border-collapse: collapse; box-shadow: 0 2px 8px rgba(0,0,0,0.05); }
.pricing-table th, .pricing-table td { padding: 1rem; border: 1px solid #e0e0e0; text-align: left; vertical-align: middle; }
.pricing-table thead th { background-color: #f2f2f2; }
.pricing-table .price-cell { font-weight: bold; font-size: 1.2em; color: var(--color-secundario); width: 150px; text-align: center; white-space: nowrap; }
.pricing-table .action-cell { width: 180px; text-align: center; }
.pricing-table .action-cell .button { white-space: nowrap; }

/* --- Nota en la Página de Calendario --- */
.calendar-note { text-align: center; margin-top: 2rem; padding: 1rem; background-color: #fff1f0; border: 1px solid var(--color-error); border-radius: 8px; color: var(--color-error); font-size: 0.95em; }
.calendar-note a { color: var(--color-error); font-weight: bold; text-decoration: underline; }

/* --- Blog y Post View (Unificado) --- */
.blog-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 2rem; align-content: start; }
@media (min-width: 768px) { .blog-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .blog-grid { grid-template-columns: repeat(3, 1fr); } }
.blog-post-card { display: flex; flex-direction: column; background-color: var(--color-blanco); border-radius: 8px; box-shadow: 0 4px 8px rgba(0,0,0,0.05); text-decoration: none; transition: transform 0.3s ease, box-shadow 0.3s ease; border: 1px solid #e0e0e0; overflow: hidden; }
.blog-post-card:hover { transform: translateY(-5px); box-shadow: 0 8px 16px rgba(0,0,0,0.1); }
.blog-card-image { width: 100%; height: 180px; object-fit: cover; }
.blog-card-content { padding: 1.2rem; display: flex; flex-direction: column; flex-grow: 1; }
.blog-post-card h3 { margin-top: 0; color: var(--color-primario); font-size: 1.15em; flex-grow: 1; line-height: 1.4; }
.blog-post-card .read-more { font-weight: bold; color: var(--color-secundario); margin-top: 0.8rem; font-size: 0.9em; }
.post-meta { font-size: 0.9em; color: #757575; margin-top: -1rem; margin-bottom: 2rem; }
.post-body img { max-width: 100%; height: auto; border-radius: 8px; margin: 1rem 0; }
body.view-post main { max-width: 100%; }
.post-container { width: 85%; max-width: 1400px; margin-left: auto; margin-right: auto; }
@media (max-width: 1200px) { body.view-post .post-container { width: 90%; } }
@media (max-width: 768px) { body.view-post .post-container { width: 95%; } }

/* --- Media Queries para Responsive --- */
@media screen and (max-width: 768px) {
    nav {
        height: 70px;
        padding: 0 1rem;
    }
    .logo img {
        height: 55px; /* Tamaño del logo en móvil */
    }
    .nav-extra {
        gap: 0.75rem; /* Menos espacio entre iconos */
    }
    .nav-links { position: absolute; right: 0; top: 70px; background-color: rgba(255,255,255,0.9); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); display: none; flex-direction: column; align-items: center; width: 100%; transform: translateX(100%); transition: transform 0.5s ease-in; box-shadow: 0 8px 16px rgba(0,0,0,0.1); }
    .nav-links.nav-active { display: flex; transform: translateX(0%); }
    .burger { display: block; }
    .contact-grid { grid-template-columns: 1fr; }
    .whatsapp-flotante { width: 50px; height: 50px; bottom: 20px; right: 20px; }
}

/* --- Estilos para la Página de Login de Alumno --- */
.login-body { display: flex; justify-content: center; align-items: center; height: 100vh; background-color: #f0f2f5; }
.login-body > div { width: 100%; max-width: 380px; padding: 0 1rem; box-sizing: border-box; }
.login-container { background: white; padding: 2.5rem; border-radius: 8px; box-shadow: 0 4px 12px rgba(0,0,0,0.1); }
.login-container h1 { text-align: center; margin-top: 0; margin-bottom: 1.5rem; }
.login-container .form-group { margin-bottom: 1.5rem; }
.login-container .form-group label { display: block; margin-bottom: 0.5rem; font-weight: 600; }
.login-btn { width: 100%; background-color: var(--color-primario); }
.login-btn:hover { background-color: var(--color-secundario); }
.error-msg { color: var(--color-error); background-color: #ffebee; text-align: center; margin-bottom: 1rem; padding: 0.75rem; border-radius: 5px; }
.back-to-site { text-align: center; margin-top: 1.5rem; }
.back-to-site a { color: #555; text-decoration: none; font-size: 0.9em; }
.back-to-site a:hover { color: var(--color-primario); text-decoration: underline; }


/* --- NUEVOS ESTILOS PARA LA HOME MODERNA --- */

.hero-section {
    text-align: center;
    padding: 4rem 1rem;
}

.hero-section h1 {
    font-size: 2.8rem;
    margin-bottom: 0.5rem;
}

.hero-section .lead {
    font-size: 1.3rem;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
    margin-bottom: 2rem;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    text-align: center;
}

.feature-item .icon {
    background-color: var(--color-primario);
    color: var(--color-blanco);
    height: 60px;
    width: 60px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
}

.feature-item h3 {
    font-size: 1.2rem;
}

.content-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: center;
}

.content-section img {
    width: 100%;
    border-radius: 8px;
    box-shadow: 0 8px 20px rgba(0,0,0,0.15);
}

.cta-section {
    text-align: center;
    background-color: var(--color-primario);
    color: var(--color-blanco);
}

.cta-section h2 {
    color: var(--color-blanco);
}

/* Adaptación para móviles */
@media (max-width: 768px) {
    .content-section {
        grid-template-columns: 1fr;
    }
    .hero-section h1 {
        font-size: 2.2rem;
    }
}