:root {
    --primary: #2D2C71;
    --primary-light: #3e3d9e;
    --bg-light: #F1F1F2;
    --white: #FFFFFF;
    --text-main: #2b2b2b;
    --text-muted: #555555;
    --border-color: #E2E8F0;
    --accent-warning: #ffc107;
    --accent-warning-bg: #fff3cd;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Montserrat', sans-serif;
    background-color: var(--bg-light);
    color: var(--text-main);
    overflow-x: hidden;
    line-height: 1.7;
    height: 100vh;
    overflow-y: hidden;
}

body.intro-finished { height: auto; overflow-y: auto; }

/* Tipografías legibles mejoradas */
.text-enhanced { font-size: 0.98rem; margin-top: 10px; color: var(--text-muted); line-height: 1.6; }
p { font-size: 1.05rem; }

/* ----- FONDOS 3D ----- */
#city-background {
    position: fixed; top: -5%; left: -5%;
    width: 110%; height: 110%;
    background: url('https://images.unsplash.com/photo-1497366216548-37526070297c?auto=format&fit=crop&w=2000&q=80') center/cover;
    z-index: -3; filter: brightness(1.2) contrast(0.9);
}
#webgl-container { position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; z-index: -2; pointer-events: none; }
#light-transition {
    position: fixed; top: 0; left: 0; width: 100vw; height: 100vh;
    background: var(--bg-light); z-index: 9998; pointer-events: none; opacity: 1;
}
#intro-message {
    position: fixed; top: 80%; left: 50%; transform: translate(-50%, -50%);
    font-size: 1.2rem; font-weight: 600; letter-spacing: 4px;
    color: var(--primary); text-transform: uppercase;
    z-index: 9999; pointer-events: none; transition: opacity 0.3s ease;
}

/* ----- INTERFAZ PRINCIPAL ----- */
#ui-layer {
    opacity: 0; visibility: hidden; display: flex; flex-direction: column; min-height: 100vh;
    transition: opacity 0.5s ease;
}
body.intro-finished #ui-layer { opacity: 1; visibility: visible; }
.page-section { display: none; animation: fadeInPage 0.6s ease forwards; padding-bottom: 80px; }
.page-section.active { display: block; }
@keyframes fadeInPage { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }

/* ----- CABECERA (NAV & SELLOS CENTRADOS OPTIMIZADOS) ----- */
nav {
    position: fixed; top: 0; width: 100%; padding: 14px 5%;
    display: flex; justify-content: space-between; align-items: center;
    z-index: 1000; background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 4px 15px rgba(0,0,0,0.1); border-bottom: 2px solid var(--primary);
}
.brand { cursor: pointer; display: flex; align-items: center; }
.main-logo { height: 65px; object-fit: contain; }

/* Sellos centrados y con tamaño mejorado a la par del logo */
.nav-seals-center {
    display: flex; gap: 20px; align-items: center;
}
.seal-btn img { height: 60px; object-fit: contain; cursor: pointer; transition: 0.3s; border-radius: 50%; }
.iso-btn img:hover { transform: scale(1.15); box-shadow: 0 0 15px rgba(45, 44, 113, 0.4); }
.spin-effect { animation: spinContinuous 10s linear infinite; }
.spin-effect:hover { animation-duration: 3s; transform: scale(1.1); box-shadow: 0 0 15px rgba(0, 166, 81, 0.4); }
@keyframes spinContinuous { 100% { transform: rotate(360deg); } }

.nav-links { display: flex; gap: 20px; align-items: center; }
.nav-links > a {
    color: var(--primary); text-decoration: none; cursor: pointer;
    font-size: 0.95rem; font-weight: 700; text-transform: uppercase;
    transition: color 0.3s; padding: 10px;
}
.nav-links > a:hover { color: var(--primary-light); }

.nav-btn-solid { background: var(--primary); color: var(--white) !important; padding: 10px 20px !important; border-radius: 30px; }
.nav-btn-solid:hover { background: var(--primary-light) !important; }

.nav-btn-outline { border: 2px solid var(--primary); color: var(--primary) !important; padding: 8px 18px !important; border-radius: 30px; }
.nav-btn-outline:hover { background: var(--primary); color: var(--white) !important; }

.mobile-menu-btn { display: none; font-size: 2rem; color: var(--primary); cursor: pointer; }

