/* ========================================================
   VARIABLES DE CONTROL SINTÁCTICO DE INGENIERÍA
   ======================================================== */
:root {
  --electric: #2563EB;
  --electric-bright: #3B82F6;
  --bg-deep: #020408;
  --bg-card: rgba(6, 10, 20, 0.75);
  --text-primary: #F1F5F9;
  --text-secondary: #94A3B8;
  --font-display: 'Barlow Condensed', sans-serif;
}

/* REGLAS ESTRUCTURALES LOCALES */
*, *::before, *::after { 
  box-sizing: border-box; 
  margin: 0; 
  padding: 0; 
}

body { 
  background: var(--bg-deep); 
  color: var(--text-primary); 
  font-family: 'DM Sans', sans-serif; 
  overflow-x: hidden; 
}

/* ========================================================
   FONDO DE PLACA ELECTRÓNICA ANIMADA
   ======================================================== */
.pcb-background {
  position: fixed; 
  inset: 0; 
  z-index: -1;
  background: radial-gradient(circle at center, #0a1b35 0%, #020408 100%);
  overflow: hidden;
}

.pcb-svg {
  position: absolute; 
  width: 120%; 
  height: 120%; 
  top: -10%; 
  left: -10%;
  opacity: 0.35;
  stroke: var(--electric-bright);
  fill: none;
}

.circuit-path {
  stroke-dasharray: 400;
  stroke-dashoffset: 800;
  animation: dash 4s linear infinite;
  stroke-width: 1.5;
}

@keyframes dash { 
  to { stroke-dashoffset: 0; } 
}

/* ========================================================
   BARRA DE NAVEGACIÓN SUPERIOR (NAV)
   ======================================================== */
nav {
  position: fixed; 
  top: 0; 
  width: 100%; 
  z-index: 100;
  display: flex; 
  align-items: center; 
  justify-content: space-between;
  padding: 1rem 5vw; 
  background: rgba(2, 4, 8, 0.9); 
  backdrop-filter: blur(15px);
  border-bottom: 2px solid var(--electric);
}

.logo-nav { 
  height: 48px; 
  width: auto; 
  filter: drop-shadow(0 0 8px var(--electric)); 
}

.nav-links {
  display: flex;
  gap: 2.5rem;
}

.nav-links a {
  color: var(--text-secondary);
  text-decoration: none;
  font-family: var(--font-display);
  font-size: 1.15rem;
  text-transform: uppercase;
  font-weight: 600;
  letter-spacing: 1px;
  position: relative;
  padding: 0.5rem 0;
  transition: all 0.3s ease;
}

.nav-links a:hover {
  color: #fff;
  text-shadow: 0 0 10px var(--electric-bright);
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--electric-bright);
  transition: width 0.3s ease;
}

.nav-links a:hover::after {
  width: 100%;
}

@media (max-width: 600px) {
  nav {
    flex-direction: column;
    gap: 1rem;
    padding: 1rem;
  }
  .nav-links {
    gap: 1.5rem;
  }
}

/* ========================================================
   SECCIÓN DE BIENVENIDA (HERO CENTRAL)
   ======================================================== */
.hero { 
  min-height: 100vh; 
  display: flex; 
  align-items: center; 
  justify-content: center; 
  text-align: center; 
  padding: 0 5vw; 
}

.hero-content { 
  position: relative; 
  z-index: 10; 
  max-width: 900px; 
  display: flex;
  flex-direction: column;
  align-items: center; 
}

h1 { 
  font-family: var(--font-display); 
  font-size: clamp(3.5rem, 10vw, 6.5rem); 
  font-weight: 800; 
  text-transform: uppercase; 
  line-height: 0.85; 
  margin-bottom: 1.5rem; 
}

h1 span { 
  color: var(--electric-bright); 
  display: block; 
  text-shadow: 0 0 35px var(--electric); 
}

.hero-sub { 
  color: var(--text-secondary); 
  font-size: 1.35rem; 
  font-weight: 300; 
  margin-bottom: 2.5rem; 
  max-width: 650px; 
}

.btn { 
  display: inline-block; 
  background: var(--electric); 
  color: white; 
  padding: 1.2rem 3rem; 
  border-radius: 4px; 
  text-decoration: none; 
  font-family: var(--font-display); 
  font-weight: 700; 
  text-transform: uppercase; 
  letter-spacing: 1.5px; 
  box-shadow: 0 5px 20px rgba(37, 99, 235, 0.5); 
  transition: 0.3s; 
}

.btn:hover { 
  background: var(--electric-bright); 
  transform: scale(1.05); 
}

/* ========================================================
   OPCIÓN 1: SERVICIOS EN CUADRÍCULA (GRID)
   ======================================================== */
