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

html {
  scroll-behavior: smooth;
}

body {
  font-family: "Montserrat", sans-serif;
  color: #fff;
  background-color: #0b0d17; /* Fondo oscuro para resaltar */
}

/* --- ESTILOS FUERA DEL MEDIA QUERY --- */
.burger {
  display: none; /* Oculto en PC */
  cursor: pointer;
}

.burger div {
  width: 25px;
  height: 3px;
  background-color: #1a2a4d;
  margin: 5px;
  transition: all 0.3s ease;
}

/* --- HERO SECTION --- */

/* --- HERO SECTION (Base Desktop) --- */ /********************************************************/
.hero {
  position: relative;
  z-index: 1;
  height: 100vh;
  width: 100%;
  background:
    /* Gradiente más claro */
    /*linear-gradient(to right, rgba(0, 0, 0, 0.2), rgba(0, 0, 0, 0.1)),*/ url("../img/logo_castro3.png")
    no-repeat center center / cover;
  display: flex;
  align-items: center;
  padding: 0 10%;
  padding-top: 80px;
  margin-top: 0;
  border-top: none;
}

.hero-content {
  z-index: 10;
  display: flex;
  flex-direction: column;
  max-width: 900px;
  flex-grow: 1;
}

.hero-subtitle {
  margin-top: 25px;
  font-weight: 600;
  letter-spacing: 2px;
  font-size: 1rem;
  margin-bottom: 1rem;
  color: #e0e0e0;
}

.hero-subtitle {
  margin-bottom: 20px; /* espacio debajo del texto */
  position: relative;
  text-align: left; /* 🔹 alinea el texto y la línea */
}

.hero-subtitle::after {
  content: "";
  display: block;
  width: 100px; /* largo de la línea */
  height: 4px; /* grosor */
  background-color: #3b5998; /* azul de tu marca */
  margin-top: 15px; /* espacio entre texto y línea */
  margin-left: 0; /* 🔹 pegada a la izquierda */
}

.hero-title {
  font-size: 2.5rem;
  font-weight: 600;
  line-height: 1.1;
  margin-bottom: 1.5rem;
}

.hero-title span {
  color: #fff;
}

.resaltado {
  color: #3b5998; /* azul de tu marca */
  font-weight: 800; /* más grueso */
  text-transform: uppercase;
}

/* --- MEDIA QUERY (Manda sobre todo lo anterior en 768px) --- */
@media (max-width: 768px) {
  .hero {
    min-height: 70vh;
    height: auto;
    padding: 120px 5% 60px 5%; /* Espacio extra para que no lo tape el header blanco */
    justify-content: center !important;
    align-items: center !important;
    text-align: center !important;
    background-position: center center !important;
    background-attachment: scroll;
  }

  .hero-content {
    align-items: center !important;
    max-width: 100%;
  }

  .hero-title {
    font-size: 2.2rem !important;
    line-height: 1.2;
  }

  .hero-title br {
    display: none; /* Evita saltos de línea raros en pantallas angostas */
  }
}
/* --- NAVEGACIÓN --- */
.header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  background-color: rgba(255, 255, 255, 0.5);
  z-index: 9999;
  /* Eliminamos cualquier borde que ande molestando */
  border-bottom: none;
  box-shadow: 0 2px 15px rgba(0, 0, 0, 0.05); /* Sombra muy sutil */
}
/* Aseguramos que el contenido del nav se vea */
.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 90px; /* Un poquito más de aire para el logo */
  padding: 0 10%;
}

.logo-container {
  display: flex;
  align-items: center;
}

.logo {
  height: 55px; /* Ajustalo para que luzca bien en la franja blanca */
  width: auto;
  display: block;
}
.nav-menu {
  display: flex;
  list-style: none;
  /* Eliminamos el margin-left que estaba en los 'li' y usamos solo gap */
  gap: 20px;
  align-items: center;
}

.nav-menu li {
  margin-left: 0; /* Quitamos el margen extra para que no se sume al gap */
}

.nav-menu a {
  text-decoration: none;
  color: #1a2a4d;
  font-weight: 700;
  /* Bajamos de 0.9rem a 0.8rem para que respire mejor */
  font-size: 0.8rem;
  text-transform: uppercase;
  position: relative;
  padding: 5px 0;
  transition: color 0.3s ease;
  /* Evita que el texto se rompa en dos líneas si el contenedor es chico */
  white-space: nowrap;
}

/* El efecto hover se mantiene igual, no hace falta tocarlo */
.nav-menu a::after {
  content: "";
  position: absolute;
  width: 0;
  height: 3px;
  bottom: -2px;
  left: 0;
  background-color: #3b5998;
  transition: width 0.3s ease;
}

/* Estado activo (Inicio) y Hover */
.nav-menu a:hover::after,
.nav-menu a.active::after {
  width: 100%;
}

.nav-menu a:hover {
  color: #3b5998;
}

