/* ==========================================================================
   1. VARIABLES Y CONFIGURACIÓN BASE
   ========================================================================== */
:root {
    --primary-color: #083060;   /* Azul oscuro corporativo */
    --secondary-color: #3D71A8; /* Azul claro para acentos */
    --terciary-color: #C22F0E;  /* Color de acento (ej. Alertas o CTAs secundarios) */
    --bg-light: #f4f5f7;        /* Fondo gris muy claro */
    --text-color: #2e2e34;      /* Color de texto principal */
    --text-color-secondary: #6c757d;      /* Color de texto secundario */
    --navbar-height: 80px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: var(--navbar-height);
}

section {
    scroll-margin-top: var(--navbar-height);
}

body {
    font-family: 'Lato', sans-serif;
    font-weight: 300;
    color: var(--text-color);
    line-height: 1.6;
    background-color: white;
}

a {
    color: var(--primary-color);
    text-decoration: none;
}

h1, h2, h3 {
    font-weight: 300;
    color: var(--primary-color);
}

/* ==========================================================================
   2. COMPONENTES Y UTILIDADES
   ========================================================================== */

/* Botones */
.btn {
    display: inline-block;
    background: var(--secondary-color);
    color: white;
    padding: 12px 30px;
    border-radius: 5px;
    text-decoration: none;
    font-weight: bold;
    margin-top: 20px;
    border: 2px solid var(--secondary-color);
    transition: all 0.3s ease;
}

.btn:hover {
    background: transparent;
    color: var(--secondary-color);
}

/* Títulos de Sección */
.section-title {
    text-align: center;
    margin-bottom: 3rem;
    font-size: 2.5rem;
    position: relative;
}

.section-title::after {
    content: '';
    width: 60px;
    height: 4px;
    background: var(--secondary-color);
    display: block;
    margin: 10px auto 0;
}

/* Textos */
.text-small {
    font-size: 0.9rem;
    color: var(--text-color);
}

/* Nav Card (Enlaces en bloques) */
.nav-card {
    text-decoration: none;
    color: inherit;
    display: block;
    height: 100%;
}

/* Estructura de Secciones Principales */
section {
    padding: 100px 5%;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
}



/* ==========================================================================
   3. NAVEGACIÓN
   ========================================================================== */
nav {
    /* La navbar es controlada principalmente por Bootstrap */
    padding: 0.5rem 5% !important;
}

/* Ajustes para el logo */
nav img {
    max-height: 80px;
    width: auto;
    transition: max-height 0.3s;
}

/* Ajustes para efecto sticky (opcional si se agrega JS) */
nav.scrolled {
    padding-top: 5px !important;
    padding-bottom: 5px !important;
}
nav.scrolled img {
    max-height: 60px;
}

/* Override de Bootstrap */
.navbar-nav .nav-link {
    font-size: 1rem;
    padding-right: 0.5rem;
    padding-left: 0.5rem;
    transition: color 0.3s ease;
}

.navbar-nav .nav-link:hover {
    color: var(--secondary-color) !important;
}

/* Contraste en hamburguesa */
.navbar-toggler {
    border: none !important;
    outline: none !important;
}

.navbar-toggler:focus {
    box-shadow: none !important;
}


/* ==========================================================================
   11. SUB-NAVEGACIÓN STICKY (SERVICIOS)
   ========================================================================== */
.sticky-sub-menu {
    position: sticky;
    top: 70px; /* Ajustado a la altura de la navbar 'scrolled' (60px img + 10px padding) */
    z-index: 990;
    background: var(--primary-color);
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    padding: 0.5rem 0;
    /* transition: top 0.3s; Si la navbar cambia de tamaño */
}

/* Ajuste para que los enlaces se vean bien */
.sticky-sub-menu .nav-link {
    color: rgba(255, 255, 255, 0.8);
    font-family: 'Lato', sans-serif;
    font-weight: 500;
    font-size: 0.8rem;
    transition: all 0.2s;
}

.text-menu {
    color: rgba(255, 255, 255, 0.8);
    font-family: 'Lato', sans-serif;
    font-weight: 500;
    font-size: 0.8rem;
    transition: all 0.2s;
}

.sticky-sub-menu .nav-link:hover, 
.sticky-sub-menu .nav-link.selected {
    color: white;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 20px;
}

@media (max-width: 991px) {
    .sticky-sub-menu {
        top: 70px; /* Ajuste para móvil si la navbar es más pequeña */
        overflow-x: auto; /* Scroll horizontal en móviles pequeños */
        white-space: nowrap;
    }
    .sticky-sub-menu .container {
        display: flex; /* Asegura flex container */
    }
    .sticky-sub-menu .nav {
        flex-wrap: nowrap; /* Evita que se rompa en varias líneas */
    }
}

/* ==========================================================================
   4. SECCIÓN INICIO (HERO)
   ========================================================================== */
#inicio {
    position: relative;
    padding: 0;
    overflow: hidden;
    color: white;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

.back-video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -2;
    object-fit: cover;
    object-position: center;
}

.video-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 43, 92, 0.6);
    z-index: 0;
}

.hero-content {
    position: relative;
    z-index: 1;
    text-align: center;
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

.hero-content h1 {
    color: white;
    font-size: 3.5rem;
    margin-bottom: 20px;
}

/* ==========================================================================
   4A. SECCIÓN MENSAJE
   ========================================================================== */
#mensaje {
    padding: 0 !important;
    min-height: auto;
    background-color: white;
}

