/* Mantem nas paginas internas o mesmo respiro superior da home. */
body:not(.home):not(.ef-form-page-body) {
    --ef-global-header-frame-gap: 20px !important;
    --ef-title-header-gap: clamp(44px, 3.2vw, 56px) !important;
}

body:not(.home):not(.ef-form-page-body) main > section:first-of-type {
    margin-top: 20px !important;
}

/* Aplica a mesma moldura a paginas Leia sobre, cujo conteudo usa um article interno. */
body.single-leia_sobre > main.leia-post,
body.single-leia_sobre > .ef-home-section,
body.single-leia_sobre > .ef-home-footer {
    width: var(--ef-site-section-width) !important;
    margin-left: auto !important;
    margin-right: auto !important;
    overflow: hidden !important;
}

body.single-leia_sobre > main.leia-post {
    margin-top: var(--ef-global-header-frame-gap, 20px) !important;
    border-radius: var(--ef-site-section-radius) var(--ef-site-section-radius) 0 0 !important;
}

body.single-leia_sobre > main.leia-post .leia-post__hero-container {
    padding-top: var(--ef-title-header-gap, clamp(44px, 3.2vw, 56px)) !important;
}

/* Mantem os titulos das paginas internas afastados do cabecalho. */
body:not(.home):not(.ef-form-page-body) main > section.ef-reference-intro .ef-home-shell {
    padding-top: var(--ef-title-header-gap, clamp(44px, 3.2vw, 56px)) !important;
}

/* No celular, deixa a logo a esquerda e o menu de tres pontos a direita. */
@media (max-width: 992px) {
    html,
    body {
        width: 100% !important;
        min-width: 0 !important;
        overflow-x: hidden !important;
    }

    .ef-header {
        width: 100% !important;
        padding: 8px 0 !important;
        background: #000 !important;
        border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
    }

    .ef-header__container {
        width: 100% !important;
        max-width: none !important;
        min-width: 0 !important;
        display: flex !important;
        align-items: center !important;
        justify-content: space-between !important;
        gap: 0 !important;
        padding-left: 20px !important;
        padding-right: 20px !important;
    }

    .ef-header__nav,
    .ef-header__socials,
    .ef-header__member-link,
    .ef-header__compact,
    .ef-header__cta,
    .block-header__button {
        display: none !important;
    }

    .ef-header__menu {
        display: none !important;
    }

    .ef-header__logo {
        margin-right: auto !important;
    }

    .ef-header__hamburger,
    .burger,
    .block-header__hamburger-menu {
        position: static !important;
        display: flex !important;
        flex: 0 0 44px !important;
        width: 44px !important;
        height: 44px !important;
        margin: 0 0 0 auto !important;
        padding: 0 !important;
        align-items: center !important;
        justify-content: center !important;
        flex-direction: column !important;
        gap: 5px !important;
    }

    .ef-header__hamburger span,
    .burger span,
    .block-header__hamburger-menu span {
        width: 5px !important;
        height: 5px !important;
        min-width: 5px !important;
        min-height: 5px !important;
        border-radius: 50% !important;
        background: #fff !important;
        transform: none !important;
        opacity: 1 !important;
    }
}

