/* Outer — logo sits in the primary nav row on desktop. */

.site-header {
    width: 100%;
    z-index: 999;
    display: grid;
    grid-template-columns: auto 1fr;
    grid-template-rows: auto auto;
    align-items: stretch;
}

/* Theme style.css sets .site-header { padding-right: 20px }. Utility already uses --px. */
.fl-module-header-menu .site-header {
    padding-right: 0;
}

.site-header .logo-menu {
    grid-column: 1;
    grid-row: 2;
    align-self: center;
    z-index: 2;
    position: relative;
}

.landata-hf-utility {
    grid-column: 2;
    grid-row: 1;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 20px;
    padding: 12px var(--px) 0;
    min-height: 48px;
    box-sizing: border-box;
}

.landata-hf-utility-link {
    color: var(--white);
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
    transition: var(--trans-text);
}

.landata-hf-utility-link:hover {
    color: var(--aqua);
}

/* Compact search so it fits the utility row (theme defaults are main-nav sized). */
.landata-hf-utility-search,
.site-header .landata-hf-utility-search.searchform {
    margin: 0;
    min-width: 180px;
    max-width: 240px;
}

.landata-hf-utility-search input,
.site-header .landata-hf-utility-search input {
    padding: 8px 40px 8px 16px;
    font-size: 14px;
    line-height: 1.2;
    height: auto;
    min-height: 0;
}

/* Beat BB theme skin `button { padding: 6px 12px }` so the icon matches LEX. */
.landata-hf-utility-search .searchsubmit,
.site-header .landata-hf-utility-search .searchsubmit,
.site-header .landata-hf-utility-search.searchform .searchsubmit {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
    width: auto;
    height: auto;
    margin: 0;
    padding: 0;
    border: none;
    background: transparent;
    box-shadow: none;
    line-height: 0;
    font-size: 0;
    color: var(--white);
    cursor: pointer;
}

.landata-hf-utility-search .searchsubmit svg,
.site-header .landata-hf-utility-search .searchsubmit svg {
    width: 16px;
    height: 16px;
    display: block;
}

.landata-hf-primary {
    grid-column: 2;
    grid-row: 2;
    width: 100%;
    min-height: 96px;
}

/* Logo */

.site-header .site-logo {
    flex: 0 1 auto;
    max-width: 350px;
    margin-right: var(--px);
    margin-left: var(--px);
}

/* Links */

.site-header a {
    text-decoration: none;
    cursor: pointer;
}

.site-header a:hover {
    text-decoration: none;
}

/* Menu - Desktop */

.site-header .main-menu {
    margin-right: 24px;
}

.site-header .main-menu ul {
    display: flex;
    list-style: none;
    align-items: center;
    margin: 0;
    padding: 0;
    align-self: stretch;
    gap: 20px;
}

.site-header .main-menu li {
    padding: 0;
}

.site-header .main-menu li a {
    color: var(--white);
    transition: var(--trans-text);
    display: block;
}

.site-header .main-menu .menu-item-has-children>a {
    position: relative;
    align-self: stretch;
    padding-right: 26px;
}

.site-header .main-menu .menu-item-has-children:hover>a:before {
    visibility: visible;
    transform: translateX(-50%) translateY(0%);
}

.site-header .main-menu .menu-item-has-children.is-active:after {
    transform: rotate(180deg);
}

/* Menu - Desktop Submenu */

.site-header .main-menu .sub-menu li {
    padding: 0;
    width: auto;
    margin-bottom: 8px;
}

.site-header .main-menu .sub-menu li:last-child {
    margin-bottom: 0;
}

.site-header .main-menu .sub-menu li a {
    display: block;
    color: var(--white);
    transition: var(--trans-text);
    display: block;
}

.site-header .main-menu .sub-menu li a:hover {
    color: var(--white);
}

.fl-row-default-height.fl-row-align-center .fl-row-content-wrap .single-fl-theme-layout header .fl-row-content-wrap {
    background: transparent !important;
}

/* Mobile Menu Button / Burger */

.site-header .mobmenu {
    display: none;
    line-height: 1;
}