.services-grid {
  display: grid; 
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 2rem; 
  padding: 5rem 5vw 2rem 5vw; 
  position: relative; 
  z-index: 10;
}

.card {
  background: var(--bg-card); 
  border: 1px solid rgba(59, 130, 246, 0.2);
  padding: 3rem 2rem; 
  border-radius: 12px; 
  backdrop-filter: blur(8px);
  text-align: center; 
  transition: 0.5s;
}

.card:hover { 
  border-color: #fff; 
  background: rgba(15, 23, 42, 0.9); 
  transform: translateY(-12px); 
}

.tech-icon {
  width: 65px; 
  height: 65px; 
  margin-bottom: 1.5rem;
  stroke: var(--electric-bright); 
  fill: none; 
  stroke-width: 1.5;
  filter: drop-shadow(0 0 10px var(--electric-bright));
  transition: stroke 0.3s ease;
}

.card:hover .tech-icon { 
  stroke: #fff; 
}

.card h3 { 
  font-family: var(--font-display); 
  font-size: 1.5rem; 
  text-transform: uppercase; 
  color: #fff; 
  margin: 0;
  letter-spacing: 1px;
}

/* ========================================================
   OPCIÓN 2: LÍNEA DE TIEMPO INDUSTRIAL (TECH-FLOW)
   ======================================================== */
.static-tech-svg {
  width: 70px;
  height: 70px;
  stroke: var(--electric-bright);
  fill: none;
  transition: transform 0.3s ease;
}

.flow-item:hover .static-tech-svg {
  transform: scale(1.1);
  stroke: #fff;
}

.tech-flow { 
  position: relative; 
  max-width: 900px; 
  margin: 0 auto; 
  padding: 60px 5vw; 
}

.flow-line { 
  position: absolute; 
  left: 50px; 
  top: 0; 
  bottom: 0; 
  width: 1px; 
  background: rgba(59, 130, 246, 0.15); 
}

.flow-item { 
  position: relative; 
  margin-bottom: 50px; 
  padding-left: 100px; 
  display: flex; 
  align-items: center; 
}

.flow-dot { 
  position: absolute; 
  left: 45px; 
  width: 10px; 
  height: 10px; 
  background: var(--bg-deep); 
  border: 2px solid var(--electric-bright); 
  border-radius: 50%; 
}

.flow-content { 
  display: flex; 
  align-items: center; 
  gap: 40px; 
  padding: 25px; 
  border-radius: 4px; 
  border: 1px solid transparent; 
  width: 100%; 
  transition: 0.3s; 
}

.flow-item:hover .flow-content { 
  background: rgba(37, 99, 235, 0.04); 
  border-color: rgba(59,130,246,0.2);
}

.flow-text h3 { 
  font-family: var(--font-display); 
  font-size: 1.7rem; 
  text-transform: uppercase; 
  color: #fff; 
  margin-bottom: 5px; 
}

.flow-text p { 
  color: var(--text-secondary); 
  font-size: 1.05rem; 
  line-height: 1.4; 
}

/* ========================================================
   SECCIÓN MÉTRICAS GLOBALES (HORIZONTAL AUTOMÁTICA)
   ======================================================== */
.tech-stats {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  gap: 4rem; 
  max-width: 1100px;
  margin: 8rem auto;
  padding: 0 5vw;
  position: relative;
  z-index: 10;
}

.stat-box {
  background: transparent; 
  border: none;
  border-bottom: 2px solid rgba(59, 130, 246, 0.2);
  padding: 2rem 1rem;
  text-align: center;
  flex: 1; 
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.stat-box:hover {
  border-bottom-color: var(--electric-bright);
  transform: translateY(-5px);
}

.stat-number {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 4vw, 4.2rem); 
  font-weight: 800;
  color: #fff;
  line-height: 1;
  margin-bottom: 1rem;
  text-shadow: 0 0 25px rgba(37, 99, 235, 0.6);
}

.stat-number span {
  color: var(--electric-bright);
}

.stat-label {
  font-family: var(--font-display);
  text-transform: uppercase;
  color: var(--text-secondary);
  font-size: 1.1rem;
  letter-spacing: 2px;
  font-weight: 600;
}


/* ========================================================
   RESPONSIVO MULTIPLATAFORMA: MENÚ SUPERIOR BLINDADO
   ======================================================== */
@media (max-width: 600px) {
  nav {
    flex-direction: column;
    gap: 0.5rem; /* Reducimos el espacio entre el logo y los botones */
    padding: 0.6rem 1rem; /* Reducimos el grosor de la barra superior */
  }
  
  .nav-links {
    gap: 1rem; /* Compactamos la separación entre los 4 botones en el móvil */
    width: 100%;
    justify-content: center; /* Asegura que se alineen en una fila horizontal centrada */
    flex-wrap: wrap; /* Si la pantalla es extremadamente estrecha, los baja de fila limpiamente */
  }

  .nav-links a {
    font-size: 0.95rem; /* Ajustamos el tamaño de la letra para ganar espacio visual */
    padding: 0.2rem 0;
  }
}


