@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@200;300;400;500;600;700&display=swap');

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Poppins', sans-serif;
}

nav {
  position: fixed;
  z-index: 99;
  width: 100%;
  background-color: #68478d;
}

nav .wrapper {
  position: relative;
  max-width: 1300px;
  padding: 0px 30px;
  height: 40px;
  line-height: 40px;
  margin: auto;
  display: flex;
  align-items: center;
  justify-content: center;
}

.wrapper .nav-links {
  display: inline-flex;
}

.nav-links li {
  list-style: none;
}

.nav-links li a {
  color: #f2f2f2;
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  padding: 9px 15px;
  border-radius: 5px;
  transition: all 0.3s ease;
  /* text-transform: lowercase; */
}

.nav-links li a:hover {
  background: rgba(255, 255, 255, 0.1);
}

.nav-links .mobile-item {
  display: none;
}

.nav-links .drop-menu {
  position: absolute;
  background: #242526;
  width: 180px;
  line-height: 45px;
  top: 85px;
  opacity: 0;
  visibility: hidden;
  box-shadow: 0 6px 10px rgba(0, 0, 0, 0.15);
}

/* DESHABILITADO: Ahora funciona con click, no con hover */
/* .nav-links li:hover .drop-menu,
.nav-links li:hover .mega-box {
  transition: all 0.3s ease;
  top: 40px;
  opacity: 1;
  visibility: visible;
} */

.drop-menu li a {
  width: 100%;
  display: block;
  padding: 0 0 0 13px;
  font-weight: 400;
  border-radius: 0px;
}

.mega-box {
  position: absolute;
  left: 0;
  width: 100%;
  /* height: calc(100vh - 140px); */
  /* overflow-y: scroll; */
  padding: 0 30px;
  top: 85px;
  opacity: 0;
  visibility: hidden;
}

/* Estilos para scroll de contenedor mega-box */
.mega-box::-webkit-scrollbar {
  -webkit-appearance: none;
}

.mega-box .content {
  background: #68478d;
  padding: 25px 35px;
  display: flex;
  width: 100%;
  justify-content: space-between;
  align-items: flex-start;
  box-shadow: 0 6px 10px rgba(0, 0, 0, 0.15);
}

.mega-box .content .row {
  /* width: calc(25% - 30px); */
  line-height: 33px;
  justify-content: center;
  display: flex;
  flex-direction: column;
  flex-wrap: wrap;
}

.content {
  display: flex;
  flex-direction: row;
  gap: 20px;
}

.content .row {
  flex: 1;
}

.content .row img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.content .row header {
  color: #ffda00;
  font-size: 18px;
  font-weight: 500;
  text-align: center;
  cursor: pointer;
  /* border-bottom: 1px solid rgba(255,255,255,0.03);; */
  /* text-overflow: inherit; */
}

.content .row header:hover {
  color: #abc4e4;
}

/* .content .row .mega-links{
  /* margin-left: -40px; 
}*/
.row .mega-links li {
  /* padding: 0 20px; */
  margin-top: 0px;
  margin-left: 4px;
  padding-left: 0px;
}

.row .mega-links li a {
  padding-top: 0px;
  padding-bottom: 0px;
  /* padding-left: 0px; */
  /* padding: 0 20px; */
  color: #d9d9d9;
  font-size: 11px;
  display: block;
}

.row .mega-links li a:hover {
  color: #f2f2f2;
}

.wrapper .btn {
  color: #fff;
  font-size: 20px;
  cursor: pointer;
  display: none;
}

.wrapper .btn.close-btn {
  position: absolute;
  right: 30px;
  top: 10px;
}

.navAswan .btn.menu-btn {
  display: none;
}

#contenedor_carrusel {
  margin-top: 110px;
}

.cont-ajuste-menu {
  margin-top: 110px;
}

#inicio_sesion_texto {
  color: #f2f2f2;
}

#nav_users {
  z-index: 0;
}

