/* okitoki-v4 — site header: the mock-up's v-header frame + the current site's mega menu
 * and mobile panel (decided 2026-10-01).
 *
 * States (one header element; the mock-up's second #fixed-header is folded into a class)
 *   default        absolute and transparent over the hero, white text   (mock-up .v-header)
 *   .is-scrolled   fixed white bar sliding in once the hero is passed    (mock-up .v-header--fixed.is-visible)
 *   body.v-header-solid   pages without a hero: fixed white bar from the start
 *   body.v-header-teal    contacts: fixed teal bar, white text, in every state (2026-10-04)
 * Below 1200px: language left, logo centred, burger right, off-canvas panel (as on prod). */

.v-header {
    --v-header-fg: rgb(var(--v-color-white));
    --v-header-bg: rgba(var(--v-color-white), 0);
    --v-header-hover: rgba(var(--v-color-white), .15);
    --v-header-brand: rgb(var(--v-color-white));
    --v-header-pill-bg: rgb(var(--v-color-white));
    --v-header-pill-fg: rgb(var(--v-color-primary));
    position: absolute;
    inset: 0 0 auto 0;
    z-index: var(--v-z-header);
    display: flex;
    align-items: center;
    height: var(--v-header-height);
    background-color: var(--v-header-bg);
    border-bottom: 1px solid rgba(var(--v-color-border), 0);
    color: var(--v-header-fg);
    transition: background-color var(--v-duration) var(--v-timing),
                box-shadow var(--v-duration) var(--v-timing),
                border-color var(--v-duration) var(--v-timing),
                color var(--v-duration) var(--v-timing);
}
.v-header.is-scrolled,
.v-header-solid .v-header,
.v-header-teal .v-header {
    position: fixed;
}
.v-header.is-scrolled,
.v-header-solid .v-header {
    --v-header-fg: rgb(var(--v-color-text));
    --v-header-bg: rgb(var(--v-color-white));
    --v-header-hover: rgba(var(--v-color-text), .1);
    --v-header-brand: rgb(var(--v-color-primary));
    --v-header-pill-bg: rgb(var(--v-color-primary));
    --v-header-pill-fg: rgb(var(--v-color-white));
    border-bottom-color: rgb(var(--v-color-border));
    box-shadow: var(--v-shadow);
}
/* Contacts keeps its teal bar in every state; the frame stays the mock-up's. */
.v-header-teal .v-header,
.v-header-teal .v-header.is-scrolled {
    --v-header-fg: rgb(var(--v-color-white));
    --v-header-bg: rgb(var(--v-color-teal));
    --v-header-hover: rgba(var(--v-color-white), .15);
    --v-header-brand: rgb(var(--v-color-white));
    --v-header-pill-bg: rgb(var(--v-color-white));
    --v-header-pill-fg: rgb(var(--v-color-teal));
    border-bottom-color: transparent;
    box-shadow: none;
}
@keyframes v-header-in {
    from { opacity: 0; transform: translateY(-100%); }
    to   { opacity: 1; transform: none; }
}
@media (min-width: 1200px) {
    body:not(.v-header-solid):not(.v-header-teal) .v-header.is-scrolled {
        animation: v-header-in var(--v-duration-long) var(--v-timing);
    }
}
.admin-bar .v-header { top: var(--wp-admin--admin-bar--height, 32px); }

/* Pages without a hero keep their content clear of the fixed bar. */
.v-header-solid .v-site__main,
.v-header-teal .v-site__main { padding-top: var(--v-header-height); }

.v-header__row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--v-space-lg);
    height: 100%;
}
/* v4: the language button sits outside the 1140 container; below ~1300px it would cover
 * the last menu item (it does in the mock-up), so the row makes room for it. */
@media (min-width: 1200px) and (max-width: 1299.98px) {
    .v-header__row { padding-right: 60px; }
}

