/* ==========================================================================
   Variables y Reset
   ========================================================================== */
:root {
    /* Paleta Corporativa M&V */
    --color-primary: #1A365D;   /* Azul Marino (Administración/Confianza) */
    --color-secondary: #C36A36; /* Cobre (Prevención/Acentos) */
    --color-text: #334155;      /* Gris Oscuro para legibilidad */
    --color-text-light: #64748B;
    --bg-body: #FFFFFF;
    --bg-light: #F8FAFC;        /* Gris suave para fondos de sección */
    --bg-card: #FFFFFF;
    --border-color: #E2E8F0;
    
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.1);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1);
    
    --transition: all 0.3s ease-in-out;
}

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

html {
    scroll-behavior: smooth;
    scroll-padding-top: 50px; /* Evita que la barra fije tape los títulos al hacer clic */
}

body {
    font-family: 'Montserrat', sans-serif;
    color: var(--color-text);
    background-color: var(--bg-body);
    line-height: 1.6;
    overflow-x: hidden;
}

h1, h2, h3, h4 { color: var(--color-primary); font-weight: 700; line-height: 1.2; }
a { text-decoration: none; color: inherit; }
img { max-width: 100%; height: auto; display: block; }
.container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 20px; }
.text-center { text-align: center; }
.mt-4 { margin-top: 1.5rem; }

/* ==========================================================================
   Botones Universales
   ========================================================================== */
.btn-primary {
    display: inline-block;
    background-color: var(--color-secondary);
    color: #FFF;
    padding: 10px 22px;
    border-radius: 6px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: var(--transition);
    text-align: center;
}
.btn-primary:hover {
    background-color: #A65A2E;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    color: #FFF;
}
.btn-large { padding: 15px 35px; font-size: 1.1rem; }
.btn-block { display: block; width: 100%; }

.btn-icon {
    color: var(--color-primary);
    font-size: 1.3rem;
    transition: var(--transition);
    display: flex;
    align-items: center;
}
.btn-icon:hover { color: var(--color-secondary); transform: scale(1.1); }

/* ==========================================================================
   Navegación Header (Single-Row Flexbox)
   ========================================================================== */
.navbar {
    position: fixed; 
    top: 0; 
    left: 0; 
    width: 100%;
    background-color: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    z-index: 1000;
    transition: var(--transition);
    height: 90px; /* Altura inicial generosa */
    display: flex;
    align-items: center;
}
.navbar.scrolled {
    height: 65px; /* Altura estricta al bajar */
    box-shadow: var(--shadow-sm);
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.logo img { 
    height: 65px; 
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1)); 
    transition: var(--transition);
}
.navbar.scrolled .logo img { height: 42px; } /* Achica el logo al hacer scroll */

.nav-links {
    display: flex;
    align-items: center;
    gap: 40px; /* Separación entre el menú de texto y los botones */
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 25px; /* Separación entre cada enlace */
}
.nav-link {
    font-weight: 600; 
    color: var(--color-primary);
    transition: var(--transition);
    font-size: 0.95rem;
}
.nav-link:hover { color: var(--color-secondary); }

.nav-actions {
    display: flex;
    align-items: center;
    gap: 15px; /* Separación entre el candado y el botón Contacto */
}

.menu-toggle { 
    display: none; 
    background: none; 
    border: none; 
    font-size: 1.5rem; 
    color: var(--color-primary); 
    cursor: pointer; 
}

/* ==========================================================================
   Secciones Generales
   ========================================================================== */
.section { padding: 80px 0; }
.bg-light { background-color: var(--bg-light); }
.section-header { text-align: center; margin-bottom: 50px; }
.section-header h2 { font-size: 2.5rem; margin-bottom: 10px; }
.section-header p { color: var(--color-text-light); font-size: 1.1rem; }

/* ==========================================================================
   Hero (Portada)
   ========================================================================== */
.hero {
    position: relative;
    min-height: 100vh;
    display: flex; align-items: center; justify-content: center;
    padding-top: 90px;
    text-align: center;
}
.hero-bg { position: absolute; top: 0; left: 0; width: 100%; height: 100%; z-index: -1; }
.hero-img { width: 100%; height: 100%; object-fit: cover; }
.hero-overlay {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background: linear-gradient(to right, rgba(26, 54, 93, 0.92), rgba(26, 54, 93, 0.75));
}
.hero-content { position: relative; z-index: 1; color: #FFF; max-width: 900px; }

.hero-logo-3d {
    max-width: 250px;
    margin: 0 auto 30px auto;
    display: block;
    animation: floatLogo 6s ease-in-out infinite;
    filter: drop-shadow(0 15px 25px rgba(0, 0, 0, 0.6));
}

@keyframes floatLogo {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-15px); }
    100% { transform: translateY(0px); }
}

