/* ========================================
   1. CONFIGURACIÓN GLOBAL Y VARIABLES
   ======================================== */

@font-face {
    font-family: 'Aptos';
    src: local('Aptos'), local('Aptos Display');
}

:root {
    /* Colores Principales */
    --azul-tecnm: #1B396A;
    --naranja-convocatoria: #d17a1b;

    /* Colores Secundarios */
    --gris-fondo: #f4f7f6;
    --blanco: #ffffff;
    --gris-claro: #F7F7F7;
    --gris-borde: #dee2e6;

    /* Sombras */
    --sombra-suave: 0 2px 10px rgba(0,0,0,0.1);
    --sombra-media: 0 4px 12px rgba(0,0,0,0.08);
    --sombra-fuerte: 0 10px 30px rgba(0,0,0,0.08);

    /* Transiciones */
    --transicion: 0.3s cubic-bezier(0.25, 1, 0.5, 1);
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--gris-fondo);
    font-family: 'Aptos', sans-serif;
    margin: 0;
    color: #333;
}

/* Full Page Content */
#full-page-content {
    display: none !important;
    position: relative;
    width: 100%;
    min-height: 100vh;
    background-color: var(--blanco);
    margin: 0;
    padding: 0;
}

#full-page-content:not(.d-none) {
    display: block !important;
}

/* ========================================
   2. HEADER - TOP HEADER
   ======================================== */

#header-container {
    position: -webkit-sticky; /* Fix for Safari iOS */
    position: sticky;
    top: 0;
    z-index: 1050;
    width: 100%;
    transition: top 0.3s ease;
}

/* Cuando Google Translate está activo, bajar el header para no solaparse con su barra */
html.translated-ltr #header-container,
html.translated-rtl #header-container {
    top: 40px;
}

.top-header {
    background-color: var(--gris-claro);
    border-bottom: 1px solid var(--gris-borde);
    padding: 8px 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: var(--sombra-suave);
}

.top-header .container-fluid {
    max-width: 1600px;
}

/* Contenedor Principal */
.header-content {
    display: flex;
    justify-content: space-between; /* Elementos empujados a los extremos */
    align-items: center;
    gap: 15px;
    flex-wrap: nowrap; /* Evita que el header se rompa en varias líneas en PC angostas */
    width: 100%;
}

/* ========================================
   3. MARCA Y LOGOS
   ======================================== */

.brand-container {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: var(--azul-tecnm);
    flex-shrink: 0;
    order: 1;
}

.logo-principal {
    height: 90px;
    width: auto;
    flex-shrink: 0;
}

.brand-text {
    display: flex;
    flex-direction: column;
    color: var(--azul-tecnm);
    line-height: 1;
    margin: 0;
}

.brand-text h2,
.brand-text h1,
.brand-text h3 {
    margin: 0;
    padding: 0;
}

.brand-text .title-top {
    font-size: 15px;
    font-weight: 800;
}

.brand-text .title-mid {
    font-size: 17px;
    font-weight: 800;
}

.brand-text .title-bottom {
    font-size: 12px;
    font-style: italic;
    font-weight: 500;
}

.logo-secundario {
    height: 90px;
    width: auto;
    object-fit: contain;
    flex-shrink: 0;
    order: 3;
}

/* ========================================
   4. MENÚ CENTRAL E INDICADOR
   ======================================== */

.menu-central-container {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 25px;
    padding: 0;
    margin: 0;
    border: none;
    height: 60px;
    order: 2;
    flex: 0 1 auto;
}

.nav-link-inline {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: #212529;
    cursor: pointer;
    z-index: 2;
    border: none;
    background: none;
    padding: 10px 8px;
    position: relative;
    transition: background-color 0.2s;
    font-size: 0.85rem;
    font-family: inherit;
    white-space: nowrap;
}

.nav-link-inline:hover {
    background-color: rgba(0,0,0,0.02);
    border-radius: 4px;
}

.nav-link-inline i {
    font-size: 1.3rem;
    margin-bottom: 2px;
    pointer-events: none;
}

.nav-link-inline span {
    font-size: 0.85rem;
    font-weight: 600;
    pointer-events: none;
    line-height: 1;
}

.nav-indicator {
    height: 3px;
    background-color: var(--azul-tecnm);
    position: absolute;
    bottom: 0;
    left: 0;
    transition: all var(--transicion);
    border-radius: 2px;
    z-index: 1;
    width: 0;
}

/* ========================================
   5. SELECTOR DE IDIOMA
   ======================================== */

.language-selector {
    display: flex;
    gap: 6px;
    border: none;
    padding: 0;
    margin: 0;
    order: 4;
}

.language-selector input[type="radio"] {
    display: none;
}

.language-selector label.flag-btn {
    padding: 2px;
    margin: 0;
    height: 36px;
    width: 52px;
    border: 2px solid transparent;
    border-radius: 4px;
    overflow: hidden;
    cursor: pointer;
    flex-shrink: 0;
    transition: all 0.2s;
}

.language-selector label.flag-btn:hover {
    transform: scale(1.1);
}

.language-selector label.flag-btn.active-lang {
    border-color: var(--azul-tecnm);
    background-color: rgba(27, 57, 106, 0.1);
}

.language-selector label.flag-btn img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.language-selector input[type="radio"]:checked + label {
    border: 2px solid var(--naranja-convocatoria);
    box-shadow: 0 0 0 2px rgba(209, 122, 27, 0.2);
}

/* ========================================
   RESPONSIVE HEADER - TABLET (max 992px)
   ======================================== */
@media (max-width: 992px) {
    .logo-principal  { height: 70px; }
    .logo-secundario { height: 70px; }
    .brand-text .title-top { font-size: 13px; }
    .brand-text .title-mid { font-size: 14px; }
    .brand-text .title-bottom { font-size: 11px; }
    .menu-central-container { gap: 16px; }
    .nav-link-inline span { font-size: 0.78rem; }
}

/* ========================================
   RESPONSIVE HEADER - MÓVIL (max 768px)
   ======================================== */