/* ---------- Logo: cloud mark + brand name in the site font (mock-up) ---------- */
.v-header__logo {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    gap: var(--v-space-sm);
    color: var(--v-header-brand);
    text-decoration: none;
}
.v-header__logo-image { display: block; line-height: 0; }
.v-header__logo-image svg { display: block; width: auto; height: 32px; }
.v-header__logo-title {
    font-size: 18px;
    font-weight: var(--v-font-weight-semibold);
    line-height: 1.6;
    text-transform: uppercase;
}

/* ---------- Desktop navigation ---------- */
.v-header__panel-wrap { display: flex; align-self: stretch; }
.v-header__nav { display: flex; }
.v-header__nav-list {
    display: flex;
    align-items: stretch;
    margin: 0;
    padding: 0;
    list-style: none;
}
/* Items are not positioned: the mega panel anchors to the header itself, full-width centred. */
.v-header__nav-item {
    display: flex;
    align-items: center;
}
.v-header__nav-link {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--v-space-xs);
    height: 32px;
    padding: 0 var(--v-space-sm);
    border-radius: var(--v-radius);
    color: var(--v-header-fg);
    white-space: nowrap;
    text-decoration: none;
    transition: background-color var(--v-duration) var(--v-timing), color var(--v-duration) var(--v-timing);
}
/* Parent labels without a URL render as <a> with no href: keep the hand, not the I-beam. */
.v-header__nav-link:not([href]) { cursor: pointer; }
.v-header__nav-link:hover,
.v-header__nav-item.is-open > .v-header__nav-link {
    background-color: var(--v-header-hover);
}
.v-header__nav-item.is-current > .v-header__nav-link {
    text-decoration: underline;
    text-underline-offset: 6px;
    text-decoration-thickness: 1px;
}
/* Parent item: label + caret read as one control, like the mock-up's link-with-arrow. */
.v-header__nav-item--parent > .v-header__nav-link {
    padding-right: 32px;
}
.v-header__nav-toggle {
    position: relative;
    z-index: 1;
    display: flex;
    margin: 0 8px 0 -28px;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    padding: 0;
    border: 0;
    border-radius: var(--v-radius-sm);
    background: transparent;
    color: var(--v-header-fg);
}
.v-header__nav-toggle .v-icon {
    width: 16px;
    height: 16px;
    transition: transform var(--v-duration) var(--v-timing);
}
.v-header__nav-item.is-open > .v-header__nav-toggle .v-icon {
    transform: rotate(180deg);
}

/* Login stays a plain link; the last button-class item (Registration) is the mock-up's pill. */
.v-header__nav-item--button:last-child .v-header__nav-link--button {
    margin-left: var(--v-space-sm);
    border-radius: var(--v-radius-lg);
    background-color: var(--v-header-pill-bg);
    color: var(--v-header-pill-fg);
}
.v-header__nav-item--button:last-child .v-header__nav-link--button:hover {
    background-color: rgb(var(--v-color-accent));
    color: rgb(var(--v-color-white));
}

/* ---------- Mega panel (product cards) ---------- */
.v-header__panel {
    position: absolute;
    top: var(--v-header-height); /* from the bar's top edge: clears its 1px bottom border */
    left: 50%;
    width: min(1310px, calc(100vw - 30px));
    max-height: calc(100dvh - var(--v-header-height) - 15px);
    overflow-y: auto;
    overscroll-behavior: contain;
    transform: translateX(-50%);
    border-radius: 0 0 var(--v-radius-lg) var(--v-radius-lg);
    background: rgb(var(--v-color-white));
    box-shadow: var(--v-shadow);
    color: rgb(var(--v-color-text));
    visibility: hidden;
    opacity: 0;
    transition: opacity var(--v-duration) var(--v-timing), visibility 0s linear var(--v-duration);
}
.v-header__nav-item.is-open > .v-header__panel {
    visibility: visible;
    opacity: 1;
    transition: opacity var(--v-duration) var(--v-timing);
}
.v-header__panel-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: var(--v-space-sm);
    margin: 0;
    padding: var(--v-space-md);
    list-style: none;
}
.v-header__card-link {
    display: block;
    height: 100%;
    padding: var(--v-space-md);
    border-radius: var(--v-radius);
    color: inherit;
    text-decoration: none;
    transition: background-color var(--v-duration) var(--v-timing);
}
.v-header__card-link:hover,
.v-header__card-link:focus-visible {
    background-color: rgb(var(--v-color-surface-contrast));
}
.v-header__card-img {
    display: block;
    width: 100%;
    height: auto;
    margin-bottom: var(--v-space-sm);
}
.v-header__card-title {
    display: block;
    font-weight: var(--v-font-weight-semibold);
    line-height: var(--v-font-line-height-heading);
    text-transform: uppercase;
}
.v-header__card-link:hover .v-header__card-title {
    color: rgb(var(--v-color-primary));
}
.v-header__card-desc {
    display: block;
    margin-top: var(--v-space-xs);
    color: rgb(var(--v-color-text-secondary));
    font-size: var(--v-font-size-sm);
}

