/*   --- MENU ---   */

nav {
  margin: 0 auto;
  background: white;
  height: 80px;
  width: 90%;
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 40px;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  margin: 20px auto 0 auto;
  z-index: 1000;
  flex-wrap: wrap;
  transition: transform 0.3s ease, opacity 0.3s ease;
}


.enlace {
    display: flex;
    align-items: center;
}

.logo {
    height: 40px;
}

nav ul {
    display: flex;
    gap: 20px;
    align-items: center;
}

nav ul li {
    position: relative;
    opacity: 0;
    transform: translateY(20px);
}

nav ul.menu-animado li {
  animation: slideIn 1s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

nav ul.menu-animado li:nth-child(1) { animation-delay: 0.1s; }
nav ul.menu-animado li:nth-child(2) { animation-delay: 0.2s; }
nav ul.menu-animado li:nth-child(3) { animation-delay: 0.3s; }
nav ul.menu-animado li:nth-child(4) { animation-delay: 0.4s; }


#check:checked ~ ul li {
    animation: slideIn 0.4s forwards;
}

#check:checked ~ ul li:nth-child(1) { animation-delay: 0.1s; }
#check:checked ~ ul li:nth-child(2) { animation-delay: 0.2s; }
#check:checked ~ ul li:nth-child(3) { animation-delay: 0.3s; }
#check:checked ~ ul li:nth-child(4) { animation-delay: 0.4s; }

nav ul li a {
    display: inline-block;
    color: black;
    font-size: 18px;
    font-weight: bold;
    padding: 8px 10px;
    border-radius: 3px;
    text-transform: uppercase;
    position: relative;
    transition: color 0.3s ease;
}

nav ul li a::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 3px;
    background: linear-gradient(90deg, rgb(179, 11, 170) 25%, rgb(13, 51, 122) 73%);
    transition: width 0.5s ease;
}

nav ul li a:hover::after,
nav ul li a.active::after {
    width: 100%;
}

.checkbtn {
    font-size: 30px;
    color: black;
    cursor: pointer;
    display: none;
}

#check {
    display: none;
}

@media (max-width: 952px) {
    nav ul li a {
        font-size: 16px;
    }
}

@media (max-width: 858px) {
    .checkbtn {
        display: block;
    }

    nav ul {
        position: fixed;
        top: 90px;
        left: 50%;
        transform: translateX(-50%);
        width: 90%;
        background: white;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 30px;
        padding: 30px 0;
        border-radius: 15px;
        box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
        backdrop-filter: blur(8px);
        transition: all 0.5s ease;
        opacity: 0;
        pointer-events: none;
        z-index: 10;
    }



    #check:checked ~ ul {
        opacity: 1;
        pointer-events: auto;
    }



    nav ul li a {
        font-size: 20px;
        padding: 10px;
    }

    nav ul li a::after {
        bottom: -2px;
    }

    li a:hover,
    li a.active {
        background: linear-gradient(90deg, rgb(179, 11, 170) 25%, rgb(13, 51, 122) 73%);
        -webkit-background-clip: text;
        -webkit-text-fill-color: transparent;
        background-clip: text;
        color: transparent;
    }

}

nav ul li a.active {
  position: relative;
  pointer-events: none; /* Evita que se pueda volver a hacer clic */
  font-weight: bold;
}



@keyframes slideIn {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes subrayadoActivo {
  from {
    transform: scaleX(0);
    opacity: 0;
  }
  to {
    transform: scaleX(1);
    opacity: 1;
  }
}