/* w56 global header - matches w56.com.br */

body.w56-site {
    --w56-header-height: 70px;
}

body.w56-site #wrapper,
body.w56-site .page-wrapper {
    background-color: #141416;
}

/* Fixed header on desktop — stays at top while scrolling */
@media (min-width: 850px) {
    body.w56-site #header,
    body.w56-site .header-wrapper {
        position: fixed !important;
        top: 0;
        left: 0;
        right: 0;
        width: 100%;
        z-index: 1000;
        background: rgba(20, 20, 22, 0.95) !important;
        border-bottom: 1px solid #f0c159;
    }

    body.w56-site.admin-bar #header,
    body.w56-site.admin-bar .header-wrapper {
        top: 32px;
    }

    body.w56-site #wrapper {
        padding-top: var(--w56-header-height);
    }
}

body.w56-site #header {
    z-index: 1000;
    background: rgba(20, 20, 22, 0.95) !important;
    border-bottom: 1px solid #f0c159;
}

body.w56-site .header-wrapper {
    background: rgba(20, 20, 22, 0.95) !important;
}

body.w56-site .header-main {
    background: transparent !important;
}

/* Keep header content in a centered 1200px column like the original .container */
body.w56-site .header-main .header-inner.flex-row.container {
    align-items: center;
    min-height: var(--w56-header-height);
    max-width: 1200px !important;
    width: 100%;
    margin-left: auto !important;
    margin-right: auto !important;
    padding: 15px 20px;
}

body.w56-site #logo {
    flex: 0 0 auto;
    margin: 0;
    position: relative;
    z-index: 2;
}

body.w56-site #logo img {
    width: 50px !important;
    height: 50px !important;
    border-radius: 50%;
    object-fit: cover;
    box-shadow: 0 0 0 3px rgba(240, 193, 89, 0.35);
    display: block;
}

body.w56-site .header-main .header-nav.nav > li > a {
    line-height: 1.2 !important;
    min-height: 0 !important;
}

/* Desktop: grid layout — logo | nav | buttons with fixed gaps */
@media (min-width: 850px) {
    body.w56-site .header-main .header-inner.flex-row.container {
        display: grid !important;
        grid-template-columns: auto minmax(0, 1fr) auto;
        column-gap: 20px;
        align-items: center;
        justify-content: stretch;
    }

    body.w56-site .header-main .header-inner > .flex-col.flex-left.flex-grow {
        grid-column: 2;
        flex: none !important;
        flex-grow: 0 !important;
        display: flex;
        justify-content: center;
        align-items: center;
        min-width: 0;
        width: 100%;
        padding: 0 8px 0 0;
        margin: 0;
        overflow: visible;
    }

    body.w56-site .header-main .header-inner > .flex-col.flex-right.hide-for-medium {
        grid-column: 3;
        flex: none !important;
        display: flex;
        justify-content: flex-end;
        align-items: center;
        margin: 0 0 0 12px;
        padding-left: 0;
        position: relative;
        z-index: 5;
        flex-shrink: 0;
    }

    body.w56-site #logo {
        grid-column: 1;
    }

    body.w56-site .header-nav-main.nav-left {
        justify-content: center;
        max-width: 100%;
        width: 100%;
        flex-wrap: nowrap !important;
        gap: 8px;
        font-size: 0.85em !important;
    }

    body.w56-site .header-nav-main.nav-left > li > a,
    body.w56-site .header-main .header-nav.nav > li > a {
        font-size: 0.85em !important;
        padding: 6px 10px !important;
        letter-spacing: 0.01em;
        line-height: 1.2 !important;
    }

    body.w56-site .header-nav-main.nav-right {
        flex-shrink: 0;
        white-space: nowrap;
    }

    body.w56-site .header-button-1 .button,
    body.w56-site .header-button-2 .button {
        padding: 9px 16px !important;
        font-size: 0.85em !important;
    }
}

body.w56-site .header-nav-main.nav-left {
    flex: 0 0 auto;
    justify-content: flex-start;
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 8px;
    margin: 0;
    width: auto;
}

body.w56-site .header-nav-main.nav-left > li {
    margin: 0;
    flex-shrink: 0;
}

body.w56-site .header-nav-main.nav-left > li > a {
    color: #fff !important;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.01em;
    border-radius: 6px;
    white-space: nowrap;
    transition: all 0.3s;
    line-height: 1.2 !important;
}

