/* ==========================================================
   ELDER ALVES ADVOCACIA
   HEADER.CSS
   ----------------------------------------------------------
   Header customizado:
   - Topbar
   - Logo
   - Menu desktop
   - Dropdown áreas
   - CTA WhatsApp
   - Menu mobile corrigido
========================================================== */


/* ==========================================================
   HEADER GERAL
========================================================== */

.ea-custom-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 9999;
    color: #ffffff;
    transition:
        background 0.28s ease,
        box-shadow 0.28s ease,
        backdrop-filter 0.28s ease;
}

.ea-custom-header::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(
        180deg,
        rgba(5, 19, 34, 0.96) 0%,
        rgba(5, 19, 34, 0.84) 64%,
        rgba(5, 19, 34, 0.24) 100%
    );
    pointer-events: none;
    transition: opacity 0.28s ease;
}

.ea-custom-header.is-scrolled {
    background: rgba(5, 19, 34, 0.96);
    backdrop-filter: blur(18px);
    box-shadow: 0 14px 44px rgba(0, 0, 0, 0.22);
}

.ea-custom-header.is-scrolled::before {
    opacity: 0;
}


/* ==========================================================
   TOPBAR
========================================================== */

.ea-topbar {
    position: relative;
    z-index: 2;
    height: 34px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.ea-topbar-inner {
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    color: rgba(255, 255, 255, 0.84);
    font-size: 13px;
    font-weight: 600;
}

.ea-topbar span,
.ea-topbar a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none !important;
}

.ea-topbar a {
    color: #ffffff;
    font-weight: 800;
}

.ea-topbar a:hover {
    color: var(--gold);
}


/* ==========================================================
   HEADER PRINCIPAL
========================================================== */

.ea-main-header {
    position: relative;
    z-index: 2;
}

.ea-main-header-inner {
    min-height: 76px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 28px;
}


/* ==========================================================
   LOGO
========================================================== */

.ea-logo {
    width: 205px;
    max-width: 205px;
    flex: 0 0 205px;
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    position: relative;
    z-index: 10001;
    text-decoration: none !important;
}

.ea-logo img {
    display: block;
    width: 100%;
    max-width: 100%;
    height: auto;
    object-fit: contain;
    image-rendering: auto;
    backface-visibility: hidden;
    transform: translateZ(0);
}


/* ==========================================================
   NAV DESKTOP
========================================================== */

.ea-main-nav {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ea-main-nav ul,
.ea-main-nav li {
    margin: 0 !important;
    padding: 0 !important;
    list-style: none !important;
}

.ea-main-nav > ul {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 34px;
}

.ea-main-nav li {
    position: relative;
}

.ea-main-nav a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: rgba(255, 255, 255, 0.94);
    font-size: 15px;
    font-weight: 800;
    line-height: 1;
    text-decoration: none !important;
    transition: color 0.28s ease;
}

.ea-main-nav a:hover,
.ea-main-nav .current-menu-item > a {
    color: var(--gold);
    text-decoration: none !important;
}


/* ==========================================================
   DROPDOWN DESKTOP
========================================================== */

.ea-has-dropdown > a span {
    font-size: 12px;
    line-height: 1;
    transform: translateY(1px);
}

.ea-dropdown {
    position: absolute;
    top: calc(100% + 24px);
    left: 50%;
    width: 310px;
    padding: 12px !important;
    margin: 0 !important;
    background: rgba(5, 19, 34, 0.97);
    border: 1px solid rgba(198, 163, 106, 0.24);
    border-radius: 16px;
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.32);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translate(-50%, 10px);
    transition:
        opacity 0.28s ease,
        visibility 0.28s ease,
        transform 0.28s ease;
}

.ea-dropdown::before {
    content: "";
    position: absolute;
    top: -24px;
    left: 0;
    width: 100%;
    height: 24px;
}

.ea-has-dropdown:hover .ea-dropdown,
.ea-has-dropdown:focus-within .ea-dropdown {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translate(-50%, 0);
}