.hero-content h1 { 
    color: #FFF; 
    font-size: 3.2rem; 
    margin-bottom: 20px; 
    line-height: 1.2;
}

.hero-description { 
    font-size: 1.15rem; 
    line-height: 1.8; 
    color: #E2E8F0;
    max-width: 800px; 
    margin: 0 auto 40px auto; 
    text-shadow: 0 2px 4px rgba(0,0,0,0.5); 
}

/* ==========================================================================
   Quiénes Somos / Institucional
   ========================================================================== */
.nosotros-wrapper { display: grid; grid-template-columns: 1.2fr 0.8fr; gap: 60px; align-items: center; }
.quienes-somos-text { font-size: 1.1rem; color: var(--color-text); margin-bottom: 40px; text-align: justify; line-height: 1.8; }

.mision-vision-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 25px; }
.mv-card { background: var(--bg-light); padding: 25px; border-radius: 10px; border-left: 4px solid var(--color-secondary); transition: var(--transition); }
.mv-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-md); background: #FFF; border: 1px solid var(--border-color); border-left: 4px solid var(--color-secondary); }
.mv-icon { color: var(--color-primary); font-size: 2rem; margin-bottom: 15px; }
.mv-card h3 { color: var(--color-primary); font-size: 1.2rem; margin-bottom: 10px; }
.mv-card p { font-size: 0.95rem; color: var(--text-main); text-align: justify; line-height: 1.6; margin-bottom: 0;}

.nosotros-imagen { position: relative; padding: 20px 20px 0 0; }
.img-decorativa { position: relative; border-radius: 10px; overflow: hidden; box-shadow: var(--shadow-lg); z-index: 2; border: 4px solid #FFF; }
.img-decorativa img { width: 100%; height: auto; display: block; transition: 0.5s; }
.img-decorativa:hover img { transform: scale(1.03); }
.img-adorno { position: absolute; top: 0; right: 0; width: 80%; height: 80%; background: var(--color-secondary); z-index: 1; border-radius: 10px; opacity: 0.15; }

/* ==========================================================================
   Servicios (Grid y Tarjetas)
   ========================================================================== */
.servicios-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}
.card-servicio {
    background: var(--bg-card); border-radius: 10px;
    overflow: hidden; box-shadow: var(--shadow-sm);
    transition: var(--transition); cursor: pointer; display: block;
}
.card-servicio:hover { transform: translateY(-5px); box-shadow: var(--shadow-lg); }
.servicio-img { position: relative; height: 200px; overflow: hidden; }
.servicio-img img { width: 100%; height: 100%; object-fit: cover; transition: var(--transition); }
.card-servicio:hover .servicio-img img { transform: scale(1.05); }
.servicio-hover {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(195, 106, 54, 0.85); color: #FFF;
    display: flex; align-items: center; justify-content: center; gap: 10px;
    opacity: 0; transition: var(--transition); font-weight: 600; font-size: 1.2rem;
}
.card-servicio:hover .servicio-hover { opacity: 1; }
.servicio-info { padding: 25px 20px; text-align: center; }
.servicio-info h3 { font-size: 1.3rem; margin-bottom: 0; }

