/* L&P mobile navigation. Parent U-Design remains untouched. */
#lp-mobile-menu-panel,
#lp-mobile-sticky,
.lp-mobile-menu-toggle {
    display: none;
}

@media screen and (max-width: 719px) {
    /* U-Design's generated SelectNav is replaced by the L&P mobile menu. */
    #main-menu select.selectnav {
        display: none !important;
    }

    /*
     * U-Design gives the responsive logo a 150px height and a fixed 300px box.
     * Keep the existing logo, but make the mobile header compact and center it
     * against the actual visible header width rather than the old 320px grid.
     */
    #top-wrapper {
        min-height: 120px;
        padding-bottom: 0 !important;
        position: relative;
    }

    /*
     * U-Design's sub-480px grid is 320px wide. Keep the mobile header
     * controls on that same centered grid instead of stretching them to
     * the viewport. This is the shared containing block for logo + toggle.
     */
    #top-elements {
        display: block !important;
        height: 120px !important;
        margin: 0 auto !important;
        max-width: calc(100% - 40px);
        min-height: 120px;
        position: relative;
        transform: translateX(-6px);
        width: 320px !important;
    }

    #logo {
        box-sizing: border-box !important;
        height: 100px;
        left: 0 !important;
        margin: 0 !important;
        padding: 10px 48px !important;
        position: absolute !important;
        top: 0 !important;
        width: 100% !important;
    }

    #logo h1,
    #logo .site-name {
        height: 100px;
        margin: 0 !important;
        padding: 0 !important;
        width: 100% !important;
    }

    #logo h1 a,
    #logo .site-name a {
        background-position: 50% 50% !important;
        background-size: contain !important;
        height: 100px !important;
        margin: 0 auto !important;
        max-width: 190px !important;
        width: 100% !important;
    }

    /* The old navigation row no longer needs to reserve vertical space. */
    #main-menu {
        height: 0 !important;
        margin: 0 !important;
        min-height: 0 !important;
        position: static !important;
    }

    #main-menu::before {
        display: none !important;
    }

    #main-menu #dropdown-holder {
        height: 0 !important;
        min-height: 0 !important;
        position: static !important;
        width: 100% !important;
    }

    /* Logo and toggle now share #top-elements as their containing block. */
    #lp-mobile-header-toggle.lp-mobile-menu-toggle {
        display: flex;
        position: absolute;
        right: 24px;
        top: 40px;
        z-index: 10002;
    }

    .lp-mobile-menu-toggle {
        align-items: center;
        background: transparent;
        border: 0;
        box-shadow: none;
        box-sizing: border-box;
        cursor: pointer;
        flex-direction: column;
        gap: 5px;
        height: 40px;
        justify-content: center;
        margin: 0;
        padding: 7px;
        width: 40px;
    }

    .lp-mobile-menu-toggle span {
        background: #1a3e49;
        display: block;
        height: 2px;
        transition: transform .2s ease, opacity .2s ease;
        width: 24px;
    }

    body.lp-mobile-menu-open .lp-mobile-menu-toggle span:nth-child(1) {
        transform: translateY(7px) rotate(45deg);
    }

    body.lp-mobile-menu-open .lp-mobile-menu-toggle span:nth-child(2) {
        opacity: 0;
    }

    body.lp-mobile-menu-open .lp-mobile-menu-toggle span:nth-child(3) {
        transform: translateY(-7px) rotate(-45deg);
    }

    #lp-mobile-menu-panel {
        background: #fff;
        bottom: 0;
        box-sizing: border-box;
        display: block;
        left: 0;
        opacity: 0;
        overflow-y: auto;
        padding: 66px 24px 32px;
        pointer-events: none;
        position: fixed;
        right: 0;
        top: 0;
        transform: translateY(-12px);
        transition: opacity .2s ease, transform .2s ease;
        visibility: hidden;
        width: 100vw;
        z-index: 10000;
    }

    /* Dedicated close control remains above the panel and cannot be clipped by theme containers. */
    #lp-mobile-panel-toggle.lp-mobile-menu-toggle {
        display: none;
        position: fixed;
        right: 36px;
        top: 13px;
        z-index: 10003;
    }

    body.admin-bar #lp-mobile-panel-toggle.lp-mobile-menu-toggle {
        top: 59px;
    }

    body.lp-mobile-menu-open #lp-mobile-panel-toggle.lp-mobile-menu-toggle {
        display: flex;
    }

    body.lp-mobile-menu-open #lp-mobile-panel-toggle.lp-mobile-menu-toggle span:nth-child(1) {
        transform: translateY(7px) rotate(45deg);
    }

    body.lp-mobile-menu-open #lp-mobile-panel-toggle.lp-mobile-menu-toggle span:nth-child(2) {
        opacity: 0;
    }

    body.lp-mobile-menu-open #lp-mobile-panel-toggle.lp-mobile-menu-toggle span:nth-child(3) {
        transform: translateY(-7px) rotate(-45deg);
    }

    body.lp-mobile-menu-open {
        overflow: hidden;
    }

    body.lp-mobile-menu-open #lp-mobile-menu-panel {
        opacity: 1;
        pointer-events: auto;
        transform: translateY(0);
        visibility: visible;
    }

    #lp-mobile-menu-panel .lp-mobile-menu-list,
    #lp-mobile-menu-panel .lp-mobile-menu-list ul {
        list-style: none;
        margin: 0;
        padding: 0;
    }

    #lp-mobile-menu-panel .lp-mobile-menu-list > li {
        border-bottom: 1px solid #e4e7e8;
    }

    #lp-mobile-menu-panel .lp-mobile-menu-list a {
        color: #1a3e49;
        display: block;
        font-size: 18px;
        font-weight: 600;
        line-height: 1.3;
        padding: 11px 4px;
        text-decoration: none;
    }

    #lp-mobile-menu-panel .lp-mobile-menu-list ul {
        padding: 0 0 6px 14px;
    }

    #lp-mobile-menu-panel .lp-mobile-menu-list ul a {
        font-size: 15px;
        font-weight: 400;
        padding: 6px 4px;
    }

    #lp-mobile-menu-panel .lp-mobile-language {
        border-top: 0;
        margin-top: 0;
        padding-top: 16px;
    }

    #lp-mobile-menu-panel .lp-mobile-language a {
        color: #1a3e49;
        display: inline-block;
        font-size: 16px;
        font-weight: 600;
        text-decoration: none;
    }

    #lp-mobile-sticky {
        align-items: center;
        background: #fff;
        box-shadow: 0 2px 10px rgba(0, 0, 0, .12);
        box-sizing: border-box;
        display: flex;
        height: 56px;
        justify-content: space-between;
        left: 0;
        opacity: 0;
        padding: 5px 12px 5px 16px;
        pointer-events: none;
        position: fixed;
        right: 0;
        top: 0;
        transform: translateY(-100%);
        transition: opacity .18s ease, transform .18s ease;
        width: 100%;
        z-index: 9999;
    }

    body.admin-bar #lp-mobile-sticky {
        top: 46px;
    }

    body.lp-mobile-sticky-active #lp-mobile-sticky {
        opacity: 1;
        pointer-events: auto;
        transform: translateY(0);
    }

    #lp-mobile-sticky .lp-mobile-sticky-logo {
        align-items: center;
        display: flex;
        height: 40px;
    }

    #lp-mobile-sticky .lp-mobile-sticky-logo img {
        height: 36px;
        max-width: 190px;
        object-fit: contain;
        width: auto;
    }

    #lp-mobile-sticky .lp-mobile-menu-toggle {
        display: flex;
        position: static;
    }

    body.fixed-menu #main-menu,
    body.fixed-menu #sticky-menu-alias {
        position: static !important;
    }

    body.fixed-menu #sticky-menu-logo {
        display: none !important;
    }
}

