/* src/css/estilos.css */

/* --- VARIABLES DE COLOR Y FUENTES --- */
:root {
    --color-primario: #200044;
    --color-acento: #f0a500;
    --color-texto-principal: #333333;
    --color-texto-secundario: #555555;
    --color-fondo: #FFFFFF;
    --color-fondo-seccion: #f4f7f6;
    --fuente-principal: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* --- RESETEO BÁSICO Y ESTILOS GLOBALES --- */
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { font-family: var(--fuente-principal); background-color: var(--color-fondo); color: var(--color-texto-principal); line-height: 1.6; }
h1, h2, h3 { color: var(--color-primario); margin-bottom: 1rem; }
a { color: var(--color-acento); text-decoration: none; }
.container { max-width: 1200px; margin-left: auto; margin-right: auto; padding: 0 15px; }

/* --- ESTILOS DEL ENCABEZADO Y LOGO --- */
.encabezado-principal { background-color: var(--color-primario); color: white; padding: 1rem 0; }
.encabezado-principal .container { display: flex; align-items: center; justify-content: space-between; }
.logo-container img { max-height: 70px; width: auto; }

/* --- ESTILOS DE NAVEGACIÓN PRINCIPAL --- */
.navegacion-principal { display: flex; align-items: center; gap: 20px; }
.navegacion-principal ul { list-style: none; display: flex; gap: 20px; }
.navegacion-principal ul a { color: var(--color-fondo); text-decoration: none; font-size: 1rem; font-weight: 600; padding: 10px; transition: color 0.3s ease; }
.navegacion-principal a:hover { color: var(--color-acento); }

/* --- ESTILO DE BOTONES DE ACCIÓN (LOGIN, DASHBOARD) --- */
.acciones-usuario { display: flex; gap: 10px; }
.btn-login { background-color: var(--color-acento); color: #FFFFFF; padding: 4px 15px; border-radius: 5px; font-weight: 700; transition: background-color 0.3s ease, color 0.3s ease; }
.btn-login:hover { background-color: #ffb703; color: var(--color-primario); }
.btn-dashboard { background-color: #5a3e7b; color: #FFFFFF; padding: 4px 15px; border-radius: 5px; font-weight: 700; transition: background-color 0.3s ease; }
.btn-dashboard:hover { background-color: #462963; }

/* --- ESTILO DEL BOTÓN HAMBURGUESA Y CERRAR --- */
.menu-hamburguesa { display: none; flex-direction: column; gap: 5px; cursor: pointer; }
.menu-hamburguesa span { display: block; width: 25px; height: 3px; background-color: var(--color-fondo); }
.menu-cerrar { display: none; position: absolute; top: 30px; right: 30px; width: 30px; height: 30px; cursor: pointer; }
.menu-cerrar::before, .menu-cerrar::after { content: ''; position: absolute; top: 50%; left: 0; width: 100%; height: 3px; background-color: var(--color-fondo); }
.menu-cerrar::before { transform: rotate(45deg); }
.menu-cerrar::after { transform: rotate(-45deg); }

/* --- ESTILOS DE LA PÁGINA DE LOGIN --- */
.main-login { display: flex; justify-content: center; align-items: center; padding: 4rem 15px; background-color: var(--color-fondo-seccion); min-height: calc(100vh - 102px - 280px); }
.login-container { width: 100%; max-width: 450px; background-color: var(--color-fondo); padding: 2.5rem; border-radius: 8px; box-shadow: 0 8px 30px rgba(0,0,0,0.1); }
.login-form h2 { text-align: center; font-size: 2rem; margin-bottom: 2rem; }
.form-group { margin-bottom: 1.5rem; }
.form-group label { display: block; margin-bottom: 0.5rem; font-weight: 600; color: var(--color-texto-secundario); }
.form-group input { width: 100%; padding: 12px; border: 1px solid #ccc; border-radius: 5px; font-size: 1rem; }
.btn-submit { width: 100%; padding: 15px; background-color: var(--color-primario); color: var(--color-fondo); border: none; border-radius: 5px; font-size: 1.1rem; font-weight: 700; cursor: pointer; transition: background-color 0.3s ease; }
.btn-submit:hover { background-color: #331450; }
.success-message { background-color: #d4edda; color: #155724; border-color: #c3e6cb; }
.error-message { background-color: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; padding: 10px; border-radius: 5px; margin-bottom: 1.5rem; text-align: center; }

/* --- ESTILOS DEL HERO BANNER --- */
.seccion-hero { position: relative; height: 60vh; background-image: url('../img/hero-background.jpg'); background-size: cover; background-position: center; display: flex; justify-content: center; align-items: center; text-align: center; color: #FFFFFF; }
.seccion-hero::after { content: ''; position: absolute; top: 0; left: 0; width: 100%; height: 100%; background-color: rgba(0, 0, 0, 0.5); z-index: 1; }
.hero-contenido { position: relative; z-index: 2; max-width: 800px; padding: 0 20px; }
.hero-contenido h1 { color: #FFFFFF; font-size: 3rem; margin-bottom: 1rem; }
.hero-contenido p { font-size: 1.2rem; margin-bottom: 2rem; }
.btn-hero { background-color: var(--color-acento); color: var(--color-primario); padding: 12px 30px; border-radius: 5px; font-weight: 700; font-size: 1rem; text-transform: uppercase; transition: background-color 0.3s ease, transform 0.3s ease; }
.btn-hero:hover { background-color: #ffb703; transform: translateY(-3px); }

/* --- ESTILOS DE SECCIONES GENERALES --- */
.seccion-accesos, .seccion-noticias { padding: 4rem 0; }
.seccion-accesos { background-color: var(--color-fondo-seccion); }
.titulo-seccion { text-align: center; margin-bottom: 3rem; font-size: 2.5rem; }
.seccion-encabezado { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 3rem; }
.seccion-encabezado .titulo-seccion { margin-bottom: 0; }
.ver-todas-enlace { font-weight: 600; white-space: nowrap; }

/* --- ESTILOS DE ACCESOS DIRECTOS --- */
.accesos-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 30px; }
.acceso-item { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 20px; background-color: var(--color-fondo); border-radius: 8px; box-shadow: 0 2px 10px rgba(0,0,0,0.05); transition: transform 0.3s ease, box-shadow 0.3s ease; color: var(--color-texto-secundario); }
.acceso-item:hover { transform: translateY(-5px); box-shadow: 0 8px 20px rgba(0,0,0,0.1); }
.acceso-icono { margin-bottom: 1rem; }
.acceso-icono svg { width: 50px; height: 50px; fill: var(--color-primario); stroke: var(--color-primario); transition: fill 0.3s ease, stroke 0.3s ease; }
.acceso-item:hover .acceso-icono svg { fill: var(--color-acento); stroke: var(--color-acento); }
.acceso-item span { font-weight: 600; font-size: 0.9rem; }

/* --- ESTILOS DE NOTICIAS --- */
.noticias-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 30px; }
.noticia-card { background-color: var(--color-fondo); border-radius: 8px; box-shadow: 0 4px 15px rgba(0,0,0,0.08); overflow: hidden; display: flex; flex-direction: column; transition: transform 0.3s ease, box-shadow 0.3s ease; }
.noticia-card:hover { transform: translateY(-5px); box-shadow: 0 12px 25px rgba(0,0,0,0.12); }
.noticia-imagen img { width: 100%; height: 200px; object-fit: cover; }
.noticia-contenido { padding: 20px; display: flex; flex-direction: column; flex-grow: 1; }
.noticia-fecha { font-size: 0.8rem; color: var(--color-texto-secundario); margin-bottom: 0.5rem; display: block; }
.noticia-titulo { font-size: 1.25rem; margin-bottom: 0.75rem; }
.noticia-titulo a { color: var(--color-primario); text-decoration: none; }
.noticia-titulo a:hover { color: var(--color-acento); }
.noticia-extracto { font-size: 0.9rem; line-height: 1.5; flex-grow: 1; }
.noticia-footer { padding: 0 20px 20px 20px; text-align: right; }
.noticia-enlace { font-weight: 700; color: var(--color-acento); }
.noticia-enlace::after { content: ' →'; }
.noticia-enlace:hover { text-decoration: underline; }

/* --- ESTILOS PARA LA PÁGINA DE NOTICIA INDIVIDUAL --- */
.main-articulo { padding-top: 3rem; padding-bottom: 3rem; }
.articulo-completo { max-width: 800px; margin: 0 auto; }
.articulo-header { margin-bottom: 2rem; border-bottom: 1px solid #eee; padding-bottom: 1rem; }
.articulo-titulo { font-size: 2.5rem; line-height: 1.2; margin-bottom: 1rem; }
.articulo-meta { font-size: 0.9rem; color: var(--color-texto-secundario); }
.articulo-meta span:not(:last-child)::after { content: ' | '; margin: 0 5px; }
.articulo-imagen-principal { margin: 0 0 2rem 0; }
.articulo-imagen-principal img { width: 100%; height: auto; border-radius: 8px; }

.articulo-imagen-principal figcaption,
.galeria-grid figcaption {
    font-size: 0.8rem;
    color: #666;
    text-align: center;
    margin-top: 0.5rem;
    font-style: italic;
}
.pie-de-foto-texto {
    display: block;
}
.enlace-descarga {
    display: block;
    font-size: 0.75rem;
    color: #555;
    font-style: italic;
    text-decoration: none;
    margin-top: 2px;
}
.enlace-descarga:hover {
    text-decoration: underline;
    color: var(--color-primario);
}

.articulo-contenido p, .articulo-contenido ul, .articulo-contenido ol, .articulo-contenido h2, .articulo-contenido h3 { margin-bottom: 1.5rem; }
.articulo-contenido a { text-decoration: underline; }
.articulo-contenido img { max-width: 100%; height: auto; border-radius: 5px; display: block; margin: 1.5rem auto; }
.articulo-galeria { margin-top: 3rem; padding-top: 2rem; border-top: 1px solid #eee; }
.galeria-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 15px; }
.galeria-grid figure { margin: 0; }
.galeria-grid img { width: 100%; border-radius: 5px; }

/* --- ESTILOS DEL PIE DE PÁGINA --- */
.pie-de-pagina { background-color: var(--color-primario); color: #e0e0e0; padding: 3rem 0 1rem 0; }
.footer-contenido { display: flex; justify-content: space-between; gap: 30px; margin-bottom: 2rem; }
.footer-columna { flex: 1; }
.footer-columna h3 { color: var(--color-acento); margin-bottom: 1rem; font-size: 1rem; }
.footer-columna p { margin-bottom: 0.15rem; font-size: 0.9rem; }
.footer-columna a { color: #e0e0e0; transition: color 0.3s ease; }
.footer-columna a:hover { color: var(--color-acento); }
.footer-copyright { text-align: center; padding-top: 1.5rem; border-top: 1px solid rgba(255, 255, 255, 0.2); font-size: 0.8rem; color: #a0a0a0; }
.footer-redes { display: flex; align-items: center; gap: 15px; margin-top: 1rem; }
.footer-redes a { color: #FFFFFF; transition: color 0.3s ease; }
.footer-redes a:not(.logo-svg-footer):hover { color: var(--color-acento); }
.footer-redes svg { width: 24px; height: 24px; fill: currentColor; }
.footer-redes .logo-svg-footer svg { width: 26px; height: 26px; }

/* --- ESTILOS PARA LA PAGINACIÓN --- */
.paginacion {
    margin-top: 3rem;
    display: flex;
    justify-content: center;
}
.paginacion ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    gap: 10px;
}
.paginacion a {
    display: block;
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 5px;
    text-decoration: none;
    color: var(--color-primario);
    transition: background-color 0.3s, color 0.3s;
}
.paginacion a:hover {
    background-color: var(--color-fondo-seccion);
}
.paginacion a.active {
    background-color: var(--color-primario);
    color: white;
    border-color: var(--color-primario);
}

/* --- ESTILOS RESPONSIVE (PARA MÓVILES) --- */
@media (max-width: 768px) {
    .accesos-grid { grid-template-columns: repeat(2, 1fr); }
    .hero-contenido h1 { font-size: 2.2rem; }
    .hero-contenido p { font-size: 1rem; }
    .titulo-seccion { font-size: 2rem; }
    .seccion-encabezado { flex-direction: column; align-items: center; gap: 10px; }
    .encabezado-principal .container { flex-direction: row; }
    .menu-hamburguesa { display: flex; }
    .navegacion-principal { display: none; }
    .navegacion-principal.menu-abierto { display: flex; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background-color: rgba(32, 0, 68, 0.95); flex-direction: column; justify-content: center; align-items: center; gap: 30px; z-index: 100; }
    .navegacion-principal.menu-abierto ul { flex-direction: column; text-align: center; gap: 30px; }
    .navegacion-principal.menu-abierto a { font-size: 1.5rem; }
    .navegacion-principal.menu-abierto .menu-cerrar { display: block; }
    .navegacion-principal.menu-abierto .acciones-usuario { margin-top: 20px; display: flex; flex-direction: row; gap: 15px; align-items: center; }
    .navegacion-principal.menu-abierto .acciones-usuario a { font-size: 1rem; padding: 8px 20px; }
    .footer-contenido { flex-direction: column; text-align: center; }
    .footer-redes { justify-content: center; }
    .articulo-titulo { font-size: 1.8rem; }
    .galeria-grid { 
        grid-template-columns: 1fr; 
    }

    .contacto-grid {
        flex-direction: column;
    }
    
    .transparencia-texto {
        padding: 1.5rem !important;
    }
    .transparencia-texto p,
    .transparencia-texto .blockquote-ley,
    .lista-fines li p {
        text-align: left !important; /* Desactivamos el justificado en móviles */
    }
}

/* --- ESTILOS PARA LA PÁGINA DE CONTACTO --- */
.main-contacto .estado-formulario { padding: 15px; border-radius: 5px; margin: -1rem auto 2rem auto; text-align: center; font-weight: 600; max-width: 800px; }

.contacto-grid { 
    display: flex; 
    gap: 3rem; 
    margin-bottom: 3rem;
    align-items: flex-start;
}
.info-contacto {
    flex: 1;
}
.formulario-contacto {
    flex: 1.5;
}

.contact-box {
    background-color: var(--color-fondo-seccion);
    padding: 2.5rem;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
}

.info-contacto h3,
.formulario-contacto h3 { 
    margin-top: 0; 
    font-size: 1.8rem; 
    border-bottom: 2px solid var(--color-acento); 
    padding-bottom: 0.5rem; 
    margin-bottom: 1.5rem; 
}

.lista-info-contacto { list-style: none; padding: 0; }
.lista-info-contacto li { display: flex; align-items: flex-start; gap: 15px; margin-bottom: 1.5rem; font-size: 1rem; color: var(--color-texto-secundario); }
.lista-info-contacto li a { color: var(--color-texto-secundario); font-weight: 600; }
.lista-info-contacto li a:hover { color: var(--color-primario); }
.lista-info-contacto svg { width: 24px; height: 24px; fill: var(--color-primario); margin-top: 2px; flex-shrink: 0; }

.formulario-contacto .form-group { margin-bottom: 1.5rem; }
.formulario-contacto label { display: block; margin-bottom: 0.5rem; font-weight: 600; }
.formulario-contacto input, .formulario-contacto textarea { width: 100%; padding: 12px; border: 1px solid #ccc; border-radius: 5px; font-size: 1rem; font-family: var(--fuente-principal); }

.mapa-container { margin-top: 2rem; border-top: 1px solid #eee; padding-top: 2rem; }
.mapa-container h3 { text-align: center; font-size: 1.8rem; }
.mapa-container iframe { border-radius: 8px; margin-top: 1.5rem; }

/* --- ESTILO PARA BOTÓN FLOTANTE DE WHATSAPP --- */
.whatsapp-flotante { position: fixed; bottom: 25px; right: 25px; background-color: #25D366; color: white; width: 60px; height: 60px; border-radius: 50%; display: flex; align-items: center; justify-content: center; box-shadow: 0 4px 12px rgba(0,0,0,0.2); z-index: 100; transition: transform 0.2s ease, box-shadow 0.2s ease; }
.whatsapp-flotante:hover { transform: scale(1.1); box-shadow: 0 6px 16px rgba(0,0,0,0.3); }
.whatsapp-flotante svg { width: 32px; height: 32px; }

/* --- ESTILOS PARA LA CAPA DE CARGA --- */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1001; /* Más alto que el botón de WhatsApp */
}
.spinner {
    width: 60px;
    height: 60px;
    border: 8px solid #f3f3f3;
    border-top: 8px solid var(--color-primario);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* --- ESTILOS PARA ENLACE DE RECUPERAR CONTRASEÑA --- */
.forgot-password-link {
    text-align: center;
    margin-top: 1.5rem;
}
.forgot-password-link a {
    color: var(--color-texto-secundario);
    font-size: 0.9rem;
    text-decoration: underline;
}
.forgot-password-link a:hover {
    color: var(--color-primario);
}

/* --- ESTILOS PARA LA PÁGINA DE TRANSPARENCIA --- */
.main-transparencia {
    padding-top: 3rem;
    padding-bottom: 3rem;
}

.transparencia-icono img {
    display: block;
    margin: -1rem auto 2.5rem auto;
    max-width: 820px;
    width: 100%;
}

.transparencia-links {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 2rem;
    margin-bottom: 3rem;
    flex-wrap: wrap; /* Para que se adapte a móviles */
}

.transparencia-links a {
    display: block;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border-radius: 8px;
}

.transparencia-links a:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.1);
}

.transparencia-links img {
    max-width: 250px; /* Tamaño máximo para cada imagen-enlace */
    width: 100%;
    height: auto;
    border-radius: 8px;
}

.transparencia-texto {
    background-color: var(--color-fondo-seccion);
    padding: 2.5rem;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
    max-width: 900px;
    margin: 0 auto;
    line-height: 1.7; /* Aumentamos el interlineado */
}

.transparencia-texto p {
    text-align: justify; /* Justificamos los párrafos */
    margin-bottom: 1rem;
}

.blockquote-ley {
    border-left: 4px solid var(--color-acento);
    padding: 1rem 1.5rem;
    margin: 2rem 0;
    font-style: italic;
    color: var(--color-texto-secundario);
    background-color: #ffffff; /* Fondo blanco para destacar */
    border-radius: 0 8px 8px 0; /* Bordes redondeados */
    text-align: justify;
}

.lista-fines {
    list-style: none;
    padding-left: 0;
    margin: 2rem 0;
}

.lista-fines li {
    margin-bottom: 1.5rem;
}

.lista-fines li p {
    margin-top: 0.25rem;
    padding-left: 1.5rem;
    text-align: justify; /* Justificamos también el texto de las listas */
}

/* --- CORRECCIÓN PARA FOOTER FLOTANTE --- */
html {
    height: 100%;
}

body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.pie-de-pagina {
    margin-top: auto;
}


/* --- CINTILLO DE MARCAS --- */
.cintillo-marcas {
    position: relative;
    background: linear-gradient(to top, var(--color-primario) 0%, var(--color-primario) 70%, transparent 100%);
    padding: 80px 0 20px 0;
    overflow: hidden;
}

.marcas-container {
    position: relative;
    overflow: hidden;
    padding: 40px 0;
}

.marcas-scroll {
    width: 100%;
    overflow: hidden;
}

.marcas-track {
    display: flex;
    gap: 80px;
    align-items: center;
    animation: scroll-marcas 40s linear infinite;
    width: fit-content;
}

.marcas-track img {
    height: 60px;
    width: auto;
    max-width: 200px;
    object-fit: contain;
    opacity: 0.9;
    transition: opacity 0.3s ease;
}

.marcas-track img:hover {
    opacity: 1;
}

@keyframes scroll-marcas {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(-50%);
    }
}

@media (max-width: 768px) {
    .marcas-track {
        gap: 50px;
    }
    
    .marcas-track img {
        height: 45px;
        max-width: 150px;
    }
}
