/*!
 * HB Tack — the Tack Room storefront, on Grav + KahunaCart
 *
 * Started as a copy of the Kahuna theme's stylesheet: the structure, the
 * storefront rules and the KahunaCart hand-off are Kahuna's, the tokens are
 * HB Tack's (forest green, saddle, brass on stone and paper; Libre Caslon and
 * Figtree; square corners). The Tack Room's own pieces — the masthead, the
 * home page, the cards, the product page and the bag — are in tack-room.css,
 * which loads after this file.
 *
 * No build step. Everything is driven by the custom properties in the token
 * block below, and a site's css/custom.css overrides whatever else it wants.
 * The palette is light only; Kahuna's dark side and its scheme toggle were
 * left behind with the copy.
 *
 * The storefront's own markup is very nearly NOT styled here. KahunaCart
 * ships assets/kahunacart.css, which styles every kahunacart-* class in the
 * plugin's templates and partials and resolves its internals through
 * --kahunacart-* -> --grav-* -> --theme-accent -> neutral fallback. This
 * theme integrates by publishing those tokens (see "KahunaCart integration"
 * below), not by writing rules against the plugin's classes.
 *
 * Four blocks are the exception, and each says so where it sits: the product
 * gallery (13), the catalog sidebar (14), the storefront search form (12) and
 * the account area (18). Those are partials and pages the theme lays out
 * rather than merely spaces, and every rule in them is scoped under a theme
 * class — which is also what puts them ahead of the plugin's single-class
 * rules, since the plugin's stylesheet loads after this one.
 *
 * Order of business:
 *   1. Tokens / 2. Texture / KahunaCart integration
 *   3. Reset & base / 4. Typography
 *   5. Layout / 6. Header & nav / 7. Footer / 8. Buttons / 9. Forms
 *  10. Tables / 11. Callouts / 12. Storefront: listing head, grid & cards
 *  13. Product detail / 14. Catalog: sidebar, tree, filters, crumbs, tags
 *  15. Cart / 16. Checkout / 17. Receipt & downloads
 *  18. Account area & login / 19. Home page / 20. Processing, denied, error
 *  21. Utilities / 22. Print
 */

/* ------------------------------------------------------------------ 1. tokens */

/*
 * The brand block. These are the ones a site changes; everything else is
 * derived from them or is furniture.
 */
:root {
    color-scheme: light;

    /* Two brand colours, split by job, as in Kahuna. In the Tack Room both
       are the forest green: links and buttons wear the same colour, and the
       saddle and brass below do the picking out. */
    --k-brand: #1c3328;
    --k-accent: #1c3328;

    /* HB Tack's own colours, for the pieces the two brand tokens don't reach. */
    --hb-green: #1c3328;
    --hb-green-2: #264536;
    --hb-stone: #eae7df;
    --hb-paper: #f7f5f0;
    --hb-saddle: #7a3f22;
    --hb-brass: #a8864e;
    --hb-brass-lt: #d9c6a0;
    --hb-on-green: #efe9dc;
    --hb-on-green-soft: #cfd6cc;
    --hb-brass-plate: linear-gradient(135deg, #d3b884, #a8864e 50%, #cfb27a);

    --k-font-display: "Libre Caslon Display", "Libre Caslon Text", Georgia, serif;
    --hb-font-serif: "Libre Caslon Text", Georgia, "Times New Roman", serif;
    --k-font: "Figtree", "Helvetica Neue", Helvetica, Arial, sans-serif;
    --k-font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;

    --k-radius: 0;
    --k-radius-sm: 0;
    --k-radius-btn: 0;
}

/* The admin's Colour Scheme option. `auto` sets nothing and the system
   preference decides; light and dark pin the page either way. */
:root[data-theme="light"] { color-scheme: light; }
:root[data-theme="dark"] { color-scheme: dark; }

/*
 * The palette. HB Tack's is a light one only: stone ground, paper surfaces,
 * forest-green ink for the brand and the footer. The theme pins
 * `color-scheme: light`, so these are plain values rather than Kahuna's
 * light-dark() pairs.
 */
:root {
    --k-bg: var(--hb-stone);
    --k-bg-alt: #e3dfd5;
    --k-surface: var(--hb-paper);
    --k-surface-sunk: #efece5;
    --k-ink: #1a1d1a;
    --k-ink-soft: #4a4f48;
    --k-muted: #6b6f66;
    --k-line: #cfc9bb;
    --k-line-strong: #b5ad9b;

    --k-brand-strong: var(--hb-green);
    --k-brand-deep: var(--hb-green);
    --k-brand-soft: #e2e5dd;
    --k-brand-line: #9aa89e;
    --k-on-brand-deep: var(--hb-on-green);

    --k-accent-ink: var(--hb-on-green);
    --k-accent-strong: var(--hb-green-2);
    --k-accent-soft: #e2e5dd;
    --k-accent-line: #9aa89e;
    --k-focus: var(--hb-brass);

    --k-select-chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236b6f66' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    --k-info-glyph: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M12 11v5'/%3E%3Cpath d='M12 7.6h.01'/%3E%3C/svg%3E");

    --k-footer-bg: var(--hb-green);
    --k-footer-ink: var(--hb-on-green-soft);
    --k-footer-muted: #9fb0a4;
    --k-footer-line: rgb(217 198 160 / .25);

    --k-ok: #3f6e4b;
    --k-warn: #946a1f;
    --k-danger: #9b3b2b;

    --k-shadow-rgb: 28 51 40;
    --k-shadow: 0 1px 2px rgb(var(--k-shadow-rgb) / .06), 0 18px 30px -24px rgb(var(--k-shadow-rgb) / .6);
    --k-shadow-lift: 0 2px 6px rgb(var(--k-shadow-rgb) / .08), 0 30px 60px -40px rgb(var(--k-shadow-rgb) / .5);
}

/* Scale, rhythm and the few numbers the layout is built from. */
:root {
    --k-step--1: .875rem;
    --k-step-0: 1rem;
    --k-step-1: 1.125rem;
    --k-step-2: clamp(1.45rem, 1.15rem + 1.2vw, 1.95rem);
    --k-step-3: clamp(2rem, 1.4rem + 2.6vw, 3.25rem);
    --k-step-4: clamp(2.7rem, 1.5rem + 4.8vw, 5rem);

    --k-gap: 1.75rem;
    --k-gutter: clamp(1rem, 4vw, 2.5rem);
    --k-container: 80rem;
    --k-auth-width: 26rem;   /* the sign-in card, and the flash region above it */
    --k-grid-max: 3;
    --k-header-h: 4.25rem;

    --k-ease: cubic-bezier(.2, .7, .2, 1);
    --k-dur: 180ms;

    --k-z-header: 30;
    --k-z-menu: 40;
    --k-z-grain: 60;
    --k-z-skip: 100;
}

/* Kept for sites whose custom.css keys off the body class the font option
   used to set; the font stacks above already fall back on their own. */
body.has-display-font { --k-font-display: "Libre Caslon Display", "Libre Caslon Text", Georgia, serif; }

/* ----------------------------------------------------------------- 2. texture */

/* Kahuna's film of grain is left out: the Tack Room is flat stone and paper. */

/* ------------------------------------------------- KahunaCart integration */

/*
 * The entire hand-off between this theme and the KahunaCart storefront.
 *
 * The plugin's own stylesheet (assets/kahunacart.css) owns the appearance of
 * every kahunacart-* class in its templates and partials. It resolves each of
 * its internal --kc-* values through the chain
 *
 *     --kahunacart-*  (site or theme override — what this block writes)
 *       -> --grav-*   (a theme's design-token system)
 *       -> --theme-accent (generic hook any theme can publish)
 *       -> neutral fallback that follows the page's own palette
 *
 * so a theme claims the storefront by naming tokens, never by out-specifying
 * the plugin's selectors. Nothing in this block is a rule against plugin
 * markup, and the general answer to "the storefront looks wrong" is a token
 * here or a change in the plugin's CSS — not a selector.
 *
 * These map to Kahuna's own --k-* tokens, which already carry both sides of
 * the palette — so light and dark are both covered by defining the hand-off
 * exactly once.
 */
:root {
    --kahunacart-fg: var(--k-ink);
    --kahunacart-bg: var(--k-bg);
    --kahunacart-muted: var(--k-muted);
    --kahunacart-subtle: var(--k-muted);
    --kahunacart-border: var(--k-line);
    --kahunacart-border-strong: var(--k-line-strong);

    /* Split by job, the way the plugin uses them: --accent is ink and
       borders, --accent-strong is the only one that ever fills a box. */
    --kahunacart-accent: var(--k-brand-strong);
    --kahunacart-accent-strong: var(--k-accent);
    --kahunacart-accent-ink: var(--k-accent-strong);
    --kahunacart-on-accent-strong: var(--k-accent-ink);

    --kahunacart-surface: var(--k-surface);
    --kahunacart-surface-2: var(--k-surface-sunk);
    --kahunacart-surface-sunk: var(--k-surface-sunk);
    --kahunacart-card: var(--k-surface);
    --kahunacart-input: var(--k-surface);

    --kahunacart-radius: var(--k-radius-sm);
    --kahunacart-radius-lg: var(--k-radius);
    --kahunacart-font-mono: var(--k-font-mono);

    --kahunacart-success: var(--k-ok);
    --kahunacart-warning: var(--k-warn);
    --kahunacart-danger: var(--k-danger);

    --kahunacart-ease: var(--k-ease);
    --kahunacart-duration: var(--k-dur);

    /* --- generic tokens, for anything else that reads them ---------------- */
    --theme-accent: var(--k-brand);

    --grav-bg: var(--k-bg);
    --grav-bg-subtle: var(--k-surface-sunk);
    --grav-bg-elevated: var(--k-surface);
    --grav-fg: var(--k-ink);
    --grav-fg-muted: var(--k-muted);
    --grav-fg-subtle: var(--k-muted);
    --grav-border: var(--k-line);
    --grav-border-strong: var(--k-line-strong);
    --grav-radius-md: var(--k-radius-sm);
    --grav-radius-lg: var(--k-radius);
    --grav-font-display: var(--k-font-display);
    --grav-font-mono: var(--k-font-mono);
    --grav-success: var(--k-ok);
    --grav-warning: var(--k-warn);
    --grav-danger: var(--k-danger);
    --grav-header-height: var(--k-header-h);
    --grav-ease: var(--k-ease);
    --grav-duration-2: var(--k-dur);
}

/* --------------------------------------------------------- 3. reset and base */

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

html {
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
    scroll-padding-top: calc(var(--k-header-h) + 1rem);
}

body {
    margin: 0;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    background: var(--k-bg);
    color: var(--k-ink);
    font-family: var(--k-font);
    font-size: var(--k-step-0);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

img, svg, video { max-width: 100%; height: auto; display: block; }

a {
    color: var(--k-brand-strong);
    text-decoration-thickness: 1px;
    text-underline-offset: .2em;
    text-decoration-color: var(--k-brand-line);
    transition: color var(--k-dur) var(--k-ease), text-decoration-color var(--k-dur) var(--k-ease);
}

a:hover { color: var(--k-ink); text-decoration-color: currentColor; }

:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
    outline: 3px solid var(--k-focus);
    outline-offset: 2px;
    border-radius: var(--k-radius-sm);
}

::selection { background: var(--hb-brass-lt); color: var(--k-ink); }

hr {
    border: 0;
    border-top: 1px solid var(--k-line);
    margin: 2.5rem 0;
}

code, kbd, samp, pre { font-family: var(--k-font-mono); font-size: .9em; }

code {
    background: var(--k-surface-sunk);
    border: 1px solid var(--k-line);
    border-radius: 5px;
    padding: .1em .35em;
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after {
        animation-duration: .001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .001ms !important;
    }
}

/* ------------------------------------------------------------ 4. typography */

h1, h2, h3, h4, h5, h6 {
    font-family: var(--k-font-display);
    font-weight: 400;
    line-height: 1.08;
    letter-spacing: 0;
    margin: 0 0 .5em;
    text-wrap: balance;
}

h1, .k-page-title { font-size: var(--k-step-3); font-weight: 400; letter-spacing: -.01em; line-height: 1.05; color: var(--k-brand-strong); }
h2 { font-size: var(--k-step-2); color: var(--k-brand-strong); }
h3 { font-size: var(--k-step-1); font-family: var(--hb-font-serif); font-weight: 700; }
h4, h5, h6 { font-family: var(--k-font); font-size: var(--k-step-0); font-weight: 600; }

p, ul, ol, dl, table, figure, blockquote { margin: 0 0 1.1rem; }

/* Labels: the small-caps voice the theme uses for anything that names a
   region rather than reads as a sentence. One place to change it. */
.k-label-caps, .k-panel-title, .k-section-eyebrow {
    font-family: var(--k-font);
    font-size: .6875rem;
    font-weight: 600;
    letter-spacing: .22em;
    text-transform: uppercase;
    color: var(--k-ink-soft);
}

.k-page-lede {
    font-family: var(--hb-font-serif);
    font-size: var(--k-step-1);
    color: var(--k-ink-soft);
    max-width: 48ch;
    text-wrap: pretty;
}

.k-prose { max-width: 66ch; text-wrap: pretty; font-family: var(--hb-font-serif); font-size: 1.0625rem; line-height: 1.75; }
.k-prose > :last-child { margin-bottom: 0; }
.k-prose h2 { margin-top: 2em; }
.k-prose h3 { margin-top: 1.6em; }
.k-prose li + li { margin-top: .25em; }

.k-prose blockquote {
    border-left: 2px solid var(--hb-brass);
    padding-left: 1.25rem;
    margin-left: 0;
    color: var(--k-ink-soft);
    font-size: 1.08em;
}

.k-prose pre {
    background: var(--k-surface-sunk);
    border: 1px solid var(--k-line);
    border-radius: var(--k-radius-sm);
    padding: 1rem;
    overflow-x: auto;
}

.k-prose pre code { background: none; border: 0; padding: 0; }

.k-prose ul, .k-prose ol { padding-inline-start: 1.4rem; }
.k-prose li::marker { color: var(--k-muted); }
.k-prose h2, .k-prose h3, .k-prose h4 { text-wrap: balance; }
.k-prose strong { color: var(--k-ink); font-weight: 600; }
.k-prose hr { margin-block: 2rem; }

/* Markdown tables. `.k-table` is the class the theme's own templates put on a
   cart or an order table; a table written in a page has no class to give it,
   so the same treatment is written against the element inside prose. */
.k-prose table {
    width: 100%;
    border-collapse: collapse;
    border-top: 1px solid var(--k-line);
    font-size: .95rem;
}

.k-prose :is(th, td) {
    padding: .7rem .9rem;
    text-align: left;
    vertical-align: top;
    border-bottom: 1px solid var(--k-line);
    overflow-wrap: anywhere;
}

.k-prose :is(th, td):last-child { padding-inline-end: 0; }

/* A content table in this theme is nearly always a name and an explanation:
   a short label on the left — "KahunaCart Licenses", "Shortcode Core" — and a
   sentence or two on the right. Automatic table layout shares the width out by
   how much each column wants, and a column of sentences wants far more than a
   column of names, so the names end up in a strip barely wide enough for one
   word and come apart a word per line. Holding the first cell of every row on
   one line asks for exactly the width the longest name needs and leaves the
   whole rest of the table to the explanation. */
.k-prose :is(th, td):first-child {
    padding-inline-start: 0;
    white-space: nowrap;
}

.k-prose thead th {
    padding-block: .55rem;
    font-family: var(--k-font);
    font-size: .72rem;
    font-weight: 500;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--k-muted);
}

