/* Prevenir overflow horizontal em dispositivos móveis */
@media (max-width: 768px) {
    * {
        max-width: 100vw;
        box-sizing: border-box;
    }

    html, body {
        overflow-x: hidden;
        width: 100%;
        max-width: 100vw;
    }

    .container {
        max-width: 100vw;
        padding-left: 1.6vh;
        padding-right: 1.6vh;
    }
}

/* Menu mobile básico */
.mobile-menu-btn {
    display: none;
    flex-direction: column;
    gap: 0.4vh;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.32vh;
    border-radius: 1.6vh;
}

.mobile-menu-btn span {
    width: 2vh;
    height: 0.2vh;
    background: #0B1220;
    transition: all 0.2s ease;
}

/* Desktop Styles - Garantir que o desktop mantenha o design original */
@media (min-width: 769px) {
    .header-nav {
        min-width: 50vw !important;
        width: auto !important;
        margin: 0 auto !important;
        padding: 1.4vh 2vw !important;
        justify-content: space-between !important;
        flex-wrap: nowrap !important;
        max-width: 90vw !important;
    }
    
    .desktop-nav {
        display: flex !important;
    }
    
    .mobile-menu-toggle {
        display: none !important;
    }
    
    .mobile-nav-links {
        display: none !important;
    }
    
    .nav-animated-btn {
        display: flex !important;
    }
    
    .nav-actions {
        order: unset !important;
        margin-right: 2.08vw !important;
    }
    
    .nav-brand {
        order: unset !important;
        margin-right: 4.17vw !important;
    }
}

/* Mobile Navigation Styles */
.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-around;
    width: 1.8vh;
    height: 1.8vh;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 1001;
    margin-right: 0.65vh;
}

.hamburger-line {
    width: 100%;
    height: 0.2vh;
    background: #333;
    border-radius: 0.0625vh;
    transition: all 0.3s ease;
    transform-origin: center;
}

.mobile-menu-toggle.active .hamburger-line:nth-child(1) {
    transform: rotate(45deg) translate(0.4vh, 0.4vh);
}

.mobile-menu-toggle.active .hamburger-line:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle.active .hamburger-line:nth-child(3) {
    transform: rotate(-45deg) translate(0.4vh, -0.4vh);
}

.mobile-menu {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: rgba(0, 0, 0, 0.5);
    z-index: 99999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    pointer-events: none;
}

.mobile-menu.active {
    display: block;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.mobile-menu-content {
    position: absolute;
    top: 0;
    right: 0;
    width: 28vw;
    height: 100%;
    background: white;
    padding: 0;
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    pointer-events: auto;
    z-index: 100000;
}

.mobile-menu-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 1.95vh 0.3125vh 1.95vh;
    border-bottom: 0.0625vh solid #f0f0f0;
}

.mobile-menu-logo {
    color: #333;
    font-size: 2.4vh;
    font-weight: 700;
    text-decoration: none;
}

.mobile-menu-close {
    background: none;
    border: none;
    color: #333;
    font-size: 2.4vh;
    cursor: pointer;
    padding: 0.5vh;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 3vh;
    height: 3vh;
}

.mobile-menu-nav {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: flex-start;
    padding: 1.95vh;
    gap: 2vh;
}

.mobile-menu.active .mobile-menu-content {
    transform: translateX(0);
}

/* Garantir que o conteúdo da página não seja afetado quando o menu mobile está ativo */
body.mobile-menu-active {
    overflow: hidden !important;
}

.mobile-nav-link {
    display: block;
    padding: 0;
    color: #333;
    text-decoration: none;
    font-size: 1.92vh;
    font-weight: 500;
    text-align: left;
    width: auto;
    transition: color 0.3s ease;
    position: relative;
}

.mobile-nav-link:hover,
.mobile-nav-link.active {
    color: #b3ce3a !important;
}