@media (max-width: 768px) {
  /* Botón hamburguesa */
  .burger {
    display: block !important;
    z-index: 10001;
  }

  .nav-menu {
    position: fixed;
    right: 0;
    top: 0;

    /* Aumentamos un poco de 50 a 60 para que entren bien los textos largos */
    width: 60% !important;
    height: 55vh !important;

    /* PADDING: Esto es lo que evita que los links toquen los bordes */
    padding: 30px 15px; /* 30px arriba/abajo, 15px a los costados */

    background: rgba(26, 42, 77, 0.98); /* Un poco más sólido para leer mejor */
    display: flex;
    flex-direction: column;

    /* Cambiamos center por space-evenly para que se repartan mejor a lo alto */
    justify-content: space-evenly;
    align-items: center;

    /* Animación */
    transform: translate(100%, -100%);
    transition: transform 0.4s ease;
    z-index: 10000;
    border-bottom-left-radius: 20px;
    box-shadow: -5px 5px 20px rgba(0, 0, 0, 0.4);
  }

  .nav-menu.nav-active {
    transform: translate(0, 0);
  }

  .nav-menu li {
    width: 100%; /* Para que el texto tenga todo el ancho del contenedor */
    text-align: center;
    list-style: none;
  }

  .nav-menu a {
    display: block;
    font-size: 1rem;
    color: #fff;
    text-decoration: none;
    text-transform: uppercase;
    /* Evita que "Nuestros Trabajos" se amontone */
    white-space: normal;
    padding: 5px 10px;
  }
  /* --- ARREGLO DE CARDS MAQUINARIA --- */
  .machinery-grid {
    grid-template-columns: 1fr !important;
    gap: 25px;
    padding: 0 15px;
  }

  .mobile-info-btn {
    display: flex !important;
    flex-direction: column;
    align-items: center;
    padding: 15px;
    background: #fff;
  }

  .mobile-machine-title {
    display: block !important;
    color: #1a2a4d;
    font-weight: bold;
    margin-bottom: 10px;
  }
}

/* Ajuste para el Hero debido al header fixed */

