header {
  padding: 1.5rem 0;
  background-color: var(--color-primary);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  position: relative;
  top: 0;
  z-index: 10;
  border-bottom-left-radius: 90px;
  border-bottom-right-radius: 90px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 150px;
  width: 100%;
}
.header {
z-index: 1000;
position: relative;
}
.nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
}
.logo {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--color-white);
  height: 100px;
  width: 120px;
  display: flex;
  align-items: center;
  margin-left: 15px;
}

.logo img{
  width: 100%;
  height: 100%;
}
.rigth-side {
  display: flex;
  align-items: center;
  gap: 1rem;
}
.nav__links {
  display: flex;
  gap: 2rem;
  padding: 0.75rem;
  font-weight: 500;
  font-size: 1.1rem;
}
.nav__links a {
  color: var(--color-white);
  text-decoration: none;
}
.nav__toggle .nav__bar {
  width: 25px;
  height: 3px;
  background-color: var(--color-white);
  border-radius: 2px;
}
.language-select {
  padding: 0.4rem 0.6rem;
  border-radius: 5px;
  border: 1px solid #ccc;
  background: white;
  font-size: 1rem;
  cursor: pointer;
}


/* === ESTILOS RESPONSIVE (CON MODIFICACIONES) === */
@media (max-width: 768px) {
  /* Ocultamos los links del menú de escritorio */
  .nav__links, .btn--primary:not(.mobile-only) {
      display: none;
  }
  
  /* MODIFICACIÓN: Hacemos visible el botón de hamburguesa */
  .nav__toggle {
      display: flex; /* Cambiado de 'none' a 'flex' */
      flex-direction: column;
      gap: 4px; /* Espacio entre las barras */
      cursor: pointer;
  }

  .mobile-only {
      display: block; 
      margin-top: 1.5rem;
      width: 100%;
      text-align: center;
  }
  
  .header{
    border-radius: 0;
  }
}


/* --- ESTILOS DEL MENÚ MÓVIL (SIN CAMBIOS) --- */
.mobile-menu {
  display: none; /* Oculto por defecto */
  background-color: var(--color-primary); 
  padding: 1rem;
  position: absolute;
  top: 100%;
  left: 0;
  width: 100%;
  z-index: 999; 
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.05);
}

/* Esta clase se añade con JavaScript para mostrar el menú */
.mobile-menu.active {
  display: block; 
}


/* --- ESTILOS PARA ESCRITORIO (SIN CAMBIOS) --- */
@media (min-width: 769px) {
  .mobile-only, .mobile-menu, .nav__toggle {
      display: none !important;
  }
}


/* --- Estilos para el Mega Menú (Escritorio) --- */
.mega-menu {
  /* Clave #1: Oculto por defecto. El JS lo mostrará. */
  display: none;
  background-color: #f5f5f5;
  border-radius: 12px;
  padding: 1.5rem 2rem;
  box-shadow: 0 5px 15px rgba(0,0,0,0.1);
  border: 1px solid #eee;
  color: #333; /* Color de texto para el contenido del menú */
  border-bottom-left-radius: 40px !important;
  border-bottom-right-radius: 40px !important; 

}
/* Tu JS ya posiciona el menú, pero este es el estilo del contenido */
.mega-menu__column {
  display: flex;
  flex-direction: column;
}
.mega-menu__column h4 {
  margin: 0 0 1rem 0;
  font-size: 1rem;
}
.mega-menu__column ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.mega-menu__column a {
  color: #555;
  text-decoration: none;
}
.mega-menu__column a:hover {
  color: var(--color-primary); /* Usa una de tus variables de color */
}


/* --- Estilos para el Menú Acordeón (Móvil) --- */
.mobile-menu-trigger {
  color: var(--color-secondary);
  font-weight: 500;
  padding: 0.75rem 0;
  cursor: pointer;
  margin: 0;
}
.mobile-submenu {
  list-style: none;
  margin: 0;
  padding: 0 0 0 1rem; /* Indentación para los sub-items */
  overflow: hidden;
  /* Clave #2: Oculto por defecto. El JS cambiará max-height para mostrarlo. */
  max-height: 0;
  transition: max-height 0.3s ease-out;
}
.mobile-submenu a {
  color: #ccc;
  text-decoration: none;
  display: block;
  padding: 0.5rem 0;
}

.mobile-menu {
  display: none;
  position: absolute;
  top: 100%;
  right: 0;
  width: 100%;
  background-color: var(--color-primary); /* o el color que uses */
  z-index: 999;
}

.mobile-menu.active {
  display: block;
}


/* === ESTILOS DEL MEGA MENÚ (AÑADIR) === */

/* El contenedor principal del menú desplegable */
.mega-menu {
  display: none; /* Oculto por defecto, JS lo cambia a 'flex' */
  position: fixed; /* JS lo controla, pero es bueno tenerlo como referencia */
  background-color: #f6f6f6;
  padding: 2rem;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
  gap: 2rem; /* Espacio entre las columnas */
  border: 1px solid #e0e0e0;
}

