/* =========================================
   1. CONFIGURACIÓN GENERAL Y RESET
   ========================================= */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

body {
    background-color: #f4f7f6;
    color: #333;
    line-height: 1.6;
}

/* =========================================
   2. NAVEGACIÓN (RESPONSIVE)
   ========================================= */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 5%;
    background: white;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

/* Contenedor del logo */
.logo {
    display: flex;
    align-items: center;
    /* Ajusta este ancho máximo según qué tan grande quieras el logo en monitores */
    max-width: 250px; 
    height: auto;
    padding: 10px;
}

/* La imagen dentro del logo */
.logo img {
    width: 100%;      /* Ocupa el 100% del contenedor .logo */
    height: auto;     /* Mantiene la proporción original para no deformarse */
    display: block;   /* Elimina espacios fantasma debajo de la imagen */
    object-fit: contain; /* Asegura que la imagen se vea bien si hay dimensiones fijas */
}

/* --- Ajustes para Dispositivos Específicos (Media Queries) --- */

/* Tablets (menos de 768px) */
@media (max-width: 768px) {
    .logo {
        max-width: 180px; /* Reducimos un poco el logo en tablets */
    }
}

/* Celulares (menos de 480px) */
@media (max-width: 480px) {
    .logo {
        max-width: 140px; /* Logo más pequeño para pantallas estrechas */
        margin: 0 auto;   /* Centra el logo si el menú se vuelve vertical */
    }
}


.nav-links {
    display: flex;
    list-style: none;
}

.nav-links li { margin: 0 15px; }

.nav-links a {
    text-decoration: none;
    color: #555;
    font-weight: 500;
    transition: 0.3s;
}

.cta-button {
    background-color: #00a8e8;
    color: white;
    padding: 10px 20px;
    border-radius: 5px;
    text-decoration: none;
    font-weight: bold;
    font-size: 0.9rem;
}

/* =========================================
   3. HERO SECTION
   ========================================= */
.hero {
    min-height: 60vh;
    background: linear-gradient(rgba(0, 0, 0, 0.6), rgba(0, 0, 0, 0.6)), 
                url('img/planta_potabilizadora.png') no-repeat center center/cover;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: white;
    padding: 40px 20px;
}

.hero-content h1 {
    font-size: clamp(1.8rem, 5vw, 3rem); /* Tamaño fluido */
    margin-bottom: 20px;
    text-transform: uppercase;
}

.hero-content p {
    font-size: clamp(1rem, 2vw, 1.2rem);
    max-width: 800px;
    margin: 0 auto 30px;
}

/* =========================================
   4. TARJETAS DE SECTORES (GRID)
   ========================================= */
.sectors {
    padding: 60px 5%;
    text-align: center;
}

.card-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
    max-width: 1200px;
    margin: 0 auto;
}

.card {
    background: #e3f2fd;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.6s ease forwards;
}

/* Animación escalonada para cada tarjeta */
.card:nth-child(1) { animation-delay: 0.1s; }
.card:nth-child(2) { animation-delay: 0.2s; }
.card:nth-child(3) { animation-delay: 0.3s; }
.card:nth-child(4) { animation-delay: 0.4s; }

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Hover dinámico */
.card:hover {
    transform: translateY(-10px) scale(1.03);
    box-shadow: 0 8px 20px rgba(0,0,0,0.15);
}