/* --- BOTONES --- */
.btn-cotizar {
  display: inline-block;
  width: fit-content;
  padding: 10px 32px;
  background-color: #0f3483; /* Azul basado en el logo */
  color: white;
  text-decoration: none;
  font-weight: 700;
  text-transform: uppercase;
  border-radius: 4px;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.btn-cotizar:hover {
  background-color: #2d4373;
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}

/* --- WHATSAPP FLOTANTE --- */
.whatsapp-float {
  position: fixed;
  width: 60px;
  height: 60px;
  bottom: 40px;
  right: 40px;
  background-color: #25d366; /* Verde oficial de WhatsApp */
  color: #fff;
  border-radius: 50px;
  text-align: center;
  font-size: 30px;
  box-shadow: 2px 2px 3px #999;
  z-index: 10000; /* Siempre por encima del navbar y hero */
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}

.whatsapp-float:hover {
  transform: scale(1.1); /* Efecto de crecimiento al pasar el mouse */
  background-color: #0f3483; /* Verde más oscuro */
}

/* Ajuste para que el SVG quede bien centrado */
.whatsapp-float svg {
  width: 35px;
  height: 35px;
}

/* Responsivo para móviles */
@media (max-width: 768px) {
  .hero-title {
    font-size: 2.5rem;
  }
  .hero-content {
    padding: 0 5%;
    text-align: center;
    align-items: center;
  }
}

/* --- SECCIÓN SOBRE NOSOTROS --- */
.about {
  padding: 100px 10%;
  background-color: #fcfcfc; /* Un blanco roto apenas para despegar del blanco puro */
  color: #1a1a1a;
}

.about-flex {
  display: flex;
  align-items: center;
  gap: 60px;
  margin-bottom: 100px;
}

.about-text {
  flex: 1.2;
}

.about-text h2 {
  font-size: 2.8rem;
  font-weight: 800;
  margin-bottom: 30px;
  color: #000;
}

.about-text p {
  font-size: 1.1rem;
  line-height: 1.8;
  margin-bottom: 25px;
  color: #444;
}

.about-gallery {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.about-img {
  width: 100%;
  height: auto;
  border-radius: 2px; /* Casi recto como en la foto */
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

/* --- POR QUÉ NOSOTROS --- */
.why-us {
  text-align: center;
}

.why-us h3 {
  font-size: 2.8rem;
  font-weight: 800;
  margin-bottom: 60px;
}

.values-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 40px;
}

.value-card {
  padding: 20px;
}

.value-icon {
  width: 70px;
  height: 70px;
  object-fit: contain;
  margin-bottom: 30px;
}

.value-card h4 {
  font-size: 1.2rem;
  font-weight: 800;
  margin-bottom: 20px;
  color: #000;
  line-height: 1.3;
}

.value-card p {
  font-size: 1rem;
  color: #555;
  line-height: 1.5;
}

/* --- RESPONSIVE 768px --- */
@media (max-width: 768px) {
  .about-flex {
    flex-direction: column;
    text-align: center;
  }

  .values-grid {
    grid-template-columns: 1fr; /* Uno debajo del otro en móvil */
  }

  .about-text h2,
  .why-us h3 {
    font-size: 2rem;
  }
}

/* --- SECCIÓN SERVICIOS --- */
.services {
  padding: 80px 0;
  background-color: #ffffff;
  color: #333;
}

.service-row {
  display: flex;
  align-items: stretch; /* Estira imagen y texto para que midan lo mismo */
  width: 100%;
  min-height: 500px;
  overflow: hidden;
}

.services-container {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 0; /* Las filas van pegadas para un diseño limpio */
}
/* El efecto espejo para la fila del medio */
.service-row.reverse {
  flex-direction: row-reverse;
}

.service-image {
  flex: 1;
  width: 50%;
  position: relative;
}

.service-text {
  flex: 1;
  width: 50%;
  display: flex;
  flex-direction: column;
  justify-content: center; /* Centra el texto verticalmente respecto a la imagen */
  padding: 60px 8%; /* Espaciado generoso para que no toque los bordes */
  background-color: #ffffff;
}

.service-image img {
  width: 100%;
  height: 100%;
  object-fit: cover; /* Hace que la imagen llene el espacio sin deformarse */
  display: block;
}

.service-text {
  padding: 60px 10%; /* Espaciado interno para el texto */
}

.service-text h2 {
  font-size: 2.5rem;
  color: #1a2a4d;
  font-weight: 800;
  margin-bottom: 20px;
  position: relative;
}

.service-text h2::after {
  content: "";
  display: block;
  width: 50px;
  height: 4px;
  background-color: #3b5998;
  margin-top: 10px;
}

.service-text p {
  font-size: 1.1rem;
  line-height: 1.7;
  margin-bottom: 20px;
  color: #555;
}

.service-text ul {
  list-style: none;
  padding: 0;
}

.service-text ul li {
  position: relative;
  padding-left: 25px;
  margin-bottom: 12px;
  font-size: 1rem;
  font-weight: 500;
}

/* Agregamos un pequeño punto azul personalizado para la lista */
.service-text ul li::before {
  content: "✓"; /* Check elegante para servicios */
  color: #3b5998;
  font-weight: bold;
  position: absolute;
  left: 0;
}

/* --- RESPONSIVE --- */
@media (max-width: 768px) {
  .service-row,
  .service-row.reverse {
    flex-direction: column; /* En móvil, todo uno abajo del otro */
  }

  .service-image,
  .service-text {
    width: 100%;
    flex: none;
  }

  .service-text {
    padding: 40px 10%;
  }
}

@media (max-width: 768px) {
  /* Separamos las filas para que no se peguen entre sí */
  .service-row {
    margin-bottom: 50px !important;
    flex-direction: column !important;
  }

  /* Ajustamos el contenedor de la imagen para que no choque los bordes */
  .service-image {
    width: 100% !important;
    padding: 0 20px !important; /* Margen lateral para la imagen */
    box-sizing: border-box !important;
  }

  .service-image img {
    width: 100% !important;
    height: auto !important;
    border-radius: 15px !important; /* Esquinas redondeadas para que no sea tan rústico */
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1) !important; /* Una sombra suave */
  }

  /* Ajuste solo para pantallas grandes */
  @media (min-width: 1024px) {
    .service-row .service-image {
      padding-left: 10px; /* espacio desde el borde izquierdo */
      padding-right: 10px; /* opcional, para equilibrar */
      box-sizing: border-box;
    }
  }
  @media (min-width: 1024px) {
    .service-row:nth-child(1) .service-image,
    .service-row:nth-child(3) .service-image {
      padding-left: 40px;
    }
  }

  /* El texto ya lo tenías bien, pero aseguramos que coincida el margen */
  .service-text {
    width: 100% !important;
    padding: 30px 20px !important; /* Alineado con el margen de la imagen */
    text-align: left !important; /* Mejor lectura en móvil */
  }

  .service-text h2 {
    font-size: 1.5rem !important;
    margin-bottom: 15px !important;
  }

  .service-text ul {
    padding-left: 20px !important;
  }
}

/* Ajuste fino para pantallas muy grandes */
@media (min-width: 1400px) {
  .service-text {
    padding: 60px 12%;
  }
}

.works {
  padding: 80px 0;
  background-color: #f9f9f9;
  overflow: hidden; /* Evita que el slider rompa el ancho de la web */
}

.works h2 {
  text-align: center;
  font-family: "Montserrat", sans-serif;
  font-weight: 800;
  font-size: 2.5rem;
  margin-bottom: 50px;
  color: #1a2a4d;
}

/* Contenedor del Slider */
.slider {
  width: 100%;
  margin: auto;
  overflow: hidden;
  background: white; /* Opcional: fondo para resaltar */
  padding: 20px 0;
}

.slide-track {
  display: flex;
  /* CÁLCULO: Ancho de cada slide (450px) * Total de slides (26) */
  width: calc(450px * 26);
  animation: scroll 40s linear infinite; /* Aumenté a 40s porque al ser más ancho recorre más distancia */
}

.slide {
  /* Aumentamos el ancho de 350px a 450px */
  width: 450px;
  padding: 10px; /* Reduje un poco el padding para que la foto luzca más grande */
  box-sizing: border-box;
}

.slide img {
  width: 100%;
  height: 350px;
  /* Aumentamos la altura a 300px para mantener la proporción con el nuevo ancho */
  height: 300px;
  border-radius: 12px;
  box-shadow: 0 6px 15px rgba(0, 0, 0, 0.15);
  transition: transform 0.3s ease;
  object-fit: contain;
  display: block;
  background-color: #f4f4f4;
}

.slide img:hover {
  transform: scale(1.03);
}

/* Animación de movimiento */
@keyframes scroll {
  0% {
    transform: translateX(0);
  }
  100% {
    /* Debe desplazarse exactamente la mitad del ancho total (las 13 fotos originales) */
    transform: translateX(calc(-450px * 13));
  }
}
/* Pausar al pasar el mouse para que el cliente pueda ver bien */
.slider:hover .slide-track {
  animation-play-state: paused;
}

.clients {
  padding: 100px 10%;
  text-align: center;
  /* Fondo azul oscuro con efecto de puntos técnicos */
  background-color: #1a2a4d;
  background-image:
    radial-gradient(rgba(255, 255, 255, 0.1) 1px, transparent 1px),
    linear-gradient(to bottom, #1a2a4d, #0d1629);
  background-size:
    30px 30px,
    100% 100%;
  color: #fff;
}

.clients h2 {
  font-size: 2.5rem;
  font-weight: 800;
  margin-bottom: 20px;
}

.clients-subtitle {
  max-width: 800px;
  margin: 0 auto 60px;
  font-size: 1.1rem;
  opacity: 0.9;
  line-height: 1.6;
}

.clients-grid {
  display: grid;
  /* 5 columnas en escritorio, 3 en tablet, 2 en móvil */
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 30px;
  align-items: center;
}

/* --- SECCIÓN CLIENTES (Solo Escritorio) --- */

.client-item {
  background: rgba(255, 255, 255, 0.05);
  padding: 30px;
  border-radius: 8px;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: all 0.4s ease; /* Controla la suavidad de la expansión */
  border: 1px solid rgba(255, 255, 255, 0.1);
  cursor: crosshair;
}

.client-item img {
  width: 100%;
  max-width: 120px;
  height: auto;
  /* Eliminamos el grayscale para que siempre tengan color */
  filter: none;
  opacity: 1; /* Opacidad total para que resalten */
  transition: transform 0.4s ease;
}

/* --- EFECTO HOVER (Expansión) --- */

.client-item:hover {
  /* Expandimos la tarjeta entera */
  transform: scale(1.1);
  background: rgba(255, 255, 255, 0.15);
  border-color: #3b5998;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2); /* Opcional: le da profundidad al expandirse */
}

/* Si prefieres que lo que se expanda sea el logo y no el recuadro, usa esto: */
.client-item:hover img {
  transform: scale(1.05);
}

@media (max-width: 768px) {
  .clients {
    padding: 60px 5%; /* Reducimos padding para ganar espacio */

    /* Invertimos: Fondo blanco/gris muy claro */
    background-color: #f9f9f9;

    /* Puntos oscuros (azul del logo con baja opacidad) */
    background-image:
      radial-gradient(rgba(26, 42, 77, 0.1) 1px, transparent 1px),
      linear-gradient(to bottom, #f9f9f9, #ffffff);

    background-size:
      20px 20px,
      100% 100%; /* Puntos un poco más chicos para móvil */

    /* Cambiamos el color del texto a oscuro para que se lea sobre el fondo claro */
    color: #1a2a4d;
  }

  .clients-subtitle {
    opacity: 0.8;
    color: #444;
  }

  /* Aseguramos que los logos se vean perfectos */
  .client-item {
    background: white;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    border: 1px solid #eee;
  }
}

@media (max-width: 768px) {
  .client-item img {
    /* Quitamos los filtros para que se vean originales */
    filter: grayscale(0%) brightness(100%);
    opacity: 1;
  }

  .client-item {
    /* Quitamos el fondo sutil para que no ensucie en móvil */
    background: transparent;
    border: none;
    padding: 15px; /* Menos espacio para que entren más en pantalla */
  }

  .clients-grid {
    /* Forzamos 3 columnas para que no queden logos gigantes */
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
  }
}

.footer {
  background-color: #ffffff;
  padding: 80px 10% 20px;
  border-top: 1px solid #eee; /* Una línea muy sutil para separar */
  color: #333;
  font-family: "Montserrat", sans-serif;
}

.footer-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 40px;
  margin-bottom: 50px;
}

.footer-column h4 {
  color: #1a2a4d; /* El azul predominante */
  font-weight: 800;
  font-size: 1.2rem;
  margin-bottom: 25px;
  position: relative;
}

/* Una rayita azul debajo del título del footer */
.footer-column h4::after {
  content: "";
  display: block;
  width: 30px;
  height: 3px;
  background-color: #3b5998;
  margin-top: 8px;
}

.footer-column ul {
  list-style: none;
}

.footer-column ul li {
  margin-bottom: 15px;
  font-size: 0.95rem;
  line-height: 1.5;
  color: #555;
}

/* Estilo para los links de redes */
.social-link {
  display: inline-block;
  margin-right: 15px;
  color: #1a2a4d;
  font-weight: 700;
  text-decoration: none;
  transition: color 0.3s ease;
}

.social-link:hover {
  color: #3b5998;
}

.footer-logo {
  max-width: 180px;
  margin-bottom: 15px;
}

/* BARRA DE DERECHOS RESERVADOS */
.footer-bottom {
  border-top: 1px solid #f0f0f0;
  padding-top: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
  color: #888;
}

.footer-bottom a {
  color: #1a2a4d;
  text-decoration: none;
  font-weight: 600;
}

/* RESPONSIVE */
@media (max-width: 768px) {
  .footer-bottom {
    flex-direction: column;
    gap: 10px;
    text-align: center;
  }
}

.footer-column ul li i {
  color: #3b5998; /* El azul del logo */
  margin-right: 12px;
  width: 20px; /* Para que todos los textos queden alineaditos */
  text-align: center;
}

.social-link i {
  margin-right: 8px;
  font-size: 1.1rem;
}

/* --- SECCIÓN MAQUINARIA --- */
.machinery {
  background-color: #ffffff; /* Fondo blanco pedido */
  padding: 80px 10%;
  color: #1a2a4d; /* Texto oscuro para contraste */
  text-align: center;
}

.section-title {
  font-size: 2.5rem;
  font-weight: 800;
  margin-bottom: 10px;
  text-transform: uppercase;
}

.section-subtitle {
  font-size: 1.1rem;
  color: #666;
  margin-bottom: 40px;
}

/* Grilla */
.machinery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 30px;
}

.machine-card {
  background: #fdfdfd;
  border: 1px solid #eee;
  overflow: hidden;
  position: relative;
  transition: transform 0.3s ease;
}

.machine-img-container {
  position: relative;
  width: 100%;
  aspect-ratio: 4/3;
  overflow: hidden;
}

.machine-img {
  width: 100%;
  height: 100%;
  object-fit: contain; /* Para que la máquina no se corte */
  padding: 20px;
}

/* Overlay Desktop (Hover) */
.machine-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(26, 42, 77, 0.9);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  opacity: 0;
  transition: opacity 0.3s ease;
  color: #fff;
  padding: 20px;
}

