/* 02-header.css
 * Estilos para o header e navegação
 * Criado por Agência Federal
 * https://agencia.federal.gov.br
 */

/* =========================================================
   HEADER
   ========================================================= */
.af-header2 {
    background: var(--af-black);
    color: var(--af-white);
    border-bottom: 0;
    position: sticky;
    top: 0;
    z-index: 200;
    transition: background .22s ease, box-shadow .22s ease, backdrop-filter .22s ease;
    will-change: background, box-shadow;
}

/* =========================================================
   HEADER — sombra leve no estado normal
   ========================================================= */
.af-header2 {
    box-shadow: 0 4px 14px rgba(0, 0, 0, .28);
}

/* ---------- MOBILE ROW (topo) ---------- */
.af-hdr-mobile {
    display: none;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 0;
}

.af-hdr-mobile-brand {
    flex: 1;
    text-align: center;
}

.af-hdr-brand-link {
    color: var(--af-white);
    text-decoration: none;
    font-weight: 800;
    letter-spacing: .06em;
    text-transform: uppercase;
}

/* ---------- BOTÕES ÍCONE (burger + iconbtn) ---------- */
.af-iconbtn,
.af-burger,
.af-hdr-mobile .af-iconbtn {
    border: 0;
    outline: 0;
    box-shadow: none;
    background: transparent;
    color: var(--af-white);
    cursor: pointer;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    transition: background .2s ease;
}

.af-iconbtn {
    width: 42px;
    height: 42px;
}

.af-burger {
    width: 48px;
    height: 48px;
    font-size: 28px;
    padding: 0;
}

.af-burger:hover,
.af-iconbtn:hover,
.af-hdr-mobile .af-iconbtn:hover {
    background: rgba(255, 255, 255, .06);
}

/* ---------- DESKTOP TOP ROW (LINHA 1) ---------- */
.af-hdr-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 16px 0 8px 0;

    /* ✅ pra colapsar sem “tremida” */
    transition: max-height .18s ease, padding .18s ease, opacity .18s ease, transform .18s ease;
    will-change: max-height, padding, opacity, transform;
}

.af-hdr-brand {
    display: flex;
    align-items: center;
    gap: 14px;
}

.af-hdr-logo .custom-logo {
    max-height: 64px;
    width: auto;
}

.af-hdr-tools {
    display: flex;
    align-items: center;
    gap: 14px;
    flex: 1 1 auto;
    min-width: 0;
}

/* ---------- SOCIAL ---------- */
.af-social {
    display: flex;
    align-items: center;
    gap: 10px;
}

.af-social-a {
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, .14);
    background: rgba(255, 255, 255, .04);

    color: var(--af-white);
    text-decoration: none;
    font-size: 13px;
    box-sizing: border-box;

    transition: border-color .2s ease, color .2s ease, background .2s ease;
}

.af-social-a:hover {
    border-color: rgba(212, 175, 55, .55);
    color: var(--af-gold);
    text-decoration: none;
}

.af-social-a.is-chip {
    font-weight: 900;
    letter-spacing: .06em;
    text-transform: uppercase;
    font-size: 12px;
    line-height: 1;
}

.af-social-a.is-chip span {
    display: inline-block;
    transform: translateY(.5px);
}

/* ---------- SEARCH (linha 1) ---------- */
/* ---------- SEARCH (linha 1) ---------- */
.af-search2 {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1 1 260px;
    /* cresce e encolhe */
    min-width: 0;
    /* impede quebra do layout */
    max-width: 360px;
    /* limite máximo elegante */
}

.af-search2 input {
    flex: 1 1 auto;
    /* ocupa só o que pode */
    min-width: 0;
    /* evita overflow no flex */
    width: 100%;
    /* remove width fixa */
    background: #0d1118;
    border: 1px solid rgba(255, 255, 255, .16);
    color: var(--af-white);
    border-radius: 8px;
    height: 36px;
    padding: 8px 12px;
    box-sizing: border-box;
}

.af-search2 button {
    flex: 0 0 36px;
    /* nunca encolhe */
    width: 36px;
    height: 36px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, .16);
    background: #0d1118;
    color: var(--af-white);
    cursor: pointer;
    box-sizing: border-box;
}

/* =========================================================
   NAV v2 (LINHA 2)
   - Estado 1 (topo): [=][menu] ............ [CTA]
   - Estado 2 (sticky): [logo] ............ [=][menu]
   ========================================================= */
.af-nav2 {
    border-top: 0;
}

.af-nav2-inner {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 0;
    min-height: 56px;
    /* ✅ altura do menu */
    flex-wrap: nowrap;
}

/* ✅ LOGO DO STICKY: no topo fica escondido, no sticky aparece */
.af-nav-logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;

    /* topo: escondido sem estourar layout */
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%) translateX(-200%);
    opacity: 0;
    pointer-events: none;
}