@media (max-width: 768px) {
    .header-content {
        display: flex;
        flex-wrap: wrap;
        justify-content: space-between;
        align-items: flex-start;
        padding: 5px 0;
        gap: 8px;
    }

    /* Fila 1 - Izquierda: Logo Tec y Texto */
    .brand-container {
        order: 1;
        flex: 1 1 auto;
        /* Asegura espacio para el logo derecho en pantallas de 360px */
        max-width: calc(100% - 100px); 
        align-items: center;
        margin: 0;
    }

    .logo-principal {
        height: 50px;
        flex-shrink: 0;
    }

    .brand-text {
        /* Permite que el texto se acomode en múltiples líneas si no cabe, 
           en lugar de ocultarse (como pasaba antes) */
        min-width: 0;
    }

    .brand-text .title-top,
    .brand-text .title-mid,
    .brand-text .title-bottom {
        white-space: normal;
        overflow: visible;
        text-overflow: clip;
        line-height: 1.1;
    }

    .brand-text .title-top { font-size: 11px; margin-bottom: 2px; }
    .brand-text .title-mid { font-size: 12px; margin-bottom: 2px; }
    .brand-text .title-bottom { font-size: 9px; }

    /* Fila 1 - Derecha: Logo Ciencia y Tecnología */
    .logo-secundario {
        order: 2;
        flex: 0 0 auto;
        height: 40px;
        width: auto;
        /* Limita su ancho sin distorsionarlo para que siempre quepa */
        max-width: 90px;
        object-fit: contain;
        margin: 0;
        align-self: center;
    }

    /* Fila 2: Menú y banderas (Ocupa todo el ancho 100%) */
    .menu-central-container {
        order: 3;
        flex: 1 1 100%;
        display: flex;
        justify-content: space-between; /* Botones izq, banderas der */
        align-items: center;
        height: auto;
        margin: 0;
        gap: 5px;
    }

    .nav-indicator { display: none; }

    /* Botones de navegación en vertical ("column") para ahorrar mucho espacio horizontal */
    .nav-link-inline {
        flex-direction: column;
        padding: 4px;
        gap: 2px;
        text-align: center;
    }

    .nav-link-inline i { font-size: 1.2rem; margin-bottom: 0; }
    .nav-link-inline span { font-size: 0.70rem; line-height: 1.1; }

    /* Banderas ajustadas al tamaño proporcionado */
    .language-selector {
        flex: 0 0 auto;
        gap: 4px;
        margin: 0;
        padding: 0;
    }
    
    .language-selector label.flag-btn {
        width: 32px;
        height: 22px;
    }
}

/* ========================================
   RESPONSIVE HEADER - MÓVIL PEQUEÑO Y MUY PEQUEÑO (max 480px / 390px)
   Ajustes menores, ya que la lógica principal de Flexbox arriba ya hace todo el trabajo pesado.
   ======================================== */
@media (max-width: 390px) {
    .header-content {
        gap: 5px;
    }
    
    /* Textos un poco más pequeños para evitar que se pisen en MotoG35 */
    .brand-text .title-top { font-size: 10px; }
    .brand-text .title-mid { font-size: 11px; }
    .brand-text .title-bottom { display: none; } /* Ocultamos solo el bottom para ahorrar altura */
    
    .logo-principal { height: 42px; }
    .logo-secundario { height: 35px; max-width: 80px; }
    
    .nav-link-inline i { font-size: 1.0rem; }
    .nav-link-inline span { font-size: 0.65rem; }
    
    .language-selector label.flag-btn { width: 30px; height: 20px; }
}

/* ========================================
   6. HERO / PORTADA
   ======================================== */

.hero-container {
    position: relative;
    width: 100%;
    overflow: hidden;
    border-bottom: 5px solid #ddd;
}

.hero-img {
    width: 100%;
    height: 550px;
    object-fit: cover;
    display: block;
}

/* Título Sobre Portada */
.hero-title-overlay {
    position: absolute;
    top: 10%;
    width: 100%;
    background-color: rgba(255, 255, 255, 0.75);
    padding: 15px 0;
    text-align: center;
    z-index: 2;
}

.hero-title-overlay h1 {
    font-family: 'Graduate', serif;
    font-size: 2.2rem;
    margin: 0;
    font-weight: bold;
    color: #000;
    text-transform: uppercase;
}

/* Botón Flotante Naranja */
.btn-flotante-naranja {
    position: absolute;
    bottom: 10%;
    left: 5%;
    background-color: var(--naranja-convocatoria);
    color: var(--blanco);
    padding: 12px 35px;
    border-radius: 12px;
    font-weight: bold;
    text-decoration: none;
    font-size: 1.4rem;
    box-shadow: 3px 3px 15px rgba(0,0,0,0.4);
    z-index: 3;
    transition: transform 0.2s;
    border: none;
    cursor: pointer;
    display: inline-block;
}

.btn-flotante-naranja:hover {
    transform: scale(1.05);
    color: var(--blanco);
}

.btn-flotante-naranja:focus {
    outline: 2px solid var(--blanco);
    outline-offset: 2px;
}

@media (max-width: 480px) {
    .btn-flotante-naranja {
        bottom: 50%;
        left: 50%;
        transform: translateX(-50%) translateY(50%);
    }

    .btn-flotante-naranja:hover {
        transform: translateX(-50%) translateY(50%) scale(1.05);
    }
}

/* Botón Facebook Sobre Portada */
.btn-facebook-sobre-portada {
    position: absolute;
    bottom: 5%;
    right: 5%;
    width: 150px;
    z-index: 15;
    transition: transform var(--transicion);
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    display: block;
}

.btn-facebook-sobre-portada:focus {
    outline: 2px solid var(--naranja-convocatoria);
    outline-offset: 4px;
    border-radius: 4px;
}

.btn-facebook-sobre-portada img {
    width: 100%;
    height: auto;
    filter: drop-shadow(4px 8px 15px rgba(0,0,0,0.5));
    display: block;
}

.btn-facebook-sobre-portada:hover img {
    filter: drop-shadow(4px 8px 15px rgba(0,0,0,0.6)) brightness(1.1);
}

/* Alturas erráticas de Facebook eliminadas */


/* ========================================
   7. TARJETAS DE ACCESO RÁPIDO
   ======================================== */

.card-replica-btn {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    width: 100%;
    transition: transform 0.3s ease;
    font-family: inherit;
}

.card-replica-btn:hover {
    transform: scale(1.05);
}

.card-replica-btn:focus {
    outline: 2px solid var(--naranja-convocatoria);
    outline-offset: 4px;
    border-radius: 12px;
}

.card-replica {
    background-color: var(--blanco);
    border-radius: 12px;
    box-shadow: var(--sombra-media);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 20px;
    height: 100%;
    transition: box-shadow 0.3s;
}

.card-replica-btn:hover .card-replica {
    box-shadow: var(--sombra-fuerte);
}

.icon-container-replica {
    flex: 0 0 100px;
    width: 100px;
    height: auto;
}

.content-container-replica {
    flex: 1;
    display: flex;
    flex-direction: column;
    text-align: right;
}

.title-replica {
    font-size: 18px;
    font-weight: bold;
    margin: 0;
    color: #333;
}