.k-prose tbody tr:hover { background: var(--k-surface); }

/* On a phone the two columns can want more room than there is. A markdown
   table has no wrapper to scroll inside — Grav writes the `<table>` straight
   into the content — so the table itself becomes the scroll port, the way the
   plugin's own cart and order tables do at this width: `display: block` puts
   the row groups in a single anonymous table box that keeps the columns lined
   up and is free to be wider than the port. The page then stays put and the
   table is what moves sideways. */
@media (max-width: 40rem) {
    .k-prose table {
        display: block;
        max-inline-size: 100%;
        overflow-x: auto;
        overscroll-behavior-inline: contain;
    }

    /* With the names held on one line there is not much of a phone left for
       the explanation beside them, and a paragraph two words wide is no better
       than a name one word wide. Every column after the first asks for a
       readable measure instead, which is what pushes the table past the port
       and gives the scroll something to do. */
    .k-prose :is(th, td) ~ :is(th, td) { min-inline-size: 15rem; }
}

.k-num, .k-price, .k-tabular { font-variant-numeric: tabular-nums; }

/* ---------------------------------------------------------------- 5. layout */

.k-container {
    width: 100%;
    max-width: var(--k-container);
    margin-inline: auto;
    padding-inline: var(--k-gutter);
}

.k-main {
    flex: 1 0 auto;
    padding-block: clamp(1.75rem, 5vw, 3.5rem) clamp(2.5rem, 6vw, 4.5rem);
}

/* The home page opens with its own hero and needs no top padding of its own. */
body.tmpl-home .k-main { padding-top: 0; }

.k-modular > * + * { margin-top: clamp(2rem, 6vw, 4rem); }

/*
 * An ordinary page — the `default` template, which is what a hand-written
 * markdown page gets.
 *
 * The storefront templates fill the container because they are grids of
 * things. A page of prose is not, and a 68ch measure pinned to the left edge
 * of an 80rem container is a narrow column of text with half a screen of
 * nothing beside it. So the article is centred in the container and the
 * measure stays a measure: nobody wants an 80rem line of text either.
 *
 * The two things in a markdown page that genuinely want more room than a
 * sentence does — a table and a code block — lean out past the measure by
 * `--k-measure-bleed`, which is zero until the viewport is wide enough that
 * leaning out cannot push them off the screen. Everything else stays on the
 * measure, so the left edge of the article is one straight line all the way
 * down.
 *
 * The marketing `home` template is not this; it has its own full-width layout
 * in section 19 and never carries `.k-page`.
 */
.k-page {
    --k-measure: 68ch;
    --k-measure-bleed: 0rem;
    max-width: var(--k-measure);
    margin-inline: auto;
}

/* The measure is the article's now, so the wrapper stops setting a second,
   narrower one of its own. */
.k-page > .k-prose { max-width: none; }

.k-page > .k-prose > :is(table, pre, figure, .k-wide) {
    width: calc(100% + 2 * var(--k-measure-bleed));
    margin-inline: calc(-1 * var(--k-measure-bleed));
}

@media (min-width: 64rem) {
    .k-page { --k-measure-bleed: 5rem; }
}

.k-page-hero { margin-bottom: clamp(1.5rem, 4vw, 2.5rem); }

/* A section heading with an action on the right: "Featured — View all". */
.k-section-head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: .5rem 2rem;
    margin-bottom: 1.5rem;
}

.k-section-head h2 { margin: 0; }
.k-section-eyebrow { display: block; margin-bottom: .5rem; }

.k-link-arrow {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    font-weight: 500;
    text-decoration: none;
    color: var(--k-ink-soft);
    white-space: nowrap;
}

.k-link-arrow::after {
    content: "\2192";
    transition: transform var(--k-dur) var(--k-ease);
}

.k-link-arrow:hover { color: var(--k-brand-strong); }
.k-link-arrow:hover::after { transform: translateX(3px); }

.k-back {
    margin-top: 1.5rem;
    font-size: .93rem;
}

.k-back a { text-decoration: none; color: var(--k-muted); }
.k-back a:hover { color: var(--k-brand-strong); text-decoration: underline; }

.k-empty,
.hb-shop .kahunacart-listing-empty {
    color: var(--k-muted);
    font-size: var(--k-step-1);
}

/* -------------------------------------------------------- 6. header and nav */

.k-skip-link {
    position: absolute;
    left: .75rem;
    top: -4rem;
    z-index: var(--k-z-skip);
    background: var(--k-ink);
    color: var(--k-bg);
    padding: .6rem 1rem;
    border-radius: var(--k-radius-sm);
    text-decoration: none;
    transition: top .15s ease;
}

.k-skip-link:focus { top: .75rem; color: var(--k-bg); }

/* The promo bar, the masthead, the menu and the footer are the Tack Room's
   own and live in tack-room.css. */

/* --------------------------------------------------------------- 8. buttons */

/*
 * `.button` is the class the plugin's partials and the Form plugin both emit,
 * so it is the one the theme styles. A bare <button type="submit"> with no
 * class gets the same treatment; one that carries its own class (the plugin's
 * link-style buttons, for instance) is left to its own stylesheet.
 *
 * `a.button` is named for the same reason `button.button` is. KahunaCart's own
 * stylesheet carries a fallback at `.kahunacart :where(.button)`, which lands
 * at the weight of a single class and loads after this file, so a plain
 * `.button` selector loses the tie on source order anywhere inside a
 * storefront section. That is why "Add to cart" on a product page came out as
 * the theme's filled pill — it is a <button>, and `button.button` outweighs
 * the fallback — while "View details" on a listing card, an <a>, came out in
 * the plugin's small outlined box next to it. Naming the element puts every
 * button the theme draws in the same style.
 */
.button,
a.button,
button.button,
button[type="submit"]:not([class]) {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .6rem;
    min-height: 3.125rem;
    padding: .5rem 1.875rem;
    border: 1px solid var(--k-accent);
    border-radius: var(--k-radius-btn);
    background: var(--k-accent);
    color: var(--k-accent-ink);
    font: inherit;
    font-family: var(--k-font);
    font-weight: 600;
    font-size: .75rem;
    letter-spacing: .2em;
    text-transform: uppercase;
    line-height: 1.2;
    text-decoration: none;
    cursor: pointer;
    transition: transform var(--k-dur) var(--k-ease), background-color var(--k-dur) var(--k-ease),
                border-color var(--k-dur) var(--k-ease), box-shadow var(--k-dur) var(--k-ease);
}

.button:hover,
a.button:hover,
button.button:hover,
button[type="submit"]:not([class]):hover {
    background: var(--k-accent-strong);
    border-color: var(--k-accent-strong);
    color: var(--k-accent-ink);
}

.button:active,
a.button:active,
button.button:active,
button[type="submit"]:not([class]):active {
    background: var(--hb-green);
}

.button[disabled], .button.is-disabled, button[disabled] {
    opacity: .5;
    pointer-events: none;
}

.k-button--ghost,
a.k-button--ghost,
button.k-button--ghost {
    background: transparent;
    border-color: var(--hb-green);
    color: var(--hb-green);
}

.k-button--ghost:hover,
a.k-button--ghost:hover,
button.k-button--ghost:hover {
    background: var(--hb-green);
    border-color: var(--hb-green);
    color: var(--hb-on-green);
}

.k-button--ink,
a.k-button--ink,
button.k-button--ink {
    background: var(--k-ink);
    border-color: var(--k-ink);
    color: var(--k-bg);
}

.k-button--ink:hover,
a.k-button--ink:hover,
button.k-button--ink:hover {
    background: var(--k-ink-soft);
    border-color: var(--k-ink-soft);
    color: var(--k-bg);
}

.k-button--lg, a.k-button--lg, button.k-button--lg { padding: .9rem 1.75rem; font-size: 1.02rem; }
.k-button--sm, a.k-button--sm, button.k-button--sm { padding: .45rem .9rem; font-size: .85rem; }

.k-button--block,
a.k-button--block,
button.k-button--block {
    width: 100%;
    margin-top: .5rem;
}

.k-remove {
    width: 2rem;
    height: 2rem;
    padding: 0;
    border: 1px solid transparent;
    border-radius: 50%;
    background: transparent;
    color: var(--k-muted);
    font-size: 1.15rem;
    line-height: 1;
    cursor: pointer;
    transition: color var(--k-dur) var(--k-ease), border-color var(--k-dur) var(--k-ease);
}

.k-remove:hover {
    border-color: var(--k-danger);
    color: var(--k-danger);
}

/* ----------------------------------------------------------------- 9. forms */

.k-input, .k-select,
input[type="text"], input[type="email"], input[type="number"],
input[type="tel"], input[type="url"], input[type="password"],
input[type="search"], textarea, select,
.kahuna-input, .kahuna-select {
    width: 100%;
    padding: .66rem .85rem;
    border: 1px solid var(--k-line-strong);
    border-radius: var(--k-radius-sm);
    background: var(--k-surface);
    color: var(--k-ink);
    font: inherit;
    line-height: 1.4;
    transition: border-color var(--k-dur) var(--k-ease), box-shadow var(--k-dur) var(--k-ease);
}

textarea { resize: vertical; min-height: 5.5rem; }

