/* ==========================================================================
   1. VARIABLES Y RESET GLOBAL
   ========================================================================== */
:root {
    --primary-blue: #0f5499;
    --secondary-blue: #0a3d73;
    --accent-green: #a4c238;
    --accent-red: #da291c;
    --text-dark: #333333;
    --text-light: #666666;
    --bg-light: #f9f9f9;
    --white: #ffffff;
}

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

html, body {
    width: 100%;
    overflow-x: hidden; /* EVITA EL DESBORDAMIENTO HORIZONTAL EN MÓVILES */
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: 'Poppins', sans-serif;
    color: var(--text-dark);
    line-height: 1.6;
    background-color: var(--white);
    overflow-wrap: break-word; /* Evita que palabras muy largas rompan la caja */
}

a {
    text-decoration: none;
    color: inherit;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    width: 100%;
}

.text-center { text-align: center; }

/* ==========================================================================
   2. BOTONES GLOBALES
   ========================================================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 25px;
    border-radius: 5px;
    font-weight: 600;
    transition: background 0.3s ease, transform 0.2s ease;
    cursor: pointer;
    border: none;
    text-align: center;
}

.btn-red { background-color: var(--accent-red); color: var(--white); }
.btn-red:hover { background-color: #b32015; }

/* ==========================================================================
   3. HEADER Y NAVEGACIÓN
   ========================================================================== */
.header {
    background-color: var(--primary-blue);
    color: var(--white);
    padding: 15px 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.flex-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap; /* Permite que el menú baje si no cabe */
}

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

.nav-links {
    display: flex;
    list-style: none;
    gap: 20px;
    font-size: 0.9rem;
    font-weight: 600;
    flex-wrap: wrap;
    justify-content: center;
}

.nav-links a { transition: color 0.3s; }
.nav-links a:hover { color: var(--accent-green); }

/* ==========================================================================
   4. SECCIONES GENERALES (Hero, Beneficios, Cita)
   ========================================================================== */
.hero { padding: 60px 0; overflow: hidden; }
.hero-content { display: flex; align-items: center; gap: 40px; }
.hero-text { flex: 1; }
.hero-text h1 { font-size: 2.8rem; color: var(--primary-blue); line-height: 1.2; margin-bottom: 20px; }
.hero-text h1 span { color: var(--accent-green); display: block; }
.hero-text p { color: var(--text-light); margin-bottom: 20px; font-size: 1.05rem; }
.hero-image { flex: 1; width: 100%; }
.image-placeholder { background-color: #e0e0e0; height: 400px; border-radius: 50px 0 50px 0; display: flex; align-items: center; justify-content: center; color: #999; }

.benefits { padding: 60px 0; background-color: var(--bg-light); }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 30px; }
.card { background: var(--white); padding: 40px 30px; border-radius: 15px; box-shadow: 0 10px 30px rgba(0,0,0,0.05); text-align: center; transition: transform 0.3s; }
.card:hover { transform: translateY(-5px); }
.card i { font-size: 3rem; margin-bottom: 20px; }
.icon-red { color: var(--accent-red); }
.icon-green { color: var(--accent-green); }
.icon-blue { color: var(--primary-blue); }
.card h3 { color: var(--primary-blue); margin-bottom: 15px; }
.card p { font-size: 0.9rem; color: var(--text-light); }

.quote-section { background-color: var(--primary-blue); color: var(--white); padding: 0; }
.flex-quote { display: flex; align-items: stretch; }
.flex-quote .quote-image { flex: 1; }
.flex-quote .quote-image .image-placeholder { height: 100%; border-radius: 0 50px 50px 0; }
.quote-text { flex: 1; padding: 80px 40px; display: flex; flex-direction: column; justify-content: center; }
.quote-text blockquote { font-size: 1.5rem; font-weight: 600; line-height: 1.4; margin-bottom: 20px; }
.quote-text cite { font-size: 0.9rem; font-style: normal; opacity: 0.8; }

/* ==========================================================================
   5. COMPONENTES ESPECIALES (Carrusel 3D)
   ========================================================================== */
