/* ============================================
   HEADER PREMIUM MULTI-CAMADAS
   Muricy Consultoria - 2025
   Estrutura: Top Bar | Header Principal | Action Bar
   ============================================ */

/* ============================================
   VARIÁVEIS ESPECÍFICAS DO HEADER
   ============================================ */
:root {
    --header-top-bg: #1a2634;
    --header-main-bg: #ffffff;
    --header-action-bg: #f8fafc;
    --header-border: #e2e8f0;
    --header-text-muted: #64748b;
    --header-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    --header-shadow-lg: 0 8px 30px rgba(0, 0, 0, 0.12);
}

/* ============================================
   CONTAINER DO HEADER
   ============================================ */
.header-container {
    max-width: 1320px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ============================================
   CAMADA 1: TOP BAR
   ============================================ */
.header-top-bar {
    background: var(--header-top-bg);
    padding: 10px 0;
    font-size: 13px;
}

.top-bar-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Contato Esquerda */
.top-bar-contact {
    display: flex;
    align-items: center;
    gap: 24px;
}

.top-bar-item {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #94a3b8;
    text-decoration: none;
    transition: color 0.2s ease;
}

.top-bar-item i {
    color: var(--primary);
    font-size: 12px;
}

.top-bar-item:hover {
    color: #e2e8f0;
}

/* Redes Sociais Direita */
.top-bar-social {
    display: flex;
    align-items: center;
    gap: 16px;
}

.top-bar-social .social-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    color: #94a3b8;
    border-radius: 50%;
    transition: all 0.2s ease;
    font-size: 13px;
}

.top-bar-social .social-link:hover {
    color: var(--white);
    background: var(--primary);
    transform: translateY(-2px);
}

/* ============================================
   CAMADA 2: LINHA DO MEIO (Logo + Menu + Ações)
   ============================================ */
.header-middle-layer {
    background: rgba(255, 255, 255, 0.08);
    padding: 10px 0;
    border-bottom: none;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.header-middle-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 24px;
}

/* Logo */
.header-logo {
    flex-shrink: 0;
}

.header-logo .logo-img {
    max-height: 48px;
    width: auto;
    display: block;
    transition: transform 0.3s ease;
}

.header-logo:hover .logo-img {
    transform: scale(1.02);
}

.header-logo .logo-text {
    font-size: 24px;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.5px;
}

/* Menu Principal Desktop - integrado na linha do meio */
.header-nav-desktop {
    flex: 1;
    display: flex;
    justify-content: center;
}

.header-nav-desktop .nav-menu-premium {
    display: flex;
    list-style: none;
    gap: 2px;
    margin: 0;
    padding: 0;
}

.header-nav-desktop .nav-menu-premium li {
    position: relative;
}

.header-nav-desktop .nav-menu-premium a {
    display: block;
    padding: 10px 18px;
    color: var(--text);
    font-weight: 500;
    font-size: 15px;
    text-decoration: none;
    border-radius: 6px;
    transition: all 0.2s ease;
    position: relative;
}

.header-nav-desktop .nav-menu-premium a::after {
    content: '';
    position: absolute;
    bottom: 6px;
    left: 18px;
    right: 18px;
    height: 2px;
    background: var(--primary);
    transform: scaleX(0);
    transition: transform 0.2s ease;
    border-radius: 1px;
}

.header-nav-desktop .nav-menu-premium a:hover {
    color: var(--primary);
    background: rgba(0, 173, 186, 0.06);
}

.header-nav-desktop .nav-menu-premium a:hover::after {
    transform: scaleX(1);
}

/* Ações do Header (Usuário + CTA) */
.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.nav-menu-premium {
    display: flex;
    list-style: none;
    gap: 4px;
    margin: 0;
    padding: 0;
}

.nav-menu-premium li {
    position: relative;
}

.nav-menu-premium a {
    display: block;
    padding: 10px 24px;
    color: var(--text);
    font-weight: 400;
    font-size: 15px;
    text-decoration: none;
    border-radius: 6px;
    transition: all 0.2s ease;
    position: relative;
}