/* ---------- Language switcher: pinned to the bar's right edge, outside the container (mock-up) ---------- */
.v-header__lang {
    position: absolute;
    top: 50%;
    right: var(--v-space);
    transform: translateY(-50%);
}
.v-lang { position: relative; }
.v-lang__toggle {
    display: flex;
    align-items: center;
    gap: var(--v-space-xs);
    height: 32px;
    padding: 0 var(--v-space-sm);
    border: 0;
    border-radius: var(--v-radius);
    background: transparent;
    color: var(--v-header-fg);
    font-size: var(--v-font-size-md);
    text-transform: uppercase;
    transition: background-color var(--v-duration) var(--v-timing);
}
.v-lang__toggle .v-icon {
    width: 16px;
    height: 16px;
    margin-right: -2px;
    transition: transform var(--v-duration) var(--v-timing);
}
.v-lang__toggle[aria-expanded="true"] .v-icon { transform: rotate(180deg); }
.v-lang__toggle:hover,
.v-lang__toggle[aria-expanded="true"] { background-color: var(--v-header-hover); }
.v-lang__list {
    position: absolute;
    top: calc(100% + var(--v-space-xs));
    right: 0;
    min-width: 72px;
    margin: 0;
    padding: var(--v-space-xs);
    border-radius: var(--v-radius);
    background: rgb(var(--v-color-white));
    box-shadow: var(--v-shadow);
    list-style: none;
    visibility: hidden;
    opacity: 0;
    transition: opacity var(--v-duration) var(--v-timing), visibility 0s linear var(--v-duration);
}
.v-lang__toggle[aria-expanded="true"] + .v-lang__list {
    visibility: visible;
    opacity: 1;
    transition: opacity var(--v-duration) var(--v-timing);
}
.v-lang__link {
    display: block;
    padding: var(--v-space-xs) var(--v-space-sm);
    border-radius: var(--v-radius-sm);
    color: rgb(var(--v-color-text));
    text-transform: uppercase;
}
.v-lang__link:hover,
.v-lang__link:focus-visible { background-color: rgb(var(--v-color-surface-contrast)); }

/* ---------- Burger + drawer backdrop ---------- */
.v-header__burger,
.v-header__backdrop { display: none; }

