/* =============================================
   MENU MOBILE - CSS ISOLADO E LIMPO
   ============================================= */

/* Reset específico para menu mobile */
.mobile-menu-toggle,
.mobile-nav,
.mobile-overlay {
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* =============================================
   BOTÃO HAMBURGER - SEMPRE VISÍVEL EM MOBILE
   ============================================= */

.mobile-menu-toggle {
    /* Reset completo */
    all: unset;

    /* Forçar exibição */
    display: none !important; /* Hidden by default */
    position: relative !important;
    z-index: 10001 !important;

    /* Layout */
    width: 48px !important;
    height: 48px !important;
    min-width: 48px !important;
    min-height: 48px !important;

    /* Flexbox */
    flex-direction: column !important;
    justify-content: center !important;
    align-items: center !important;
    gap: 4px !important;

    /* Visual */
    background: rgba(255, 255, 255, 0.95) !important;
    border: 2px solid rgba(0, 108, 112, 0.3) !important;
    border-radius: 8px !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;

    /* Interaction */
    cursor: pointer !important;
    touch-action: manipulation !important;
    user-select: none !important;
    -webkit-tap-highlight-color: transparent !important;

    /* Animation */
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.mobile-menu-toggle:hover,
.mobile-menu-toggle:focus {
    background: rgba(255, 255, 255, 1) !important;
    border-color: rgba(0, 108, 112, 0.6) !important;
    transform: scale(1.05) !important;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2) !important;
}

.mobile-menu-toggle:active {
    transform: scale(0.95) !important;
}

/* =============================================
   LINHAS DO HAMBURGER
   ============================================= */

.mobile-menu-toggle span {
    display: block !important;
    width: 24px !important;
    height: 3px !important;
    background: #006C70 !important;
    border-radius: 2px !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    transform-origin: center !important;
}

/* Estado ativo - transformar em X */
.mobile-menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(7px, 7px) !important;
}

.mobile-menu-toggle.active span:nth-child(2) {
    opacity: 0 !important;
    transform: scale(0) !important;
}

.mobile-menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px) !important;
}

/* =============================================
   OVERLAY DE FUNDO
   ============================================= */

.mobile-overlay {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    background: rgba(0, 0, 0, 0.6) !important;
    backdrop-filter: blur(4px) !important;
    z-index: 9998 !important;

    /* Hidden by default */
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;

    /* Animation */
    transition: all 0.3s ease !important;
}

.mobile-overlay.active {
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: all !important;
}

/* =============================================
   MENU LATERAL
   ============================================= */

.mobile-nav {
    position: fixed !important;
    top: 0 !important;
    right: -380px !important; /* Hidden by default */
    width: 350px !important;
    max-width: 85vw !important;
    height: 100vh !important;

    /* Visual */
    background: linear-gradient(135deg,
        rgba(0, 108, 112, 0.98) 0%,
        rgba(0, 77, 80, 0.98) 50%,
        rgba(54, 216, 195, 0.95) 100%) !important;
    backdrop-filter: blur(20px) !important;
    box-shadow: -10px 0 40px rgba(0, 0, 0, 0.3) !important;
    border-left: 1px solid rgba(255, 255, 255, 0.2) !important;

    /* Layout */
    display: flex !important;
    flex-direction: column !important;
    padding: 80px 0 2rem 0 !important;
    gap: 0 !important;

    /* Z-index */
    z-index: 9999 !important;

    /* Animation */
    transition: right 0.4s cubic-bezier(0.4, 0, 0.2, 1) !important;

    /* Scroll */
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
}

.mobile-nav.active {
    right: 0 !important;
}

/* =============================================
   BOTÃO FECHAR (X)
   ============================================= */

.mobile-nav-close {
    position: absolute !important;
    top: 20px !important;
    right: 20px !important;
    width: 44px !important;
    height: 44px !important;

    /* Reset */
    background: none !important;
    border: none !important;
    outline: none !important;

    /* Visual */
    color: rgba(255, 255, 255, 0.9) !important;
    font-size: 28px !important;
    font-weight: 300 !important;
    line-height: 1 !important;

    /* Layout */
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;

    /* Interaction */
    cursor: pointer !important;
    touch-action: manipulation !important;

    /* Animation */
    transition: all 0.3s ease !important;
    border-radius: 50% !important;
}

