/*
    Storefront navigation styles, shared by every theme.

    Loaded from <head> rather than inlined beside the markup: the header renders
    inside #app, and Vue's in-DOM template compiler discards <style> elements it
    finds there, so an inline block is served by PHP and then silently dropped
    the moment Vue mounts.

    A theme adopts a variant by setting a few custom properties on its header:

        --menu-ink       text colour                (default: inherit)
        --menu-accent    hover / active colour      (default: currentColor)
        --menu-surface   dropdown panel background  (default: #fff)
        --menu-line      dropdown panel borders
*/

/* ---------------------------------------------------- shared */

.tmenu {
    display: flex;
    align-items: center;
    min-width: 0;
    color: var(--menu-ink, inherit);
}

/* Long category names such as "Audio & Wearables" wrapped onto a
   second line and pushed the header out of alignment. Items stay on
   one line; if there are more than fit, the row scrolls. */
.tmenu a { white-space: nowrap; text-decoration: none; }

/* Scroll rather than wrap when the row still does not fit, with the trailing
   edge faded so a partly visible item reads as "there is more" instead of as a
   clipped one. */
.tmenu--simple,
.tmenu--modern {
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent);
    mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent);
}

.tmenu--simple::-webkit-scrollbar,
.tmenu--modern::-webkit-scrollbar { display: none; }

/* ---------------------------------------------------- simple */

.tmenu--simple { gap: 34px; }

.tmenu--simple a {
    position: relative;
    color: inherit;
    font-size: 16px;
    font-weight: 500;
    letter-spacing: .012em;
    padding: 6px 0;
}

.tmenu--simple a::after {
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    height: 1.5px;
    background: var(--menu-accent, currentColor);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform var(--motion-base, .22s) var(--motion-ease-out, ease);
    content: "";
}

.tmenu--simple a:hover { color: var(--menu-accent, currentColor); }
.tmenu--simple a:hover::after { transform: scaleX(1); }

/* ---------------------------------------------------- modern */

.tmenu--modern {
    /* The pill track is the menu's own shape, so it hugs its items instead of
       stretching to fill whatever column the header hands it. */
    width: fit-content;
    max-width: 100%;
    gap: 2px;
    padding: 3px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--menu-ink, currentColor) 7%, transparent);
}

.tmenu--modern a {
    padding: 7px 14px;
    border-radius: 999px;
    color: inherit;
    font-size: 16px;
    font-weight: 500;
    letter-spacing: .012em;
    transition: background-color var(--motion-fast, .2s) var(--motion-ease-out, ease), color var(--motion-fast, .2s) var(--motion-ease-out, ease);
}

