:root {
    --oe-bg: #faf5ea;
    --oe-text: #111111;
    --oe-text-secondary: #666666;
    --oe-border: #d9d6cf;
    --oe-navy: #000080;
    --oe-font-ui: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    --oe-header-height: 80px;
}

.oe-global-header,
.oe-global-header * {
    box-sizing: border-box;
}

.oe-global-header {
    position: relative;
    z-index: 10000;
    width: 100%;
    margin: 0;
    padding: 0;
    font-family: var(--oe-font-ui);
    color: #fff;
}

/* Replacement deliberately targets conventional theme headers, including Blocksy,
   without changing theme files. The OE header itself is excluded by ID/class. */
body.oe-global-header-replace header#header:not(#oe-global-header),
body.oe-global-header-replace .ct-header:not(.oe-global-header),
body.oe-global-header-replace [data-id="header"]:not(.oe-global-header) {
    display: none !important;
}

.oe-global-header__skip-link {
    position: fixed;
    top: 8px;
    left: 8px;
    z-index: 2147483647;
    padding: 10px 14px;
    background: var(--oe-bg);
    color: var(--oe-navy);
    border: 2px solid var(--oe-navy);
    transform: translateY(-150%);
}
.oe-global-header__skip-link:focus { transform: translateY(0); }

.oe-global-header__bar {
    min-height: var(--oe-header-height);
    margin: 0;
    padding: 0;
    background: var(--oe-navy);
}

.oe-global-header__inner {
    width: min(100% - 48px, 1840px);
    min-height: var(--oe-header-height);
    margin: 0 auto;
    display: grid;
    grid-template-columns: minmax(190px, 1fr) auto minmax(260px, 1fr);
    align-items: center;
    gap: 32px;
}

.oe-global-header__logo {
    justify-self: start;
    display: inline-flex;
    align-items: center;
    max-width: 176px;
    text-decoration: none;
    color: #fff;
}
.oe-global-header__logo-image {
    display: block;
    width: auto;
    height: auto;
    max-width: 176px;
    max-height: 52px;
    object-fit: contain;
}
.oe-global-header__logo--text {
    font: 600 21px/1 var(--oe-font-ui);
    letter-spacing: .01em;
}

.oe-global-header__desktop-nav { justify-self: center; }
.oe-global-header__menu {
    display: flex;
    align-items: center;
    gap: 42px;
    margin: 0;
    padding: 0;
    list-style: none;
}
.oe-global-header__menu li { position: relative; margin: 0; padding: 0; list-style: none; }
.oe-global-header__menu a,
.oe-global-header__utility-link,
.oe-global-header__languages a,
.oe-global-header__language-current {
    color: #fff;
    font: 500 15px/1.2 var(--oe-font-ui);
    text-decoration: none;
    white-space: nowrap;
}
.oe-global-header__menu > li > a,
.oe-global-header__utility-link {
    display: inline-flex;
    min-height: 44px;
    align-items: center;
}
.oe-global-header__menu a:hover,
.oe-global-header__menu a:focus-visible,
.oe-global-header__utility-link:hover,
.oe-global-header__utility-link:focus-visible,
.oe-global-header__languages a:hover,
.oe-global-header__languages a:focus-visible {
    text-decoration: underline;
    text-underline-offset: 4px;
}

.oe-global-header__menu > .menu-item-has-children > a::after {
    content: "";
    width: 7px;
    height: 7px;
    margin-left: 10px;
    border-right: 1.5px solid currentColor;
    border-bottom: 1.5px solid currentColor;
    transform: rotate(45deg) translateY(-2px);
}