.machine-overlay h3 {
  font-size: 1.2rem;
  margin-bottom: 15px;
}

.btn-desktop {
  padding: 10px 20px;
  background: #3b5998;
  color: white;
  border: none;
  cursor: pointer;
  font-weight: 700;
  border-radius: 6px;
}

.btn-desktop:hover {
  background: #2d4373;
  transform: scale(1.05); /* Un pequeño efecto de pulso al pasar el mouse */
}

/* Mostrar hover solo en Desktop */
@media (min-width: 769px) {
  .machine-card:hover .machine-overlay {
    opacity: 1;
  }
  .mobile-info-btn {
    display: none; /* Escondido en PC */
  }
}

/* Ajustes para 768px (Mobile) */
@media (max-width: 768px) {
  .machine-overlay {
    display: none; /* Desactiva el hover en táctil */
  }

  .mobile-info-btn {
    padding: 15px;
    background: #fff;
    border-top: 1px solid #eee;
  }

  .mobile-info-btn button {
    width: 100%;
    padding: 12px;
    background-color: #1a2a4d;
    color: white;
    border: none;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-radius: 4px;
  }
}

/* Botón para Mobile (768px) */
@media (max-width: 768px) {
  .mobile-info-btn {
    /* Asegurate que el nombre de clase coincida con tu HTML */
    width: 100%;
    padding: 12px;
    background-color: #1a2a4d;
    color: white;
    border: none;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-radius: 8px; /* Radio un poco más marcado para que sea fácil de tocar con el dedo */
  }
}

