body {
    margin: 0;
    font-family: 'Century Gothic', sans-serif;
}

.page-container {
    display: flex;
    flex-direction: column; /* Secciones apiladas */
    gap: 20px;
    width: 84%; /* Ancho del 84% */
    margin: 0 8%; /* Márgenes del 8% a los lados */
    padding: 0;
    box-sizing: border-box;
}

/* Mantener el resto de los estilos intactos */
.arriba {
    display: flex;
    align-items: stretch;
}

.arriba a {
    text-decoration: none;
    color: black;
}

/* Carrusel */
.carousel-section {
    width: 100%; /* Cambié de 1250px a 100% para que sea más responsivo */
    margin-top: 10%;
    margin-left: -1.10%;
}

.carousel-container {
    position: relative;
    overflow: hidden;
    width: 100%; /* El contenedor del carrusel ocupa el 100% del espacio */
    height: 50vh; /* 25% de la altura de la ventana del navegador */
}

.carousel-slide {
    display: flex;
    transition: transform 0.5s ease-in-out;
    width: 100%; 
    height: auto; /*Asegura que la transición ocupe el ancho completo */
}

.carousel-item {
    flex: 0 0 100%;
    box-sizing: border-box;
    height: 100%;
    position: relative;
    padding: 5px; /* Espacio para el borde visible */
    background: white;
    z-index: 1;
    overflow: hidden;
}

.carousel-item::before {
    content: "";
    position: absolute;
    top: -2px;
    left: -2px;
    width: calc(100% + 4px);
    height: calc(100% + 4px);
    background: linear-gradient(to right, #0075a8, #2fa496, #0075a8);
    background-size: 200% auto;
    background-repeat: no-repeat;
    background-position: left center;
    animation: gradientMove 5s ease infinite;
    z-index: -1;
}

@keyframes gradientMove {
    0% {
        background-position: 0% center;
    }
    50% {
        background-position: 100% center;
    }
    100% {
        background-position: 0% center;
    }
}

.noticia img {
    width: 100%; /* Las imágenes deben ocupar el 100% del ancho del item */
    height: auto; /* Las imágenes ocuparán el 100% de la altura del contenedor */
    object-fit: cover; /* Mantiene la proporción de la imagen, cubriendo el área disponible */
}

/* CONTENEDOR PRINCIPAL CON FONDO */
.contenedor-principal {
    width: 90%;
    margin: 4rem auto;
    padding: 3rem 2rem;
    border-radius: 2rem;
    background: transparent; /* ahora el fondo lo da el pseudo-elemento */
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.07);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3rem;
    position: relative;
    overflow: hidden; /* importante para que el fondo no se salga */
    box-sizing: border-box;
    margin-top: 0;
  }
  
  /* Fondo animado como ::before */
  .contenedor-principal::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to right, #0075a8, #2fa496, #0075a8);
    background-size: 200% auto;
    background-repeat: no-repeat;
    background-position: left center;
    z-index: -1;
    animation: gradientMove 5s ease infinite;
    border-radius: 2rem;
  }
  
  /* Animación del degradado */
  @keyframes gradientMove {
    0% {
      background-position: left center;
    }
    50% {
      background-position: right center;
    }
    100% {
      background-position: left center;
    }
  }
  
  /* SLOGAN */
  .slogan {
    text-align: center;
    font-family: 'Barlow Condensed', sans-serif;
    font-size: 3.5rem;
    font-weight: 800;
    color: #fff;
    line-height: 1.4;
    width: 80%;
    text-transform: uppercase;
    margin-bottom: 0;
    margin-top: 0;
  }
  
  /* CONTENEDOR INTERNO CON FLEX + ALIGN STRETCH */
  .contenedor-items {
    display: flex;
    justify-content: center;
    gap: 40px;
    margin-top: 30px;
    flex-wrap: wrap;
  }

  @media (min-width: 768px) {
    .contenedor-items {
      flex-direction: row;
      justify-content: space-evenly;
      align-items: stretch;
    }
  }
  .contenedor-item a{
    text-decoration: none;
  }
  
  /* BLOQUES IGUALADOS */
  .contenedor-item {
    margin-left: 1%;
    margin-right: 1%;
    background-color: white;
    padding: 20px;
    border-radius: 20px;
    width: 400px;
    min-height: 400px;
    display: flex;
    flex-direction: column;
    justify-content: center; /* CENTRA VERTICALMENTE */
    align-items: center;      /* CENTRA HORIZONTALMENTE */
    text-align: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  }
  
  .contenedor-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.1);
  }
  
  /* NUEVO: ENVOLTURA DE IMAGEN CENTRADA */
  .contenedor-img img {
    max-height: 250px;
    object-fit: contain;
    margin-bottom: 20px;
  }
  
  /* IMÁGENES */
  .logo-img {
    transition: transform 0.3s ease;
    border-radius: 0.5rem;
    max-width: 100%;
    height: auto;
  }
  
  .logo-img.izquierda {
    width: 60%;
  }
  
  .logo-img.derecha {
    width: 85%;
  }
  
  /* DESCRIPCIÓN */
  .descripcion {
    font-size: 1.2rem;
    color: #1e293b;
    line-height: 1.6;
    font-weight: 600;
    margin-top: auto;
  }  
  

/* Ajustes responsivos */
@media (max-width: 768px) {
    .page-container {
        width: 90%; /* En pantallas pequeñas, ocupa más espacio */
        margin: 0 5%; /* Márgenes más pequeños */
    }

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

    .abajo .aIzquierda, .abajo .aDerecha {
        width: 100%;
        margin-top: 20px;
    }

    .abajo .aIzquierda img, .abajo .aDerecha img {
        max-width: 90%;
    }

    .noticia {
        flex-direction: column; /* En pantallas pequeñas, imagen y texto en columna */
        text-align: center;
    }

    .izquierda, .derecha {
        width: 100%;
    }
}