.subtitle-replica {
    font-size: 14px;
    margin: 0;
    line-height: 1.4;
    font-weight: 800;
    color: #133665;
}

/* ========================================
   8. MENÚ LATERAL Y PANEL - NIVEL
   ======================================== */

.contenedor-menu-puro {
    background-color: var(--blanco);
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #e0e0e0;
}

.enlace-puro {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 20px;
    text-decoration: none;
    color: #444;
    transition: all 0.3s ease;
    cursor: pointer;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    font-family: inherit;
    font-size: inherit;
    position: relative;
    border-left: 3px solid transparent;
}

.enlace-puro:focus {
    outline: 2px inset var(--naranja-convocatoria);
}

.enlace-puro:hover {
    background-color: rgba(27, 57, 106, 0.02);
}

.enlace-puro.activo {
    background-color: #e8f1ff;
    color: var(--azul-tecnm);
    border-left-color: var(--azul-tecnm);
    font-weight: 600;
}

/* Submenu Internacional */
.enlace-con-submenu {
    cursor: pointer;
}

.toggle-icon {
    display: inline-block;
    transition: transform 0.3s ease;
    margin-left: 5px;
}

.enlace-con-submenu.activo .toggle-icon {
    transform: rotate(90deg);
}

.submenu-internacional {
    background-color: #f5f5f5;
    border-left: 3px solid var(--azul-tecnm);
    padding: 0;
    margin: 0;
    display: none;
}

.submenu-item {
    padding: 14px 20px !important;
    padding-left: 40px !important;
    font-size: 0.95rem;
    display: block;
    width: 100%;
    text-align: left;
    border: none;
    background: none;
    cursor: pointer;
}

.submenu-item:hover {
    background-color: rgba(27, 57, 106, 0.05);
}

.submenu-item.activo {
    background-color: #e8f1ff;
    color: var(--azul-tecnm);
    font-weight: 600;
}

/* ========================================
   9. PANEL CENTRAL DINÁMICO - IMPORTANTE
   ======================================== */

/* ⭐ SECCIONES DINÁMICAS - OCULTAS POR DEFECTO */
[id$="-section"] {
    display: none !important;
    position: static;
    margin: 0;
    padding: 0;
}

/* ⭐ CUANDO SE MUESTRAN */
[id$="-section"]:not(.d-none) {
    display: block !important;
    position: static;
    width: 100%;
    margin: 0;
    padding: 0;
}

/* ⭐ PANEL PRINCIPAL */
#panel-principal {
    min-height: 500px;
    background: var(--blanco);
    border-radius: 15px;
    padding: 40px;
    box-shadow: var(--sombra-fuerte);
    display: block !important;
}

#panel-principal.d-none {
    display: none !important;
}

/* ⭐ PANEL DINÁMICO GENERAL */
.panel-dinamico {
    min-height: 500px;
    background: var(--blanco);
    border-radius: 15px;
    padding: 40px;
    box-shadow: var(--sombra-fuerte);
    display: block !important;
    position: static;
}

.panel-dinamico.d-none {
    display: none !important;
}

.panel-dinamico h2,
.panel-dinamico h3 {
    margin-top: 0;
}

#mensaje-vacio {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 400px;
}

#mensaje-vacio i {
    font-size: 4rem;
    color: #ddd;
}

#mensaje-vacio h2 {
    color: #999;
    margin: 15px 0 10px;
}

#mensaje-vacio p {
    color: #999;
    font-size: 14px;
}

/* ========================================
   10. CONTACTO - MARCO INCLINADO
   ======================================== */

.foto-marco {
    width: 130px;
    height: 130px;
    background: #fff;
    padding: 5px;
    border: 1px solid #ccc;
    box-shadow: 4px 4px 8px rgba(0,0,0,0.1);
    clip-path: polygon(0 0, 100% 0, 100% 85%, 85% 100%, 0 100%, 0% 15%);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.img-contacto {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.texto-contacto-titulo {
    font-weight: 800;
    color: var(--azul-tecnm);
    font-size: 0.95rem;
    line-height: 1.2;
}

.texto-contacto-nombre {
    font-size: 1.2rem;
    font-weight: 500;
    color: #333;
}

/* ================================================
   CONTACTO - RESPONSIVE MÓVIL
   Cada bloque pasa de horizontal a card vertical centrada
   ================================================ */
@media (max-width: 768px) {

    /* Cada bloque de contacto (foto + texto) se convierte en tarjeta vertical */
    #contacto-section .d-flex.align-items-start {
        flex-direction: column !important;
        align-items: center !important;
        text-align: center !important;
        background: #fff;
        border: 1px solid var(--gris-borde);
        border-radius: 12px;
        padding: 24px 20px !important;
        box-shadow: 0 2px 10px rgba(0,0,0,0.07);
        margin-bottom: 20px !important;
    }

    /* Foto centrada arriba */
    .foto-marco {
        width: 120px;
        height: 120px;
        margin: 0 auto 16px;
        flex-shrink: 0;
    }

    /* Texto debajo, centrado */
    #contacto-section .d-flex > div:last-child {
        width: 100%;
        text-align: center;
    }

    .texto-contacto-titulo {
        font-size: 0.9rem;
        margin-bottom: 6px;
    }

    .texto-contacto-nombre {
        font-size: 1.1rem;
    }

    /* Enlace de correo centrado */
    #contacto-section a {
        display: block;
        margin-top: 8px;
        font-size: 0.85rem;
        word-break: break-all; /* evita que el email largo desborde */
    }
}


/* ========================================
   11. ÍNDICE DE CONTENIDOS
   ======================================== */