.ea-dropdown li + li {
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.ea-dropdown a {
    width: 100%;
    display: grid;
    grid-template-columns: 34px 1fr;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: 12px;
    color: rgba(255, 255, 255, 0.92);
    font-size: 14px;
    font-weight: 800;
    line-height: 1.25;
    text-decoration: none !important;
}

.ea-dropdown a:hover {
    background: rgba(255, 255, 255, 0.07);
    color: var(--gold);
    text-decoration: none !important;
}

.ea-dropdown a span:last-child {
    display: grid;
    gap: 2px;
}

.ea-dropdown a small {
    display: block;
    color: rgba(255, 255, 255, 0.62);
    font-size: 11px;
    font-weight: 600;
    line-height: 1.2;
}

.ea-dropdown-icon {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    border: 1px solid rgba(198, 163, 106, 0.38);
    background: rgba(198, 163, 106, 0.08);
    color: var(--gold);
    display: flex;
    align-items: center;
    justify-content: center;
}

.ea-dropdown-icon svg {
    width: 19px;
    height: 19px;
}

.ea-dropdown-icon svg path,
.ea-dropdown-icon svg circle {
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.ea-dropdown a:hover .ea-dropdown-icon {
    background: rgba(198, 163, 106, 0.18);
    border-color: rgba(198, 163, 106, 0.62);
}


/* ==========================================================
   CTA HEADER
========================================================== */

.ea-header-cta {
    flex: 0 0 auto;
    min-height: 48px;
    padding: 0 24px;
    border-radius: 12px;
    background: var(--gold);
    color: #ffffff !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    font-size: 14px;
    font-weight: 900;
    line-height: 1;
    text-decoration: none !important;
    white-space: nowrap;
    box-shadow: 0 14px 34px rgba(198, 163, 106, 0.24);
    transition:
        transform 0.28s ease,
        background 0.28s ease,
        box-shadow 0.28s ease;
}

.ea-header-cta:hover,
.ea-header-cta:focus,
.ea-header-cta:visited {
    color: #ffffff !important;
    text-decoration: none !important;
}

.ea-header-cta:hover {
    transform: translateY(-2px);
    background: var(--gold-hover);
    box-shadow: 0 18px 44px rgba(198, 163, 106, 0.34);
}

.ea-header-cta svg {
    width: 18px;
    height: 18px;
    flex: 0 0 auto;
}


/* ==========================================================
   MENU MOBILE BUTTON
========================================================== */

.ea-menu-toggle {
    display: none;
    width: 46px;
    height: 46px;
    flex: 0 0 46px;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 5px;
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.06);
    position: relative;
    z-index: 10002;
    cursor: pointer;
}

.ea-menu-toggle span {
    width: 20px;
    height: 2px;
    border-radius: 99px;
    background: #ffffff;
    transition:
        transform 0.28s ease,
        opacity 0.28s ease;
}

.ea-menu-toggle.is-active span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.ea-menu-toggle.is-active span:nth-child(2) {
    opacity: 0;
}

.ea-menu-toggle.is-active span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}


/* ==========================================================
   RESPONSIVO TABLET
========================================================== */

@media (max-width: 1120px) {
    .ea-logo {
        width: 190px;
        max-width: 190px;
        flex-basis: 190px;
    }

    .ea-main-nav > ul {
        gap: 24px;
    }

    .ea-header-cta {
        padding-inline: 18px;
    }
}


/* ==========================================================
   MENU MOBILE DEFINITIVO
========================================================== */