.af-logo-img--nav {
    height: 44px;
    width: auto;
    display: block;
}

/* burger sempre à esquerda da linha 2 */
.af-burger {
    margin: 0;
}

/* menu vem logo após o burger */
.af-nav-menu {
    margin-left: 6px;
    display: flex;
    flex: 1 1 auto;
    /* ✅ ocupa o miolo (pra CTA ir pra direita) */
    min-width: 0;
}

.af-nav-menu ul {
    list-style: none;
    display: flex;
    margin: 0;
    padding: 0;
    align-items: center;

    flex: 1;
    flex-wrap: nowrap;
    white-space: nowrap;
    overflow: visible;
}

/* =========================================================
   ✅ FIX: elimina “zonas mortas” entre itens do menu (gap)
   Em vez de gap, criamos espaço com padding (área hover/clicável)
   ========================================================= */
@media (min-width: 981px) {

    /* remove o buraco entre itens */
    .af-nav-menu ul {
        gap: 0;
    }

    /* cria área “pegável” ao redor de cada item (sem zona morta) */
    .af-nav-menu>ul>li {
        padding: 0 9px;
        /* era gap 18px -> metade pra cada lado */
    }

    /* aumenta o hitbox do link, mantendo visual */
    .af-nav-menu>ul>li>a {
        display: inline-block;
        padding: 10px 0;
        /* mais fácil de pegar com mouse */
    }

}

.af-nav-menu a {
    color: var(--af-white);
    text-decoration: none;
    font-size: 13px;
    letter-spacing: .08em;
    text-transform: uppercase;
    padding: 6px 0;
    line-height: 1.1;
}

.af-nav-menu a:hover {
    color: var(--af-gold);
}

/* CTA sempre na direita na LINHA 2 (estado topo) */
.af-cta2 {
    margin-left: auto;
    font-size: 13px;
    letter-spacing: .08em;
    text-transform: uppercase;

    padding: 6px 10px;
    line-height: 1.1;

    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, .16);
    background: rgba(255, 255, 255, .04);
    color: var(--af-white);
    text-decoration: none;
    white-space: nowrap;

    box-sizing: border-box;
    transition: border-color .2s ease, color .2s ease, background .2s ease,
        opacity .18s ease, transform .18s ease;
}

.af-cta2:hover {
    border-color: rgba(212, 175, 55, .55);
    color: var(--af-gold);
    background: rgba(255, 255, 255, .06);
    text-decoration: none;
}

/* caret desktop */
.af-nav-menu>ul>li.menu-item-has-children>a::after {
    content: " ▾";
    opacity: .75;
    font-size: 11px;
    display: inline-block;
    transition: transform .2s ease;
}

.af-nav-menu>ul>li.is-open>a::after {
    transform: rotate(180deg);
}

/* =========================================================
   SUBMENUS (DESKTOP)
   ========================================================= */
.af-nav-menu>ul>li {
    position: relative;
}

.af-nav-menu ul.sub-menu {
    display: block;
    position: absolute;
    top: calc(100% - 6px);
    left: 0;
    z-index: 50;

    width: 260px;
    max-width: min(360px, calc(100vw - 24px));
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;

    margin: 0;
    padding: 10px;
    list-style: none;

    /* ✅ FUNDO MAIS ESCURO + TRANSPARÊNCIA */
    background: rgba(7, 9, 12, .88);

    /* ✅ EFEITO VIDRO */
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);

    /* ✅ BORDA + ARREDONDADO (como era antes) */
    border: 1px solid rgba(255, 255, 255, .14);
    border-radius: 14px;

    /* ✅ SOMBRA MAIS PROFUNDA */
    box-shadow:
        0 18px 50px rgba(0, 0, 0, .60),
        0 2px 0 rgba(255, 255, 255, .06) inset;

    opacity: 0;
    transform: translateY(10px);
    pointer-events: none;
    visibility: hidden;

    transition: opacity .22s ease, transform .22s ease, visibility .22s ease;
}

.af-nav-menu>ul>li.is-open>ul.sub-menu {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
    visibility: visible;
}

.af-nav-menu ul.sub-menu li {
    position: relative;
}

.af-nav-menu ul.sub-menu a {
    display: block;
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, .08);
    background: rgba(255, 255, 255, .03);
    color: var(--af-white);
    text-decoration: none;
    font-size: 13px;
    letter-spacing: .02em;
    text-transform: none;
    box-sizing: border-box;
    white-space: normal;
    overflow-wrap: anywhere;
}

.af-nav-menu ul.sub-menu a:hover {
    border-color: rgba(212, 175, 55, .55);
    color: var(--af-gold);
}

.af-nav-menu ul.sub-menu ul.sub-menu {
    top: 0;
    left: calc(100% + 10px);
    opacity: 0;
    transform: translateY(6px);
    pointer-events: none;
    visibility: hidden;
}

