/* =========================================
   1. VARIABLES Y BASE
   ========================================= */
:root {
    --ipx-blue: #0a1f44;
    --ipx-yellow: #FDCC02; /* Amarillo Institucional */
    --ipx-white: #ffffff;
    --ipx-light: #f8f9fa;
    --ipx-grey: #e9ecef;
    --text-dark: #333;
    
    --font-heading: 'Montserrat', sans-serif;
    --font-body: 'Lato', sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { font-family: var(--font-body); line-height: 1.6; color: var(--text-dark); overflow-x: hidden; background-color: #f9f9f9; }

h1, h2, h3, h4 { font-family: var(--font-heading); font-weight: 700; color: var(--ipx-blue); margin-bottom: 15px;}
a { text-decoration: none; color: inherit; transition: 0.3s; }
ul { list-style: none; }
img { max-width: 100%; display: block; }

/* =========================================
   2. UTILIDADES Y BOTONES
   ========================================= */
.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }
.section-padding { padding: 80px 0; }
.text-center { text-align: center; }
.highlight { color: var(--ipx-yellow); }
.small-note { font-size: 0.85rem; color: #666; display: block; margin-top: 8px; }

/* BOTONES FINOS */
.btn { 
    display: inline-flex; 
    align-items: center;
    justify-content: center;
    padding: 12px 28px; 
    border-radius: 5px; 
    font-weight: 700; 
    cursor: pointer; 
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border: 2px solid transparent; 
    transition: all 0.3s ease;
    text-align: center;
    line-height: 1.2;
}

.btn-gold { 
    background-color: var(--ipx-yellow); 
    color: var(--ipx-blue); 
    border-color: var(--ipx-yellow); 
}
.btn-gold:hover { 
    background-color: transparent; 
    color: var(--ipx-blue); 
    border-color: var(--ipx-blue);
}

.btn-outline { 
    background-color: transparent; 
    color: var(--ipx-white); 
    border: 2px solid var(--ipx-white); 
}
.btn-outline:hover { 
    background-color: var(--ipx-white); 
    color: var(--ipx-blue); 
}

/* =========================================
   3. ENCABEZADO (ALINEACIÓN CORREGIDA)
   ========================================= */
.top-bar { 
    background-color: var(--ipx-blue); 
    color: #ccc; 
    padding: 4px 0; /* MÁS DELGADA */
    font-size: 0.85rem; 
}

.top-bar .container { 
    display: flex; 
    justify-content: flex-start; /* Alineado a la izquierda */
    gap: 25px; 
    align-items: center; /* ESTO CENTRA EL CORREO VERTICALMENTE */
    flex-wrap: wrap;
}

/* Asegura que tanto enlaces como textos se alineen bien */
.top-bar a, .top-bar span { 
    color: #fff; 
    display: flex; 
    align-items: center; 
    gap: 6px; 
    text-decoration: none;
}
.top-bar a:hover { color: var(--ipx-yellow); }
.top-bar i { color: var(--ipx-yellow); font-size: 0.9rem; }

/* HEADER */
#navbar { 
    background-color: var(--ipx-white); 
    box-shadow: 0 4px 12px rgba(0,0,0,0.05); 
    position: sticky; 
    top: 0; 
    z-index: 1000; 
}

.nav-container { 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    height: 90px; 
    padding: 0 20px; 
}

.logo img { max-height: 70px; width: auto; }

.nav-links { display: flex; gap: 25px; align-items: center; }
.nav-links a { font-weight: 600; color: var(--ipx-blue); font-size: 1rem; }
.nav-links a:hover { color: var(--ipx-yellow); }

.btn-nav { 
    background-color: var(--ipx-blue); 
    color: var(--ipx-white) !important; 
    padding: 10px 20px; 
    border-radius: 4px; 
}
.btn-nav:hover { background-color: var(--ipx-yellow); color: var(--ipx-blue) !important; }

.hamburger { display: none; font-size: 1.8rem; color: var(--ipx-blue); cursor: pointer; }

@media (max-width: 992px) {
    .nav-container { height: auto; padding: 15px 20px; }
    .logo img { max-height: 50px; }
    .hamburger { display: block; }
    .nav-links { 
        position: fixed; top: 120px; left: -100%; 
        background-color: var(--ipx-white); width: 100%; 
        flex-direction: column; padding: 30px 0; 
        box-shadow: 0 5px 10px rgba(0,0,0,0.1); 
        transition: left 0.4s ease; 
    }
    .nav-links.active { left: 0; }
}

/* =========================================
   4. HERO SECTION
   ========================================= */
.hero, .landing-hero {
    position: relative;
    height: 85vh;
    min-height: 600px;
    display: flex;
    align-items: center;
    overflow: hidden;
}

.hero-slider, .slide { position: absolute; top: 0; left: 0; width: 100%; height: 100%; }
.slide { background-size: cover; background-position: center; opacity: 0; transition: opacity 1s ease-in-out; z-index: 1; }
.slide.active { opacity: 1; }

.hero-overlay {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background: linear-gradient(120deg, rgba(10,31,68,0.9) 0%, rgba(10,31,68,0.75) 50%, rgba(10,31,68,0.4) 100%);
    z-index: 2;
}

.hero-content {
    display: flex !important;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    width: 100% !important;
    max-width: 1200px !important;
    margin: 0 auto;
    position: relative;
    z-index: 5;
    padding: 0 20px;
}

.hero-text-col { flex: 1; max-width: 650px; text-align: left; z-index: 10; }

.hero h1, .landing-hero h1 { 
    font-size: 3.2rem !important; 
    line-height: 1.15 !important; 
    margin-bottom: 20px; 
    color: #ffffff !important; 
    text-shadow: 0 2px 10px rgba(0,0,0,0.8);
}

.hero p, .landing-hero p { 
    font-size: 1.3rem !important; 
    line-height: 1.6; 
    color: #f0f0f0 !important; 
    margin-bottom: 35px; 
    text-shadow: 0 1px 5px rgba(0,0,0,0.8);
    font-weight: 300;
}

.hero-btns { display: flex; gap: 15px; flex-wrap: wrap; }

.landing-hero .hero-content { max-width: 1000px !important; margin: 0; }
.landing-hero .small-note {
    color: #ddd !important;
    background: rgba(0,0,0,0.5);
    padding: 6px 12px;
    border-radius: 4px;
    display: inline-block;
    margin-top: 20px;
}

/* =========================================
   5. BURBUJAS GIRATORIAS (HOME)
   ========================================= */
.hero-visual-col { flex: 1; position: relative; height: 500px; display: flex; align-items: center; justify-content: center; }
.bubble-container { position: relative; width: 450px; height: 450px; display: flex; align-items: center; justify-content: center; animation: orbitSpin 60s linear infinite; }
.main-circle { position: absolute; width: 260px; height: 260px; background: rgba(10, 31, 68, 0.6); border: 3px solid var(--ipx-yellow); border-radius: 50%; backdrop-filter: blur(8px); z-index: 1; background-image: url('img/retina-ipx.png'); background-size: 60%; background-position: center; background-repeat: no-repeat; box-shadow: 0 0 50px rgba(0,0,0,0.3); animation: counterSpin 60s linear infinite; }
.bubble { position: absolute; background: rgba(255, 255, 255, 0.95); padding: 10px 15px; border-radius: 50px; box-shadow: 0 10px 25px rgba(0,0,0,0.2); display: flex; align-items: center; gap: 10px; font-family: var(--font-heading); font-size: 0.85rem; font-weight: 700; color: var(--ipx-blue); border-left: 5px solid var(--ipx-yellow); cursor: pointer; transition: all 0.3s ease; z-index: 10; text-decoration: none; white-space: normal; line-height: 1.2; max-width: 180px; animation: counterSpin 60s linear infinite; }
.bubble:hover { transform: scale(1.1); background: #fff; z-index: 100; box-shadow: 0 0 25px rgba(253, 204, 2, 0.6); }
.bubble i { font-size: 1.3rem; color: var(--ipx-blue); flex-shrink: 0; }
.b-pos-1 { top: 0; left: 50%; margin-left: -90px; } .b-pos-2 { top: 35%; right: -20px; } .b-pos-3 { bottom: 35%; right: -20px; } .b-pos-4 { bottom: 0; left: 50%; margin-left: -70px; } .b-pos-5 { top: 50%; left: -60px; margin-top: -20px; }
@keyframes orbitSpin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
@keyframes counterSpin { from { transform: rotate(360deg); } to { transform: rotate(0deg); } }
@media (max-width: 992px) { .hero { height: auto; padding: 80px 0; } .hero-content { flex-direction: column; text-align: center !important; } .hero-text-col { margin-bottom: 40px; } .hero-visual-col { display: none; } .hero-btns { justify-content: center; } }

/* =========================================
   6. OFERTA Y GRID (3 COLUMNAS)
   ========================================= */
.official-bar { background-color: var(--ipx-yellow); color: var(--ipx-blue); text-align: center; padding: 15px 0; font-weight: 700; }
.features { padding: 60px 0; background-color: var(--ipx-white); }
.section-title { text-align: center; font-size: 2.5rem; margin-bottom: 50px; color: var(--ipx-blue); position: relative; display: inline-block; width: 100%; }
.section-title::after { content: ''; display: block; width: 60px; height: 4px; background: var(--ipx-yellow); margin: 15px auto 0; }

.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 30px; }
@media (max-width: 992px) { .grid-3 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .grid-3 { grid-template-columns: 1fr; } }

.feature-card { text-align: center; padding: 40px 30px; border-radius: 8px; background: #fff; box-shadow: 0 10px 30px rgba(0,0,0,0.05); transition: transform 0.3s ease; border-bottom: 4px solid var(--ipx-yellow); }
.feature-card:hover { transform: translateY(-5px); }
.feature-card .icon { font-size: 3rem; color: var(--ipx-blue); margin-bottom: 20px; }

.program-card { background-color: var(--ipx-white); border-radius: 8px; overflow: hidden; box-shadow: 0 5px 15px rgba(0,0,0,0.08); transition: all 0.3s ease; position: relative; border: 1px solid #eee; }
.program-card:hover { transform: translateY(-5px); box-shadow: 0 15px 30px rgba(10,31,68,0.15); }
.card-img { height: 220px; background-size: cover; background-position: center; }
.card-body { padding: 25px; }
.badge { position: absolute; top: 15px; right: 15px; z-index: 20; display: inline-block; padding: 6px 12px; font-size: 0.75rem; font-weight: 700; border-radius: 4px; box-shadow: 0 2px 5px rgba(0,0,0,0.3); text-transform: uppercase; }
.badge-blue { background-color: var(--ipx-blue); color: var(--ipx-white); }
.badge-gold { background-color: var(--ipx-yellow); color: var(--ipx-blue); }
.badge-dark { background-color: #333; color: var(--ipx-white); }
.btn-text { color: var(--ipx-blue); font-weight: 700; text-transform: uppercase; font-size: 0.9rem; }
.btn-text:hover { color: var(--ipx-yellow); text-decoration: none; }

/* =========================================
   7. FORMULARIO LANDING
   ========================================= */
.form-card { background: #ffffff; padding: 30px; border-radius: 12px; box-shadow: 0 10px 30px rgba(0,0,0,0.1); border: 1px solid #e0e0e0; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
.form-grid .full { grid-column: span 2; }
.form-grid label { display: block; margin-bottom: 6px; font-weight: 700; font-size: 0.9rem; color: var(--ipx-blue); }
.form-grid input, .form-grid textarea, .form-grid select { width: 100%; padding: 12px 14px; border: 1px solid #ccc; border-radius: 6px; font-family: var(--font-body); font-size: 1rem; background-color: #fff; }
.form-grid input:focus, .form-grid textarea:focus { border-color: var(--ipx-blue); outline: none; box-shadow: 0 0 0 3px rgba(10,31,68,0.1); }
#servicio { background-color: #f0f2f5; color: var(--ipx-blue); font-weight: 700; cursor: default; }
.privacy { display: flex; align-items: flex-start; gap: 10px; font-size: 0.85rem; margin-top: 10px; }
.privacy input { width: auto; margin-top: 4px; }

.form-actions { display: flex; gap: 15px; flex-wrap: wrap; align-items: center; margin-top: 15px; }
#btnSubmit { background-color: var(--ipx-yellow); color: var(--ipx-blue); border: none; padding: 12px 30px; font-size: 1rem; font-weight: 700; cursor: pointer; border-radius: 5px; transition: 0.3s; }
#btnSubmit:hover { background-color: #e6b800; transform: translateY(-2px); }

aside .form-card { padding: 25px; background: #fff; position: sticky; top: 120px; }
aside h3 { font-size: 1.2rem; border-bottom: 2px solid var(--ipx-yellow); padding-bottom: 10px; margin-bottom: 15px; }

@media (max-width: 768px) {
    .form-grid { grid-template-columns: 1fr; }
    .form-grid .full { grid-column: span 1; }
    aside .form-card { position: static; margin-top: 30px; }
}

/* =========================================
   8. CTA CINEMÁTICO
   ========================================= */
.cta-cinematic {
    position: relative; padding: 100px 0; color: #fff; text-align: center;
    background-color: #0a1f44; overflow: hidden;
}
.cta-bg {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background-size: cover; background-position: center; background-attachment: fixed;
    z-index: 1; opacity: 0.6;
}
.cta-overlay {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background: linear-gradient(135deg, rgba(10,31,68,0.85) 0%, rgba(10,31,68,0.6) 100%);
    z-index: 2;
}
.cta-content { position: relative; z-index: 3; }
.cta-content h2 { color: #fff; font-size: 2.8rem; margin-bottom: 20px; }
.cta-content p { font-size: 1.3rem; color: #eee; margin-bottom: 30px; font-weight: 300; }
.cta-group { display: flex; gap: 15px; justify-content: center; flex-wrap: wrap; margin-top: 30px; }

/* =========================================
   9. VIDEOS Y TESTIMONIOS (GRID 2x2)
   ========================================= */
.testimonials-section { background-color: var(--ipx-light); padding: 80px 0; }
.video-section { background-color: var(--ipx-white); padding: 80px 0; border-top: 1px solid #ddd; }

.video-grid { 
    display: grid; 
    grid-template-columns: 1fr 1fr; 
    gap: 30px; 
    margin-top: 40px; 
}
@media (max-width: 768px) { .video-grid { grid-template-columns: 1fr; } }

.video-wrapper { position: relative; padding-bottom: 56.25%; height: 0; overflow: hidden; border-radius: 10px; box-shadow: 0 8px 20px rgba(0,0,0,0.1); background: #000; }
.video-wrapper iframe { position: absolute; top: 0; left: 0; width: 100%; height: 100%; border: 0; }

/* =========================================
   10. FOOTER
   ========================================= */
.cta-banner { background: linear-gradient(rgba(10,31,68,0.9), rgba(10,31,68,0.9)), url('img/slider-5.jpg'); background-size: cover; background-position: center; text-align: center; color: var(--ipx-white); padding: 80px 0; }
.cta-banner h2 { color: var(--ipx-white); font-size: 2.5rem; margin-bottom: 20px; }

footer { background-color: var(--ipx-blue); color: #ccc; padding-top: 60px; font-size: 0.95rem; }
.grid-4 { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 40px; margin-bottom: 40px; }
footer h4 { color: var(--ipx-white); margin-bottom: 20px; font-size: 1.1rem; }
footer ul li { margin-bottom: 10px; border-bottom: 1px solid rgba(255,255,255,0.1); padding-bottom: 5px; }
footer ul li:last-child { border: none; }
footer ul li a:hover { color: var(--ipx-yellow); }
.social-icons { margin-top: 20px; }
.social-icons a { font-size: 1.5rem; margin-right: 15px; color: var(--ipx-white); transition: color 0.3s; }
.social-icons a:hover { color: var(--ipx-yellow); }
.bottom-bar { background-color: #051024; text-align: center; padding: 20px 0; font-size: 0.9rem; }

.whatsapp-float { position: fixed; bottom: 30px; right: 30px; background-color: #25D366; color: #FFF; padding: 12px 20px; border-radius: 50px; font-weight: bold; box-shadow: 2px 2px 10px rgba(0,0,0,0.3); z-index: 9999; display: flex; align-items: center; gap: 10px; text-decoration: none; transition: all 0.3s ease; }
.whatsapp-float:hover { background-color: #128C7E; transform: scale(1.05); }
.whatsapp-float i { font-size: 24px; }

/* =======================================================
   CORRECCIÓN ESPECÍFICA PARA EL INDEX (Inicio)
   ======================================================= */

/* 1. TESTIMONIOS ESCRITOS (3 Columnas Fijas) */
.testimonial-grid {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important; /* Fuerza 3 columnas siempre */
    gap: 30px !important;
    padding: 0 20px;
}

/* 2. VIDEOS DEL INDEX (2 Columnas x 2 Filas) */
.video-grid-2x2 {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important; /* Fuerza 2 columnas */
    gap: 30px !important;
    max-width: 1000px;
    margin: 40px auto 0;
    width: 100%;
}

/* Estilo para que el video no se deforme */
.video-wrapper {
    position: relative;
    padding-bottom: 56.25%; /* Relación 16:9 Youtube */
    height: 0;
    overflow: hidden;
    border-radius: 10px;
    box-shadow: 0 8px 20px rgba(0,0,0,0.1);
    background: #000;
    width: 100%;
}

.video-wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

/* AJUSTE RESPONSIVO (Solo en celulares se pone en 1 columna) */
@media (max-width: 768px) {
    .testimonial-grid {
        grid-template-columns: 1fr !important;
    }
    .video-grid-2x2 {
        grid-template-columns: 1fr !important;
    }
}

/* =========================================
   CORRECCIÓN DE ALINEACIÓN (FORMULARIO LANDING)
   ========================================= */

/* Contenedor que divide Formulario vs Resumen */
.landing-split {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr; /* Proporción ideal */
    gap: 40px;
    align-items: start; /* Esto asegura que ambas cajas empiecen arriba */
    margin-top: 30px;
}

/* En celulares se pone una debajo de otra */
@media (max-width: 992px) {
    .landing-split {
        grid-template-columns: 1fr;
    }
    /* Quitamos el sticky en celular para que no estorbe */
    .landing-split aside .form-card {
        position: static; 
        margin-top: 30px;
    }
}