.nav-menu-premium a::after {
    content: '';
    position: absolute;
    bottom: 6px;
    left: 24px;
    right: 24px;
    height: 1px;
    background: var(--primary);
    transform: scaleX(0);
    transition: transform 0.2s ease;
}

.nav-menu-premium a:hover {
    color: var(--primary);
}

.nav-menu-premium a:hover::after {
    transform: scaleX(1);
}

/* Área do Usuário */
.header-user {
    position: relative;
}

/* Usuário Logado - Toggle (com contraste escuro elegante) */
.user-toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: rgba(0, 0, 0, 0.04);
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    color: var(--text);
    transition: all 0.2s ease;
}

.user-toggle:hover {
    border-color: var(--primary);
    background: rgba(0, 173, 186, 0.06);
}

.user-toggle .user-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    overflow: hidden;
}

.user-toggle .user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.user-toggle i.fa-user-circle {
    font-size: 22px;
    color: var(--header-text-muted);
}

.user-toggle .user-name {
    font-weight: 500;
    max-width: 100px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-toggle i.fa-chevron-down {
    font-size: 11px;
    color: var(--header-text-muted);
    transition: transform 0.2s ease;
}

.user-toggle[aria-expanded="true"] i.fa-chevron-down {
    transform: rotate(180deg);
}

/* Dropdown Premium */
.user-dropdown-premium {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 240px;
    background: var(--white);
    border-radius: 12px;
    box-shadow: var(--header-shadow-lg);
    border: 1px solid var(--header-border);
    z-index: 9999;
    opacity: 0;
    transform: translateY(-10px);
    transition: all 0.2s ease;
    pointer-events: none;
}

.user-dropdown-premium:not([hidden]) {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.user-dropdown-premium::before {
    content: '';
    position: absolute;
    top: -6px;
    right: 24px;
    width: 12px;
    height: 12px;
    background: var(--white);
    border-left: 1px solid var(--header-border);
    border-top: 1px solid var(--header-border);
    transform: rotate(45deg);
}

.user-dropdown-header {
    padding: 16px 20px;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-bottom: 1px solid var(--header-border);
    border-radius: 12px 12px 0 0;
}

.user-full-name {
    font-weight: 600;
    font-size: 14px;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-dropdown-menu {
    list-style: none;
    margin: 0;
    padding: 8px 0;
}

.user-dropdown-menu li {
    margin: 0;
}

.user-dropdown-menu a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    color: var(--text);
    font-size: 14px;
    text-decoration: none;
    transition: all 0.2s ease;
}

.user-dropdown-menu a i {
    color: var(--primary);
    font-size: 14px;
    width: 20px;
    text-align: center;
}

.user-dropdown-menu a:hover {
    background: rgba(0, 173, 186, 0.05);
    color: var(--primary);
}

.user-dropdown-menu .dropdown-divider {
    height: 1px;
    margin: 8px 16px;
    background: var(--header-border);
}

.user-dropdown-menu a.logout {
    color: var(--header-text-muted);
}

.user-dropdown-menu a.logout:hover {
    color: #dc2626;
    background: rgba(220, 38, 38, 0.05);
}

.user-dropdown-menu a.logout i {
    color: var(--header-text-muted);
}

.user-dropdown-menu a.logout:hover i {
    color: #dc2626;
}

/* Usuário Não Logado (com contraste escuro elegante) */
.user-login {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    color: var(--header-text-muted);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    border-radius: 8px;
    border: 1px solid rgba(0, 0, 0, 0.08);
    background: rgba(0, 0, 0, 0.04);
    transition: all 0.2s ease;
}

.user-login:hover {
    color: var(--primary);
    border-color: var(--primary);
    background: rgba(0, 173, 186, 0.06);
}

/* CTA Principal */
.btn-header-cta-main {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: var(--primary);
    color: var(--white);
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    border-radius: 8px;
    border: 1px solid var(--primary);
    transition: all 0.2s ease;
}

.btn-header-cta-main:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
    transform: translateY(-1px);
}

/* ============================================
   SUBMENU DROPDOWN
   ============================================ */

/* Item com submenu */
.nav-menu-premium li.menu-item-has-children {
    position: relative;
}

/* Indicador de dropdown */
.nav-menu-premium li.menu-item-has-children > a::before {
    content: '\f107';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    margin-left: 8px;
    font-size: 12px;
    opacity: 0.7;
    transition: transform 0.2s ease;
}

.nav-menu-premium li.menu-item-has-children:hover > a::before {
    transform: rotate(180deg);
}

/* Submenu container */
.nav-menu-premium .sub-menu {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 220px;
    background: var(--white);
    border-radius: 12px;
    box-shadow: var(--header-shadow-lg);
    border: 1px solid var(--header-border);
    list-style: none;
    margin: 0;
    padding: 8px 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.25s ease;
    z-index: 1000;
}

/* Mostrar submenu no hover */
.nav-menu-premium li:hover > .sub-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Submenu nivel 2+ (direita) */
.nav-menu-premium .sub-menu .sub-menu {
    top: 0;
    left: 100%;
    margin-left: 8px;
}

/* Itens do submenu */
.nav-menu-premium .sub-menu li {
    margin: 0;
}

.nav-menu-premium .sub-menu a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 20px;
    color: var(--text);
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    border-radius: 0;
    transition: all 0.2s ease;
}