.af-nav-menu ul.sub-menu li.is-open>ul.sub-menu {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
    visibility: visible;
}

/* =========================================================
   ✅ DIREÇÃO DO FLYOUT POR CLASSE (não por nth-last-child)
   - padrão: abre à direita
   - se precisar: abre à esquerda com .af-open-left
   ========================================================= */
@media (min-width: 981px) {

    /* padrão: flyout (nível 2/3) abre à direita */
    .af-nav-menu ul.sub-menu ul.sub-menu {
        left: calc(100% + 14px);
        right: auto;
    }

    /* quando precisar abrir à esquerda */
    .af-nav-menu ul.sub-menu li.af-open-left>ul.sub-menu {
        left: auto;
        right: calc(100% + 14px);
    }

    /* ============================
     PONTES DE HOVER (duas direções)
     ============================ */

    /* ponte padrão (pra direita) */
    .af-nav-menu ul.sub-menu li.menu-item-has-children::after {
        content: "";
        position: absolute;
        top: 0;
        right: -14px;
        width: 14px;
        height: 100%;
        background: transparent;
    }

    /* quando abre à esquerda: desliga a ponte da direita */
    .af-nav-menu ul.sub-menu li.af-open-left.menu-item-has-children::after {
        content: none;
    }

    /* e cria a ponte do lado esquerdo */
    .af-nav-menu ul.sub-menu li.af-open-left.menu-item-has-children::before {
        content: "";
        position: absolute;
        top: 0;
        left: -14px;
        width: 14px;
        height: 100%;
        background: transparent;
    }
}

/* =========================================================
   DRAWER / OFFCANVAS
   ========================================================= */
.af-drawer {
    position: fixed;
    inset: 0;
    z-index: 9999;
}

/* ✅ evita “flash” quando abre/fecha (com hidden) */
.af-drawer {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;

    transition: opacity .18s ease, visibility 0s linear .18s;
}

.af-drawer.is-open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;

    transition: opacity .18s ease, visibility 0s linear 0s;
}

.af-drawer-backdrop {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;

    /* ✅ IMPORTANTÍSSIMO: não cobre atrás do painel */
    left: min(360px, 88vw);

    /* ✅ mais profundidade (fora do painel) */
    background:
        radial-gradient(1200px 700px at 20% 20%, rgba(0, 0, 0, .35), rgba(0, 0, 0, .80)),
        rgba(0, 0, 0, .60);

    opacity: 0;
    transition: opacity .22s ease;
}

.af-drawer.is-open .af-drawer-backdrop {
    opacity: 1;
}

.af-drawer-panel {
    position: absolute;
    inset: 0 auto 0 0;
    width: min(360px, 88vw);

    /* ✅ igual ao submenu (vidro escuro) */
    background: rgba(7, 9, 12, .88);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);

    /* ✅ borda + profundidade */
    border-right: 1px solid rgba(255, 255, 255, .14);
    box-shadow:
        18px 0 50px rgba(0, 0, 0, .60),
        2px 0 0 rgba(255, 255, 255, .06) inset;

    transform: translateX(-102%);
    transition: transform .25s ease;
    display: flex;
    flex-direction: column;

    opacity: 0;
    transition: transform .25s ease, opacity .25s ease;
}

.af-drawer.is-open .af-drawer-panel {
    opacity: 1;
    transform: translateX(0);
}

.af-drawer-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 14px;
    border-bottom: 1px solid rgba(255, 255, 255, .10);

    /* ✅ dá “cara” de header */
    min-height: 62px;
}

/* ✅ Texto "Menu" (o <strong>Menu</strong>) */
.af-drawer-head strong {
    font-size: 16px;
    font-weight: 900;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--af-white);
}

.af-drawer-search {
    padding: 14px;
    display: flex;
    gap: 10px;

    /* ✅ “barra” de busca mais premium */
    background: rgba(255, 255, 255, .03);
    border-bottom: 1px solid rgba(255, 255, 255, .10);
}

.af-drawer-search input {
    flex: 1;
    background: rgba(13, 17, 24, .72);
    /* era #0d1118 */
    border: 1px solid rgba(255, 255, 255, .14);
    /* era .16 */
    color: var(--af-white);
    border-radius: 12px;
    padding: 10px 12px;
    box-sizing: border-box;
    outline: none;
}

.af-drawer-search input:focus {
    border-color: rgba(212, 175, 55, .55);
    box-shadow: 0 0 0 3px rgba(212, 175, 55, .12);
}

.af-drawer-search button {
    border-radius: 12px;
    padding: 10px 12px;
    border: 1px solid rgba(212, 175, 55, .45);
    background: rgba(212, 175, 55, .12);
    color: var(--af-white);
    cursor: pointer;
    box-sizing: border-box;
}

