/* Botón hamburguesa - oculto por defecto en desktop */
.hamburger-menu {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 32px;
    height: 24px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 5px;
    z-index: 1001;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    margin-left: auto;
}

.hamburger-menu:focus {
    outline: none;
}

.hamburger-menu:hover {
    transform: scale(1.1);
}

.hamburger-menu span {
    width: 100%;
    height: 2.5px;
    background-color: var(--blanco);
    border-radius: 3px;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    transform-origin: center;
    display: block;
    position: relative;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

/* Animación del botón cuando está activo */
.hamburger-menu.active span:nth-child(1) {
    transform: translateY(10px) rotate(45deg);
    background-color: var(--corporativoPrincipal);
}

.hamburger-menu.active span:nth-child(2) {
    opacity: 0;
    transform: scale(0);
}

.hamburger-menu.active span:nth-child(3) {
    transform: translateY(-10px) rotate(-45deg);
    background-color: var(--corporativoPrincipal);
}

/* Overlay del menú móvil */
.menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, 
        rgba(19, 76, 126, 0.4) 0%, 
        rgba(33, 128, 187, 0.8) 100%);
    backdrop-filter: blur(8px);
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 998;
}

.menu-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Panel del menú móvil */
.mobile-menu {
    position: fixed;
    top: 0;
    right: -100%;
    width: 82%;
    max-width: 380px;
    height: 100vh;
    background: linear-gradient(180deg, 
        rgba(255, 255, 255, 0.98) 0%, 
        rgba(250, 251, 252, 0.98) 100%);
    box-shadow: -8px 0 40px rgba(19, 76, 126, 0.3);
    transition: right 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 999;
    overflow-y: auto;
    overflow-x: hidden;
}

.mobile-menu.active {
    right: 0;
}

/* Scrollbar personalizado */
.mobile-menu::-webkit-scrollbar {
    width: 6px;
}

.mobile-menu::-webkit-scrollbar-track {
    background: rgba(19, 76, 126, 0.05);
}

.mobile-menu::-webkit-scrollbar-thumb {
    background: var(--corporativoComplementario);
    border-radius: 10px;
}

/* Header del menú móvil */
.mobile-menu::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 120px;
    background: linear-gradient(135deg, 
        var(--corporativoPrincipal) 0%, 
        var(--corporativoComplementario) 100%);
    clip-path: ellipse(120% 100% at 50% 0%);
    z-index: 0;
}

/* Botón de cerrar (X) dentro del menú */
.mobile-menu-close {
    position: absolute;
    top: 35px;
    right: 30px;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.mobile-menu-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

.mobile-menu-close::before,
.mobile-menu-close::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 2px;
    background: var(--blanco);
    border-radius: 2px;
}

.mobile-menu-close::before {
    transform: rotate(45deg);
}

.mobile-menu-close::after {
    transform: rotate(-45deg);
}

/* Contenedor de links */
.mobile-menu .mobile-links {
    display: flex;
    flex-direction: column;
    padding: 80px 0 20px;
    margin: 0;
    list-style: none;
    gap: 8px;
    position: relative;
    z-index: 1;
}

a#servicios-link {
    margin-top: 70px;
}

/* Estilo de cada link */
.mobile-menu .mobile-links a {
    display: flex;
    align-items: center;
    padding: 18px 30px;
    color: #1a1a1a;
    text-decoration: none;
    font-size: 17px;
    font-weight: 600;
    letter-spacing: 0.3px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    margin: 0px 15px;
    border-radius: 12px;
}

/* Efecto de entrada escalonado */
.mobile-menu.active .mobile-links a {
    animation: slideInRight 0.4s cubic-bezier(0.4, 0, 0.2, 1) forwards;
    opacity: 0;
}

.mobile-menu.active .mobile-links a:nth-child(1) {
    animation-delay: 0.1s;
}

.mobile-menu.active .mobile-links a:nth-child(2) {
    animation-delay: 0.15s;
}

.mobile-menu.active .mobile-links a:nth-child(3) {
    animation-delay: 0.2s;
}

.mobile-menu.active .mobile-links a:nth-child(4) {
    animation-delay: 0.25s;
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.mobile-menu .mobile-i18n {
    padding: 30px 30px 40px;
    margin-top: auto;
    border-top: 2px solid rgba(19, 76, 126, 0.1);
    position: relative;
    z-index: 1;
}

.mobile-menu .mobile-i18n a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 14px 32px;
    background: linear-gradient(135deg, 
        var(--corporativoPrincipal) 0%, 
        var(--corporativoComplementario) 100%);
    color: var(--blanco);
    text-decoration: none;
    border-radius: 25px;
    font-weight: 700;
    font-size: 15px;
    letter-spacing: 1px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 15px rgba(19, 76, 126, 0.3);
    position: relative;
    overflow: hidden;
}

.mobile-menu .mobile-i18n a::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, 
        transparent, 
        rgba(255, 255, 255, 0.3), 
        transparent);
    transition: left 0.5s;
}

.mobile-menu .mobile-i18n a:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(19, 76, 126, 0.4);
}

.mobile-menu .mobile-i18n a:active {
    transform: translateY(0);
    box-shadow: 0 2px 10px rgba(19, 76, 126, 0.3);
}

/* MEDIA QUERIES PARA MENÚ */
@media screen and (max-width: 1200px) {
    .hamburger-menu {
        display: flex !important;
    }

    .header .links {
        display: none !important;
    }

    .header .internacionalizacion {
        display: none !important;
    }
}

@media screen and (min-width: 1201px) {
    .hamburger-menu,
    .mobile-menu,
    .menu-overlay {
        display: none !important;
    }
}

/* Animación de pulso sutil en el botón */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.8;
    }
}

.hamburger-menu:hover span {
    animation: pulse 1.5s infinite;
}

.hamburger-menu:hover span:nth-child(2) {
    animation-delay: 0.1s;
}

.hamburger-menu:hover span:nth-child(3) {
    animation-delay: 0.2s;
}