.nav-menu-premium .sub-menu a::after {
    display: none;
}

.nav-menu-premium .sub-menu a:hover {
    background: rgba(0, 173, 186, 0.06);
    color: var(--primary);
    padding-left: 24px;
}

/* Seta do submenu */
.nav-menu-premium .sub-menu::before {
    content: '';
    position: absolute;
    top: -6px;
    left: 24px;
    width: 12px;
    height: 12px;
    background: var(--white);
    border-left: 1px solid var(--header-border);
    border-top: 1px solid var(--header-border);
    transform: rotate(45deg);
}

/* Submenu nivel 2 sem seta */
.nav-menu-premium .sub-menu .sub-menu::before {
    display: none;
}

/* Item destaque no submenu */
.nav-menu-premium .sub-menu li.highlight > a {
    color: var(--primary);
    font-weight: 600;
}

/* ============================================
   SUBMENU MOBILE (Accordion style)
   ============================================ */
@media (max-width: 1024px) {
    /* Submenu no mobile - estilo acordeão */
    .mobile-nav .sub-menu {
        display: none;
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        box-shadow: none;
        border: none;
        background: var(--header-action-bg);
        border-radius: 8px;
        margin: 4px 0 4px 16px;
        padding: 4px 0;
        min-width: auto;
    }
    
    .mobile-nav li.menu-item-has-children.open > .sub-menu {
        display: block;
    }
    
    /* Indicador mobile */
    .mobile-nav li.menu-item-has-children > a {
        display: flex;
        justify-content: space-between;
        align-items: center;
    }
    
    .mobile-nav li.menu-item-has-children > a::after {
        content: '\f107';
        font-family: 'Font Awesome 6 Free';
        font-weight: 900;
        font-size: 14px;
        transition: transform 0.2s ease;
        margin-left: auto;
    }
    
    .mobile-nav li.menu-item-has-children.open > a::after {
        transform: rotate(180deg);
    }
    
    /* Estilo dos itens do submenu mobile */
    .mobile-nav .sub-menu a {
        padding: 12px 16px;
        font-size: 15px;
        border-radius: 6px;
    }
    
    .mobile-nav .sub-menu a:hover {
        background: rgba(0, 173, 186, 0.08);
        padding-left: 20px;
    }
}

/* ============================================
   BOTÃO MOBILE (HAMBÚRGUER)
   ============================================ */
.mobile-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 44px;
    height: 44px;
    background: rgba(0, 0, 0, 0.04);
    border: 1px solid rgba(0, 0, 0, 0.08);
    cursor: pointer;
    padding: 8px;
    gap: 5px;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.mobile-toggle:hover {
    background: rgba(0, 173, 186, 0.08);
    border-color: var(--primary);
}