/* 2229: final normal-header toggle alignment at the real 390px viewport. */
@media screen and (max-width: 719px) {
    #lp-mobile-header-toggle.lp-mobile-menu-toggle {
        right: -10px;
    }

    #lp-mobile-sticky .lp-mobile-menu-toggle {
        margin-right: 0;
    }
}

/* 2298: tablet/intermediate navigation uses the same L&P hamburger panel. */
@media screen and (min-width: 720px) and (max-width: 959px) {
    #main-menu select.selectnav,
    #main-menu #dropdown-holder {
        display: none !important;
    }

    #main-menu {
        height: 0 !important;
        margin: 0 !important;
        min-height: 0 !important;
    }

    #top-elements {
        box-sizing: border-box;
        max-width: none !important;
        position: relative;
        width: 100% !important;
    }

    #lp-mobile-header-toggle.lp-mobile-menu-toggle {
        display: flex;
        position: absolute;
        right: 0;
        top: 40px;
        z-index: 10002;
    }

    .lp-mobile-menu-toggle {
        align-items: center;
        background: transparent;
        border: 0;
        box-shadow: none;
        box-sizing: border-box;
        cursor: pointer;
        flex-direction: column;
        gap: 5px;
        height: 40px;
        justify-content: center;
        margin: 0;
        padding: 7px;
        width: 40px;
    }

    .lp-mobile-menu-toggle span {
        background: #1a3e49;
        display: block;
        height: 2px;
        transition: transform .2s ease, opacity .2s ease;
        width: 24px;
    }

    body.lp-mobile-menu-open .lp-mobile-menu-toggle span:nth-child(1) {
        transform: translateY(7px) rotate(45deg);
    }

    body.lp-mobile-menu-open .lp-mobile-menu-toggle span:nth-child(2) {
        opacity: 0;
    }

    body.lp-mobile-menu-open .lp-mobile-menu-toggle span:nth-child(3) {
        transform: translateY(-7px) rotate(-45deg);
    }

    #lp-mobile-menu-panel {
        background: #fff;
        bottom: 0;
        box-sizing: border-box;
        display: block;
        left: 0;
        opacity: 0;
        overflow-y: auto;
        padding: 66px 40px 32px;
        pointer-events: none;
        position: fixed;
        right: 0;
        top: 0;
        transform: translateY(-12px);
        transition: opacity .2s ease, transform .2s ease;
        visibility: hidden;
        width: 100vw;
        z-index: 10000;
    }

    #lp-mobile-panel-toggle.lp-mobile-menu-toggle {
        display: none;
        position: fixed;
        right: 40px;
        top: 13px;
        z-index: 10003;
    }

    body.admin-bar #lp-mobile-panel-toggle.lp-mobile-menu-toggle {
        top: 45px;
    }

    body.lp-mobile-menu-open #lp-mobile-panel-toggle.lp-mobile-menu-toggle {
        display: flex;
    }

    body.lp-mobile-menu-open {
        overflow: hidden;
    }

    body.lp-mobile-menu-open #lp-mobile-menu-panel {
        opacity: 1;
        pointer-events: auto;
        transform: translateY(0);
        visibility: visible;
    }

    #lp-mobile-menu-panel .lp-mobile-menu-list,
    #lp-mobile-menu-panel .lp-mobile-menu-list ul {
        list-style: none;
        margin: 0;
        padding: 0;
    }

    #lp-mobile-menu-panel .lp-mobile-menu-list > li {
        border-bottom: 1px solid #e4e7e8;
    }

    #lp-mobile-menu-panel .lp-mobile-menu-list a {
        color: #1a3e49;
        display: block;
        font-size: 18px;
        font-weight: 600;
        line-height: 1.3;
        padding: 11px 4px;
        text-decoration: none;
    }

    #lp-mobile-menu-panel .lp-mobile-menu-list ul {
        padding: 0 0 6px 14px;
    }

    #lp-mobile-menu-panel .lp-mobile-menu-list ul a {
        font-size: 15px;
        font-weight: 400;
        padding: 6px 4px;
    }

    #lp-mobile-menu-panel .lp-mobile-language {
        border-top: 0;
        margin-top: 0;
        padding-top: 16px;
        text-align: right;
    }

    #lp-mobile-menu-panel .lp-mobile-language a {
        color: #1a3e49;
        display: inline-block;
        font-size: 16px;
        font-weight: 600;
        text-decoration: none;
    }
}