/* No celular, elimina faixas laterais claras nas molduras das paginas. */
@media (max-width: 767px) {
    html,
    body,
    body:not(.home):not(.ef-form-page-body) {
        background: #000 !important;
    }

    body:not(.home):not(.ef-form-page-body) main,
    body.home > main.ef-home,
    body.home .ef-home,
    body.single-leia_sobre > main.leia-post,
    body.single-leia_sobre > .ef-home-section,
    body.single-leia_sobre > .ef-home-footer {
        width: 100% !important;
        max-width: none !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        background-color: #000 !important;
        border-radius: 0 !important;
    }

    body:not(.home):not(.ef-form-page-body) main > section,
    body.home > main.ef-home > section,
    body.home .ef-home > section,
    body:not(.home):not(.ef-form-page-body) main > .ef-home-section,
    body:not(.home):not(.ef-form-page-body) main > .ef-home-faq,
    body:not(.home):not(.ef-form-page-body) main > .ef-home-footer {
        width: 100% !important;
        max-width: none !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        border-radius: 0 !important;
    }

    /* Reduz o respiro entre o cabecalho e o primeiro titulo no celular. */
    body:not(.home):not(.ef-form-page-body) {
        --ef-title-header-gap: 24px !important;
    }

    body:not(.home):not(.ef-form-page-body) main > section.ef-reference-intro {
        padding-top: 32px !important;
    }

    body:not(.home):not(.ef-form-page-body) main > section.ef-reference-intro .ef-home-shell {
        padding-top: 24px !important;
    }

    body.single-leia_sobre > main.leia-post .leia-post__hero {
        padding-top: 20px !important;
    }

    body.single-leia_sobre > main.leia-post .leia-post__hero-container {
        padding-top: 24px !important;
    }

    /* Usa 16px de margem lateral em todos os contenedores de secao no mobile.
     * Este bloco vem depois dos CSS dos componentes para eliminar limites
     * antigos de 328px e manter o aproveitamento de tela uniforme. */
    body .ef-home-shell,
    body .hero-empresafora__container {
        width: calc(100% - 32px) !important;
        max-width: none !important;
        margin-left: auto !important;
        margin-right: auto !important;
        box-sizing: border-box !important;
    }

    body .ef-home-hero .ef-home-stats--hero .ef-home-shell {
        width: 100% !important;
        max-width: none !important;
    }

    /* Padroniza o alinhamento de todo texto no celular. */
    body,
    body main *,
    body .ef-home-section *,
    body .ef-home-footer *,
    body .ef-mobile-menu * {
        text-align: left !important;
    }

    /* O H1 principal da home permanece centralizado. */
    body.home main .hero-empresafora__title,
    body.home main .hero-empresafora__title * {
        text-align: center !important;
    }

    /* Cards de oferta sem linhas laterais, inferiores ou sombras no celular. */
    body main.ef-reference-page.ef-caribe-eua-dubai-page .ef-offer-plan,
    body main.ef-reference-page.ef-documentos-residencia-page .ef-offer-plan,
    body main.ef-reference-page.ef-offer-page .ef-offer-plan,
    body main.ef-reference-page.ef-caribe-eua-dubai-page .ef-offer-plan.is-featured,
    body main.ef-reference-page.ef-documentos-residencia-page .ef-offer-plan.is-featured,
    body main.ef-reference-page.ef-offer-page .ef-offer-plan.is-featured {
        border: 0 !important;
        background: #000 !important;
        background-image: none !important;
        box-shadow: none !important;
    }

    body main.ef-reference-page.ef-caribe-eua-dubai-page .ef-offer-plan__body,
    body main.ef-reference-page.ef-documentos-residencia-page .ef-offer-plan__body,
    body main.ef-reference-page.ef-offer-page .ef-offer-plan__body,
    body main.ef-reference-page.ef-caribe-eua-dubai-page .ef-offer-plan__list,
    body main.ef-reference-page.ef-documentos-residencia-page .ef-offer-plan__list,
    body main.ef-reference-page.ef-offer-page .ef-offer-plan__list,
    body main.ef-reference-page.ef-caribe-eua-dubai-page .ef-offer-plan__list li,
    body main.ef-reference-page.ef-documentos-residencia-page .ef-offer-plan__list li,
    body main.ef-reference-page.ef-offer-page .ef-offer-plan__list li {
        border: 0 !important;
        box-shadow: none !important;
    }

    /* Centraliza os CTAs dentro de cada card e preserva o texto centralizado. */
    body main.ef-reference-page.ef-caribe-eua-dubai-page .ef-offer-plan__actions,
    body main.ef-reference-page.ef-documentos-residencia-page .ef-offer-plan__actions,
    body main.ef-reference-page.ef-offer-page .ef-offer-plan__actions {
        width: 100% !important;
        align-items: center !important;
        justify-items: center !important;
    }

    body main.ef-reference-page.ef-caribe-eua-dubai-page .ef-offer-plan__actions > .ef-btn,
    body main.ef-reference-page.ef-documentos-residencia-page .ef-offer-plan__actions > .ef-btn,
    body main.ef-reference-page.ef-offer-page .ef-offer-plan__actions > .ef-btn,
    body main.ef-reference-page.ef-caribe-eua-dubai-page .ef-offer-plan__footer-note,
    body main.ef-reference-page.ef-documentos-residencia-page .ef-offer-plan__footer-note,
    body main.ef-reference-page.ef-offer-page .ef-offer-plan__footer-note {
        width: 100% !important;
        margin-left: auto !important;
        margin-right: auto !important;
        text-align: center !important;
    }

    /* Cards de jurisdicao: remove linhas e centraliza os CTAs no celular. */
    body .ef-reference-rows .ef-reference-row {
        border: 0 !important;
        background: #000 !important;
        background-image: none !important;
        box-shadow: none !important;
    }

    body .ef-reference-rows .ef-reference-row__visual,
    body .ef-reference-rows .ef-reference-row__details {
        border: 0 !important;
        border-radius: 0 !important;
        background: #000 !important;
        background-image: none !important;
        box-shadow: none !important;
    }

    body .ef-reference-rows .ef-reference-row__list,
    body .ef-reference-rows .ef-reference-row__list li,
    body .ef-reference-rows .ef-reference-row__content_mobile,
    body .ef-reference-rows .ef-reference-row__actions_mobile {
        border: 0 !important;
        box-shadow: none !important;
        background: #000 !important;
        background-image: none !important;
    }

    body .ef-reference-rows .ef-reference-row__list li {
        border-bottom: 1px solid rgba(255, 255, 255, 0.10) !important;
    }

    body .ef-reference-rows .ef-reference-row__list li:last-child {
        border-bottom: 0 !important;
    }

    body .ef-reference-rows .ef-reference-row__content_mobile,
    body .ef-reference-rows .ef-reference-row__actions_mobile {
        display: flex !important;
        width: 100% !important;
        align-items: center !important;
        justify-content: center !important;
        margin-left: auto !important;
        margin-right: auto !important;
    }

    body .ef-reference-rows .ef-reference-row__actions_mobile {
        flex-direction: column !important;
        gap: 12px !important;
    }

    body .ef-reference-rows .ef-reference-row__actions_mobile > .ef-btn {
        width: min(320px, calc(100vw - 64px)) !important;
        max-width: 320px !important;
        margin-left: auto !important;
        margin-right: auto !important;
        align-self: center !important;
        text-align: center !important;
    }
}

body.single-leia_sobre > main.leia-post + .ef-home-stats {
    margin-top: var(--ef-site-section-gap) !important;
    border-radius: var(--ef-site-section-radius) var(--ef-site-section-radius) 0 0 !important;
}

body.single-leia_sobre > .ef-home-faq,
body.single-leia_sobre > .ef-home-footer {
    margin-top: 0 !important;
    border-radius: 0 !important;
}

body.single-leia_sobre > .ef-home-footer {
    margin-bottom: var(--ef-site-section-gap) !important;
    border-bottom-left-radius: var(--ef-site-section-radius) !important;
    border-bottom-right-radius: var(--ef-site-section-radius) !important;
}