.af-drawer-social {
    display: flex;
    gap: 10px;
    padding: 12px 14px 12px 14px;

    /* ✅ linha separadora “certinha” acima */
    border-top: 1px solid rgba(255, 255, 255, .10);

    /* ✅ quebra de linha se faltar espaço */
    flex-wrap: wrap;
}

.af-drawer-social .af-social-a {
    background: rgba(255, 255, 255, .03);
    border-color: rgba(255, 255, 255, .12);
}

.af-drawer-social .af-social-a:hover {
    border-color: rgba(212, 175, 55, .55);
    background: rgba(255, 255, 255, .05);
}

.af-drawer-hr {
    border: 0;
    height: 1px;
    background: rgba(255, 255, 255, .10);
    margin: 10px 14px;
}

.af-drawer-nav {
    padding: 0 14px 14px 14px;
    overflow: auto;
}

/* drawer menu estilo FBI */
.af-drawer-nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0;
}

.af-drawer-nav li {
    margin: 0;
    padding: 0;
    border-top: 1px solid rgba(255, 255, 255, .08);
}

.af-drawer-nav>ul>li:first-child {
    border-top: 0;
}

.af-drawer-nav a {
    color: var(--af-white);
    text-decoration: none;
    display: block;
    width: 100%;
    padding: 14px 2px;
    border: 0;
    background: transparent;
    border-radius: 0;
    box-sizing: border-box;
    font-size: 16px;
    font-weight: 650;
    letter-spacing: .01em;
}

.af-drawer-nav a:hover {
    color: var(--af-gold);
    background: transparent;
}

.af-drawer-nav li.menu-item-has-children>a {
    position: relative;
    padding-right: 34px;
}

.af-drawer-nav li.menu-item-has-children>a::after {
    content: "▾";
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    opacity: .75;
    transition: transform .2s ease;
}

.af-drawer-nav li.is-open>a::after {
    transform: translateY(-50%) rotate(180deg);
}

.af-drawer-nav ul.sub-menu {
    display: block;
    overflow: hidden;
    max-height: 0;
    opacity: 0;
    transform: translateY(-4px);
    margin: 0;
    padding: 0 0 0 14px;
    border-left: 0;
    transition: max-height .26s ease, opacity .18s ease, transform .18s ease;
}

.af-drawer-nav li.is-open>ul.sub-menu {
    max-height: 720px;
    opacity: 1;
    transform: translateY(0);
}

.af-drawer-nav ul.sub-menu {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.af-drawer-nav ul.sub-menu li {
    border-top: 1px solid rgba(255, 255, 255, .06);
}

.af-drawer-nav ul.sub-menu a {
    font-size: 14px;
    font-weight: 600;
    padding: 12px 2px;
    opacity: .92;
}

.af-drawer-nav ul.sub-menu ul.sub-menu {
    padding-left: 18px;
}

.af-drawer-foot {
    margin-top: auto;
    padding: 14px;
    border-top: 1px solid rgba(255, 255, 255, .10);
    display: flex;
    align-items: center;
    justify-content: center;
}

.af-drawer-brand {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: rgba(255, 255, 255, .75);
    text-decoration: none;
}

.af-logo-img {
    width: auto;
    display: block;
}

.af-logo-img--drawer {
    height: 42px;
    width: auto;
    display: block;
}

/* =========================================================
   MOBILE REGRAS
   ========================================================= */
@media (max-width:980px) {
    .af-hdr-top {
        display: none;
    }

    .af-hdr-mobile {
        display: flex;
    }

    .af-hdr-mobile .af-iconbtn--menu {
        display: none;
    }

    .af-nav-menu {
        display: none;
    }

    .af-nav2-inner .af-burger {
        display: inline-flex;
    }

    .af-nav2-inner {
        padding: 4px 0;
        min-height: 44px;
    }

    .af-burger {
        width: 46px;
        height: 46px;
        font-size: 26px;
    }

    .af-hdr-mobile .af-iconbtn {
        width: 52px;
        height: 52px;
        border-radius: 10px;
    }

    .af-hdr-mobile-brand {
        flex: 1;
        display: flex;
        justify-content: center;
        align-items: center;
    }

    .af-hdr-brand-link--logo {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        text-decoration: none;
    }

    .af-logo-img--mobile {
        height: 38px;
        width: auto;
        display: block;
    }
}

@media (max-width:768px) {
    .af-logo-img {
        height: 52px;
    }
}

/* =========================================================
   SEARCH MODAL (FULLSCREEN)
   ========================================================= */
.af-searchmodal {
    position: fixed;
    inset: 0;
    z-index: 10000;
}

.af-searchmodal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, .68);
    opacity: 0;
    transition: opacity .25s ease;
}