.oe-global-header__menu .sub-menu {
    position: absolute;
    top: calc(100% + 14px);
    left: 50%;
    z-index: 10010;
    display: grid;
    grid-template-columns: repeat(2, minmax(150px, 1fr));
    gap: 0;
    min-width: 360px;
    margin: 0;
    padding: 12px 0;
    background: var(--oe-bg);
    border: 1px solid var(--oe-border);
    list-style: none;
    opacity: 0;
    visibility: hidden;
    transform: translate(-50%, 4px);
}
.oe-global-header__menu .sub-menu::before {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: -16px;
    height: 16px;
}
.oe-global-header__menu .sub-menu a {
    display: block;
    padding: 11px 18px;
    color: var(--oe-text);
    font-size: 14px;
    font-weight: 400;
}
.oe-global-header__menu .sub-menu a:hover,
.oe-global-header__menu .sub-menu a:focus-visible { color: var(--oe-navy); }
.oe-global-header__menu > .menu-item-has-children:hover > .sub-menu,
.oe-global-header__menu > .menu-item-has-children:focus-within > .sub-menu,
.oe-global-header__menu > .menu-item-has-children.oe-submenu-open > .sub-menu {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, 0);
}

.oe-global-header__desktop-utilities {
    justify-self: end;
    display: flex;
    align-items: center;
    gap: 28px;
}
.oe-global-header__languages { display: flex; align-items: center; gap: 7px; }
.oe-global-header__language-current { opacity: .72; }
.oe-global-header__language-separator { opacity: .5; }

.oe-global-header__icon-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 0;
    background: transparent;
    color: #fff;
    border: 0;
    border-radius: 0;
    cursor: pointer;
}
.oe-global-header__icon-button:hover { background: rgba(255,255,255,.08); }
.oe-global-header__icon-button:focus-visible,
.oe-global-header a:focus-visible,
.oe-global-header input:focus-visible,
.oe-global-header button:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 3px;
}
.oe-global-header__search-panel input:focus-visible,
.oe-global-header__search-panel button:focus-visible,
.oe-global-header__mobile-panel a:focus-visible { outline-color: var(--oe-navy); }