input::placeholder, textarea::placeholder { color: var(--k-muted); opacity: .8; }

input:focus, textarea:focus, select:focus {
    border-color: var(--k-brand);
    outline: none;
    box-shadow: 0 0 0 3px var(--k-focus);
}

/*
 * A select, which the rule above never actually reached.
 *
 * Two things were happening to Country and State on checkout. The browser
 * still draws a select itself, and on macOS it draws a shorter box that
 * ignores the background and the radius above; and the plugin's own storefront
 * sheet loads after this one and carries `.kahunacart :where(select)` at the
 * weight of a single class — which ties with `.k-select` and wins on order, so
 * the selects took the plugin's padding and the plugin's ground while every
 * text box beside them kept the theme's. Two controls in the middle of the
 * billing address sat short of their neighbours in a colour from nowhere.
 *
 * So the box is stated here in full rather than inherited, `appearance: none`
 * hands it back from the browser, and the selector is written twice — once
 * bare for a page outside the shop, once under `.kahuna` to outweigh the
 * plugin, the same trick the fieldsets above use for the same reason.
 *
 * The state select the script swaps in when the country changes is this same
 * element, in the markup from the first paint with these classes on it, and
 * the plugin's own class names are in the list too, so a page that renders the
 * partial without the theme's classes is caught as well.
 */
select, .k-select,
.kahunacart-country-select, .kahunacart-region-select,
.kahuna select, .kahuna .k-select,
.kahuna .kahunacart-country-select, .kahuna .kahunacart-region-select {
    appearance: none;
    -webkit-appearance: none;
    box-sizing: border-box;
    width: 100%;
    /* The right side carries the arrow; the other three are `.k-input`'s. */
    padding: .66rem 2.3rem .66rem .85rem;
    border: 1px solid var(--k-line-strong);
    border-radius: var(--k-radius-sm);
    background-color: var(--k-surface);
    background-image: var(--k-select-chevron);
    background-repeat: no-repeat;
    background-position: right .85rem center;
    background-size: .7rem .7rem;
    color: var(--k-ink);
    font: inherit;
    /* Stated rather than left to the control: a native select sizes itself
       from the option text and ignored the line-height that gives every text
       box its height. */
    line-height: 1.4;
    min-height: 0;
    text-overflow: ellipsis;
}

select::-ms-expand { display: none; }

/* Sections of a form. Not boxes: a hairline above and a heading, so a long
   checkout reads as one document with parts rather than a stack of cards. */
/* `.kahuna` in front of each: the plugin boxes every fieldset under its
   `.kahunacart` wrapper at the same weight, and loads after this sheet. */
.kahuna .kahuna-form fieldset {
    border: 0;
    border-top: 1px solid var(--k-line);
    border-radius: 0;
    background: none;
    padding: 1.5rem 0 0;
    margin: 0 0 2rem;
    min-width: 0;
}

.kahuna .kahuna-form legend {
    float: left;            /* renders as an ordinary block instead of sitting in the border */
    width: 100%;
    margin: 0 0 1.1rem;
    padding: 0;
    font-family: var(--k-font-display);
    font-weight: 600;
    font-size: 1.35rem;
    letter-spacing: -.015em;
}

.kahuna .kahuna-form legend + * { clear: both; }

.k-field, .kahuna-field { margin: 0; }
.k-field--wide { grid-column: 1 / -1; }

.k-label, .kahuna-label {
    display: block;
    margin-bottom: .35rem;
    font-size: .86rem;
    font-weight: 500;
    color: var(--k-ink-soft);
}

.k-checkbox {
    display: flex;
    align-items: flex-start;
    gap: .6rem;
    margin-top: 1rem;
    font-size: .95rem;
    cursor: pointer;
}

.k-checkbox input { width: auto; margin-top: .25rem; accent-color: var(--k-brand); }

.k-hint--warn { color: var(--k-warn); }

.kahuna-form-errors, .form-errors {
    border-left: 3px solid var(--k-danger);
    background: color-mix(in srgb, var(--k-danger) 8%, var(--k-surface));
    color: var(--k-danger);
    padding: .6rem .9rem;
    border-radius: var(--k-radius-sm);
}

.kahuna-form-actions { margin-top: 1rem; display: flex; gap: .6rem; flex-wrap: wrap; }

/* ---------------------------------------------------------------- 10. tables */

/* The receipt's item table is KahunaCart's own; it takes the same rules. */

:is(.k-table, .k-order .kahunacart-order-items) {
    width: 100%;
    border-collapse: collapse;
    border-top: 1px solid var(--k-line);
}

:is(.k-table, .k-order .kahunacart-order-items) th, :is(.k-table, .k-order .kahunacart-order-items) td {
    padding: 1rem .75rem;
    text-align: left;
    border-bottom: 1px solid var(--k-line);
    vertical-align: middle;
}

:is(.k-table, .k-order .kahunacart-order-items) th:first-child, :is(.k-table, .k-order .kahunacart-order-items) td:first-child { padding-left: 0; }
:is(.k-table, .k-order .kahunacart-order-items) th:last-child, :is(.k-table, .k-order .kahunacart-order-items) td:last-child { padding-right: 0; }

:is(.k-table, .k-order .kahunacart-order-items) thead th {
    padding-block: .6rem;
    font-family: var(--k-font);
    font-size: .72rem;
    font-weight: 500;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--k-muted);
}

:is(.k-table, .k-order .kahunacart-order-items) .k-num { text-align: right; font-variant-numeric: tabular-nums; }

.k-qty-input { width: 4.5rem; margin-left: auto; text-align: center; }

/* A line whose quantity an add-on decided: a number where the box would be,
   on the same right edge and in the same figures, so the column still reads
   as a column. */
.k-qty-fixed { display: inline-block; padding: .45rem 0; font-variant-numeric: tabular-nums; }

.k-cart-item-title { font-weight: 600; display: block; }
.k-cart-item-sku { color: var(--k-muted); font-size: .78rem; font-family: var(--k-font); }
.k-cart-line-total { font-family: var(--k-font-display); font-weight: 600; font-size: 1.05rem; }

/* Narrow screens: the row becomes a card and each cell labels itself. */
@media (max-width: 40rem) {
    :is(.k-table, .k-order .kahunacart-order-items), :is(.k-table, .k-order .kahunacart-order-items) tbody, :is(.k-table, .k-order .kahunacart-order-items) tr, :is(.k-table, .k-order .kahunacart-order-items) td { display: block; width: 100%; }
    :is(.k-table, .k-order .kahunacart-order-items) thead { display: none; }

    :is(.k-table, .k-order .kahunacart-order-items) tr {
        border-bottom: 1px solid var(--k-line);
        padding: .6rem 0;
    }

    :is(.k-table, .k-order .kahunacart-order-items) td {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 1rem;
        border-bottom: 0;
        padding: .35rem 0;
        text-align: right;
    }

    :is(.k-table, .k-order .kahunacart-order-items) td::before {
        content: attr(data-label);
        font-family: var(--k-font);
        font-size: .7rem;
        font-weight: 500;
        letter-spacing: .12em;
        text-transform: uppercase;
        color: var(--k-muted);
        text-align: left;
    }

    :is(.k-table, .k-order .kahunacart-order-items) td:not([data-label]) { justify-content: flex-end; }
    .k-qty-input { width: 4.5rem; }

    /* The product cell holds a title and a SKU; stacked under their label
       rather than fighting for one line. */
    :is(.k-table, .k-order .kahunacart-order-items) td:first-child {
        flex-direction: column;
        align-items: flex-start;
        gap: .1rem;
        text-align: left;
    }
}

/* --------------------------------------------------- 11. callouts & notices */

.k-callout {
    border: 1px solid var(--k-brand-line);
    border-left-width: 3px;
    background: var(--k-brand-soft);
    border-radius: var(--k-radius-sm);
    padding: 1.1rem 1.25rem;
    margin-bottom: 1.5rem;
}

.k-callout > :last-child { margin-bottom: 0; }

.k-callout--warn {
    border-color: color-mix(in srgb, var(--k-warn) 45%, var(--k-line));
    background: color-mix(in srgb, var(--k-warn) 9%, var(--k-surface));
}

/*
 * Flash messages — "Login failed", "Your address was saved", every one-line
 * answer a plugin gives a form. Drawn by `partials/messages.html.twig` for
 * Grav and the Login plugin, and reused below for KahunaCart's own message
 * partial so a storefront never has two vocabularies for the same event.
 *
 * A callout is a box the page author put there; a notice is the site
 * answering, and it has one job — to be seen. Hence the filled mark, the
 * shadow and the ink-weight text, none of which the callout has.
 */
.k-notices { display: grid; gap: .75rem; margin-bottom: 1.75rem; }

.k-notice,
.kahuna .kahunacart-message {
    display: flex;
    align-items: flex-start;
    gap: .85rem;
    margin: 0;
    padding: .95rem 1.15rem;
    border: 1px solid var(--k-line-strong);
    border-inline-start: 4px solid var(--k-muted);
    border-radius: var(--k-radius-sm);
    background: var(--k-surface);
    box-shadow: var(--k-shadow);
    color: var(--k-ink);
    font-weight: 500;
    text-wrap: pretty;
}

.k-notice-body > :first-child { margin-top: 0; }
.k-notice-body > :last-child { margin-bottom: 0; }
.k-notice a,
/* The plugin's notice is one paragraph with no mark, and its text can carry a
   link. Flex would turn each run of text and the link into separate items with
   a gap between them, so it lays out as ordinary running text. */
.kahuna .kahunacart-message { display: block; }
.kahuna .kahunacart-message a { color: var(--k-ink); text-decoration-color: currentColor; }
.kahuna .kahunacart-message a:hover { text-decoration-thickness: 2px; }

/* One character in a filled disc. Not an icon font and not an SVG per scope:
   the glyph is set from the scope class, so a new scope is one rule. */
.k-notice-mark {
    flex: none;
    width: 1.5rem;
    height: 1.5rem;
    margin-top: .1rem;
    border-radius: 50%;
    background: var(--k-muted);
    color: var(--k-surface);
    font-family: var(--k-font-display);
    font-size: .95rem;
    font-weight: 800;
    line-height: 1.5rem;
    text-align: center;
}

.k-notice-mark::before { content: "i"; }

.k-notice--error,
.kahuna .kahunacart-message--error {
    border-inline-start-color: var(--k-danger);
    background: color-mix(in srgb, var(--k-danger) 12%, var(--k-surface));
    border-color: color-mix(in srgb, var(--k-danger) 35%, var(--k-line));
}

.k-notice--error .k-notice-mark { background: var(--k-danger); }
.k-notice--error .k-notice-mark::before { content: "!"; }

.k-notice--warning,
.kahuna .kahunacart-message--warning {
    border-inline-start-color: var(--k-warn);
    background: color-mix(in srgb, var(--k-warn) 12%, var(--k-surface));
    border-color: color-mix(in srgb, var(--k-warn) 35%, var(--k-line));
}

.k-notice--warning .k-notice-mark { background: var(--k-warn); }
.k-notice--warning .k-notice-mark::before { content: "!"; }

.k-notice--success,
.kahuna .kahunacart-message--success {
    border-inline-start-color: var(--k-ok);
    background: color-mix(in srgb, var(--k-ok) 12%, var(--k-surface));
    border-color: color-mix(in srgb, var(--k-ok) 35%, var(--k-line));
}

.k-notice--success .k-notice-mark { background: var(--k-ok); }
.k-notice--success .k-notice-mark::before { content: "\2713"; }

.kahuna .kahunacart-message--info {
    border-inline-start-color: var(--k-brand);
    background: var(--k-brand-soft);
    border-color: var(--k-brand-line);
}

/* A notice that carries an action. The cart's frozen-payment warning is the
   only one so far: it says a payment page is still open at the provider, and
   the button under it is the shopper's only way out of a cart that will not
   change until the payment is finished or cancelled. The paragraph is tightened
   because a notice is a denser thing than the prose the browser's default
   margin is written for. */
.kahunacart-payment-open .k-notice-body p { margin: 0 0 .7rem; }
.kahunacart-payment-open .k-notice-body form { margin: 0; }

/* The bundle notice: a cheaper way to buy what is already in the basket, with
   the swap and a plain "keep them separate" side by side under it. */
.kahunacart-bundle-suggestion .k-notice-body p { margin: 0 0 .7rem; }

/* --------------------------------- 12. storefront: listing head, grid, cards */