.af-searchmodal-panel {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    background: #07090c;
    transform: translateY(10px);
    opacity: 0;
    transition: transform .25s ease, opacity .25s ease;
}

.af-searchmodal.is-open .af-searchmodal-backdrop {
    opacity: 1;
}

.af-searchmodal.is-open .af-searchmodal-panel {
    transform: translateY(0);
    opacity: 1;
}

.af-searchmodal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 14px;
    border-bottom: 1px solid rgba(255, 255, 255, .10);
}

.af-searchmodal-form {
    padding: 14px;
    display: flex;
    gap: 10px;
}

.af-searchmodal-form input {
    flex: 1;
    background: #0d1118;
    border: 1px solid rgba(255, 255, 255, .16);
    color: var(--af-white);
    border-radius: 12px;
    padding: 12px 12px;
    outline: none;
    font-size: 16px;
    box-sizing: border-box;
}

.af-searchmodal-form button {
    border-radius: 12px;
    padding: 12px 14px;
    border: 1px solid rgba(212, 175, 55, .45);
    background: rgba(212, 175, 55, .12);
    color: var(--af-white);
    cursor: pointer;
    box-sizing: border-box;
}

.af-searchmodal-form button:hover {
    border-color: rgba(212, 175, 55, .65);
    background: rgba(212, 175, 55, .16);
}

.af-searchmodal-hint {
    padding: 0 14px 14px 14px;
    color: rgba(255, 255, 255, .65);
    font-size: 13px;
}

@media (prefers-reduced-motion: reduce) {

    .af-searchmodal-backdrop,
    .af-searchmodal-panel,
    .af-nav-menu ul.sub-menu,
    .af-drawer-nav ul.sub-menu {
        transition: none !important;
    }
}

/* =========================================================
   SOCIAL ICONS VIA MASK (SVG externo)
   ========================================================= */
.af-social-a--icon {
    position: relative;
    overflow: hidden;
}

.af-social-a--icon::before {
    content: "";
    width: 16px;
    height: 16px;
    display: block;
    background-color: var(--af-white);

    -webkit-mask-repeat: no-repeat;
    -webkit-mask-position: center;
    -webkit-mask-size: contain;

    mask-repeat: no-repeat;
    mask-position: center;
    mask-size: contain;

    transition: background-color .2s ease;
}

.af-social-a--icon:hover::before {
    background-color: var(--af-gold);
}

.af-ico-ig::before {
    -webkit-mask-image: url("../img/ig.svg");
    mask-image: url("../img/ig.svg");
}

.af-ico-yt::before {
    -webkit-mask-image: url("../img/yt.svg");
    mask-image: url("../img/yt.svg");
}

.af-ico-in::before {
    -webkit-mask-image: url("../img/in.svg");
    mask-image: url("../img/in.svg");
}

/* =========================================================
   ✅ STICKY — ESTADO 2
   - some a linha 1 por COMPLETO (sem altura)
   - mostra logo no nav
   - CTA some
   ========================================================= */
.af-header2.is-sticky {
    background: rgba(7, 9, 12, .72);
    backdrop-filter: blur(8px);

    box-shadow:
        0 10px 28px rgba(0, 0, 0, .45),
        0 2px 0 rgba(255, 255, 255, .04) inset;
}

/* colapsa linha 1 (SEM ocupar espaço) */
.af-header2.is-sticky .af-hdr-top {
    max-height: 0;
    padding: 0 !important;
    margin: 0 !important;
    overflow: hidden;
    opacity: 0;
    transform: translateY(-10px);
    pointer-events: none;
}

/* mostra logo do sticky e alinha tudo como: [logo] .... [=][menu] */
.af-header2.is-sticky .af-nav-logo {
    position: static;
    left: auto;
    opacity: 1;
    pointer-events: auto;
}

/* CTA some no sticky */
.af-header2.is-sticky .af-cta2 {
    opacity: 0;
    transform: translateY(-6px);
    pointer-events: none;
}

/* no sticky o menu vai pra direita (e burger fica junto) */
.af-header2.is-sticky .af-nav-menu>ul {
    justify-content: flex-end;
}

/* =========================================================
   PATCH DEFINITIVO — STICKY: [logo] ......... [☰][menu] (À DIREITA)
   ========================================================= */

/* garante que o nav interno tenha largura "cheia" */
.af-header2.is-sticky .af-nav2-inner {
    width: 100%;
}

/* cria o espaçador no sticky (forçado) */
.af-header2.is-sticky .af-nav2-inner::before {
    content: "";
    flex: 1 1 auto !important;
    order: 1 !important;
}

/* garante que burger+menu estejam depois do espaçador */
.af-header2.is-sticky .af-burger {
    order: 2 !important;
    margin-left: 0 !important;
}

