@keyframes fadeInOut {
    0% {
      opacity: 1;
      background-color: #002958; /* Color azul */
    }
    100% {
      opacity: 0;
      background-color: transparent;
    }
  }
  
  body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #002958; /* Color azul */
    animation: fadeInOut 2s ease;
    animation-fill-mode: forwards;
    z-index: 9999; /* Asegura que esté sobre todo el contenido */
    pointer-events: none; /* Permite que el contenido subyacente sea accesible después de la animación */
  }
  
/* Estilos generales */
body {
    margin: 0;
    padding: 0;
    font-family: 'Roboto', Arial, sans-serif;
    font-weight: 700;
    background-color: #002958;
    background: linear-gradient(to bottom right, #001d40, #0044aa);
}

/*-----------------------------------------------------------------------------------------------------------------------------------------*/

/* Membrete con 5 logos - Imágenes grandes, header compacto */
.membrete {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1001;
    background-color: white;
    padding: 12px 0;
    box-shadow: 0px 4px 6px rgba(0, 0, 0, 0.1);
    height: 75px;
}


/* Contenedor de los 5 logos */
.membrete .logo-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
    gap: 8px;
    height: 100%;
}
.logo-item.logo-principal {
    flex: 0 0 50%; /* Ocupa exactamente la mitad */
    max-width: 50%;
    display: flex;
    justify-content: flex-start; /* ← CAMBIO: Pegado a la izquierda */
    align-items: center;
    margin-right: auto; /* ← CAMBIO: Empuja los otros logos a la derecha */
}
.logo-item.logo-secundario {
    flex: 1;
    max-width: 10%;
    display: flex;
    justify-content: center; /* Los otros logos siguen centrados */
    align-items: center;
}
.logo-item {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100%;
}

.logo-img {
    height: 55px;
    width: auto;
    max-width: 100%;
    object-fit: contain;
    filter: brightness(1.05) contrast(1.1);
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
}

/* Efecto hover */
.logo-item:hover .logo-img {
    transform: scale(1.08);
    transition: transform 0.3s ease;
}

/* Responsividad para tablets */
@media screen and (max-width: 1024px) {
    .membrete .logo-container {
        padding: 0 15px;
        gap: 6px; /* Más compacto */
    }
    
    .logo-img {
        height: 50px; /* Imágenes ligeramente más pequeñas pero membrete mantiene altura */
    }
}
/* Responsividad para móviles - 3-2 distribución */
@media screen and (max-width: 768px) {
    .membrete {
        height: 75px; /* ALTURA FIJA - NO CAMBIA */
        padding: 8px 0;
    }
    
    .membrete .logo-container {
        padding: 0 8px;
        gap: 5px;
        flex-wrap: wrap;
        justify-content: center;
        height: 100%; /* Asegura que use toda la altura disponible */
    }
    
    /* Logo 1 ocupa fila completa superior */
    .logo-item.logo-principal {
        flex: 0 0 100%;
        max-width: 100%;
        height: 35px; /* Altura reducida para primera fila */
        margin-bottom: 2px;
    }
    
    /* Logos 2-6 en fila inferior compartiendo espacio */
    .logo-item.logo-secundario {
        flex: 1;
        max-width: 18%; /* 5 logos en ~18% cada uno */
        height: 30px; /* Altura reducida para segunda fila */
    }
    
    .logo-img {
        height: 100%; /* Las imágenes ocupan toda la altura disponible */
        max-height: 100%;
    }
}

/* Para pantallas muy pequeñas */
@media screen and (max-width: 480px) {
    .membrete {
        height: 75px; /* ALTURA FIJA MANTENIDA */
    }
    
    .membrete .logo-container {
        padding: 0 5px;
        gap: 3px;
    }
    
    .logo-item.logo-principal {
        height: 32px;
    }
    
    .logo-item.logo-secundario {
        height: 28px;
        max-width: 17%;
    }
}

/*-----------------------------------------------------------------------------------------------------------------------------------------*/

/* NAVBAR AJUSTADO - ELEMENTOS EN LA PARTE INFERIOR */
.navbar {
    position: fixed;
    top: 75px;
    width: 100%;
    height: 70px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 2px solid #002958;
    z-index: 999;
    display: flex;
    justify-content: center;
    align-items: flex-end;
    padding-bottom: 8px;
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    width: 100%;
    max-width: 1200px;
    padding: 0 20px 5px 20px;
    height: 100%;
}