/* The listing's masthead: title and count on the left, the search on the
   right, one hairline under both. */
.k-shop-head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem 2.5rem;
    margin-bottom: clamp(1.5rem, 4vw, 2.5rem);
    padding-bottom: 1.25rem;
    border-bottom: 1px solid var(--k-line);
}

.k-shop-head-text { min-width: 0; flex: 1 1 22rem; }
.k-shop-head .k-page-title { margin-bottom: .25rem; }
.k-shop-head .k-page-lede { margin: .5rem 0 0; }
.k-shop-head > :last-child { margin-bottom: 0; }

.k-shop-count {
    display: block;
    font-family: var(--k-font);
    font-size: .75rem;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--k-muted);
    margin-top: .5rem;
}

/*
 * The search form: KahunaCart's own partial, dressed through the plugin's
 * class names, so a store that drops the form somewhere else gets the same
 * control. On the search page the plugin's script makes it live and hides the
 * Search button.
 *
 * `.k-search` is only the masthead's sizing wrapper; the form dresses itself.
 */
.k-search { flex: 0 1 24rem; min-width: min(100%, 16rem); }
.kahuna .kahunacart-search { display: flex; gap: .5rem; margin: 0 0 1.5rem; }
.k-search .kahunacart-search { margin-bottom: 0; }
.kahuna .kahunacart-search-field { flex: 1; margin: 0; }

.kahuna .kahunacart-search input[type="search"] {
    border-radius: var(--k-radius-btn);
    padding-inline: 1.1rem;
}

.kahuna .kahunacart-search .button {
    background: transparent;
    border-color: var(--k-line-strong);
    color: var(--k-ink);
}

.kahuna .kahunacart-search .button:hover { border-color: var(--k-ink); background: var(--k-surface); box-shadow: none; }

/*
 * The search page's results region, which the plugin's live search replaces
 * as the box is typed in. It carries `.is-loading` for the length of a
 * request. Fading it a little is the whole loading state: a spinner over a
 * grid that is about to be replaced by a nearly identical grid is more
 * movement than information.
 */
#kahunacart-search-results {
    transition: opacity var(--k-dur) var(--k-ease);
}

#kahunacart-search-results.is-loading { opacity: .5; }

/* The line above the grid — the shop's product count, or what a search
   matched. Both say the same kind of thing in the same place, and after a
   live swap one has literally replaced the other, so they share a voice. */
.kahuna .kahunacart-search-summary {
    margin: 0 0 1.25rem;
    font-family: var(--k-font);
    font-size: .75rem;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--k-muted);
}

.kahuna .kahunacart-search-more {
    margin-top: 1.5rem;
    color: var(--k-muted);
    font-size: .93rem;
}

/* grid -------------------------------------------------------------------- */

.k-grid {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: clamp(1.25rem, 3vw, var(--k-gap)) var(--k-gap);
    grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr));
}

@media (min-width: 64rem) {
    .k-grid { grid-template-columns: repeat(var(--k-grid-max), minmax(0, 1fr)); }
}

/* cards ------------------------------------------------------------------- */

/*
 * No border, no shadow, no box. A product tile is the picture and two lines
 * of text under it; the grid gap does the separating and the hover lives in
 * the picture. Boxes are for things that need to be lifted off the page, and
 * a catalog is the page.
 */
.k-card,
.kahuna .k-card.kahunacart-product-card {
    position: relative;
    display: flex;
    flex-direction: column;
    min-width: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: none;
    box-shadow: none;
}

.kahuna .k-card:hover { transform: none; box-shadow: none; }

.k-card-link {
    display: flex;
    flex-direction: column;
    gap: .8rem;
    flex: 1;
    color: inherit;
    text-decoration: none;
}

.k-card-link:hover { color: inherit; }

.k-card-body {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: .15rem .9rem;
    align-items: baseline;
}

.k-card-title {
    grid-column: 1;
    margin: 0;
    font-family: var(--k-font);
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: -.005em;
    line-height: 1.3;
    text-decoration: underline transparent;
    text-underline-offset: .2em;
    text-decoration-thickness: 1px;
    transition: text-decoration-color var(--k-dur) var(--k-ease);
}

.k-card-link:hover .k-card-title { text-decoration-color: var(--k-brand); }

.k-card-price,
.kahuna .k-card .k-card-price {
    grid-column: 2;
    margin: 0;
    font-family: var(--k-font-display);
    font-weight: 600;
    font-size: 1.08rem;
    color: var(--k-ink);
    white-space: nowrap;
}

.k-card-summary {
    grid-column: 1 / -1;
    margin: .1rem 0 0;
    color: var(--k-muted);
    font-size: .9rem;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.k-card-stock { grid-column: 1 / -1; margin-top: .25rem; }

/* The lead tile of a grid that has one: twice the width, twice the height,
   and a picture that fills whatever the two rows beside it add up to. */
@media (min-width: 64rem) {
    .k-grid--lead > .k-card:first-child { grid-column: span 2; grid-row: span 2; }
    .k-grid--lead > .k-card:first-child .k-card-title { font-size: 1.2rem; }
    .k-grid--lead > .k-card:first-child .k-card-price { font-size: 1.3rem; }
}

/* flags on a tile ---------------------------------------------------------- */

.k-badge {
    display: inline-block;
    padding: .22rem .55rem;
    border-radius: 4px;
    font-family: var(--k-font);
    font-size: .66rem;
    font-weight: 600;
    letter-spacing: .1em;
    text-transform: uppercase;
    line-height: 1.3;
    background: var(--k-bg-alt);
    color: var(--k-ink-soft);
}

.k-badge--paid { background: color-mix(in srgb, var(--k-ok) 16%, transparent); color: var(--k-ok); }
/* Part paid sits with awaiting payment for the same reason: money is still
   owed on the order. */
.k-badge--pending,
.k-badge--partially_paid { background: color-mix(in srgb, var(--k-warn) 16%, transparent); color: var(--k-warn); }
.k-badge--failed,
.k-badge--refunded,
.k-badge--partially_refunded { background: color-mix(in srgb, var(--k-danger) 14%, transparent); color: var(--k-danger); }

/* price and stock --------------------------------------------------------- */

.k-price {
    font-family: var(--k-font-display);
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    margin: 0;
}

.k-price--lead { font-size: var(--k-step-2); color: var(--k-accent-strong); }

.k-price-was {
    margin-left: .4rem;
    color: var(--k-muted);
    font-weight: 400;
    font-size: .78em;
    white-space: nowrap;
}

/*
 * A price a campaign has reduced, on a tile, in the hero stack and up beside a
 * product title. See the plugin's docs/sales.md for what decides it.
 *
 * The number takes the store's action colour rather than the plugin's
 * --kc-danger. A Kahuna tile already carries a badge naming the campaign, and
 * two urgent-red elements on one line read as an error state rather than as an
 * offer. The struck figure keeps the muted treatment the compare-at price has
 * always had — whichever claim put it there, it is the number nobody is paying.
 *
 * The card and hero rules restate the selector because both set a colour and a
 * nowrap of their own; letting the pair wrap is what keeps a long reduced price
 * from pushing a narrow tile sideways.
 */
.k-price--sale,
.kahuna .k-card .k-card-price.k-price--sale { color: var(--k-accent-strong); }

.k-card-price.k-price--sale,
.k-hero-card-price.k-price--sale { white-space: normal; }

/* The campaign's name beside the lead price, in the same pill the tiles carry,
   so a shopper meets the same badge twice on the way to the button. */
.k-price-badge { margin-left: .55rem; vertical-align: .2em; }

.k-price-was[hidden],
.k-price-badge[hidden] { display: none; }

.k-stock {
    font-size: .78rem;
    font-weight: 600;
    letter-spacing: .02em;
}

.k-stock--in { color: var(--k-ok); }
.k-stock--low { color: var(--k-warn); }
.k-stock--out { color: var(--k-danger); }
.k-stock--backorder { color: var(--k-warn); }
/* The stock line above already says it, so the plugin's own note beside the
   buy button would say it twice. The picker's status line stays: it follows
   the variant the shopper picks, which the stock line does not. */
.k-product-detail .kahunacart-backorder-note { display: none; }
.k-stock-line { margin: 0 0 1rem; min-height: 1.2rem; }

/*
 * "Notify me when it's back" (KahunaCart 1.3.5). The plugin draws it under
 * its buy form, in its own box, wherever the chosen variant can't be bought.
 * Here it sits flush under the buy box as one quiet panel in the theme's
 * surface and radius, the email field matches the theme's inputs, and "We'll
 * email you" takes the in-stock green so it reads as done. [hidden] is
 * restated because the flex rule would otherwise beat it, and the plugin's
 * script hides and shows the block as the variant changes.
 */
.k-buy .kahunacart-stock-alert {
    margin: .75rem 0 0;
    padding: 1rem 1.15rem;
    border: 1px solid var(--k-line);
    border-radius: var(--k-radius-sm);
    background: var(--k-surface);
}
.k-buy .kahunacart-stock-alert[hidden],
.k-buy .kahunacart-stock-alert [hidden] { display: none; }
.k-buy .kahunacart-stock-alert-email input {
    min-width: 15rem;
    padding: .55rem .8rem;
    border: 1px solid var(--k-line-strong);
    border-radius: var(--k-radius-sm);
    background: var(--k-bg);
    color: var(--k-ink);
    font: inherit;
}
.k-buy .kahunacart-stock-alert-email span,
.k-buy .kahunacart-stock-alert-which span {
    font-size: .85rem;
    color: var(--k-ink-soft);
}
.k-buy .kahunacart-stock-alert-watching { color: var(--k-ok); }
.k-buy .kahunacart-stock-alert-note,
.k-buy .kahunacart-stock-alert-status { color: var(--k-muted); font-size: .82rem; }

/* ------------------------------------------------------- 13. product detail */

.k-product-layout {
    display: grid;
    gap: clamp(1.5rem, 5vw, 4rem);
    align-items: start;
}

@media (min-width: 52rem) {
    .k-product-layout { grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); }
    .k-product-figure { position: sticky; top: calc(var(--k-header-h) + 1.5rem); }
}

/* gallery ----------------------------------------------------------------- */

/*
 * The product gallery is KahunaCart's own partial, dressed through its
 * kahunacart-gallery-* classes. Every selector here is under
 * .k-product-figure, which puts it ahead of the plugin's single-class rules.
 *
 * No JavaScript is involved, and none should be: the pictures are a
 * scroll-snapping row and the thumbnails are ordinary in-page links to them,
 * so swapping the image works with a click, a swipe, a keyboard and with
 * scripting off.
 */
.k-product-figure .kahunacart-gallery {
    display: flex;
    flex-direction: column;
    gap: .75rem;
    margin: 0;
}

.k-product-figure .kahunacart-gallery-main {
    display: flex;
    gap: .75rem;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    scrollbar-width: none;
    border-radius: var(--k-radius);
}

.k-product-figure .kahunacart-gallery-main::-webkit-scrollbar { display: none; }

.k-product-figure .kahunacart-gallery-main:focus-visible {
    outline: 3px solid var(--k-focus);
    outline-offset: 3px;
}

.k-product-figure .kahunacart-gallery-slide {
    flex: 0 0 100%;
    margin: 0;
    scroll-snap-align: center;
}

.k-product-figure .kahunacart-gallery-slide img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: var(--k-radius);
    background: var(--k-surface-sunk);
}