.af-header2.is-sticky .af-nav-menu {
    order: 3 !important;
    margin-left: 10px !important;

    /* ✅ isso aqui é o que geralmente “estraga” o alinhamento */
    flex: 0 0 auto !important;
    /* não estica */
    min-width: 0 !important;
}

/* garante que o UL não tente ocupar o meio */
.af-header2.is-sticky .af-nav-menu>ul {
    flex: 0 0 auto !important;
    justify-content: flex-end !important;
}

/* =========================================================
   MOBILE (<=980px)
   Layout final: [ LOGO ] ................. [ ☰ ][ 🔎 ]
   ========================================================= */
@media (max-width: 980px) {

    /* some nav desktop */
    .af-nav2 {
        display: none !important;
    }

    /* linha mobile */
    .af-hdr-mobile {
        display: flex !important;
        align-items: center;
        justify-content: flex-start !important;
        /* controla manualmente */
        gap: 0 !important;
        /* remove qualquer espaçamento automático */
        width: 100%;
    }

    /* LOGO */
    .af-hdr-mobile-brand {
        order: 1 !important;
        flex: 0 0 auto !important;
        display: flex !important;
        align-items: center !important;
        justify-content: flex-start !important;
    }

    .af-logo-img--mobile {
        height: 38px !important;
        width: auto;
        display: block;
    }

    /* SANDUÍCHE */
    .af-hdr-mobile .af-iconbtn--menu {
        order: 2 !important;
        display: inline-flex !important;
        margin-left: auto !important;
        /* empurra tudo para direita */
    }

    /* PESQUISAR */
    .af-hdr-mobile .af-iconbtn--search {
        order: 3 !important;
        display: inline-flex !important;
        margin-left: 4px !important;
        /* controla distância entre ☰ e 🔎 */
    }

    /* TAMANHO DOS BOTÕES */
    .af-hdr-mobile .af-iconbtn {
        width: 56px !important;
        height: 56px !important;
        font-size: 32px !important;
        border-radius: 14px;
        padding: 0 !important;
    }
}

.af-search-svg {
    width: 26px;
    height: 26px;
    display: block;
}

/* como usamos currentColor, controla aqui */
.af-iconbtn--search {
    color: #ffffff;
}

/* hover dourado igual seus outros ícones */
.af-iconbtn--search:hover {
    color: var(--af-gold);
}

.af-iconbtn[data-af-drawer-close] {
    width: 52px;
    /* ✅ botão maior */
    height: 52px;
    border-radius: 14px;

    font-size: 40px;
    /* ✅ X bem maior */
    font-weight: 400;
    line-height: 1;

    /* ✅ destaque sutil */
    background: rgba(255, 255, 255, .04);
    border: 1px solid rgba(255, 255, 255, .10);
}

.af-iconbtn[data-af-drawer-close]:hover {
    background: rgba(255, 255, 255, .06);
    border-color: rgba(212, 175, 55, .45);
    color: var(--af-gold);
}

.af-iconbtn[data-af-search-close] {
    width: 52px;
    /* ✅ botão maior */
    height: 52px;
    border-radius: 14px;

    font-size: 40px;
    /* ✅ X bem maior */
    font-weight: 400;
    line-height: 1;

    /* ✅ destaque sutil */
    background: rgba(255, 255, 255, .04);
    border: 1px solid rgba(255, 255, 255, .10);
}

.af-iconbtn[data-af-search-close]:hover {
    background: rgba(255, 255, 255, .06);
    border-color: rgba(212, 175, 55, .45);
    color: var(--af-gold);
}

/* SEARCH MODAL - evita botão achatar no mobile */
.af-searchmodal-form {
    align-items: center;
}

.af-searchmodal-form input {
    min-width: 0;
    /* importante em flex */
}

