/* =========================================
   1. VARIABLES Y GLOBAL
   ========================================= */
   :root {
    --bg-white: #fefffe;
    --bg-black: #01161e;
    --primary: #124559;
    --secondary: #aec3b0;
    --light-green: #eff6e0;
    --gray: #e0e1dd;
}
html, body {
    max-width: 100% !important;
    overflow-x: hidden !important;
    position: relative; /* Ayuda a contener elementos absolutos */
    overscroll-behavior-y: none;
}
html {
    scroll-behavior: smooth;
    scroll-padding-top: 100px;
    background-color: var(--bg-black); 
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg-white);
    font-family: "Montserrat", sans-serif;
    background-color: var(--bg-white);
    color: var(--bg-black);
    
    /* Configuración para Footer siempre abajo */
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    overflow-x: hidden; /* IMPORTANTE: Previene desborde horizontal */
}

main {
    flex: 1 0 auto;
    width: 100%;
    display: flex;
    flex-direction: column;
}

/* =========================================
   2. CLASES DE ESTRUCTURA (Layout Fix)
   ========================================= */

/* CONTACTO: Ocupa todo el espacio */
.flex-grow-section {
    flex: 1;
    display: flex;
    flex-direction: column;
}
.flex-grow-section > .row {
    flex: 1;
    width: 100%;
    margin: 0;
}

/* GALERÍA: Centrado vertical (Solo Desktop) */
.centered-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 60px 0;
}

/* Columnas de Contacto */
.contact-info-column {
    background: linear-gradient(135deg, var(--bg-black), var(--primary));
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
}
.contact-form-column {
    background-color: white;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* =========================================
   3. ESTILOS GENERALES Y COMPONENTES
   ========================================= */
.section-padding { padding: 80px 0; }
.text-primary { color: var(--primary) !important; }
.rounded-4 { border-radius: 1rem !important; }
.shadow { box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15) !important; }

