/* Importación de fuentes */
@font-face {
    font-family: 'Bienetresocial';
    font-style: normal;
    font-weight: 400;
    src: local('Bienetresocial Regular'), url('../fuentes/Bienetresocial.woff') format('woff');
}

@font-face {
    font-family: 'Bienetresocial';
    font-style: normal;
    font-weight: 700;
    src: local('Bienetresocial Bold'), url('../fuentes/BienetresocialBold.woff') format('woff');
}

/* Reseteo universal y estilos base */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: #f1f5f9;
    font-family: 'Open Sans', sans-serif;
    color: #334155;
    line-height: 1.6;
}

/* Contenedor principal tipo tarjeta de lectura */
main {
    max-width: 1400px; 
    width: 95%;
    background-color: #ffffff;
    margin: 40px auto;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.05), 0 8px 10px -6px rgba(0, 0, 0, 0.05);
}

/* Barra de navegación superior unificada (Desktop) */
header {
    background-color: #1e3a8a;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    height: 70px;
}

/* Botón hamburguesa oculto por defecto en PC */
.menu-toggle {
    display: none;
    background: none;
    border: none;
    color: #fff;
    font-size: 28px;
    cursor: pointer;
    padding: 5px;
}

.nav-links {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    align-items: center;
    gap: 15px;
}

.nav-links li a {
    display: block;
    color: #fff;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    padding: 10px 15px;
    border-radius: 6px;
    transition: background-color 0.2s ease;
}

.nav-links li a:hover {
    background-color: #1d4ed8;
    color: #ffffff;
}

/* Títulos y textos principales */
h1 {
    font-family: 'Bienetresocial', sans-serif;
    font-weight: 700;
    text-align: center;
    color: #1e3a8a;
    font-size: 38px;
    margin-bottom: 10px;
    letter-spacing: -0.5px;
}

.subtitle {
    text-align: center;
    color: #64748b;
    font-size: 16px;
    margin-bottom: 40px;
}

/* Imágenes dentro de las secciones explicativas */
main img:not(.icon-grid img) {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    margin: 15px 0;
}

/* Sistema de Tarjetas en Cuadrícula para las Preguntas Frecuentes */
.faq-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 25px;
    margin-bottom: 40px;
}

.faq-card {
    background-color: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.faq-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 15px rgba(30, 58, 138, 0.08);
}

.faq-card h3 {
    font-family: 'Bienetresocial', sans-serif;
    color: #1e3a8a;
    font-size: 18px;
    margin-bottom: 12px;
    padding-bottom: 6px;
    border-bottom: 2px solid #cbd5e1;
}

.faq-card ul {
    list-style-type: none;
    padding-left: 0;
}

.faq-card ul li {
    margin-bottom: 8px;
}

.faq-card ul li a {
    color: #475569;
    text-decoration: none;
    font-size: 14px;
    transition: color 0.15s ease;
    display: inline-block;
}

.faq-card ul li a:hover {
    color: #1e3a8a;
    text-decoration: underline;
}

/* Cuadro de contacto final */
.contacto-faq {
    text-align: center;
    background-color: #e0e7ff;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 50px;
    font-weight: 600;
}

.contacto-faq a {
    color: #1e3a8a;
    text-decoration: underline;
}

/* Sección de respuestas */
.respuestas-seccion h2 {
    font-family: 'Bienetresocial', sans-serif;
    font-weight: 700;
    color: #1e3a8a;
    font-size: 22px;
    margin-top: 50px;
    margin-bottom: 15px;
    padding-bottom: 8px;
    border-bottom: 2px solid #e2e8f0;
    clear: both;
}

p {
    font-size: 15px;
    color: #475569;
    margin-bottom: 15px;
}

.cuadro {
    background-color: #f8fafc;
    border: 1px solid #e2e8f0;
    padding: 20px;
    width: 100%;
    border-radius: 8px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    margin: 15px 0;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    display: flow-root; 
}
.cuadro h2 {
    margin-top: 0;
    clear: both;
}