.k-product-figure .kahunacart-gallery-thumbs {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.k-product-figure .kahunacart-gallery-thumbs a {
    display: block;
    overflow: hidden;
    border: 1px solid var(--k-line);
    border-radius: var(--k-radius-sm);
    background: var(--k-surface-sunk);
    transition: border-color var(--k-dur) var(--k-ease);
}

.k-product-figure .kahunacart-gallery-thumbs a:hover,
.k-product-figure .kahunacart-gallery-thumbs a:focus-visible { border-color: var(--k-ink); }

.k-product-figure .kahunacart-gallery-thumbs img {
    display: block;
    width: 64px;
    height: 64px;
    aspect-ratio: 1 / 1;
    object-fit: cover;
}

@media (prefers-reduced-motion: reduce) {
    .k-product-figure .kahunacart-gallery-main { scroll-behavior: auto; }
}

/* the detail column ------------------------------------------------------- */

.k-product-title { margin-bottom: .6rem; }

.k-product-summary {
    color: var(--k-ink-soft);
    font-size: var(--k-step-1);
    text-wrap: pretty;
    max-width: 44ch;
}

.k-buy { margin-top: 1.25rem; }

/* "incl. VAT" under a price, when the store turns the plugin's tax note on.
   Quiet and on its own line under the lead price; on a card, one size down. */
.k-price-note {
    display: block;
    margin-top: .3rem;
    font-size: .8rem;
    font-weight: 400;
    letter-spacing: 0;
    color: var(--k-muted);
}

.k-card .k-price-note,
.k-hero-card .k-price-note { margin-top: .15rem; font-size: .75rem; }

/* Product labels (KahunaCart 1.3.5): the EU energy class arrow, its "Product
   information sheet" link and any label image, under the lead price. The
   arrow is sized in em by the plugin, so it follows the price's size; the
   sheet link takes the theme's quiet link style. */
.k-product-detail .kahunacart-labels { margin: .6rem 0 0; }
.k-product-detail .kahunacart-label-sheet {
    font-size: .8rem;
    color: var(--k-ink-soft);
    text-decoration: underline;
    text-underline-offset: .2em;
}
.k-product-detail .kahunacart-label-sheet:hover { color: var(--k-brand); }

/* On a tile the arrow sits under the card's text: outside the tile's own link,
   because it is a link to the full label. */
.k-card-labels { margin-top: .45rem; font-size: .85rem; }
.k-card-labels .kahunacart-labels { margin: 0; }

/* A gallery picture that opens full size. */
.k-product-figure .kahunacart-gallery-zoom { display: block; cursor: zoom-in; }
.k-product-figure .kahunacart-gallery-zoom:focus-visible {
    outline: 2px solid var(--k-brand);
    outline-offset: 3px;
    border-radius: var(--k-radius);
}

/* The facts under the buy box: SKU, kind, anything else a template adds.
   A definition list laid out as rows with a label column. */
.k-facts {
    display: grid;
    grid-template-columns: max-content minmax(0, 1fr);
    gap: .35rem 1.25rem;
    margin: 1.5rem 0 0;
    padding-top: 1.25rem;
    border-top: 1px solid var(--k-line);
    font-size: .9rem;
}

.k-facts dt {
    font-family: var(--k-font);
    font-size: .7rem;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--k-muted);
    padding-top: .2rem;
}

.k-facts dd { margin: 0; color: var(--k-ink-soft); }
.k-facts code { font-size: .82rem; }

.k-product-description {
    margin-top: clamp(2.5rem, 6vw, 4rem);
    padding-top: clamp(1.5rem, 4vw, 2.5rem);
    border-top: 1px solid var(--k-line);
    display: grid;
    gap: 1rem 3rem;
}

@media (min-width: 52rem) {
    .k-product-description { grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); }
    .k-product-description > .k-prose { grid-column: 2; }
}

.k-product-description-head { margin: 0; }

/* ------------------ 14. catalog: sidebar, tree, filters, crumbs, tags */

/*
 * The catalog sidebar and the taxonomy blocks around it.
 *
 * This is the other large place the theme dresses markup it does not write.
 * The tree, the facet panel, the breadcrumb trail, the subcategory cards and
 * the tag list are all plugin partials, included whole and never forked — so
 * there is no element here the theme can hang a k-* class on, and the only
 * way to give them Kahuna's own furniture is to reach in.
 *
 * Every rule below is therefore scoped under a theme class the theme *does*
 * own: .k-catalog on the layout wrapper, .k-shop or .k-product on the page
 * section. Two classes beats the plugin's one whichever sheet loads last.
 *
 * What is NOT here is colour. The token hand-off at the top of this file
 * already resolves every --kc-* the plugin's stylesheet reads into a Kahuna
 * value. These rules take the plugin's panels *away* — the rail is a column
 * of typography with hairlines, not a stack of boxes beside a grid.
 */

/* layout ------------------------------------------------------------------ */

.k-shop .k-catalog {
    display: grid;
    gap: clamp(1.5rem, 4vw, 3rem);
    align-items: start;
}

@media (min-width: 52rem) {
    .k-shop .k-catalog { grid-template-columns: 15rem minmax(0, 1fr); }
    .k-catalog .kahunacart-catalog-nav { position: sticky; top: calc(var(--k-header-h) + 1.5rem); }
}

/* minmax(0, 1fr) above, and min-width: 0 here: both stop a wide product card
   from setting the column's floor and shoving the rail off the page. */
.k-shop .k-catalog-main { min-width: 0; }

/* The grid is living in a column, not in the container, so it auto-fills
   until the container is wide enough to give the column its own columns. */
.k-catalog-main .k-grid { grid-template-columns: repeat(auto-fill, minmax(13rem, 1fr)); }

@media (min-width: 78rem) {
    .k-catalog-main .k-grid { grid-template-columns: repeat(var(--k-grid-max), minmax(0, 1fr)); }
}

/* the rail ---------------------------------------------------------------- */

.k-catalog .kahunacart-catalog-nav {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    font-size: .93rem;
}

.k-catalog .kahunacart-cat-tree,
.k-catalog .kahunacart-filters {
    border: 0;
    border-radius: 0;
    background: none;
    box-shadow: none;
    padding: 0;
}

.k-catalog .kahunacart-filters {
    border-top: 1px solid var(--k-line);
    padding-top: 1.5rem;
}

.k-catalog .kahunacart-nav-title,
.k-catalog .kahunacart-filters legend:not(.kahunacart-visually-hidden) {
    font-family: var(--k-font);
    font-size: .7rem;
    font-weight: 500;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--k-muted);
    margin: 0 0 .8rem;
    padding: 0;
}

/* the tree ---------------------------------------------------------------- */

/*
 * One column system, at every depth.
 *
 * The browser's own `<details>` marker is what the plugin uses, and in a rail
 * it does not line up with anything: it is laid out as a list marker outside
 * the summary's box, its width depends on the platform, and a leaf row — which
 * has no marker at all — starts somewhere else entirely. Three depths of that
 * and no two labels share a left edge.
 *
 * So the marker is taken away and every row is built the same way: a fixed
 * `--k-tree-slot` for the chevron, then the label. A leaf gets the slot
 * as empty space rather than as nothing, which is what makes "Tops" line up
 * with "Womens" whether or not either has children. The indent guide is drawn
 * down the centre of the parent's slot, so it points at the chevron it belongs
 * to, and stops half a row short of the bottom so it ends on the last child
 * rather than dangling past it.
 */
.k-catalog .kahunacart-cat-tree {
    --k-tree-slot: 1.35rem;   /* the chevron column, present on every row */
    --k-tree-indent: 1.15rem; /* how far one depth steps in */
    --k-tree-row: 1.9rem;     /* one row, for the guide's bottom stop */
    --k-tree-chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m9 5 7 7-7 7'/%3E%3C/svg%3E");
}

.k-catalog .kahunacart-cat-list .kahunacart-cat-list {
    position: relative;
    margin: .1rem 0 .35rem calc(var(--k-tree-slot) / 2);
    padding-inline-start: calc(var(--k-tree-indent) - var(--k-tree-slot) / 2);
    border-inline-start: 0;
}

.k-catalog .kahunacart-cat-list .kahunacart-cat-list::before {
    content: "";
    position: absolute;
    inset-block: 0 calc(var(--k-tree-row) / 2);
    inset-inline-start: 0;
    width: 1px;
    background: var(--k-line);
}

.k-catalog .kahunacart-cat-item + .kahunacart-cat-item { margin-top: .1rem; }

/* A row with children. Flex rather than the list-item display the plugin
   sets, which is what puts the marker back outside the box. */
.k-catalog .kahunacart-cat-summary {
    display: flex;
    align-items: center;
    list-style: none;
    padding: 0;
}

.k-catalog .kahunacart-cat-summary::-webkit-details-marker { display: none; }

.k-catalog .kahunacart-cat-summary::before {
    content: "";
    flex: none;
    width: var(--k-tree-slot);
    height: var(--k-tree-row);
    background-color: var(--k-line-strong);
    -webkit-mask: var(--k-tree-chevron) no-repeat center / .55rem .55rem;
    mask: var(--k-tree-chevron) no-repeat center / .55rem .55rem;
    transition: transform var(--k-dur) var(--k-ease), background-color var(--k-dur) var(--k-ease);
}

.k-catalog .kahunacart-cat-branch[open] > .kahunacart-cat-summary::before { transform: rotate(90deg); }
.k-catalog .kahunacart-cat-summary:hover::before { background-color: var(--k-brand); }

/* The empty slot that keeps a leaf's label on the same line as its cousins'. */
.k-catalog .kahunacart-cat-item > .kahunacart-cat-link { margin-inline-start: var(--k-tree-slot); }

.k-catalog .kahunacart-cat-link {
    display: inline-block;
    min-width: 0;
    padding: .3rem .5rem;
    border-radius: var(--k-radius-sm);
    color: var(--k-ink-soft);
    line-height: 1.35;
    text-decoration: none;
    transition: background-color var(--k-dur) var(--k-ease), color var(--k-dur) var(--k-ease);
}

.k-catalog .kahunacart-cat-link:hover {
    background: var(--k-bg-alt);
    color: var(--k-ink);
    text-decoration: none;
}

.k-catalog .kahunacart-cat-link.is-current {
    background: var(--k-brand-soft);
    color: var(--k-brand-strong);
    font-weight: 600;
}

.k-catalog .kahunacart-cat-item.is-ancestor > .kahunacart-cat-branch > .kahunacart-cat-summary > .kahunacart-cat-link {
    color: var(--k-ink);
    font-weight: 600;
}

/* An open branch on the trail to the current category reads as part of the
   heading, so its chevron stops being furniture too. */
.k-catalog .kahunacart-cat-item.is-ancestor > .kahunacart-cat-branch > .kahunacart-cat-summary::before {
    background-color: var(--k-ink-soft);
}

.k-catalog .kahunacart-cat-count,
.k-catalog .kahunacart-filter-count {
    font-family: var(--k-font);
    font-size: .72rem;
    font-variant-numeric: tabular-nums;
    color: var(--k-muted);
}

/* The link already carries .5rem of padding on that side; this is the gap
   between the two, not between the label and the count. */
.k-catalog .kahunacart-cat-count { margin-inline-start: .3rem; }

/* the facet panel --------------------------------------------------------- */

.k-catalog .kahunacart-filter-group {
    border: 0;
    border-top: 1px solid var(--k-line);
    border-radius: 0;
    margin: 0;
    padding: 1.1rem 0 0;
    min-width: 0;
}

/* A legend sits in its fieldset's border by default, which puts the hairline
   through the word. Floated, it is an ordinary block above the options. */
.k-catalog .kahunacart-filter-group > legend {
    float: left;
    width: 100%;
}

.k-catalog .kahunacart-filter-group > legend + * { clear: both; }

.k-catalog .kahunacart-filters > .kahunacart-filter-group:first-of-type {
    border-top: 0;
    padding-top: 0;
}

.k-catalog .kahunacart-filter-options {
    gap: .4rem;
    max-height: 17em;
    padding-inline-end: .2rem;
    scrollbar-width: thin;
}

.k-catalog .kahunacart-filter-option {
    color: var(--k-ink-soft);
    line-height: 1.35;
}

.k-catalog .kahunacart-filter-option:hover { color: var(--k-ink); }

.k-catalog .kahunacart-filter-option input {
    width: auto;
    flex: none;
    margin: 0;
    accent-color: var(--k-brand);
}

.k-catalog .kahunacart-filter-field input {
    padding: .45rem .55rem;
    text-align: center;
}

.k-catalog .kahunacart-filter-actions { padding-top: .5rem; }
.k-catalog .kahunacart-filter-actions .button { flex: 1 1 auto; justify-content: center; }

.k-catalog .kahunacart-filter-clear {
    color: var(--k-muted);
    font-size: .85rem;
    text-decoration: none;
}

.k-catalog .kahunacart-filter-clear:hover { color: var(--k-brand-strong); text-decoration: underline; }

/* The rest of a facet the `catalog.facets.max_values` cap has shortened: a
   <details> holding real checkboxes in the same form, so opening it costs no
   request and needs no script. Styled like the Clear link rather than like a
   button, because it reveals rather than does. */
.k-catalog .kahunacart-filter-more { margin-top: .4rem; }

.k-catalog .kahunacart-filter-more-toggle {
    color: var(--k-muted);
    font-size: .85rem;
    cursor: pointer;
}