.toggle-line {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--text);
    border-radius: 2px;
    transition: all 0.3s ease;
    transform-origin: center;
}

/* Animação X */
.mobile-toggle[aria-expanded="true"] .toggle-line:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.mobile-toggle[aria-expanded="true"] .toggle-line:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
}

.mobile-toggle[aria-expanded="true"] .toggle-line:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* ============================================
   MENU MOBILE PREMIUM
   ============================================ */
.mobile-menu {
    position: fixed;
    top: 0;
    right: 0;
    width: 60%;
    max-width: 380px;
    height: 100vh;
    background: var(--white);
    box-shadow: -8px 0 30px rgba(0, 0, 0, 0.15);
    z-index: 10000;
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    opacity: 0;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.35s ease;
}

.mobile-menu.is-open {
    transform: translateX(0);
    opacity: 1;
}

.mobile-menu-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid var(--header-border);
    background: var(--header-action-bg);
}

.mobile-menu-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text);
}

.mobile-close {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: var(--header-text-muted);
    font-size: 20px;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.mobile-close:hover {
    background: rgba(0, 0, 0, 0.05);
    color: var(--text);
}

.mobile-menu-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px 0;
}

/* Info rápida mobile */
.mobile-quick-info {
    padding: 0 24px 16px;
    margin-bottom: 16px;
    border-bottom: 1px solid var(--header-border);
}

.quick-info-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: var(--header-action-bg);
    border-radius: 8px;
    color: var(--text);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.quick-info-item i {
    color: var(--primary);
}

.quick-info-item:hover {
    background: rgba(0, 173, 186, 0.1);
    color: var(--primary);
}

/* Navegação Mobile */
.mobile-nav {
    list-style: none;
    margin: 0;
    padding: 0 24px;
}

.mobile-nav li {
    margin: 4px 0;
}

.mobile-nav a {
    display: block;
    padding: 14px 16px;
    color: var(--text);
    text-decoration: none;
    font-size: 16px;
    font-weight: 500;
    border-radius: 10px;
    transition: all 0.2s ease;
}

.mobile-nav a:hover {
    background: rgba(0, 173, 186, 0.08);
    color: var(--primary);
}

/* Footer do Menu Mobile */
.mobile-menu-footer {
    padding: 20px 24px;
    border-top: 1px solid var(--header-border);
    background: var(--header-action-bg);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.btn-mobile-user,
.btn-mobile-cta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 20px;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.25s ease;
}

.btn-mobile-user {
    background: var(--white);
    color: var(--text);
    border: 1px solid var(--header-border);
}

.btn-mobile-user:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: rgba(0, 173, 186, 0.05);
}

.btn-mobile-cta {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: var(--white);
    box-shadow: 0 4px 14px rgba(0, 173, 186, 0.3);
}

.btn-mobile-cta:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(0, 173, 186, 0.4);
}

/* Overlay Mobile */
body.mobile-menu-open::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    opacity: 0;
    animation: fadeIn 0.3s ease forwards;
}

@keyframes fadeIn {
    to { opacity: 1; }
}

/* ============================================
   WHATSAPP FLOAT
   ============================================ */
.whatsapp-float {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 56px;
    height: 56px;
    background: #25d366;
    color: var(--white);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    box-shadow: 0 4px 20px rgba(37, 211, 102, 0.4);
    z-index: 1000;
    transition: all 0.3s ease;
    text-decoration: none;
}

.whatsapp-float:hover {
    transform: scale(1.1) rotate(5deg);
    box-shadow: 0 6px 25px rgba(37, 211, 102, 0.5);
}

/* ============================================
   RESPONSIVIDADE
   ============================================ */

