/* =====================================================
   LAYOUT - Header, Footer, Menu
   ===================================================== */

/* ==================== HEADER ==================== */
.header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.08);
    z-index: 1000;
    transition: all 0.3s ease;
}

.header.scrolled {
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.12);
}

.header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 30px;
    padding-top: 15px;
    padding-bottom: 15px;
    transition: var(--transicao);
}

.header.scrolled .container {
    padding-top: 10px;
    padding-bottom: 10px;
}

/* ==================== LOGO ==================== */
.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    flex-shrink: 0;
    transition: var(--transicao);
}

.logo-icon {
    width: 45px;
    height: 45px;
    flex-shrink: 0;
    transition: var(--transicao);
}

.logo:hover .logo-icon {
    transform: rotate(-5deg) scale(1.05);
}

.logo-text {
    display: flex;
    flex-direction: column;
    line-height: 1.1;
    font-family: 'Space Grotesk', sans-serif;
}

.logo-text strong {
    font-size: 1.15rem;
    color: var(--azul);
    font-weight: 700;
    letter-spacing: -0.5px;
}

.logo-text span {
    font-size: 1.15rem;
    color: var(--laranja);
    font-weight: 700;
    letter-spacing: -0.5px;
    margin-top: -3px;
}

.logo-text small {
    font-family: 'Inter', sans-serif;
    font-size: 0.65rem;
    color: var(--cinza-500);
    font-weight: 600;
    letter-spacing: 3px;
    text-transform: uppercase;
    margin-top: 3px;
}

/* ==================== MENU DESKTOP ==================== */
/* Posicionado no centro do ecrã porque está fora do header no HTML */
.nav {
    position: fixed;
    top: 15px; /* Alinhado com o padding do header */
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    justify-content: center;
    z-index: 1001;
    transition: all 0.3s ease;
}

.header.scrolled ~ .nav {
    top: 10px; /* Acompanha o header ao fazer scroll */
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 5px;
    margin: 0;
    padding: 0;
}

.nav-menu li {
    position: relative;
}
/* ==================== MENU DESKTOP ==================== */
.nav-menu a {
    display: block;
    padding: 10px 16px;
    font-size: 0.9rem;
    font-weight: 600; /* Deixar a fonte um pouco mais forte para realçar no fundo escuro */
    color: #FFFFFF; /* AQUI: Muda a cor para branco */
    text-decoration: none;
    border-radius: var(--raio-full);
    transition: var(--transicao);
    position: relative;
    white-space: nowrap;
}

.nav-menu a:hover,
.nav-menu a.active {
    color: #FFFFFF; /* Mantém branco ao passar o rato */
    background: rgba(255, 255, 255, 0.15); /* Fundo branco transparente em vez de azul */
}

/* A linha laranja debaixo do link ativo mantém-se igual */
.nav-menu a.active::after {
    content: '';
    position: absolute;
    bottom: 4px;
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 3px;
    background: var(--laranja); /* cor laranja */
    border-radius: var(--raio-full);
}

/* ==================== HEADER ACTIONS ==================== */
.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.header-actions .btn {
    padding: 10px 18px;
    font-size: 0.85rem;
}

/* ==================== USER MENU ==================== */
.user-menu {
    position: relative;
}

.user-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 12px 6px 6px;
    background: var(--cinza-100);
    border: 1px solid var(--cinza-200);
    border-radius: var(--raio-full);
    cursor: pointer;
    transition: var(--transicao);
    font-family: inherit;
}

.user-btn:hover {
    background: var(--cinza-200);
    border-color: var(--cinza-300);
}

.user-btn i.fa-chevron-down {
    font-size: 0.75rem;
    color: var(--cinza-500);
    transition: var(--transicao);
}

.user-btn.active i.fa-chevron-down {
    transform: rotate(180deg);
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--azul);
    color: var(--branco);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.9rem;
    overflow: hidden;
    flex-shrink: 0;
}

.user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.user-info {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    line-height: 1.2;
}

.user-nome {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--cinza-800);
}

.user-tipo {
    font-size: 0.7rem;
    color: var(--cinza-500);
    text-transform: capitalize;
}

.user-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    min-width: 240px;
    background: var(--branco);
    border-radius: var(--raio);
    box-shadow: var(--sombra-xl);
    border: 1px solid var(--cinza-200);
    padding: 8px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: var(--transicao);
    z-index: 1001;
}