.oe-global-header__icon { display: inline-flex; width: 22px; height: 22px; }
.oe-global-header__icon svg { width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.oe-global-header__icon--close { display: none; }
.oe-global-header__icon-button[aria-expanded="true"] .oe-global-header__icon--search,
.oe-global-header__icon-button[aria-expanded="true"] .oe-global-header__icon--menu { display: none; }
.oe-global-header__icon-button[aria-expanded="true"] .oe-global-header__icon--close { display: inline-flex; }

.oe-global-header__search-panel {
    background: var(--oe-bg);
    color: var(--oe-text);
    border-bottom: 1px solid var(--oe-border);
}
.oe-global-header__search-panel[hidden],
.oe-global-header__mobile-panel[hidden] { display: none !important; }
.oe-global-header__search-form {
    width: min(100% - 48px, 1000px);
    margin: 0 auto;
    padding: 28px 0 32px;
}
.oe-global-header__search-form label {
    display: block;
    margin: 0 0 10px;
    font: 600 14px/1.3 var(--oe-font-ui);
    color: var(--oe-text);
}
.oe-global-header__search-row { display: grid; grid-template-columns: 1fr auto; }
.oe-global-header__search-row input[type="search"] {
    min-width: 0;
    height: 48px;
    padding: 0 14px;
    border: 2px solid var(--oe-border);
    border-right: 0;
    border-radius: 0;
    background: transparent;
    color: var(--oe-text);
    font: 400 16px/1.2 var(--oe-font-ui);
    -webkit-appearance: none;
}
.oe-global-header__search-row button {
    min-width: 112px;
    height: 48px;
    padding: 0 20px;
    border: 2px solid var(--oe-navy);
    border-radius: 0;
    background: var(--oe-navy);
    color: #fff;
    font: 600 15px/1 var(--oe-font-ui);
    cursor: pointer;
}

.oe-global-header__mobile-actions,
.oe-global-header__mobile-panel { display: none; }

@media (max-width: 1100px) {
    .oe-global-header__inner { grid-template-columns: minmax(170px,1fr) auto minmax(235px,1fr); gap: 22px; }
    .oe-global-header__menu { gap: 27px; }
    .oe-global-header__desktop-utilities { gap: 18px; }
    .oe-global-header__menu a,
    .oe-global-header__utility-link,
    .oe-global-header__languages a,
    .oe-global-header__language-current { font-size: 15px; }
}

@media (max-width: 900px) {
    :root { --oe-header-height: 64px; }
    .oe-global-header__inner {
        width: min(100% - 32px, 1200px);
        grid-template-columns: 1fr auto;
        gap: 20px;
    }
    .oe-global-header__logo { max-width: 150px; }
    .oe-global-header__logo-image { max-width: 150px; max-height: 43px; }
    .oe-global-header__desktop-nav,
    .oe-global-header__desktop-utilities { display: none; }
    .oe-global-header__mobile-actions { display: flex; align-items: center; gap: 2px; }
    .oe-global-header__mobile-panel {
        background: var(--oe-bg);
        color: var(--oe-text);
        border-bottom: 1px solid var(--oe-border);
        padding: 10px 24px 22px;
    }
    .oe-global-header__mobile-panel:not([hidden]) { display: block; }
    .oe-global-header__mobile-panel .oe-global-header__menu {
        display: block;
        margin: 0;
    }
    .oe-global-header__mobile-panel .oe-global-header__menu > li { border-bottom: 1px solid var(--oe-border); }
    .oe-global-header__mobile-panel .oe-global-header__menu > li > a {
        width: 100%;
        min-height: 48px;
        color: var(--oe-text);
        font-size: 15px !important;
        font-weight: 500 !important;
        line-height: 1.25;
        justify-content: space-between;
    }
    .oe-global-header__mobile-panel .oe-global-header__menu > .menu-item-has-children > a::after { border-color: currentColor; }
    .oe-global-header__mobile-panel .oe-global-header__menu .sub-menu {
        position: static;
        display: none;
        grid-template-columns: 1fr;
        min-width: 0;
        padding: 0 0 12px 16px;
        border: 0;
        background: transparent;
        opacity: 1;
        visibility: visible;
        transform: none;
    }
    .oe-global-header__mobile-panel .oe-global-header__menu .sub-menu::before { display: none; }
    .oe-global-header__mobile-panel .oe-global-header__menu .oe-submenu-open > .sub-menu { display: grid; }
    .oe-global-header__mobile-panel .oe-global-header__menu .sub-menu a {
        padding: 8px 0;
        color: var(--oe-text);
        font-size: 15px !important;
        font-weight: 400 !important;
        line-height: 1.35;
    }
    .oe-global-header__mobile-utilities {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 24px;
        padding-top: 18px;
    }
    .oe-global-header__mobile-utilities .oe-global-header__utility-link,
    .oe-global-header__mobile-utilities .oe-global-header__languages a,
    .oe-global-header__mobile-utilities .oe-global-header__language-current {
        color: var(--oe-text);
        font-size: 15px !important;
        font-weight: 500 !important;
        line-height: 1.25;
    }
    .oe-global-header__mobile-utilities .oe-global-header__language-separator { color: var(--oe-text-secondary); }
    .oe-global-header__search-form { width: min(100% - 32px, 1000px); padding: 18px 0 22px; }
}

@media (max-width: 520px) {
    .oe-global-header__inner { width: calc(100% - 24px); }
    .oe-global-header__logo { max-width: 138px; }
    .oe-global-header__logo-image { max-width: 138px; }
    .oe-global-header__mobile-panel { padding-left: 16px; padding-right: 16px; }
    .oe-global-header__search-form { width: calc(100% - 32px); }
    .oe-global-header__search-row { grid-template-columns: 1fr; gap: 10px; }
    .oe-global-header__search-row input[type="search"] { border-right: 2px solid var(--oe-border); }
    .oe-global-header__search-row button { width: 100%; }
}
