/*
  Global stylesheet for the HIDROEDIFICAR website.

  This stylesheet centralises the styling across all pages to provide a more modern,
  fluid interface. Rounded corners, subtle shadows and improved typography give
  the site a lighter, less rigid feel. Each section uses gentle background
  shading to visually separate content without harsh boxes. Navigation menus
  include hover states and dropdowns styled with smooth transitions.
*/

/* Import Google font Poppins for a contemporary look */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;600&display=swap');

/*
  Animación de desplazamiento para el fondo de chispas.  Se mueve
  horizontalmente para simular un fuego en movimiento.  Ajuste la duración
  según necesidad para un efecto más rápido o más lento.
*/
@keyframes fireMove {
  0% {
    background-position: 0 0;
  }
  100% {
    /* Desplaza la posición de fondo completamente a la derecha. Con
       animation-direction: alternate se invierte el movimiento para
       evitar que aparezcan franjas grises cuando termina el ciclo. */
    background-position: 100% 0;
  }
}

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

body {
  font-family: 'Poppins', sans-serif;
  line-height: 1.6;
  color: #1d1d1d;
  background-color: #f7f9fc;
}

/* Top scrolling marquee */
.top-marquee {
  width: 100%;
  background: rgba(0, 76, 151, 0.8);
  color: white;
  padding: 5px 0;
  position: fixed;
  top: 0;
  z-index: 200;
  text-align: center;
  font-size: 0.9rem;
}

nav {
  background: rgba(255, 255, 255, 0.9);
  padding: 15px 10%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  backdrop-filter: blur(5px);
  position: relative;
  /* Aseguramos que la navegación y su menú desplegable estén por encima del banner y otros elementos */
  z-index: 1000;
  margin-top: 50px;
}

nav img {
  height: 80px;
}

nav ul {
  list-style: none;
  display: flex;
  gap: 20px;
  position: relative;
  align-items: center;
}

nav ul li {
  position: relative;
}

nav a {
  text-decoration: none;
  color: #1d1d1d;
  font-weight: 600;
  transition: color 0.2s ease;
}

nav a:hover {
  /* Al pasar el cursor, el texto cambia a un tono ámbar */
  color: #ffa500;
}

/* Dropdown menu */
nav ul ul {
  display: none;
  position: absolute;
  background: rgba(0, 76, 151, 0.9);
  top: 100%;
  left: 0;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
  /* Elevamos el z-index para que el menú desplegable se muestre por encima del banner */
  z-index: 1100;
  padding: 10px 0;
  border-radius: 8px;
  min-width: 220px;
}

nav ul li:hover > ul {
  display: block;
}

nav ul ul li {
  padding: 8px 20px;
}

nav ul ul li a {
  color: #fff;
  display: block;
  font-weight: 500;
}

nav ul ul li a:hover {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
}

nav ul li.has-dropdown > a::after {
  content: '\25BC';
  margin-left: 5px;
  font-size: 0.7em;
  /* Alinea la flecha verticalmente con el texto */
  display: inline-block;
  vertical-align: middle;
}

/* Alineamos el texto y la flecha dentro del enlace de servicios */
nav ul li.has-dropdown > a {
  display: inline-flex;
  align-items: center;
}

header {
  background: url('hero.jpg') center/cover no-repeat;
  height: 90vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-left: 10%;
  color: white;
  text-shadow: 2px 2px 6px rgba(0, 0, 0, 0.7);
  position: relative;
}

header::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 76, 151, 0.4);
  z-index: -1;
}

header h1 {
  font-size: 3em;
  max-width: 600px;
  line-height: 1.2;
}

.cta-button {
  background-color: #004c97;
  color: white;
  padding: 14px 28px;
  text-decoration: none;
  border-radius: 6px;
  font-weight: 600;
  margin-top: 24px;
  display: inline-block;
  transition: background-color 0.3s ease, transform 0.2s ease;
}

.cta-button:hover {
  background-color: #002b5c;
  transform: translateY(-2px);
}

.whatsapp-float {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 100;
}

.whatsapp-float img {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
  transition: transform 0.2s ease;
}