.mobmenu,
.mobmenu:focus,
.mobmenu:active,
.mobmenu:visited,
.mobmenu:hover {
    opacity: 1;
    visibility: visible;
    top: 0;
    height: 82px;
    padding: 0 var(--px);
    border: 0;
    border-radius: 0;
    background: transparent;
    transition: opacity 0.25s, visibility 0.25s;
    -webkit-appearance: none;
}

.mobmenu .burger {
    display: inline-block;
    z-index: 1;
    position: relative;
    width: 18px;
    height: 16px;
}

.mobmenu .burger:after,
.mobmenu .burger:before,
.mobmenu .burger span {
    opacity: 1;
    visibility: visible;
    position: absolute;
    left: 0;
    width: 18px;
    height: 2px;
    border-radius: 2px;
    content: '';
    background-color: var(--white);
    transition: transform 0.15s, visibility 0.15s, opacity 0.15s, top 0.15s, bottom 0.15s;
    transform-origin: center;
}

.mobmenu .burger span {
    top: 7px;
}

.mobmenu .burger:before {
    top: 0;
}

.mobmenu .burger:after {
    bottom: 0;
}

.mobmenu.is-active .burger:before {
    transform: rotate(45deg);
    top: 7px;
}

.mobmenu.is-active .burger:after {
    transform: rotate(-45deg);
    bottom: 7px;
}

.mobmenu.is-active .burger span {
    opacity: 0;
    visibility: hidden;
}

.mobmenu:hover {
    border: 0;
    color: var(--white);
}

/* Over 1020 */

@media screen and (min-width: 1020px) {

    .site-header .main-menu ul.sub-menu {
        opacity: 0;
        visibility: hidden;
        z-index: 99;
        position: absolute;
        top: 2.125em;
        /* Anchor to the right so wide submenus do not create page overflow. */
        left: auto;
        right: 0;
        flex-direction: column;
        flex-wrap: wrap;
        align-items: flex-start;
        min-width: 400px;
        padding: 20px 24px;
        border-radius: 0;
        background-color: var(--blue);
        transition: opacity 0.25s, visibility 0.25s;
    }

    /*
     * Beat legacy frontend.css rules that BB still ships in the layout-bundle
     * (same selectors, later in the cascade) when the dark-launch gate is live.
     */
    body.landata-hf-wp-live .site-header .main-menu ul.sub-menu {
        left: auto;
        right: 0;
        border-radius: 0;
        background-color: var(--blue);
    }

    .site-header .main-menu>ul li {
        display: flex;
        position: relative;
    }

    .site-header .main-menu ul li a {
        display: flex;
        align-items: center;
        line-height: 1.5em;
    }

    .site-header .main-menu .menu-item-has-children:hover>ul.sub-menu {
        display: block;
    }

    .site-header .main-menu ul li a:hover {
        color: var(--aqua);
    }

    .site-header .main-menu .menu-item-has-children>a:after {
        content: '';
        background-image: url(/wp-content/plugins/landata-custom-layouts/header-menu/images/nav-arrow.svg);
        background-size: contain;
        background-repeat: no-repeat;
        background-position: center center;
        transform: rotate(0deg);
        transition: transform 0.25s;
        position: absolute;
        right: 0;
        top: 50%;
        transform: translateY(-50%);
        height: 8px;
        width: 16px;
    }

    .site-header .main-menu .menu-item-has-children li {
        padding-left: 16px;
        position: relative;
    }

    .site-header .main-menu .menu-item-has-children li a:before {
        content: '';
        background-image: url(/wp-content/plugins/landata-custom-layouts/header-menu/images/nav-arrow.svg);
        background-size: contain;
        background-repeat: no-repeat;
        background-position: center center;
        transition: transform 0.25s;
        transform: translateY(-50%) rotate(270deg);
        height: 6px;
        width: 12px;
        display: inline-block;
        position: absolute;
        left: 0;
        top: 12px;
    }

    .site-header .main-menu li:hover ul.sub-menu,
    .site-header .main-menu .show-sub-menu .sub-menu {
        visibility: visible;
        opacity: 1;
    }
}

/* Under 1020 */

