/* Reset y tipografía */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  line-height: 1.6;
  background: #f9f9f9;
  color: #333;
}

/* Contenedor general */
.container {
  width: 90%;
  max-width: 1100px;
  margin: auto;
  padding: 20px 0;
}

section {
  scroll-margin-top: 80px; /* Ajusta el valor según la altura de tu header */
}

/* Header */
header {
  background: #003366;
  color: white;
  padding: 10px 0;
  position: fixed;
  width: 100%;
  top: 0;
  left: 0;
  border-radius: 0 0 20px 20px;
  z-index: 999;
  box-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

header .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

header .logo img {
  height: 50px;
  animation: bounceLogo 2s infinite ease-in-out;
  will-change: transform;
}

/* Keyframes para la animación principal */
@keyframes bounceLogo {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-5px); }
}

/* Media query para móviles (menos de 768px ancho) */
@media (max-width: 768px) {
  header .logo img {
    animation: bounceLogoMobile 1.2s infinite ease-in-out;
  }
}

/* Keyframes para la animación en móviles, más suave */
@keyframes bounceLogoMobile {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-3px); }
}


@keyframes bounceLogo {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-5px);
  }
}

nav {
  display: flex;
}

nav ul {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
  gap: 25px;
}

nav ul li {
  margin-left: 0;
}

nav ul li a {
  color: white;
  text-decoration: none;
  font-size: 16px;
  font-weight: 600;
  transition: color 0.3s;
}

nav ul li a:hover {
  color: #ffcc00;
}

/* Botón de menú hamburguesa */
.menu-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  width: 30px;
  height: 30px;
  position: relative;
  z-index: 1000;
}

.menu-toggle span {
  position: absolute;
  width: 25px;
  height: 3px;
  background-color: white;
  transition: all 0.3s ease;
}

.menu-toggle span:nth-child(1) {
  top: 6px;
}

.menu-toggle span:nth-child(2) {
  top: 13px;
}

.menu-toggle span:nth-child(3) {
  top: 20px;
}

.menu-toggle.active span:nth-child(1) {
  transform: rotate(45deg);
  top: 13px;
}

.menu-toggle.active span:nth-child(2) {
  opacity: 0;
}

.menu-toggle.active span:nth-child(3) {
  transform: rotate(-45deg);
  top: 13px;
}

/* Media Queries para móviles */
@media (max-width: 768px) {
  nav {
    display: none;
  }
  nav.active {
    display: block;
    position: absolute;
    top: 100px; /* Ajusta dependiendo del tamaño de tu header */
    right: 0;
    background: #003366;
    width: 100%;
    text-align: center;
  }
  nav ul {
    flex-direction: column;
    gap: 0;
  }
  nav ul li {
    margin: 10px 0;
  }

  .menu-toggle {
    display: flex;
  }
}

/* Mostrar el menú cuando el botón hamburguesa sea clickeado */
nav.active {
  display: block;
}

/* Para que el contenido no quede tapado por el header */
body > :not(header) {
  padding-top: 80px;
}

/* Sección del carrusel */
.carousel-section {
  position: relative;
  max-width: 1100px;
  margin: 40px auto 60px auto; /* espacio para no chocar con header */
}

/* Contenedor del swiper */
.swiper-container {
  width: 100%;
  height: 500px; /* altura fija para buen aspecto */
  border-radius: 15px;
  overflow: hidden;
  box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

/* Imágenes del carrusel */
.swiper-slide img {
  width: 100%;
  height: 500px;
  object-fit: cover; /* cubrir todo el área sin deformar */
  border-radius: 15px;
}

/* Texto superpuesto en el carrusel */
.carousel-text {
  position: absolute;
  bottom: 30px;
  left: 30px;
  color: #fff;
  font-size: 2rem;
  font-weight: 700;
  text-shadow: 2px 2px 8px rgba(0,0,0,0.7), 0 0 15px rgba(0,0,0,0.3);
  max-width: 80%;
  z-index: 10;
}

/* Botones de navegación */
.swiper-button-prev,
.swiper-button-next {
  color: #fff;
  filter: drop-shadow(0 0 2px rgba(0,0,0,0.7));
}

/* Sección Servicios */
#servicios h2 {
  text-align: center;
  margin-bottom: 15px;
  font-size: 2.2rem;
  color: #003366;
}

#servicios p {
  max-width: 800px;
  margin: 0 auto 30px auto;
  font-size: 1.1rem;
  text-align: center;
  color: #444;
}

.services-list {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 40px;
}

.service-item {
  background: white;
  border-radius: 12px;
  box-shadow: 0 3px 10px rgba(0,0,0,0.1);
  padding: 20px;
  width: 260px;
  text-align: center;
  transition: transform 0.3s ease;
}

.service-item:hover {
  transform: translateY(-8px);
}

.service-icon {
  width: 80px;
  margin-bottom: 15px;
}

.service-item h3 {
  font-size: 1.3rem;
  color: #003366;
  margin-bottom: 10px;
}

.service-item p {
  font-size: 1rem;
  color: #555;
}

/* Sección Quiénes Somos */
#quienes-somos {
  padding: 60px 20px;
  background-color: #f7f9fb;
}

.section-title {
  text-align: center;
  font-size: 2.8rem;
  color: #003366;
  margin-bottom: 50px;
  position: relative;
}

.section-title::after {
  content: '';
  width: 80px;
  height: 4px;
  background-color: #ffcc00;
  display: block;
  margin: 10px auto 0;
  border-radius: 2px;
}

.info-block {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 60px;
  gap: 30px;
}

.info-block.reverse {
  flex-direction: row-reverse;
}

.info-image img {
  width: 100%;
  max-width: 400px;
  border-radius: 12px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.15);
  object-fit: cover;
}