body.w56-site .header-nav-main.nav-left > li > a:hover,
body.w56-site .header-nav-main.nav-left > li.current-menu-item > a,
body.w56-site .header-nav-main.nav-left > li.current_page_item > a {
    color: #f0c159 !important;
    background: rgba(240, 193, 89, 0.2);
}

body.w56-site .header-nav-main.nav-right {
    display: flex;
    gap: 15px;
    flex-shrink: 0;
    align-items: center;
}

body.w56-site .header-button-1 .button,
body.w56-site .header-button-2 .button {
    min-height: auto !important;
    padding: 12px 24px !important;
    font-size: 0.85em !important;
    font-weight: 700 !important;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    border-radius: 25px !important;
    line-height: 1.2 !important;
}

body.w56-site .header-button-1 .button {
    background: linear-gradient(135deg, #f0c159, #ff6900) !important;
    border: none !important;
    color: #fff !important;
}

body.w56-site .header-button-2 .button {
    background: #00d084 !important;
    border: none !important;
    color: #fff !important;
}

body.w56-site .header-button-1 .button:hover,
body.w56-site .header-button-2 .button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(240, 193, 89, 0.4);
}

body.w56-site #wide-nav {
    display: none !important;
}

body.w56-site .page-title-inner,
body.w56-site .page-header {
    display: none;
}

/* Mobile header bar: ☰ | Logo | LOGIN CADASTRO (matches original order) */
@media (max-width: 849px) {
    html,
    body.w56-site {
        overscroll-behavior-y: none;
    }

    body.w56-site {
        --w56-header-height: 48px;
    }

    body.w56-site #header,
    body.w56-site .header-wrapper,
    body.w56-site #masthead.header-main,
    body.w56-site .header-main {
        height: auto !important;
        min-height: 0 !important;
    }

    body.w56-site .header-bottom,
    body.w56-site .header-bg-container,
    body.w56-site .header-divider,
    body.w56-site .top-divider {
        display: none !important;
        height: 0 !important;
        min-height: 0 !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    body.w56-site .header-main .header-nav,
    body.w56-site .header-main .mobile-nav,
    body.w56-site .header-main .header-button {
        margin: 0 !important;
    }

    body.w56-site .header-main .nav > li,
    body.w56-site .header-main .mobile-nav > li {
        margin: 0 !important;
    }

    body.w56-site .header-main .nav > li > a,
    body.w56-site .header-main .header-button > .button {
        line-height: 1.15 !important;
        margin: 0 !important;
    }

    body.w56-site .header-main .flex-col {
        padding-top: 0 !important;
        padding-bottom: 0 !important;
    }

    body.w56-site #logo {
        width: auto !important;
        max-width: none !important;
        line-height: 0;
    }

    body.w56-site #wrapper {
        padding-top: 0 !important;
    }

    /* Sticky (not fixed) avoids iOS pull-down gap above the menu bar */
    body.w56-site #header {
        position: sticky !important;
        top: 0;
        left: auto;
        right: auto;
        width: 100%;
    }

    body.w56-site .header-wrapper {
        position: relative !important;
        top: auto;
        left: auto;
        right: auto;
    }

    body.w56-site.admin-bar #header {
        top: 46px;
    }

    body.w56-site #header::before {
        content: '';
        position: absolute;
        left: 0;
        right: 0;
        bottom: 100%;
        height: 100px;
        background: rgba(20, 20, 22, 0.95);
        pointer-events: none;
    }

    body.w56-site.w56-mobile-nav-open {
        overflow: hidden;
        touch-action: none;
    }

    body.w56-site .header-main .header-inner.flex-row.container {
        display: flex !important;
        justify-content: space-between;
        align-items: center;
        padding: 5px 12px !important;
        min-height: 0 !important;
        height: auto !important;
        max-height: none;
    }

    body.w56-site .header-main .header-inner > .flex-col.show-for-medium.flex-left {
        order: 1;
        flex: 0 0 auto;
    }

    body.w56-site #logo {
        order: 2;
        flex: 0 0 auto;
    }

    body.w56-site .header-main .header-inner > .flex-col.show-for-medium.flex-right {
        order: 3;
        flex: 0 0 auto;
        margin-left: auto;
    }

    body.w56-site .mobile-nav {
        display: flex;
        align-items: center;
        gap: 0;
    }

    body.w56-site .mobile-nav .nav-icon a {
        color: #fff !important;
        font-size: 1.25em !important;
        line-height: 1;
        padding: 2px !important;
        border-radius: 6px;
        background: none !important;
        border: none !important;
        min-width: auto !important;
        min-height: auto !important;
    }

    body.w56-site .mobile-nav .nav-icon a:hover {
        color: #f0c159 !important;
        background: rgba(240, 193, 89, 0.1) !important;
    }

    body.w56-site .header-nav-main.nav-right {
        gap: 8px;
    }

    body.w56-site .header-button-1 .button,
    body.w56-site .header-button-2 .button {
        padding: 6px 11px !important;
        font-size: 0.68em !important;
        line-height: 1.1 !important;
        min-height: 0 !important;
        height: auto !important;
    }

    body.w56-site #logo img {
        width: 40px !important;
        height: 40px !important;
        max-height: 40px !important;
    }

    /* Dropdown panel below header (original site style) */
    body.w56-site #main-menu.mobile-sidebar {
        display: block !important;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        width: 100%;
        max-width: 100%;
        max-height: calc(100vh - 60px);
        overflow-y: auto;
        background: rgba(20, 20, 22, 0.98) !important;
        padding: 20px;
        border-radius: 0 0 12px 12px;
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
        transform: translateY(-8px);
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
        transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s;
        z-index: 1001;
    }

    body.w56-site #main-menu.mobile-sidebar.w56-mobile-nav-open {
        transform: translateY(0);
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
    }

    body.w56-site #main-menu.mobile-sidebar .sidebar-menu {
        padding: 0;
    }

    body.w56-site #main-menu.mobile-sidebar .nav-sidebar > li > a {
        display: block;
        text-align: center;
        color: #fff;
        font-size: 0.9em;
        text-transform: uppercase;
        letter-spacing: 0.03em;
        padding: 12px 16px;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        border-radius: 0;
    }

    body.w56-site #main-menu.mobile-sidebar .nav-sidebar > li:last-child > a {
        border-bottom: none;
    }

    body.w56-site #main-menu.mobile-sidebar .nav-sidebar > li > a:hover,
    body.w56-site #main-menu.mobile-sidebar .nav-sidebar > li.current-menu-item > a {
        color: #f0c159;
        background: rgba(240, 193, 89, 0.1);
    }

    body.w56-site.w56-mobile-nav-open .w56-mobile-nav-backdrop {
        display: block;
    }
}