@media screen and (max-width: 1020px) {

    .site-header {
        min-height: 82px;
        /* Logo left; hamburger right. Account lives in the drawer. */
        grid-template-columns: 1fr auto;
        grid-template-rows: auto;
        align-items: center;
    }

    .site-header .logo-menu {
        grid-column: 1;
        grid-row: 1;
        align-self: center;
    }

    /* Utility contact/search stay desktop-only; mobile uses drawer footer.
       Beat the theme `.flex` class so this row cannot show under the hamburger. */
    .site-header .landata-hf-utility,
    .site-header .landata-hf-utility.flex,
    .site-header .landata-hf-utility-link,
    .site-header .landata-hf-utility-search {
        display: none !important;
    }

    .landata-hf-primary {
        grid-column: 2;
        grid-row: 1;
        min-height: 82px;
        width: auto;
        align-self: center;
    }

    .landata-hf-account {
        display: none;
    }

    .landata-hf-account-mobile {
        display: block;
        width: 100%;
    }

    .landata-hf-drawer-footer {
        display: block;
        width: 100%;
        padding: 0 var(--px) var(--py);
        box-sizing: border-box;
    }

    .site-header .mobmenu {
        display: block;
        position: relative;
        z-index: 2;
    }

    .site-header.is-active {
        position: fixed;
        z-index: 999;
    }

    .site-header.is-active .main-menu {
        opacity: 1;
        visibility: visible;
    }

    .site-header .site-logo {
        flex: 0 1 332px;
    }

    .site-header .menu-wrap {
        flex-direction: row-reverse;
    }

    .site-header .menu-nav {
        padding-right: 0;
    }

    .site-header .main-menu {
        display: block;
        position: absolute;
        height: 100vh;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        opacity: 0;
        z-index: 0;
        padding-top: 60px;
        margin-right: 0;
        background: var(--navy);
        visibility: hidden;
        flex-direction: column;
        justify-content: flex-start;
        overflow-y: auto;
    }

    .site-header .main-menu > ul,
    .site-header .main-menu .landata-hf-account-mobile-list,
    .site-header .main-menu .landata-hf-drawer-footer-list {
        align-items: flex-start;
        margin: 0;
        margin-bottom: 0 !important;
        flex-direction: column;
        width: 100%;
        text-align: left;
        padding: 0 var(--px);
        padding-top: 0 !important;
        padding-bottom: 0 !important;
        gap: 0;
        list-style: none;
    }

    .site-header .main-menu .landata-hf-drawer-footer-list {
        /* Horizontal inset comes from .landata-hf-drawer-footer. */
        padding-left: 0;
        padding-right: 0;
    }

    .site-header .main-menu li {
        width: 100%;
        padding: 0;
        border-top: 1px solid var(--aqua);
        position: relative;
    }

    /* Keep a separator between primary nav and account links. */
    .site-header .main-menu .landata-hf-account-mobile-list > li:first-child {
        border-top: 1px solid var(--aqua);
    }

    .site-header .main-menu li a {
        font-size: 20px;
        padding: var(--half-py) 0;
        display: block;
        color: var(--white);
        text-decoration: none;
        background: transparent;
        border: 0;
        border-radius: 0;
        text-align: left;
        width: auto;
        white-space: normal;
    }

    /* Account drawer links — smaller than primary nav. */
    .site-header .main-menu .landata-hf-account-mobile-list > li > a,
    .site-header .main-menu .landata-hf-account-mobile-list .menu-item-has-children > a {
        font-size: 15px;
    }

    .site-header .main-menu .landata-hf-account-mobile-list .sub-menu li a {
        font-size: 13px;
    }

    /* Match account links above (not primary nav size/weight). */
    .site-header .main-menu .landata-hf-drawer-footer-list li a {
        font-size: 15px;
        font-weight: 400;
        line-height: 1.5;
    }

    .site-header .main-menu .landata-hf-drawer-search {
        display: flex;
        width: 100%;
        max-width: none;
        min-width: 0;
        margin: 12px 0 0;
        box-sizing: border-box;
    }

    .site-header .main-menu .landata-hf-drawer-search input {
        width: 100%;
        flex: 1 1 auto;
        min-width: 0;
    }

    .site-header .main-menu ul.sub-menu {
        display: none;
        opacity: 1;
        visibility: visible;
        position: relative;
        top: 0;
        width: 100%;
        margin-top: 0;
        padding: 0;
        background-color: transparent;
    }

    .site-header .main-menu .sub-menu li {
        width: 100%;
        border: 0;
        padding: 0;
    }

    .site-header .main-menu .sub-menu li a {
        font-size: 15px;
        padding: 6px 0;
        color: var(--white);
    }

    .site-header .menu-item-has-children:after {
        content: '';
        background-image: url(/wp-content/plugins/landata-custom-layouts/header-menu/images/nav-arrow.svg);
        background-size: contain;
        background-repeat: no-repeat;
        background-position: center center;
        transform: rotate(0deg);
        transition: transform 0.25s;
        position: absolute;
        right: 1em;
        top: 1.35em;
        height: 8px;
        width: 16px;
        pointer-events: none;
    }

    .site-header .menu-item-has-children.in-view:after,
    .site-header .menu-item-has-children.is-active:after {
        transform: rotate(180deg);
    }

    .site-header .main-menu > ul > li:first-of-type {
        border-top: 0;
    }



}

