/* ======================================================
   EC INGENIERIA - ESTILOS PRINCIPALES
   Paleta: Azul (#0B4BB3), Celeste (#4FC3F7), Gris (#2E3A59), Fondo (#F9FBFD)
   ====================================================== */

:root {
  --primary: #0B4BB3;
  --secondary: #4FC3F7;
  --border-blue: #2F6DD5;
  --dark: #2E3A59;
  --light: #F9FBFD;
  --text: #2E3A59;
  --radius: 12px;
  --shadow: 0 4px 15px rgba(0,0,0,0.1);
  --transition: all 0.3s ease;
  font-family: "Poppins", Arial, sans-serif;
}

/* === RESET === */
* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: "Poppins", Arial, sans-serif;
  background: var(--light);
  color: var(--text);
  line-height: 1.6;
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: var(--transition);
}

a:hover { color: var(--secondary); }

/* === CONTENEDORES === */
.container { width: 90%; max-width: 1200px; margin: 0 auto; }
.wrap { padding: 60px 0; }
.section { padding: 80px 0; }

h1, h2, h3, h4 { color: var(--dark); }
h1 { font-size: 2.4rem; margin-bottom: 20px; }
h2 { text-align: center; margin-bottom: 40px; font-size: 2rem; }

/* === HEADER === */
.header {
  background: var(--light);
  box-shadow: var(--shadow);
  padding: 15px 0;
  position: sticky;
  top: 0;
  z-index: 1000;
}
.nav { display: flex; justify-content: space-between; align-items: center; }
.brand { display: flex; align-items: center; gap: 10px; }
.brand img { height: 48px; width: auto; }
.brand .title { font-weight: 700; font-size: 1.2rem; color: var(--primary); }
.menu { display: flex; gap: 24px; }
.menu a { font-weight: 500; color: var(--text); }
.menu a:hover { color: var(--primary); }
.menu-toggle { display: none; background: none; border: none; font-size: 1.8rem; cursor: pointer; }


/* === HERO === */
.hero { background: var(--light); }
.hero-flex {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: center;
}
.hero-text .badge {
  display: inline-block;
  background: none;
  color: var(--primary);
  font-weight: 600;
  padding: 0;
  margin-bottom: 16px;
}
.hero-text .lead {
  font-size: 1.1rem;
  color: var(--text);
  margin-bottom: 24px;
  text-align: justify;
}

/* === CTA HERO (corregido y aislado) === */
.cta-hero {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 24px;
}

/* Resetea herencias de .btn y .cta */
.cta-hero .btn {
  all: unset; /* 💥 elimina herencias anteriores */
  display: inline-flex;
  justify-content: center;
  align-items: center;
  background: none;
  border: none;
  cursor: pointer;

  height: 54px;
  width: 240px;
  border-radius: var(--radius);

  font-family: "Poppins", Arial, sans-serif;
  font-weight: 700;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  text-align: center;
  line-height: 1;
  box-sizing: border-box;
  transition: var(--transition);
}

/* Botón azul */
.cta-hero .btn.primary {
  background: var(--primary);
  color: #fff;
}
.cta-hero .btn.primary:hover {
  background: var(--secondary);
  color: var(--dark);
}

/* Botón celeste */
.cta-hero .btn.secondary {
  background: var(--secondary);
  color: var(--dark);
}
.cta-hero .btn.secondary:hover {
  background: var(--primary);
  color: #fff;
}

/* === Móvil === */
@media (max-width: 600px) {
  .cta-hero {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }
  .cta-hero .btn {
    width: 100%;
  }
}

/* === CORRECCIÓN HERO EN MÓVIL === */
@media (max-width: 900px) {
  .hero-flex {
    display: flex;
    flex-direction: column;
    text-align: center;
    gap: 20px;
  }

  .hero-banner {
    width: 100%;
    order: 2; /* la imagen abajo del texto */
  }

  .hero-banner .banner {
    width: 100%;
    max-width: 100%;
    height: auto;
  }

  .hero-banner .banner img {
    width: 100%;
    height: auto;
    object-fit: cover;
  }

  .hero-text {
    order: 1;
  }

  .cta-hero {
    justify-content: center;
  }
}