@media (max-width: 980px) {
    html,
    body {
        overflow-x: hidden !important;
    }

    body.ea-menu-open {
        overflow: hidden !important;
        touch-action: none;
    }

    body.ea-menu-open::before {
        content: "";
        position: fixed;
        inset: 0;
        background: rgba(5, 19, 34, 0.58);
        backdrop-filter: blur(4px);
        z-index: 9998;
    }

    .ea-menu-toggle {
        display: flex !important;
    }

    .ea-main-header-inner {
        min-height: 72px;
    }

    .ea-header-cta {
        display: none !important;
    }

    .ea-main-nav {
        position: fixed !important;
        top: 0 !important;
        right: 0 !important;
        left: auto !important;
        bottom: auto !important;

        width: min(86vw, 380px) !important;
        max-width: min(86vw, 380px) !important;
        height: 100vh !important;
        max-height: 100vh !important;

        padding: 116px 26px 40px !important;

        background:
            radial-gradient(circle at top right, rgba(198, 163, 106, 0.16), transparent 34%),
            rgba(5, 19, 34, 0.985) !important;

        box-shadow: -24px 0 70px rgba(0, 0, 0, 0.34);
        justify-content: flex-start !important;
        align-items: flex-start !important;

        overflow-y: auto !important;
        overflow-x: hidden !important;

        z-index: 10000 !important;

        transform: translateX(110%) !important;
        translate: none !important;

        opacity: 1 !important;
        visibility: visible !important;

        transition: transform 0.28s ease;
        display: flex !important;
    }

    .ea-main-nav.is-open {
        transform: translateX(0) !important;
    }

    .ea-main-nav > ul {
        width: 100% !important;
        max-width: 100% !important;

        display: flex !important;
        flex-direction: column !important;
        align-items: stretch !important;
        justify-content: flex-start !important;

        gap: 8px !important;

        margin: 0 !important;
        padding: 0 !important;

        overflow: visible !important;
    }

    .ea-main-nav li {
        position: static !important;
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
        overflow: visible !important;
    }

    .ea-main-nav > ul > li > a,
    .ea-main-nav li > a {
        width: 100% !important;
        max-width: 100% !important;

        display: flex !important;
        align-items: center !important;
        justify-content: flex-start !important;

        padding: 14px 0 !important;

        color: #ffffff !important;
        font-size: 16px !important;
        font-weight: 900 !important;
        line-height: 1.2 !important;

        text-decoration: none !important;
        white-space: normal !important;

        transform: none !important;
        translate: none !important;
    }

    .ea-main-nav li > a:hover,
    .ea-main-nav li > a:focus {
        color: var(--gold) !important;
    }

    .ea-has-dropdown,
    .ea-has-dropdown:hover,
    .ea-has-dropdown:focus,
    .ea-has-dropdown:focus-within {
        position: static !important;
        transform: none !important;
        translate: none !important;
    }

    .ea-has-dropdown > a {
        cursor: default !important;
        pointer-events: none !important;
    }

    .ea-has-dropdown > a span {
        display: inline-flex !important;
        margin-left: 4px !important;
        font-size: 11px !important;
        transform: translateY(1px) !important;
    }


    /* ======================================================
       DROPDOWN MOBILE TRAVADO DENTRO DO MENU
    ====================================================== */

    .ea-main-nav.is-open .ea-dropdown,
    .ea-main-nav.is-open .ea-has-dropdown:hover .ea-dropdown,
    .ea-main-nav.is-open .ea-has-dropdown:focus .ea-dropdown,
    .ea-main-nav.is-open .ea-has-dropdown:focus-within .ea-dropdown,
    .ea-dropdown {
        position: static !important;

        inset: auto !important;
        top: auto !important;
        right: auto !important;
        bottom: auto !important;
        left: auto !important;

        transform: none !important;
        translate: none !important;

        opacity: 1 !important;
        visibility: visible !important;
        pointer-events: auto !important;

        width: 100% !important;
        min-width: 0 !important;
        max-width: 100% !important;

        margin: 6px 0 14px !important;
        padding: 8px !important;

        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: 0 !important;

        background: rgba(18, 39, 57, 0.95) !important;
        border: 1px solid rgba(255, 255, 255, 0.12) !important;
        border-radius: 14px !important;
        box-shadow: none !important;

        overflow: hidden !important;
    }

    .ea-dropdown::before {
        display: none !important;
        content: none !important;
    }

    .ea-dropdown li {
        position: relative !important;
        width: 100% !important;
        max-width: 100% !important;
        overflow: hidden !important;
        border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
    }

    .ea-dropdown li:last-child {
        border-bottom: 0 !important;
    }

    .ea-dropdown li + li {
        border-top: 0 !important;
    }

    .ea-dropdown a {
        position: relative !important;

        width: 100% !important;
        max-width: 100% !important;
        min-height: 54px !important;

        display: grid !important;
        grid-template-columns: 34px minmax(0, 1fr) !important;
        align-items: center !important;
        gap: 12px !important;

        padding: 10px !important;
        margin: 0 !important;

        transform: none !important;
        translate: none !important;

        color: rgba(255, 255, 255, 0.94) !important;
        text-decoration: none !important;
        white-space: normal !important;

        overflow: hidden !important;
        border-radius: 10px !important;

        font-size: 14px !important;
        line-height: 1.2 !important;
        font-weight: 900 !important;
    }

    .ea-dropdown a:hover,
    .ea-dropdown a:focus {
        background: rgba(255, 255, 255, 0.06) !important;
        color: var(--gold) !important;
    }

    .ea-dropdown-icon {
        width: 34px !important;
        height: 34px !important;
        min-width: 34px !important;
        max-width: 34px !important;

        border-radius: 10px !important;

        display: grid !important;
        place-items: center !important;

        color: var(--gold) !important;
        border: 1px solid rgba(198, 163, 106, 0.45) !important;
        background: rgba(198, 163, 106, 0.07) !important;
    }

    .ea-dropdown-icon svg {
        width: 18px !important;
        height: 18px !important;
    }

    .ea-dropdown-icon svg path,
    .ea-dropdown-icon svg circle {
        stroke: currentColor !important;
        stroke-width: 1.8 !important;
        stroke-linecap: round !important;
        stroke-linejoin: round !important;
    }

    .ea-dropdown a span:last-child {
        display: block !important;

        min-width: 0 !important;
        max-width: 100% !important;

        color: inherit !important;

        font-size: 14px !important;
        line-height: 1.2 !important;
        font-weight: 900 !important;

        white-space: normal !important;
        overflow: hidden !important;
        text-overflow: initial !important;
    }

    .ea-dropdown small {
        display: block !important;

        margin-top: 3px !important;

        color: rgba(255, 255, 255, 0.62) !important;

        font-size: 11px !important;
        line-height: 1.15 !important;
        font-weight: 500 !important;

        white-space: normal !important;
        overflow: visible !important;
    }
}