.indice-contenidos {
    background: linear-gradient(135deg, #f0f4ff 0%, #e8f0ff 100%);
    border-left: 5px solid var(--naranja-convocatoria);
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 30px;
}

.indice-contenidos h3 {
    margin: 0;
    color: var(--azul-tecnm);
    font-size: 18px;
    font-weight: 700;
}

.indice-contenidos ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.indice-contenidos li {
    margin-bottom: 10px;
}

.indice-link {
    color: var(--azul-tecnm);
    text-decoration: none;
    font-weight: 600;
    transition: all var(--transicion);
    padding: 8px 12px;
    display: inline-block;
    border-radius: 4px;
}

.indice-link:before {
    content: "▸ ";
    margin-right: 8px;
    color: var(--naranja-convocatoria);
    font-weight: 800;
}

.indice-link:hover {
    color: var(--naranja-convocatoria);
    background-color: rgba(27, 57, 106, 0.08);
    padding-left: 18px;
}

.indice-link:focus {
    outline: 2px solid var(--naranja-convocatoria);
    outline-offset: 2px;
}

/* ========================================
   12A. TABLA TUTORÍAS
   ======================================== */

.tabla-tutorias-container {
    margin-top: 30px;
    overflow-x: auto;
}

.tabla-tutorias {
    width: 100%;
    border-collapse: collapse;
    background-color: var(--blanco);
    border: 1px solid var(--gris-borde);
    box-shadow: var(--sombra-suave);
    font-family: 'Times New Roman', serif;
}

.tabla-tutorias thead {
    background-color: var(--azul-tecnm);
    color: var(--blanco);
}

.tabla-tutorias thead th {
    padding: 20px;
    text-align: center;
    font-weight: 700;
    font-size: 20px;
    letter-spacing: 1px;
}

.tabla-tutorias tbody tr {
    border-bottom: 1px solid var(--gris-borde);
    transition: background-color 0.2s;
}

.tabla-tutorias tbody tr:hover {
    background-color: rgba(27, 57, 106, 0.03);
}

.tabla-tutorias tbody tr:last-child {
    border-bottom: none;
}

.celda-foto {
    width: 200px;
    min-height: 250px;
    padding: 25px;
    text-align: center;
    vertical-align: top;
    background-color: #f9f9f9;
}

.foto-estudiante {
    width: 150px;
    height: 180px;
    object-fit: cover;
    object-position: top;
    border-radius: 10px;
    display: block;
    margin: 0 auto 15px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    border: 2px solid var(--blanco);
}

.nombre-estudiante {
    font-weight: 700;
    font-size: 18px;
    color: var(--azul-tecnm);
    line-height: 1.3;
    margin-top: 15px;
    text-align: center;
}

.celda-info {
    padding: 25px;
    vertical-align: top;
}

.celda-info p {
    margin: 0 0 18px 0;
    font-size: 17px;
    line-height: 1.8;
    color: #222;
}

.celda-info p:last-child {
    margin-bottom: 0;
}

.celda-info strong {
    color: var(--azul-tecnm);
    font-weight: 800;
    font-size: 18px;
}

/* ================================================
   TABLA TUTORÍAS - RESPONSIVE ESTRICTO (MISMA TABLA)
   Escala proporcional adaptativa para aprovechar el área sin alargar la tabla.
   ================================================ */
@media (max-width: 992px) {
    .tabla-tutorias { table-layout: fixed; width: 100%; }
    .tabla-tutorias thead th { font-size: 17px; padding: 15px; }
    .celda-foto { width: 25%; min-width: 130px; padding: 15px; }
    .foto-estudiante { width: 110px; height: 135px; border-radius: 6px; }
    .nombre-estudiante { font-size: 15px; }
    .celda-info { padding: 15px; word-wrap: break-word; }
    .celda-info p { font-size: 14.5px; }
    .celda-info strong { font-size: 15px; }
}

@media (max-width: 768px) {
    .tabla-tutorias-container {
        overflow-x: auto;
        margin-top: 15px;
    }
    .tabla-tutorias {
        table-layout: fixed;
        width: 100%;
        min-width: 400px; /* Para que al menos se lea de lado en pantallas enanas */
    }
    .tabla-tutorias thead th {
        padding: 10px 5px;
        font-size: 14px;
    }
    /* Se usa porcentaje para que escale con la pantalla, la imagen se mantiene visible */
    .celda-foto {
        width: 30%; 
        min-width: 110px;
        padding: 12px 8px;
    }
    .foto-estudiante {
        width: 90px;
        height: 110px;
        margin: 0 auto 8px;
        border-radius: 5px;
    }
    .nombre-estudiante {
        font-size: 13px;
        margin-top: 5px;
        line-height: 1.2;
    }
    .celda-info {
        padding: 12px 10px;
        word-wrap: break-word;
    }
    .celda-info p {
        font-size: 12px;
        line-height: 1.35;
        margin-bottom: 10px;
    }
    .celda-info strong {
        font-size: 13px;
        display: inline;
    }
}

@media (max-width: 480px) {
    .tabla-tutorias {
        min-width: 320px;
    }
    .tabla-tutorias thead th {
        font-size: 12px;
        padding: 8px 4px;
    }
    .celda-foto {
        width: 32%; 
        min-width: 85px;
        padding: 10px 5px;
    }
    .foto-estudiante {
        width: 70px;
        height: 85px;
        margin-bottom: 5px;
    }
    .nombre-estudiante {
        font-size: 11px;
    }
    .celda-info {
        padding: 10px 6px;
    }
    .celda-info p {
        font-size: 10.5px;
        line-height: 1.3;
        margin-bottom: 6px;
    }
    .celda-info strong {
        font-size: 11px;
        margin-bottom: 0px;
    }
}

/* ========================================
   12B. LÍNEAS DE INVESTIGACIÓN - PÁGINA COMPLETA
   ======================================== */

.lineas-container {
    font-family: 'Times New Roman', serif;
    line-height: 1.8;
    color: #333;
}

.lineas-container h1 {
    font-size: 40px;
    font-weight: bold;
    color: var(--azul-tecnm);
    margin-bottom: 20px;
    border-bottom: 3px solid var(--naranja-convocatoria);
    padding-bottom: 15px;
}

.lineas-container h2 {
    font-size: 28px;
    font-weight: bold;
    color: var(--azul-tecnm);
    margin-top: 30px;
    margin-bottom: 15px;
}

.lineas-container h3 {
    font-size: 18px;
    font-weight: bold;
    color: var(--azul-tecnm);
    margin-top: 20px;
    margin-bottom: 10px;
}

.lineas-container p {
    font-size: 16px;
    margin-bottom: 15px;
    text-align: justify;
    line-height: 1.8;
}

.lineas-intro {
    background-color: #f0f4ff;
    padding: 20px;
    border-left: 5px solid var(--naranja-convocatoria);
    border-radius: 8px;
    margin-bottom: 30px;
}

.lineas-intro p {
    margin-bottom: 10px;
    font-size: 16px;
    line-height: 1.8;
}

.lgac-list {
    background-color: #f9f9f9;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 30px;
}

.lgac-list p {
    font-size: 16px;
    margin-bottom: 12px;
    font-weight: bold;
    color: var(--azul-tecnm);
}

.lgac-item {
    margin-bottom: 40px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e0e0e0;
}

.lgac-item:last-child {
    border-bottom: none;
}

.lgac-item h2 {
    font-size: 26px;
    font-weight: bold;
    color: var(--azul-tecnm);
    margin-bottom: 15px;
}

.lgac-section {
    margin-bottom: 15px;
}

.lgac-section h3 {
    font-size: 17px;
    font-weight: bold;
    color: var(--azul-tecnm);
    margin-bottom: 8px;
}

.lgac-section p {
    font-size: 16px;
    text-align: justify;
    line-height: 1.8;
}

.lgac-link {
    color: var(--azul-tecnm);
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
    padding-bottom: 2px;
    border-bottom: 2px solid transparent;
    font-size: 16px;
}

.lgac-link:hover {
    color: var(--naranja-convocatoria);
    border-bottom-color: var(--naranja-convocatoria);
}

.lgac-link:focus {
    outline: 2px solid var(--naranja-convocatoria);
    outline-offset: 2px;
}

/* ========================================
   12C. NÚCLEO ACADÉMICO - PÁGINA COMPLETA
   ======================================== */

.nucleo-lgac {
    margin-bottom: 50px;
    padding-bottom: 30px;
    border-bottom: 2px solid #e0e0e0;
}

.nucleo-lgac:last-child {
    border-bottom: none;
}

.nucleo-lgac h2 {
    font-size: 26px;
    font-weight: bold;
    color: var(--azul-tecnm);
    margin-bottom: 25px;
    padding-bottom: 10px;
    border-bottom: 3px solid var(--naranja-convocatoria);
}

.profesor-item {
    background-color: #f9f9f9;
    padding: 20px;
    margin-bottom: 20px;
    border-left: 5px solid var(--naranja-convocatoria);
    border-radius: 8px;
}

.profesor-item h3 {
    font-size: 18px;
    font-weight: bold;
    color: var(--azul-tecnm);
    margin-bottom: 15px;
    margin-top: 0;
}

.profesor-item p {
    font-size: 15px;
    margin-bottom: 10px;
    line-height: 1.7;
}

.profesor-item p:last-child {
    margin-bottom: 0;
}

.profesor-item a {
    color: var(--naranja-convocatoria);
    text-decoration: none;
    transition: all 0.3s ease;
}

.profesor-item a:hover {
    color: var(--azul-tecnm);
    text-decoration: underline;
}

.profesor-item a:focus {
    outline: 2px solid var(--naranja-convocatoria);
    outline-offset: 2px;
}

/* ========================================
   12C.1. TABLA DE PROFESORES - LGAC
   ======================================== */

.tabla-profesores-lgac {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
}

.fila-profesor {
    border: 2px solid #e0e0e0;
    margin-bottom: 20px;
    display: table-row;
    background-color: var(--blanco);
}

.fila-profesor:last-child {
    margin-bottom: 0;
}

.foto-profesor {
    width: 140px;
    height: 180px;
    object-fit: cover;
    object-position: top;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    display: block;
    margin: 0 auto;
}

.separador-perfil {
    margin-left: 10px;
}

/* Responsive - Tablets */
@media (max-width: 768px) {
    .fila-profesor {
        display: block;
        margin-bottom: 20px;
    }

    .celda-foto {
        width: 100%;
        border-right: none;
        border-bottom: 2px solid #e0e0e0;
        text-align: center;
        padding: 15px;
    }

    .foto-profesor {
        width: 140px;
        height: 180px;
    }

    .celda-info {
        display: block;
        padding: 15px;
    }

    .celda-info p {
        font-size: 14px;
    }
}

/* Responsive - Celulares */
@media (max-width: 480px) {
    .celda-foto {
        width: 100%;
        padding: 30px;
        vertical-align: middle;
    }

    .foto-profesor {
        width: 120px;
        height: 160px;
    }

    .celda-info {
        padding: 12px;
    }

    .celda-info p {
        font-size: 13px;
        margin-bottom: 6px;
    }
}

/* ========================================
   12D. Costos (títulos reutilizables).
   ======================================== */
.titulo-seccion {
    font-family: "Times New Roman", serif;
    font-size: 56px;
    font-weight: 700;
    color: var(--azul-tecnm);
    margin: 0 0 18px 0;
    text-transform: none;
    line-height: 1.05;
}

.seccion-divider {
    height: 3px;
    background-color: var(--naranja-convocatoria);
    border: none;
    margin: 0 0 28px 0;
    opacity: 1;
}

/* ========================================
   12D.1. SECCIONES (estilo Costos) - REUTILIZABLE
   ======================================== */
.seccion-contenido {
    background-color: var(--blanco);
    padding: 40px;
}

.seccion-cuerpo {
    font-family: "Times New Roman", serif;
    font-size: 18px;
    line-height: 1.8;
    color: #333;
    text-align: justify;
}

.seccion-cuerpo p {
    margin: 0 0 18px 0;
}

.seccion-cuerpo p:last-child {
    margin-bottom: 0;
}

/* Responsive para secciones tipo Costos */
@media (max-width: 768px) {
    .titulo-seccion {
        font-size: 42px;
    }

    .seccion-contenido {
        padding: 24px;
    }

    .seccion-cuerpo {
        font-size: 17px;
    }
}

@media (max-width: 480px) {
    .titulo-seccion {
        font-size: 34px;
    }

    .seccion-contenido {
        padding: 18px;
    }

    .seccion-cuerpo {
        font-size: 16px;
    }
}

/* ========================================
   12E. VINCULACIÓN (solo tabla)
   ======================================== */

/* Tabla Vinculación */
.tabla-vinculacion-container {
    margin-top: 30px;
    overflow-x: auto;
}

.tabla-vinculacion {
    width: 100%;
    border-collapse: collapse;
    background-color: var(--blanco);
    border: 2px solid #000;
    font-family: 'Times New Roman', serif;
}

.tabla-vinculacion thead {
    background-color: var(--blanco);
    border-bottom: 2px solid #000;
}

.tabla-vinculacion thead th {
    padding: 15px;
    text-align: center;
    font-weight: 600;
    font-size: 14px;
    border-right: 2px solid #000;
}

.tabla-vinculacion thead th:last-child {
    border-right: none;
}

.tabla-vinculacion tbody tr {
    border-bottom: 2px solid #000;
}

.tabla-vinculacion td {
    border-right: 2px solid #000;
    padding: 15px;
    font-size: 14px;
    line-height: 1.6;
    color: #333;
}

.tabla-vinculacion td:last-child {
    border-right: none;
}

/* Columnas específicas */
.col-ano-titulo {
    width: 50%;
    text-align: left;
}

.col-fecha {
    width: 25%;
    text-align: center;
}

.col-enlace {
    width: 25%;
    text-align: center;
}

.celda-ano-titulo {
    text-align: left;
    vertical-align: top;
}

.celda-ano-titulo strong {
    color: var(--azul-tecnm);
    font-weight: 700;
    display: block;
    margin-bottom: 8px;
}

.celda-fecha,
.celda-enlace {
    text-align: center;
    vertical-align: middle;
}

.tabla-vinculacion td a {
    color: var(--naranja-convocatoria);
    text-decoration: none;
    transition: all 0.3s ease;
    font-weight: 600;
}

.tabla-vinculacion td a:hover {
    color: var(--azul-tecnm);
    text-decoration: underline;
}

.tabla-vinculacion td a:focus {
    outline: 2px solid var(--naranja-convocatoria);
    outline-offset: 2px;
}

/* ================================================
   TABLA VINCULACIÓN - RESPONSIVE MÓVIL
   En pantallas <768px: cada fila se convierte en card con etiquetas
   ================================================ */
@media (max-width: 768px) {

    .tabla-vinculacion-container {
        overflow-x: visible;
        margin-top: 15px;
    }

    /* Tabla, thead, tbody y tr como bloques */
    .tabla-vinculacion,
    .tabla-vinculacion thead,
    .tabla-vinculacion thead tr,
    .tabla-vinculacion tbody,
    .tabla-vinculacion tr {
        display: block;
        width: 100%;
    }

    /* Encabezado oculto — las etiquetas data-label lo sustituyen */
    .tabla-vinculacion thead tr {
        display: none;
    }

    /* Cada fila = tarjeta visual */
    .tabla-vinculacion tbody tr {
        margin-bottom: 16px;
        border: 1px solid #ccc;
        border-radius: 8px;
        overflow: hidden;
        box-shadow: 0 2px 6px rgba(0,0,0,0.07);
        background: #fff;
    }

    /* Cada celda: flex con etiqueta a la izquierda y valor a la derecha */
    .tabla-vinculacion td {
        display: flex;
        align-items: flex-start;
        gap: 10px;
        padding: 10px 14px;
        border-right: none;
        border-bottom: 1px solid #eee;
        font-size: 13px;
    }

    .tabla-vinculacion td:last-child {
        border-bottom: none;
    }

    /* Etiqueta de columna en azul antes del valor */
    .tabla-vinculacion td::before {
        content: attr(data-label);
        font-weight: 800;
        color: var(--azul-tecnm);
        min-width: 55px;
        flex-shrink: 0;
        font-size: 14px;
        padding-top: 1px;
        text-transform: uppercase;
        letter-spacing: 0.5px;
    }

    /* La celda del título de la nota: el año en negrita se pasa abajo para dar espacio */
    .celda-ano-titulo {
        flex-wrap: wrap;
    }

    .celda-ano-titulo strong {
        display: block;
        width: 100%;
        margin-top: 2px;
        margin-bottom: 5px;
        font-size: 12px;
        color: #666;
        font-weight: 600;
    }

    /* El texto que sigue al strong ahora empezará en una nueva línea y ocupará todo el ancho */
    .celda-ano-titulo {
        line-height: 1.5;
    }

    /* Enlace del color naranja, no se corta */
    .tabla-vinculacion td a {
        word-break: break-all;
    }
}

/* ================================================
   TABLA RETRIBUCIÓN SOCIAL - RESPONSIVE MÓVIL
   En pantallas <768px: cada fila se convierte en card vertical
   ================================================ */
@media (max-width: 768px) {
    /* Tabla como bloques */
    .tabla-retribucion,
    .tabla-retribucion thead,
    .tabla-retribucion thead tr,
    .tabla-retribucion tbody,
    .tabla-retribucion tr {
        display: block;
        width: 100%;
    }

    /* Ocultar encabezados originales */
    .tabla-retribucion thead tr {
        display: none;
    }

    /* Fila como tarjeta (card) */
    .tabla-retribucion tbody tr {
        margin-bottom: 20px;
        border: 1px solid var(--gris-borde);
        border-radius: 10px;
        overflow: hidden;
        box-shadow: 0 4px 6px rgba(0,0,0,0.08); /* Misma sombra de otras cards */
    }

    /* Celda de Actividad (con fondo distintivo) */
    .tabla-retribucion .celda-actividad {
        display: block;
        width: 100% !important;
        background-color: #f1f5fa; /* Fondo suave para resaltar */
        border-bottom: 2px solid var(--azul-tecnm);
        padding: 16px !important;
        text-align: center;
    }

    /* Celda de Descripción */
    .tabla-retribucion .celda-descripcion {
        display: block;
        width: 100% !important;
        padding: 18px !important;
        text-align: justify;
        background-color: #fff;
        line-height: 1.6;
    }

    /* Etiqueta visual para la descripción (usando el data-label que inyectamos) */
    .tabla-retribucion .celda-descripcion::before {
        content: attr(data-label) ": ";
        display: block;
        font-weight: 800;
        color: var(--azul-tecnm);
        text-transform: uppercase;
        font-size: 13px;
        margin-bottom: 6px;
    }
}

/* ========================================
   13. PROCESOS ADMINISTRATIVOS - DESPLEGABLES
   ======================================== */

.procesos-container {
    font-family: 'Times New Roman', serif;
    line-height: 1.8;
    color: #333;
}

.procesos-container h1 {
    font-size: 40px;
    font-weight: bold;
    color: var(--azul-tecnm);
    margin-bottom: 20px;
    border-bottom: 3px solid var(--naranja-convocatoria);
    padding-bottom: 15px;
}

.procesos-intro {
    background-color: #f0f4ff;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 30px;
}

.procesos-intro p {
    font-size: 16px;
    margin-bottom: 10px;
    line-height: 1.8;
}

.procesos-lista {
    border-left: 5px solid var(--naranja-convocatoria);
    padding-left: 12px;
    margin-bottom: 20px;
}

.proceso-btn {
    width: 100%;
    background-color: #f9f9f9;
    border: 1px solid #e0e0e0;
    padding: 15px 20px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 16px;
    font-weight: 600;
    color: var(--azul-tecnm);
    transition: all 0.3s ease;
    margin-bottom: 10px;
    border-radius: 4px;
}

.proceso-btn:hover {
    background-color: #e8f1ff;
    border-color: var(--azul-tecnm);
}

.proceso-btn:focus {
    outline: 2px solid var(--naranja-convocatoria);
    outline-offset: 2px;
}

.proceso-titulo {
    font-weight: 600;
    color: var(--azul-tecnm);
}

.proceso-icon {
    font-size: 14px;
    transition: transform 0.3s ease;
}

.proceso-contenido {
    display: none;
    background-color: #fff;
    border: 1px solid #e0e0e0;
    border-top: none;
    padding: 20px;
    margin-bottom: 10px;
    border-radius: 0 0 4px 4px;
}

.proceso-contenido.activo {
    display: block;
}

.proceso-texto h3 {
    font-size: 18px;
    font-weight: bold;
    color: var(--azul-tecnm);
    margin-top: 20px;
    margin-bottom: 10px;
}

.proceso-texto p {
    font-size: 16px;
    margin-bottom: 15px;
    text-align: justify;
    line-height: 1.8;
}

.pasos-lista {
    font-size: 16px;
    margin-bottom: 15px;
    padding-left: 20px;
}

.pasos-lista li {
    margin-bottom: 10px;
    line-height: 1.8;
}

.tabla-protocolo {
    width: 100%;
    border-collapse: collapse;
    margin: 15px 0;
    border: 1px solid #e0e0e0;
    /* Tabla se contiene dentro de su parent, el scroll lo maneja el wrapper */
    font-size: 15px;
}

.tabla-protocolo thead {
    background-color: var(--azul-tecnm);
    color: var(--blanco);
}

.tabla-protocolo th {
    padding: 12px;
    text-align: left;
    font-weight: 600;
}

.tabla-protocolo td {
    padding: 12px;
    border: 1px solid #e0e0e0;
}

.tabla-protocolo tbody tr:nth-child(even) {
    background-color: #f9f9f9;
}

/* Wrapper scrollable ELIMINADO en favor de tabla vertical en móvil */
.tabla-protocolo-wrapper {
    width: 100%;
    overflow-x: visible;
    margin: 15px 0;
}

.tabla-protocolo-wrapper .tabla-protocolo {
    margin: 0;
    border: 1px solid #e0e0e0;
    min-width: unset; /* Sin ancho mínimo — la tabla se adapta */
    word-break: break-word;
    white-space: normal;
}

/* ========================================
   RESPONSIVE MÓVIL - PROCESOS ADMINISTRATIVOS
   ======================================== */
@media (max-width: 768px) {

    .procesos-container {
        padding: 0 4px;
    }

    .procesos-container h1 {
        font-size: 26px;
        margin-bottom: 14px;
        padding-bottom: 10px;
    }

    .procesos-intro {
        padding: 14px;
        margin-bottom: 20px;
    }

    .procesos-intro p {
        font-size: 14px;
    }

    .proceso-btn {
        padding: 12px 14px;
        font-size: 14px;
    }

    .proceso-contenido {
        padding: 14px 10px;
    }

    .proceso-texto p,
    .proceso-texto li {
        font-size: 14px;
        line-height: 1.7;
    }

    .proceso-texto h3 {
        font-size: 15px;
        margin-top: 14px;
    }

    .pasos-lista {
        font-size: 14px;
        padding-left: 16px;
    }

    /* Tabla: sin scroll horizontal, texto envuelve verticalmente */
    .tabla-protocolo {
        display: block;
        width: 100%;
        font-size: 13px;
    }

    .tabla-protocolo thead,
    .tabla-protocolo tbody,
    .tabla-protocolo tr {
        display: block;
        width: 100%;
    }

    /* Cabecera oculta — la etiqueta data-label la reemplaza en móvil */
    .tabla-protocolo thead tr {
        display: none;
    }

    .tabla-protocolo td {
        display: flex;
        align-items: flex-start;
        gap: 8px;
        padding: 8px 10px;
        border: none;
        border-bottom: 1px solid #e0e0e0;
        font-size: 13px;
        word-break: break-word;
    }

    /* Etiqueta de columna antes del valor */
    .tabla-protocolo td::before {
        content: attr(data-label);
        font-weight: 700;
        color: var(--azul-tecnm);
        min-width: 90px;
        flex-shrink: 0;
        font-size: 12px;
    }

    /* Separador visual entre filas */
    .tabla-protocolo tbody tr {
        border: 1px solid #ddd;
        border-radius: 6px;
        margin-bottom: 10px;
        background: #fff;
        box-shadow: 0 1px 4px rgba(0,0,0,0.06);
    }

    .tabla-protocolo tbody tr:nth-child(even) {
        background-color: #f9f9f9;
    }
}

/* ========================================
   14. FOOTER
   ======================================== */

.footer-replica {
    background: linear-gradient(to right, #1a3668 0%, #3b5998 40%, #6b8bb2 100%);
    color: var(--blanco);
    padding: 40px 0;
    font-size: 14px;
}

.footer-flex-container {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    max-width: 90%;
    margin: 0 auto;
    flex-wrap: wrap;
    gap: 20px;
}

.footer-info-text {
    flex: 1;
    min-width: 300px;
    line-height: 1.6;
}

.footer-info-text h2,
.footer-info-text h3 {
    margin: 0 0 8px 0;
}

.footer-info-text p {
    margin: 0 0 8px 0;
}

.footer-title {
    font-weight: bold;
    font-size: 16px;
    margin-bottom: 5px;
}

.footer-linea-bold {
    font-weight: bold;
    font-size: 16px;
    margin-bottom: 5px;
}

.footer-linea-bold a,
.footer-info-text a {
    color: var(--blanco);
    text-decoration: underline;
    transition: opacity 0.2s;
}

.footer-linea-bold a:hover,
.footer-info-text a:hover {
    opacity: 0.8;
}

.footer-linea-bold a:focus,
.footer-info-text a:focus {
    outline: 2px solid var(--blanco);
    outline-offset: 2px;
}

.footer-map-container {
    flex: 0 0 350px;
    height: 200px;
}

.footer-map-container iframe {
    border: none;
    border-radius: 4px;
}

.footer-credits {
    font-size: 0.85rem;
    color: #888;
    margin-top: 15px;
    font-style: italic;
}

.footer-credits strong {
    color: #666;
    font-weight: 600;
}

/* ========================================
   15. ANIMACIONES
   ======================================== */

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fade-in {
    animation: fadeIn 0.4s ease-out;
}

.animate-slide-down {
    animation: slideDown 0.5s ease-out forwards;
}

/* ========================================
   16. MEDIA QUERIES - RESPONSIVE
   ======================================== */

/* Pantallas Large - 1199px y menor */
@media (max-width: 1199px) {
    .header-content {
        gap: 12px;
    }

    .brand-text .title-top {
        font-size: 12px;
    }

    .brand-text .title-mid {
        font-size: 13px;
    }

    .brand-text .title-bottom {
        font-size: 9px;
    }

    .menu-central-container {
        gap: 20px;
        height: 55px;
    }

    .nav-link-inline {
        padding: 8px 6px;
        font-size: 0.8rem;
    }

    .nav-link-inline span {
        font-size: 0.7rem;
    }

    .nav-link-inline i {
        font-size: 1rem;
    }

    .logo-principal {
        height: 60px;
    }

    .logo-secundario {
        width: 180px;
    }
}

/* Tablets - 768px y menor */
@media (max-width: 768px) {
    .top-header {
        padding: 6px 0;
    }

    .header-content {
        flex-direction: row; /* Fuerza la horizontal! */
        justify-content: space-between;
        align-items: center;
        gap: 5px;
    }

    .brand-container {
        gap: 6px;
        order: 1;
        flex: 0 0 auto;
    }

    .logo-principal {
        height: 40px;
    }

    .brand-text .title-top {
        font-size: 10px;
    }

    .brand-text .title-mid {
        font-size: 11px;
    }

    .brand-text .title-bottom {
        font-size: 8px;
        display: none; /* Empezar a ocultar texto para dar lugar */
    }

    .menu-central-container {
        gap: 10px;
        height: 45px;
        order: 2;
        flex: 1;
        justify-content: center;
        /* Omitido el width 100% */
    }

    .nav-link-inline {
        padding: 6px 4px;
        font-size: 0.7rem;
    }

    .nav-link-inline span {
        font-size: 0.6rem;
    }

    .nav-link-inline i {
        font-size: 0.85rem;
        margin-bottom: 1px;
    }

    .language-selector {
        gap: 4px;
        order: 3;
    }

    .language-selector label.flag-btn {
        height: 24px;
        width: 36px;
    }

    .logo-secundario {
        width: 120px;
        order: 4;
    }
}

/* Móviles - 576px y menor */
@media (max-width: 575px) {
    .top-header {
        padding: 2px 0; /* Reducir el contorno/altura del header */
    }

    .header-content {
        flex-direction: row !important;
        flex-wrap: nowrap !important;
        justify-content: space-between !important;
        align-items: center;
        gap: 5px;
    }

    .brand-container {
        order: 1;
        width: auto;
        flex: 0 0 auto;
        margin-left: 5px;
    }

    .brand-text {
        display: none !important; /* Ocultar texto para que todo quepa horizontalmente */
    }

    .logo-principal {
        height: 38px !important; /* Logo más chico pegado a la izquierda */
    }

    .menu-central-container {
        order: 2;
        width: auto;
        flex: 1;
        flex-wrap: nowrap !important;
        justify-content: center;
        gap: 8px !important;
        padding: 0;
        height: auto;
    }

    .nav-link-inline {
        padding: 4px 6px;
        font-size: 0.8rem !important; /* Textos de botones más grandes */
    }

    .nav-link-inline span {
        font-size: 0.65rem !important;
    }

    .nav-link-inline i {
        font-size: 1rem !important;
        margin-bottom: 0;
    }

    .language-selector {
        order: 3;
        width: auto;
        flex: 0 0 auto;
        gap: 4px !important;
        padding: 0;
        margin-right: 5px;
    }

    .language-selector label.flag-btn {
        height: 18px;
        width: 27px;
    }

    .logo-secundario {
        display: block !important;
        height: 20px !important; /* Muy pequeño para que quepa */
        width: auto !important;
        order: 4;
        margin-left: 5px;
        flex: 0 0 auto;
    }
}

/* Móviles Extra Small - 360px y menor */
@media (max-width: 360px) {
    .logo-principal {
        height: 32px !important; 
    }

    .nav-link-inline {
        padding: 2px 4px;
    }

    .nav-link-inline span {
        font-size: 0.55rem !important;
    }

    .language-selector label.flag-btn {
        height: 16px;
        width: 24px;
    }
}

/* ========================================
   17. AJUSTES FINALES MÓVIL (Añadidos)
   ======================================== */
@media (max-width: 768px) {
    .hero-img {
        height: 350px !important;
    }
    
    .hero-title-overlay h1 {
        font-size: 1.5rem;
    }
    
    #panel-principal, .panel-dinamico {
        padding: 20px !important;
        min-height: auto;
        width: 100% !important;
        box-sizing: border-box;
    }
    
    .contenedor-menu-puro {
        margin-bottom: 20px;
    }

    /* Ocultar el indicador de menú porque en modo envoltura (wrap) se desfasa */
    .nav-indicator {
        display: none !important;
    }
}

@media (max-width: 480px) {
    .hero-img {
        height: 250px !important;
    }
    
    .hero-title-overlay h1 {
        font-size: 1.2rem;
    }
    
    /* Botón flotante a la izquierda y reescalado adecuado */
    .btn-flotante-naranja {
        font-size: 1rem !important;
        padding: 10px 20px !important;
        left: 5% !important;
        bottom: 10% !important;
        transform: none !important;
    }

    .btn-flotante-naranja:hover {
        transform: scale(1.05) !important;
    }
    
    /* Facebook botón más visible en móvil */
    .btn-facebook-sobre-portada {
        width: 80px !important;
        bottom: 8% !important;
        right: 5% !important;
        transform: none !important;
    }
    
    /* La tabla de tutorías ahora se trabaja con media query propia — sin scroll horizontal */
    .tabla-tutorias-container {
        overflow-x: visible;
    }
    
    /* Tabla vinculación: ahora usa media query propia, sin scroll horizontal */
    .tabla-vinculacion-container {
        overflow-x: visible;
    }
    
    /* Hacer el iframe del mapa más pequeño en celular */
    .footer-map-container {
        height: 150px !important;
        flex: 1 1 100% !important;
    }

    /* Tablas de Instalaciones (LGAC) - Sin scroll horizontal, formato vertical */
    #instalaciones-section .table-responsive {
        overflow-x: visible !important;
    }

    #instalaciones-section table,
    #instalaciones-section thead,
    #instalaciones-section tbody,
    #instalaciones-section tr,
    #instalaciones-section td {
        display: block !important;
        width: 100% !important;
    }

    #instalaciones-section thead {
        display: none !important; /* Ocultar encabezados (Fotografía, Descripción) */
    }

    #instalaciones-section tr {
        margin-bottom: 20px;
        border: 2px solid var(--azul-tecnm) !important;
        border-radius: 8px;
        overflow: hidden;
        background-color: var(--blanco) !important;
        box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    }

    /* Celda de la foto */
    #instalaciones-section td:first-child {
        border: none !important;
        border-bottom: 2px solid var(--azul-tecnm) !important;
        padding: 20px !important;
        background-color: #f8f9fa !important;
    }

    /* Celda de la descripción */
    #instalaciones-section td:last-child {
        border: none !important;
        padding: 20px !important;
    }

    #instalaciones-section td img {
        max-width: 100% !important;
        height: auto !important;
        margin: 0 auto !important;
        display: block !important;
        border-radius: 4px;
    }
}