/* 2298: language switcher treatment is identical at every hamburger size. */
@media screen and (max-width: 719px) {
    #lp-mobile-menu-panel .lp-mobile-language {
        border-top: 0;
        text-align: right;
    }
}


/* 2328: tablet toggle belongs to the full header wrapper, not U-Design's narrow #top-elements box. */
@media screen and (min-width: 720px) and (max-width: 959px) {
    #top-wrapper {
        position: relative;
    }

    #lp-mobile-header-toggle.lp-mobile-menu-toggle {
        right: 24px;
        top: 40px;
    }
}


/* 2329: U-Design breakpoint 480-719px gets its own header-toggle host.
 * Phone portrait (<480px) remains on the frozen 320px #top-elements grid. */
@media screen and (min-width: 480px) and (max-width: 719px) {
    #top-wrapper {
        position: relative;
    }

    #lp-mobile-header-toggle.lp-mobile-menu-toggle {
        display: flex;
        right: 24px;
        top: 40px;
    }
}

/* 2330: add breathing room above the menu content only in U-Design's
 * 480-719px state. The fixed close button keeps its established position. */
@media screen and (min-width: 480px) and (max-width: 719px) {
    #lp-mobile-menu-panel {
        padding-top: 80px;
    }
}

/* 2336: narrow desktop / iPad portrait navigation.
 * Keep the menu at its natural right-aligned position, reclaim horizontal
 * space from the top-level item padding, and make the final INFO dropdown
 * open inward so it cannot run beyond the right viewport edge.
 * Hamburger states <=959px and normal desktop >1100px remain untouched. */