.k-catalog .kahunacart-filter-more-toggle:hover { color: var(--k-brand-strong); }

.k-catalog .kahunacart-filter-more > .kahunacart-filter-options { margin-top: .4rem; }

/* A value nothing reachable answers. Counts follow the current filters, so a
   value that would give an empty grid reads 0 and its input is disabled;
   greying it in place rather than removing it keeps the panel from reshuffling
   under the cursor on every tick. `catalog.facets.empty: hide` drops them
   instead and nothing then reaches these rules. What the shopper has ticked is
   never disabled, at any count. */
.k-catalog .kahunacart-filter-option.is-disabled,
.k-catalog .kahunacart-filter-range.is-disabled {
    color: var(--k-muted);
    opacity: .5;
    cursor: not-allowed;
}

.k-catalog .kahunacart-filter-option.is-disabled:hover { color: var(--k-muted); }
.k-catalog .kahunacart-filter-option.is-disabled input { cursor: not-allowed; }

/* Under a facet whose every value is out of reach: the heading stays and says
   so once, instead of a column of a dozen dead boxes all reading 0. */
.k-catalog .kahunacart-filter-none {
    margin: 0;
    color: var(--k-muted);
    font-size: .85rem;
    font-style: italic;
}

/* A category holding nothing under the filters currently on. Still a link, so
   the tree stays the way out of a corner somebody has filtered themselves
   into; the row rather than the whole item, because a dead branch's children
   carry the class too and two opacities multiply. */
.k-catalog .kahunacart-cat-item.is-unavailable > .kahunacart-cat-link,
.k-catalog .kahunacart-cat-item.is-unavailable > .kahunacart-cat-count,
.k-catalog .kahunacart-cat-item.is-unavailable > .kahunacart-cat-branch > .kahunacart-cat-summary {
    opacity: .5;
}

/* A specification value that links to the rest of the catalogue answering it.
   Ink at rest with a dotted rule under it: a spec table where every second
   cell is brand-coloured reads as a list of links rather than a table of
   facts. */
.kahunacart-attribute-link {
    color: var(--k-ink);
    text-decoration: none;
    border-bottom: 1px dotted var(--k-line);
}

.kahunacart-attribute-link:hover,
.kahunacart-attribute-link:focus-visible {
    color: var(--k-brand-strong);
    border-bottom-color: currentColor;
}

.kahunacart-attribute-link .kahunacart-spec-hex { color: inherit; }

/* breadcrumbs ------------------------------------------------------------- */

.k-shop .kahunacart-breadcrumbs,
.k-product .kahunacart-breadcrumbs {
    margin-bottom: 1.25rem;
    font-size: .85rem;
}

.k-shop .kahunacart-breadcrumb-item a,
.k-product .kahunacart-breadcrumb-item a {
    color: var(--k-muted);
    text-decoration: none;
}

.k-shop .kahunacart-breadcrumb-item a:hover,
.k-product .kahunacart-breadcrumb-item a:hover {
    color: var(--k-brand-strong);
    text-decoration: underline;
}

/* the category banner ----------------------------------------------------- */

.k-category-media {
    margin: 1.25rem 0 1.5rem;
    border-radius: var(--k-radius);
    overflow: hidden;
    background: var(--k-surface-sunk);
}

.k-category-media img {
    display: block;
    width: 100%;
    height: auto;
    max-height: 22rem;
    object-fit: cover;
}

/* subcategory cards ------------------------------------------------------- */

/* A department card is a sunk tile with the name set large in the display
   face — it is a door, not a product, and should not look like one. */
.k-shop .kahunacart-subcategory-grid {
    grid-template-columns: repeat(auto-fill, minmax(13rem, 1fr));
    gap: var(--k-gap);
    margin: 0 0 clamp(2rem, 5vw, 3rem);
}

.k-shop .kahunacart-subcategory-card {
    border: 0;
    border-radius: var(--k-radius-sm);
    background: var(--k-surface-sunk);
    box-shadow: none;
    overflow: hidden;
    transition: background-color var(--k-dur) var(--k-ease);
}

.k-shop .kahunacart-subcategory-card:hover { background: var(--k-brand-soft); }

.k-shop .kahunacart-subcategory-media {
    aspect-ratio: 16 / 9;
    background: var(--k-bg-alt);
}

.k-shop .kahunacart-subcategory-title {
    font-family: var(--k-font-display);
    font-size: 1.35rem;
    font-weight: 600;
    letter-spacing: -.02em;
    padding: 1.25rem 1.25rem .15rem;
}

.k-shop .kahunacart-subcategory-card:not(.has-image) .kahunacart-subcategory-title { padding-top: 2rem; }

.k-shop .kahunacart-subcategory-link:hover .kahunacart-subcategory-title { color: var(--k-brand-strong); }

.k-shop .kahunacart-subcategory-count {
    padding: 0 1.25rem 1.25rem;
    color: var(--k-muted);
    font-family: var(--k-font);
    font-size: .75rem;
    letter-spacing: .06em;
    text-transform: uppercase;
}

/* custom fields ----------------------------------------------------------- */

/* The product's public custom fields (a warranty, a country of origin), drawn
   by the plugin's partial: a heading and a definition list. Laid out like the
   facts under the buy box, and set apart like the tags below it. */
.k-product .kahunacart-custom-fields {
    margin-top: clamp(2rem, 5vw, 3rem);
    padding-top: clamp(1.25rem, 3vw, 1.75rem);
    border-top: 1px solid var(--k-line);
}

.k-product .kahunacart-custom-fields h2 {
    font-family: var(--k-font);
    font-size: .7rem;
    font-weight: 500;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--k-muted);
    margin: 0 0 .7rem;
}

.k-product .kahunacart-custom-fields dl {
    display: grid;
    grid-template-columns: max-content minmax(0, 1fr);
    gap: .35rem 1.25rem;
    margin: 0;
    font-size: .9rem;
}

.k-product .kahunacart-custom-field { display: contents; }
.k-product .kahunacart-custom-field dt { color: var(--k-muted); }
.k-product .kahunacart-custom-field dd { margin: 0; color: var(--k-ink-soft); overflow-wrap: anywhere; }

/* product safety ---------------------------------------------------------- */

/* The plugin's Product safety section (the EU's product safety details): a
   closed <details> set apart like the custom fields above it, its summary in
   the same small mono caps as every other heading down here. Open, the
   manufacturer and the EU responsible person sit side by side where there is
   room and stack on a phone. */
.k-product .kahunacart-product-safety {
    margin-top: clamp(2rem, 5vw, 3rem);
    padding-top: clamp(1.25rem, 3vw, 1.75rem);
    border: 0;
    border-top: 1px solid var(--k-line);
    border-radius: 0;
}

.k-product .kahunacart-product-safety-title {
    cursor: pointer;
    padding: 0;
    font-family: var(--k-font);
    font-size: .7rem;
    font-weight: 500;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--k-muted);
}

.k-product .kahunacart-product-safety-title:hover { color: var(--k-ink-soft); }

.k-product .kahunacart-product-safety-title:focus-visible {
    outline: 2px solid var(--k-brand);
    outline-offset: 3px;
    border-radius: 4px;
}

.k-product .kahunacart-product-safety-body {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr));
    gap: 1.25rem 2rem;
    padding: 1rem 0 0;
    font-size: .9rem;
}

.k-product .kahunacart-safety-info { grid-column: 1 / -1; }

.k-product .kahunacart-safety-heading {
    font-family: var(--k-font);
    font-size: .8rem;
    font-weight: 600;
    letter-spacing: 0;
    text-transform: none;
    color: var(--k-ink);
    margin: 0 0 .4rem;
}

.k-product .kahunacart-safety-address {
    display: flex;
    flex-direction: column;
    gap: .1rem;
    font-style: normal;
    color: var(--k-ink-soft);
    overflow-wrap: anywhere;
}

.k-product .kahunacart-safety-name { color: var(--k-ink); font-weight: 600; }

.k-product .kahunacart-safety-trade-name,
.k-product .kahunacart-safety-contact { color: var(--k-muted); }

.k-product .kahunacart-safety-contact a { color: var(--k-brand-strong); }

.k-product .kahunacart-safety-prose { color: var(--k-ink-soft); max-width: 66ch; }
.k-product .kahunacart-safety-prose > :first-child { margin-top: 0; }
.k-product .kahunacart-safety-prose > :last-child { margin-bottom: 0; }

/* tags -------------------------------------------------------------------- */

.k-product .kahunacart-tags {
    margin-top: clamp(2rem, 5vw, 3rem);
    padding-top: clamp(1.25rem, 3vw, 1.75rem);
    border-top: 1px solid var(--k-line);
}

.k-product .kahunacart-tags-title {
    font-family: var(--k-font);
    font-size: .7rem;
    font-weight: 500;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--k-muted);
    margin: 0 0 .7rem;
}

.k-product .kahunacart-tag-list { gap: .45rem; }

.k-product .kahunacart-tag {
    padding: .28rem .8rem;
    border: 1px solid var(--k-line-strong);
    border-radius: var(--k-radius-btn);
    background: transparent;
    color: var(--k-ink-soft);
    font-size: .82rem;
    text-decoration: none;
    transition: border-color var(--k-dur) var(--k-ease), background-color var(--k-dur) var(--k-ease), color var(--k-dur) var(--k-ease);
}

.k-product .kahunacart-tag:hover {
    border-color: var(--k-brand);
    background: var(--k-brand-soft);
    color: var(--k-brand-strong);
    text-decoration: none;
}

/* narrow screens ---------------------------------------------------------- */

@media (max-width: 51.99rem) {
    .k-shop .k-catalog { gap: 1.5rem; }
    .k-catalog .kahunacart-catalog-nav { gap: 1.25rem; padding-bottom: 1.5rem; border-bottom: 1px solid var(--k-line); }
    .k-catalog .kahunacart-filter-options { max-height: 13em; }
    .k-catalog .kahunacart-filter-actions .button { width: 100%; }
}

/* ------------------------------------------------------------------ 15. cart */

.k-cart-layout {
    display: grid;
    gap: clamp(1.5rem, 4vw, 3rem);
    align-items: start;
}

@media (min-width: 58rem) {
    .k-cart-layout { grid-template-columns: minmax(0, 1.9fr) minmax(18rem, 1fr); }
}

.k-cart-actions {
    display: flex;
    flex-wrap: wrap;
    gap: .6rem;
    justify-content: flex-end;
    margin-top: 1.25rem;
}

.k-panel {
    border-radius: var(--k-radius);
    background: var(--k-surface-sunk);
    padding: 1.35rem 1.5rem 1.5rem;
}

.k-panel + .k-panel { margin-top: 1.25rem; }

.k-panel-title { margin: 0 0 1rem; }

@media (min-width: 58rem) {
    .k-panel--sticky { position: sticky; top: calc(var(--k-header-h) + 1.5rem); }
}

/* -------------------------------------------------------------- 16. checkout */

/*
 * KahunaCart's checkout, as the plugin draws it: one form, its steps one
 * under the other. On a wide screen the order summary moves out to a column
 * of its own on the right. It is drawn inside the payment step (the plugin's
 * script greys Place order against the controls of the step it sits in), so
 * it is lifted out with absolute positioning against the form rather than by
 * a grid, which keeps every step a real box a Continue can land on. The panel
 * inside it is sticky, so the total stays in view down the whole form.
 */
.kahuna .k-checkout-layout {
    position: relative;
    max-width: none;
    margin: 0;
    counter-reset: k-step;
    --k-checkout-aside: clamp(19rem, 35%, 28rem);
    --k-checkout-gap: clamp(1.5rem, 4vw, 3.5rem);
}

@media (min-width: 58rem) {
    .kahuna .k-checkout-layout { padding-right: calc(var(--k-checkout-aside) + var(--k-checkout-gap)); }
    .kahuna .k-checkout-aside {
        position: absolute;
        top: 0;
        right: 0;
        bottom: 0;
        width: var(--k-checkout-aside);
        margin: 0;
    }
}

@media (max-width: 57.99rem) {
    .kahuna .k-checkout-aside { margin-top: 2rem; }
}

/* Sections of the form: a hairline above and a heading, numbered in order by
   a counter each fieldset steps, so a section a later release adds numbers
   itself. A hidden section (the delivery address while it is the billing
   one) is not counted. */