/* ==========================================================
   MOBILE PEQUENO
========================================================== */

@media (max-width: 680px) {
    .ea-topbar-inner {
        justify-content: center;
        text-align: center;
        font-size: 12px;
    }

    .ea-topbar-inner a {
        display: none;
    }

    .ea-main-header-inner {
        min-height: 72px;
        gap: 16px;
    }

    .ea-logo {
        width: 178px;
        max-width: 178px;
        flex-basis: 178px;
    }

    .ea-main-nav {
        width: min(88vw, 350px) !important;
        max-width: min(88vw, 350px) !important;
        padding: 104px 24px 36px !important;
    }
}

@media (max-width: 420px) {
    .ea-logo {
        width: 166px;
        max-width: 166px;
        flex-basis: 166px;
    }

    .ea-menu-toggle {
        width: 44px;
        height: 44px;
        flex-basis: 44px;
    }

    .ea-main-nav {
        width: 88vw !important;
        max-width: 88vw !important;
        padding: 98px 22px 34px !important;
    }

    .ea-dropdown a {
        grid-template-columns: 32px minmax(0, 1fr) !important;
        gap: 10px !important;
        font-size: 13px !important;
    }

    .ea-dropdown-icon {
        width: 32px !important;
        height: 32px !important;
        min-width: 32px !important;
        max-width: 32px !important;
    }
}