/* === BANNER ===*/
.hero-banner { display: flex; justify-content: center; align-items: center; }
.banner {
  position: relative;
  width: 100%;
  max-width: 520px;
  height: 340px;
  overflow: hidden;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.banner img {
  position: absolute;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 1s ease-in-out;
}
.banner img.active { opacity: 1; }

/* === CARDS DE SERVICIOS (INDEX) === */
.cards-index{
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(300px,1fr));
  gap:24px;
  margin-top:32px;
  align-items:stretch;
}

/* Cada enlace se comporta como tarjeta */
.cards-index > a.card-index{
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:flex-start;

  background:#fff;
  border:1px solid rgba(0,0,0,0.08);
  border-radius:var(--radius);
  box-shadow:0 2px 10px rgba(0,0,0,0.08);

  padding:20px 16px;
  text-align:center;
  text-decoration:none;
  color:var(--text);
  height:100%;
  transition:transform .25s ease, box-shadow .25s ease, border-color .25s ease;
  cursor:pointer;
}

.cards-index > a.card-index:hover{
  transform:translateY(-5px);
  box-shadow:0 6px 18px rgba(0,0,0,0.15);
  border-color:var(--secondary);
}

/* Ícono/imagen compacta (evita “gigante”) */
.cards-index > a.card-index > img{
  width:100px;
  height:100px;
  object-fit:contain;
  margin-bottom:12px;
}

/* Título y texto */
.cards-index > a.card-index > h3{
  color:var(--primary);
  font-size:1.05rem;
  margin:6px 0 6px;
  line-height:1.2;
}
.cards-index > a.card-index > p{
  font-size:.9rem;
  line-height:1.4;
  margin:0;
  text-align:center;
  color:var(--text);
}

/* Responsivo */
@media (max-width: 900px){
  .cards-index{ grid-template-columns:repeat(auto-fit,minmax(200px,1fr)); }
}
@media (max-width: 600px){
  .cards-index{ grid-template-columns:1fr; }
}

/* Blindaje por si existen reglas viejas (.cards .card, etc.) */
.cards-index .card{ all:unset; }
.cards-index .card{ display:revert; }

/* === QUIENES SOMOS === */
.quienes-somos p { text-align: justify; }

/* === MISION, VISION, VALORES === */
.cards-mvv {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 30px;
  justify-content: center;
  align-items: stretch;
}
.card-mvv {
  background: #fff;
  border: 2px solid var(--border-blue);
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  padding: 25px 20px;
  text-align: center;
  transition: var(--transition);
}
.card-mvv:hover {
  transform: translateY(-6px);
  border-color: var(--secondary);
  box-shadow: 0 8px 20px rgba(0,0,0,0.15);
}
.card-mvv h3 {
  color: var(--primary);
  margin-bottom: 10px;
  font-size: 1.3rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.card-mvv p { color: var(--text); font-size: 0.95rem; line-height: 1.5; }
/* Íconos más pequeños y proporcionados en Misión, Visión y Valores */
.card-mvv img,
.card-mvv svg {
  width: 56px;          /* tamaño equilibrado */
  height: auto;
  margin-bottom: 10px;
  object-fit: contain;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.08));
  transition: transform 0.3s ease;
}

.card-mvv:hover img,
.card-mvv:hover svg {
  transform: scale(1.05);
}

/* === EMPRESA / FOTO CENTRAL === */
.empresa-foto { text-align: center; }
.empresa-foto .container.center {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}
.foto-central {
  max-width: 320px;
  width: 100%;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  margin-bottom: 12px;
}
.descripcion-foto {
  color: #2E3A59;
  font-size: 1rem;
  text-align: center;
}

/* === SERVICIOS (bloques alternados con imagen y texto) === */
.servicios {
  padding-top: 80px;
  padding-bottom: 80px;
}

.servicios h2 {
  text-align: center;
  margin-bottom: 2.5rem;
  color: var(--primary);
  font-size: 2rem;
}

/* Contenedor general de cada servicio */
.servicios .servicio {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2.5rem;
  margin-bottom: 60px;
  background: var(--light);
  border-radius: var(--radius);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.servicios .servicio:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
}