/* LOGO - Ajustado hacia abajo */
.navbar .logo {
    flex-shrink: 0;
    margin: 0;
    padding-bottom: 0;
}

.navbar .logo img {
    height: 48px;
    width: auto;
    margin-bottom: -10px; /* Aumentamos el margen negativo para bajar más la imagen */
    transform: translateY(5px); /* Movemos la imagen hacia abajo */
}

/* MENÚ PRINCIPAL - Ajustado hacia abajo */
.nav-links {
    display: flex;
    justify-content: center;
    align-items: flex-end;
    gap: 25px;
    list-style: none;
    padding: 0;
    margin: 0 0 0 0; /* Reducimos margen inferior */
    flex: 1;
}

.nav-links > li {
    margin: 0;
    padding-bottom: 0; /* Eliminamos padding inferior */
}

.nav-links a {
    text-decoration: none;
    font-weight: bold;
    color: #002958;
    font-size: 16px;
    padding: 8px 12px 12px 12px; /* Más padding solo en la parte inferior */
    transition: 0.3s;
    border-radius: 5px;
    white-space: nowrap;
}

.nav-links a:hover {
    color: #58d3f8;
    background: rgba(0, 41, 88, 0.1);
}

/* BOTÓN CONECTARSE - Ajustado hacia abajo */
.connect-button {
    position: relative;
    flex-shrink: 0;
    margin: 0;
    padding-bottom: 0; /* Eliminamos padding inferior */
    align-self: flex-end; /* Forzamos alineación al fondo */
}

#connectBtn {
    background: white;
    color: #002958;
    font-size: 14px;
    font-weight: bold;
    padding: 6px 18px 10px 18px;
    border: 2px solid #002958;
    border-radius: 25px;
    cursor: pointer;
    transition: 0.3s;
    white-space: nowrap;
    margin-bottom: -3px;
}

#connectBtn:hover {
    background: white;
    color: #002958;
}

/* DROPDOWN MENUS - Ajustados para no cambiar posición */
.dropdown {
    position: relative;
}

.dropdown-menu {
    position: absolute;
    top: calc(100% + 5px);
    left: 0;
    background: #002958;
    list-style: none;
    padding: 10px 0;
    min-width: 220px;
    border-radius: 0 0 8px 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    visibility: hidden;
    opacity: 0;
    transition: all 0.3s ease;
}

.dropdown:hover .dropdown-menu {
    visibility: visible;
    opacity: 1;
}

.dropdown-menu li a {
    color: white;
    display: block;
    padding: 10px 20px;
    border-radius: 0;
}

.dropdown-menu li a:hover {
    background: white;
    color: #002958;
}

/* MENÚ CONECTARSE DROPDOWN - Ajustado */
.connect-menu {
    position: absolute;
    top: calc(100% + 5px);
    right: 0;
    background: #002958;
    list-style: none;
    padding: 10px 0;
    min-width: 160px;
    border-radius: 0 0 8px 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    display: none;
}

.connect-menu.show {
    display: block;
}

.connect-menu li a {
    color: white;
    padding: 10px 15px;
    border-radius: 0;
}

.connect-menu li a:hover {
    background: #002958;
    color: white;
    cursor: default;
}

/* Flecha del dropdown */
.dropdown-arrow {
    margin-left: 4px;
    font-size: 12px;
}

/* RESPONSIVE NAVBAR - Ajustado */
@media screen and (max-width: 1024px) {
    .nav-container {
        padding: 0 15px 5px 15px;
    }
    
    .nav-links {
        gap: 20px;
    }
    
    .nav-links a {
        font-size: 14px;
        padding: 6px 10px 8px 10px;
    }
    
    .navbar .logo img {
        height: 45px;
    }
}

@media screen and (max-width: 768px) {
    .navbar {
        top: 85px;
        height: 60px;
        align-items: center;
        padding-bottom: 0;
    }
    
    .nav-container {
        padding: 0 15px;
        align-items: center;
    }
    
    .nav-links, 
    .connect-button {
        display: none;
    }
    
    .navbar .logo {
        margin: 0 auto;
        padding-bottom: 0;
    }
    
    .navbar .logo img {
        height: 42px;
    }
}