.user-dropdown.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.user-dropdown a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 14px;
    font-size: 0.9rem;
    color: var(--cinza-700);
    border-radius: var(--raio-sm);
    text-decoration: none;
    transition: var(--transicao);
}

.user-dropdown a:hover {
    background: var(--cinza-100);
    color: var(--azul);
}

.user-dropdown a i {
    width: 18px;
    text-align: center;
    color: var(--cinza-500);
}

.user-dropdown a:hover i {
    color: var(--azul);
}

.user-dropdown a.text-danger {
    color: var(--erro);
}

.user-dropdown a.text-danger:hover {
    background: rgba(239, 68, 68, 0.1);
    color: var(--erro);
}

.user-dropdown a.text-danger i {
    color: var(--erro);
}

.user-dropdown hr {
    border: none;
    border-top: 1px solid var(--cinza-200);
    margin: 6px 0;
}

/* ==================== MENU TOGGLE (Mobile Base) ==================== */
.menu-toggle {
    display: none;
    width: 42px;
    height: 42px;
    background: var(--cinza-100);
    border: 1px solid var(--cinza-200);
    border-radius: var(--raio);
    color: var(--cinza-700);
    font-size: 1.15rem;
    cursor: pointer;
    transition: var(--transicao);
    align-items: center;
    justify-content: center;
}

.menu-toggle:hover {
    background: var(--azul);
    color: var(--branco);
    border-color: var(--azul);
}

/* Esconder elementos exclusivos do mobile no desktop */
.menu-close-btn, 
.menu-mobile-buttons {
    display: none !important;
}

/* ==================== MAIN CONTENT ==================== */
.main-content {
    min-height: calc(100vh - 200px);
    padding-top: 80px;
}

/* ==================== FOOTER ==================== */
.footer {
    background: var(--cinza-900);
    color: var(--cinza-300);
    padding: 60px 0 0;
    margin-top: 80px;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1.5fr;
    gap: 40px;
    padding-bottom: 40px;
}

.footer-col h4 {
    color: var(--branco);
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 20px;
    position: relative;
    padding-bottom: 10px;
}

.footer-col h4::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 30px;
    height: 3px;
    background: var(--laranja);
    border-radius: var(--raio-full);
}

.footer-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    margin-bottom: 15px;
}

.footer-logo div {
    display: flex;
    flex-direction: column;
    line-height: 1.1;
    font-family: 'Space Grotesk', sans-serif;
}

.footer-logo strong {
    color: var(--branco);
    font-size: 1rem;
    font-weight: 700;
}

.footer-logo span {
    color: var(--laranja);
    font-size: 1rem;
    font-weight: 700;
}

.footer-desc {
    color: var(--cinza-400);
    font-size: 0.875rem;
    line-height: 1.7;
    margin-bottom: 20px;
}

.footer-social {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.footer-social a {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 50%;
    color: var(--cinza-300);
    font-size: 1rem;
    transition: var(--transicao);
}

.footer-social a:hover {
    background: var(--laranja);
    color: var(--branco);
    transform: translateY(-3px);
}

.footer-col ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-col ul li {
    margin-bottom: 10px;
}

.footer-col ul a {
    color: var(--cinza-400);
    font-size: 0.875rem;
    text-decoration: none;
    transition: var(--transicao);
    display: inline-block;
}

.footer-col ul a:hover {
    color: var(--laranja);
    transform: translateX(5px);
}

.footer-contacts li {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    color: var(--cinza-400);
    font-size: 0.875rem;
    line-height: 1.6;
}

.footer-contacts li i {
    color: var(--laranja);
    font-size: 1rem;
    margin-top: 3px;
    flex-shrink: 0;
    width: 18px;
    text-align: center;
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding: 25px 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
}

.footer-bottom p {
    color: var(--cinza-500);
    font-size: 0.8rem;
    margin: 0;
}

.footer-links-bottom {
    display: flex;
    gap: 25px;
    flex-wrap: wrap;
}

.footer-links-bottom a {
    color: var(--cinza-500);
    font-size: 0.8rem;
    text-decoration: none;
    transition: var(--transicao);
}

.footer-links-bottom a:hover {
    color: var(--laranja);
}

/* ==================== BACK TO TOP ==================== */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 48px;
    height: 48px;
    background: var(--azul);
    color: var(--branco);
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    cursor: pointer;
    box-shadow: var(--sombra-lg);
    transition: var(--transicao);
    opacity: 0;
    visibility: hidden;
    z-index: 999;
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    background: var(--laranja);
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(249, 115, 22, 0.4);
}