/* Fondo oscuro detrás del modal */
.modal-overlay {
  display: none; /* Oculto por defecto */
  position: fixed;
  z-index: 10000; /* Por encima de todo */
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.8);
  justify-content: center;
  align-items: center;
  padding: 20px;
}

/* Caja blanca del modal */
.modal-content {
  background-color: #fff;
  padding: 30px;
  border-radius: 12px;
  max-width: 500px;
  width: 100%;
  position: relative;
  color: #1a2a4d;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

/* Botón cerrar (X) */
.close-modal {
  position: absolute;
  top: 15px;
  right: 20px;
  font-size: 28px;
  font-weight: bold;
  cursor: pointer;
  color: #aaa;
}

.close-modal:hover {
  color: #1a2a4d;
}

/* Estilo de la ficha técnica dentro del modal */
.tech-spec-list {
  list-style: none;
  margin-top: 20px;
  padding: 0;
}

.tech-spec-list li {
  padding: 10px 0;
  border-bottom: 1px solid #eee;
  font-size: 1rem;
}

.tech-spec-list strong {
  color: #3b5998;
}

/* Estilo del título en Móvil */
.mobile-machine-title {
  display: none; /* Oculto en PC */
  font-size: 0.9rem; /* Tamaño mediano/chico como pediste */
  color: #1a2a4d;
  font-weight: 700;
  margin-bottom: 10px;
  text-transform: uppercase;
  line-height: 1.2;
}

@media (max-width: 768px) {
  .nav-links {
    position: fixed;
    /* Lo pegamos a la derecha */
    right: 0;
    top: 0;

    /* Definimos el tamaño: 70% de ancho y 100% de alto */
    width: 70% !important;
    height: 100vh;

    background-color: #1a2a4d;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;

    /* Efecto: Empieza "escondido" a la derecha (100%) */
    transform: translateX(100%);
    transition: transform 0.5s ease-in-out;

    z-index: 1000;
    box-shadow: -10px 0 20px rgba(0, 0, 0, 0.5);
  }

  /* Cuando se activa, vuelve a su posición original (0) */
  /* Pero como su ancho es 70%, solo llegará a cubrir eso */
  .nav-active {
    transform: translateX(0%);
  }
}

/* --- CONFIGURACIÓN BASE (Escritorio) --- */

/* Ocultamos los elementos móviles en PC */
.mobile-info-btn {
  display: none;
}

/* Efecto Hover para PC */
.machine-card:hover .machine-overlay {
  opacity: 1;
}

/* --- CONFIGURACIÓN MÓVIL (768px) --- */

@media (max-width: 768px) {
  /* 1. La Grilla: Aseguramos una sola columna bien centrada */
  .machinery-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 30px;
    padding: 0 10px;
  }

  /* 2. La Tarjeta: Quitamos alturas fijas que puedan romper el flujo */
  .machine-card {
    height: auto !important;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
  }

  /* 3. Desactivamos el overlay de escritorio en móvil */
  .machine-overlay {
    display: none !important;
  }

  /* 4. Contenedor de Info Móvil: Activamos y ordenamos */
  .mobile-info-btn {
    display: flex !important;
    flex-direction: column;
    align-items: center;
    padding: 20px;
    text-align: center;
  }

  /* 5. El Nombre de la Máquina: Visible y legible */
  .mobile-machine-title {
    display: block !important;
    font-size: 1rem;
    color: #1a2a4d;
    font-weight: 700;
    margin-bottom: 15px;
    text-transform: uppercase;
    line-height: 1.4;
  }

  /* 6. El Botón: Grande y fácil de tocar */
  .mobile-info-btn button {
    width: 100%;
    max-width: 280px;
    padding: 12px;
    background-color: #1a2a4d;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s;
  }

  /* Ajuste de imagen para que no se deforme */
  .machine-img {
    height: 250px;
    object-fit: cover;
  }
}