@media screen and (max-width: 980px) {
  .content {
    /* flex-direction: column; */
    height: auto;
    /* overflow-y: scroll; */
  }

  #nav_users {
    z-index: 99;
  }

  /* Fondo oscuro solo para mega-box que NO sean de #nav_users */
  .wrapper .nav-links .mega-box .content:not(#nav_users .mega-box .content) {
    background: #3A3B3C;
  }

  #contenedor_carrusel {
    margin-top: 135px;
  }

  .cont-ajuste-menu {
    margin-top: 135px;
  }

  .navAswan .btn.menu-btn {
    display: block;
  }

  nav .wrapper {
    position: absolute;
  }

  .wrapper .btn {
    display: block;
  }

  .wrapper .nav-links {
    position: fixed;
    height: 100vh;
    width: 100%;
    max-width: 350px;
    top: 0;
    left: -100%;
    background: #242526;
    display: block;
    padding: 50px 10px;
    line-height: 50px;
    overflow-y: auto;
    box-shadow: 0px 15px 15px rgba(0, 0, 0, 0.18);
    transition: all 0.3s ease;
  }

  /* custom scroll bar */
  ::-webkit-scrollbar {
    width: 10px;
  }

  ::-webkit-scrollbar-track {
    background: #242526;
  }

  ::-webkit-scrollbar-thumb {
    background: #3A3B3C;
  }

  #menu-btn:checked~.nav-links {
    left: 0%;
  }

  #menu-btn:checked~.btn.menu-btn {
    display: none;
  }

  #close-btn:checked~.btn.menu-btn {
    display: block;
  }

  .nav-links li {
    margin: 15px 10px;
  }

  .nav-links li a {
    padding: 0 20px;
    display: block;
    font-size: 20px;
  }

  .nav-links .drop-menu {
    position: static;
    opacity: 1;
    top: 65px;
    visibility: visible;
    padding-left: 20px;
    width: 100%;
    max-height: 0px;
    overflow: hidden;
    box-shadow: none;
    transition: all 0.3s ease;
  }

  #showDrop:checked~.drop-menu,
  #dm_arte:checked~.mega-box {
    max-height: 100%;
    overflow: auto;
  }

  #showDrop:checked~.drop-menu,
  #dm_bazar:checked~.mega-box {
    max-height: 100%;
    overflow: auto;
  }

  #showDrop:checked~.drop-menu,
  #dm_escolar:checked~.mega-box {
    max-height: 100%;
    overflow: auto;
  }

  #showDrop:checked~.drop-menu,
  #dm_manualidades:checked~.mega-box {
    max-height: 100%;
    overflow: auto;
  }

  #showDrop:checked~.drop-menu,
  #dm_tecnologia:checked~.mega-box {
    max-height: 100%;
    overflow: auto;
  }

  #showDrop:checked~.drop-menu,
  #dm_papeleria:checked~.mega-box {
    max-height: 100%;
    overflow: auto;
  }

  .mega-box {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.5s ease-in-out;
  }

  #showDrop:checked~.drop-menu,
  #dm_utiles:checked~.mega-box {
    max-height: 100%;
    overflow: auto;
  }

  .nav-links .desktop-item {
    display: none;
  }

  .nav-links .mobile-item {
    display: block;
    color: #f2f2f2;
    font-size: 20px;
    font-weight: 500;
    padding-left: 20px;
    cursor: pointer;
    border-radius: 5px;
    transition: all 0.3s ease;
  }

  .nav-links .mobile-item:hover {
    background: #3A3B3C;
  }

  .drop-menu li {
    margin: 0;
  }

  .drop-menu li a {
    border-radius: 5px;
    font-size: 18px;
  }

  .mega-box {
    position: static;
    top: 65px;
    opacity: 1;
    visibility: visible;
    padding: 0 20px;
    max-height: 0px;
    overflow: hidden;
    transition: all 0.3s ease;
  }

  .mega-box .content {
    box-shadow: none;
    flex-direction: column;
    padding: 20px 20px 0 20px;
  }

  .mega-box .content .row {
    width: 100%;
    margin-bottom: 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
  }

  .mega-box .content .row:nth-child(1),
  .mega-box .content .row:nth-child(2) {
    border-top: 0px;
  }

  .content .row .mega-links {
    border-left: 0px;
    padding-left: 15px;
  }

  .row .mega-links li {
    margin: 0;
  }

  .content .row header {
    font-size: 19px;
  }
}

nav input {
  display: none;
}

.body-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 100%;
  text-align: center;
  padding: 0 30px;
}

.body-text div {
  font-size: 45px;
  font-weight: 600;
}

/* ========================================
   ESTILOS PERSONALIZADOS PARA MEGA MENÚ
   ======================================== */

/* Eliminar espacio en blanco entre header y menú */
#nav_users {
  margin-top: 0 !important;
  padding-top: 0 !important;
}

.containerAswan {
  margin-bottom: 0 !important;
  padding-bottom: 0 !important;
}

/* Deshabilitar el comportamiento hover por defecto */
#nav_users .nav-links>li:hover .mega-box {
  opacity: 0 !important;
  pointer-events: none !important;
  top: 0 !important;
  visibility: hidden !important;
}

/* Contenedor del mega menú con límite de ancho */
#nav_users .mega-box {
  max-width: 100vw !important;
  left: 0 !important;
  right: 0 !important;
  transform: none !important;
  transition: opacity 0.2s ease, visibility 0.2s ease, top 0.2s ease !important;
  visibility: hidden;
  will-change: opacity, visibility;
}

/* Mostrar mega menú solo cuando tiene la clase 'active' (por click) */
#nav_users .nav-links>li .mega-box.active {
  opacity: 1 !important;
  pointer-events: all !important;
  top: 40px !important;
  visibility: visible !important;
  transition: opacity 0.2s ease, visibility 0.2s ease, top 0.2s ease !important;
}

