nav {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 20px;
    position: sticky;
    top: 0;
    z-index: 1000;
    transition: all 0.5s ease;
    height: 100px; /* altura inicial */
}

/* Logo */
.logo img {
    height: 80px;
    transition: all 0.5s ease;
    opacity: 1;
    transform: scale(1);
}

.logo-movil {
    position: absolute;
    left: 20px;
    opacity: 0;
    font-size: 22px;
    font-weight: bold;
    color: #000;
    transition: all 0.5s ease;
}

.logo-movil a {
    text-decoration: none; /* Quita el subrayado */
    color: #777;
}

.logo-movil a:hover {
    text-decoration: none; /* Sigue sin subrayado al pasar el ratón */
    color: inherit;        /* Mantiene el color */
}

/* Menú principal */
.menu {
    list-style: none;
    display: flex;
    justify-content: flex-start;
    transition: all 0.3s ease;
}

.menu li {
    position: relative;
}

.menu li a {
    display: block;
    padding: 12px 20px;
    color: #333;
    text-decoration: none;
    text-align: center;
    transition: background 0.3s ease;
    border-radius: 12px;
}

.menu li a:hover {
    background-color: rgba(51,51,51,0.1);
    color: #000;
}

/* Submenú con animación de deslizamiento */
.submenu ul {
    list-style: none;
    position: absolute;
    top: 100%;
    left: 0;
    background-color: rgba(51,51,51,0.9);
    backdrop-filter: blur(8px);
    min-width: 180px;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transform: translateX(-10px);
    transition: max-height 1s ease, opacity 1s ease, transform 0.5s ease;
    border-radius: 12px;}

.submenu ul li a {
    display: block;
}

.submenu:hover ul {
    max-height: 500px;
    opacity: 1;
    transform: translateX(0);
}

/* Hamburguesa */
.hamburguesa {
    display: none;
    flex-direction: column;
    cursor: pointer;
    padding: 12px;
    transition: all 0.3s ease;
}

.hamburguesa span {
    height: 3px;
    width: 25px;
    background-color: #333;
    margin: 4px 0;
    border-radius: 2px;
    transition: 0.4s;
}

/* Transformación a X */
.hamburguesa.activo span:nth-child(1) {
    transform: rotate(45deg) translate(9px, 9px);
}
.hamburguesa.activo span:nth-child(2) {
    opacity: 0;
}
.hamburguesa.activo span:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -6px);
}

/* Responsive */
@media (max-width: 768px) {
    .hamburguesa {
        display: flex;
    }

    .menu {
        display: flex;
        flex-direction: column;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background-color: rgba(255, 255, 255, 0.9);
        backdrop-filter: blur(10px);
        max-height: 0;
        overflow: hidden;
        opacity: 0;

    }

    .menu.activo {
        max-height: 600px;
        opacity: 1;
        transition: max-height 0.5s ease, opacity 0.5s ease;
    }

    .menu li {
        width: 100%;
    }

    /* Submenú en móvil */


    .submenu ul {
        position: static;
        max-height: 0;
        opacity: 0;
        transform: translateX(-10px);
        border-radius: 0;
	}

    .submenu.activo ul {
        max-height: 500px;
        opacity: 1;
        transform: translateX(0);
        border-radius: 0;

    }

    .submenu ul:hover {
        border-radius: 0;
    }

    .submenu ul li a {
        padding-left: 30px;


    }

}

/* Efecto scroll suave con reducción de barra */
#navbar.scrolled {
    height: 60px; /* altura reducida */
}

#navbar.scrolled .logo img {
    opacity: 0;
    transform: scale(0.6);
}

#navbar.scrolled .logo-movil {
    opacity: 1;
}