/*************************************************/

@media (max-width: 768px) {
  /* 1. Ajustamos la grilla para que no se amontone */
  .machinery-grid {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 40px !important;
    padding: 0 20px !important;
  }

  /* 2. Forzamos a que se vea el bloque de info móvil */
  .mobile-info-btn {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    padding: 20px 10px !important;
    background-color: #ffffff !important; /* Fondo blanco para contraste */
    border-radius: 0 0 8px 8px !important;
  }

  /* 3. ARREGLO DEL NOMBRE: Lo hacemos visible y legible */
  .mobile-machine-title {
    display: block !important;
    color: #1a2a4d !important; /* El azul de tu marca */
    font-size: 1.1rem !important;
    font-weight: 800 !important;
    text-transform: uppercase !important;
    margin-bottom: 15px !important;
    text-align: center !important;
    line-height: 1.3 !important;
  }

  /* 4. ARREGLO DEL BOTÓN: Lo hacemos más chico y elegante */
  .mobile-info-btn button {
    display: block !important;
    width: auto !important; /* Que no ocupe todo el ancho */
    min-width: 180px !important;
    padding: 10px 25px !important;
    background-color: #3b5998 !important;
    color: #fff !important;
    border: none !important;
    border-radius: 5px !important;
    font-size: 0.9rem !important;
    font-weight: 700 !important;
    cursor: pointer !important;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1) !important;
  }

  /* 5. Aseguramos que la imagen no sea gigante */
  .machine-img {
    height: 250px !important;
    object-fit: cover !important;
    border-radius: 8px 8px 0 0 !important;
  }

  /* Ocultamos el overlay de desktop que a veces molesta */
  .machine-overlay {
    display: none !important;
  }
}

/*******************************************/

/* --- SECCIÓN SERVICIOS (Desktop Ajustado) --- */
.services {
  padding: 80px 0;
  background-color: #ffffff;
  color: #333;
}

.services-container {
  max-width: 100%; /* Expandido al borde de la pantalla */
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.service-row {
  display: flex;
  align-items: stretch;
  width: 100%;
  min-height: 500px;
  overflow: hidden;
}

.service-row.reverse {
  flex-direction: row-reverse;
}

.service-image {
  flex: 1;
  width: 50%;
  position: relative;
  /* Margen mínimo para aproximar la imagen al borde */
  padding: 0 10px;
  box-sizing: border-box;
}

.service-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 8px; /* Redondeado sutil */
}