/* Cada una de las columnas dentro del menú */
.mega-menu-column {
  flex: 1; /* Hace que las columnas compartan el espacio */
}

/* Títulos de cada columna (ej. "Cuentas", "Tarjetas") */
.mega-menu-column h3 {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--color-primary); /* Usa el color primario de tu marca */
  margin-top: 0;
  margin-bottom: 1rem;
  border-bottom: 2px solid var(--color-secondary); /* Un pequeño acento visual */
  padding-bottom: 0.5rem;
}

/* La lista de enlaces dentro de cada columna */
.mega-menu-column ul {
  display: flex;          /* ↔️ Convierte la lista en un contenedor flexible (horizontal) */
  flex-direction: row;  /* Asegura la dirección horizontal */
  gap: 1.5rem;            /* Espacio entre cada ítem */
  list-style: none;
  padding: 0;
  margin: 0;
  justify-content:space-around
}

/* Elimina el margen inferior de los <li> que ya no es necesario */
.mega-menu-column ul li {
  margin-bottom: 0;
}

/* Los enlaces finales */
.mega-menu-column ul li a {
  color: #333;
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s ease;
}

/* Efecto hover para los enlaces */
.mega-menu-column ul li a:hover {
  color: var(--color-primary);
  text-decoration: none;
}

/* --- Ajustes al nav__links para el hover --- */
.nav__links > li > a {
    padding: 10px 15px;
    border-radius: 8px;
    transition: background-color 0.3s ease;
}
/* Opcional: Resaltar el link principal cuando el menú está abierto */
.nav__links > li:hover > a {
    background-color: rgba(255, 255, 255, 0.15);
}


/* === ESTILOS DEL MENÚ MÓVIL ACORDEÓN (AÑADIR) === */

/* Títulos de cada sección (ej. Credits, Accounts) */
.mobile-menu-trigger {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--color-white);
  padding: 0.75rem 0;
  cursor: pointer;
  border-top: 1px solid rgba(255, 255, 255, 0.2);
  margin: 0;
}

.mobile-menu-trigger:first-of-type {
  border-top: none;
}

/* Contenedor de los sub-enlaces */
.mobile-submenu {
  list-style: none;
  padding-left: 1.5rem; /* Indentación para los sub-items */
  margin: 0;
  /* JS se encarga de la animación con max-height */
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s ease-in-out;
}

/* Enlaces dentro del submenú */
.mobile-submenu li a {
  display: block;
  padding: 0.6rem 0;
  color: white;
  text-decoration: none;
  font-size: 1rem;
}


/* Centra la lista de ítems dentro del mega-menú */
/* 1. Organiza los ítems del menú (Credit Card, etc.) en una fila centrada */
.mega-menu-column ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  justify-content: center;
  gap: 2rem;
}

/* 2. Apila y centra el texto y la imagen dentro de cada ítem */
.mega-menu-column ul li a {
display: inline-flex;
flex-direction: column;
align-items: center;
gap: 4px;
text-decoration: none;
color: inherit;
}

/* 3. Define el tamaño de la imagen (ahora siempre visible) */
.menu-item-icon {
width: 28px;
height: 28px;
}


/* --- Estilos para el Language Switcher con Banderas --- */

.language-switcher {
  position: relative; /* Necesario para posicionar las opciones */
  display: inline-block;
  cursor: pointer;
  font-family: sans-serif; /* Cambia esto por la fuente de tu proyecto */
  color: white;
}

.selected-language {
  display: flex;
  align-items: center;
  padding: 8px 12px;
  border-radius: 5px;
  background-color: #2a3d66; /* Color azul oscuro del fondo */
  transition: background-color 0.2s;
}

.selected-language:hover {
  background-color: #3b5080;
}

.selected-language img {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  margin-right: 8px;
  object-fit: cover;
}

.selected-language span {
  font-weight: bold;
  font-size: 16px;
}

.arrow-down {
  border: solid white;
  border-width: 0 2px 2px 0;
  display: inline-block;
  padding: 3px;
  transform: rotate(45deg);
  -webkit-transform: rotate(45deg);
  margin-left: 10px;
}

.language-options {
  display: none; /* Oculto por defecto */
  position: absolute;
  top: 100%;
  left: 0;
  width: 100%;
  background-color: #2a3d66;
  border-radius: 5px;
  overflow: hidden;
  z-index: 10;
  margin-top: 5px;
}

/* Mostramos las opciones cuando la clase 'open' está presente */
.language-switcher.open .language-options {
  display: block;
}

.language-option {
  display: flex;
  align-items: center;
  padding: 10px 12px;
  text-decoration: none;
  color: white;
  transition: background-color 0.2s;
}

.language-option:hover {
  background-color: #3b5080;
}

.language-option img {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  margin-right: 8px;
  object-fit: cover;
}