/* ---------- Below 1200px: mobile bar + off-canvas panel (prod behaviour) ---------- */
@media (max-width: 1199.98px) {
    .v-header,
    .v-header.is-scrolled,
    .v-header-solid .v-header {
        position: fixed;
        --v-header-fg: rgb(var(--v-color-white));
        --v-header-bg: rgb(var(--v-color-primary));
        --v-header-hover: rgba(var(--v-color-white), .15);
        --v-header-brand: rgb(var(--v-color-white));
        --v-header-pill-bg: rgb(var(--v-color-white));
        --v-header-pill-fg: rgb(var(--v-color-primary));
        border-bottom-color: transparent;
        box-shadow: none;
    }
    .v-header-teal .v-header {
        --v-header-bg: rgb(var(--v-color-teal));
        --v-header-pill-fg: rgb(var(--v-color-teal));
    }
    .v-header__row { gap: var(--v-space-sm); }
    .v-header__lang { position: static; order: -1; flex: 0 0 64px; transform: none; }
    .v-header__lang .v-lang__list { right: auto; left: 0; }
    .v-header__logo { flex: 1 1 auto; justify-content: center; }

    .v-header__backdrop { display: block; }
    .v-header__burger {
        position: relative;
        z-index: 2;
        display: flex;
        flex: 0 0 64px;
        flex-direction: column;
        justify-content: space-between;
        align-items: flex-end;
        height: 22px;
        padding: 0;
        border: 0;
        background: transparent;
        color: inherit;
    }
    .v-header__burger span:not(.screen-reader-text) {
        display: block;
        width: 34px;
        height: 3px;
        border-radius: 2px;
        background: currentColor;
        transition: transform var(--v-duration) var(--v-timing), opacity var(--v-duration) var(--v-timing);
    }
    .v-header__burger[aria-expanded="true"] span:nth-child(1) { transform: translateY(9.5px) rotate(45deg); }
    .v-header__burger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
    .v-header__burger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-9.5px) rotate(-45deg); }

    /* Drawer from the right: 40% of the screen, never narrower than 300px (phones) so the
     * labels and product cards still fit; the page behind is dimmed, a tap on it closes. */
    .v-header__panel-wrap {
        position: fixed;
        top: var(--v-header-height);
        right: 0;
        bottom: 0;
        z-index: 1;
        display: block;
        width: min(100vw, max(300px, 40vw));
        overflow-y: auto;
        overscroll-behavior: contain;
        background: var(--v-header-bg);
        box-shadow: -12px 0 32px rgba(var(--v-color-black), .18);
        transform: translateX(100%);
        transition: transform var(--v-duration-long) var(--v-timing);
    }
    .v-header__panel-wrap.is-open { transform: translateX(0); }
    .v-header__backdrop {
        position: fixed;
        inset: var(--v-header-height) 0 0 0;
        background: rgba(var(--v-color-black), .45);
        opacity: 0;
        visibility: hidden;
        transition: opacity var(--v-duration-long) var(--v-timing), visibility 0s linear var(--v-duration-long);
    }
    html.v-nav-open .v-header__backdrop {
        opacity: 1;
        visibility: visible;
        transition: opacity var(--v-duration-long) var(--v-timing);
    }
    .v-header__nav { padding: var(--v-space-md) var(--v-space-md) var(--v-space-xl); }
    .v-header__nav-list { flex-direction: column; align-items: stretch; gap: 0; }
    .v-header__nav-item { position: relative; flex-wrap: wrap; justify-content: center; }
    .v-header__nav-link { justify-content: center; width: 100%; height: 44px; border-radius: 0; }
    /* Label and caret sit side by side, centred together, with a fixed gap. */
    .v-header__nav-item--parent > .v-header__nav-link { width: auto; padding-right: 0; }
    .v-header__nav-toggle { position: static; width: 36px; height: 44px; margin: 0; }
    .v-header__nav-item--button { padding: var(--v-space-xs) var(--v-space-lg); }
    .v-header__nav-link--button,
    .v-header__nav-item--button:last-child .v-header__nav-link--button {
        justify-content: center;
        width: 100%;
        height: 42px;
        margin: 0;
        border-radius: var(--v-radius-lg);
        box-shadow: inset 0 0 0 1px currentColor;
    }
    .v-header__nav-item--button:last-child .v-header__nav-link--button { box-shadow: none; }

    .v-header__panel {
        position: static;
        display: none;
        width: 100%;
        max-height: none;
        transform: none;
        border-radius: 0;
        box-shadow: none;
        visibility: visible;
        opacity: 1;
    }
    .v-header__nav-item.is-open > .v-header__panel { display: block; }
    .v-header__panel-grid { grid-template-columns: 1fr; padding: var(--v-space-xs); }
    .v-header__card-link { text-align: center; }
    .v-header__card-img { width: 160px; margin-inline: auto; }

    html.v-nav-open,
    html.v-nav-open body { overflow: hidden; }
}