/*-----------------------------------------------------------------------------------------------------------------------------------------*/

/* Menú hamburguesa */
.hamburger {
    display: none;
    flex-direction: column;
    cursor: pointer;
    position: fixed;
    top: 110px;
    left: auto; /* Cambiar esto */
    right: 20px; /* Posicionar desde la derecha */
    transform: none; /* Eliminar esto */
    z-index: 1000;
  }


  .hamburger .bar {
    height: 3px;
    width: 30px;
    background-color: white;
    margin: 3px 0;
  }
  
  /* Menú móvil */
  .mobile-menu {
    position: fixed;
    top: -100%; /* Inicialmente fuera de la pantalla */
    left: 0;
    width: 100%;
    background-color: #002958;
    transition: top 0.3s ease-in-out;
    padding: 75px 20px;
    box-shadow: 0px 5px 10px rgba(0, 0, 0, 0.2);
    z-index: 1000; /* Asegúrate de que esté sobre otros elementos */
  }
  
  .mobile-menu ul {
    list-style-type: none;
    padding: 0;
  }
  
  .mobile-menu li {
    margin: 20px 0;
  }
  
  .mobile-menu a {
    color: white;
    font-size: 18px;
    text-decoration: none;
  }
  
  /* Media Query para pantallas pequeñas */
  @media screen and (max-width: 768px) {
    /* Ocultar el menú de escritorio */
    .nav-links {
      display: none;
    }
  
    /* Mostrar el ícono de hamburguesa */
    .hamburger {
      display: flex;
    }
  
    /* Menú móvil desplegado */
    .mobile-menu.open {
      top: 0; /* Muestra el menú móvil cuando se activa */
    }
    .connect-button {
          display: none;
      }
  }
  
  /* Ajuste del contenedor del submenú */
  .movil-dropdown-menu {
    display: none; /* Oculto por defecto */
    list-style: none;
    padding: 10px 0;
    margin: 0px 0 0 0; /* Margen para separarlo del elemento padre */
    background-color: #004080;
    border-radius: 0px;
  }
  
  .movil-dropdown-menu li {
    padding: 10px 0;
    text-align: center;
  }
  
  .movil-dropdown-menu a {
    color: white;
    font-size: 18px;
    text-decoration: none;
    display: block;
    padding: 0px 0;
  }
  
  /* Mostrar el submenú cuando está activo */
  .movil-dropdown.open .movil-dropdown-menu {
    display: block;
    animation: slideDown 0.3s ease-in-out;
  }
  
  /* Animación para suavizar la aparición */
  @keyframes slideDown {
    from {
      opacity: 0;
      transform: translateY(-10px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }
  
  /*-----------------------------------------------------------------------------------------------------------------------------------------*/
  
  /* Fondo de la página con la imagen */
  main {
      background: url('img-style/main1.jpg') no-repeat center top;
      background-size: cover;
      position: relative;
      padding-top: 80px; /* Espacio debajo del navbar */
      min-height: 75vh;
      transition: background-image 1s ease-in-out; /* Transición suave entre las imágenes */
  }
  
  @media screen and (max-width: 768px) {
     main {
      min-height: 40vh;
     }
  }
  
  /* Degradado solo en la parte inferior de la imagen */
  main::after {
      content: '';
      position: absolute;
      bottom: 0;
      left: 0;
      width: 100%;
      height: 100px;
      background: linear-gradient(to top, #002958, transparent);
      z-index: 1;
  }
  
  /* Texto centrado en el lado izquierdo */
  .main-text {
      position: absolute;
      top: 50%;
      left: 5%; /* Ajusta según sea necesario */
      transform: translateY(-50%);
      color: white;
      font-size: 2rem;
      font-weight: bold;
      z-index: 2;
      text-shadow: 2px 2px 5px rgba(0, 0, 0, 0.5); /* Sombra para mejorar la legibilidad */
  }
  
  .main-button {
      position: absolute;
      top: 56%;
      left: 9%; /* Ajusta según sea necesario */
      transform: translateY(-50%);
  }
  
  #saldoBtn {
      background: transparent;
      color: white;
      font-size: 25px;
      font-weight: bold;
      padding: 10px 15px;
      border: solid 2px white;
      border-radius: 25px;
      cursor: pointer;
      transition: 0.3s;
  }
  
  #saldoBtn:hover {
      background: white;
      color: black;
  }
  
  /* Responsividad para pantallas pequeñas (móviles) */
  @media screen and (max-width: 768px) {
      main {
          background-size: auto 100%;
          text-align: center;
      }
      .main-text {
          font-size: 1.5rem;
          left: 13%;
      }
      .main-button {
          position: absolute;
          top: 56%;
          left: 15%; /* Ajusta según sea necesario */
          transform: translateY(-50%);
      }
  }
  
  /*-----------------------------------------------------------------------------------------------------------------------------------------*/
  
  footer {
      background-color: #001d3f;
      color: whitesmoke;
      padding: 20px;
      text-align: center;
  }
  
  .enlaces-interes,
  .redes-sociales,
  .informacion-adicional {
      margin-bottom: 20px;
  }
  
  .enlaces-interes ul {
      list-style-type: none;
      padding: 0;
  }
  
  .enlaces-interes li {
      display: inline;
      margin-right: 10px;
  }
  
  .redes-sociales img {
      width: 40px;
      height: 40px;
      margin-right: 25px;
  }
  
  /***/
  /* Estilo para la sección de noticias */
  /* ESTILOS PARA LAS NOTICIAS - TARJETAS CON IMAGEN COMPLETA Y PUNTOS SUSPENSIVOS */
  .tittle h3 {
      color: #fff;
      font-size: 2rem;
      margin: 30px 0;
      text-transform: uppercase;
      letter-spacing: 2px;
      text-align: center;
  }
  
  .news-section {
      display: flex;
      flex-wrap: wrap;
      justify-content: center;
      gap: 25px;
      padding: 20px;
      max-width: 1200px;
      margin: 0 auto;
  }
  
  .news-card {
      background: white;
      border-radius: 8px;
      overflow: hidden;
      width: 300px;
      height: auto;
      min-height: 380px;
      box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
      transition: all 0.3s ease;
      display: flex;
      flex-direction: column;
  }
  
  .news-card:hover {
      transform: translateY(-5px);
      box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
  }
  
  .news-card img {
      width: 100%;
      height: 180px;
      object-fit: cover;  /* 🔹 La imagen rellena el espacio */
      background: #f5f5f5;
      border-bottom: 2px solid #002958;
      padding: 0; /* 🔹 Quitar padding para que no quede margen */
  }
  
  .news-content {
      padding: 15px;
      flex: 1;
      display: flex;
      flex-direction: column;
  }
  
  .news-content h2 {
      color: #002958;
      font-size: 1.1rem;
      margin: 0 0 10px 0;
      line-height: 1.3;
      /* Texto truncado con puntos suspensivos */
      display: -webkit-box;
      -webkit-line-clamp: 2;
      -webkit-box-orient: vertical;
      overflow: hidden;
      text-overflow: ellipsis;
      min-height: 2.6em;
      height: 2.6em; /* Altura fija basada en line-height */
  }
  
  .news-content p {
      color: #555;
      font-size: 0.9rem;
      line-height: 1.4;
      margin: 0;
      /* Texto truncado con puntos suspensivos */
      display: -webkit-box;
      -webkit-line-clamp: 4;
      -webkit-box-orient: vertical;
      overflow: hidden;
      text-overflow: ellipsis;
      flex: 1;
      min-height: 5.6em; /* 4 líneas * 1.4 line-height */
      max-height: 5.6em;
  }
  
  /* Versión móvil */
  @media (max-width: 768px) {
      .news-section {
          gap: 20px;
          padding: 15px;
      }
      
      .news-card {
          width: 100%;
          max-width: 350px;
          min-height: 360px;
      }
      
      .news-card img {
          height: 160px;
      }
      
      .news-content h2 {
          font-size: 1rem;
          -webkit-line-clamp: 2;
          min-height: 2.4em;
          height: 2.4em;
      }
      
      .news-content p {
          font-size: 0.85rem;
          -webkit-line-clamp: 3;
          min-height: 4.2em;
          max-height: 4.2em;
      }
  }
  
  .no-news {
      color: white;
      text-align: center;
      font-size: 1.2rem;
      padding: 40px 20px;
      background: rgba(255, 255, 255, 0.1);
      border-radius: 10px;
      margin: 30px auto;
      max-width: 600px;
      width: 90%;
  }