/* ---------------------------------------------------------------------------
 * ck-desk-header-v1.css — the desktop header as three bands: a slim utility
 * strip, the brand row with a wide search, and a category rail under it.
 *
 * The shape is borrowed from the big marketplaces, not their marks: nothing here
 * carries another shop's name, logo or picture, and the colours stay China
 * Kanta's — brand red #e31e24 for the two things that already were red today
 * (the Shop pill and the search action) and neutral ink for everything else.
 *
 * WHY IT IS DONE WITH ORDERS AND `display: contents` INSTEAD OF NEW MARKUP
 * — every link the old desktop header carried is still the same element in the
 *   same blade, with the same `route()` calls and the same Alpine state. The
 *   mega panel in particular is 108 lines of hover-driven markup; copying it
 *   next door would have meant two panels, two `open` flags and one of them
 *   always wrong. So the DOM keeps its order (back, logo, nav, search, icons)
 *   and only the layout changes: the nav is given `order: 9` and a 100% basis,
 *   which drops it onto a second line below the row it was born inside.
 *
 * WHY EVERY RULE IS INSIDE THE lg QUERY AND BELOW `.ck-storefront`
 * — the phone and the Capacitor app render this same layout file. A phone held
 *   sideways at 1024px is the widest thing this can affect, and at that width
 *   the shopper is already being shown the desktop header by the blade's own
 *   `lg:flex`; nothing new appears for them, the row simply splits. Below the
 *   query breakpoint this file says nothing at all, so `ck-phone-header-v2.css`,
 *   `ck-header-tight-v1.css` and `mobile-nav-v7.css` keep the phone exactly as
 *   it was shipped. The `.ck-storefront` prefix is what lets these rules beat
 *   `ck-compact-v2.css`, which owns the same header at `.ck-storefront .x`.
 *
 * WHAT DELIBERATELY DID NOT COME ACROSS: the reference header shrinks to one
 * row once the shopper scrolls. Doing that here would change the height of an
 * element that is `sticky` but still in the flow, so the whole page would jump
 * by 40px the moment it triggered — the same reflow already reported once on
 * the phone home header. A tall sticky band costs a little content and takes
 * nothing away.
 */

/* Outside the query, on purpose, and the only rule in this file that is: the word inside the
   search action has to be switched off for phones before it can be switched on for desktops. The
   field's action is a 48px round door on a phone, and a word in it would push the magnifier out
   of the circle. `lg:inline` cannot do this job — the committed bundle was built before that
   variant was ever used, so the class exists in the markup and in no stylesheet. */
.ck-dsearch-go-word {
    display: none;
}