.kahuna .k-checkout-layout fieldset {
    counter-increment: k-step;
    border: 0;
    border-top: 1px solid var(--k-line);
    border-radius: 0;
    background: none;
    padding: 1.5rem 0 0;
    margin: 0 0 2rem;
    min-width: 0;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem 1.25rem;
}

.kahuna .k-checkout-layout fieldset[hidden] { display: none; }

.kahuna .k-checkout-layout legend {
    float: left;
    grid-column: 1 / -1;
    width: 100%;
    margin: 0 0 .1rem;
    padding: 0;
    font-family: var(--k-font-display);
    font-weight: 600;
    font-size: 1.35rem;
    letter-spacing: -.015em;
}

.kahuna .k-checkout-layout legend::before {
    content: counter(k-step, decimal-leading-zero);
    display: inline-block;
    margin-right: .7rem;
    font-family: var(--k-font);
    font-size: .72rem;
    font-weight: 500;
    letter-spacing: .1em;
    color: var(--k-brand-strong);
    vertical-align: .35em;
}

/* Everything in a section that is not one of the field cells takes the whole
   row: the address book, the tick boxes and their notes, the lists of
   choices. A field cell takes one of the three columns unless it is wide. */
.kahuna .k-checkout-layout fieldset > :not(.k-field, legend) { grid-column: 1 / -1; margin: 0; }
.kahuna .k-checkout-layout .k-field--wide { grid-column: 1 / -1; }
.kahuna .k-checkout-layout fieldset > .kahunacart-checkbox { display: flex; align-items: flex-start; gap: .6rem; font-size: .95rem; cursor: pointer; }
.kahuna .k-checkout-layout fieldset > .kahunacart-checkbox input { width: auto; margin-top: .25rem; accent-color: var(--k-brand); }
.kahuna .k-checkout-layout fieldset > .kahunacart-hint { margin-top: -.6rem; padding-left: 1.6rem; font-size: .82rem; color: var(--k-muted); }

@media (max-width: 40rem) {
    .kahuna .k-checkout-layout fieldset { grid-template-columns: minmax(0, 1fr); }
}

/* The first section under the express buttons keeps a bare top: the "or
   continue below" divider already separates them. */
.kahuna .k-checkout-layout > :first-child fieldset:first-child,
.kahuna .k-checkout-layout .kahunacart-zone + .kahunacart-address-suggestion + .kahunacart-checkout-step fieldset:first-child,
.kahuna .k-checkout-layout .kahunacart-checkout-step-address > fieldset:first-child { border-top: 0; padding-top: 0; }

/* A list of choices (delivery methods, collection points, ways to pay): one
   row per choice, the label filling the row and the price on the right; the
   chosen one carries the brand. */
.kahuna .k-checkout-layout :is(.kahunacart-shipping-method, .kahunacart-provider, .kahunacart-payment-method, .kahunacart-pickup-choice, .kahunacart-pickup-deliver) {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .25rem .75rem;
    margin: 0 0 .5rem;
    padding: .8rem 1rem;
    border: 1px solid var(--k-line-strong);
    border-radius: 0;
    background: var(--k-surface);
    cursor: pointer;
    transition: border-color var(--k-dur) var(--k-ease), background-color var(--k-dur) var(--k-ease);
}

.kahuna .k-checkout-layout :is(.kahunacart-shipping-method, .kahunacart-provider, .kahunacart-payment-method, .kahunacart-pickup-choice, .kahunacart-pickup-deliver):hover { border-color: var(--k-ink); }
.kahuna .k-checkout-layout :is(.kahunacart-shipping-method, .kahunacart-provider, .kahunacart-payment-method, .kahunacart-pickup-choice, .kahunacart-pickup-deliver):has(input:checked) { border-color: var(--k-brand); background: var(--k-brand-soft); }
.kahuna .k-checkout-layout :is(.kahunacart-shipping-method, .kahunacart-provider, .kahunacart-payment-method) input { width: auto; margin: 0; accent-color: var(--k-brand); }
.kahuna .k-checkout-layout :is(.kahunacart-shipping-method, .kahunacart-payment-method) .kahunacart-price,
.kahuna .k-checkout-layout .kahunacart-payment-method-fee { margin-left: auto; font-family: var(--k-font-display); font-weight: 600; font-variant-numeric: tabular-nums; }
.kahuna .k-checkout-layout .kahunacart-payment-method-label { flex: 1; }
.kahuna .k-checkout-layout :is(.kahunacart-shipping-method, .kahunacart-payment-method) small { flex-basis: 100%; padding-left: 1.6rem; color: var(--k-muted); font-size: .85rem; }
.kahuna .k-checkout-layout :is(.kahunacart-shipping-method-unavailable, .kahunacart-payment-method--unavailable) { cursor: default; opacity: .6; }
.kahuna .k-checkout-layout :is(.kahunacart-shipping-hint, .kahunacart-shipping-none, .kahunacart-pickup-hint) { color: var(--k-ink-soft); font-size: .93rem; }

/* ---- express pay ----
   The wallet buttons a provider mounted, at the top of the form above the
   first numbered section. The plugin's own sheet draws the caption, the row
   and the "or continue below" divider; this adds the theme's voice (the
   caption in a field label's weight, the divider on the theme's hairline) and
   the spacing that puts the block in the rhythm of the sections under it. */
.kahuna .kahunacart-express {
    margin: 0 0 2rem;

    /* The colours a wallet button paints itself with on the plugin's `auto`
       theme: the theme's ink as the fill and the page's ground as the label.
       A merchant who picked dark, light or outline gets that instead. */
    --kahunacart-express-auto-bg: var(--k-ink);
    --kahunacart-express-auto-fg: var(--k-bg);
    --kahunacart-express-auto-border: transparent;
}

.kahuna .kahunacart-express-heading {
    margin: 0 0 .6rem;
    font-size: .86rem;
    font-weight: 500;
    color: var(--k-ink-soft);
}

.kahuna .kahunacart-express-or {
    margin: 1.4rem 0 0;
    font-size: .86rem;
    color: var(--k-muted);
}

.kahuna .kahunacart-express-or::before,
.kahuna .kahunacart-express-or::after { background: var(--k-line); }

/* Where a Continue lands: clear of the sticky header. */
#kahunacart-checkout-address,
#kahunacart-checkout-shipping,
#kahunacart-checkout-payment { scroll-margin-top: calc(var(--k-header-h) + 1.5rem); }

/* ---- the checkout steps ----
   The plugin's script says out loud which parts are finished:
   `data-kc-step-ready` on the step and on its button, the real `disabled`
   attribute beside it, and `aria-busy` on a region being fetched. All three
   are set by script alone, so with scripting off every button is live. */

/* The button that ends a step, at the end of the last section it covers. The
   sections carry 2rem of air below them already, so this pulls back up under
   the last one rather than opening a second gap. */
.k-checkout-layout .kahunacart-step-actions {
    display: flex;
    justify-content: flex-end;
    margin: -1rem 0 2rem;
}

@media (max-width: 34rem) {
    .k-checkout-layout .kahunacart-step-actions .button { width: 100%; }
}

/* In the summary panel there is one button and it is the width of the panel. */
.k-checkout-layout .kahunacart-place-order-actions { display: block; margin: 1.25rem 0 0; }
.k-checkout-layout .kahunacart-place-order { width: 100%; }

/* Greyed out while the step it sits under is unfinished. */
.kahuna .kahunacart-step-actions .button[data-kc-step-ready="0"],
.kahuna .kahunacart-step-actions .button[disabled] {
    background: var(--k-surface-sunk);
    border-color: var(--k-line-strong);
    color: var(--k-muted);
    opacity: 1;
    transform: none;
    box-shadow: none;
}

.kahuna .kahunacart-step-actions:has(.button[aria-disabled="true"]) { cursor: not-allowed; }

/* What a greyed-out button is waiting for, under the button: small, in the
   body ink, with the info glyph in front. */
.kahuna .k-checkout-layout .kahunacart-step-missing {
    display: flex;
    align-items: flex-start;
    gap: .45rem;
    margin: -1.45rem 0 2rem;
    font-size: .88rem;
    line-height: 1.45;
    color: var(--k-ink-soft);
    justify-content: flex-end;
}

.kahuna .k-checkout-layout .kahunacart-place-order-actions + .kahunacart-step-missing { margin: .55rem 0 .75rem; justify-content: flex-start; }

.kahuna .k-checkout-layout .kahunacart-step-missing[hidden] { display: none; }

.kahuna .k-checkout-layout .kahunacart-step-missing::before {
    content: "";
    flex: none;
    width: .95rem;
    height: .95rem;
    margin-top: .14rem;
    background: currentColor;
    opacity: .75;
    -webkit-mask: var(--k-info-glyph) no-repeat center / contain;
    mask: var(--k-info-glyph) no-repeat center / contain;
}

/* The chevron on a Continue: the step it goes to is the one below. */
.kahunacart-step-chevron {
    width: 1em;
    height: 1em;
    margin-left: .4em;
    vertical-align: -.12em;
    flex: none;
}

.kahunacart-step-actions .button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* While the delivery options are on their way, and while a choice is being
   stored and the order repriced: what is there stays readable, it just stops
   taking clicks until the answer has arrived. */
.kahuna [data-kc-step][aria-busy="true"],
.kahuna #kahunacart-checkout-summary[aria-busy="true"] {
    opacity: .55;
    pointer-events: none;
    cursor: progress;
    transition: opacity 120ms var(--k-ease);
}

/* The summary panel: what is being bought, then the totals. */
.k-checkout-aside .k-panel { padding: 1.5rem; }
.k-checkout-aside .kahunacart-totals { margin: 0; }

.k-summary-items {
    list-style: none;
    margin: 0 0 1rem;
    padding: 0 0 .9rem;
    border-bottom: 1px solid var(--k-line-strong);
    display: grid;
    gap: .55rem;
    font-size: .93rem;
}

.k-summary-item {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 0 1rem;
}
.k-summary-item-title { flex: 1 1 0; min-width: 0; }

.k-summary-qty { color: var(--k-muted); }
.k-summary-item-total { font-variant-numeric: tabular-nums; white-space: nowrap; }

/* "Code applied", the notes about a line and the terms box, under the
   payment choices. */
.kahuna .k-checkout-layout .kahunacart-coupon-active {
    margin: 0 0 1rem;
    font-size: .88rem;
    color: var(--k-ok);
    font-weight: 600;
}
.kahuna .k-checkout-layout .kahunacart-line-notes { margin: 0 0 2rem; padding-left: 1.1rem; font-size: .88rem; color: var(--k-ink-soft); }
.kahuna .k-checkout-layout .kahunacart-step-payment > .kahunacart-checkbox { display: flex; gap: .6rem; margin: 0 0 1.5rem; font-size: .95rem; }

/* --------------------------------------------------- 17. receipt & downloads */

.k-receipt {
    max-width: 46rem;
    margin-inline: auto;
    border: 1px solid var(--k-line);
    border-radius: var(--k-radius);
    background: var(--k-surface);
    padding: clamp(1.5rem, 5vw, 3rem);
    box-shadow: var(--k-shadow);
}

.k-receipt-head { text-align: center; margin-bottom: 2rem; }

.k-receipt-check {
    width: 3.25rem;
    height: 3.25rem;
    margin: 0 auto 1rem;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: var(--k-brand-soft);
    color: var(--k-brand-strong);
    font-size: 1.5rem;
    line-height: 1;
}

.k-receipt-meta {
    display: grid;
    gap: .4rem;
    justify-content: center;
    margin: 0;
    font-size: .95rem;
}

.k-meta-row {
    display: flex;
    gap: .6rem;
    align-items: baseline;
    justify-content: center;
}

.k-meta-row dt { color: var(--k-muted); }
.k-meta-row dd { margin: 0; }

/* The receipt's way out: invoice, PDF, orders, shop — spaced, centred, in
   the quiet link style of the theme's other ways back. */
.k-order .kahunacart-order-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: .5rem 1.5rem;
    margin-top: 2rem;
}

.k-order .kahunacart-order-links a { text-decoration: none; color: var(--k-muted); }
.k-order .kahunacart-order-links a:hover { color: var(--k-brand-strong); text-decoration: underline; }

/* The rest of KahunaCart's receipt inside the card: the totals under the
   table, then the return request, the order's history and the add-on panels
   as quiet sections of their own. */
