/* ---------------------------------------------------------------------------
 * ck-header-red-v1.css — the red shopping header, on the phone and on a desktop.
 *
 * WHY A LAYER INSTEAD OF A CLASS SWAP ON THE HEADER
 * The bar is one element with eleven owners already: mobile-nav-v7.css reserves the status band
 * and paints the rows, home-storefront-v3.css sizes the doors, ck-compact-v2.css tightens the
 * rhythm, ck-header-tight-v1.css takes eight pixels back off two paddings, ck-desk-header-v1.css
 * splits the same box into three bands at 1024px, ck-back-v1.css keeps the wordmark left-aligned
 * beside the new arrow, ck-icons-v1.css owns the glyphs. Re-colouring the bar by editing those
 * files would mean rewriting rules that are correct about *size* only to change *ink*. This layer
 * says nothing about geometry: every rule here paints, and every selector is one class deeper than
 * the file it answers, so it wins at any link order and the measured paddings stay where they are.
 *
 * It is unlayered, like every other ck-* sheet. Tailwind v4 puts its utilities in @layer utilities
 * and an unlayered rule outranks a layered one whatever the specificity, which is how `bg-white` on
 * the header element loses to the band below without the blade's class list being touched.
 *
 * WHY THE BAND IS DEEP_RED AND NOT PRIMARY_RED
 * The brief's ramp leads with PRIMARY_RED #F20d38. White ink on it measures 4.3:1 — legal for the
 * 15px wordmark, illegal for the 10.5px strapline, and the strapline is the one new line a
 * shopper has to read. DEEP_RED #D50032 is the same hue family and lands at 5.5:1, so every word
 * in this bar passes AA. PRIMARY_RED therefore paints no surface here; the brightest thing in the
 * ramp that reaches the screen is the ACCENT_RED #FF4D6D sheen across the top of the band, and it
 * is held at 18% over 22px on purpose: at its strongest pixel the sheen is #dc0e3c, which is
 * 5.0:1 under white, so the pass does not depend on where a line of ink happens to land.
 *
 * The red inside the search field is set to the band's value, not to the app's existing
 * --ck-brand #e31e24. Two reds that touch and are not the same red is the one thing that makes a
 * recolour look like a mistake, and the field's action is the only red that touches the band.
 *
 * WHAT STAYS WHITE AND WHY
 * Every surface a shopper types into or reads a list from: the search field, the suggestion
 * panel, the category sheet, the desktop mega panel, the More and Account dropdowns, the All
 * Categories button. Those are containers, not chrome, and a translucent-white container on a red
 * band is unreadable the moment anything behind it is bright. The tiles in the brand row are the
 * exception: they hold one glyph each, so they take a flat 16%-alpha wash and the white glyph on
 * top of it.
 *
 * WHAT THIS LAYER DOES NOT TOUCH
 * The bottom tab bar (it is the shop's primary dock and stays neutral), the floating cart, the
 * announcement band above this header (already the shop's own red), the campaign overlay, and the
 * messenger screens where the storefront header steps out entirely. On the product page the bar is
 * hidden below 1024px by ck-compact-v2.css and this file says nothing about display, so that page
 * still paints its picture to the top edge.
 */

/* ---------------------------------------------------------------- the band */

.ck-storefront .ck-appbar {
    --ckr-band: #d50032;
    --ckr-ink: #ffffff;
    --ckr-ink-quiet: rgba(255, 255, 255, .86);
    --ckr-tile: rgba(255, 255, 255, .16);
    --ckr-tile-press: rgba(255, 255, 255, .3);
    --ckr-hair: rgba(255, 255, 255, .22);
    --ckr-seam: rgba(122, 0, 28, .55);
    --ckr-sheen: rgba(255, 77, 109, .18);

    background-color: var(--ckr-band);
    background-image: linear-gradient(180deg, var(--ckr-sheen) 0, rgba(255, 77, 109, 0) 22px);
    color: var(--ckr-ink);
    border-bottom-color: var(--ckr-seam);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .14);
}

/* ------------------------------------------------------------- phone chrome */

/*
 * The nav inside the bar paints its own white in mobile-nav-v7.css and its own #17171a in that
 * file's dark block. Three classes clear both, and the band shows through.
 */
.ck-storefront .ck-appbar .ck-mnav {
    background: transparent;
}

/*
 * The mark is red on transparent — sampled off public/images/logo.png, three quarters of its ink
 * sits in the #b01010-#f01010 range — so on a red band it disappears. A white tile is the fix,
 * and the tile is 2px larger than the box it backs, which the 34px doors in this row already
 * dominate: the row's height does not move, so --ck-appbar-h, which ck-catdir-panes-v1.js
 * measures rather than assumes, re-seats the category panes by itself.
 */
.ck-storefront .ck-appbar .ck-mnav-logo {
    color: var(--ckr-ink);
}

.ck-storefront .ck-appbar .ck-mnav-logo img {
    padding: 2px;
    border-radius: 6px;
    background: #fff;
}