/* Mejorar el espaciado del contenedor principal del mega menú */
#nav_users .mega-box .content {
  padding: 20px 15px !important;
  display: flex;
  flex-wrap: nowrap;
  gap: 10px;
  justify-content: space-evenly;
  overflow-x: hidden;
  overflow-y: hidden;
  max-width: 100%;
  box-sizing: border-box;
}

/* Estilo para cada columna (row) del mega menú */
#nav_users .mega-box .content .row {
  flex: 1 1 0;
  min-width: 150px;
  max-width: 180px;
  margin: 0 !important;
  padding: 8px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 6px;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
}

/* Estilo para los headers (títulos amarillos) */
#nav_users .mega-box .content .row header {
  position: relative;
  margin-bottom: 10px !important;
  padding-bottom: 6px;
  border-bottom: 2px solid rgba(255, 193, 7, 0.3);
  cursor: pointer;
  transition: color 0.2s ease;
  font-size: 0.88rem;
  line-height: 1.3;
  word-wrap: break-word;
  overflow-wrap: break-word;
  hyphens: auto;
  max-height: 2.6em;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

#nav_users .mega-box .content .row header:hover {
  color: #ffd54f !important;
}

/* Contenedor de la lista con scroll */
#nav_users .mega-box .content .row .mega-links {
  max-height: 120px;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 6px;
  margin: 0;
  list-style: none;
}

/* Estilo para el scrollbar */
#nav_users .mega-box .content .row .mega-links::-webkit-scrollbar {
  width: 5px;
}

#nav_users .mega-box .content .row .mega-links::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 3px;
}

#nav_users .mega-box .content .row .mega-links::-webkit-scrollbar-thumb {
  background: rgba(255, 193, 7, 0.4);
  border-radius: 3px;
}

#nav_users .mega-box .content .row .mega-links::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 193, 7, 0.6);
}

/* Estilo para cada item de la lista */
#nav_users .mega-box .content .row .mega-links li {
  margin: 0 0 5px 0 !important;
  padding: 0 !important;
}

#nav_users .mega-box .content .row .mega-links li a {
  display: block;
  padding: 5px 8px !important;
  border-radius: 4px;
  transition: background 0.15s ease, padding-left 0.15s ease;
  line-height: 1.3;
  font-size: 0.85rem;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

#nav_users .mega-box .content .row .mega-links li a:hover {
  background: rgba(255, 255, 255, 0.1);
  padding-left: 12px !important;
}

/* Mejorar el espaciado del item del menú desktop */
#nav_users .nav-links>li {
  margin: 0 5px;
}

#nav_users .nav-links>li>a.desktop-item {
  padding: 12px 18px;
  cursor: pointer;
  user-select: none;
}

/* Indicador visual cuando el menú está activo */
#nav_users .nav-links>li .mega-box.active~a.desktop-item,
#nav_users .nav-links>li:has(.mega-box.active)>a.desktop-item {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
}

/* Responsive: ajustes para pantallas más pequeñas */
@media screen and (max-width: 970px) {

  /* En móvil, NO aplicar los estilos de click de desktop */
  #nav_users .nav-links>li:hover .mega-box {
    opacity: 1 !important;
    pointer-events: all !important;
    visibility: visible !important;
  }

  /* Contenedor principal - gris oscuro */
  #nav_users .mega-box .content {
    background: #3A3B3C !important;
    padding: 10px !important;
    box-shadow: none !important;
  }

  /* Tarjetas - gris más oscuro, 100% de ancho */
  #nav_users .mega-box .content .row {
    background: #2d2e2f !important;
    padding: 12px !important;
    margin: 0 0 10px 0 !important;
    border-radius: 6px !important;
    border: none !important;
    box-shadow: none !important;
    width: 100% !important;
    min-width: auto !important;
    max-width: none !important;
    box-sizing: border-box !important;
  }

  /* Headers - amarillo */
  #nav_users .mega-box .content .row header {
    color: #ffc107 !important;
    font-size: 0.95rem !important;
    font-weight: 600 !important;
    text-align: left !important;
    margin: 0 0 10px 0 !important;
    padding: 0 0 8px 0 !important;
    border-bottom: 1px solid rgba(255, 193, 7, 0.3) !important;
  }

  /* Lista */
  #nav_users .mega-box .content .row .mega-links {
    padding: 0 !important;
    margin: 0 !important;
    list-style: none !important;
  }

  #nav_users .mega-box .content .row .mega-links li {
    margin: 0 0 4px 0 !important;
    padding: 0 !important;
    list-style: none !important;
  }

  /* Links - gris claro */
  #nav_users .mega-box .content .row .mega-links li a {
    color: #d9d9d9 !important;
    font-size: 0.85rem !important;
    padding: 8px 10px !important;
    display: block !important;
    border-radius: 4px !important;
    transition: background 0.2s ease !important;
    background: transparent !important;
  }

  /* Hover */
  #nav_users .mega-box .content .row .mega-links li a:hover {
    color: #ffffff !important;
    background: rgba(255, 255, 255, 0.1) !important;
  }
}