.k-order .kahunacart-order-meta { margin-bottom: 2rem; }
.k-order .kahunacart-payment-reference { font: inherit; font-size: .9em; letter-spacing: .04em; }
.k-order .kahunacart-order-items { margin-bottom: 1rem; }
.k-order .kahunacart-totals { margin: 0 0 0 auto; }
.k-order :is(.kahunacart-refund-request, .kahunacart-order-history, .kahunacart-order-panel, .kahunacart-downloads, .kahunacart-order-pickup, .kahunacart-quote, .kahunacart-offline-instructions) { margin: 2rem 0 0; }
.k-order :is(.kahunacart-order-history, .kahunacart-order-panel, .kahunacart-downloads, .kahunacart-order-pickup, .kahunacart-quote) h2 {
    margin: 0 0 .75rem;
    font: 600 .6875rem/1.3 var(--k-font);
    letter-spacing: .18em;
    text-transform: uppercase;
    color: var(--hb-saddle);
}
.k-order .kahunacart-order-history-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .35rem; font-size: .9rem; }
.k-order .kahunacart-order-history-entry { display: flex; flex-wrap: wrap; gap: .25rem 1rem; }
.k-order .kahunacart-order-history-when { min-width: 9rem; color: var(--k-muted); font-variant-numeric: tabular-nums; }
.k-order .kahunacart-order-history-message { flex-basis: 100%; margin: 0; color: var(--k-ink-soft); }
.k-order .kahunacart-refund-request summary { cursor: pointer; }
.k-order .kahunacart-account-offer { margin-top: 2rem; }

/* ----------------------------------------------- 18. account area & login */

/*
 * The customer account pages are the plugin's own templates, extending this
 * theme's base and styled by the plugin's stylesheet through the token
 * hand-off. What the plugin draws is a row of tabs over a column of panels.
 * Kahuna wants a rail: the section links down the left, the page on the
 * right, the same arrangement the catalog uses. That is a layout change, not
 * a colour, so it is written here against the plugin's classes — scoped under
 * the body class the theme owns, which is what carries it past the plugin's
 * single-class rules.
 */
.kahuna .kahunacart-account > h1 { margin-bottom: 1.25rem; }

@media (min-width: 58rem) {
    .kahuna .kahunacart-account {
        display: grid;
        grid-template-columns: 13rem minmax(0, 1fr);
        column-gap: clamp(2rem, 5vw, 4rem);
        align-items: start;
    }

    .kahuna .kahunacart-account > h1,
    .kahuna .kahunacart-account > .kahunacart-messages { grid-column: 1 / -1; }

    .kahuna .kahunacart-account > .kahunacart-account-nav {
        grid-column: 1;
        grid-row: span 40;
        position: sticky;
        top: calc(var(--k-header-h) + 1.5rem);
    }

    .kahuna .kahunacart-account > :not(h1, .kahunacart-messages, .kahunacart-account-nav) { grid-column: 2; }
}

.kahuna .kahunacart-account-nav {
    margin: 0 0 2rem;
    border: 0;
}

.kahuna .kahunacart-account-nav ul {
    display: flex;
    flex-wrap: wrap;
    gap: .25rem;
}

@media (min-width: 58rem) {
    .kahuna .kahunacart-account-nav ul { flex-direction: column; }
}

.kahuna .kahunacart-account-nav li { padding: 0; margin: 0; }

.kahuna .kahunacart-account-nav li > a,
.kahuna .kahunacart-account-nav li > span {
    display: block;
    padding: .5rem .8rem;
    border-radius: var(--k-radius-btn);
    color: var(--k-ink-soft);
    text-decoration: none;
    font-weight: 500;
    transition: background-color var(--k-dur) var(--k-ease), color var(--k-dur) var(--k-ease);
}

.kahuna .kahunacart-account-nav li > a:hover { background: var(--k-bg-alt); color: var(--k-ink); }

.kahuna .kahunacart-account-nav-item--current { border: 0; font-weight: 500; }

.kahuna .kahunacart-account-nav-item--current > span {
    background: var(--k-brand-soft);
    color: var(--k-brand-strong);
    font-weight: 600;
}

.kahuna .kahunacart-account-nav-item--logout { margin-top: .5rem; }
.kahuna .kahunacart-account-nav-item--logout > a { color: var(--k-muted); }

.kahuna .kahunacart-account-identity { margin-bottom: 1.5rem; }
/* The customer's group badges sit tight under their name, and take the gap below. */
.kahuna .kahunacart-account-identity:has(+ .kahunacart-account-groups) { margin-bottom: .25rem; }
.kahuna .kahunacart-account-profile-header .kahunacart-account-identity { margin: 0; }
.kahuna .kahunacart-account > h2 { margin-top: 2rem; }
.kahuna .kahunacart-account-panel { margin: 0 0 2.5rem; }
.kahuna .kahunacart-account-panel:first-of-type { margin-top: 0; }

.kahuna .kahunacart-account-orders thead th {
    font-family: var(--k-font);
    font-size: .7rem;
    font-weight: 500;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--k-muted);
}

.kahuna .kahunacart-address-card {
    border: 1px solid var(--k-line);
    border-radius: var(--k-radius);
    background: var(--k-surface);
    padding: 1.25rem 1.4rem;
}

/* The account's Stock alerts tab (KahunaCart 1.3.5): one card per alert,
   drawn like the address cards beside it. */
.kahuna .kahunacart-stock-alert-item {
    border: 1px solid var(--k-line);
    border-radius: var(--k-radius);
    background: var(--k-surface);
    padding: 1rem 1.25rem;
}
.kahuna .kahunacart-stock-alert-item .kahunacart-stock-alert-name a { color: var(--k-ink); font-weight: 600; }

.kahuna .kahunacart-account-empty {
    border: 1px dashed var(--k-line-strong);
    border-radius: var(--k-radius);
    padding: 1.5rem;
    color: var(--k-muted);
}

/* The Login plugin ships a hardcoded near-white card and sets no text colour
   of its own, so it is restated in theme tokens. Qualified with `body` on
   purpose: the plugin's stylesheet is enqueued after the theme's. */
/*
 * The flash region on a sign-in page belongs to the card, not to the page: it
 * is answering the form directly under it, and left full-container-width up in
 * the corner it reads as something that happened to a different page.
 *
 * Keyed off the card itself rather than a list of template names, because the
 * Login plugin renders the same section on seven routes — sign in, forgot,
 * reset, magic link, register, profile, unauthorized — and a theme should not
 * have to keep that list.
 */
body:has(#grav-login) .k-notices {
    max-width: var(--k-auth-width);
    margin: 4rem auto 0;
}

body:has(#grav-login) .k-notices + #grav-login { margin-top: 1rem; }

body #grav-login {
    max-width: var(--k-auth-width);
    margin: 4rem auto;
    padding: 2rem 2.25rem 2.25rem;
    background: var(--k-surface);
    border: 1px solid var(--k-line);
    border-radius: var(--k-radius);
    box-shadow: var(--k-shadow);
    color: var(--k-ink);
    text-align: left;
}

#grav-login h1 {
    margin: 0 0 1.4rem;
    font-family: var(--k-font-display);
    font-size: 1.6rem;
    font-weight: 600;
    color: var(--k-ink);
    text-align: center;
}

#grav-login label {
    display: block;
    margin-bottom: .35rem;
    font-size: .86rem;
    font-weight: 500;
    color: var(--k-ink-soft);
}

#grav-login input[type="checkbox"] + label,
#grav-login label:has(input[type="checkbox"]) {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    margin: 0;
    font-weight: 400;
    color: var(--k-ink-soft);
}

#grav-login input[type="checkbox"] { width: auto; accent-color: var(--k-brand); }

#grav-login .form-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: .6rem;
    margin-top: 1.25rem;
}

#grav-login a:not(.button) { color: var(--k-brand-strong); }

/* ------------------------------------------------------------- 19. home page */

/* The home page is the Tack Room's own; see tack-room.css. */

/* ------------------------------------------- 20. processing, denied, error */

.k-processing { display: grid; place-items: center; min-height: 40vh; }

.k-processing-card {
    max-width: 32rem;
    text-align: center;
    padding: clamp(1.5rem, 5vw, 3rem);
    border-radius: var(--k-radius);
    background: var(--k-surface-sunk);
}

.k-spinner {
    display: block;
    width: 2.25rem;
    height: 2.25rem;
    margin: 0 auto 1.25rem;
    border: 3px solid var(--k-line-strong);
    border-top-color: var(--k-accent);
    border-radius: 50%;
    animation: k-spin 900ms linear infinite;
}

@keyframes k-spin { to { transform: rotate(360deg); } }

/* KahunaCart's own wording inside the card: the title in the page title's
   voice, the help under it muted, the buttons centred. */
.k-processing-card h1 { color: var(--hb-green); }
.k-processing-card p { color: var(--k-muted); }
.k-processing-card p:has(> .button) { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: .75rem 1.25rem; margin-top: 1.5rem; }

.k-denied { max-width: 42rem; }
.k-denied h1 { color: var(--hb-green); }
.k-denied .k-callout { text-align: left; }
.k-denied .k-callout h1 { margin: 0 0 .75rem; font-size: var(--k-step-2); }
.k-denied .kahunacart-denied-message { margin: 0 0 1rem; padding: 0; border: 0; background: none; text-align: left; color: var(--k-ink-soft); }
.k-denied .k-callout a { color: var(--k-ink-soft); text-decoration: none; }
.k-denied .k-callout a:hover { color: var(--k-brand-strong); text-decoration: underline; }

.k-error {
    display: grid;
    gap: 1rem 3rem;
    align-items: center;
    padding-block: clamp(2rem, 8vw, 5rem);
}

@media (min-width: 52rem) {
    .k-error { grid-template-columns: auto minmax(0, 1fr); }
}

.k-error-code {
    font-family: var(--k-font-display);
    font-size: clamp(5rem, 18vw, 11rem);
    font-weight: 800;
    line-height: .9;
    margin: 0;
    color: var(--k-accent);
    letter-spacing: -.05em;
}

.k-error-actions { display: flex; flex-wrap: wrap; gap: .75rem 1.5rem; align-items: center; margin-top: 1.5rem; }

/* ------------------------------------------------------------- 21. utilities */

.k-visually-hidden {
    position: absolute !important;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
}

/* account menu ------------------------------------------------------------ */

.k-account { position: relative; }

.k-account-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 2px;
    border: 1px solid var(--k-line-strong);
    border-radius: 50%;
    background: var(--k-surface);
    cursor: pointer;
    transition: border-color var(--k-dur) var(--k-ease);
}

.k-account-toggle:hover { border-color: var(--k-ink); }

.k-avatar {
    display: block;
    width: 2.1rem;
    height: 2.1rem;
    border-radius: 50%;
    background: var(--k-surface-sunk);
    object-fit: cover;
}

.k-account-menu {
    position: absolute;
    top: calc(100% + .6rem);
    right: 0;
    z-index: var(--k-z-menu);
    min-width: 14rem;
    padding: .45rem;
    background: var(--k-surface);
    border: 1px solid var(--k-line);
    border-radius: var(--k-radius-sm);
    box-shadow: var(--k-shadow-lift);
}

.k-account-menu[hidden] { display: none; }

.k-account-who {
    display: grid;
    gap: .1rem;
    padding: .55rem .65rem .7rem;
    border-bottom: 1px solid var(--k-line);
    margin-bottom: .35rem;
    line-height: 1.3;
}

.k-account-who strong { color: var(--k-ink); font-size: .92rem; }
.k-account-who span { color: var(--k-muted); font-size: .8rem; word-break: break-all; }

.k-account-menu a {
    display: block;
    padding: .5rem .65rem;
    border-radius: 7px;
    color: var(--k-ink-soft);
    text-decoration: none;
    font-size: .92rem;
}

.k-account-menu a:hover,
.k-account-menu a:focus-visible {
    background: var(--k-brand-soft);
    color: var(--k-ink);
}

.k-account-signout {
    border-top: 1px solid var(--k-line);
    margin-top: .35rem;
    padding-top: .6rem !important;
    border-radius: 0 0 7px 7px;
    color: var(--k-muted) !important;
}

/* ----------------------------------------------------------------- 22. print */

@media print {
    body::before { content: none; }
    .k-header, .k-footer, .k-back, .k-skip-link, .k-nav-toggle, .k-announce { display: none !important; }
    body { background: #fff; color: #000; }
    .k-receipt { border: 0; box-shadow: none; padding: 0; }
    .k-table { border-color: #999; }
}