@media screen and (min-width: 960px) and (max-width: 1100px) {
    #navigation-menu > ul.sf-menu {
        margin-right: 0 !important;
    }

    #navigation-menu ul.sf-menu > li > a {
        padding-right: 16px;
    }

    #navigation-menu ul.sf-menu > li > a > span {
        padding-left: 16px;
    }

    #navigation-menu ul.sf-arrows > li > a.sf-with-ul,
    #navigation-menu ul.sf-arrows > li > a.sf-with-ul:hover,
    #navigation-menu ul.sf-arrows > li > a.sf-with-ul:focus {
        padding-right: 22px;
    }

    #navigation-menu ul.sf-menu > li:last-child {
        transform: translateX(-5px);
    }

    #navigation-menu ul.sf-menu > li:last-child:hover > ul,
    #navigation-menu ul.sf-menu > li:last-child.sfHover > ul {
        left: auto;
        right: 0;
    }
}

/* 2366: real iPhone landscape / U-Design 480–719 header.
 * Keep exactly the established L&P mobile header: logo + hamburger only.
 * U-Design otherwise reintroduces its auxiliary top elements in this range. */
@media screen and (min-width: 480px) and (max-width: 719px) {
    #top-elements .phone-number,
    #top-elements #search,
    #top-elements .social-media-area {
        display: none !important;
    }
}

/* 2367: real-phone landscape only — remove U-Design's secondary utility menu.
 * Keep the finished 600px portrait header and <=479 phone portrait untouched. */
@media screen and (min-width: 600px) and (max-width: 719px) and (orientation: landscape) {
    #secondary-navigation-bar-wrapper {
        display: none !important;
    }
}


/* ==========================================================================
   2368 — Phone landscape inherits the complete frozen 390px phone UI.
   Additive only: portrait breakpoints and tablet/desktop modes are untouched.
   The low-height landscape gate identifies phones without widening existing
   width breakpoints.
   ========================================================================== */