.whatsapp-float img:hover {
  transform: scale(1.05);
}

section {
  /*
    Los bloques de contenido ahora utilizan un fondo dinámico
    inspirado en chispas de fuego. Combinamos la imagen con un
    degradado oscuro para mejorar el contraste del texto y
    evitar las superficies totalmente blancas que resultaban
    "cuadriculadas". El color del texto se establece en blanco
    para maximizar la legibilidad sobre el fondo oscuro.
  */
  padding: 80px 10%;
  font-size: 1.1rem;
  background: linear-gradient(rgba(0, 0, 0, 0.7), rgba(0, 0, 0, 0.7)), url('fire_background.png') center/cover no-repeat;
  color: #fff;
  margin: 40px auto;
  border-radius: 12px;
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2);
  max-width: 1200px;

  /* Ajustes para animar el fondo de fuego */
  /* Ajustamos el tamaño y repetición para un desplazamiento continuo */
  background-size: auto;
  background-repeat: repeat;
  animation: fireMove 60s linear infinite alternate;
}

.section-title {
  /* Color ámbar para títulos de sección sobre el fondo oscuro */
  color: #ffa500;
  margin-bottom: 20px;
  font-size: 2em;
  font-weight: 600;
}

.flex {
  display: flex;
  gap: 40px;
  flex-wrap: wrap;
}

.service {
  flex: 1;
  min-width: 250px;
  /* Tarjetas de servicio con fondo semi-transparente para resaltar sobre el fondo dinámico */
  background-color: rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.service:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
}

.service-icon {
  font-size: 48px;
  /* Color naranja para los íconos de servicios, en armonía con el fondo de fuego */
  color: #ff8c00;
  margin-bottom: 12px;
}

.service h3 {
  margin-bottom: 12px;
  font-size: 1.4em;
  font-weight: 600;
}

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

.service li {
  margin-bottom: 8px;
  position: relative;
  padding-left: 24px;
}

.service li::before {
  content: '\2022'; /* bullet symbol */
  position: absolute;
  left: 0;
  /* Cambiamos el color del punto al naranja para complementar el fondo de fuego */
  color: #ff8c00;
  font-weight: bold;
}

img.section-img {
  width: 100%;
  max-width: 350px;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

#contacto {
  position: relative;
  padding: 3rem;
  overflow: hidden;
  background-color: #f9fbff;
}

#contacto::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  /* Utilizamos el mismo fondo dinámico de chispas de fuego para esta sección */
  background: url('fire_background.png') center/cover no-repeat;
  opacity: 0.4;
  z-index: -1;
  filter: blur(2px);

  /* Ajustes para animar el fondo de fuego en la sección de contacto */
  background-size: auto;
  background-repeat: repeat;
  animation: fireMove 60s linear infinite alternate;
}

#contacto form {
  margin-top: 20px;
}

#contacto input,
#contacto textarea {
  width: 100%;
  padding: 10px;
  margin: 6px 0;
  border: 1px solid #ccc;
  border-radius: 6px;
}

#contacto button {
  background-color: #004c97;
  color: white;
  border: none;
  padding: 12px 20px;
  border-radius: 6px;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

#contacto button:hover {
  background-color: #002b5c;
}

footer {
  text-align: center;
  font-size: 0.9rem;
  padding: 20px;
  background: #004c97;
  color: white;
  border-radius: 0 0 12px 12px;
}

@media (max-width: 768px) {
  nav {
    flex-direction: column;
    align-items: flex-start;
    padding: 10px 5%;
  }
  nav ul {
    flex-direction: column;
    gap: 10px;
    margin-top: 10px;
    width: 100%;
  }
  header {
    height: auto;
    padding: 25% 5% 15%;
    text-align: center;
  }
  header h1 {
    font-size: 2.2em;
    max-width: 100%;
  }
  .flex {
    flex-direction: column;
    gap: 20px;
  }
  .service {
    margin-bottom: 20px;
  }
  img.section-img {
    max-width: 100%;
    height: auto;
  }
  .cta-button {
    width: 100%;
    text-align: center;
  }
  .top-marquee {
    font-size: 0.75rem;
    padding: 3px 0;
  }
}