/* Estilos para el contenedor e input de búsqueda */
.search-container {
    max-width: 650px;
    margin: 0 auto 40px auto;
    position: relative;
}

#faqSearch {
    width: 100%;
    padding: 14px 20px;
    font-size: 16px;
    font-family: 'Open Sans', sans-serif;
    border: 2px solid #cbd5e1;
    border-radius: 30px;
    outline: none;
    background-color: #f8fafc;
    color: #1e293b;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

#faqSearch:focus {
    border-color: #1e3a8a;
    background-color: #ffffff;
    box-shadow: 0 6px 15px rgba(30, 58, 138, 0.15);
}

#faqSearch::placeholder {
    color: #94a3b8;
}

/* Contenedor de iconos de acceso rápido (Grid moderno) */
.icon-grid {
    display: grid;
    grid-template-columns: repeat(13, 1fr); /* Fuerza exactamente 13 columnas */
    grid-template-rows: repeat(2, auto);
    gap: 12px; /* Espacio entre los iconos */
    margin-bottom: 30px;
    background: #f8fafc;
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    align-items: center;
    justify-items: center;
}

.icon-grid a img {
    width: 100%;
    max-width: 100px; /* Limita el tamaño máximo para que entren cómodos los 13 */
    height: auto;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border-radius: 6px;
}

.icon-grid a img:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(30, 58, 138, 0.2);
}


footer {
    height: 40px;
    background-color: #1e3a8a;
    margin-top: 40px;
}


nav ul {
    display: flex;
    justify-content: center;
    list-style: none;
    max-width: 1200px;
    margin: 0 auto;
}



main > p:first-of-type {
    text-align: center;
    color: #64748b;
    font-size: 16px;
    margin-bottom: 30px;
}

h2 {
    font-family: 'Bienetresocial', sans-serif;
    font-weight: 700;
    color: #1e3a8a;
    font-size: 22px;
    margin-top: 40px;
    margin-bottom: 15px;
    padding-bottom: 8px;
    border-bottom: 2px solid #e2e8f0; /* Reemplaza los separadores por líneas limpias */
}


/* Estilo para las imágenes flotantes */
main img[style*="float: left"] {
    margin-right: 20px !important;
}

main img[style*="float: right"] {
    margin-left: 20px !important;
}

/* ==========================================================
   ESTILOS EXCLUSIVOS PARA CELULARES (Pantallas <= 768px)
   ========================================================== */
@media screen and (max-width: 768px) {
    main {
        width: 100%;
        margin: 10px auto;
        padding: 15px;
        border-radius: 0;
    }

    nav {
        padding: 10px 15px;
        height: auto;
        position: relative;
    }

    /* Mostrar botón hamburguesa en mobile */
    .menu-toggle {
        display: block;
    }

    /* Achicar logo para que encaje al lado del botón hamburguesa */
    .logo svg {
        max-width: 190px;
        height: auto;
    }

    /* Ocultar el menú de navegación por defecto y transformarlo en desplegable vertical */
    .nav-links {
        display: none;
        flex-direction: column;
        width: 100%;
        position: absolute;
        top: 100%;
        left: 0;
        background-color: #1e3a8a;
        box-shadow: 0 8px 16px rgba(0,0,0,0.2);
        padding: 10px 0;
        z-index: 1001;
        gap: 0;
    }

    /* Clase que activa el despliegue al hacer clic */
    .nav-links.active {
        display: flex;
    }

    .nav-links li {
        width: 100%;
    }

    .nav-links li a {
        display: block;
        padding: 12px 20px;
        font-size: 15px;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        border-radius: 0;
    }

    h1 {
        font-size: 26px;
    }

    .subtitle {
        font-size: 14px;
        margin-bottom: 20px;
    }

    .faq-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .cuadro {
        padding: 15px;
    }

    .cuadro h2 {
        font-size: 18px;
    }

    p {
        font-size: 14px;
    }

    .search-container {
        padding: 0 10px;
    }

    #faqSearch {
        font-size: 14px;
        padding: 12px 15px;
    }
}