/* --- VARIÁVEIS --- */
#mapea-site-header {
    --h-merlot: #4F0713;
    --h-rosa: #E499B6;
    --h-gold: #FDC762;
    --h-rubi: #AD0919;
    --h-white: #ffffff;
    --h-topbar-bg: #3b050e; 
    
    /* Alturas para cálculo (Ajuste se precisar) */
    --topbar-height: 40px; 
    --header-height: 90px;
}

/* =========================================
   1. TOP BAR (FIXA NO TOPO INICIAL)
   ========================================= */
.top-bar {
    background-color: var(--h-topbar-bg);
    color: white;
    font-size: 12px;
    padding: 10px 0;
    
    /* FIXAÇÃO */
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1002;
    transition: transform 0.3s ease; /* Animação para sumir */
}

/* Quando rolar, a topbar sobe (some) */
body.scrolled-mode .top-bar {
    transform: translateY(-100%);
}

.top-bar-container {
    max-width: 1200px; margin: 0 auto; padding: 0 20px;
    display: flex; justify-content: space-between; align-items: center;
    height: 20px; /* Altura controlada */
}

.social-links { display: flex; gap: 15px; }
.social-links a { color: rgba(255,255,255,0.7); transition: color 0.3s; font-size: 14px; }
.social-links a:hover { color: var(--h-gold); }

.student-area-link {
    color: white; text-decoration: none; font-weight: 600;
    display: flex; align-items: center; gap: 6px;
    transition: color 0.3s;
}
.student-area-link:hover { color: var(--h-gold); }
.student-area-link i { font-size: 14px; color: var(--h-gold); }

/* =========================================
   2. MAIN HEADER (FIXO ABAIXO DA TOPBAR)
   ========================================= */
.main-header {
    background: white;
    box-shadow: 0 4px 20px rgba(0,0,0,0.05);
    
    /* FIXAÇÃO */
    position: fixed;
    top: 40px; /* Começa abaixo da Topbar */
    left: 0;
    width: 100%;
    z-index: 1001;
    
    /* Transições Modernas */
    transition: top 0.3s ease, padding 0.3s ease, background 0.3s ease, box-shadow 0.3s ease;
    padding: 20px 0; /* Padding Inicial (Grande) */
}

/* --- ESTADO "ROLAGEM" (MODERNO) --- */
body.scrolled-mode .main-header {
    top: 0; /* Cola no teto (cobrindo o espaço da topbar que sumiu) */
    padding: 10px 0; /* Fica mais fininho (Slim) */
    
    /* Efeito Vidro / Moderno */
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: 0 10px 30px rgba(79, 7, 19, 0.1); /* Sombra Merlot suave */
}

.header-container {
    max-width: 1200px; margin: 0 auto; padding: 0 20px;
    display: flex; align-items: center; 
    justify-content: space-between; 
}

/* Logo */
.logo { flex: 0 0 auto; transition: transform 0.3s; }
.logo img { height: 45px; width: auto; display: block; transition: height 0.3s; }

/* Diminui o logo levemente na rolagem */
body.scrolled-mode .logo img { height: 38px; }

/* Navegação Desktop */
.desktop-nav { 
    display: flex; gap: 30px; align-items: center;
    position: absolute; left: 50%; transform: translateX(-50%);
}

.desktop-nav a {
    text-decoration: none; color: var(--h-merlot);
    font-weight: 500; font-size: 15px; position: relative;
    transition: color 0.3s;
}
.desktop-nav a:hover { color: var(--h-rubi); }
.desktop-nav a::after {
    content: ''; position: absolute; bottom: -5px; left: 0; width: 0; height: 2px;
    background: var(--h-gold); transition: width 0.3s;
}
.desktop-nav a:hover::after { width: 100%; }

.header-right { display: flex; align-items: center; gap: 20px; }

.btn-header-cta {
    background: var(--h-merlot); color: white;
    padding: 12px 25px; border-radius: 50px;
    font-weight: 700; font-size: 14px;
    text-decoration: none; display: inline-flex; align-items: center; gap: 8px;
    transition: all 0.3s;
    box-shadow: 0 4px 10px rgba(79, 7, 19, 0.15);
}
.btn-header-cta:hover { background: var(--h-rubi); transform: translateY(-2px); color: white; }

/* Mobile Toggle */
.mobile-toggle { display: none; background: none; border: none; font-size: 24px; color: var(--h-merlot); cursor: pointer; }

/* =========================================
   3. MENU GAVETA (Mobile)
   ========================================= */
.mobile-drawer {
    position: fixed; top: 0; right: -100%; width: 85%; max-width: 300px; height: 100vh;
    background: white; z-index: 10000;
    box-shadow: -10px 0 40px rgba(0,0,0,0.15);
    transition: right 0.3s cubic-bezier(0.77, 0, 0.175, 1);
    padding: 25px; display: flex; flex-direction: column;
}
.mobile-drawer.open { right: 0; }

.drawer-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.5); z-index: 9999;
    opacity: 0; visibility: hidden; transition: all 0.3s;
    backdrop-filter: blur(2px);
}
.drawer-overlay.open { opacity: 1; visibility: visible; }

.drawer-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 30px; border-bottom: 1px solid #f0f0f0; padding-bottom: 15px; }
.drawer-title { font-weight: 800; color: var(--h-merlot); font-size: 18px; }
.close-drawer { background: none; border: none; font-size: 28px; color: #999; cursor: pointer; }

.drawer-nav a { display: block; padding: 12px 0; text-decoration: none; color: #333; font-weight: 500; font-size: 16px; border-bottom: 1px solid #f9f9f9; }
.drawer-cta-mobile {
    margin-top: 30px; text-align: center;
    background: var(--h-merlot); color: white !important;
    padding: 15px !important; border-radius: 12px; font-weight: 700 !important;
    border: none !important; display: block;
}

/* =========================================
   4. RESPONSIVIDADE
   ========================================= */
@media (max-width: 992px) {
    /* No Mobile, a topbar geralmente atrapalha o fixo, então podemos escondê-la ou mantê-la */
    /* Se quiser manter a topbar no mobile, remova o display:none abaixo */
    .top-bar { display: none; } 
    
    .main-header { top: 0 !important; } /* No mobile, header cola no topo direto */
    
    .desktop-nav, .header-right { display: none; }
    .mobile-toggle { display: block; margin-left: 15px; }
    .header-container { padding: 0 15px; }
    .logo img { height: 35px; }

    .mobile-header-cta {
        display: inline-flex;
        background: var(--h-gold);
        color: var(--h-merlot) !important;
        font-size: 12px; font-weight: 800;
        padding: 8px 15px; border-radius: 50px;
        text-decoration: none;
        box-shadow: 0 4px 10px rgba(0,0,0,0.1);
        margin-left: auto;
        border: 1px solid rgba(0,0,0,0.05);
    }
}
@media (min-width: 993px) { .mobile-header-cta { display: none; } }