/* Under 900 */

@media screen and (max-width: 900px) {
    .site-header .landata-hf-utility-search.searchform {
        display: none;
    }

}

/* Under 767 */

@media screen and (max-width: 767px) {
    .site-header .site-logo {
        max-width: 280px;
    }

    .logged-in .search-top {
        margin: 75px auto 0;
    }
}

/* Account area — dual-state for REST (cookie toggle via html.landata-hf-auth--signed-in).
   WordPress pages may render only one panel via server-side cookie branching.
   Desktop: icon + dropdown. Mobile: links live in the hamburger drawer. */

.landata-hf-account {
    display: flex;
    align-items: center;
    /* Bordered search + avatar need more air than Contact↔search text gap. */
    margin-left: 12px;
    margin-right: 0;
}

/* Desktop-only control; mobile drawer list is shown in the ≤1020 rules. */
.landata-hf-account-mobile {
    display: none;
}

.landata-hf-drawer-footer {
    display: none;
}

.landata-hf-account-mobile .landata-hf-account-signed-out {
    display: block;
}

/* Hide the drawer's signed-in list by default when both panels are rendered
   (REST/export). Scoped to beat `.site-header .main-menu ul` above while
   staying less specific than the signed-in rules below. */
.site-header .main-menu .landata-hf-account-signed-in {
    display: none;
}

.landata-hf-account-dropdown .landata-hf-account-signed-out,
.landata-hf-account-dropdown .landata-hf-account-signed-in {
    flex-direction: column;
    gap: 12px;
}

.landata-hf-account-dropdown .landata-hf-account-signed-out {
    display: flex;
}

.landata-hf-account-dropdown .landata-hf-account-signed-in {
    display: none;
}

html.landata-hf-auth--signed-in .landata-hf-account-signed-out,
#landata-hf.landata-hf-auth--signed-in .landata-hf-account-signed-out {
    display: none;
}

html.landata-hf-auth--signed-in .landata-hf-account-dropdown .landata-hf-account-signed-in,
#landata-hf.landata-hf-auth--signed-in .landata-hf-account-dropdown .landata-hf-account-signed-in {
    display: flex;
}

html.landata-hf-auth--signed-in .landata-hf-account-mobile .landata-hf-account-signed-in,
#landata-hf.landata-hf-auth--signed-in .landata-hf-account-mobile .landata-hf-account-signed-in {
    display: block;
}

.landata-hf-account-menu {
    position: relative;
    line-height: 0;
}

.landata-hf-account-trigger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    padding: 0;
    overflow: hidden;
    border: 1px solid var(--white);
    border-radius: 50%;
    background: transparent;
    color: var(--white);
    cursor: pointer;
    line-height: 0;
}

/* Keep icon + ring white; beat BB theme button:hover/focus chrome. */
.landata-hf-account-trigger:hover,
.landata-hf-account-trigger:focus,
.landata-hf-account-trigger:active {
    color: var(--white);
    border-color: var(--white);
    background: transparent;
    box-shadow: none;
    outline: none;
}

.landata-hf-account-trigger:focus-visible {
    color: var(--white);
    border-color: var(--white);
    outline: 2px solid var(--aqua);
    outline-offset: 2px;
}

.landata-hf-account-trigger-icon {
    position: relative;
    display: inline-flex;
    margin-top: 12px;
}

