/* ======== VARIABLES DE COLOR Y FUENTES ======== */
:root {
    --color-verde-oscuro: #1A3A1A;
    --color-verde-medio: #3D8C40;
    --color-verde-aguara: #2ecc71; /* Verde brillante estilo Aguará */
    --color-azul-utmb: #002D54;
    --color-gradiente: linear-gradient(90deg, #d4a373, #31c4b9);
    --bg-dark: #0a0a0a;
    --color-texto-claro: #F0F0F0;
    --color-texto-oscuro: #121212;
    --font-principal: 'Outfit', sans-serif;
}

/* ======== ESTILOS GENERALES Y PREVENIR SCROLL HORIZONTAL ======== */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}
html, body {
    scroll-behavior: smooth;
    overflow-x: hidden; /* Fundamental para evitar que se mueva a los lados en el celular */
    width: 100%;
}
body {
    font-family: var(--font-principal);
    background-color: var(--color-texto-claro);
    color: var(--color-texto-oscuro);
    line-height: 1.6;
}
.container {
    max-width: 1100px;
    margin: auto;
    padding: 0 2rem;
}

/* ======== NAVBAR FLOTANTE ESTILO PÍLDORA ======== */
.navbar {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: 95%;
    max-width: 1200px;
    background: rgba(255, 255, 255, 0.05); 
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 100px; 
    padding: 10px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 1000;
    transition: all 0.4s ease-in-out;
}
.nav-logo { width: 80px; height: auto; transition: transform 0.3s ease; }
.nav-logo:hover { transform: scale(1.05); }
.nav-menu { display: flex; list-style: none; gap: 1.5rem; }
.nav-menu li a { color: var(--color-texto-claro); text-decoration: none; font-weight: 700; font-size: 0.85rem; padding-bottom: 5px; border-bottom: 2px solid transparent; transition: border-bottom 0.3s ease, transform 0.3s ease; text-transform: uppercase; letter-spacing: 1px;}
.nav-menu li a:hover { border-bottom: 2px solid var(--color-verde-aguara); transform: translateY(-2px); }

.nav-right { display: flex; align-items: center; gap: 15px; }

/* ======== HERO SECTION (PÁGINA DE INICIO) CON MALLA Y LUCES ======== */
.hero { 
    display: flex; 
    flex-direction: column; 
    align-items: center; 
    justify-content: center; 
    text-align: center; 
    height: 100vh; 
    color: var(--color-texto-claro); 
    
    background-image: 
        linear-gradient(rgba(0, 0, 0, 0.2) 1px, transparent 1px), 
        linear-gradient(90deg, rgba(0, 0, 0, 0.2) 1px, transparent 1px), 
        linear-gradient(rgba(10, 10, 10, 0.4) 0%, rgba(10, 10, 10, 0.85) 100%), 
        radial-gradient(circle at bottom left, rgba(255, 184, 77, 0.3) 0%, transparent 50%), 
        radial-gradient(circle at bottom right, rgba(255, 184, 77, 0.5) 0%, transparent 60%), 
        url('images/fondodistancias.jpg'); 

    background-size: 5px 5px, 5px 5px, 100% 100%, 100% 100%, 100% 100%, cover; 
    background-position: center; 
    background-attachment: fixed; 
}

.hero-content { max-width: 900px; width: 100%; position: relative; padding-top: 60px;}