/* Tablet (até 1024px) */
@media (max-width: 1024px) {
    .header-container {
        padding: 0 20px;
    }
    
    /* Esconder menu desktop da linha do meio */
    .header-nav-desktop {
        display: none;
    }
    
    /* Mostrar botão mobile */
    .mobile-toggle {
        display: flex;
    }
    
    /* Ajustar linha do meio */
    .header-middle-content {
        gap: 20px;
    }
    
    /* Esconder nome do usuário */
    .user-toggle .user-name {
        display: none;
    }
    
    /* CTA menor */
    .btn-header-cta-main {
        padding: 10px 20px;
        font-size: 14px;
    }
}

/* Mobile (até 768px) */
@media (max-width: 768px) {
    :root {
        --header-height: 70px;
    }

    /* Esconder a barra de contato no mobile - some junto com o header fixo */
    .header-top-bar {
        display: none;
    }

    /* Login já está disponível dentro do menu mobile (rodapé do drawer);
       some daqui pra não disputar espaço com o botão hamburguer */
    .header-user {
        display: none;
    }

    /* Linha do meio mais compacta */
    .header-middle-layer {
        padding: 10px 0;
    }
    
    .header-logo .logo-img {
        max-height: 42px;
    }
    
    .header-logo .logo-text {
        font-size: 20px;
    }
    
    /* CTA mobile compacto */
    .btn-header-cta-main {
        padding: 10px 16px;
        font-size: 13px;
    }
    
    /* Ajustar dropdown mobile */
    .user-dropdown-premium {
        position: fixed;
        top: auto;
        bottom: 80px;
        left: 16px;
        right: 16px;
        width: auto;
    }
    
    .user-dropdown-premium::before {
        top: auto;
        bottom: -6px;
        right: 24px;
        transform: rotate(225deg);
    }
}

/* Mobile pequeno (até 480px) */
@media (max-width: 480px) {
    .header-container {
        padding: 0 16px;
    }
    
    .header-logo .logo-img {
        max-height: 36px;
    }
    
    .user-toggle {
        padding: 6px 10px;
    }
    
    .user-toggle i.fa-user-circle {
        font-size: 20px;
    }
    
    .btn-header-cta-main {
        padding: 8px 14px;
        font-size: 12px;
    }
    
    .mobile-menu {
        max-width: 100%;
    }
}

/* ============================================
   ANIMAÇÕES E EFEITOS
   ============================================ */
.site-header-premium {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 9999;
    width: 100%;
}

/* Descer o header fixo quando a admin bar do WordPress está visível (logado),
   senão o header fica atrás dela e o conteúdo/hero sobe cedo demais */
body.admin-bar .site-header-premium {
    top: 32px;
}

@media (max-width: 782px) {
    body.admin-bar .site-header-premium {
        top: 46px;
    }
}

/* Remover padding-top do body (pode vir inline de scripts) */
body {
    padding-top: 0 !important;
}

/* Efeito scroll - header ganha fundo ao rolar */
.site-header-premium.scrolled .header-middle-layer {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
}

/* Header sticky combinado no scroll */
@media (min-width: 1025px) {
    .site-header-premium.scrolled {
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
    }
    
    .site-header-premium.scrolled .header-top-bar {
        transform: translateY(-100%);
        height: 0;
        overflow: hidden;
        padding: 0;
        transition: transform 0.3s ease, height 0.3s ease;
    }
    
    .site-header-premium.scrolled .header-middle-layer {
        padding: 14px 0;
        transition: padding 0.3s ease, background 0.3s ease;
    }
}

/* Focus states para acessibilidade */
.mobile-toggle:focus-visible,
.mobile-close:focus-visible,
.user-toggle:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* Overlay do menu mobile */
.mobile-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9998;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.mobile-menu-overlay.active {
    opacity: 1;
    visibility: visible;
}


/* Reduzir motion para quem prefere */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}