/* Animación en íconos o imágenes dentro de la tarjeta */
.card-icon img {
    width: 100px;
    height: 100px;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.card:hover .card-icon img {
    transform: rotate(5deg) scale(1.1);
}

/* =========================================
   4.5. SERVICIOS
   ========================================= */
.services {
    padding: 60px 5%;
    text-align: center;
}

.services-list {
    list-style: none;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
    max-width: 1200px;
    margin: 0 auto;
}

.services-list li {
    background: #e3f2fd;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    text-align: left;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
}

/* Efecto al pasar el mouse */
.services-list li:hover {
    transform: translateY(-10px) scale(1.03);
    box-shadow: 0 8px 20px rgba(0,0,0,0.15);
}

/* Animación de entrada */
.services-list li {
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.6s ease forwards;
}

/* Animación escalonada */
.services-list li:nth-child(1) { animation-delay: 0.1s; }
.services-list li:nth-child(2) { animation-delay: 0.2s; }
.services-list li:nth-child(3) { animation-delay: 0.3s; }
.services-list li:nth-child(4) { animation-delay: 0.4s; }
/* puedes seguir agregando más según el número de tarjetas */

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.card-icon img {
    width: 100px;
    height: 100px;
    object-fit: contain;
    transition: transform 0.3s ease;
}

/* Animación en el ícono */
.services-list li:hover .card-icon img {
    transform: rotate(5deg) scale(1.1);
}


/* =========================================
   4.6 carousel
   ========================================= */

.carousel {
  position: relative;
  width: 90%;
  margin: 40px auto;
  text-align: center;
}

.carousel h2 {
  font-size: 1.8rem;
  margin-bottom: 20px;
  color: #004b8d;
}

.carousel-container {
  position: relative;
  overflow: hidden;
  border-radius: 10px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

.carousel-track {
  display: flex;
  transition: transform 0.5s ease-in-out;
}

.carousel-item {
  min-width: 100%;
}

.carousel-item img {
  width: 100%;
  height: 500px;
  object-fit: cover;
}

.carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background-color: rgba(0,0,0,0.5);
  color: white;
  border: none;
  font-size: 2rem;
  cursor: pointer;
  padding: 10px;
  border-radius: 50%;
  z-index: 10;
}

.carousel-btn.prev { left: 15px; }
.carousel-btn.next { right: 15px; }

.carousel-btn:hover {
  background-color: rgba(0,0,0,0.8);
}

/* =========================================
   4.7 nosotros
   ========================================= */
/* Sección Nosotros */
.nosotros {
  max-width: 1000px;
  margin: 60px auto;
  padding: 40px 20px;
  background-color: #f9f9f9;   /* Fondo suave */
  border-radius: 10px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  text-align: center;
}

.nosotros h2 {
  font-size: 2rem;
  color: #004b8d;              /* Azul corporativo */
  margin-bottom: 20px;
  line-height: 1.3;
}

.nosotros h2:nth-of-type(2) {
  font-size: 1.4rem;
  font-weight: 500;
  color: #007a5e;              /* Verde corporativo */
  margin-bottom: 25px;
}

.nosotros p {
  font-size: 1rem;
  line-height: 1.8;
  color: #333;
  text-align: justify;
  margin: 0 auto;
  max-width: 900px;
}

/* Responsivo */
@media (max-width: 768px) {
  .nosotros {
    padding: 30px 15px;
  }

  .nosotros h2 {
    font-size: 1.6rem;
  }

  .nosotros h2:nth-of-type(2) {
    font-size: 1.2rem;
  }

  .nosotros p {
    font-size: 0.95rem;
    line-height: 1.6;
  }
}


/* =========================================
   5. CONTACTO Y FOOTER
   ========================================= */
.contact { padding: 60px 5%; background: #eef2f3; }

.contact-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 40px;
    max-width: 1100px;
    margin: 0 auto;
}

.contact-form form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

footer {
    background: #002e40;
    color: white;
    padding: 50px 5% 20px;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 30px;
}

/* =========================================
   6. MEDIA QUERIES (MAGIA DEL RESPONSIVE)
   ========================================= */

/* Para tablets y celulares (Menos de 768px) */
@media (max-width: 768px) {
    .navbar {
        flex-direction: column;
        gap: 15px;
    }

    .nav-links {
        padding: 10px 0;
        font-size: 0.9rem;
    }

    .nav-links li {
        margin: 0 10px;
    }

    .hero {
        min-height: 50vh;
    }
}

/* Para celulares pequeños (Menos de 480px) */
@media (max-width: 480px) {
    .nav-links {
        display: none; /* Escondemos links para usar un menú hamburguesa si quisieras */
    }
    
    .cta-button {
        width: 100%;
        text-align: center;
    }

    .contact-container {
        text-align: center;
    }
}