/* ----- REDES SOCIALES FLOTANTES ----- */
.social-float {
    position: fixed; top: 50%; left: 0; transform: translateY(-50%);
    display: flex; flex-direction: column; gap: 10px; z-index: 1000;
}
.social-float a {
    display: flex; justify-content: center; align-items: center;
    width: 50px; height: 50px;
    background: var(--primary); color: var(--white);
    font-size: 1.5rem; text-decoration: none;
    transition: 0.3s; border-radius: 0 10px 10px 0;
    box-shadow: 2px 2px 10px rgba(0,0,0,0.2);
}
.social-float a:hover { width: 60px; background: var(--primary-light); }

/* ----- HERO SECTION (Fondo Transparente y Borde 3D) ----- */
.hero { position: relative; min-height: 100vh; display: flex; align-items: center; justify-content: center; text-align: center; padding: 0 20px; pointer-events: none; z-index: 10; margin-top: 50px; }
.hero-content {
    max-width: 900px; width: 100%; padding: 40px; pointer-events: auto;
    background: transparent; /* Eliminado fondo para máximo contraste 3D */
    border-radius: 20px;
}
.dynamic-text-container {
    min-height: 120px;
    display: flex; align-items: center; justify-content: center;
    margin-bottom: 20px;
}
.hero h1 {
    font-size: clamp(2.5rem, 6vw, 4.5rem);
    font-weight: 900;
    color: var(--primary);
    text-transform: uppercase;
    line-height: 1.2;
    /* Borde blanco exterior limpio (sin líneas internas) */
    text-shadow: 
        -2px -2px 0 var(--white),
         0px -2px 0 var(--white),
         2px -2px 0 var(--white),
         2px  0px 0 var(--white),
         2px  2px 0 var(--white),
         0px  2px 0 var(--white),
        -2px  2px 0 var(--white),
        -2px  0px 0 var(--white);
}
.cursor {
    display: inline-block; width: 4px; height: 1em;
    background-color: var(--primary); margin-left: 5px;
    animation: blink 0.8s infinite; vertical-align: middle;
}
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0; } }

.hero-buttons { display: flex; gap: 20px; justify-content: center; flex-wrap: wrap; margin-top: 20px;}
.btn-primary { 
    background: var(--primary); color: var(--white); 
    padding: 15px 30px; border-radius: 30px; font-weight: 900; 
    text-transform: uppercase; cursor: pointer; text-decoration: none; 
    transition: 0.3s; 
    border: 3px solid var(--white); /* Borde Blanco para contraste */
    box-shadow: 0 5px 15px rgba(0,0,0,0.4), inset 0 2px 5px rgba(255,255,255,0.3); /* Efecto 3D */
    display: inline-block; 
}
.btn-primary:hover { 
    background: var(--primary-light); transform: translateY(-3px); 
    box-shadow: 0 10px 20px rgba(45, 44, 113, 0.5), inset 0 2px 5px rgba(255,255,255,0.4); 
}
.btn-secondary { 
    background: rgba(255, 255, 255, 0.9); color: var(--primary); 
    border: 3px solid var(--white); 
    padding: 15px 30px; border-radius: 30px; font-weight: 900; 
    text-transform: uppercase; cursor: pointer; text-decoration: none; 
    transition: 0.3s; display: inline-block; 
    box-shadow: 0 5px 15px rgba(0,0,0,0.4);
}
.btn-secondary:hover { background: var(--primary); color: var(--white); }