@media (min-width: 1024px) {

    .ck-storefront .ck-dsearch-go .ck-dsearch-go-word {
        display: inline;
    }

    /* — the utility strip ————————————————————————————————————————————————
       The trust line that was already there keeps its place at the left; the
       doors a shopper actually uses go to the right, which is where the old
       row-1 icons put them. `Sell on China Kanta` is the supplier sign-up, the
       one ask the strip has real inventory for. */
    .ck-storefront .ck-desk-utils {
        display: flex;
        align-items: center;
        gap: 14px;
        font-size: 11px;
        font-weight: 500;
        letter-spacing: .01em;
    }

    .ck-storefront .ck-desk-utils a {
        color: #fff;
        white-space: nowrap;
        opacity: .92;
        transition: opacity 120ms ease;
    }

    .ck-storefront .ck-desk-utils a:hover {
        opacity: 1;
        text-decoration: underline;
        text-underline-offset: 2px;
    }

    .ck-storefront .ck-desk-utils .ck-desk-utils-sep {
        color: rgba(255, 255, 255, .45);
    }

    .ck-storefront .ck-desk-utils a.is-here {
        opacity: 1;
        font-weight: 700;
    }

    /* The strip now carries two groups at the far edges, so the phrases stop
       being centred and one of them is the shortest sentence here. */
    .ck-storefront .ck-pdp-promo .ck-desk-promo-quiet {
        display: none;
    }

    /* — the brand row splits into two rows —————————————————————————————————
       `display: contents` removes the wrapper's own box, so its four children
       become items of the outer row and can share a wrapping line with the
       account/cart block that used to sit outside it. */
    .ck-storefront .ck-appbar .ck-desk-row {
        flex-wrap: wrap;
        padding-top: 12px;
        padding-bottom: 0;
        row-gap: 0;
    }

    .ck-storefront .ck-appbar .ck-desk-left {
        display: contents;
    }

    .ck-storefront .ck-appbar .ck-desk-logo {
        order: 2;
    }

    .ck-storefront .ck-appbar .ck-desk-search {
        order: 3;
        flex: 1 1 420px;
        min-width: 0;
        margin-inline: 26px;
    }

    .ck-storefront .ck-appbar .ck-desk-searchbox {
        max-width: 880px;
    }

    .ck-storefront .ck-appbar .ck-desk-side {
        order: 4;
    }

    /* — the rail ————————————————————————————————————————————————————————
       15 departments do not fit in one line next to the rest of the row, so
       the middle of the rail scrolls and only fades at both edges; the two
       doors that must always be reachable — All Categories and More — sit
       outside the scroller. */
    .ck-storefront .ck-appbar nav.ck-desk-nav {
        order: 9;
        display: flex;
        align-items: center;
        gap: 0;
        flex: 1 0 100%;
        min-width: 0;
        margin: 12px 0 0;
        padding: 0 0 7px;
        font-size: 13px;
        border-top: 1px solid #e9edf2;
    }

    .ck-storefront .ck-appbar nav.ck-desk-nav > :not(.ck-desk-rail) {
        flex: 0 0 auto;
    }

    /* All Categories: bordered, neutral, and the only thing in the row with a
       grid glyph, so it reads as "the whole list" rather than another link. */
    .ck-storefront .ck-appbar .ck-desk-cats {
        order: 1;
        margin-right: 14px;
    }

    .ck-storefront .ck-appbar .ck-desk-cats > button {
        display: flex;
        align-items: center;
        gap: 8px;
        height: 34px;
        padding: 0 13px;
        border: 1px solid #d7dbe0;
        border-radius: 9px;
        background: #fff;
        color: #111827;
        font-size: 13px;
        font-weight: 700;
        transition: border-color 120ms ease, color 120ms ease, background 120ms ease;
    }

    .ck-storefront .ck-appbar .ck-desk-cats > button:hover {
        border-color: #e31e24;
        color: #e31e24;
        background: #fff7f7;
    }

    /* the trigger's own underline classes come from the blade and are dropped
       here: the button is a box now, and a 2px rule inside a bordered box
       reads as a defect */
    .ck-storefront .ck-appbar .ck-desk-cats > button,
    .ck-storefront .ck-appbar .ck-desk-more > button {
        border-bottom-width: 1px;
    }

    .ck-storefront .ck-appbar .ck-desk-shop {
        order: 2;
        margin-right: 8px;
        padding: 7px 16px;
        font-size: 13px;
    }

    .ck-storefront .ck-appbar .ck-desk-rail {
        order: 3;
        flex: 1 1 auto;
        display: flex;
        align-items: center;
        gap: 2px;
        min-width: 0;
        overflow-x: auto;
        overflow-y: hidden;
        scrollbar-width: none;
        -ms-overflow-style: none;
    }

    .ck-storefront .ck-appbar .ck-desk-rail::-webkit-scrollbar {
        display: none;
    }

    .ck-storefront .ck-appbar .ck-desk-rail a {
        display: flex;
        align-items: center;
        height: 30px;
        padding: 0 11px;
        border-radius: 8px;
        color: #3f4753;
        font-weight: 500;
        white-space: nowrap;
        transition: color 120ms ease, background 120ms ease;
    }

    .ck-storefront .ck-appbar .ck-desk-rail a:hover {
        color: #e31e24;
        background: #f7f8fa;
    }

    .ck-storefront .ck-appbar .ck-desk-rail a.is-here {
        color: #e31e24;
        font-weight: 700;
        background: #fdf1f1;
    }

    .ck-storefront .ck-appbar .ck-desk-more {
        order: 4;
        margin-left: 10px;
    }

    .ck-storefront .ck-appbar .ck-desk-more > button {
        display: flex;
        align-items: center;
        gap: 6px;
        height: 30px;
        padding: 0 11px;
        border-radius: 8px;
        color: #3f4753;
        font-size: 13px;
        font-weight: 600;
        background: transparent;
        transition: color 120ms ease, background 120ms ease;
    }

    .ck-storefront .ck-appbar .ck-desk-more > button:hover {
        color: #e31e24;
        background: #f7f8fa;
    }

    /* — the wide search field ——————————————————————————————————————————
       Red-outlined like the reference, with the camera door for the picture
       search that the phone already has, and the word on the button so the
       action is not an icon someone has to guess. */
    .ck-storefront .ck-dsearch-field {
        --ck-dgo: 96px;
        --ck-dcam: 44px;
    }

    .ck-storefront .ck-dsearch-input {
        height: 44px;
        padding-block: 0;
        padding-left: 18px;
        padding-right: calc(var(--ck-dgo) + var(--ck-dcam) + 6px);
        border: 2px solid #e31e24;
        border-radius: 9999px;
        font-size: 14px;
        transition: border-color 120ms ease, box-shadow 120ms ease;
    }

    .ck-storefront .ck-dsearch-input:focus {
        border-color: #e31e24;
        box-shadow: 0 0 0 3px rgba(227, 30, 36, .12);
        outline: none;
    }

    .ck-storefront .ck-dsearch-input::placeholder {
        color: #9aa2ad;
    }

    .ck-storefront .ck-dsearch-go {
        width: var(--ck-dgo);
        gap: 7px;
        border-radius: 0 9999px 9999px 0;
        font-size: 14px;
        font-weight: 700;
        letter-spacing: .01em;
    }

    .ck-storefront .ck-dsearch-cam {
        position: absolute;
        top: 50%;
        right: calc(var(--ck-dgo) + 6px);
        z-index: 11;
        transform: translateY(-50%);
        display: flex;
        align-items: center;
        justify-content: center;
        width: var(--ck-dcam);
        height: 30px;
        border-radius: 9999px;
        color: #4b5563;
        transition: color 120ms ease, background 120ms ease;
    }

    .ck-storefront .ck-dsearch-cam:hover {
        color: #e31e24;
        background: #f7f8fa;
    }

    /* the suggestion panel hangs off a 44px field now, so it starts under it */
    .ck-storefront .ck-dsearch-panel {
        margin-top: 8px;
    }

    /* — the mega panel, now anchored to the header instead of the row ———————
       With the wrapper gone (`display: contents`) the nearest positioned box is
       the sticky header itself, which is what puts the panel under the rail
       across the full width. Inside that span the card keeps the container's
       own maximum so it never runs to the edge of a 4K screen. */
    .ck-storefront .ck-appbar .ck-desk-mega {
        width: 100%;
        max-width: 1536px;
        margin-inline: auto;
    }

    /* the left column of the panel repeats the rail, so the rail item for the
       category being hovered gets the same weight the column gives it */
    .ck-storefront .ck-appbar .ck-desk-mega a:hover {
        color: #e31e24;
    }
}