.service-text {
  flex: 1;
  width: 50%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 60px 6%; /* Aire interno para el texto */
  background-color: #ffffff;
}

.service-text h2 {
  font-size: 2.5rem;
  color: #1a2a4d;
  font-weight: 800;
  margin-bottom: 20px;
}

.service-text h2::after {
  content: "";
  display: block;
  width: 50px;
  height: 4px;
  background-color: #3b5998;
  margin-top: 10px;
}

.service-text p {
  font-size: 1.1rem;
  line-height: 1.7;
  margin-bottom: 20px;
  color: #555;
}

.service-text ul {
  list-style: none;
  padding: 0;
}

.service-text ul li {
  position: relative;
  padding-left: 25px;
  margin-bottom: 12px;
  font-size: 1rem;
  font-weight: 500;
}

.service-text ul li::before {
  content: "✓";
  color: #3b5998;
  font-weight: bold;
  position: absolute;
  left: 0;
}
/********************************************************/

/* --- MAQUINARIA DESKTOP (3x2) --- */
@media (min-width: 1024px) {
  .machinery-grid {
    display: grid !important;
    /* Forzamos 3 columnas iguales */
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 30px !important;
    max-width: 1200px;
    margin: 0 auto;
  }

  .machine-card {
    width: 100% !important; /* Que ocupen todo el ancho de su celda */
  }
}
/*****************************************************************/

/* --- CLIENTES DESKTOP (5x3) --- */
@media (min-width: 1024px) {
  .clients-grid {
    display: grid !important;
    /* Forzamos 5 columnas iguales */
    grid-template-columns: repeat(5, 1fr) !important;
    gap: 20px !important;
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 0;
  }

  .client-item {
    width: 100% !important;
    aspect-ratio: 1 / 1; /* Opcional: para que las tarjetas sean cuadradas y prolijas */
  }
}

li a {
  text-decoration: none;
  color: #1a2a4d;
  font-weight: 700;
}
li a:hover {
  color: #3b5998;
}

li a {
  text-decoration: none;
  color: #1a2a4d;
  font-weight: 700;
}

li a:hover {
  color: #3b5998;
}
/****************************************************************************************************/
/****************************************************************************************************/
/* 1. Definimos la animación (asegurate de tenerla una sola vez en tu CSS) */
/*@keyframes slideInFromLeft {
  0% {
    transform: translateX(-100%);
    opacity: 0;
  }
  100% {
    transform: translateX(80px);
    opacity: 1;
  }
}

/* 2. Aplicamos el efecto al contenido del Hero */ /*************************************************/

/*.hero-content {
  animation: slideInFromLeft 1.8s ease-out forwards;
  animation-delay: 0.5s;
  opacity: 0;
}

.hero {
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;

  min-height: 80vh;
}

.btn-cotizar {
  display: inline-block;
  animation: slideInFromLeft 1.8s ease-out forwards;
  animation-delay: 0.8s;
  opacity: 0;
}

/***************************/
/***************************/

@keyframes slideInFromLeft {
  0% {
    transform: translateX(-100%);
    opacity: 0;
  }
  100% {
    transform: translateX(80px); /* 🔹 entra y se queda alineado */
    opacity: 1;
  }
}

/* Contenedor del Hero */
.hero {
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: flex-start; /* 🔹 arranca a la izquierda */
  min-height: 80vh;
  padding-left: 120px; /* 🔹 ahora sí se nota el corrimiento */
}

.hero-content {
  animation: slideInFromLeft 1.8s ease-out forwards;
  animation-delay: 0.5s;
  opacity: 0;
  text-align: left;
}

/* Botón Cotizar */
.btn-cotizar {
  display: inline-block;
  opacity: 1; /* 🔹 sin animación propia */
  margin-top: 20px;
  margin-left: 0 !important; /* 🔹 fuerza alineación al inicio */
}

/* --- ANIMACIÓN PARA MÓVIL (Fade In Puro) --- */
@media (max-width: 768px) {
  /* Definimos la nueva animación de solo opacidad */
  @keyframes fadeInOnly {
    0% {
      opacity: 0;
    }
    100% {
      opacity: 1;
    }
  }

  .hero-content {
    /* Quitamos el movimiento (el transform) y aplicamos el fade */
    transform: none !important;
    animation: fadeInOnly 2s ease-in-out forwards !important;
    animation-delay: 0.3s;
    opacity: 0;
  }

  /* Aseguramos que los elementos internos no tengan efectos raros */
  .hero-subtitle,
  .hero-title,
  .btn-cotizar {
    animation: none !important;
    opacity: 1 !important;
  }
}