#mensaje .img-cover {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center; /* Alineación superior para evitar cortar la cabeza */
    min-height: 400px; /* Altura mínima en móviles */
}

/* ==========================================================================
   5. SECCIÓN SERVICIOS
   ========================================================================== */
#servicios {
    background: var(--bg-light);
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
}

.service-card {
    background: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    border-top: 4px solid var(--primary-color);
    transition: transform 0.3s;
    height: 100%;
    min-height: 300px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.service-card:hover {
    transform: translateY(-5px);
}

.service-card h3 {
    margin-bottom: 15px;
    font-size: 1.2rem;
}

/* Estilos para Páginas Internas de Servicios */
.page-header {
    background: var(--primary-color);
    color: white;
    padding: 80px 5% 40px; /* Ajustado para reducir espacio visual */
    text-align: center;
    margin-bottom: 0; 
}

.page-header h1 {
    color: white;
    font-size: 2.8rem;
    margin-bottom: 0; /* Eliminar margen inferior del título */
}

.service-content {
    padding: 60px 5%;
    max-width: 1000px;
    margin: 0 auto;
}

.service-intro {
    font-size: 1.2rem;
    text-align: center;
    margin-bottom: 50px;
}

.methodology-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 40px;
}

.phase-card {
    background: var(--bg-light);
    padding: 25px;
    border-radius: 8px;
    border-left: 5px solid var(--secondary-color);
}

.phase-card h4 {
    color: var(--primary-color);
    margin-bottom: 10px;
}

/* ==========================================================================
   6. SECCIÓN EQUIPO
   ========================================================================== */
#equipo {
    text-align: center;
    background: var(--bg-light);
}

.team-info {
    max-width: 1200px;
    margin: 0 auto;
    font-size: 1.1rem;
}

.locations {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 30px;
    font-weight: bold;
    color: var(--secondary-color);
}

.team-card-img {
    height: 250px;
    object-fit: cover;
}

/* Tarjeta de Equipo y Hover Efectos */
.team-item {
    /* No 'transition' aquí para transform, se maneja abajo en las clases de animación */
}

/* Efecto Hover en la tarjeta del equipo */
/* Nota: Si hay conflicto con la animación de entrada, asegurar que la especificidad gane */
.team-item .card {
    transition: transform 0.3s ease;
}

.team-item:hover .card {
    transform: translateY(-5px);
}

/* Overlay Bio (Información oculta) */
.team-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.98);
    z-index: 10;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease-in-out;
    transform: translateY(10px);
}

.team-overlay.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* ==========================================================================
   7. SECCIÓN CLIENTES (CARRUSEL)
   ========================================================================== */
#clientes {
    padding: 60px 0;
    overflow: hidden;
    background: white;
}

#clientes .section-title {
    margin-bottom: 2rem;
}

.clients-slider {
    height: 200px;
    margin: auto;
    overflow: hidden;
    position: relative;
    width: 100%;
}

.clients-slider .slide-track {
    display: flex;
    width: max-content;
    animation: scroll 40s linear infinite;
}

.clients-slider .slide {
    height: 200px;
    width: auto;
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 20px;
}

.clients-slider img {
    height: 120px;
    width: auto;
    max-height: 120px;
    max-width: none;
    /* transition: transform 0.3s; Opcional: efecto hover */
    /* filter: grayscale(100%);  Opcional: si quieres logos en gris por defecto */
}
/*
.clients-slider img:hover {
    filter: grayscale(0); transform: scale(1.1);
}
*/

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

/* ==========================================================================
   8. SECCIÓN POSTULACIÓN (ÚNETE)
   ========================================================================== */
#postula {
    background: linear-gradient(rgba(0, 43, 92, 0.85), rgba(0, 43, 92, 0.85)), url('../img/postula.jpg');
    background-size: cover;
    background-position: center;
    color: white;
    text-align: center;
    min-height: 100vh;
}

#postula h2 {
    color: white;
}

#postula p {
    margin-bottom: 30px;
    font-size: 1.2rem;
}

/* ==========================================================================
   8. FOOTER
   ========================================================================== */
footer {
    background: #001530;
    color: #dee2e6;
    text-align: center;
    padding: 20px 5%;
    font-size: 0.85rem;
}

footer p {
    margin: 2px 0;
    font-size: inherit;
}

footer a {
    color: #dee2e6 !important;
    text-decoration: none;
    transition: color 0.3s;
}

footer a:hover {
    color: white !important;
}

/* ==========================================================================
   9. ANIMACIONES (Scroll Reveal)
   ========================================================================== */
.valor-item, .team-item {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 1s ease-out, transform 1s ease-out;
    will-change: opacity, transform;
}

.valor-item.visible, .team-item.visible {
    opacity: 1;
    transform: translateY(0); /* Vuelve a su posición original */
}

/* ==========================================================================
   10. RESPONSIVE DESIGN
   ========================================================================== */
@media (max-width: 768px) {
    /* Ocultar menú en móviles (pendiente implementación hamburguesa) */
    nav ul {
        display: none;
    }
    
    #inicio h1 {
        font-size: 2.5rem;
    }
}