/* ==================== WHATSAPP FLUTUANTE ==================== */
.whatsapp-float {
    position: fixed;
    bottom: 90px;
    right: 25px;
    display: flex;
    align-items: center;
    gap: 10px;
    background: #25D366;
    color: #ffffff;
    padding: 15px 22px;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 700;
    font-size: 0.9rem;
    box-shadow: 0 8px 25px rgba(37, 211, 102, 0.5);
    z-index: 99998;
    animation: pulseWhatsApp 2s infinite;
    transition: all 0.3s ease;
}

.whatsapp-float:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 15px 40px rgba(37, 211, 102, 0.7);
    color: #ffffff;
}

.whatsapp-float i {
    font-size: 1.5rem;
}

@keyframes pulseWhatsApp {
    0%, 100% { box-shadow: 0 8px 25px rgba(37, 211, 102, 0.5); }
    50% { box-shadow: 0 8px 35px rgba(37, 211, 102, 0.9); }
}

/* =====================================================
   RESPONSIVO
   ===================================================== */

@media (max-width: 1024px) {
    .footer-grid {
        grid-template-columns: 1fr 1fr;
        gap: 30px;
    }
}

/* ==================== MOBILE ==================== */
@media (max-width: 900px) {

    /* --- Header container controlado --- */
    .header .container {
        display: flex !important;
        align-items: center !important;
        justify-content: space-between !important;
        gap: 8px !important;
        padding: 10px 12px !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
        flex-wrap: nowrap !important;
    }

    /* --- Logo encolhível --- */
    .logo {
        flex: 1 1 auto !important;
        min-width: 0 !important;
        overflow: hidden !important;
    }

    .logo-icon {
        width: 36px !important;
        height: 36px !important;
        flex-shrink: 0 !important;
    }

    .logo-text {
        min-width: 0 !important;
        overflow: hidden !important;
    }

    .logo-text strong,
    .logo-text span {
        font-size: 0.85rem !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
    }

    .logo-text small {
        font-size: 0.5rem !important;
        letter-spacing: 1px !important;
    }

    /* --- Actions à direita --- */
    .header-actions {
        display: flex !important;
        align-items: center !important;
        gap: 6px !important;
        flex-shrink: 0 !important;
        margin-left: auto !important;
    }

    /* Esconder botões de desktop no mobile */
    .btn-login-desktop, 
    .btn-registar-desktop,
    .header-actions .btn, 
    .header-actions .btn-outline, 
    .header-actions .btn-primary {
        display: none !important;
    }

    /* --- Hamburger visível --- */
    .menu-toggle {
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        width: 42px !important;
        height: 42px !important;
        min-width: 42px !important;
        flex-shrink: 0 !important;
        background: #1E3A8A !important;
        color: #FFFFFF !important;
        border: none !important;
        border-radius: 10px !important;
        font-size: 1.2rem !important;
        cursor: pointer !important;
        padding: 0 !important;
        margin: 0 !important;
    }

    .menu-toggle i {
        color: #FFFFFF !important;
    }

    /* --- Overlay do menu (fundo escuro) --- */
    body.menu-open {
        overflow: hidden !important;
    }

    body.menu-open::after {
        content: '' !important;
        position: fixed !important;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
        background: rgba(0, 0, 0, 0.6) !important;
        z-index: 99998 !important; /* Atrás do menu branco */
    }

    /* --- Menu Drawer (Painel Branco) --- */
    .nav {
        position: fixed !important;
        top: 0 !important;
        left: -100% !important; /* Escondido por defeito */
        transform: none !important; /* Anula o translateX do desktop */
        width: 85% !important;
        max-width: 320px !important;
        height: 100vh !important;
        background: #ffffff !important;
        z-index: 99999 !important; /* Acima de tudo */
        transition: left 0.35s cubic-bezier(0.4, 0, 0.2, 1) !important;
        padding: 80px 20px 30px !important;
        overflow-y: auto !important;
        display: block !important;
        box-shadow: 5px 0 30px rgba(0, 0, 0, 0.2) !important;
    }

    .nav.active {
        left: 0 !important;
    }

    /* --- Links do Menu Mobile --- */
    .nav-menu {
        flex-direction: column !important;
        gap: 8px !important;
        width: 100% !important;
        list-style: none !important;
        padding: 0 !important;
        margin: 0 !important;
    }

    .nav-menu a {
        display: block !important;
        width: 100% !important;
        padding: 15px !important;
        font-size: 1rem !important;
        font-weight: 600 !important;
        border-radius: 8px !important;
        text-align: left !important;
        color: #1E3A8A !important;
        background: #F1F5F9 !important;
        pointer-events: auto !important;
    }

    .nav-menu a:hover, 
    .nav-menu a.active {
        background: #1E3A8A !important;
        color: #ffffff !important;
    }

    .nav-menu a.active::after {
        display: none !important;
    }

    /* --- Botão Fechar (X) --- */
    .menu-close-btn {
        display: flex !important;
        position: absolute !important;
        top: 15px !important;
        right: 15px !important;
        background: #FEE2E2 !important;
        color: #EF4444 !important;
        border: none !important;
        border-radius: 8px !important;
        width: 40px !important;
        height: 40px !important;
        font-size: 1.2rem !important;
        cursor: pointer !important;
        align-items: center !important;
        justify-content: center !important;
        z-index: 100001 !important;
    }

    /* --- Botões Entrar/Registar dentro do menu mobile --- */
    .menu-mobile-buttons {
        display: flex !important;
        flex-direction: column !important;
        gap: 10px !important;
        margin-top: 20px !important;
        padding-top: 20px !important;
        border-top: 1px solid #E2E8F0 !important;
    }

    .menu-mobile-buttons a {
        text-align: center !important;
        padding: 12px !important;
        border-radius: 8px !important;
        text-decoration: none !important;
        font-weight: 600 !important;
    }

    .menu-mobile-buttons .btn-outline {
        background: #ffffff !important;
        color: #1E3A8A !important;
        border: 2px solid #1E3A8A !important;
    }

    .menu-mobile-buttons .btn-primary {
        background: #1E3A8A !important;
        color: #ffffff !important;
        border: 2px solid #1E3A8A !important;
    }

    /* --- WhatsApp mobile --- */
    .whatsapp-float {
        bottom: 80px !important;
        right: 15px !important;
        padding: 15px !important;
        border-radius: 50% !important;
    }

    .whatsapp-float span {
        display: none !important;
    }
}