/* Imagen del servicio */
.servicios .servicio img {
  width: 50%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Texto del servicio */
.servicios .servicio .texto {
  width: 50%;
  padding: 40px;
}

.servicios .servicio .texto h3 {
  color: var(--primary);
  font-size: 1.5rem;
  margin-bottom: 12px;
  position: relative;
}

.servicios .servicio .texto h3::after {
  content: "";
  display: block;
  width: 60px;
  height: 3px;
  background: var(--secondary);
  border-radius: 3px;
  margin-top: 6px;
}

.servicios .servicio .texto p {
  color: var(--dark);
  line-height: 1.7;
  text-align: justify;
  font-size: 1rem;
}

/* Alternar orden (imagen derecha / texto izquierda) */
.servicios .servicio.invertido {
  flex-direction: row-reverse;
}

/* Alternar fondos para distinguir secciones */
.servicios .servicio:nth-child(even) {
  background: #fff;
}
.servicios .servicio:nth-child(odd) {
  background: var(--light);
}

/* === RESPONSIVE === */
@media (max-width: 900px) {
  .servicios .servicio,
  .servicios .servicio.invertido {
    flex-direction: column;
    text-align: center;
  }

  .servicios .servicio img {
    width: 100%;
    height: 240px;
  }

  .servicios .servicio .texto {
    width: 100%;
    padding: 24px 20px;
  }

  .servicios .servicio .texto h3 {
    font-size: 1.3rem;
  }

  .servicios .servicio .texto p {
    font-size: 0.95rem;
  }
}

/* === LINK MANUALES PROYECTOS === */
.manual-link {
  display: inline-block;
  margin-top: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--secondary);
  transition: var(--transition);
}

.manual-link:hover {
  color: var(--primary);
  text-decoration: underline;
}


/* === CONTACTO (versión moderna final) === */
.contacto {
  padding: 0;
  background: none;
}

.contacto-bg {
  background: linear-gradient(135deg, #0B4BB3 0%, #4FC3F7 100%);
  padding: 100px 20px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.contacto-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
}

.contacto-form {
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
  padding: 50px 40px;
  max-width: 600px;
  width: 100%;
  text-align: center;
  animation: fadeIn 0.6s ease-out;
}

.contacto-form h2 {
  color: var(--primary);
  font-size: 2rem;
  margin-bottom: 10px;
  font-weight: 700;
}

.contacto-form .subtitulo {
  color: #555;
  margin-bottom: 30px;
  font-size: 1rem;
}

.contact-box {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.contact-box .row {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}
.contact-box .row div {
  flex: 1;
}

.input {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid #ddd;
  border-radius: 10px;
  font-family: inherit;
  font-size: 0.95rem;
  background: #fafafa;
  transition: all 0.3s ease;
}

.input:focus {
  border-color: var(--primary);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(11, 75, 179, 0.15);
}

.contacto .btn.primary {
  background: var(--primary);
  color: #fff;
  font-weight: 600;
  font-size: 1rem;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  border-radius: 10px;
  padding: 14px;
  transition: all 0.3s ease;
  margin-top: 10px;
}
.contacto .btn.primary:hover {
  background: var(--secondary);
  color: var(--dark);
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.nota {
  margin-top: 15px;
  color: #888;
  font-size: 0.85rem;
}

/* Animación */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

/* === RESPONSIVE === */
@media (max-width: 600px) {
  .contacto-form {
    padding: 40px 25px;
  }
  .contacto-form h2 {
    font-size: 1.6rem;
  }
  .contact-box .row {
    flex-direction: column;
  }
}


/* === FOOTER === */
.footer {
  background: var(--dark);
  color: #fff;
  padding: 60px 0;
}
.footer .container.cols {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 24px;
}
.footer a { color: var(--secondary); }
.footer a:hover { color: #fff; }

/* === RESPONSIVE === */
@media (max-width: 900px) {
  .hero-flex { grid-template-columns: 1fr; text-align: center; }
  .cta { justify-content: center; }
  .hero-banner { margin-top: 30px; }
  .menu {
    display: none;
    flex-direction: column;
    background: var(--light);
    position: absolute;
    top: 70px;
    right: 10px;
    padding: 20px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
  }
  .menu.show { display: flex; }
  .menu-toggle { display: block; color: var(--primary); }