.hero-title { font-weight: 900; text-transform: uppercase; margin: 15px 0; text-shadow: 2px 2px 10px rgba(0,0,0,0.5); line-height: 1; letter-spacing: -2px;}
.title-top { font-size: 4.5rem; color: #ffffff; }
.title-bottom { 
    font-size: 4rem; 
    background: var(--color-gradiente); 
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    display: inline-block;
}

.hero-year-small { font-size: 1.5rem; font-weight: 700; color: rgba(255, 255, 255, 0.4); margin: 25px 0; letter-spacing: 12px;}

.bottom-info-pills { display: flex; justify-content: center; gap: 15px; margin-bottom: 40px; flex-wrap: wrap;}
.info-pill { background: rgba(255, 255, 255, 0.1); padding: 10px 20px; border-radius: 30px; display: flex; align-items: center; gap: 8px; font-size: 0.95rem; font-weight: 700; border: 1px solid rgba(255,255,255,0.1); }

/* ======== BOTONES ======== */
.hero-buttons { display: flex; gap: 20px; justify-content: center; flex-wrap: wrap;}
.btn-main { background: var(--color-verde-aguara); color: #000 !important; padding: 15px 35px; border-radius: 8px; font-weight: 900; text-decoration: none; transition: all 0.3s ease; text-transform: uppercase; border: none;}
.btn-main:hover { transform: translateY(-3px); box-shadow: 0 10px 20px rgba(46, 204, 113, 0.3); background: #27ae60;}

.btn-outline { border: 2px solid rgba(255,255,255,0.3); color: white !important; padding: 13px 35px; border-radius: 8px; font-weight: 900; text-decoration: none; background: rgba(255,255,255,0.05); transition: all 0.3s ease; text-transform: uppercase;}
.btn-outline:hover { background: rgba(255,255,255,0.1); border-color: white; transform: translateY(-3px);}

/* ======== SECCIÓN "EL CIRCUITO" ======== */
.section-dark-clon { background-color: var(--bg-dark); padding: 120px 20px 80px 20px; text-align: center; color: white; }
.section-label { font-size: 0.85rem; letter-spacing: 4px; color: rgba(255,255,255,0.4); margin-bottom: 15px; font-weight: 700;}
.section-title-large { font-size: 4rem; font-weight: 900; margin-bottom: 30px; letter-spacing: -1px; text-transform: uppercase;}
.gradient-text { background: var(--color-gradiente); -webkit-background-clip: text; -webkit-text-fill-color: transparent;}
.section-description { max-width: 700px; margin: 0 auto; font-size: 1.15rem; line-height: 1.8; color: rgba(255,255,255,0.6); }

/* ======== ENCABEZADOS DE PÁGINAS INTERNAS ======== */
.page-header { 
    text-align: center; 
    padding: 140px 20px 80px 20px; 
    color: var(--color-texto-claro); 
    background-image: 
        linear-gradient(rgba(10, 10, 10, 0.6) 0%, rgba(10, 10, 10, 0.9) 100%), 
        radial-gradient(circle at bottom left, rgba(255, 184, 77, 0.2) 0%, transparent 50%), 
        radial-gradient(circle at bottom right, rgba(255, 184, 77, 0.4) 0%, transparent 60%), 
        url('images/fondodistancias.jpg'); 
    background-size: 100% 100%, 100% 100%, 100% 100%, cover; 
    background-position: center; 
    background-attachment: fixed; 
}
.page-header h1 { font-size: 3.5rem; font-weight: 900; text-transform: uppercase; text-shadow: 2px 2px 15px rgba(0,0,0,0.7); margin-bottom: 10px; }
.page-header p { font-size: 1.4rem; color: rgba(255,255,255,0.8); max-width: 800px; margin: 0 auto; }

.content-section { padding: 5rem 0; }
.content-section h2 { font-size: 2.5rem; margin-bottom: 1.5rem; font-weight: 900; text-align: center; }
.dark-bg { background-color: var(--color-verde-oscuro); color: var(--color-texto-claro); }

/* ======== TARJETAS GLOBALES (DISTANCIAS, CERTIFICACIONES, ETC) ======== */
.grid-distancias { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 40px; max-width: 1200px; margin: 0 auto; padding: 0 20px; position: relative; z-index: 10; }
.card-distancia { border-radius: 20px; overflow: hidden; box-shadow: 0 15px 35px rgba(0,0,0,0.2); transition: all 0.4s ease; display: flex; flex-direction: column; }
.card-distancia:hover { transform: translateY(-10px); box-shadow: 0 20px 45px rgba(0,0,0,0.4); border-color: var(--color-verde-aguara) !important; }
.card-img-container { position: relative; height: 350px; overflow: hidden; background: #222; }
.card-img-container img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s ease; }
.card-distancia:hover .card-img-container img { transform: scale(1.05); }

/* ======== SECCIONES INTERNAS ======== */
.about-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 3rem; align-items: center; }
.about-image { width: 100%; border-radius: 15px; box-shadow: 0 10px 20px rgba(0,0,0,0.1); }
.pilares-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2rem; margin-top: 3rem; }
.pilar-card { text-align: center; padding: 2rem; background: #fff; border-radius: 15px; box-shadow: 0 10px 20px rgba(0,0,0,0.05); transition: transform 0.3s ease; }
.pilar-card:hover { transform: translateY(-5px); }
.pilar-card i { font-size: 3rem; margin-bottom: 1rem; color: var(--color-verde-medio); }

.info-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 2rem; margin-top: 2rem; }
.info-card { background: #fff; padding: 2rem; border-radius: 15px; text-align: center; border: 1px solid #eee; box-shadow: 0 10px 20px rgba(0,0,0,0.05); transition: all 0.3s ease;}
.info-card:hover { transform: translateY(-5px); box-shadow: 0 15px 35px rgba(0,0,0,0.1); border-color: var(--color-verde-medio); }
.info-card i { font-size: 2.5rem; color: var(--color-verde-medio); margin-bottom: 1rem; }

.dark-bg-section { background-color: var(--color-verde-oscuro); color: var(--color-texto-claro); padding: 4rem 2rem; margin: 4rem -2rem; border-radius: 15px; }
.dark-bg-section .info-card { background: rgba(255, 255, 255, 0.05); border: 1px solid rgba(255, 255, 255, 0.2); color: var(--color-texto-claro);}
.dark-bg-section .info-card i { color: var(--color-texto-claro); }

.map-container { position: relative; padding-bottom: 56.25%; height: 0; overflow: hidden; max-width: 100%; margin-top: 2rem; border-radius: 15px; box-shadow: 0 10px 30px rgba(0,0,0,0.1); }
.map-container iframe { position: absolute; top: 0; left: 0; width: 100%; height: 100%; }

.certification-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; }
.certification-card { background: #fff; border: 1px solid #eee; border-radius: 15px; padding: 2.5rem 2rem; box-shadow: 0 10px 30px rgba(0,0,0,0.05); display: flex; flex-direction: column; text-align: center; transition: all 0.3s ease; }
.certification-card:hover { transform: translateY(-10px); box-shadow: 0 15px 35px rgba(0,0,0,0.1); }
.certification-logo { max-height: 60px; width: auto; margin: 0 auto 1.5rem auto; object-fit: contain; }
.certification-list { list-style: none; padding: 0; margin: 1rem 0 2rem 0; text-align: center; }
.certification-list li { margin-bottom: 0.5rem; }

.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; margin-bottom: 4rem; }
.contact-card { background-color: #ffffff; padding: 2.5rem 2rem; border-radius: 15px; text-align: center; box-shadow: 0 10px 20px rgba(0,0,0,0.05); border: 1px solid #eee; transition: all 0.3s ease;}
.contact-card:hover { transform: translateY(-5px); box-shadow: 0 15px 30px rgba(0,0,0,0.1); border-color: var(--color-verde-medio);}

.hub-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; margin-top: 2rem; }
.hub-card { background-color: #fff; padding: 2.5rem; border-radius: 15px; text-align: center; border: 1px solid #eee; box-shadow: 0 10px 30px rgba(0,0,0,0.05); text-decoration: none; color: var(--color-texto-oscuro); transition: all 0.3s ease; display: block;}
.hub-card:hover { transform: translateY(-10px); box-shadow: 0 15px 35px rgba(0,0,0,0.1); border-color: var(--color-verde-medio); }
.hub-card i { font-size: 3rem; color: var(--color-verde-medio); margin-bottom: 1rem; }

/* ======== ANIMACIONES ======== */
.fade-in { opacity: 0; transform: translateY(40px); transition: opacity 0.8s ease-out, transform 0.8s ease-out; }
.fade-in.is-visible { opacity: 1; transform: translateY(0); }

/* ======== RESPONSIVE Y MENÚ HAMBURGUESA ======== */
.hamburger-menu { display: none; cursor: pointer; flex-direction: column; gap: 5px; z-index: 1001; }
.hamburger-menu .bar { display: block; width: 25px; height: 3px; background-color: var(--color-texto-claro); transition: all 0.3s ease-in-out; }

/* Para Tablets y pantallas medianas */
@media (max-width: 992px) {
    /* El menú pasa a ser una barra fija arriba para no molestar */
    .navbar { 
        width: 100% !important; 
        max-width: 100% !important; 
        top: 0 !important; 
        left: 0 !important; 
        transform: none !important; 
        border-radius: 0 !important; 
        background-color: rgba(10, 10, 10, 0.95) !important; 
        padding: 15px 20px !important;
        border: none !important;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
    }
    
    /* El menú desplegable */
    .nav-menu { 
        position: fixed; 
        left: -100%; 
        top: 60px; 
        flex-direction: column; 
        background-color: rgba(10,10,10,0.98); 
        width: 100%; 
        height: 100vh;
        text-align: center; 
        transition: 0.4s; 
        gap: 0; 
        padding-top: 2rem; 
        border-radius: 0;
    }
    .nav-menu li { padding: 1.5rem 0; width: 100%; }
    .nav-menu li a { font-size: 1.2rem; }
    .nav-menu.active { left: 0; }
    
    .hamburger-menu { display: flex; }
    .hamburger-menu.active .bar:nth-child(2) { opacity: 0; }
    .hamburger-menu.active .bar:nth-child(1) { transform: translateY(8px) rotate(45deg); }
    .hamburger-menu.active .bar:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }
}

/* Para Celulares */
@media (max-width: 768px) {
    /* Achicamos los textos gigantes para que entren en la pantalla */
    .title-top { font-size: 2.2rem; line-height: 1.2; display: block; }
    .title-bottom { font-size: 2rem; line-height: 1.2; }
    .hero-year-small { font-size: 1.2rem; letter-spacing: 5px; margin: 15px 0; }
    .section-title-large { font-size: 2.2rem; }
    .page-header h1 { font-size: 2.5rem; }
    
    /* Acomodamos las píldoras de información */
    .bottom-info-pills { flex-direction: column; align-items: center; gap: 10px; padding: 0 20px; }
    .info-pill { width: 100%; justify-content: center; font-size: 0.85rem; }

    /* Acomodamos los botones */
    .hero-buttons { flex-direction: column; width: 100%; padding: 0 20px; gap: 15px; }
    .btn-main, .btn-outline { width: 100%; padding: 15px; font-size: 1rem; }
    
    /* Todas las grillas pasan a 1 sola columna */
    .grid-distancias, .about-grid, .pilares-grid, .info-grid, .certification-grid, .contact-grid, .hub-grid { 
        grid-template-columns: 1fr; 
        gap: 20px;
    }
    
    .hero-content { padding-top: 80px; }
    .section-dark-clon { padding: 80px 20px 60px 20px; }
}

/* ======== FOOTER ======== */
footer { text-align: center; padding: 2rem; background: var(--color-texto-oscuro); color: var(--color-texto-claro); }