@media (max-width: 768px) {
    .user-info {
        display: none;
    }

    .user-btn {
        padding: 4px;
        border-radius: 50%;
    }

    .user-btn i.fa-chevron-down {
        display: none;
    }

    .footer-grid {
        grid-template-columns: 1fr;
        gap: 30px;
        text-align: center;
    }

    .footer-col h4::after {
        left: 50%;
        transform: translateX(-50%);
    }

    .footer-social {
        justify-content: center;
    }

    .footer-bottom {
        flex-direction: column;
        text-align: center;
    }

    .footer-links-bottom {
        justify-content: center;
    }

    .footer-logo {
        justify-content: center;
    }

    .footer-contacts li {
        justify-content: center;
    }

    .back-to-top {
        bottom: 20px;
        right: 20px;
        width: 42px;
        height: 42px;
    }
}

@media (max-width: 480px) {
    .logo-icon {
        width: 38px;
        height: 38px;
    }

    .logo-text strong,
    .logo-text span {
        font-size: 1rem;
    }

    .logo-text small {
        font-size: 0.55rem;
    }
}

@media (max-width: 400px) {
    .logo-text small {
        display: none !important;
    }
}


/* =====================================================
   LAYOUT - Header, Footer, Menu
   ===================================================== */

/* ==================== HEADER ==================== */
.header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background: var(--azul); /* Fundo azul escuro como na imagem 1 */
    /* Se usares fundo branco no header no desktop, remove o var(--azul) acima */
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.08);
    z-index: 1000;
    transition: all 0.3s ease;
}

.header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 30px;
    padding-top: 15px;
    padding-bottom: 15px;
}