/* ----- MODAL ODS ----- */
.modal { display: none; position: fixed; z-index: 2000; left: 0; top: 0; width: 100%; height: 100%; overflow: auto; background-color: rgba(0,0,0,0.7); backdrop-filter: blur(5px); }
.modal-content { background-color: var(--white); margin: 5% auto; padding: 40px; border-radius: 15px; width: 90%; max-width: 900px; box-shadow: 0 20px 50px rgba(0,0,0,0.3); position: relative; animation: slideDown 0.4s ease; }
@keyframes slideDown { from { transform: translateY(-50px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.close-modal { color: #aaa; float: right; font-size: 28px; font-weight: bold; cursor: pointer; transition: 0.3s; }
.close-modal:hover { color: var(--primary); }
.modal-header { display: flex; align-items: center; gap: 20px; margin-bottom: 20px; border-bottom: 2px solid var(--bg-light); padding-bottom: 20px; }
.modal-ods-logo { height: 80px; }
.modal-header h2 { color: var(--primary); font-size: 2rem; }
.modal-body p { margin-bottom: 15px; text-align: justify; }
.ods-workers-section { display: flex; gap: 30px; margin-top: 30px; align-items: flex-start; }
.ods-text-content { flex: 1.5; }
.ods-text-content h3 { color: var(--primary); margin-bottom: 15px; }
.ods-icons img { height: 60px; margin-bottom: 15px; }

/* Centrado de la imagen ODS */
.ods-image { flex: 1; display: flex; justify-content: center; align-items: center; }
.ods-image img { width: 100%; max-width: 350px; border-radius: 10px; box-shadow: 0 10px 20px rgba(0,0,0,0.1); object-fit: contain; }

/* ----- BANNER COOKIES ----- */
.cookie-banner { position: fixed; bottom: -100px; left: 0; width: 100%; background: var(--primary); color: white; padding: 15px 5%; display: flex; justify-content: space-between; align-items: center; z-index: 1500; transition: bottom 0.5s ease; font-size: 1rem; }
.cookie-banner.show { bottom: 0; }
.cookie-banner a { color: var(--accent-warning); text-decoration: underline; }
.cookie-banner button { background: var(--accent-warning); color: var(--text-main); border: none; padding: 10px 22px; border-radius: 5px; font-weight: bold; cursor: pointer; transition: 0.3s; }
.cookie-banner button:hover { background: #e0a800; }

/* ----- SECCIONES GENÉRICAS ----- */
.inner-page-container { max-width: 1200px; margin: 130px auto 40px; padding: 0 20px; position: relative; z-index: 10; }
.section-header { text-align: center; margin-bottom: 40px; }
.section-header h2 { font-size: 2.6rem; font-weight: 900; color: var(--primary); text-transform: uppercase; margin-bottom: 10px; }
.section-header p { color: var(--text-muted); font-size: 1.15rem; }

.content-panel { background: var(--white); border-radius: 15px; padding: 45px; margin-bottom: 30px; box-shadow: 0 10px 30px rgba(0,0,0,0.05); border: 1px solid var(--border-color); }
.content-panel h3 { color: var(--primary); font-size: 1.9rem; margin-bottom: 20px; border-bottom: 2px solid var(--bg-light); padding-bottom: 12px; }
.content-panel p { margin-bottom: 18px; text-align: justify; }

/* ----- VENTAJAS Y SERVICIOS ----- */
.advantages-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 25px; position: relative; z-index: 10; margin-bottom: 60px; }
.adv-card { background: var(--white); padding: 35px; border-radius: 15px; text-align: center; box-shadow: 0 10px 30px rgba(0,0,0,0.05); border: 1px solid var(--border-color); transition: 0.3s; }
.adv-card i { font-size: 2.8rem; color: var(--primary); margin-bottom: 15px; }
.adv-card h4 { font-size: 1.2rem; color: var(--primary); font-weight: 800; margin-bottom: 12px; }
.adv-card:hover { transform: translateY(-10px); border-color: var(--primary); box-shadow: 0 15px 40px rgba(45, 44, 113, 0.1); }

.services-detail-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 30px; }
.service-detail-card { background: var(--white); border-radius: 15px; overflow: hidden; box-shadow: 0 10px 30px rgba(0,0,0,0.05); border: 1px solid var(--border-color); text-align: center; transition: 0.3s; }
.service-detail-card:hover { transform: scale(1.03); }
.service-detail-card img { width: 100%; height: 210px; object-fit: cover; }
.service-detail-card h4 { padding: 22px; font-size: 1.2rem; color: var(--primary); font-weight: 800; text-transform: uppercase; }

/* ----- ALIADOS (Logos PNG Dinámicos) ----- */
.partners-bar { width: 100%; background: var(--white); border-top: 1px solid var(--border-color); border-bottom: 1px solid var(--border-color); padding: 22px 0; display: flex; align-items: center; position: relative; z-index: 10; margin-top: 60px; }
.partners-title { position: absolute; left: 5%; z-index: 2; font-weight: 800; color: var(--primary); text-transform: uppercase; background: var(--white); padding: 5px 15px; border-left: 4px solid var(--primary); font-size: 1.05rem; }
.marquee-wrapper { overflow: hidden; width: 100%; white-space: nowrap; mask-image: linear-gradient(to right, transparent, black 10%, black 90%, transparent); }
.marquee-content { display: inline-block; white-space: nowrap; animation: marquee 35s linear infinite; }
/* Estilo para los logos PNG de la barra flotante */
.marquee-content img { height: 50px; width: auto; object-fit: contain; margin: 0 40px; filter: grayscale(100%); transition: filter 0.3s; vertical-align: middle; }
.marquee-content img:hover { filter: grayscale(0%); }
@keyframes marquee { 0% { transform: translateX(0); } 100% { transform: translateX(-50%); } }

/* ----- CONTACTO ----- */
.contact-wrapper { display: grid; grid-template-columns: 1fr 1fr; gap: 50px; }
.contact-info p { font-size: 1.1rem; line-height: 1.8; margin-bottom: 15px; }
.contact-icon { color: var(--primary); font-size: 1.3rem; width: 30px; }
.form-group { margin-bottom: 22px; }
.form-group label { display: block; margin-bottom: 8px; font-weight: 700; color: var(--text-main); font-size: 1rem; }
.form-group input, .form-group select, .form-group textarea { width: 100%; padding: 16px; background: var(--bg-light); border: 1px solid var(--border-color); color: var(--text-main); border-radius: 8px; font-family: 'Montserrat', sans-serif; font-size: 1rem; transition: 0.3s; }
.form-group input:focus, .form-group select:focus, .form-group textarea:focus { border-color: var(--primary); outline: none; }

/* ----- FOOTER ----- */
footer { background: var(--white); padding: 60px 5% 30px; border-top: 1px solid var(--border-color); position: relative; z-index: 10; }
.footer-content { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 40px; margin-bottom: 30px; }
.footer-logo { height: 75px; object-fit: contain; }
.footer-col h4 { color: var(--primary); margin-bottom: 20px; font-weight: 800; text-transform: uppercase; font-size: 1.1rem; }
.footer-col a { display: block; color: var(--text-muted); text-decoration: none; margin-bottom: 10px; font-size: 0.9rem; cursor: pointer; }
.footer-col a:hover { color: var(--primary); text-decoration: underline; }
.footer-col p { display: block; color: var(--text-muted); margin-bottom: 12px; font-size: 1.05rem; }

/* Aviso Ético Destacado y Centrado */
.ethical-notice { 
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    text-align: center;
    padding: 30px; border-radius: 12px; font-size: 1.15rem; 
    color: #856404; background-color: var(--accent-warning-bg); border: 2px solid var(--accent-warning); 
    margin-bottom: 30px; line-height: 1.6;
    box-shadow: 0 5px 15px rgba(255, 193, 7, 0.3);
}
.ethical-notice i { font-size: 3rem; margin-bottom: 15px; }
.pulse-effect { animation: highlight-pulse 2.5s infinite; }
@keyframes highlight-pulse { 
    0% { box-shadow: 0 0 0 0 rgba(255, 193, 7, 0.7); } 
    70% { box-shadow: 0 0 0 15px rgba(255, 193, 7, 0); } 
    100% { box-shadow: 0 0 0 0 rgba(255, 193, 7, 0); } 
}
.copyright { text-align: center; color: var(--text-muted); font-size: 0.95rem; border-top: 1px solid var(--border-color); padding-top: 20px; }

/* ----- FLOTANTES WHATSAPP ----- */
.whatsapp-float { position: fixed; bottom: 30px; right: 30px; width: 65px; height: 65px; background-color: #25d366; color: var(--white); border-radius: 50%; display: flex; justify-content: center; align-items: center; font-size: 2.4rem; box-shadow: 0 10px 20px rgba(37, 211, 102, 0.4); z-index: 1000; text-decoration: none; transition: transform 0.3s; }
.whatsapp-float:hover { transform: scale(1.15); }

/* ----- MEDIA QUERIES RESPONSIVAS ----- */
@media (max-width: 992px) {
    /* Mantener Logo y Sellos en la misma línea superior centradamente */
    nav { flex-wrap: nowrap; padding: 12px 15px; justify-content: space-between; }
    .main-logo { height: 40px; }
    .nav-seals-center { flex-direction: row; order: unset; width: auto; border: none; padding-top: 0; margin-top: 0; gap: 8px; justify-content: center; flex: 1; }
    .seal-btn img { height: 35px; }
    
    .nav-links { display: none; flex-direction: column; position: absolute; top: 100%; left: 0; width: 100%; background: var(--white); padding: 20px; text-align: center; border-top: 1px solid var(--border-color); box-shadow: 0 10px 20px rgba(0,0,0,0.1); }
    .nav-links.active { display: flex; }
    .mobile-menu-btn { display: block; }
    
    .contact-wrapper, .ods-workers-section { grid-template-columns: 1fr; flex-direction: column; }
    .cookie-banner { flex-direction: column; gap: 15px; text-align: center; }
    .social-float { transform: scale(0.8); left: -5px; }
}