.info-text {
  flex: 1;
  font-size: 1.1rem;
  color: #333;
  line-height: 1.6;
  text-align: justify;
}

.info-text h3 {
  font-size: 1.8rem;
  color: #00509e;
  margin-bottom: 15px;
  position: relative;
}

.info-text h3::after {
  content: '';
  width: 60px;
  height: 3px;
  background-color: #ffcc00;
  display: block;
  margin-top: 5px;
  border-radius: 2px;
}

/* Responsive Design */
@media (max-width: 768px) {
  .info-block {
    flex-direction: column;
  }

  .info-block.reverse {
    flex-direction: column;
  }

  .info-image img {
    max-width: 100%;
  }
}

/* Código Ético */
#codigo-etico {
  background: #e0f0ff;
  padding: 40px 0;
}

.codigo-container {
  display: flex;
  align-items: center;
  gap: 40px;
  flex-wrap: wrap;
  justify-content: center;
  text-align: center;
}

#codigo-etico h2 {
  color: #003366;
  font-size: 2.2rem;
  margin-bottom: 20px;
}

.codigo-texto {
  font-size: 1.15rem;
  color: #333;
  max-width: 600px;
  line-height: 1.6;
}

/* Máquinas y Equipos */
#maquinas h2 {
  text-align: center;
  margin-bottom: 35px;
  color: #003366;
  font-size: 2.3rem;
}

.machine-item {
  display: flex;
  gap: 20px;
  margin-bottom: 30px;
  flex-wrap: wrap;
  background: white;
  padding: 20px;
  border-radius: 15px;
  box-shadow: 0 3px 12px rgba(0,0,0,0.1);
  align-items: center;
}

.machine-item img {
  width: 250px;
  border-radius: 12px;
  object-fit: cover;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(0,0,0,0.12);
}

.machine-info h3 {
  color: #00509e;
  font-size: 1.6rem;
  margin-bottom: 10px;
}

.machine-info p {
  font-size: 1.1rem;
  color: #444;
  max-width: 600px;
  line-height: 1.5;
}

/* Contacto */
#contacto {
  background: #003366;
  color: white;
  padding: 40px 0;
  text-align: center;
}

#contacto h2 {
  font-size: 2.3rem;
  margin-bottom: 25px;
}

#contacto p {
  font-size: 1.15rem;
  margin-bottom: 20px;
}

#contacto ul {
  list-style: none;
  font-size: 1.1rem;
  line-height: 1.8;
  padding-left: 0;
}

#contacto ul li {
  margin-bottom: 10px;
}

/* Estilo por defecto para el enlace de correo */
#contacto a {
  color: white; /* Color base */
  text-decoration: none; /* Sin subrayado */
}

/* Estilo cuando el cursor está sobre el enlace */
#contacto a:hover {
  color: #ffcc00; /* Cambia a dorado al hacer hover */
  text-decoration: underline; /* Subraya al pasar el cursor */
}

/* Estilo para el contenedor del mapa */
.mapa-container {
  margin-top: 20px;
  margin-bottom: 20px;
  border-radius: 15px;  /* Bordes redondeados */
  overflow: hidden; /* Evita que los bordes sobresalgan */
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1); /* Sombra suave */
  width: 100%;
}

/* Ajustes para el iframe del mapa */
.mapa-container iframe {
  border: 0;
  border-radius: 15px;
  width: 100%;
  height: 350px;
}

/* En pantallas más pequeñas */
@media (max-width: 768px) {
  #contacto ul li {
    font-size: 1rem; /* Ajuste del tamaño del texto */
  }
  .mapa-container iframe {
    height: 300px; /* Ajustar la altura en pantallas más pequeñas */
  }
}

/* Estilos para el botón flotante */
.boton-flotante {
  position: fixed;
  bottom: 20px; /* Distancia desde el fondo */
  left: 20px;   /* Distancia desde la izquierda */
  background-color: #007BFF;
  color: white;
  padding: 15px 20px;
  border-radius: 50%;
  font-size: 18px;
  text-align: center;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
  text-decoration: none;
  transition: all 0.3s ease;
}

.boton-flotante:hover {
  background-color: #0056b3;
  transform: scale(1.1);
}

/* Responsive */
@media (max-width: 900px) {
  .services-list {
    flex-direction: column;
    align-items: center;
  }

  .history-content {
    flex-direction: column;
    align-items: center;
  }

  .side-image {
    width: 100%;
    max-width: 350px;
  }

  .codigo-container {
    flex-direction: column;
  }

  .codigo-image {
    width: 90%;
    max-width: 400px;
  }

  .machine-item {
    flex-direction: column;
    text-align: center;
  }

  .machine-item img {
    width: 90%;
    max-width: 300px;
    margin: 0 auto;
  }

  /* Ajustes carrusel tablets */
  .swiper-container {
    height: 300px;
  }
  .swiper-slide img {
    height: 300px;
  }
  .carousel-text {
    font-size: 1.5rem;
    bottom: 20px;
    left: 20px;
  }
}

@media (max-width: 480px) {
  nav ul {
    flex-direction: column;
    gap: 15px;
  }

  nav ul li a {
    font-size: 1.1rem;
  }

  .carousel-text {
    font-size: 1.2rem;
    bottom: 15px;
    left: 15px;
    max-width: 90%;
  }

  /* Ajustes carrusel móviles */
  .swiper-container {
    height: 220px;
  }
  .swiper-slide img {
    height: 220px;
  }

  #servicios h2,
  #quienes-somos h2,
  #codigo-etico h2,
  #maquinas h2,
  #contacto h2 {
    font-size: 1.8rem;
  }
}