body.w56-site .w56-mobile-nav-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.35);
    z-index: 1000;
}

body.w56-site .mobile-nav .nav-icon a,
body.w56-site .mobile-nav .is-small {
    color: #fff !important;
}

body.w56-site .mfp-ready .sidebar-menu,
body.w56-site .mobile-sidebar {
    background: #141416;
}

body.w56-site .mobile-sidebar .nav-sidebar > li > a {
    color: #fff;
    font-size: 0.9em;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

body.w56-site .mobile-sidebar .nav-sidebar > li > a:hover,
body.w56-site .mobile-sidebar .nav-sidebar > li.current-menu-item > a {
    color: #f0c159;
}

@media (min-width: 850px) and (max-width: 1199px) {
    body.w56-site .header-main .header-inner.flex-row.container {
        column-gap: 12px;
        padding-left: 12px;
        padding-right: 12px;
    }

    body.w56-site .header-nav-main.nav-left {
        gap: 6px !important;
    }

    body.w56-site .header-nav-main.nav-left > li > a,
    body.w56-site .header-main .header-nav.nav > li > a {
        padding: 6px 8px !important;
    }

    body.w56-site .header-button-1 .button,
    body.w56-site .header-button-2 .button {
        padding: 8px 12px !important;
    }
}

/* Desktop nav: force 0.85em (overrides Flatsome inline #custom-css) */
@media (min-width: 850px) {
    body.w56-site .header-nav-main.nav-left,
    body.w56-site .header-nav-main.nav-left > li,
    body.w56-site .header-nav-main.nav-left > li > a,
    body.w56-site .header-main .header-nav.nav > li > a,
    body.w56-site .header-main .header-nav.nav-left > li > a {
        font-size: 0.85em !important;
    }

    body.w56-site .header-button-1 .button,
    body.w56-site .header-button-2 .button {
        font-size: 0.85em !important;
    }
}