.af-searchmodal-form button {
    flex: 0 0 auto;
    /* NÃO deixa encolher */
    width: 48px;
    /* tamanho fixo */
    height: 48px;
    padding: 0;
    /* evita virar “pílula” */
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.af-searchmodal-form button img {
    width: 22px;
    height: 22px;
    display: block;
}

/* =========================================================
   ✅ DESKTOP HOVER SUBMENUS (estilo FBI)
   - abre no hover e no foco (teclado)
   - mantém animação e visual atuais
   ========================================================= */
@media (min-width: 981px) {

    /* abre submenu nível 1 ao passar o mouse ou focar dentro do item */
    .af-nav-menu>ul>li.menu-item-has-children:hover>ul.sub-menu,
    .af-nav-menu>ul>li.menu-item-has-children:focus-within>ul.sub-menu {
        opacity: 1;
        transform: translateY(0);
        pointer-events: auto;
        visibility: visible;
    }

    /* abre submenu nível 2 (submenu dentro do submenu) */
    .af-nav-menu ul.sub-menu li.menu-item-has-children:hover>ul.sub-menu,
    .af-nav-menu ul.sub-menu li.menu-item-has-children:focus-within>ul.sub-menu {
        opacity: 1;
        transform: translateY(0);
        pointer-events: auto;
        visibility: visible;
    }

    /* gira o caret no hover/focus (nível 1) */
    .af-nav-menu>ul>li.menu-item-has-children:hover>a::after,
    .af-nav-menu>ul>li.menu-item-has-children:focus-within>a::after {
        transform: rotate(180deg);
    }
}

@media (min-width: 981px) {

    .af-nav-menu>ul>li.menu-item-has-children {
        position: relative;
    }

    /* cria uma área invisível de proteção */
    .af-nav-menu>ul>li.menu-item-has-children::after {
        content: "";
        position: absolute;
        left: 0;
        right: 0;
        top: 100%;
        height: 12px;
        /* zona de tolerância */
    }

}

/* =========================================================
   ✅ FIX EXTRA: PONTE quando o flyout abre PARA A ESQUERDA
   (resolve o “vão” ao mover o mouse pro submenu esquerdo)
   ========================================================= */
@media (min-width: 981px) {

    /* quando você força abrir à esquerda (seu nth-last-child),
     cria uma ponte invisível do lado ESQUERDO do item */
    .af-nav-menu ul.sub-menu li:nth-last-child(-n+3).menu-item-has-children {
        position: relative;
        /* garantia */
    }

}

/* =========================================================
   SUBMENU – fundo e borda só no hover
   ========================================================= */

/* estado normal: totalmente limpo */
.af-nav-menu ul.sub-menu a {
    background: transparent;
    border: 1px solid transparent;
    /* mantém o tamanho */
}

/* estado hover / focus */
.af-nav-menu ul.sub-menu a:hover,
.af-nav-menu ul.sub-menu a:focus,
.af-nav-menu ul.sub-menu a:focus-visible {
    background: rgba(255, 255, 255, .05);
    border-color: rgba(212, 175, 55, .75);
    color: var(--af-gold);
}

/* =========================================================
   SEARCH ICON BUTTON — PADRÃO IGUAL AOS OUTROS
   ========================================================= */
.af-search-icon {
    width: 36px;
    height: 36px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, .14);
    background: rgba(255, 255, 255, .04);

    cursor: pointer;
    box-sizing: border-box;
}

/* Ícone branco */
.af-search-icon img {
    width: 18px;
    height: 18px;
    display: block;
    filter: brightness(0) invert(1);
}

/* Hover igual aos botões sociais */
.af-search-icon:hover {
    border-color: rgba(212, 175, 55, .55);
}

/* Ícone dourado no hover */
.af-search-icon:hover img {
    filter: brightness(0) saturate(100%) invert(72%) sepia(35%) saturate(586%) hue-rotate(6deg) brightness(92%) contrast(92%);
}

/* =========================================================
   ✅ INDICADOR DE "FLYOUT" (NÍVEL 2/3) — seta para a direita
   ========================================================= */
.af-nav-menu ul.sub-menu li.menu-item-has-children>a::after {
    content: " ▸";
    opacity: .75;
    font-size: 12px;
    float: right;
    transform: translateY(1px);
}

/* quando o flyout estiver aberto (via .is-open do JS) */
.af-nav-menu ul.sub-menu li.is-open>a::after {
    opacity: 1;
}

/* =========================================================
   ✅ GARANTIA: 3º NÍVEL abre ao hover/focus no DESKTOP
   (você já tem regras parecidas; estas reforçam)
   ========================================================= */
@media (min-width: 981px) {

    /* nível 2 e 3 (qualquer submenu dentro de submenu) */
    .af-nav-menu ul.sub-menu li.menu-item-has-children:hover>ul.sub-menu,
    .af-nav-menu ul.sub-menu li.menu-item-has-children:focus-within>ul.sub-menu {
        opacity: 1;
        transform: translateY(0);
        pointer-events: auto;
        visibility: visible;
    }
}

/* =========================================================
   ✅ DRAWER: evita cortar quando tem 3 níveis e muitos itens
   ========================================================= */
.af-drawer-nav li.is-open>ul.sub-menu {
    max-height: 1400px;
    /* antes 720px — aumenta pra não truncar */
}

/* =========================================================
   ✅ FIX: "PONTE" DE HOVER ENTRE SUBMENU -> SUBSUBMENU
   Evita o mouse “escapar” e fechar
   ========================================================= */
@media (min-width: 981px) {

    /* garante referência pros pseudos */
    .af-nav-menu ul.sub-menu li.menu-item-has-children {
        position: relative;
    }

    /* 1) cria uma ponte invisível à direita do item do submenu
        (preenche o vão entre o item e o flyout) */
    .af-nav-menu ul.sub-menu li.menu-item-has-children::after {
        content: "";
        position: absolute;
        top: 0;
        right: -14px;
        /* “puxa” pra dentro do vão */
        width: 14px;
        /* largura da ponte */
        height: 100%;
        background: transparent;
    }

    /* 2) aumenta um pouco a distância do flyout, mas mantendo a ponte */
    .af-nav-menu ul.sub-menu ul.sub-menu {
        left: calc(100% + 14px);
        /* antes: +10px */
    }
}