/* CORREÇÃO: Remover pseudo-elemento duplicado do CSS principal */
.mobile-nav-close::before {
    content: none !important;
    display: none !important;
}

.mobile-nav-close:hover,
.mobile-nav-close:focus {
    background: rgba(255, 255, 255, 0.1) !important;
    color: rgba(255, 255, 255, 1) !important;
    transform: rotate(90deg) !important;
}

/* =============================================
   LINKS DO MENU
   ============================================= */

.mobile-nav a {
    display: block !important;
    padding: 16px 32px !important;

    /* Text */
    color: rgba(255, 255, 255, 0.95) !important;
    text-decoration: none !important;
    font-size: 18px !important;
    font-weight: 500 !important;
    line-height: 1.4 !important;

    /* Animation */
    transition: all 0.3s ease !important;
    position: relative !important;

    /* Border */
    border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
}

.mobile-nav a::before {
    content: '' !important;
    position: absolute !important;
    left: 0 !important;
    top: 0 !important;
    bottom: 0 !important;
    width: 0 !important;
    background: rgba(255, 255, 255, 0.1) !important;
    transition: width 0.3s ease !important;
}

.mobile-nav a:hover,
.mobile-nav a:focus {
    color: rgba(255, 255, 255, 1) !important;
    background: rgba(255, 255, 255, 0.05) !important;
    padding-left: 40px !important;
}

.mobile-nav a:hover::before,
.mobile-nav a:focus::before {
    width: 4px !important;
}

/* =============================================
   CONTROLE DO BODY QUANDO MENU ABERTO
   ============================================= */

body.mobile-menu-open {
    overflow: hidden !important;
    position: fixed !important;
    width: 100% !important;
    height: 100vh !important;
}

/* =============================================
   MEDIA QUERIES - MOBILE FIRST
   ============================================= */

/* Mobile Portrait (até 768px) */
@media screen and (max-width: 768px) {
    .mobile-menu-toggle {
        display: flex !important;
    }

    .mobile-nav {
        width: 320px !important;
        max-width: 90vw !important;
    }
}

/* Mobile Landscape (até 1024px) */
@media screen and (max-width: 1024px) {
    .mobile-menu-toggle {
        display: flex !important;
    }
}

/* Tablets e Mobile Landscape */
@media screen and (max-width: 1200px) {
    .mobile-menu-toggle {
        display: flex !important;
    }
}

/* =============================================
   FALLBACKS PARA NAVEGADORES ANTIGOS
   ============================================= */

/* Fallback para navegadores sem suporte a backdrop-filter */
@supports not (backdrop-filter: blur(20px)) {
    .mobile-nav {
        background: rgba(0, 77, 80, 0.98) !important;
    }

    .mobile-overlay {
        background: rgba(0, 0, 0, 0.8) !important;
    }
}

/* Fallback para navegadores sem suporte a CSS Grid */
@supports not (display: grid) {
    .mobile-nav {
        display: block !important;
    }
}

/* =============================================
   ACESSIBILIDADE
   ============================================= */

/* Foco visível para usuários de teclado */
.mobile-menu-toggle:focus-visible {
    outline: 3px solid rgba(255, 200, 87, 0.8) !important;
    outline-offset: 2px !important;
}

.mobile-nav a:focus-visible {
    outline: 2px solid rgba(255, 200, 87, 0.8) !important;
    outline-offset: 2px !important;
}

/* Reduzir movimento para usuários sensíveis */
@media (prefers-reduced-motion: reduce) {
    .mobile-menu-toggle,
    .mobile-nav,
    .mobile-overlay,
    .mobile-nav a {
        transition: none !important;
    }
}

/* High contrast mode */
@media (prefers-contrast: high) {
    .mobile-menu-toggle {
        border-color: #000 !important;
        background: #fff !important;
    }

    .mobile-menu-toggle span {
        background: #000 !important;
    }

    .mobile-nav {
        background: #000 !important;
        border-left-color: #fff !important;
    }

    .mobile-nav a {
        color: #fff !important;
        border-bottom-color: #fff !important;
    }
}
