/*
 * Desktop site header (templates/site-header-desktop.php). Hidden below 1024px, where
 * templates/mobile-header.php takes over.
 *
 * Tweak colours, fonts and sizes with the variables below.
 */
.ofh {
    --ofh-font: Lato, Arial, Helvetica, sans-serif;
    --ofh-ink: #1c1c1a;          /* text, icons, dropdown top border */
    --ofh-ink-soft: #55534e;     /* utility strip text */
    --ofh-line: #e9e5de;         /* hairlines */
    --ofh-paper: #fff;
    --ofh-paper-warm: #f6f3ee;   /* utility strip background */
    --ofh-accent: #0063A8;       /* cart count badge (Offenbachers blue) */
    --ofh-announce-bg: #1c1c1a;
    --ofh-announce-ink: #f3efe8;
    --ofh-main-height: 92px;
    --ofh-wrap: 1560px;
    --ofh-gutter: clamp(24px, 3vw, 48px);
    --ofh-ease: cubic-bezier(0.4, 0, 0.2, 1);

    display: none;
    font-family: var(--ofh-font);
    -webkit-font-smoothing: antialiased;
}

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

    .ofh {
        display: contents; /* lets .ofh-sticky stick against the whole page */
    }

    .ofh *,
    .ofh *::before,
    .ofh *::after {
        box-sizing: border-box;
    }

    .ofh ul,
    .ofh li {
        margin: 0;
        padding: 0;
        list-style: none;
    }

    .ofh .ofh-icon,
    .ofh .ofh-util__drop > button,
    .ofh .ofh-search__submit,
    .ofh .ofh-search__close {
        all: unset;
        box-sizing: border-box;
        margin: 0 !important; /* parent theme: button { margin: 10px 0 40px !important } */
        cursor: pointer;
    }

    .ofh :focus-visible {
        outline: 2px solid var(--ofh-ink);
        outline-offset: 3px;
    }

    .ofh svg {
        fill: none;
        stroke: currentColor;
        stroke-width: 1.5;
        stroke-linecap: round;
        stroke-linejoin: round;
    }

    .ofh .ofh-wrap {
        max-width: var(--ofh-wrap);
        margin: 0 auto;
        padding: 0 var(--ofh-gutter);
    }

    /* ---- announcement bar ---- */

    .ofh .ofh-announce {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 10px;
        height: 38px;
        padding: 0 var(--ofh-gutter);
        background: var(--ofh-announce-bg);
        color: var(--ofh-announce-ink) !important;
        font-size: 12px;
        font-weight: 400;
        letter-spacing: 0.2em;
        text-transform: uppercase;
        text-decoration: none !important;
    }

    .ofh .ofh-announce span {
        background: linear-gradient(currentColor, currentColor) 0 100% / 100% 1px no-repeat;
        padding-bottom: 2px;
    }

    .ofh .ofh-announce__arrow {
        width: 16px;
        height: 16px;
        transition: transform 0.35s var(--ofh-ease);
    }

    .ofh .ofh-announce:hover .ofh-announce__arrow {
        transform: translateX(5px);
    }

    /* ---- sticky block: hides on scroll down, returns on scroll up (js/site-header.js) ---- */

    .ofh .ofh-sticky {
        position: sticky;
        top: 0;
        z-index: 9990;
        transition: transform 0.45s var(--ofh-ease);
    }

    body.admin-bar .ofh .ofh-sticky {
        top: 32px;
    }

    .ofh .ofh-sticky.is-hidden {
        transform: translateY(-100%);
    }

    /* ---- main bar ---- */

    .ofh .ofh-main {
        position: relative;
        z-index: 2;
        background: var(--ofh-paper);
        border-bottom: 1px solid var(--ofh-line);
        transition: box-shadow 0.3s ease;
    }

    .ofh .ofh-sticky.is-stuck .ofh-main {
        box-shadow: 0 6px 24px rgba(28, 28, 26, 0.08);
    }

    .ofh .ofh-main__inner {
        display: flex;
        align-items: stretch;
        height: var(--ofh-main-height);
        gap: 24px;
    }

    .ofh .ofh-logo {
        display: flex;
        align-items: center;
        flex: none;
        color: var(--ofh-ink) !important;
        text-decoration: none !important;
    }

    .ofh .ofh-logo img {
        display: block;
        width: auto;
        height: 74px; /* source file is 233x138 */
        max-width: none;
        transition: opacity 0.2s ease;
    }

    .ofh .ofh-logo:hover img {
        opacity: 0.85;
    }

    /* ---- main menu ---- */

    .ofh .ofh-nav {
        flex: 1;
        display: flex;
        justify-content: center;
        min-width: 0;
    }

    .ofh .ofh-menu {
        display: flex;
        align-items: stretch;
        gap: clamp(14px, 2.1vw, 40px);
    }

    .ofh .ofh-menu > li {
        position: relative;
        display: flex;
        align-items: center;
    }

    .ofh .ofh-menu > li > a {
        position: relative;
        padding: 8px 0;
        color: var(--ofh-ink) !important;
        font-size: 14px;
        font-weight: 400;
        letter-spacing: 0.14em;
        line-height: 1;
        text-transform: uppercase;
        text-decoration: none !important;
        white-space: nowrap;
    }

    /* underline draws in from the left, leaves to the right */
    .ofh .ofh-menu > li > a::after {
        content: "";
        position: absolute;
        left: 0;
        right: 0.14em; /* trailing letter-spacing */
        bottom: 0;
        height: 1px;
        background: currentColor;
        transform: scaleX(0);
        transform-origin: right center;
        transition: transform 0.4s var(--ofh-ease);
    }

    .ofh .ofh-menu > li:hover > a::after,
    .ofh .ofh-menu > li:focus-within > a::after,
    .ofh .ofh-menu > li.current-menu-item > a::after,
    .ofh .ofh-menu > li.current-menu-ancestor > a::after {
        transform: scaleX(1);
        transform-origin: left center;
    }

    /* ---- dropdown panels ---- */

    .ofh .ofh-menu .sub-menu {
        position: absolute;
        z-index: 10;
        min-width: 250px;
        padding: 16px 0;
        background: var(--ofh-paper);
        border: 1px solid var(--ofh-line);
        border-top: 2px solid var(--ofh-ink);
        box-shadow: 0 18px 40px rgba(28, 28, 26, 0.1);

        visibility: hidden;
        opacity: 0;
        translate: 0 8px;
        /* short delay before closing so diagonal mouse moves don't snap menus shut */
        transition: opacity 0.2s ease 0.1s, translate 0.2s ease 0.1s, visibility 0s linear 0.3s;
    }

    /* first level: flush with the bottom of the bar, row text lined up under the top link */
    .ofh .ofh-menu > li > .sub-menu {
        top: 100%;
        left: -25px;
        margin-top: 1px; /* main bar bottom border */
    }

    .ofh .ofh-menu > li > .sub-menu.opens-left {
        left: auto;
        right: -25px;
    }

    /* deeper levels fly out to the side, first row lined up with the parent row */
    .ofh .ofh-menu .sub-menu .sub-menu {
        top: -18px;
        left: 100%;
        translate: 8px 0;
    }

    .ofh .ofh-menu .sub-menu .sub-menu.opens-left {
        left: auto;
        right: 100%;
        translate: -8px 0;
    }

    .ofh .ofh-menu li:hover > .sub-menu,
    .ofh .ofh-menu li:focus-within > .sub-menu {
        visibility: visible;
        opacity: 1;
        translate: 0 0;
        z-index: 11;
        transition: opacity 0.25s ease, translate 0.25s ease, visibility 0s;
    }

    .ofh .ofh-menu .sub-menu li {
        position: relative;
    }

    /* rows cascade in top to bottom once a panel opens; --i (row index) is set in js/site-header.js */
    .ofh .ofh-menu .sub-menu > li,
    .ofh .ofh-util__panel > li {
        opacity: 0;
        translate: 0 6px;
        transition: opacity 0.15s ease, translate 0.15s ease;
    }

    .ofh .ofh-menu li:hover > .sub-menu > li,
    .ofh .ofh-menu li:focus-within > .sub-menu > li,
    .ofh .ofh-util__drop:hover .ofh-util__panel > li,
    .ofh .ofh-util__drop:focus-within .ofh-util__panel > li {
        opacity: 1;
        translate: none;
        transition: opacity 0.3s ease, translate 0.3s ease;
        transition-delay: calc(0.05s + var(--i, 0) * 0.1s);
    }

    .ofh .ofh-menu .sub-menu a {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 24px;
        padding: 9px 24px;
        color: var(--ofh-ink) !important;
        font-size: 15px;
        font-weight: 400;
        letter-spacing: 0.01em;
        line-height: 1.4;
        white-space: nowrap;
        text-decoration: underline;
        text-decoration-color: transparent;
        text-decoration-thickness: 1px;
        text-underline-offset: 5px;
        transition: text-decoration-color 0.2s ease;
    }

    .ofh .ofh-menu .sub-menu li:hover > a,
    .ofh .ofh-menu .sub-menu a:focus-visible {
        text-decoration-color: currentColor;
    }

    /* "LOUNGING", "SHOP BY BRAND"... are labels in the WP menu (href="#") */
    .ofh .ofh-menu .sub-menu li.disabled > a {
        cursor: default;
        font-size: 13px;
        letter-spacing: 0.12em;
    }

    /* Contrast Therapy sits apart at the bottom of its panel */
    .ofh .ofh-menu .sub-menu li.contrast-therapy {
        margin-top: 10px;
        padding-top: 10px;
        border-top: 1px solid var(--ofh-line);
    }

    /* brand logos from the Menu Image plugin: show the name instead, like the other rows */
    .ofh .ofh-menu .sub-menu img.menu-image {
        display: none !important;
    }

    .ofh .ofh-menu .sub-menu .menu-image-title {
        display: inline !important;
        position: static !important;
        visibility: visible !important;
        clip: auto !important;
        width: auto !important;
        height: auto !important;
        opacity: 1 !important;
    }

    /* chevron on rows that open a flyout */
    .ofh .ofh-menu .sub-menu li.menu-item-has-children > a::after {
        content: "";
        flex: none;
        width: 6px;
        height: 6px;
        border-right: 1px solid currentColor;
        border-bottom: 1px solid currentColor;
        opacity: 0.5;
        transform: rotate(-45deg);
        transition: transform 0.25s var(--ofh-ease), opacity 0.2s ease;
    }

    .ofh .ofh-menu .sub-menu li.menu-item-has-children:hover > a::after {
        opacity: 1;
        transform: translateX(3px) rotate(-45deg);
    }

    .ofh .ofh-menu .sub-menu li.menu-item-has-children.opens-left > a::after {
        transform: rotate(135deg);
    }

    .ofh .ofh-menu .sub-menu li.menu-item-has-children.opens-left:hover > a::after {
        transform: translateX(-3px) rotate(135deg);
    }

    /* ---- icons ---- */

    .ofh .ofh-icons {
        display: flex;
        align-items: center;
        flex: none;
        gap: 6px;
    }

    .ofh .ofh-icon {
        position: relative;
        display: grid;
        place-items: center;
        width: 40px;
        height: 40px;
        border-radius: 50%;
        color: var(--ofh-ink) !important;
        transition: background-color 0.2s ease;
    }

    .ofh .ofh-icon:hover,
    .ofh .ofh-search-toggle[aria-expanded="true"] {
        background-color: var(--ofh-paper-warm);
    }

    .ofh .ofh-icon svg {
        width: 23px;
        height: 23px;
    }

    .ofh .ofh-cart__count {
        position: absolute;
        top: 3px;
        right: 1px;
        min-width: 17px;
        height: 17px;
        padding: 0 4px;
        border-radius: 9px;
        background: var(--ofh-accent);
        color: #fff;
        font-size: 10px;
        font-weight: 700;
        line-height: 17px;
        text-align: center;
    }

    .ofh .ofh-cart__count.is-empty {
        display: none;
    }

    /* ---- search panel (drops down from the main bar) ---- */

    .ofh .ofh-search {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--ofh-paper);
        border-bottom: 1px solid var(--ofh-line);
        box-shadow: 0 18px 40px rgba(28, 28, 26, 0.08);
        opacity: 0;
        translate: 0 -10px;
        transition: opacity 0.25s ease, translate 0.3s var(--ofh-ease);
    }

    .ofh .ofh-search[hidden] {
        display: block;
        visibility: hidden;
        pointer-events: none;
    }

    .ofh .ofh-search.is-open {
        opacity: 1;
        translate: 0 0;
    }

    .ofh .ofh-search__form {
        display: flex;
        align-items: center;
        gap: 16px;
        height: 84px;
        margin: 0 auto !important;
    }

    .ofh .ofh-search__form > svg {
        flex: none;
        width: 24px;
        height: 24px;
        color: var(--ofh-ink);
    }

    .ofh .ofh-search__form input[type="search"] {
        flex: 1;
        height: 48px;
        margin: 0;
        padding: 0;
        border: 0;
        border-bottom: 1px solid var(--ofh-line);
        border-radius: 0;
        background: none;
        box-shadow: none;
        color: var(--ofh-ink);
        font-family: var(--ofh-font);
        font-size: 22px;
        font-weight: 400;
        transition: border-color 0.2s ease;
    }

    .ofh .ofh-search__form input[type="search"]:focus {
        outline: none;
        border-bottom-color: var(--ofh-ink);
    }

    .ofh .ofh-search__form input[type="search"]::placeholder {
        color: #9a968e;
    }

    .ofh .ofh-search__submit {
        padding: 13px 26px;
        background: var(--ofh-ink);
        color: #fff;
        font-size: 12px;
        font-weight: 700;
        letter-spacing: 0.16em;
        text-transform: uppercase;
        transition: background-color 0.2s ease;
    }

    .ofh .ofh-search__submit:hover {
        background: #3a3934;
    }

    .ofh .ofh-search__close {
        display: grid;
        place-items: center;
        width: 40px;
        height: 40px;
        color: var(--ofh-ink) !important; /* parent theme forces white button text */
    }

    .ofh .ofh-search__close svg {
        width: 22px;
        height: 22px;
        transition: transform 0.3s var(--ofh-ease);
    }

    .ofh .ofh-search__close:hover svg {
        transform: rotate(90deg);
    }

    /* ---- utility strip (slides up under the main bar once the page is scrolled) ---- */

    .ofh .ofh-util {
        position: relative;
        z-index: 1;
        background: var(--ofh-paper-warm);
        border-bottom: 1px solid var(--ofh-line);
        transition: transform 0.35s var(--ofh-ease), opacity 0.25s ease;
    }

    .ofh .ofh-sticky.is-stuck .ofh-util {
        transform: translateY(-100%);
        opacity: 0;
        pointer-events: none;
    }

    .ofh .ofh-util__inner {
        display: flex;
        align-items: center;
        justify-content: space-between;
        height: 40px;
    }

    .ofh .ofh-util__list {
        display: flex;
        align-items: center;
        height: 100%;
    }

    .ofh .ofh-util__list > li {
        display: flex;
        align-items: center;
        height: 100%;
    }

    .ofh .ofh-util__list > li + li::before {
        content: "";
        width: 1px;
        height: 12px;
        margin: 0 16px;
        background: #c9c4ba;
    }

    .ofh .ofh-util a,
    .ofh .ofh-util__drop > button {
        color: var(--ofh-ink-soft) !important;
        font-family: var(--ofh-font);
        font-size: 12px;
        font-weight: 400;
        letter-spacing: 0.14em;
        text-transform: uppercase;
        text-decoration: none !important;
        transition: color 0.2s ease;
    }

    .ofh .ofh-util a:hover,
    .ofh .ofh-util__drop:hover > button {
        color: var(--ofh-ink) !important;
    }

    .ofh .ofh-util__drop {
        position: relative;
        display: flex;
        align-items: center;
        height: 100%;
    }

    .ofh .ofh-util__drop > button {
        display: flex;
        align-items: center;
        gap: 8px;
        height: 100%;
    }

    .ofh .ofh-caret {
        width: 5px;
        height: 5px;
        border-right: 1px solid currentColor;
        border-bottom: 1px solid currentColor;
        transform: translateY(-2px) rotate(45deg);
        transition: transform 0.25s var(--ofh-ease);
    }

    .ofh .ofh-util__drop:hover .ofh-caret,
    .ofh .ofh-util__drop:focus-within .ofh-caret {
        transform: translateY(1px) rotate(225deg);
    }

    .ofh .ofh-util__panel {
        position: absolute;
        top: 100%;
        left: -24px;
        z-index: 10;
        min-width: 240px;
        padding: 12px 0;
        background: var(--ofh-paper);
        border: 1px solid var(--ofh-line);
        border-top: 2px solid var(--ofh-ink);
        box-shadow: 0 18px 40px rgba(28, 28, 26, 0.1);
        visibility: hidden;
        opacity: 0;
        translate: 0 8px;
        transition: opacity 0.2s ease 0.1s, translate 0.2s ease 0.1s, visibility 0s linear 0.3s;
    }

    .ofh .ofh-util__drop--right .ofh-util__panel {
        left: auto;
        right: -24px;
    }

    .ofh .ofh-util__drop:hover .ofh-util__panel,
    .ofh .ofh-util__drop:focus-within .ofh-util__panel {
        visibility: visible;
        opacity: 1;
        translate: 0 0;
        transition: opacity 0.25s ease, translate 0.25s ease, visibility 0s;
    }

    .ofh .ofh-util__panel a {
        display: block;
        padding: 9px 24px;
        color: var(--ofh-ink) !important;
        font-size: 14px;
        letter-spacing: 0.01em;
        line-height: 1.45;
        text-transform: none;
        white-space: nowrap;
    }

    .ofh .ofh-util__panel a:hover {
        background: var(--ofh-paper-warm);
    }

    .ofh .ofh-util__panel svg {
        display: none; /* icons baked into the old utility menu items */
    }
}

/* tighter fit for smaller laptops */
@media only screen and (min-width: 1024px) and (max-width: 1279px) {
    .ofh {
        --ofh-main-height: 80px;
        --ofh-gutter: 20px;
    }

    .ofh .ofh-logo img {
        height: 62px;
    }

    .ofh .ofh-menu {
        gap: 14px;
    }

    .ofh .ofh-menu > li > a {
        font-size: 12px;
        letter-spacing: 0.08em;
    }

    .ofh .ofh-icons {
        gap: 0;
    }

    .ofh .ofh-icon {
        width: 34px;
    }
}

@media only screen and (min-width: 1024px) and (prefers-reduced-motion: reduce) {
    .ofh *,
    .ofh *::before,
    .ofh *::after {
        transition-duration: 0.01ms !important;
        transition-delay: 0s !important;
        translate: none !important;
    }
}