.tmenu--modern a:hover {
    background: var(--menu-surface, #fff);
    color: var(--menu-accent, currentColor);
    box-shadow: 0 1px 3px rgba(0, 0, 0, .12);
}

/* ------------------------------------------------------ mega */

.tmenu--mega { gap: 24px; }

.tmenu__item { position: relative; }

.tmenu__trigger {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 20px 0;
    border: 0;
    background: none;
    color: inherit;
    font: inherit;
    font-size: 16px;
    font-weight: 500;
    /*
     * A shade under a pixel of tracking. At this size it is the difference
     * between a row of words and a row that looks set — the same reason the
     * wordmark above it is not simply bold.
     */
    letter-spacing: .012em;
    cursor: pointer;
    white-space: nowrap;
}

.tmenu__trigger::after {
    border-top: 4px solid currentColor;
    border-right: 3.5px solid transparent;
    border-left: 3.5px solid transparent;
    content: "";
    opacity: .5;
    transition: transform var(--motion-base, .2s) var(--motion-ease-out, ease);
}

.tmenu__item:hover .tmenu__trigger { color: var(--menu-accent, currentColor); }
.tmenu__item:hover .tmenu__trigger::after { transform: rotate(180deg); }

/* The panel is full-bleed rather than dropdown-width: a mega menu
   that only spans its trigger reads as an ordinary dropdown. */
/* Anchored to the nav rather than the trigger. Centring on the trigger put
   the panel off the right edge of the viewport whenever the trigger sat near
   the end of the row — which is exactly where "All departments" lives. */
.tmenu--mega { position: relative; }
.tmenu--mega .tmenu__item { position: static; }

.tmenu__panel {
    position: absolute;
    z-index: 60;
    top: 100%;
    right: 0;
    width: min(920px, calc(100vw - 48px));
    padding: 26px 30px;
    border: 1px solid var(--menu-line, rgba(0, 0, 0, .1));
    border-radius: 14px;
    background: var(--menu-surface, #fff);
    box-shadow: 0 26px 60px -24px rgba(0, 0, 0, .35);
    opacity: 0;
    transform: translateY(6px);
    transition: opacity .2s ease, transform .2s ease, visibility .2s;
    visibility: hidden;
}

.tmenu__item:hover .tmenu__panel,
.tmenu__item:focus-within .tmenu__panel {
    opacity: 1;
    transform: translateY(0);
    visibility: visible;
}

.tmenu__cols {
    display: grid;
    gap: 10px 26px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.tmenu__panel a {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
    padding: 11px 12px;
    border-radius: 8px;
    color: inherit;
    font-size: 16px;
    font-weight: 450;
    transition: background-color var(--motion-fast, .16s) var(--motion-ease-out, ease), color var(--motion-fast, .16s) var(--motion-ease-out, ease);
}

.tmenu__panel a:hover {
    background: color-mix(in srgb, var(--menu-accent, currentColor) 10%, transparent);
    color: var(--menu-accent, currentColor);
}

.tmenu__panel small {
    color: color-mix(in srgb, var(--menu-ink, currentColor) 45%, transparent);
    font-size: 11.5px;
    font-variant-numeric: tabular-nums;
}

.tmenu__foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid var(--menu-line, rgba(0, 0, 0, .1));
    font-size: 12px;
}

.tmenu__foot strong { font-weight: 650; }
.tmenu__foot a { padding: 0; color: var(--menu-accent, currentColor); font-weight: 700; }

@media (max-width: 900px) {
    .tmenu__panel { display: none; }
}


/* ── A section's own sub-menu ────────────────────────────────────────────────
   Distinct from the "all departments" panel above, which is deliberately
   full-bleed. A dropdown for one section is anchored under its own trigger and
   sized to its contents — a 920px panel holding four words reads as a mistake.

   The item is put back to `relative` because the mega variant sets its items
   `static` so that panel can span the nav. */
.tmenu__item--has-sub { position: relative; }
.tmenu--mega .tmenu__item--has-sub { position: relative; }

.tmenu__panel--sub {
    right: auto;
    left: 0;
    width: max-content;
    min-width: 190px;
    max-width: min(320px, calc(100vw - 32px));
    padding: 12px 14px;
}

.tmenu__panel--sub .tmenu__cols {
    grid-template-columns: minmax(0, 1fr);
    gap: 2px;
}

/* The inline variants render their panel as spans, which do not lay out as
   the grid the mega panel uses. */
.tmenu--simple .tmenu__panel--sub,
.tmenu--modern .tmenu__panel--sub {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.tmenu__panel--sub a {
    padding: 9px 12px;
    border-radius: 7px;
    font-size: 15px;
}

.tmenu__panel--sub a:hover {
    background: color-mix(in srgb, var(--menu-accent, currentColor) 8%, transparent);
}


/* ── All departments ─────────────────────────────────────────────────────────
   A panel fixed to the window's left edge, not a column in the page: opening it
   moves nothing, and the shop keeps its width whether it is there or not.

   Colours come from the same custom properties as the rest of this file, so a
   theme adopts it by setting the two or three it already sets. */
.tmenu__item--rail { margin-right: 10px; }

.tmenu__trigger--rail {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    background: none;
    border: 0;
    /* Deliberately not `font: inherit`: the shorthand resets font-size too, and
       this button then rendered a pixel and a half larger than every other item
       in the row. It takes the same type as its neighbours. */
    font-family: inherit;
    font-size: 16px;
    font-weight: 500;
    letter-spacing: .012em;
    cursor: pointer;
    color: var(--menu-accent, currentColor);
}

.tmenu__bars {
    width: 15px;
    height: 11px;
    flex: none;
    background:
        linear-gradient(currentColor 0 0) 0 0 / 100% 1.5px no-repeat,
        linear-gradient(currentColor 0 0) 0 50% / 100% 1.5px no-repeat,
        linear-gradient(currentColor 0 0) 0 100% / 100% 1.5px no-repeat;
}

.tmenu__rule {
    align-self: center;
    width: 1px;
    height: 20px;
    background: var(--menu-line, rgba(0, 0, 0, .12));
    margin-right: 10px;
}

.tdept {
    position: fixed;
    left: 0;
    z-index: 70;
    width: 268px;
    max-width: 86vw;
    /*
     * Deliberately not a scroll container. Each row's shelf opens outside the
     * panel, and `overflow-y: auto` makes a box scrollable on both axes: the
     * shelf then either gets clipped, or — worse — focusing a link inside it
     * scrolls the panel sideways and drags the whole menu off the screen.
     *
     * Six departments need no scrolling. A shop with thirty would, and would
     * need the shelves rendered outside this box before it could have it.
     */
    background: var(--menu-surface, #fff);
    color: var(--menu-ink, inherit);
    border: 1px solid var(--menu-line, rgba(0, 0, 0, .12));
    /* nothing on the side it is against */
    border-left: 0;
    box-shadow: 0 20px 50px -20px rgba(0, 0, 0, .35), 0 2px 8px rgba(0, 0, 0, .08);
}

.tdept[hidden] { display: none; }

/*
 * No entrance animation, on purpose.
 *
 * It started as a fade from `opacity: 0`. An animation only applies its
 * keyframes while it is running, and a browser that throttles animations — a
 * background tab, a page still loading, a device under load — can leave one
 * running but frozen on its first frame. The panel then opens completely
 * invisible, and the menu appears broken rather than pretty.
 *
 * Appearing instantly is not worse. Being invisible is much worse.
 */

.tdept__cap {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 11px 14px;
    border-bottom: 1px solid var(--menu-line, rgba(0, 0, 0, .12));
    font-size: 11px;
    letter-spacing: .1em;
    text-transform: uppercase;
    opacity: .65;
}

.tdept__close {
    background: none;
    border: 0;
    font-size: 19px;
    line-height: 1;
    cursor: pointer;
    color: inherit;
    padding: 0 2px;
}

.tdept__row { position: relative; }

.tdept__link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 12px 14px;
    text-decoration: none;
    color: inherit;
    font-size: 16px;
    border-bottom: 1px solid var(--menu-line, rgba(0, 0, 0, .08));
}

.tdept__row:last-child .tdept__link { border-bottom: 0; }

.tdept__link i {
    font-style: normal;
    font-size: 11px;
    opacity: .5;
    font-variant-numeric: tabular-nums;
}

.tdept__row:hover > .tdept__link,
.tdept__row:focus-within > .tdept__link {
    color: var(--menu-accent, currentColor);
    background: color-mix(in srgb, var(--menu-accent, currentColor) 8%, transparent);
}

/* the shelf opens beside the row it belongs to */
.tdept__shelf {
    position: absolute;
    left: 100%;
    top: 0;
    margin-left: 8px;
    width: 420px;
    max-width: calc(100vw - 300px);
    padding: 16px;
    background: var(--menu-surface, #fff);
    border: 1px solid var(--menu-line, rgba(0, 0, 0, .12));
    box-shadow: 0 20px 50px -20px rgba(0, 0, 0, .35);
    opacity: 0;
    /* Not `visibility: hidden`: that takes the links out of the tab order, so
       focus can never land inside, so `:focus-within` can never fire, and a
       shelf that only opens on hover is a shelf a keyboard cannot open. Kept
       focusable and merely invisible; the first link to take focus reveals it. */
    pointer-events: none;
    /* No transition here either, for the reason given above the panel: a fade
       that never gets to run leaves the shelf invisible while hovered. */
}

.tdept__row:hover > .tdept__shelf,
.tdept__row:focus-within > .tdept__shelf {
    opacity: 1;
    pointer-events: auto;
}

.tdept__shelfcols {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 2px 18px;
}

.tdept__shelf a { white-space: nowrap; }

.tdept__shelf a {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
    padding: 8px 10px;
    text-decoration: none;
    color: inherit;
    font-size: 14px;
}

.tdept__shelf a:hover { color: var(--menu-accent, currentColor); }
.tdept__shelf small { font-size: 11px; opacity: .5; font-variant-numeric: tabular-nums; }

.tdept__all {
    display: inline-block;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--menu-line, rgba(0, 0, 0, .12));
    font-size: 13px;
    font-weight: 600;
    color: var(--menu-accent, currentColor);
    text-decoration: none;
}

/* On a narrow screen the shelf has nowhere to go beside its row, so it opens
   under it and the panel behaves as a plain list. */
@media (max-width: 860px) {
    .tdept { width: 100%; max-width: none; }
    .tdept__shelf {
        position: static;
        width: auto;
        max-width: none;
        margin: 0;
        border: 0;
        border-top: 1px solid var(--menu-line, rgba(0, 0, 0, .12));
        box-shadow: none;
        height: 0;
        overflow: hidden;
        opacity: 1;
        pointer-events: auto;
    }
    .tdept__row:focus-within > .tdept__shelf { height: auto; }
    .tdept__shelfcols { grid-template-columns: minmax(0, 1fr); }
}


/* ── The menu's own accent ───────────────────────────────────────────────────
   The menu carries its own accent rather than the theme's signal colour: a
   hover that suits one kind of shop is wrong for another, and the menu is
   where a shop's manners are read first. The three tokens below are the whole
   palette, so an install changes the menu's colour by setting them.

   Scoped to the menu and its panels, so nothing else in the theme moves. */
.tmenu,
.tdept {
    --menu-gold: #a67c3d;
    --menu-gold-wash: #f6efe2;
    --menu-ember: #f97316;
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .tmenu,
    :root:not([data-theme="light"]) .tdept {
        --menu-gold: #d9ae6a;
        --menu-gold-wash: #241d10;
    }
}

:root[data-theme="dark"] .tmenu,
:root[data-theme="dark"] .tdept {
    --menu-gold: #d9ae6a;
    --menu-gold-wash: #241d10;
}

.tmenu__trigger:hover,
.tmenu__item:hover > .tmenu__trigger,
.tmenu__item--has-sub:focus-within > .tmenu__trigger { color: var(--menu-gold); }

.tmenu__trigger--rail { color: var(--menu-gold); }

/* A department is part of the shop; a promotion is this week's window. Same row,
   different promise — so one is set lighter and carries an ember. */
.tmenu__trigger[data-kind="promotion"] { font-weight: 400; }

.tmenu__trigger[data-kind="promotion"]::before,
.tdept__link[data-kind="promotion"] > span::before {
    content: "";
    display: inline-block;
    width: 5px;
    height: 5px;
    margin-right: 8px;
    border-radius: 50%;
    background: var(--menu-ember);
    vertical-align: middle;
}

/* The work the shop is named for, marked once and quietly: a few stitches of
   thread, in the gold of the wordmark. */
.tmenu__trigger[data-craft="true"],
.tdept__link[data-craft="true"] { color: var(--menu-gold); }

.tmenu__trigger[data-craft="true"]::after,
.tdept__link[data-craft="true"] > span::after {
    content: "";
    display: inline-block;
    width: 14px;
    height: 6px;
    margin-left: 8px;
    vertical-align: middle;
    background: repeating-linear-gradient(90deg, var(--menu-gold) 0 3px, transparent 3px 5px);
    opacity: .85;
}

/* the panel, dressed as the design has it */
.tdept { border-top: 2px solid var(--menu-gold); }

.tdept__cap {
    letter-spacing: .12em;
    font-size: 10.5px;
    opacity: 1;
    color: color-mix(in srgb, var(--menu-ink, currentColor) 55%, transparent);
}

.tdept__count {
    margin-left: auto;
    margin-right: 10px;
    font-variant-numeric: tabular-nums;
    color: var(--menu-gold);
}

.tdept__link { font-size: 15.5px; }

.tdept__row:hover > .tdept__link,
.tdept__row:focus-within > .tdept__link {
    color: var(--menu-gold);
    background: var(--menu-gold-wash);
}

.tdept__shelf { border-left: 2px solid var(--menu-gold); }
.tdept__shelf a { font-size: 15px; }
.tdept__shelf a:hover { color: var(--menu-gold); }
.tdept__all { color: var(--menu-gold); }

/* the section's photograph, when it has one */
/* A shelf carrying a photograph needs the width for both: at 420px the picture
   took a third and the sub-sections wrapped mid-name — "One / Piece". */
.tdept__shelf:has(.tdept__shot) {
    width: 560px;
    max-width: calc(100vw - 320px);
    display: grid;
    grid-template-columns: minmax(0, 1fr) 168px;
    grid-template-areas: "links shot" "all shot";
    align-items: start;
    column-gap: 18px;
}

.tdept__shelf:has(.tdept__shot) .tdept__shelfcols { grid-area: links; }
.tdept__shelf:has(.tdept__shot) .tdept__all { grid-area: all; }

.tdept__shot {
    grid-area: shot;
    align-self: stretch;
    min-height: 120px;
    background-size: cover;
    background-position: center;
    border: 1px solid var(--menu-line, rgba(0, 0, 0, .12));
}


/* ── The drawer ──────────────────────────────────────────────────────────────
   The same six sections as the desktop menu, sized for a thumb. Rows are 48px
   because that is the smallest target most people can hit reliably while
   walking, which is how a good share of this shop is browsed. */
.tdrawer { display: flex; flex-direction: column; }

.tdrawer__search { padding: 12px 16px 14px; }

.tdrawer__search input {
    width: 100%;
    min-height: 46px;
    padding: 11px 14px;
    font-size: 16px; /* anything smaller and iOS zooms the page on focus */
    border: 1px solid var(--menu-line, rgba(0, 0, 0, .18));
    background: var(--menu-surface, #fff);
    color: inherit;
}

.tdrawer__promos {
    display: flex;
    gap: 10px;
    padding: 0 16px 14px;
}

.tdrawer__promos a {
    flex: 1;
    min-height: 46px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-align: center;
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    color: inherit;
    border: 1px solid var(--menu-line, rgba(0, 0, 0, .18));
}

.tdrawer__promos a::before {
    content: "";
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--menu-ember, currentColor);
}

.tdrawer__row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 48px;
    padding: 13px 16px;
    font-size: 16.5px;
    font-weight: 600;
    color: inherit;
    text-decoration: none;
    border-top: 1px solid var(--menu-line, rgba(0, 0, 0, .1));
    cursor: pointer;
    list-style: none;
}

.tdrawer__row::-webkit-details-marker { display: none; }

.tdrawer__row small {
    font-size: 12px;
    font-weight: 400;
    opacity: .5;
    font-variant-numeric: tabular-nums;
}

.tdrawer__row[data-craft="true"] { color: var(--menu-gold, currentColor); }

.tdrawer__row[data-craft="true"] > span::after {
    content: "";
    display: inline-block;
    width: 14px;
    height: 6px;
    margin-left: 8px;
    vertical-align: middle;
    background: repeating-linear-gradient(90deg, var(--menu-gold, currentColor) 0 3px, transparent 3px 5px);
    opacity: .85;
}

.tdrawer__section[open] > .tdrawer__row { color: var(--menu-gold, currentColor); }

.tdrawer__children { display: flex; flex-direction: column; padding: 0 0 8px; }

.tdrawer__children a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 46px;
    padding: 11px 16px 11px 28px;
    font-size: 15.5px;
    text-decoration: none;
    color: inherit;
    opacity: .88;
}

.tdrawer__children small { font-size: 12px; opacity: .55; font-variant-numeric: tabular-nums; }

.tdrawer__all {
    font-weight: 600;
    color: var(--menu-gold, currentColor) !important;
    opacity: 1 !important;
}

.tdrawer__foot {
    display: flex;
    gap: 18px;
    padding: 14px 16px 6px;
    border-top: 1px solid var(--menu-line, rgba(0, 0, 0, .1));
}

.tdrawer__foot a { text-decoration: none; color: inherit; font-size: 15px; }

/* the drawer needs the same tokens the menu defines */
.tdrawer {
    --menu-gold: #a67c3d;
    --menu-ember: #f97316;
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .tdrawer { --menu-gold: #d9ae6a; }
}

:root[data-theme="dark"] .tdrawer { --menu-gold: #d9ae6a; }

/* Shared header tools and cart badge */
.gadget-header__cart {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.gadget-header__cart-count {
    position: absolute;
    top: -5px;
    right: -7px;
    min-width: 17px;
    height: 17px;
    padding: 0 4px;
    border-radius: 10px;
    background: #de1849;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    line-height: 17px;
    text-align: center;
}

.gadget-header__cart-count[hidden] {
    display: none !important;
}

.gadget-header__icon-link,
.gadget-header__cart {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: inherit;
    text-decoration: none;
}