/* 390 source: @media screen and (max-width: 719px) */
@media screen and (orientation: landscape) and (max-height: 500px) {

    /* U-Design's generated SelectNav is replaced by the L&P mobile menu. */
    #main-menu select.selectnav {
        display: none !important;
    }

    /*
     * U-Design gives the responsive logo a 150px height and a fixed 300px box.
     * Keep the existing logo, but make the mobile header compact and center it
     * against the actual visible header width rather than the old 320px grid.
     */
    #top-wrapper {
        min-height: 120px;
        padding-bottom: 0 !important;
        position: relative;
    }

    /*
     * U-Design's sub-480px grid is 320px wide. Keep the mobile header
     * controls on that same centered grid instead of stretching them to
     * the viewport. This is the shared containing block for logo + toggle.
     */
    #top-elements {
        display: block !important;
        height: 120px !important;
        margin: 0 auto !important;
        max-width: calc(100% - 40px);
        min-height: 120px;
        position: relative;
        transform: translateX(-6px);
        width: 320px !important;
    }

    #logo {
        box-sizing: border-box !important;
        height: 100px;
        left: 0 !important;
        margin: 0 !important;
        padding: 10px 48px !important;
        position: absolute !important;
        top: 0 !important;
        width: 100% !important;
    }

    #logo h1,
    #logo .site-name {
        height: 100px;
        margin: 0 !important;
        padding: 0 !important;
        width: 100% !important;
    }

    #logo h1 a,
    #logo .site-name a {
        background-position: 50% 50% !important;
        background-size: contain !important;
        height: 100px !important;
        margin: 0 auto !important;
        max-width: 190px !important;
        width: 100% !important;
    }

    /* The old navigation row no longer needs to reserve vertical space. */
    #main-menu {
        height: 0 !important;
        margin: 0 !important;
        min-height: 0 !important;
        position: static !important;
    }

    #main-menu::before {
        display: none !important;
    }

    #main-menu #dropdown-holder {
        height: 0 !important;
        min-height: 0 !important;
        position: static !important;
        width: 100% !important;
    }

    /* Logo and toggle now share #top-elements as their containing block. */
    #lp-mobile-header-toggle.lp-mobile-menu-toggle {
        display: flex;
        position: absolute;
        right: 24px;
        top: 40px;
        z-index: 10002;
    }

    .lp-mobile-menu-toggle {
        align-items: center;
        background: transparent;
        border: 0;
        box-shadow: none;
        box-sizing: border-box;
        cursor: pointer;
        flex-direction: column;
        gap: 5px;
        height: 40px;
        justify-content: center;
        margin: 0;
        padding: 7px;
        width: 40px;
    }

    .lp-mobile-menu-toggle span {
        background: #1a3e49;
        display: block;
        height: 2px;
        transition: transform .2s ease, opacity .2s ease;
        width: 24px;
    }

    body.lp-mobile-menu-open .lp-mobile-menu-toggle span:nth-child(1) {
        transform: translateY(7px) rotate(45deg);
    }

    body.lp-mobile-menu-open .lp-mobile-menu-toggle span:nth-child(2) {
        opacity: 0;
    }

    body.lp-mobile-menu-open .lp-mobile-menu-toggle span:nth-child(3) {
        transform: translateY(-7px) rotate(-45deg);
    }

    #lp-mobile-menu-panel {
        background: #fff;
        bottom: 0;
        box-sizing: border-box;
        display: block;
        left: 0;
        opacity: 0;
        overflow-y: auto;
        padding: 66px 24px 32px;
        pointer-events: none;
        position: fixed;
        right: 0;
        top: 0;
        transform: translateY(-12px);
        transition: opacity .2s ease, transform .2s ease;
        visibility: hidden;
        width: 100vw;
        z-index: 10000;
    }

    /* Dedicated close control remains above the panel and cannot be clipped by theme containers. */
    #lp-mobile-panel-toggle.lp-mobile-menu-toggle {
        display: none;
        position: fixed;
        right: 36px;
        top: 13px;
        z-index: 10003;
    }

    body.admin-bar #lp-mobile-panel-toggle.lp-mobile-menu-toggle {
        top: 59px;
    }

    body.lp-mobile-menu-open #lp-mobile-panel-toggle.lp-mobile-menu-toggle {
        display: flex;
    }

    body.lp-mobile-menu-open #lp-mobile-panel-toggle.lp-mobile-menu-toggle span:nth-child(1) {
        transform: translateY(7px) rotate(45deg);
    }

    body.lp-mobile-menu-open #lp-mobile-panel-toggle.lp-mobile-menu-toggle span:nth-child(2) {
        opacity: 0;
    }

    body.lp-mobile-menu-open #lp-mobile-panel-toggle.lp-mobile-menu-toggle span:nth-child(3) {
        transform: translateY(-7px) rotate(-45deg);
    }

    body.lp-mobile-menu-open {
        overflow: hidden;
    }

    body.lp-mobile-menu-open #lp-mobile-menu-panel {
        opacity: 1;
        pointer-events: auto;
        transform: translateY(0);
        visibility: visible;
    }

    #lp-mobile-menu-panel .lp-mobile-menu-list,
    #lp-mobile-menu-panel .lp-mobile-menu-list ul {
        list-style: none;
        margin: 0;
        padding: 0;
    }

    #lp-mobile-menu-panel .lp-mobile-menu-list > li {
        border-bottom: 1px solid #e4e7e8;
    }

    #lp-mobile-menu-panel .lp-mobile-menu-list a {
        color: #1a3e49;
        display: block;
        font-size: 18px;
        font-weight: 600;
        line-height: 1.3;
        padding: 11px 4px;
        text-decoration: none;
    }

    #lp-mobile-menu-panel .lp-mobile-menu-list ul {
        padding: 0 0 6px 14px;
    }

    #lp-mobile-menu-panel .lp-mobile-menu-list ul a {
        font-size: 15px;
        font-weight: 400;
        padding: 6px 4px;
    }

    #lp-mobile-menu-panel .lp-mobile-language {
        border-top: 0;
        margin-top: 0;
        padding-top: 16px;
    }

    #lp-mobile-menu-panel .lp-mobile-language a {
        color: #1a3e49;
        display: inline-block;
        font-size: 16px;
        font-weight: 600;
        text-decoration: none;
    }

    #lp-mobile-sticky {
        align-items: center;
        background: #fff;
        box-shadow: 0 2px 10px rgba(0, 0, 0, .12);
        box-sizing: border-box;
        display: flex;
        height: 56px;
        justify-content: space-between;
        left: 0;
        opacity: 0;
        padding: 5px 12px 5px 16px;
        pointer-events: none;
        position: fixed;
        right: 0;
        top: 0;
        transform: translateY(-100%);
        transition: opacity .18s ease, transform .18s ease;
        width: 100%;
        z-index: 9999;
    }

    body.admin-bar #lp-mobile-sticky {
        top: 46px;
    }

    body.lp-mobile-sticky-active #lp-mobile-sticky {
        opacity: 1;
        pointer-events: auto;
        transform: translateY(0);
    }

    #lp-mobile-sticky .lp-mobile-sticky-logo {
        align-items: center;
        display: flex;
        height: 40px;
    }

    #lp-mobile-sticky .lp-mobile-sticky-logo img {
        height: 36px;
        max-width: 190px;
        object-fit: contain;
        width: auto;
    }

    #lp-mobile-sticky .lp-mobile-menu-toggle {
        display: flex;
        position: static;
    }

    body.fixed-menu #main-menu,
    body.fixed-menu #sticky-menu-alias {
        position: static !important;
    }

    body.fixed-menu #sticky-menu-logo {
        display: none !important;
    }

}