/* ============================================
   TELAS DO TUTOR LMS SOB O HEADER FIXO
   ============================================

   O Tutor não passa pelo <main> do tema: o painel do aluno e o catálogo de
   cursos são filhos diretos do <body>, entre o header e o footer. Como o offset
   do header (style.css) só alcança `main`, `.site-content` e `#primary`, essas
   telas começavam encostadas no topo — e o header, sendo `position: fixed`,
   cobria a primeira faixa inteira. No catálogo em produção eram 109px de
   conteúdo escondidos; no painel, todo o cabeçalho de perfil (avatar, nome,
   avaliações, notificações, botão de novo curso).

   Duas marcações precisam ser cobertas porque as versões do plugin diferem entre
   ambientes: 3.9.x envolve tudo em `.tutor-wrap.tutor-wrap-parent`, e 4.x usa
   `.tutor-dashboard-layout` no painel. Manter as duas evita que uma atualização
   do Tutor (ou o deploy para um ambiente com versão diferente) traga o problema
   de volta.

   :has(.site-header-premium) não é enfeite: o Tutor também renderiza tela cheia
   sem o header do tema, e ali qualquer deslocamento abriria um vão. */

body:has(.site-header-premium) .tutor-wrap.tutor-wrap-parent,
body:has(.site-header-premium) .tutor-dashboard-layout {
    padding-top: var(--header-height);
}

/* Aqui é --header-height puro, e não a soma com a admin bar: isto é espaçamento
   de fluxo normal, e a admin bar já desloca o fluxo por conta própria — ela
   aplica `html { margin-top: 32px }`. Somar de novo empurraria 32px a mais. */

/* Dentro de um contêiner que já recebeu o offset do tema, zera o próprio — senão
   o vão sairia dobrado. Testar a ascendência do próprio elemento, e não um
   :has() no body: no body a pergunta viraria "existe ALGUMA tela do Tutor dentro
   de main nesta página", que é outra coisa. */
body:has(.site-header-premium) main .tutor-wrap.tutor-wrap-parent,
body:has(.site-header-premium) .site-content .tutor-wrap.tutor-wrap-parent,
body:has(.site-header-premium) #primary .tutor-wrap.tutor-wrap-parent,
body:has(.site-header-premium) main .tutor-dashboard-layout,
body:has(.site-header-premium) .site-content .tutor-dashboard-layout,
body:has(.site-header-premium) #primary .tutor-dashboard-layout {
    padding-top: 0;
}

/* ── Elementos grudados no topo (só no Tutor 4.x) ──────────

   Lá a barra lateral e o cabeçalho do painel usam `position: sticky; top: 0`,
   medido a partir do topo do viewport. Padding no contêiner não resolve: sticky
   ignora o pai e volta ao topo do viewport assim que a rolagem começa, indo para
   debaixo do header. O remédio é deslocar o próprio `top`.

   Aqui a admin bar SOMA, ao contrário do padding acima: sticky é posicionado
   contra o viewport, onde a admin bar ocupa espaço de verdade.

   Em 3.9.x nada do painel é sticky, então estas regras simplesmente não casam. */

body:has(.site-header-premium) {
    --painel-topo: var(--header-height);
}

body.admin-bar:has(.site-header-premium) {
    --painel-topo: calc(var(--header-height) + 32px);
}

@media (max-width: 782px) {
    body.admin-bar:has(.site-header-premium) {
        --painel-topo: calc(var(--header-height) + 46px);
    }
}

/* Até 600px o WordPress solta a admin bar (position: absolute) e ela rola junto
   com a página, então deixa de ocupar espaço no topo do viewport. */
@media (max-width: 600px) {
    body.admin-bar:has(.site-header-premium) {
        --painel-topo: var(--header-height);
    }
}

body:has(.site-header-premium) .tutor-dashboard-sidebar,
body:has(.site-header-premium) .tutor-dashboard-header,
body:has(.site-header-premium) .tutor-profile-header,
body:has(.site-header-premium) .tutor-account-page-wrapper .tutor-account-header {
    top: var(--painel-topo, var(--header-height));
}

/* A lateral é dimensionada em 100dvh contando do topo do viewport. Descontar o
   header evita que ela passe da dobra e crie um scroll interno. */
body:has(.site-header-premium) .tutor-dashboard-sidebar {
    min-height: calc(100dvh - var(--painel-topo, var(--header-height)));
}