/*
 * The wordmark and the strapline are one column. home-storefront-v3.css rules `.ck-mnav-logo span`
 * for ellipsis and that reaches both of these, which is what keeps a long strapline from pushing
 * the doors off a 360px screen.
 */
.ck-storefront .ck-appbar .ck-mnav-lock {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 1px;
}

.ck-storefront .ck-appbar .ck-mnav-strap {
    font-size: 10.5px;
    font-weight: 600;
    line-height: 1.15;
    letter-spacing: .005em;
    color: var(--ckr-ink-quiet);
}

/* The arrow, the support door, the bell, the cart and the account door. */
.ck-storefront .ck-appbar .ck-mnav-action {
    background: var(--ckr-tile);
    color: var(--ckr-ink);
}

.ck-storefront .ck-appbar .ck-mnav-action:active {
    background: var(--ckr-tile-press);
}

/*
 * The count was a red pill with a white ring, because it sat on white paper. On the band the ring
 * is the band and the pill is white, so the number is knocked out of it in the band's own red.
 */
.ck-storefront .ck-appbar .ck-mnav-count {
    background: #fff;
    border-color: var(--ckr-band);
    color: var(--ckr-band);
}

.ck-storefront .ck-appbar .ck-back {
    background-color: var(--ckr-tile);
    color: var(--ckr-ink);
}

.ck-storefront .ck-appbar .ck-back:active {
    background-color: var(--ckr-tile-press);
    color: var(--ckr-ink);
}

@media (hover: hover) and (pointer: fine) {
    .ck-storefront .ck-appbar .ck-back:hover {
        background-color: var(--ckr-tile-press);
        color: var(--ckr-ink);
    }
}

/* --------------------------------------------------------------- phone tabs */

.ck-storefront .ck-appbar .ck-mnav-tab {
    color: var(--ckr-ink-quiet);
}

.ck-storefront .ck-appbar .ck-mnav-tab.is-active {
    color: var(--ckr-ink);
}

/* The underline was brand red on white paper. On a band of the same hue it would vanish, and the
 * tab above it is already the brightest white in the row, so the bar takes the same white. */
.ck-storefront .ck-appbar .ck-mnav-tab::after {
    background: var(--ckr-ink);
}

/* ---------------------------------------------------------------- the chips */

/*
 * Scoped through .ck-mnav-cats because the full category sheet re-uses this same class inside a
 * white panel, and a translucent chip with white ink in that panel is invisible. The sheet keeps
 * the chips exactly as mobile-nav-v7.css drew them.
 */
.ck-storefront .ck-appbar .ck-mnav-cats .ck-mnav-chip {
    border-color: var(--ckr-hair);
    background: var(--ckr-tile);
    color: var(--ckr-ink);
}

.ck-storefront .ck-appbar .ck-mnav-cats .ck-mnav-chip:active {
    background: var(--ckr-tile-press);
}

.ck-storefront .ck-appbar .ck-mnav-cats .ck-mnav-chip.is-active {
    border-color: #fff;
    background: #fff;
    color: var(--ckr-band);
}

/* The strip's fade-out over the ☰ is painted, so it has to be the band's colour and not white. */
.ck-storefront .ck-appbar .ck-mnav-expand {
    background: linear-gradient(to right, rgba(213, 0, 50, 0) 0%, var(--ckr-band) 38%);
    color: var(--ckr-ink);
}

.ck-storefront .ck-appbar .ck-mnav-catrow {
    border-top-color: var(--ckr-hair);
}

/* ------------------------------------------------------- the search's field */

/*
 * The field stays white paper. Only the red inside it is re-matched to the band, and the action
 * keeps the shape the 40px field already gives it.
 */
.ck-storefront .ck-appbar .ck-dsearch-go {
    background: var(--ckr-band);
}

.ck-storefront .ck-appbar .ck-dsearch-go:hover {
    background: #b8002a;
}

/* =========================================================== desktop, 1024
 *
 * Everything below is inside the query, because below it the desktop row is `hidden lg:flex` in the
 * blade and these elements are not on the screen at all. The three bands ck-desk-header-v1.css
 * built — utility strip, brand row, category rail — keep their geometry; only the ink moves.
 */