/* =========================================================
   ✅ MENU ATIVO COMPLETO (DESKTOP + SUBMENU + DRAWER)
   - Mantém menu pai dourado quando filho está ativo
   - Destaca submenu ativo
   - Mantém consistência no mobile/drawer
   ========================================================= */

/* ================================
   DESKTOP — NÍVEL 1 (menu principal)
   ================================ */
.af-nav-menu>ul>li.current-menu-item>a,
.af-nav-menu>ul>li.current-menu-parent>a,
.af-nav-menu>ul>li.current-menu-ancestor>a,
.af-nav-menu>ul>li.current_page_parent>a,
.af-nav-menu>ul>li.current_page_ancestor>a {
    color: var(--af-gold);
}

/* caret dourado quando ativo */
.af-nav-menu>ul>li.current-menu-parent>a::after,
.af-nav-menu>ul>li.current-menu-ancestor>a::after {
    color: var(--af-gold);
}


/* ================================
   DESKTOP — SUBMENUS (nível 2 e 3)
   ================================ */
.af-nav-menu ul.sub-menu li.current-menu-item>a,
.af-nav-menu ul.sub-menu li.current-menu-parent>a,
.af-nav-menu ul.sub-menu li.current-menu-ancestor>a {
    color: var(--af-gold);
}


/* ================================
   DRAWER (mobile)
   ================================ */
.af-drawer-nav li.current-menu-item>a,
.af-drawer-nav li.current-menu-parent>a,
.af-drawer-nav li.current-menu-ancestor>a {
    color: var(--af-gold);
}

/* no sticky você já põe position: static; aqui só garantimos o reset */
.af-header2.is-sticky .af-nav-logo {
    position: static;
    left: auto;
    transform: none;
    opacity: 1;
    pointer-events: auto;
}

/* 2) ✅ Submenu nunca pode ultrapassar a viewport */
@media (min-width: 981px) {

    /* nível 1 */
    .af-nav-menu>ul>li>ul.sub-menu {
        max-width: min(360px, calc(100vw - 24px));
        /* se tiver texto grande/URL, evita estourar */
        overflow-wrap: anywhere;
    }

    /* nível 2/3 (flyout) */
    .af-nav-menu ul.sub-menu ul.sub-menu {
        max-width: min(360px, calc(100vw - 24px));
        overflow-wrap: anywhere;
    }

    /* 3) ✅ Quando o item está perto da direita, alinha submenu pelo lado direito */
    .af-nav-menu>ul>li:nth-last-child(-n+2)>ul.sub-menu {
        left: auto;
        right: 0;
    }
}

/* =========================================================
   FIX DEFINITIVO — OVERFLOW SÓ NO STICKY (DESKTOP)
   (não estoura + submenus continuam abrindo)
   ========================================================= */
@media (min-width: 981px) {

    /* o sticky não pode gerar scroll horizontal */
    .af-header2.is-sticky,
    .af-header2.is-sticky .af-nav2,
    .af-header2.is-sticky .af-nav2-inner {
        overflow-x: clip;
        overflow-y: visible;
    }

    /* trava o menu no sticky: ele NÃO pode esticar além do espaço */
    .af-header2.is-sticky .af-nav-menu {
        flex: 0 1 auto !important;
        /* pode encolher */
        min-width: 0 !important;
        max-width: 100% !important;
    }

    /* o UL do menu no sticky tem que poder encolher */
    .af-header2.is-sticky .af-nav-menu>ul {
        flex: 0 1 auto !important;
        min-width: 0 !important;
        max-width: 100% !important;

        /* ✅ NÃO cortar aqui, senão mata o submenu (absolute) */
        overflow: visible !important;
    }

    /* ✅ se algum item for gigante, o corte horizontal fica NO CASCO do nav,
        e não no UL (pra não quebrar submenu) */
    .af-header2.is-sticky .af-nav2-inner {
        overflow-x: clip;
    }

    /* IMPORTANTÍSSIMO: submenu NÃO herda nowrap no sticky */
    .af-header2.is-sticky .af-nav-menu ul.sub-menu,
    .af-header2.is-sticky .af-nav-menu ul.sub-menu a {
        white-space: normal !important;
        overflow-wrap: anywhere !important;
        word-break: break-word !important;
    }

    /* garantia extra: li não pode cortar submenu */
    .af-header2.is-sticky .af-nav-menu>ul>li {
        overflow: visible;
    }
}