/* ========================================================
   SECCIÓN CONTACTO Y FORMULARIO INDUSTRIAL
   ======================================================== */
.contact-section {
  max-width: 850px;
  margin: 6rem auto 10rem auto;
  padding: 0 5vw;
  position: relative;
  z-index: 10;
}

.contact-header {
  text-align: center;
  margin-bottom: 3.5rem;
}

.contact-header h2 {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 5vw, 3.8rem);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 1rem;
}

.contact-header h2 span {
  color: var(--electric-bright);
  text-shadow: 0 0 25px rgba(37, 99, 235, 0.4);
}

.contact-header p {
  color: var(--text-secondary);
  font-size: 1.1rem;
}

.tech-form {
  background: var(--bg-card);
  border: 1px solid rgba(59, 130, 246, 0.15);
  padding: 3rem 2.5rem;
  border-radius: 8px;
  backdrop-filter: blur(12px);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.form-group label {
  font-family: var(--font-display);
  text-transform: uppercase;
  font-size: 0.95rem;
  color: var(--text-primary);
  letter-spacing: 1px;
}

.tech-form input,
.tech-form select,
.tech-form textarea {
  background: rgba(2, 4, 8, 0.8);
  border: 1px solid rgba(59, 130, 246, 0.3);
  padding: 1rem;
  color: #fff;
  font-family: 'DM Sans', sans-serif;
  font-size: 1rem;
  border-radius: 4px;
  width: 100%;
  transition: all 0.3s ease;
}

.tech-form input:focus,
.tech-form select:focus,
.tech-form textarea:focus {
  outline: none;
  border-color: var(--electric-bright);
  box-shadow: 0 0 15px rgba(59, 130, 246, 0.3);
  background: rgba(6, 10, 20, 0.9);
}

.tech-form select option {
  background: #060a14;
  color: #fff;
}

.btn-form {
  width: 100%;
  border: none;
  cursor: pointer;
}

.form-submit {
  margin-top: 1rem;
}

@media (max-width: 480px) {
  .tech-form {
    padding: 2rem 1.5rem;
  }
}

/* ========================================================
   BOTÓN FLOTANTE DE WHATSAPP FIX
   ======================================================== */
.wa-float-compact {
  position: fixed;
  bottom: 2.5rem;
  right: 2.5rem;
  z-index: 200;
  width: 60px;
  height: 60px;
  background-color: #25D366;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.6);
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.wa-float-compact:hover {
  transform: scale(1.1) translateY(-4px);
  box-shadow: 0 10px 25px rgba(37, 211, 102, 0.4);
}

.wa-icon-svg {
  width: 32px;
  height: 32px;
  fill: #ffffff;
}

/* ========================================================
   PIE DE PÁGINA INDUSTRIAL (FILAS APILADAS)
   ======================================================== */
.tech-footer {
  border-top: 1px solid rgba(59, 130, 246, 0.15);
  background: rgba(2, 4, 8, 0.85);
  backdrop-filter: blur(10px);
  padding: 3rem 5vw;
  position: relative;
  z-index: 10;
  margin-top: 4rem;
}

.footer-content {
  max-width: 100%; /* Elimina topes centrales para expandir a los extremos */
  margin: 0 auto;
  display: flex;
  justify-content: space-between; /* Empuja el Copyright a la izquierda y el contacto a la derecha */
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 2rem;
}


.footer-contact-list {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.6rem;
  text-align: right;
}

.footer-link {
  font-family: var(--font-display);
  font-size: 1.05rem;
  color: var(--electric-bright);
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 1px;
  transition: all 0.3s ease;
}

.footer-link:hover {
  color: #fff;
  text-shadow: 0 0 8px var(--electric-bright);
}

.footer-text-address {
  font-family: 'DM Sans', sans-serif;
  color: var(--text-secondary);
  font-size: 0.95rem;
  margin-top: 0.4rem;
}

@media (max-width: 768px) {
  .footer-content {
    flex-direction: column-reverse;
    align-items: center;
    text-align: center;
    gap: 1.5rem;
  }
  .footer-contact-list {
    align-items: center;
    text-align: center;
    width: 100%;
  }
}

/* ========================================================
   CONTENEDOR DE GOOGLE MAPS INDUSTRIAL
   ======================================================== */
.map-container {
  width: 100%;
  height: 350px;
  margin-top: 3rem;
  border-radius: 6px;
  border: 1px solid rgba(59, 130, 246, 0.3);
  overflow: hidden;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
  position: relative;
  z-index: 10;
}

.map-container:hover {
  border-color: var(--electric-bright);
  box-shadow: 0 0 25px rgba(37, 99, 235, 0.2);
}

@media (max-width: 480px) {
  .map-container {
    height: 280px;
    margin-top: 2rem;
  }
}

/* ========================================================
   CONTENEDOR Y BOTÓN DE ACCESO A MAPAS
   ======================================================== */
.map-action-container {
  width: 100%;
  text-align: center;
  margin: 4rem auto;
  padding: 0 5vw;
  position: relative;
  z-index: 10;
}

.btn-mapa {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.8rem;
  background: transparent;
  border: 1px solid var(--electric-bright);
  color: #fff;
  padding: 1.2rem 2.5rem;
  border-radius: 4px;
  font-family: var(--font-display);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  cursor: pointer;
  box-shadow: 0 0 15px rgba(37, 99, 235, 0.2);
  transition: all 0.3s ease;
}

.btn-mapa:hover {
  background: var(--electric);
  box-shadow: 0 0 25px rgba(37, 99, 235, 0.5);
  transform: translateY(-3px);
}

.map-icon-svg {
  stroke: var(--electric-bright);
  transition: stroke 0.3s ease;
}

.btn-mapa:hover .map-icon-svg {
  stroke: #fff;
}

.map-address-sub {
  color: var(--text-secondary);
  font-size: 1rem;
  margin-top: 1rem;
  font-family: 'DM Sans', sans-serif;
}

/* ========================================================
   BOTÓN COMPACTO DE INSTAGRAM EN EL FOOTER
   ======================================================== */
.instagram-footer-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.95rem;
  margin-top: 0.5rem;
  cursor: pointer;
  padding: 0;
  transition: color 0.3s ease;
}

.instagram-icon-svg {
  width: 18px; /* Tamaño compacto y discreto */
  height: 18px;
  fill: none;
  stroke: var(--electric-bright);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: all 0.3s ease;
  filter: drop-shadow(0 0 4px rgba(59, 130, 246, 0.3));
}

/* Efecto de iluminación al pasar el cursor */
.instagram-footer-btn:hover {
  color: #fff;
}

.instagram-footer-btn:hover .instagram-icon-svg {
  stroke: #fff;
  transform: scale(1.1);
  filter: drop-shadow(0 0 8px #fff);
}

/* Centrado automático en pantallas de teléfono */
@media (max-width: 768px) {
  .instagram-footer-btn {
    justify-content: center;
    margin-top: 0.8rem;
  }
}

.footer-left-block {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.5rem;
}

/* ========================================================
   RESPONSIVO EXCLUSIVO PARA LA SECCIÓN EXPLICATIVA VERTICAL
   ======================================================== */
@media (max-width: 768px) {
  .tech-flow {
    padding: 40px 4vw; /* Suaviza los márgenes laterales del contenedor */
  }

  .flow-line {
    left: 25px; /* Mueve la línea sutil azul hacia la izquierda para ganar espacio */
  }

  .flow-item {
    padding-left: 45px; /* Reduce drásticamente el empuje izquierdo en pantallas móviles */
    margin-bottom: 35px;
    width: 100%;
  }

  .flow-dot {
    left: 20px; /* Realinea el punto del circuito sobre la nueva posición de la línea */
  }

  .flow-content {
    flex-direction: column; /* Apila el icono SVG encima del texto explicativo */
    align-items: flex-start; /* Alinea el contenido al inicio de forma limpia */
    gap: 1rem; /* Compacta el espacio entre el dibujo técnico y la descripción */
    padding: 20px 15px;
  }

  .static-tech-svg {
    width: 55px; /* Hace el icono un poco más compacto en el terminal táctil */
    height: 55px;
  }
}

/* ========================================================
   PARCHE DE CONTROL SEGURO: CONTADORES EN VERTICAL
   ======================================================== */
@media (max-width: 768px) {
  .tech-stats {
    /* Cancela la fila horizontal y los apila uno debajo de otro */
    flex-direction: column !important;
    gap: 3.5rem !important;
    margin: 5rem auto !important;
    padding: 0 8vw !important;
    width: 100% !important;
  }

  .stat-box {
    width: 100% !important;
    flex: none !important;
    padding: 1.5rem 0.5rem !important;
    border-bottom: 2px solid rgba(59, 130, 246, 0.3) !important;
  }

  .stat-number {
    font-size: clamp(3rem, 12vw, 4rem) !important;
    margin-bottom: 0.5rem !important;
  }

  .stat-label {
    font-size: 1.05rem !important;
    letter-spacing: 1.5px !important;
  }
}