/* Remover todas as bolas verdes dos links mobile */
.mobile-nav-link::after,
.mobile-nav-link::before,
.mobile-nav-link.active::after,
.mobile-nav-link.active::before,
.mobile-nav-links .mobile-nav-link::after,
.mobile-nav-links .mobile-nav-link::before,
.mobile-nav-links .mobile-nav-link.active::after,
.mobile-nav-links .mobile-nav-link.active::before {
    content: none !important;
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    width: 0 !important;
    height: 0 !important;
}


.mobile-contact-btn {
    margin-top: 1.25vh;
    padding: 1.125vh 2.5vh;
    background: #b3ce3a;
    color: white;
    border: none;
    border-radius: 0.75vh;
    font-size: 1.1vh;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
    box-shadow: 0 0.25vh 0.9375vh rgba(179, 206, 58, 0.3);
}

.mobile-contact-btn:hover {
    background: #9bb32a;
    transform: translateY(-0.2vh);
    box-shadow: 0 0.6vh 2vh rgba(179, 206, 58, 0.4);
}

/* Mobile Responsive Styles */
@media (max-width: 768px) {
    .header-nav {
        min-width: auto;
        width: calc(100% - 1.95vh);
        margin: 0 0.9375vh;
        padding: 0.75vh 1.25vh;
        justify-content: space-between;
        flex-wrap: wrap;
        transition: all 0.3s ease;
    }
    
    .header-nav.expanded {
        padding: 0.75vh 1.25vh 1.25vh 1.25vh;
    }
    
    .desktop-nav {
        display: none !important;
    }
    
    .mobile-menu-toggle {
        display: flex;
        order: 3;
    }
    
    .nav-actions {
        order: 2;
        margin-right: 0;
    }
    
    .nav-brand {
        margin-right: 0;
        order: 1;
    }
    
    .nav-animated-btn {
        display: none !important;
    }
    
    .mobile-nav-links {
        display: none;
        width: 100%;
        order: 4;
        flex-basis: 100%;
        margin-top: 0.2vh;
        padding-top: 1.5vh;
        border-top: 0.1vh solid #f0f0f0;
    }
    
    .header-nav.expanded .mobile-nav-links {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 1vh;
    }
    
    .mobile-nav-link {
        padding: 0.8vh 0;
        color: #333;
        text-decoration: none;
        font-size: 1.6vh;
        font-weight: 500;
        text-align: center;
        transition: color 0.3s ease;
    }
    
    /* Controlar a ordem dos links mobile */
    .mobile-nav-link:nth-child(1) { order: 1; } /* Home */
    .mobile-nav-link:nth-child(2) { order: 2; } /* Impact */
    .mobile-nav-link:nth-child(3) { order: 3; } /* Services */
    .mobile-nav-link:nth-child(4) { order: 4; } /* Recruitment */
    .mobile-nav-link:nth-child(5) { order: 5; } /* About us */
    .mobile-nav-contact-btn { order: 6; } /* Get in Touch */
    
    .mobile-nav-link:hover {
        color: #b3ce3a !important;
    }
    
    .mobile-nav-link.active {
        color: #b3ce3a !important;
    }
    
    /* Botão de tradução em preto no mobile */
    .language-toggle {
        color: #000000 !important;
    }
    
    .language-toggle svg {
        fill: #000000 !important;
    }
    
    /* Hamburger/X em preto no mobile */
    .hamburger-line {
        background: #000000 !important;
    }
    
    .mobile-nav-contact-btn {
        padding: 0.75vh 1.95vh;
        background: #b3ce3a;
        color: white;
        border: none;
        border-radius: 0.5vh;
        font-size: 1.6vh;
        font-weight: 600;
        cursor: pointer;
        transition: all 0.3s ease;
        text-decoration: none;
        display: inline-block;
        text-align: center;
    }
    
    .mobile-nav-contact-btn:hover {
        background: #9bb32a;
        transform: translateY(-0.1vh);
    }
}

@media (max-width: 480px) {
    .header-nav {
        width: calc(100% - 1.95vh);
        margin: 0 0.625vh;
        padding: 0.625vh 0.9375vh;
    }
    
    .mobile-menu-content {
        width: 100%;
        padding: 4.375vh 1.25vh 1.25vh;
    }
}