/* Modal Servicios (GLightbox Inline) */
.modal-inline-content { padding: 30px; background: #FFF; border-radius: 10px; text-align: center; }

/* ==========================================================================
   Eventos (Swiper y Tarjetas)
   ========================================================================== */
.card-evento {
    background: var(--bg-card); border-radius: 10px;
    border: 1px solid var(--border-color); overflow: hidden;
}
.evento-img-wrapper { position: relative; height: 220px; }
.evento-img-wrapper img { width: 100%; height: 100%; object-fit: cover; }
.evento-tipo-badge {
    position: absolute; top: 15px; right: 15px;
    background: var(--color-primary); color: #FFF;
    padding: 5px 12px; border-radius: 20px; font-size: 0.8rem; font-weight: 600;
    box-shadow: var(--shadow-sm);
}
.evento-info { padding: 20px; }
.evento-info h3 { font-size: 1.2rem; margin-bottom: 10px; }
.evento-fecha { color: var(--color-secondary); font-weight: 600; font-size: 0.9rem; }
.swiper-pagination { position: relative; margin-top: 30px; }

/* ==========================================================================
   Partners (Logos Contenedor Inteligente)
   ========================================================================== */
.partner-slide { display: flex; justify-content: center; }
.partner-logo-container {
    width: 100%; aspect-ratio: 3/2; 
    background-color: #FFF; border-radius: 8px;
    border: 1px solid var(--border-color);
    padding: 20px; display: flex; align-items: center; justify-content: center;
    transition: var(--transition);
}
.partner-logo-container img {
    max-width: 100%; max-height: 100%;
    object-fit: contain; filter: grayscale(100%); transition: var(--transition); opacity: 0.6;
}
.partner-logo-container:hover { border-color: var(--color-secondary); }
.partner-logo-container:hover img { filter: grayscale(0%); opacity: 1; transform: scale(1.05); }

/* ==========================================================================
   Contacto
   ========================================================================== */
.contacto-wrapper { display: grid; grid-template-columns: 1fr 1fr; gap: 50px; align-items: start; }
.contacto-info h2 { font-size: 2rem; margin-bottom: 15px; }
.info-items { margin-top: 30px; display: flex; flex-direction: column; gap: 20px; }
.info-items .item { display: flex; align-items: center; gap: 15px; font-size: 1.1rem; }
.info-items .item i { color: var(--color-secondary); font-size: 1.5rem; width: 30px; text-align: center; }
.social-links a {
    display: inline-flex; align-items: center; justify-content: center;
    width: 40px; height: 40px; border-radius: 50%;
    background: var(--color-primary); color: #FFF; margin-right: 10px;
    transition: var(--transition);
}
.social-links a:hover { background: var(--color-secondary); transform: translateY(-3px); }

/* Formulario */
.contacto-form-container { background: var(--bg-card); padding: 40px; border-radius: 10px; box-shadow: var(--shadow-lg); border: 1px solid var(--border-color); }
.form-row { display: flex; gap: 20px; }
.form-group { width: 100%; margin-bottom: 20px; }
.form-group label { display: block; font-weight: 600; margin-bottom: 8px; color: var(--color-primary); font-size: 0.9rem; }
.form-group input, .form-group select, .form-group textarea {
    width: 100%; padding: 12px;
    border: 1px solid #CBD5E1; border-radius: 6px;
    font-family: inherit; font-size: 1rem; transition: var(--transition);
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
    outline: none; border-color: var(--color-secondary); box-shadow: 0 0 0 3px rgba(195, 106, 54, 0.1);
}

/* ==========================================================================
   Footer
   ========================================================================== */
.footer { background-color: var(--color-primary); color: #FFF; padding: 30px 0; font-size: 0.95rem; }

/* ==========================================================================
   Responsive Design (Mobile First Media Queries)
   ========================================================================== */

/* Tablets y pantallas medianas */
@media (max-width: 992px) {
    .nav-links { gap: 20px; }
    .nav-menu { gap: 15px; }
    
    .hero-content h1 { font-size: 2.6rem; }
    .contacto-wrapper { grid-template-columns: 1fr; }
    
    .nosotros-wrapper { grid-template-columns: 1fr; gap: 40px; }
    .nosotros-imagen { order: -1; padding: 0; margin-bottom: 10px; }
    .mision-vision-grid { grid-template-columns: 1fr; }
    .img-adorno { display: none; }
}

/* Celulares */
@media (max-width: 768px) {
    /* Ajustes Navbar Mobile */
    .navbar { height: 75px; }
    .navbar.scrolled { height: 60px; }
    .logo img { height: 50px; } 
    .navbar.scrolled .logo img { height: 38px; }
    
    /* Configuración Menú Hamburguesa */
    .menu-toggle { display: block; }
    .nav-links {
        position: absolute; 
        top: 100%; 
        left: 0; 
        width: 100%;
        background: #FFF; 
        flex-direction: column; 
        padding: 20px;
        gap: 20px; 
        box-shadow: var(--shadow-md);
        clip-path: polygon(0 0, 100% 0, 100% 0, 0 0);
        transition: clip-path 0.3s ease-in-out;
    }
    .nav-links.active { clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%); }
    
    .nav-menu { flex-direction: column; width: 100%; text-align: center; gap: 15px; }
    .nav-actions { flex-direction: column; width: 100%; }
    .nav-actions .btn-primary { width: 100%; }
    
    /* Ajustes Portada */
    .hero-logo-3d { max-width: 160px; margin-bottom: 20px; }
    .hero-content h1 { font-size: 2rem; }
    .hero-description { font-size: 1rem; }
    
    /* Ajustes Generales y Formularios */
    .section-header h2 { font-size: 2rem; }
    .form-row { flex-direction: column; gap: 0; }
    .contacto-form-container { padding: 25px; }
}