/***************************************************************************************************/
/* NUEVO AJUSTE EXCLUSIVO PARA MOVER EL TEXTO Y EL BOTÓN EN ESCRITORIO */
@media (min-width: 1024px) {
  .hero-content {
    /* 1. Despegamos el bloque del centro y lo tiramos hacia arriba a la izquierda */
    margin-bottom: auto; /* Empuja el contenido hacia el techo */
    margin-right: auto; /* Empuja el contenido hacia la izquierda */

    /* 2. Control de distancias exactas */
    margin-top: 40px; /* Distancia desde el menú superior (si querés más arriba, bajá este número) */
    margin-left: -8%; /* Lo tira un poco más a la izquierda aprovechando el espacio */

    /* 3. Acortamos el ancho máximo para que se mantenga bien dentro de la zona negra */
    max-width: 500px !important;
  }
}
/*************************************************************************************************/

@media (min-width: 768px) and (max-width: 1023px) {
  .hero {
    background-size: 80% auto !important;

    background-position: center bottom !important;

    background-image:
      linear-gradient(
        to bottom,
        rgba(11, 13, 23, 0.8) 0%,
        rgba(11, 13, 23, 0.4) 60%,
        rgba(11, 13, 23, 0.9) 100%
      ),
      url("/img/logo_castro2.png") !important;

    height: 100vh !important;
    min-height: 85vh !important;
  }

  .hero-content {
    max-width: 600px !important;
    margin: 0 auto !important;
    padding-top: 20px !important;
  }
}

/* --- AJUSTES EXCLUSIVOS DE TÍTULO Y BOTÓN PARA 768px --- */
@media (max-width: 768px) {
  .hero-title {
    /* Achicamos el tamaño y bajamos el grosor de la letra */
    font-size: 1.8rem !important;
    font-weight: 600 !important;
    line-height: 1.2 !important; /* Un toque más de aire entre líneas */
    color: rgba(255, 255, 255, 0.6) !important;
  }

  .btn-cotizar {
    /* Convertimos tu azul #0f3483 a RGBA con un 80% de opacidad (0.8) */
    /* El botón se va a ver azul pero dejará pasar sutilmente el fondo de la imagen */
    background-color: rgba(15, 52, 131, 0.45) !important;

    /* Mantenemos un leve efecto blur de vidrio si querés que quede más pro (opcional) */
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
  }

  .hero-title span {
    color: inherit !important;
  }
}
/********************************************************************************************/
/* --- ANIMACIÓN PARA MÓVIL (Fade In Puro) --- */
@media (max-width: 768px) {
  @keyframes fadeInOnly {
    0% {
      opacity: 0;
    }
    100% {
      opacity: 1;
    }
  }

  /* 🔹 CORRECCIÓN EN EL HERO: Imagen grande y bien posicionada */
  .hero {
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
    align-items: center !important;
    padding: 0 20px !important;

    background-size: cover !important;
    background-position: center center !important;

    /* 🔹 MODIFICACIÓN AQUÍ: Bajamos las opacidades para aclarar el fondo */
    background-image:
      linear-gradient(
        to bottom,
        rgba(11, 13, 23, 0.4) 0%,
        /* ANTES: 0.85 (Ahora mucho más claro arriba) */ rgba(11, 13, 23, 0.2)
          50%,
        /* ANTES: 0.6  (Casi invisible en el medio) */ rgba(11, 13, 23, 0.5)
          100% /* ANTES: 0.9  (Un sombreado suave abajo) */
      ),
      url("../img/logo_castro2.png") !important;
  }

  /* 🔹 CORRECCIÓN EN EL CONTENIDO: Centrado total de la estructura */
  .hero-content {
    transform: none !important;
    animation: fadeInOnly 2s ease-in-out forwards !important;
    animation-delay: 0.3s;
    opacity: 0;

    /* Forzamos a que todo lo que esté adentro se alinee al medio */
    text-align: center !important;
    align-items: center !important;
    justify-content: center !important;
    margin: 0 auto !important;
    width: 100% !important;
    max-width: 100% !important;
  }

  /* 🔹 CORRECCIÓN DEL SUBTÍTULO: Forzamos su centrado */
  .hero-subtitle {
    text-align: center !important;
    margin-left: auto !important;
    margin-right: auto !important;
    display: block !important;
  }

  /* 🔹 SI TENÉS UNA LÍNEA AZUL DEBAJO DEL SUBTÍTULO EN EL HTML, ESTO LA CENTRA: */
  .hero-subtitle::after {
    margin: 10px auto 0 auto !important;
  }
}

/* --- AJUSTES EXCLUSIVOS DE TÍTULO Y BOTÓN PARA 768px --- */
@media (max-width: 768px) {
  .hero-title {
    font-size: 1.8rem !important;
    font-weight: 600 !important;
    line-height: 1.2 !important;
    color: rgba(255, 255, 255, 0.6) !important;
    text-align: center !important; /* Asegura el centrado del h1 */
  }

  .btn-cotizar {
    background-color: rgba(15, 52, 131, 0.45) !important;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);

    /* Centra el botón inline-block */
    margin: 20px auto 0 auto !important;
    display: inline-block !important;
  }

  .hero-title span {
    color: inherit !important;
  }
}