/* Títulos */
.section-title h2, .main-title {
    font-weight: 700;
    color: var(--bg-black);
    font-size: 45px;
    margin: 0 0 15px;
    border-left: 5px solid var(--primary);
    padding-left: 15px;
}
.section-title h3 {
    font-weight: 350;
    font-size: 30px;
    margin: 0 0 15px;
    border-left: 5px solid var(--primary);
    padding-left: 15px;
}
.page-header { background-color: #f8f9fa; }
.main-title {
    background: linear-gradient(135deg, var(--bg-black), var(--primary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    border: none; padding: 0;
}

/* Botón Hero */
.btn-hero {
    background: linear-gradient(45deg, var(--primary), var(--secondary));
    color: white; font-weight: 600; border: none; padding: 10px 30px;
    transition: 0.3s; letter-spacing: 1px;
}
.btn-hero:hover {
    background: linear-gradient(45deg, #1a252f, #2980b9);
    color: white; transform: translateY(-2px); box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

/* NAVBAR */
.navbar { background-color: white; box-shadow: 0 2px 20px rgba(0, 0, 0, 0.137); }
.navbar-brand img { max-height: 60px; width: auto; }

.navbar .nav-link.btn {
    background-color: transparent !important; color: var(--bg-black) !important;
    border: none !important; font-weight: 500 !important; box-shadow: none !important;
    transition: transform 0.3s ease, text-shadow 0.3s ease;
}
.navbar .nav-link.btn:hover {
    transform: translateY(-3px);
    text-shadow: 0px 4px 6px rgba(0, 0, 0, 0.3);
    background-color: transparent !important; color: var(--bg-black) !important;
    font-weight: 500 !important;
}
.navbar .nav-link.btn:active, .navbar .nav-link.btn:focus {
    background-color: transparent !important; color: var(--bg-black) !important;
    box-shadow: none !important; transform: translateY(0);
}

/* FORMULARIOS */
.form-control, .form-select {
    border-radius: 0; border: none; border-bottom: 2px solid var(--gray);
    padding: 12px 15px; background-color: transparent;
}
.form-control:focus, .form-select:focus { box-shadow: none; border-color: var(--primary); }
.form-label { letter-spacing: 1px; font-size: 0.75rem; font-weight: bold; color: #6c757d; }

/* SECCIONES HOME */
.hero-section { position: relative; height: 80vh; width: 100%; overflow: hidden; background-color: var(--bg-black); }
.hero-bg-image { width: 100%; height: 100%; object-fit: cover; opacity: 0.5; }
.hero-content { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); text-align: center; color: white; width: 90%; z-index: 10; }

.feature-box-1 {
    padding: 32px; margin: 10px; position: relative; z-index: 1;
    box-shadow: 0 0 30px rgba(1, 22, 30, 0.1); border-radius: 10px; overflow: hidden;
    background: white; transition: ease all 0.35s; height: 100%;
}
.feature-box-1 .icon {
    width: 70px; height: 70px; line-height: 70px; background: var(--primary);
    color: var(--light-green); text-align: center; border-radius: 50%;
    margin-bottom: 22px; font-size: 27px; transition: 0.3s;
}
.feature-box-1:hover:after { content: ""; position: absolute; top: 0; bottom: 0; left: 0; right: 0; background: var(--primary); z-index: -1; width: 100%; }
.feature-box-1:hover h5, .feature-box-1:hover p { color: var(--light-green) !important; }
.feature-box-1:hover .icon { background: rgba(255,255,255,0.2); color: var(--light-green); }

/* ESTILOS INTERNOS CONTACTO */
.contact-info-home { background: linear-gradient(135deg, var(--bg-black), var(--primary)); padding: 40px; color: var(--light-green); height: 100%; }
.contact-wrapper { background: var(--bg-white); border-radius: 20px; overflow: hidden; box-shadow: 0 5px 30px rgba(1, 22, 30, 0.15); }
.contact-item { display: flex; align-items: center; }
.contact-icon {
    width: 45px; height: 45px; background: rgba(255, 255, 255, 0.1);
    border-radius: 50%; display: flex; align-items: center; justify-content: center;
    margin-right: 20px; flex-shrink: 0; transition: all 0.3s ease;
}
.contact-item:hover .contact-icon { background: white; transform: scale(1.1); }
.contact-item:hover .contact-icon i { color: var(--primary); }

/* FOOTER */
.footer { background: var(--bg-black); padding: 40px 0 20px; color: var(--light-green); margin-top: auto; }
.footer-logo { max-height: 60px; width: auto; }
.footer-links { list-style: none; padding: 0; display: flex; gap: 15px; }
.footer-links a { color: #6c757d; text-decoration: none; transition: 0.3s; font-size: 0.85rem;}
.footer-links a:hover { color: var(--primary); }
.social-icon, .social-link {
    width: 35px; height: 35px; border: 1px solid rgba(255,255,255,0.3);
    border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
    margin-right: 10px; color: #6c757d; text-decoration: none; transition: 0.3s;
}
.social-icon:hover, .social-link:hover { background: white; color: var(--primary); }

/* WHATSAPP */
.btn-wsp {
    position: fixed; bottom: 20px; right: 20px; z-index: 9999;
    width: 60px; height: 60px; border-radius: 50%; background-color: #124559;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3); animation: breathe 2s ease-in-out infinite;
}
.btn-wsp i { color: #fff; font-size: 24px; }
@keyframes breathe { 0%, 100% { box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.5); } 70% { box-shadow: 0 0 0 15px rgba(37, 211, 102, 0); } }

/* =========================================
   RESPONSIVE OPTIMIZATIONS (FIX CRÍTICO)
   ========================================= */
@media (max-width: 992px) {
    .section-padding { padding: 3rem 0; }
    .contact-info-column, .contact-form-wrapper { padding: 40px 20px !important; min-height: auto; }
    .mobile-padding { padding: 40px 20px !important; }
    
    /* FIX: Desactivar flex-grow forzado en móvil para evitar huecos blancos */
    .flex-grow-section, 
    .centered-section { 
        flex: 0 0 auto; 
        min-height: auto; 
        display: block; /* Importante: Block normal, no flex */
        padding: 40px 0;
    }
    
    .navbar-collapse { text-align: center; padding-bottom: 1rem; }
    .navbar-nav { gap: 10px; }
}

@media (max-width: 768px) {
    .hero-section { height: 60vh; }
    .display-2 { font-size: 2.5rem; word-wrap: break-word; }
    .section-title h2, .main-title { font-size: 1.8rem; }
    .w-75 { width: 95% !important; }
    .footer-links { justify-content: center !important; margin-top: 20px; }
    .footer .text-md-end { text-align: center !important; }
    .social-links { text-align: center; }
    .row{margin-right: 0 !important; margin-left: 0 !important; }
}