.cf-wrapper { position: relative; width: 100%; max-width: 1200px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; overflow: hidden; padding: 20px 0; }
.cf-slider { position: relative; width: 100%; height: 480px; display: flex; justify-content: center; align-items: center; perspective: 1000px; }
.cf-item { position: absolute; width: 260px; height: 400px; background-color: var(--primary-blue); display: flex; flex-direction: column; transition: all 0.5s ease-in-out; box-shadow: 0 10px 30px rgba(0,0,0,0.2); border-radius: 10px; overflow: hidden; }
.cf-img-box { height: 55%; width: 100%; overflow: hidden; background-color: #ffffff; box-sizing: border-box; display: flex; align-items: center; justify-content: center; padding: 15px; }
.cf-img-box img { width: 100%; height: 100%; object-fit: contain; }
.cf-content { height: 45%; padding: 20px 15px; text-align: center; color: var(--white); display: flex; flex-direction: column; justify-content: space-between; }
.cf-content h4 { font-size: 1.1rem; line-height: 1.2; margin-bottom: 5px; }
.cf-content p { font-size: 0.75rem; opacity: 0.8; }
.cf-link { display: inline-block; padding: 5px 15px; border: 1px solid var(--white); color: var(--white); font-size: 0.8rem; border-radius: 4px; transition: background 0.3s; margin: 0 auto; }
.cf-link:hover { background: var(--white); color: var(--primary-blue); }

.cf-item.center { transform: translateX(0) scale(1.1); z-index: 10; opacity: 1; }
.cf-item.left-1 { transform: translateX(-260px) scale(0.9); z-index: 9; opacity: 0.95; }
.cf-item.right-1 { transform: translateX(260px) scale(0.9); z-index: 9; opacity: 0.95; }
.cf-item.left-2 { transform: translateX(-480px) scale(0.75); z-index: 8; opacity: 0.6; }
.cf-item.right-2 { transform: translateX(480px) scale(0.75); z-index: 8; opacity: 0.6; }
.cf-item.hidden { transform: translateX(0) scale(0.5); z-index: 1; opacity: 0; pointer-events: none; }

.cf-btn { background: transparent; border: none; font-size: 2.5rem; color: var(--text-dark); cursor: pointer; z-index: 20; padding: 10px; transition: color 0.3s, transform 0.2s; display: flex; align-items: center; }
.cf-btn:hover { color: var(--primary-blue); transform: scale(1.1); }

/* ==========================================================================
   6. SERVICIOS Y DIFERENCIADORES (Tablas y Proyectos)
   ========================================================================== */
.diff-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 60px; margin-top: 40px; align-items: flex-start; }
.diff-features { display: flex; flex-direction: column; gap: 30px; }
.diff-item { display: flex; gap: 20px; padding-bottom: 30px; border-bottom: 1px solid #eee; }
.diff-item:last-child { border-bottom: none; }
.diff-icon { background-color: rgba(15, 84, 153, 0.05); color: var(--primary-blue); width: 45px; height: 45px; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 1.2rem; flex-shrink: 0; }
.diff-text h4 { color: var(--primary-blue); font-size: 1.1rem; margin-bottom: 8px; }
.diff-text p { color: var(--text-m); font-size: 0.95rem; line-height: 1.5; }

/* Envoltorio para evitar que la tabla rompa el diseño en celulares */
.diff-table-wrapper { background: #fff; border-radius: 10px; box-shadow: 0 5px 20px rgba(0,0,0,0.05); overflow-x: auto; border: 1px solid #f0f0f0; width: 100%; }
.comparative-table { width: 100%; min-width: 500px; border-collapse: collapse; }
.comparative-table th { padding: 20px 15px; font-size: 0.8rem; font-weight: 600; text-transform: uppercase; }
.col-service { text-align: left; color: var(--text-light); width: 50%; }
.col-other { color: var(--text-light); text-align: center; width: 25%; }
.col-aizpuro { background-color: var(--primary-blue); color: var(--white); text-align: center; width: 25%; }
.comparative-table td { padding: 15px; font-size: 0.9rem; color: var(--text-dark); border-bottom: 1px solid #f0f0f0; vertical-align: middle; }
.text-blue { color: var(--primary-blue); font-size: 1rem; }
.text-gray { color: #ccc; font-weight: bold; }
.bg-light-blue { background-color: rgba(15, 84, 153, 0.03); }

.projects-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.project-card { background: #fff; border: 1px solid #f0f0f0; border-radius: 8px; padding: 25px 20px; box-shadow: 0 2px 10px rgba(0,0,0,0.02); transition: box-shadow 0.3s; }
.project-card:hover { box-shadow: 0 8px 25px rgba(0,0,0,0.08); }
.project-card h4 { color: var(--primary-blue); font-size: 1.05rem; margin-bottom: 8px; }
.project-card p { color: var(--text-light); font-size: 0.85rem; line-height: 1.4; }
.border-blue { border-left: 4px solid var(--primary-blue); }
.border-green { border-left: 4px solid var(--accent-green); }
.border-red { border-left: 4px solid var(--accent-red); }

/* ==========================================================================
   7. NOSOTROS (Filosofía, Valores, Pasos)
   ========================================================================== */
.filosofia-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 50px; align-items: center; }
.filosofia-img-wrapper { width: 100%; height: 100%; min-height: 350px; }
.filosofia-img { width: 100%; height: 100%; object-fit: cover; border-radius: 10px 60px 10px 60px; box-shadow: 0 15px 35px rgba(0,0,0,0.08); }

.principios-list { display: flex; flex-direction: column; }
.principio-item { display: flex; align-items: flex-start; gap: 35px; padding: 35px 0; border-bottom: 1px solid #f0f0f0; }
.principio-item:last-child { border-bottom: none; padding-bottom: 0; }
.principio-item:first-child { padding-top: 0; }
.principio-numero { font-family: Georgia, 'Times New Roman', Times, serif; font-size: 3.5rem; font-weight: 700; color: var(--primary-blue); line-height: 0.8; min-width: 65px; }
.principio-texto h4 { color: var(--primary-blue); font-size: 1.25rem; margin-bottom: 12px; font-weight: 600; }

.pasos-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 30px; margin-top: 40px; }
.paso-item { background: var(--white); padding: 30px 20px; border-radius: 10px; text-align: center; box-shadow: 0 5px 20px rgba(0,0,0,0.05); border: 1px solid #eee; }
.paso-num { width: 50px; height: 50px; background-color: var(--primary-blue); color: var(--white); font-size: 1.5rem; font-weight: bold; border-radius: 50%; display: flex; align-items: center; justify-content: center; margin: 0 auto 15px auto; }
.paso-item h5 { color: var(--accent-green); font-size: 0.9rem; margin-bottom: 5px; text-transform: uppercase; }
.paso-item h4 { color: var(--primary-blue); font-size: 1.1rem; margin-bottom: 10px; }

/* ==========================================================================
   8. FORMULARIOS (Contacto y Boletín)
   ========================================================================== */
.contact-section { padding: 80px 0; }
.contact-section h2 { font-size: 2.5rem; color: var(--primary-blue); text-align: center; margin-bottom: 50px; }
.contact-section h2 span { color: var(--accent-green); display: block; }
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 50px; align-items: flex-start; }
.diag-value-container { display: flex; flex-direction: column; gap: 30px; }
.cert-seal-box { background: var(--white); padding: 30px; border-radius: 20px; box-shadow: 0 10px 40px rgba(0,0,0,0.05); }
.diag-inclusion-list { background: rgba(15, 84, 153, 0.05); padding: 30px; border-radius: 20px; border-left: 5px solid var(--primary-blue); }
.inclusions-list { list-style: none; padding: 0; }
.inclusions-list li { display: flex; align-items: center; gap: 15px; margin-bottom: 18px; font-size: 0.95rem; line-height: 1.2; }
.inclusions-list li i { font-size: 1.6rem; color: var(--primary-blue); width: 30px; text-align: center; }

form input, form textarea, form select { width: 100%; padding: 12px 15px; margin-bottom: 20px; border: 1px solid #ccc; border-radius: 8px; font-family: 'Poppins', sans-serif; }
.form-group-row { display: flex; gap: 20px; width: 100%; }

.boletin-form { display: flex; flex-direction: row; gap: 10px; justify-content: center; max-width: 500px; margin: 0 auto; width: 100%; }
.boletin-input { flex-grow: 1; height: 50px; padding: 0 20px; border-radius: 8px; border: none; font-size: 1rem; box-shadow: 0 4px 10px rgba(0,0,0,0.1); margin-bottom: 0 !important; }
.boletin-btn { height: 50px !important; margin: 0 !important; padding: 0 30px !important; border-radius: 8px !important; font-size: 1rem; box-shadow: 0 4px 10px rgba(0,0,0,0.1); }

/* ==========================================================================
   9. FOOTER
   ========================================================================== */
.footer { background-color: var(--primary-blue); color: var(--white); padding: 60px 0 0 0; margin-top: auto; }
.footer-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 30px; padding-bottom: 40px; }
.footer h4 { margin-bottom: 20px; font-size: 1.2rem; }
.footer-links ul { list-style: none; }
.footer-links li { margin-bottom: 10px; }
.footer-links a:hover { color: var(--accent-green); }
.footer-logo-img { max-height: 80px; width: auto; margin-bottom: 15px; }
.social-icons a { display: inline-block; width: 35px; height: 35px; background: rgba(255,255,255,0.1); text-align: center; line-height: 35px; border-radius: 50%; margin-right: 10px; transition: background 0.3s; }
.social-icons a:hover { background: var(--accent-red); }
.footer-bottom { background-color: var(--secondary-blue); text-align: center; padding: 20px 0; font-size: 0.8rem; }
.whatsapp-float { position: fixed; bottom: 20px; right: 20px; background-color: #25d366; color: white; width: 60px; height: 60px; border-radius: 50%; text-align: center; font-size: 35px; line-height: 60px; box-shadow: 2px 2px 10px rgba(0,0,0,0.2); z-index: 100; transition: transform 0.3s; }
.whatsapp-float:hover { transform: scale(1.1); }

/* ==========================================================================
   10. ANIMACIONES AL SCROLL
   ========================================================================== */
.anim-fade-up { opacity: 0; transform: translateY(40px); transition: opacity 0.8s ease-out, transform 0.8s ease-out; }
.anim-fade-up.visible { opacity: 1; transform: translateY(0); }
.delay-1 { transition-delay: 0.1s; }
.delay-2 { transition-delay: 0.3s; }
.delay-3 { transition-delay: 0.5s; }

/* ==========================================================================
   CORRECCIONES ESTABLES (Certificado, MVV, Formularios, etc.)
   ========================================================================== */
.cert-seal-img { max-width: 140px !important; width: 100%; height: auto; margin: 0 auto 20px auto !important; display: block; }

.blue-section-bg { background-color: var(--primary-blue) !important; color: var(--white); }
.mvv-card { background: rgba(255, 255, 255, 0.05); padding: 40px 30px; border-radius: 15px; text-align: center; border: 1px solid rgba(255, 255, 255, 0.1); color: var(--white); transition: transform 0.3s ease; }
.mvv-card:hover { transform: translateY(-5px); background: rgba(255, 255, 255, 0.1); }
.mvv-icon.circle-icon { width: 80px; height: 80px; background-color: var(--accent-green); border-radius: 50%; display: flex; align-items: center; justify-content: center; margin: 0 auto 20px auto; }
.mvv-icon.circle-icon i { font-size: 2.2rem; color: var(--primary-blue); margin: 0; }
.mvv-card h3 { color: var(--accent-green) !important; font-size: 1.6rem; margin-bottom: 15px; }
.mvv-card p { font-size: 0.95rem; color: rgba(255, 255, 255, 0.9); line-height: 1.6; }
.valores-grid { list-style: none; padding: 0; }
.valores-grid li { color: var(--white) !important; margin-bottom: 8px; display: flex; align-items: center; gap: 8px; }
.blue-section-bg h2, .blue-section-bg p { color: var(--white); }

.grid-2-nosotros { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; }

.cert-reg-number { font-size: 1rem; color: var(--text-dark); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 25px; }
.cert-reg-number strong { font-size: 1.5rem; color: var(--primary-blue); font-weight: 700; display: block; margin-top: 5px; }
.cert-seal-box > div { background-color: var(--bg-light); padding: 20px; border-radius: 10px; margin-bottom: 15px; text-align: left; }
.cert-seal-box > div strong { color: var(--primary-blue); display: block; margin-bottom: 8px; font-size: 1.05rem; }

.diag-inclusion-list { background: rgba(15, 84, 153, 0.05); padding: 30px; border-radius: 20px; border-left: 5px solid var(--primary-blue); }
.diag-inclusion-list h4 { color: var(--primary-blue); font-size: 1.4rem; margin-bottom: 10px; font-weight: 700; }
.diag-inclusion-list p { color: var(--text-light); font-size: 0.95rem; margin-bottom: 20px; line-height: 1.5; }
.inclusions-list { list-style: none; padding: 0; }
.inclusions-list li { display: flex; align-items: center; gap: 15px; margin-bottom: 18px; font-size: 0.95rem; line-height: 1.3; }
.inclusions-list li i { font-size: 1.5rem; color: var(--primary-blue); width: 30px; text-align: center; flex-shrink: 0; }
.inclusions-list li span { flex: 1; color: var(--text-dark); }

.privacy-check { display: flex; align-items: flex-start; justify-content: flex-start; gap: 10px; text-align: left; }
.privacy-check input[type="checkbox"] { width: auto !important; margin-bottom: 0 !important; margin-top: 4px; cursor: pointer; }
.btn-submit { width: 100%; font-size: 1.1rem; padding: 15px; }

/* ==========================================================================
   11. MEDIA QUERIES CONSOLIDADOS (Optimizados para iOS y Android Tabletas/Móviles)
   ========================================================================== */

/* iPad Pro, Tabletas Grandes y Portátiles pequeñas (hasta 1024px) */
@media (max-width: 1024px) {
    .hero-text h1 { font-size: 2.3rem; }
    .grid-3 { grid-template-columns: repeat(2, 1fr); } /* 3 columnas pasan a 2 */
    .projects-grid { grid-template-columns: repeat(2, 1fr); }
    .footer-grid { grid-template-columns: repeat(2, 1fr); }
    
    /* Limitamos las imágenes en tabletas para que no crezcan de más */
    .image-placeholder { height: 350px; }
    .filosofia-img { max-height: 400px; } 
    .diff-grid { gap: 30px; }
}

/* iPad Normal, Tabletas horizontales y pantallas intermedias (hasta 850px) */
@media (max-width: 850px) {
    .hero-content { flex-direction: column; text-align: center; gap: 30px; }
    .hero-image { width: 100%; max-width: 600px; margin: 0 auto; }
    
    .flex-quote { flex-direction: column; }
    .quote-image .image-placeholder { border-radius: 50px 50px 0 0; height: 250px; }
    
    .contact-grid { flex-direction: column; grid-template-columns: 1fr; gap: 40px; }
    .filosofia-grid { grid-template-columns: 1fr; gap: 30px; text-align: center; }
    .filosofia-img-wrapper { min-height: auto; max-width: 600px; margin: 0 auto; }
    .filosofia-img { border-radius: 30px; }
    
    .diff-grid { grid-template-columns: 1fr; }
    
    .cf-item.left-1 { transform: translateX(-180px) scale(0.85); }
    .cf-item.right-1 { transform: translateX(180px) scale(0.85); }
}

/* Tabletas pequeñas y Móviles en horizontal (hasta 768px) */
@media (max-width: 768px) {
    .grid-2-nosotros { grid-template-columns: 1fr; } /* Apila las tarjetas Meta y Objetivo */
    .nav-links { gap: 12px; font-size: 0.85rem; }
}

/* Teléfonos Móviles en vertical (hasta 600px) */
@media (max-width: 600px) {
    .header { padding: 10px 0; }
    .flex-header { flex-direction: column; gap: 10px; }
    .nav-links { flex-wrap: wrap; justify-content: center; width: 100%; }
    
    .hero-text h1 { font-size: 1.8rem; }
    .image-placeholder { height: 250px; border-radius: 30px 0 30px 0; }
    
    .grid-3, .projects-grid { grid-template-columns: 1fr; } /* Pasa de 2 a 1 columna */
    .footer-grid { grid-template-columns: 1fr; text-align: center; }
    
    .form-group-row { flex-direction: column; gap: 0; }
    .boletin-form { flex-direction: column; }
    .boletin-btn { width: 100%; }
    
    .cf-slider { height: 420px; }
    .cf-item.left-1, .cf-item.right-1, .cf-item.left-2, .cf-item.right-2 { opacity: 0; pointer-events: none; }
    .cf-item.center { transform: translateX(0) scale(1); width: 280px; }
    .cf-btn { display: none; } 
    
    .comparative-table th, .comparative-table td { padding: 12px 10px; font-size: 0.8rem; }
    .col-service { width: 40%; }
    .col-other, .col-aizpuro { width: 30%; }
    
    .principio-item { flex-direction: column; gap: 15px; padding: 25px 0; text-align: left; }
    .principio-numero { font-size: 2.8rem; }
    
    .quote-text { padding: 40px 20px; }
}