/* 390 source: @media screen and (max-width: 719px) */
@media screen and (orientation: landscape) and (max-height: 500px) {

    #lp-mobile-header-toggle.lp-mobile-menu-toggle {
        right: -10px;
    }

    #lp-mobile-sticky .lp-mobile-menu-toggle {
        margin-right: 0;
    }

}

/* 390 source: @media screen and (max-width: 719px) */
@media screen and (orientation: landscape) and (max-height: 500px) {

    #lp-mobile-menu-panel .lp-mobile-language {
        border-top: 0;
        text-align: right;
    }

}

/* 2369: phone landscape must use the clean 390px header.
 * At widths above 719px U-Design re-enables the secondary utility bar;
 * suppress it inside the isolated low-height landscape phone mode. */
@media screen and (orientation: landscape) and (max-height: 500px) {
    #secondary-navigation-bar-wrapper {
        display: none !important;
    }
}

/* 2370: phone landscape uses the full available viewport width.
 * Keep the frozen portrait/tablet breakpoints untouched; this only neutralizes
 * U-Design's 720px wrapper/grid constraint in the isolated low-height landscape mode. */
@media screen and (orientation: landscape) and (max-height: 500px) {
    #wrapper-1,
    #wrapper-2,
    #wrapper-3 {
        width: 100% !important;
        max-width: none !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
    }

    #top-elements {
        width: 100% !important;
        max-width: none !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        transform: none !important;
    }

    #lp-mobile-header-toggle.lp-mobile-menu-toggle {
        right: 16px !important;
    }
}