.landata-hf-account-trigger-icon svg {
    width: 37px;
    height: 37px;
}

.landata-hf-account-dot {
    display: none;
    position: absolute;
    top: 0;
    right: 6px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: var(--aqua);
}

html.landata-hf-auth--signed-in .landata-hf-account-dot,
#landata-hf.landata-hf-auth--signed-in .landata-hf-account-dot {
    display: block;
}

.landata-hf-account-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 12px);
    right: 10px;
    min-width: 290px;
    padding: 24px;
    border-radius: 12px;
    background-color: var(--white);
    z-index: 100;
}

/* White notch pointing up toward the account icon. */
.landata-hf-account-dropdown::before {
    content: '';
    position: absolute;
    top: -10px;
    right: 12px;
    width: 0;
    height: 0;
    border-left: 10px solid transparent;
    border-right: 10px solid transparent;
    border-bottom: 10px solid var(--white);
    pointer-events: none;
}

.landata-hf-account-menu.is-open .landata-hf-account-dropdown {
    display: block;
}

.landata-hf-account-dropdown[hidden] {
    display: none !important;
}

.landata-hf-account-dropdown a,
.landata-hf-order-now-trigger {
    display: block;
    width: 100%;
    padding: 10px 36px;
    color: var(--navy);
    /* Match primary header nav size; keep account items bold. */
    font-size: var(--text-menu);
    font-weight: 600;
    line-height: 1.5;
    text-decoration: none;
    white-space: nowrap;
    text-align: center;
    box-sizing: border-box;
    border: 1px solid var(--navy);
    border-radius: 24px;
    background-color: var(--white);
}

.landata-hf-order-now-trigger {
    cursor: pointer;
    font-family: inherit;
    font-size: var(--text-menu);
    font-weight: 600;
    text-shadow: none;
    box-shadow: none;
    appearance: none;
    -webkit-appearance: none;
}

/* Beat BB theme skin button/button:focus/button:active chrome. */
.landata-hf-order-now-trigger:focus,
.landata-hf-order-now-trigger:active {
    border: 1px solid var(--navy);
    background-color: var(--white);
    color: var(--navy);
    box-shadow: none;
    outline: none;
    position: static;
}

.landata-hf-order-now-trigger:hover,
.landata-hf-account-dropdown a:hover {
    color: var(--white);
    background-color: var(--navy);
    border-color: var(--navy);
    text-decoration: none;
}

.landata-hf-account-dropdown a:focus,
.landata-hf-account-dropdown a:active {
    outline: none;
    /* Beat BB/theme a:focus underline when JS focuses the first item on open. */
    text-decoration: none;
}

.landata-hf-order-now-trigger:focus-visible,
.landata-hf-account-dropdown a:focus-visible {
    color: var(--white);
    background-color: var(--navy);
    border-color: var(--navy);
    outline: 2px solid var(--navy);
    outline-offset: 2px;
    text-decoration: none;
}

.landata-hf-order-now-menu {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.landata-hf-order-now-dropdown {
    display: none;
    flex-direction: column;
    gap: 8px;
    padding-left: 12px;
}

.landata-hf-order-now-menu.is-open .landata-hf-order-now-dropdown {
    display: flex;
}

.landata-hf-order-now-dropdown[hidden] {
    display: none !important;
}

@media screen and (max-width: 1020px) {
    .site-header .landata-hf-utility,
    .site-header .landata-hf-utility.flex,
    .site-header .landata-hf-utility-link,
    .site-header .landata-hf-utility-search {
        display: none !important;
    }

    .landata-hf-account {
        display: none;
    }

    .landata-hf-account-mobile {
        display: block;
        width: 100%;
    }

    .landata-hf-drawer-footer {
        display: block;
        width: 100%;
    }
}

/*
 * Home hero clearance under the taller shared header. Lives in this file so
 * WordPress only loads it when the header is live (see enqueue gate in
 * header-menu.php); the API appends this CSS for LEX, which has no home hero.
 * Higher specificity beats the home-search module's 1rem rule.
 */
@media screen and (max-width: 1020px) {
    .fl-module-home-search .home-search .text-col {
        margin-top: 7rem;
    }
}