/* ==================== LOGO ==================== */
.logo { display: flex; align-items: center; gap: 12px; text-decoration: none; flex-shrink: 0; }
.logo-icon { width: 45px; height: 45px; flex-shrink: 0; }
.logo-text { display: flex; flex-direction: column; line-height: 1.1; font-family: 'Space Grotesk', sans-serif; }
.logo-text strong { font-size: 1.15rem; color: #FFFFFF; font-weight: 700; } /* Letra branca */
.logo-text span { font-size: 1.15rem; color: var(--laranja); font-weight: 700; margin-top: -3px; }
.logo-text small { font-family: 'Inter', sans-serif; font-size: 0.65rem; color: rgba(255,255,255,0.7); font-weight: 600; letter-spacing: 3px; text-transform: uppercase; margin-top: 3px; }

/* ==================== MENU DESKTOP ==================== */
.nav {
    position: fixed;
    top: 15px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    justify-content: center;
    z-index: 1001;
    transition: all 0.3s ease;
}

.header.scrolled ~ .nav { top: 10px; }

.nav-menu {
    display: flex;
    list-style: none;
    gap: 5px;
    margin: 0;
    padding: 0;
}

.nav-menu li { position: relative; }

.nav-menu a {
    display: block;
    padding: 10px 16px;
    font-size: 0.9rem;
    font-weight: 600;
    color: #FFFFFF; /* Letras brancas no desktop */
    text-decoration: none;
    border-radius: var(--raio-full);
    transition: var(--transicao);
}

.nav-menu a:hover,
.nav-menu a.active {
    color: #FFFFFF;
    background: rgba(255, 255, 255, 0.15);
}

.nav-menu a.active::after {
    content: '';
    position: absolute;
    bottom: 4px;
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 3px;
    background: var(--laranja);
    border-radius: var(--raio-full);
}

/* Esconder elementos mobile no desktop */
.menu-close-btn, 
.menu-mobile-buttons {
    display: none !important;
}

/* ==================== HEADER ACTIONS ==================== */
.header-actions { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }

/* Botões Desktop Brancos */
.btn-login-desktop {
    background: transparent;
    border: 2px solid rgba(255, 255, 255, 0.4);
    color: #FFFFFF;
    padding: 10px 20px;
    border-radius: 30px;
    font-weight: 600;
    transition: all 0.3s ease;
}
.btn-login-desktop:hover {
    background: rgba(255,255,255,0.1);
    border-color: #FFFFFF;
}

.btn-registar-desktop {
    background: var(--laranja);
    color: #FFFFFF;
    padding: 10px 20px;
    border-radius: 30px;
    font-weight: 700;
    border: none;
    transition: all 0.3s ease;
}
.btn-registar-desktop:hover {
    background: #ea580c;
}

/* ==================== USER MENU ==================== */
.user-menu { position: relative; }
.user-btn { display: flex; align-items: center; gap: 10px; padding: 6px 12px 6px 6px; background: rgba(255,255,255,0.1); border: 1px solid rgba(255,255,255,0.2); border-radius: var(--raio-full); cursor: pointer; color: #FFF; }
.user-avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--laranja); color: var(--branco); display: flex; align-items: center; justify-content: center; font-weight: 700; }
.user-nome { color: #FFF; }
.user-tipo { color: rgba(255,255,255,0.7); }

/* ... (Mantém os estilos do user-dropdown iguais aos teus originais) ... */
.user-dropdown { position: absolute; top: calc(100% + 10px); right: 0; min-width: 240px; background: var(--branco); border-radius: var(--raio); box-shadow: var(--sombra-xl); border: 1px solid var(--cinza-200); padding: 8px; opacity: 0; visibility: hidden; transform: translateY(-10px); transition: var(--transicao); z-index: 1001; }
.user-dropdown.active { opacity: 1; visibility: visible; transform: translateY(0); }
.user-dropdown a { display: flex; align-items: center; gap: 12px; padding: 11px 14px; font-size: 0.9rem; color: var(--cinza-700); border-radius: var(--raio-sm); text-decoration: none; transition: var(--transicao); }
.user-dropdown a:hover { background: var(--cinza-100); color: var(--azul); }
.user-dropdown a.text-danger { color: var(--erro); }
.user-dropdown a.text-danger:hover { background: rgba(239, 68, 68, 0.1); }


/* =====================================================
   RESPONSIVO / MOBILE
   ===================================================== */

/* =====================================================
   MENU MOBILE - VERSÃO À PROVA DE FALHAS (SERVIDOR)
   ===================================================== */
@media (max-width: 900px) {

    /* 1. Header e Hamburger */
    .menu-toggle {
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        width: 42px !important;
        height: 42px !important;
        background: var(--azul) !important;
        color: #FFFFFF !important;
        border: none !important;
        border-radius: 10px !important;
        font-size: 1.2rem !important;
        z-index: 100002 !important; /* Fica acima de tudo quando o menu abre */
    }

    /* 2. Overlay (Fundo Escuro) */
    body.menu-open {
        overflow: hidden !important;
    }
    body.menu-open::after {
        content: '' !important;
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        width: 100vw !important;
        height: 100vh !important;
        background: rgba(0, 0, 0, 0.6) !important;
        z-index: 99998 !important;
    }

    /* 3. O Painel da Gaveta (Fundo Branco) */
    nav#nav.nav {
        position: fixed !important;
        top: 0 !important;
        left: -100% !important; 
        transform: none !important; 
        width: 85% !important;
        max-width: 320px !important;
        height: 100vh !important;
        background: #ffffff !important; /* Fundo branco puro */
        z-index: 99999 !important; /* Acima do overlay */
        transition: left 0.3s ease !important;
        padding: 80px 20px 30px !important;
        overflow-y: auto !important;
        display: block !important;
        box-shadow: 5px 0 30px rgba(0,0,0,0.2) !important;
        flex-direction: column !important; /* Garante que os links ficam em coluna */
    }
    nav#nav.nav.active {
        left: 0 !important;
    }

    /* 4. A Lista de Links (Em Coluna) */
    nav#nav .nav-menu {
        display: flex !important;
        flex-direction: column !important;
        gap: 8px !important;
        width: 100% !important;
        list-style: none !important;
        padding: 0 !important;
        margin: 0 !important;
    }

    /* 5. Cada Link (Formato Cartão) */
    nav#nav .nav-menu a {
        display: block !important;
        width: 100% !important;
        padding: 15px !important;
        color: var(--azul) !important;
        background: #F8FAFC !important; /* Fundo cinza claro */
        border-radius: 8px !important;
        font-weight: 600 !important;
        text-align: left !important;
        box-sizing: border-box !important;
        pointer-events: auto !important;
    }

    nav#nav .nav-menu a:hover, 
    nav#nav .nav-menu a.active {
        background: var(--azul) !important;
        color: #ffffff !important;
    }

    /* 6. Botão Fechar (X) */
    nav#nav .menu-close-btn {
        display: flex !important;
        position: absolute !important;
        top: 15px !important;
        right: 15px !important;
        background: #FEE2E2 !important;
        color: #EF4444 !important;
        border: none !important;
        border-radius: 8px !important;
        width: 40px !important;
        height: 40px !important;
        font-size: 1.2rem !important;
        cursor: pointer !important;
        align-items: center !important;
        justify-content: center !important;
        z-index: 100001 !important;
    }

    /* 7. Botões Entrar/Registar (Em Coluna no Fundo) */
    nav#nav .menu-mobile-buttons {
        display: flex !important;
        flex-direction: column !important; /* Força ficar um em cima do outro */
        gap: 10px !important;
        margin-top: 20px !important;
        padding-top: 20px !important;
        border-top: 1px solid #E2E8F0 !important;
        width: 100% !important;
    }

    nav#nav .menu-mobile-buttons a {
        display: block !important;
        width: 100% !important;
        text-align: center !important;
        padding: 14px !important;
        border-radius: 8px !important;
        text-decoration: none !important;
        font-weight: 600 !important;
        font-size: 1rem !important;
        box-sizing: border-box !important;
    }

    nav#nav .menu-mobile-buttons .btn-outline {
        background: #ffffff !important;
        color: var(--azul) !important;
        border: 2px solid var(--azul) !important;
    }

    nav#nav .menu-mobile-buttons .btn-primary {
        background: var(--laranja) !important;
        color: #ffffff !important;
        border: 2px solid var(--laranja) !important;
    }
}