@media (min-width: 1024px) {

    .ck-storefront .ck-appbar .ck-desk-logo > span {
        color: var(--ckr-ink);
    }

    /*
     * The wordmark is two-tone by design and the second tone is brand red — #e62129 against a
     * #d50032 band is the same colour twice, so half the shop's name disappeared into the band it
     * sits on. The two words keep their roles and trade their paint: white first, then the palest
     * pink that still answers the band, 3.9:1 at the 18px bold this row actually sets.
     */
    .ck-storefront .ck-appbar .ck-desk-logo > span > span:first-child {
        color: var(--ckr-ink);
    }

    .ck-storefront .ck-appbar .ck-desk-logo > span > span:last-child {
        color: #ffd0d9;
    }

    .ck-storefront .ck-appbar .ck-desk-logo img {
        padding: 2px;
        border-radius: 8px;
        background: #fff;
    }

    /*
     * The one ask in the row was a red pill on white paper. On a red band the ask is the white
     * pill, and the hover that used to darken the red now dims the white so it still answers.
     */
    .ck-storefront .ck-appbar .ck-desk-shop {
        background: #fff;
        color: var(--ckr-band);
        box-shadow: 0 2px 10px rgba(88, 0, 20, .3);
    }

    .ck-storefront .ck-appbar .ck-nav-primary:hover {
        background: #f2e3e5;
    }

    .ck-storefront .ck-appbar .ck-nav-primary:active {
        background: #fff;
    }

    .ck-storefront .ck-appbar nav.ck-desk-nav {
        border-top-color: var(--ckr-hair);
    }

    /*
     * The rail is fifteen departments of grey ink. On the band they are white at 88%, the current
     * department is a white pill with the band's red inside it, and the hover wash is the same one
     * the brand-row tiles use, so one press state runs the length of the header.
     */
    .ck-storefront .ck-appbar .ck-desk-rail a {
        color: var(--ckr-ink-quiet);
    }

    .ck-storefront .ck-appbar .ck-desk-rail a:hover {
        background: var(--ckr-tile);
        color: var(--ckr-ink);
    }

    .ck-storefront .ck-appbar .ck-desk-rail a.is-here {
        background: #fff;
        color: var(--ckr-band);
    }

    .ck-storefront .ck-appbar .ck-desk-more > button {
        color: var(--ckr-ink);
    }

    .ck-storefront .ck-appbar .ck-desk-more > button:hover {
        background: var(--ckr-tile);
        color: var(--ckr-ink);
    }

    /* The three trigger doors: the tablet menu, the theme switch and the narrow search. */
    .ck-storefront .ck-appbar .ck-desk-side > button,
    .ck-storefront .ck-appbar .ck-desk-side > div > button {
        color: var(--ckr-ink);
    }

    .ck-storefront .ck-appbar .ck-desk-side > button:hover,
    .ck-storefront .ck-appbar .ck-desk-side > div > button:hover {
        color: #fff;
    }

    /* The cart door is the Livewire component, whose badge is a utility class on a red disc. */
    .ck-storefront .ck-appbar .ck-desk-side [data-cart-count] {
        background: #fff;
        color: var(--ckr-band);
    }

    /*
     * A 2px brand-red outline on a red band is not an outline. The field is a white box on the
     * band and needs no edge; the focus ring is the only thing that still moves.
     */
    .ck-storefront .ck-appbar .ck-dsearch-input {
        border-color: #fff;
    }

    .ck-storefront .ck-appbar .ck-dsearch-input:focus {
        border-color: #fff;
        box-shadow: 0 0 0 3px rgba(255, 255, 255, .45);
    }

    .ck-storefront .ck-appbar .ck-dsearch-cam {
        color: #6b7280;
    }

    .ck-storefront .ck-appbar .ck-dsearch-cam:hover {
        color: var(--ckr-band);
        background: #f7f8fa;
    }
}

/* ------------------------------------------------------------ the whole sentence
 *
 * The bar asks a shopper to search "products, brands and categories", and that sentence is the
 * header's promise about what the search actually covers, so it is worth the room. On a phone the
 * field holds its type at 16px because anything smaller makes iOS zoom the page when the box takes
 * focus, and at 16px the sentence measured 284px against 278px of room at 390px and 248px at 360px —
 * the last two or three letters fell off the end, which on a clipped placeholder reads as a broken
 * string rather than a long one.
 *
 * The hint is allowed to be a little quieter than the text it stands in for, so only the
 * ::placeholder scales, and it scales with the screen instead of by guess-work at three widths:
 * 13px at 390 and above, down to the 11px floor the smallest phone in the analytics needs. What
 * a shopper types keeps the 16px that stops the zoom, the camera keeps its inset, and the row keeps
 * the 12px edge the wordmark above it is aligned to.
 */
@media (max-width: 1023.98px) {
    .ck-storefront .ck-appbar .ck-mnav-search input[type="search"]::placeholder {
        font-size: clamp(11px, 3.3vw + .4px, 13px);
        letter-spacing: .002em;
        opacity: 1;
    }
}

/* --------------------------------------------------------------- phone fit
 *
 * Four round doors, an arrow and the wordmark have to share 360px. The doors give 2px each and the
 * row 2px of gap, which is 14px back and still leaves every one of them a 32px disc — above the
 * 30px floor the tiles were already held to at this width.
 */
@media (max-width: 379.98px) {
    .ck-storefront .ck-appbar .ck-mnav-actions {
        gap: 6px;
    }

    .ck-storefront .ck-appbar .ck-mnav-action {
        width: 32px;
        height: 32px;
    }
}

/* ----------------------------------------------------------- reduced motion

 * Nothing here animates on its own, so the only thing the switch owes the header is the press
 * states: the band already hands those to the sheets that own the transitions.
 */
@media (prefers-reduced-motion: reduce) {
    .ck-storefront .ck-appbar .ck-mnav-action,
    .ck-storefront .ck-appbar .ck-back {
        transition-duration: 1ms;
    }

    .ck-storefront .ck-appbar .ck-mnav-action:active,
    .ck-storefront .ck-appbar .ck-back:active {
        transform: none;
    }
}
