/* Riverstone Pebble Co. design system.
   Palette: slate (ink, dark bands), stone-white (page), sand (warm accents), moss (actions).
   Type: Young Serif for display, Figtree for everything else. Signature: pebble-shaped image frames. */

/* ---------- Fonts (self-hosted, SIL OFL 1.1, licences beside the files) ---------- */
@font-face {
    font-family: "Young Serif";
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url("../fonts/young-serif/young-serif-latin-400-normal.woff2") format("woff2");
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
    font-family: "Young Serif";
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url("../fonts/young-serif/young-serif-latin-ext-400-normal.woff2") format("woff2");
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
    font-family: "Figtree";
    font-style: normal;
    font-weight: 300 900;
    font-display: swap;
    src: url("../fonts/figtree/figtree-latin-wght-normal.woff2") format("woff2");
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
    font-family: "Figtree";
    font-style: normal;
    font-weight: 300 900;
    font-display: swap;
    src: url("../fonts/figtree/figtree-latin-ext-wght-normal.woff2") format("woff2");
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* ---------- Tokens ---------- */
:root {
    --slate-950: #1f292e;
    --slate-900: #28343a;
    --slate-800: #34434a;
    --slate-700: #43535b;
    --slate-600: #56656c;
    --slate-300: #b4bfc2;
    --slate-200: #d3dadb;

    --stone-50: #f7f7f3;
    --stone-100: #eeefea;
    --stone-200: #e3e5de;
    --stone-300: #cfd2c8;

    --sand-100: #efe6d6;
    --sand-200: #e6d8be;
    --sand-300: #dcc7a2;
    --sand-500: #bf9f6c;
    --sand-700: #7d6239;

    --moss-50: #e6ece0;
    --moss-300: #9fb48c;
    --moss-600: #4e6b3b;
    --moss-700: #405a30;
    --moss-800: #2f4225;

    --white: #ffffff;
    --moss-50-faint: rgba(230, 236, 224, 0.3); /* --moss-50 at 30% */

    --danger-600: #9a3a2c;
    --danger-50: #f7e5e0;
    --danger-25: #fffaf8;
    --warning-700: #6c5220;
    --warning-50: #f5ecd5;

    --ink: var(--slate-900);
    --ink-soft: var(--slate-700);
    --muted: var(--slate-600);
    --page: var(--stone-100);
    --surface: var(--stone-50);
    --line: var(--stone-300);
    --action: var(--moss-600);
    --action-hover: var(--moss-700);
    --focus: #2f6fb0;

    --font-display: "Young Serif", Georgia, "Times New Roman", serif;
    --font-body: "Figtree", "Segoe UI", system-ui, -apple-system, sans-serif;

    /* Type scale: minor third (1.2) from 17px body, display sizes fluid. */
    --text-xs: 0.8125rem;
    --text-s: 0.9375rem;
    --text-m: 1.0625rem;
    --text-l: 1.25rem;
    --text-xl: clamp(1.45rem, 1.2rem + 0.9vw, 1.8rem);
    --text-2xl: clamp(1.8rem, 1.4rem + 1.6vw, 2.6rem);
    --text-3xl: clamp(2.3rem, 1.6rem + 3vw, 4.1rem);

    --space-1: 0.25rem;
    --space-2: 0.5rem;
    --space-3: 0.75rem;
    --space-4: 1rem;
    --space-5: 1.5rem;
    --space-6: 2rem;
    --space-7: 3rem;
    --space-8: 4.5rem;
    --space-9: 6.5rem;

    --radius-s: 6px;
    --radius-m: 12px;
    --radius-l: 20px;
    --radius-pill: 999px;

    --gutter: clamp(16px, 4vw, 40px);
    --container: 1240px;
    --header-height: 72px;
    --shadow-raised: 0 18px 40px -24px rgba(31, 41, 46, 0.45);
}

/* ---------- Base ---------- */
*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--page);
    color: var(--ink);
    font-family: var(--font-body);
    font-size: var(--text-m);
    line-height: 1.6;
    font-feature-settings: "kern", "liga";
    -webkit-font-smoothing: antialiased;
}

img,
svg {
    display: block;
    max-width: 100%;
}

img {
    height: auto;
}

h1,
h2,
h3 {
    margin: 0;
    font-family: var(--font-display);
    font-weight: 400;
    line-height: 1.12;
    letter-spacing: -0.01em;
    text-wrap: balance;
    overflow-wrap: break-word;
}

p {
    margin: 0;
    text-wrap: pretty;
}

a {
    color: inherit;
    text-decoration-thickness: 1px;
    text-underline-offset: 0.2em;
}

a:hover {
    color: var(--action);
}

button,
input,
select,
textarea {
    font: inherit;
    color: inherit;
}

:focus-visible {
    outline: 3px solid var(--focus);
    outline-offset: 3px;
    border-radius: 4px;
}

::selection {
    background: var(--sand-300);
    color: var(--slate-950);
}

.visually-hidden {
    position: absolute !important;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.skip-link {
    position: absolute;
    left: var(--space-4);
    top: -100px;
    z-index: 100;
    padding: var(--space-2) var(--space-4);
    background: var(--slate-900);
    color: var(--stone-50);
    border-radius: var(--radius-s);
}

.skip-link:focus {
    top: var(--space-2);
}

.container {
    width: 100%;
    max-width: calc(var(--container) + 2 * var(--gutter));
    margin-inline: auto;
    padding-inline: var(--gutter);
}

.site-main {
    flex: 1 0 auto;
}

.site-main:focus {
    outline: none;
}

/* ---------- Buttons and links ---------- */
.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    min-height: 46px;
    padding: 0.65rem 1.4rem;
    border: 1.5px solid var(--action);
    border-radius: var(--radius-pill);
    background: var(--action);
    color: var(--stone-50);
    font-weight: 600;
    font-size: var(--text-m);
    line-height: 1.2;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.button:hover {
    background: var(--action-hover);
    border-color: var(--action-hover);
    color: var(--stone-50);
}

.button:disabled,
.button[aria-disabled="true"] {
    background: var(--stone-300);
    border-color: var(--stone-300);
    color: var(--slate-700);
    cursor: not-allowed;
}

.button--large {
    min-height: 54px;
    padding-inline: 1.9rem;
    font-size: 1.0625rem;
}

.button--small {
    min-height: 38px;
    padding: 0.4rem 0.9rem;
    font-size: var(--text-s);
}

.button--block {
    width: 100%;
}

.button--outline {
    background: transparent;
    color: var(--action);
}

.button--outline:hover {
    background: var(--action);
    color: var(--stone-50);
}

.button--quiet {
    background: transparent;
    border-color: var(--line);
    color: var(--ink);
}

.button--quiet:hover {
    background: var(--stone-200);
    border-color: var(--slate-300);
    color: var(--ink);
}

.text-link {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    color: var(--action);
    font-weight: 600;
    text-decoration: underline;
    text-decoration-color: var(--moss-300);
    text-decoration-thickness: 2px;
}

.text-link:hover {
    color: var(--action-hover);
    text-decoration-color: currentColor;
}

.link-button {
    padding: var(--space-2) 0;
    border: 0;
    background: none;
    color: var(--muted);
    font-size: var(--text-s);
    text-decoration: underline;
    text-underline-offset: 0.2em;
    cursor: pointer;
}

.link-button:hover {
    color: var(--danger-600);
}

/* ---------- Badges, chips, notices ---------- */
.badge {
    display: inline-block;
    padding: 0.2rem 0.65rem;
    border-radius: var(--radius-pill);
    font-size: var(--text-xs);
    font-weight: 600;
    line-height: 1.4;
    white-space: nowrap;
}

.badge--featured {
    background: var(--sand-300);
    color: var(--slate-950);
}

.badge--sold-out {
    background: var(--slate-900);
    color: var(--stone-50);
}

.badge--shipping {
    background: var(--moss-50);
    color: var(--moss-800);
}

.chips {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
    margin: var(--space-5) 0 0;
    padding: 0;
    list-style: none;
}

.chip {
    display: inline-flex;
    align-items: center;
    min-height: 40px;
    padding: 0.35rem 1rem;
    border: 1.5px solid var(--line);
    border-radius: var(--radius-pill);
    background: var(--surface);
    font-size: var(--text-s);
    font-weight: 500;
    text-decoration: none;
}

.chip:hover {
    border-color: var(--action);
    color: var(--action);
}

.notice {
    margin: var(--space-5) 0 0;
    padding: var(--space-3) var(--space-4);
    border-left: 4px solid var(--action);
    border-radius: var(--radius-s);
    background: var(--moss-50);
    color: var(--moss-800);
    font-weight: 500;
}

.notice--warning {
    border-color: var(--sand-500);
    background: var(--warning-50);
    color: var(--warning-700);
}

.notice--error {
    border-color: var(--danger-600);
    background: var(--danger-50);
    color: var(--danger-600);
}

/* ---------- Pebble frames: the signature shape ---------- */
.pebble-frame {
    overflow: hidden;
    background-color: var(--stone-200);
    background-image: url("../images/placeholder.svg");
    background-size: cover;
    background-position: center;
}

.pebble-frame img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.pebble-frame--a {
    border-radius: 58% 42% 55% 45% / 52% 48% 52% 48%;
}

.pebble-frame--b {
    border-radius: 45% 55% 42% 58% / 56% 44% 58% 42%;
}

.pebble-frame--c {
    border-radius: 52% 48% 62% 38% / 44% 56% 44% 56%;
}

.pebble-frame--d {
    border-radius: 40% 60% 52% 48% / 58% 42% 58% 42%;
}

/* ---------- Top bar and header ---------- */
.topbar {
    background: var(--moss-800);
    color: var(--moss-50);
    font-size: var(--text-xs);
}

.topbar__list {
    display: flex;
    justify-content: center;
    gap: var(--space-6);
    margin: 0 auto;
    padding-block: 0.45rem;
    list-style: none;
}

.topbar__extra {
    display: none;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 40;
    background: var(--surface);
    border-bottom: 1px solid var(--line);
}

.site-header__inner {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    min-height: var(--header-height);
}

.brand {
    --logo-highlight: var(--stone-50);
    display: inline-flex;
    align-items: center;
    gap: var(--space-3);
    margin-right: auto;
    color: var(--slate-900);
    text-decoration: none;
}

.brand:hover {
    color: var(--slate-900);
}

.brand .logo-mark {
    color: var(--moss-600);
    flex: none;
}

.brand__name {
    display: flex;
    flex-direction: column;
    font-family: var(--font-display);
    font-size: 1.35rem;
    line-height: 1;
    letter-spacing: -0.01em;
}

.brand__sub {
    margin-top: 0.2rem;
    font-family: var(--font-body);
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    color: var(--muted);
}

.nav-toggle {
    display: none;
    align-items: center;
    gap: var(--space-2);
    min-height: 44px;
    padding: 0 var(--space-3);
    border: 1.5px solid var(--line);
    border-radius: var(--radius-pill);
    background: transparent;
    font-size: var(--text-s);
    font-weight: 600;
    cursor: pointer;
}

.nav-toggle__icon,
.cart-link__icon {
    flex: none;
}

/* Narrow phones: brand, cart and menu must share about 330px without squeezing the icons. */
@media (max-width: 419.98px) {
    .site-header__inner {
        gap: var(--space-2);
    }

    .brand {
        gap: var(--space-2);
    }

    .brand .logo-mark {
        width: 34px;
        height: 34px;
    }

    .brand__name {
        font-size: 1.2rem;
    }

    .nav-toggle {
        width: 44px;
        justify-content: center;
        padding: 0;
    }

    .nav-toggle__label {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip: rect(0, 0, 0, 0);
    }
}

.site-nav__list {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    margin: 0;
    padding: 0;
    list-style: none;
}

.site-nav__link {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    min-height: 44px;
    padding: 0 var(--space-3);
    border-radius: var(--radius-pill);
    font-weight: 600;
    font-size: var(--text-s);
    text-decoration: none;
    cursor: pointer;
}

.site-nav__link:hover {
    background: var(--stone-200);
    color: var(--ink);
}

.cart-link {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    min-height: 44px;
    padding: 0 var(--space-4) 0 var(--space-3);
    border-radius: var(--radius-pill);
    background: var(--slate-900);
    color: var(--stone-50);
    font-weight: 600;
    font-size: var(--text-s);
    text-decoration: none;
}

.cart-link:hover {
    background: var(--slate-800);
    color: var(--stone-50);
}

.cart-link__count {
    display: inline-grid;
    place-items: center;
    min-width: 1.5rem;
    height: 1.5rem;
    padding: 0 0.35rem;
    border-radius: var(--radius-pill);
    background: var(--sand-300);
    color: var(--slate-950);
    font-size: var(--text-xs);
    font-weight: 700;
    line-height: 1;
}

/* Category menu: details/summary, mega panel on desktop. */
.mega > summary {
    list-style: none;
}

.mega > summary::-webkit-details-marker {
    display: none;
}

.mega__chevron {
    transition: transform 0.2s ease;
}

.mega[open] .mega__chevron {
    transform: rotate(180deg);
}

.mega[open] > .mega__trigger {
    background: var(--stone-200);
}

.mega__panel {
    background: var(--surface);
}

.mega__columns {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    gap: var(--space-5) var(--space-6);
    margin: 0;
    padding: 0;
    list-style: none;
}

.mega__empty {
    color: var(--muted);
}

.mega__footer {
    margin-top: var(--space-5);
    padding-top: var(--space-3);
    border-top: 1px solid var(--line);
}

.tree-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-2);
}

.tree-link {
    display: inline-flex;
    align-items: center;
    min-height: 36px;
    padding: 0.2rem 0;
    font-size: var(--text-s);
    text-decoration: none;
    overflow-wrap: anywhere;
}

.tree-link:hover {
    text-decoration: underline;
}

.tree-row--depth-0 > .tree-link {
    font-family: var(--font-display);
    font-size: 1.15rem;
}

.tree-row--depth-1 > .tree-link {
    font-weight: 600;
}

.tree-row--depth-2 > .tree-link,
.tree-row--depth-3 > .tree-link {
    color: var(--ink-soft);
}

.tree-branch {
    margin: 0;
    padding: 0 0 0 var(--space-3);
    list-style: none;
    border-left: 1px solid var(--line);
}

.mega__column > .tree-branch {
    margin-top: var(--space-1);
}

.tree-toggle {
    display: none;
    flex: none;
    place-items: center;
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: var(--radius-pill);
    background: transparent;
    cursor: pointer;
}

.tree-toggle svg {
    transition: transform 0.2s ease;
}

.tree-toggle[aria-expanded="true"] svg {
    transform: rotate(180deg);
}

@media (min-width: 960px) {
    .topbar__extra {
        display: list-item;
    }

    .site-header__inner {
        gap: var(--space-5);
    }

    .site-nav {
        margin-right: auto;
    }

    .mega__panel {
        position: absolute;
        left: 0;
        right: 0;
        top: 100%;
        max-height: calc(100vh - var(--header-height) - 40px);
        overflow-y: auto;
        border-top: 1px solid var(--line);
        border-bottom: 1px solid var(--line);
        box-shadow: var(--shadow-raised);
    }

    .mega__inner {
        padding-block: var(--space-6);
    }

    .brand {
        margin-right: var(--space-4);
    }
}

/* Mobile navigation breakpoint; site.js (mobileQuery) uses the same width. */
@media (max-width: 959.98px) {
    .nav-toggle {
        display: inline-flex;
        order: 3;
    }

    .cart-link {
        order: 2;
    }

    .cart-link__label {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip: rect(0, 0, 0, 0);
    }

    .cart-link {
        padding: 0 var(--space-3);
    }

    .site-nav {
        order: 4;
        flex-basis: 100%;
    }

    .js .site-nav {
        position: absolute;
        left: 0;
        right: 0;
        top: 100%;
        display: none;
        max-height: calc(100vh - var(--header-height));
        overflow-y: auto;
        padding: var(--space-3) var(--gutter) var(--space-6);
        background: var(--surface);
        border-bottom: 1px solid var(--line);
        box-shadow: var(--shadow-raised);
    }

    .js .site-nav.is-open {
        display: block;
    }

    .no-js .site-header__inner {
        flex-wrap: wrap;
    }

    .no-js .nav-toggle {
        display: none;
    }

    .site-nav__list {
        flex-direction: column;
        align-items: stretch;
        gap: 0;
    }

    .site-nav__item {
        border-bottom: 1px solid var(--line);
    }

    .site-nav__link {
        width: 100%;
        min-height: 52px;
        padding: 0;
        border-radius: 0;
        font-size: var(--text-m);
        justify-content: space-between;
    }

    .site-nav__link:hover,
    .mega[open] > .mega__trigger {
        background: transparent;
    }

    .mega__inner {
        padding: 0 0 var(--space-4);
    }

    .mega__columns {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .js .tree-toggle {
        display: inline-grid;
    }

    .js .tree-branch[data-collapsed="true"] {
        display: none;
    }

    .tree-link {
        min-height: 44px;
    }
}

/* ---------- Page head, breadcrumbs, sections ---------- */
.page-head {
    padding-block: var(--space-6) var(--space-5);
}

.page-head--compact {
    padding-bottom: 0;
}

.page-head__inner--media {
    display: grid;
    gap: var(--space-5);
    align-items: center;
}

.page-head__title {
    font-size: var(--text-2xl);
}

.page-head__lead {
    max-width: 62ch;
    margin-top: var(--space-3);
    color: var(--ink-soft);
    font-size: var(--text-l);
    line-height: 1.55;
}

.page-head__media {
    width: min(220px, 50vw);
    aspect-ratio: 1;
    justify-self: end;
}

@media (min-width: 768px) {
    .page-head__inner--media {
        grid-template-columns: 1fr auto;
    }
}

@media (max-width: 767.98px) {
    .page-head__media {
        display: none;
    }
}

.breadcrumbs ol {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-1) 0;
    margin: 0 0 var(--space-3);
    padding: 0;
    list-style: none;
    font-size: var(--text-s);
    color: var(--muted);
}

.breadcrumbs li + li::before {
    content: "/";
    margin: 0 0.55rem;
    color: var(--slate-300);
}

.breadcrumbs a {
    text-decoration: none;
}

.breadcrumbs a:hover {
    text-decoration: underline;
}

.breadcrumbs [aria-current="page"] {
    color: var(--ink);
}

/* Phones: only the step back up (the parent of the current page), so a deep path never fills the screen. */
@media (max-width: 639.98px) {
    .breadcrumbs li:not(:nth-last-child(2)) {
        display: none;
    }

    .breadcrumbs li:nth-last-child(2)::before {
        content: "‹";
        margin: 0 0.4rem 0 0;
        color: var(--ink-soft);
    }
}

.section {
    padding-block: var(--space-8);
}

.section--tight {
    padding-block: var(--space-5) var(--space-8);
}

.section--sand {
    background: var(--sand-100);
}

.section__head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: var(--space-2) var(--space-5);
    margin-bottom: var(--space-6);
}

.section__title {
    font-size: var(--text-2xl);
}

.section__title--small {
    font-size: var(--text-xl);
}

.prose {
    max-width: 66ch;
}

.prose h2 {
    margin: var(--space-6) 0 var(--space-3);
    font-size: var(--text-xl);
}

.prose h2:first-child {
    margin-top: 0;
}

.prose p + p {
    margin-top: var(--space-4);
}

.empty-inline {
    color: var(--ink-soft);
}

/* ---------- Home: hero ---------- */
.hero {
    background: var(--slate-900);
    color: var(--stone-50);
    overflow: hidden;
}

.hero__inner {
    display: grid;
    gap: var(--space-6);
    padding-block: var(--space-7) var(--space-8);
}

.hero__title {
    max-width: 13ch;
    font-size: var(--text-3xl);
    line-height: 1.04;
}

.hero__lead {
    max-width: 44ch;
    margin-top: var(--space-5);
    color: var(--slate-200);
    font-size: var(--text-l);
    line-height: 1.55;
}

.hero__actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-3) var(--space-5);
    margin-top: var(--space-6);
}

.hero .button {
    background: var(--sand-300);
    border-color: var(--sand-300);
    color: var(--slate-950);
}

.hero .button:hover {
    background: var(--sand-200);
    border-color: var(--sand-200);
}

.hero .text-link {
    color: var(--stone-50);
    text-decoration-color: var(--sand-500);
}

.hero .text-link:hover {
    color: var(--sand-300);
}

.hero__media {
    position: relative;
    justify-self: center;
    width: min(100%, 560px);
}

.hero__image {
    width: 100%;
    aspect-ratio: 1.08;
    background-image: url("../images/site/hero.jpg"), url("../images/placeholder.svg");
}

.hero__image-small {
    position: absolute;
    left: -4%;
    bottom: -6%;
    width: 36%;
    aspect-ratio: 1.15;
    border: 6px solid var(--slate-900);
    background-image: url("../images/site/hero-2.jpg"), url("../images/placeholder.svg");
}

@media (min-width: 900px) {
    .hero__inner {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
        align-items: center;
        gap: var(--space-8);
        padding-block: var(--space-8) var(--space-9);
    }

    .hero__media {
        justify-self: end;
    }
}

/* ---------- Home: trust strip ---------- */
.trust-strip {
    background: var(--surface);
    border-bottom: 1px solid var(--line);
}

.trust-strip__list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr));
    gap: var(--space-4) var(--space-5);
    margin: 0 auto;
    padding-block: var(--space-5);
    list-style: none;
}

/* Four items: 2 × 2 on tablets (auto-fit would leave 3 + 1), then one row on desktop with each item as wide as its text,
   spread out evenly (equal columns made the longest item wrap alone). */
@media (min-width: 640px) {
    .trust-strip__list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (min-width: 1100px) {
    .trust-strip__list {
        display: flex;
        justify-content: space-between;
    }
}

.trust-item {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    min-width: 0;
}

.trust-item svg {
    flex: none;
    color: var(--moss-600);
}

.trust-item strong {
    display: block;
    font-size: var(--text-s);
    line-height: 1.3;
}

.trust-item span {
    display: block;
    color: var(--muted);
    font-size: var(--text-xs);
}

/* ---------- Product grid and card ---------- */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(150px, 100%), 1fr));
    gap: var(--space-6) var(--space-4);
    margin: 0;
    padding: 0;
    list-style: none;
}

@media (min-width: 768px) {
    .product-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: var(--space-7) var(--space-5);
    }
}

@media (min-width: 1100px) {
    .product-grid {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    }

    /* Beside the category sidebar: four columns at desktop widths instead of three oversized ones. */
    .listing .product-grid {
        grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
    }
}

/* ProductGridLayout.EvenRows (home featured shelf): 2 columns, 4 from 900 px, so an even count of cards fills whole rows
   (auto-fill gave 3 + 3 + 2 at 768 px). ImageSources.EvenRowsProductCardSizes mirrors these steps. */
.product-grid--even-rows {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

@media (min-width: 900px) {
    .product-grid--even-rows {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

.product-card {
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* Cards in one grid row share three row tracks (photo + name, summary, price), so summaries and prices line up across the row
   even when a name wraps. The grid's row gap moves to padding under each card, since the cards' own tracks must sit flush. */
@supports (grid-template-rows: subgrid) {
    .product-grid {
        --product-grid-row-gap: var(--space-6);
        row-gap: 0;
        margin-bottom: calc(-1 * var(--product-grid-row-gap));
    }

    .product-grid > li,
    .product-card {
        display: grid;
        grid-row: span 3;
        grid-template-rows: subgrid;
        row-gap: 0;
    }

    .product-grid > li {
        padding-bottom: var(--product-grid-row-gap);
    }

    .product-card {
        height: auto;
    }

    .product-card__summary {
        align-self: start;
    }

    @media (min-width: 768px) {
        .product-grid {
            --product-grid-row-gap: var(--space-7);
        }
    }
}

.product-card__link {
    text-decoration: none;
}

.product-card__media {
    position: relative;
    aspect-ratio: 1;
    overflow: hidden;
    border-radius: var(--radius-l);
    background: var(--stone-200);
}

.product-card__media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-card--sold-out .product-card__media img {
    opacity: 0.6;
    filter: grayscale(0.5);
}

.product-card__badges {
    position: absolute;
    left: var(--space-2);
    top: var(--space-2);
    right: var(--space-2);
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-1);
}

.product-card__name {
    margin-top: var(--space-3);
    font-size: var(--text-l);
    line-height: 1.2;
    overflow-wrap: anywhere;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-card__link:hover .product-card__name {
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 0.18em;
}

.product-card__summary {
    margin-top: var(--space-1);
    color: var(--muted);
    font-size: var(--text-s);
    line-height: 1.45;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-card__meta {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0 var(--space-3);
    margin-top: auto;
    padding-top: var(--space-2);
}

.product-card__price {
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.product-card__stock {
    color: var(--warning-700);
    font-size: var(--text-xs);
    font-weight: 600;
}

@media (max-width: 479.98px) {
    .product-card__name {
        font-size: 1.05rem;
    }

    .product-card__summary {
        display: none;
    }

    .badge {
        font-size: 0.72rem;
        padding: 0.15rem 0.5rem;
    }
}

/* ---------- Home: category tiles ---------- */
/* Column counts: 2, 3 from 480 px, then the page's balanced counts (DisplayLimits.GetCategoryTileLayout, inline
   --tile-columns-medium / --tile-columns-wide) from 768 / 1100 px. A short last row is centred, never left as an orphan at the
   left edge. ImageSources.GetCategoryTileSizes mirrors these steps and the column gap. */
.category-tiles {
    --tile-columns: 2;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: var(--space-6) var(--space-5);
    margin: 0;
    padding: 0;
    list-style: none;
}

.category-tiles > li {
    flex: 0 0 calc((100% - (var(--tile-columns) - 1) * var(--space-5)) / var(--tile-columns));
    min-width: 0;
}

@media (min-width: 480px) {
    .category-tiles {
        --tile-columns: 3;
    }
}

@media (min-width: 768px) {
    .category-tiles {
        --tile-columns: var(--tile-columns-medium, 3);
    }
}

@media (min-width: 1100px) {
    .category-tiles {
        --tile-columns: var(--tile-columns-wide, 6);
    }
}

.category-tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    text-decoration: none;
}

.category-tile__media {
    display: block;
    width: 100%;
    aspect-ratio: 1;
}

.category-tile__name {
    margin-top: var(--space-4);
    font-family: var(--font-display);
    font-size: var(--text-l);
    line-height: 1.2;
    overflow-wrap: anywhere;
}

.category-tile:hover .category-tile__name {
    text-decoration: underline;
    text-underline-offset: 0.18em;
}

.category-tile__text {
    margin-top: var(--space-1);
    max-width: 30ch;
    color: var(--ink-soft);
    font-size: var(--text-s);
    line-height: 1.45;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

@media (max-width: 479.98px) {
    .category-tile__text {
        display: none;
    }
}

/* ---------- Home: process band ---------- */
.process {
    padding-block: var(--space-8);
    background: var(--moss-800);
    color: var(--moss-50);
}

.process__title {
    max-width: 18ch;
    color: var(--stone-50);
}

.process__steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr));
    gap: var(--space-6);
    margin: var(--space-7) 0 0;
    padding: 0;
    list-style: none;
    counter-reset: step;
}

/* Four steps: 2 × 2 from 640 px (auto-fit would leave 3 + 1), one row from 1100 px. */
@media (min-width: 640px) {
    .process__steps {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (min-width: 1100px) {
    .process__steps {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

.process__step {
    counter-increment: step;
    padding-top: var(--space-4);
    border-top: 1px solid var(--moss-50-faint);
}

.process__step::before {
    content: counter(step);
    display: block;
    margin-bottom: var(--space-3);
    font-family: var(--font-display);
    font-size: 2.4rem;
    line-height: 1;
    color: var(--sand-300);
}

.process__step h3 {
    color: var(--stone-50);
    font-size: var(--text-l);
}

.process__step p {
    margin-top: var(--space-2);
    color: var(--moss-50);
    font-size: var(--text-s);
    line-height: 1.6;
}

/* ---------- Home: about teaser ---------- */
.about-teaser {
    display: grid;
    gap: var(--space-6);
    align-items: center;
}

.about-teaser__media {
    width: min(100%, 460px);
    aspect-ratio: 1.15;
    justify-self: center;
    background-image: url("../images/site/about.jpg"), url("../images/placeholder.svg");
}

.about-teaser__copy p {
    max-width: 52ch;
    margin: var(--space-4) 0 var(--space-5);
    color: var(--ink-soft);
    font-size: var(--text-l);
    line-height: 1.6;
}

@media (min-width: 768px) {
    .about-teaser {
        grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
        gap: var(--space-8);
    }
}

/* ---------- Listing (shop, category) ---------- */
.listing {
    display: grid;
    gap: var(--space-5);
}

@media (min-width: 960px) {
    .listing {
        grid-template-columns: 240px minmax(0, 1fr);
        gap: var(--space-7);
        align-items: start;
    }

    .listing__aside {
        position: sticky;
        top: calc(var(--header-height) + var(--space-4));
    }

    /* site.js keeps the panel open on desktop, so the heading is not a toggle there. */
    .js .category-filter__summary {
        pointer-events: none;
    }

    .js .category-filter__summary::after {
        display: none;
    }
}

/* Without JavaScript the panel is rendered closed; on desktop show its content anyway (browsers without ::details-content
   ignore this rule and keep a working toggle). */
@media (min-width: 960px) {
    .category-filter::details-content {
        content-visibility: visible;
    }
}

.category-filter {
    border: 1px solid var(--line);
    border-radius: var(--radius-m);
    background: var(--surface);
    padding: 0 var(--space-4);
}

.category-filter__summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 50px;
    font-weight: 700;
    cursor: pointer;
    list-style: none;
}

.category-filter__summary::-webkit-details-marker {
    display: none;
}

.category-filter__summary::after {
    content: "";
    width: 0.55rem;
    height: 0.55rem;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg) translateY(-25%);
    transition: transform 0.2s ease;
}

.category-filter[open] > .category-filter__summary::after {
    transform: rotate(-135deg);
}

.side-tree {
    margin: 0;
    padding: 0 0 var(--space-4);
    list-style: none;
}

.side-tree__branch {
    margin: 0;
    padding: 0 0 0 var(--space-3);
    list-style: none;
    border-left: 1px solid var(--line);
}

.side-tree__link {
    display: block;
    padding: 0.4rem 0.6rem;
    border-radius: var(--radius-s);
    font-size: var(--text-s);
    line-height: 1.35;
    text-decoration: none;
    overflow-wrap: anywhere;
}

.side-tree__link:hover {
    background: var(--stone-200);
    color: var(--ink);
}

.side-tree__link[aria-current="page"] {
    background: var(--moss-50);
    color: var(--moss-800);
    font-weight: 700;
}

.side-tree > li > .side-tree__link {
    font-weight: 600;
}

.listing__toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
    margin-bottom: var(--space-5);
    padding-bottom: var(--space-4);
    border-bottom: 1px solid var(--line);
}

.listing__count {
    color: var(--muted);
    font-size: var(--text-s);
}

.sort-form {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-2);
    font-size: var(--text-s);
}

.sort-form label {
    font-weight: 600;
}

.js .sort-form__apply {
    display: none;
}

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-7) var(--space-4);
    border: 1px dashed var(--slate-300);
    border-radius: var(--radius-l);
    text-align: center;
    color: var(--ink-soft);
}

.empty-state--large {
    border: 0;
    padding-block: var(--space-6) var(--space-8);
}

.empty-state__title {
    color: var(--ink);
    font-size: var(--text-xl);
}

.empty-state .button {
    margin-top: var(--space-3);
}

.empty-state__art {
    width: 140px;
    aspect-ratio: 1.2;
    margin-bottom: var(--space-3);
}

/* ---------- Forms ---------- */
.select {
    position: relative;
}

.select::after {
    content: "";
    position: absolute;
    right: 1rem;
    top: 50%;
    width: 0.5rem;
    height: 0.5rem;
    border-right: 2px solid var(--ink-soft);
    border-bottom: 2px solid var(--ink-soft);
    transform: translateY(-70%) rotate(45deg);
    pointer-events: none;
}

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="number"],
input:not([type]),
select,
textarea {
    width: 100%;
    min-height: 48px;
    padding: 0.65rem 0.9rem;
    border: 1.5px solid var(--line);
    border-radius: var(--radius-m);
    background: var(--white);
    font-size: var(--text-m);
    line-height: 1.4;
}

select {
    appearance: none;
    padding-right: 2.5rem;
    cursor: pointer;
}

.sort-form select {
    width: auto;
    min-height: 42px;
    font-size: var(--text-s);
}

textarea {
    resize: vertical;
    min-height: 96px;
}

input:hover,
select:hover,
textarea:hover {
    border-color: var(--slate-300);
}

input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 3px solid var(--focus);
    outline-offset: 1px;
    border-color: var(--slate-700);
}

.input-validation-error {
    border-color: var(--danger-600) !important;
    background: var(--danger-25);
}

.form {
    display: flex;
    flex-direction: column;
    gap: var(--space-5);
}

.form__group {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-4);
    margin: 0;
    padding: var(--space-5);
    border: 1px solid var(--line);
    border-radius: var(--radius-l);
    background: var(--surface);
    min-width: 0;
}

.form__legend {
    float: left;
    width: 100%;
    margin-bottom: var(--space-1);
    padding: 0;
    font-family: var(--font-display);
    font-size: var(--text-xl);
    line-height: 1.2;
}

.form__legend + * {
    clear: both;
}

@media (min-width: 640px) {
    .form__group {
        grid-template-columns: 1fr 1fr;
        padding: var(--space-6);
    }

    .field--wide,
    .pay-options,
    .form__group > .field__error {
        grid-column: 1 / -1;
    }

    .form__legend {
        grid-column: 1 / -1;
    }
}

.field {
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
    min-width: 0;
}

.field label {
    font-weight: 600;
    font-size: var(--text-s);
}

.field__hint {
    color: var(--muted);
    font-size: var(--text-xs);
}

.field__error,
.field-validation-error {
    color: var(--danger-600);
    font-size: var(--text-s);
    font-weight: 600;
}

.field__error:empty {
    display: none;
}

.form__summary ul {
    margin: 0;
    padding: var(--space-3) var(--space-4) var(--space-3) var(--space-6);
    border-radius: var(--radius-s);
    background: var(--danger-50);
    color: var(--danger-600);
}

.form__summary.validation-summary-valid {
    display: none;
}

.form__fine {
    color: var(--muted);
    font-size: var(--text-xs);
    text-align: center;
}

.pay-options {
    display: grid;
    gap: var(--space-3);
}

.pay-option {
    display: flex;
    align-items: flex-start;
    gap: var(--space-3);
    padding: var(--space-4);
    border: 1.5px solid var(--line);
    border-radius: var(--radius-m);
    background: var(--white);
    cursor: pointer;
}

.pay-option:hover {
    border-color: var(--slate-300);
}

.pay-option:has(input:checked) {
    border-color: var(--action);
    background: var(--moss-50);
}

.pay-option input {
    flex: none;
    width: 20px;
    height: 20px;
    margin: 0.15rem 0 0;
    accent-color: var(--action);
}

.pay-option__title {
    display: block;
    font-weight: 700;
}

.pay-option__text {
    display: block;
    margin-top: var(--space-1);
    color: var(--ink-soft);
    font-size: var(--text-s);
    line-height: 1.5;
}

/* Quantity stepper */
.qty {
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
}

.qty__label {
    font-weight: 600;
    font-size: var(--text-s);
}

.qty__control {
    display: inline-flex;
    align-items: stretch;
    width: max-content;
    border: 1.5px solid var(--line);
    border-radius: var(--radius-pill);
    background: var(--white);
    overflow: hidden;
}

.qty__step {
    width: 46px;
    border: 0;
    background: transparent;
    font-size: 1.25rem;
    line-height: 1;
    cursor: pointer;
}

.qty__step:hover:not(:disabled) {
    background: var(--stone-200);
}

.qty__step:disabled {
    color: var(--slate-300);
    cursor: not-allowed;
}

.qty__control .qty__input {
    width: 3.5rem;
    min-height: 46px;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    text-align: center;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    -moz-appearance: textfield;
}

.qty__control .qty__input::-webkit-outer-spin-button,
.qty__control .qty__input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.qty__control--small .qty__step {
    width: 38px;
}

.qty__control--small .qty__input {
    width: 2.75rem;
    min-height: 40px;
}

/* ---------- Product page ---------- */
.product-page {
    padding-top: var(--space-5);
    padding-bottom: var(--space-8);
}

.product {
    display: grid;
    gap: var(--space-6);
}

@media (min-width: 900px) {
    .product {
        grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
        gap: var(--space-8);
        align-items: start;
    }

    .gallery {
        position: sticky;
        top: calc(var(--header-height) + var(--space-4));
    }
}

.gallery__main {
    aspect-ratio: 1;
    overflow: hidden;
    border-radius: var(--radius-l);
    background: var(--stone-200);
}

.gallery__main img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.gallery__thumbs {
    display: flex;
    gap: var(--space-2);
    margin: var(--space-3) 0 0;
    padding: 0;
    list-style: none;
    overflow-x: auto;
}

.gallery__thumb {
    display: block;
    width: 76px;
    aspect-ratio: 1;
    overflow: hidden;
    border: 2px solid transparent;
    border-radius: var(--radius-m);
    background: var(--stone-200);
}

.gallery__thumb[aria-current="true"] {
    border-color: var(--slate-900);
}

.gallery__thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product__name {
    font-size: clamp(1.65rem, 1.3rem + 1.3vw, 2.4rem);
    overflow-wrap: anywhere;
}

.product__summary {
    margin-top: var(--space-3);
    color: var(--ink-soft);
    font-size: var(--text-l);
    line-height: 1.5;
}

.product__buy {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
    margin-top: var(--space-5);
    padding: var(--space-5);
    border-radius: var(--radius-l);
    background: var(--surface);
    border: 1px solid var(--line);
}

.product__price {
    font-family: var(--font-display);
    font-size: var(--text-xl);
    font-variant-numeric: tabular-nums;
}

.stock {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    margin-top: calc(-1 * var(--space-3));
    font-size: var(--text-s);
    font-weight: 600;
}

.stock__dot {
    width: 0.6rem;
    height: 0.6rem;
    border-radius: 50%;
    background: var(--moss-600);
}

.stock--low {
    color: var(--warning-700);
}

.stock--low .stock__dot {
    background: var(--sand-500);
}

.stock--soldout {
    color: var(--slate-700);
}

.stock--soldout .stock__dot {
    background: var(--slate-700);
}

.add-to-cart {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: var(--space-3);
}

.add-to-cart .button {
    flex: 1 1 200px;
}

.product__ship-note {
    color: var(--muted);
    font-size: var(--text-s);
}

.details-table {
    width: 100%;
    margin-top: var(--space-5);
    border-collapse: collapse;
    font-size: var(--text-s);
}

.details-table th,
.details-table td {
    padding: 0.7rem 0;
    border-bottom: 1px solid var(--line);
    text-align: left;
    vertical-align: top;
}

.details-table th {
    width: 34%;
    padding-right: var(--space-4);
    color: var(--muted);
    font-weight: 600;
}

.details-table td {
    overflow-wrap: anywhere;
}

.product__description {
    margin-top: var(--space-6);
}

/* ---------- Cart ---------- */
.cart {
    display: grid;
    gap: var(--space-6);
}

@media (min-width: 960px) {
    .cart {
        grid-template-columns: minmax(0, 1fr) 360px;
        gap: var(--space-7);
        align-items: start;
    }

    .summary-card {
        position: sticky;
        top: calc(var(--header-height) + var(--space-4));
    }
}

.cart-lines {
    margin: 0 0 var(--space-4);
    padding: 0;
    list-style: none;
    border-top: 1px solid var(--line);
}

.cart-line {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    grid-template-areas:
        "media info info"
        "qty remove total";
    gap: var(--space-3) var(--space-4);
    align-items: center;
    padding-block: var(--space-4);
    border-bottom: 1px solid var(--line);
}

.cart-line__media {
    grid-area: media;
    align-self: start;
    width: 84px;
    aspect-ratio: 1;
    overflow: hidden;
    border-radius: var(--radius-m);
    background: var(--stone-200);
}

.cart-line__media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cart-line__info {
    grid-area: info;
    min-width: 0;
}

.cart-line__name {
    font-family: var(--font-display);
    font-size: 1.15rem;
    line-height: 1.25;
    text-decoration: none;
    overflow-wrap: anywhere;
}

.cart-line__name:hover {
    text-decoration: underline;
}

.cart-line__unit {
    margin-top: var(--space-1);
    color: var(--muted);
    font-size: var(--text-s);
}

.cart-line__stock {
    color: var(--warning-700);
    font-size: var(--text-xs);
    font-weight: 600;
}

.cart-line__qty {
    grid-area: qty;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-2);
}

.js .cart-line__qty [data-qty-submit] {
    display: none;
}

.js .cart-line__qty.is-dirty [data-qty-submit] {
    display: inline-flex;
}

.cart-line__total {
    grid-area: total;
    justify-self: end;
    align-self: center;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.cart-line__remove {
    grid-area: remove;
    justify-self: start;
}

@media (min-width: 640px) {
    .cart-line__media {
        width: 110px;
    }

    .cart-line__remove {
        justify-self: end;
    }

    .cart-line {
        grid-template-columns: 110px minmax(0, 1fr) auto auto;
        grid-template-areas:
            "media info qty total"
            "media info qty remove";
        gap: var(--space-1) var(--space-5);
    }

    .cart-line__total {
        align-self: end;
        min-width: 5.5rem;
        text-align: right;
    }

    .cart-line__remove {
        align-self: start;
    }
}

.summary-card {
    padding: var(--space-5);
    border: 1px solid var(--line);
    border-radius: var(--radius-l);
    background: var(--surface);
}

.summary-card__title {
    margin-bottom: var(--space-4);
    font-size: var(--text-xl);
}

.summary-card .button {
    margin-top: var(--space-5);
}

.summary-card__fine {
    margin-top: var(--space-3);
    color: var(--muted);
    font-size: var(--text-xs);
    text-align: center;
}

.ship-progress {
    margin-bottom: var(--space-4);
    padding: var(--space-3) var(--space-4);
    border-radius: var(--radius-m);
    background: var(--sand-100);
    font-size: var(--text-s);
}

.ship-progress--done {
    background: var(--moss-50);
    color: var(--moss-800);
    font-weight: 600;
}

.ship-progress__bar {
    height: 8px;
    margin-top: var(--space-2);
    border-radius: var(--radius-pill);
    background: var(--sand-200);
    overflow: hidden;
}

.ship-progress__bar span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: var(--moss-600);
}

.totals {
    margin: 0;
}

.totals__row {
    display: flex;
    justify-content: space-between;
    gap: var(--space-4);
    padding-block: 0.45rem;
    font-variant-numeric: tabular-nums;
}

.totals dt {
    color: var(--ink-soft);
}

.totals dd {
    margin: 0;
    font-weight: 600;
}

.totals__row--total {
    margin-top: var(--space-2);
    padding-top: var(--space-3);
    border-top: 1px solid var(--line);
    font-size: var(--text-l);
}

.totals__row--total dt {
    color: var(--ink);
    font-weight: 700;
}

.totals__row--total dd {
    font-weight: 700;
}

.totals__note {
    margin-top: var(--space-1);
    color: var(--muted);
    font-size: var(--text-xs);
}

/* ---------- Checkout ---------- */
.checkout {
    display: grid;
    gap: var(--space-6);
}

@media (min-width: 960px) {
    .checkout {
        grid-template-columns: minmax(0, 1fr) 380px;
        gap: var(--space-7);
        align-items: start;
    }
}

@media (max-width: 959.98px) {
    .checkout__summary {
        order: -1;
    }
}

.mini-lines {
    margin: 0 0 var(--space-3);
    padding: 0;
    list-style: none;
}

.mini-line {
    display: grid;
    grid-template-columns: 52px minmax(0, 1fr) auto;
    gap: var(--space-3);
    align-items: center;
    padding-block: var(--space-2);
    border-bottom: 1px solid var(--line);
    font-size: var(--text-s);
}

.mini-line--plain {
    grid-template-columns: minmax(0, 1fr) auto;
}

.mini-line img {
    width: 52px;
    height: 52px;
    border-radius: var(--radius-s);
    object-fit: cover;
    background: var(--stone-200);
}

.mini-line__name {
    overflow-wrap: anywhere;
}

.mini-line__qty {
    color: var(--muted);
    white-space: nowrap;
}

.mini-line__total {
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

/* ---------- Confirmation ---------- */
.confirmation__head {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-3);
    margin-bottom: var(--space-7);
}

.confirmation__mark {
    display: grid;
    place-items: center;
    width: 84px;
    height: 74px;
    background: var(--moss-600);
    background-image: none;
    color: var(--stone-50);
}

.confirmation__grid {
    display: grid;
    gap: var(--space-6);
}

@media (min-width: 900px) {
    .confirmation__grid {
        grid-template-columns: minmax(0, 1fr) 380px;
        gap: var(--space-8);
        align-items: start;
    }
}

.confirmation__next p {
    max-width: 56ch;
    margin-top: var(--space-3);
    color: var(--ink-soft);
}

.confirmation__next .button {
    margin-top: var(--space-6);
}

.order-meta {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-3);
    margin: 0 0 var(--space-4);
    font-size: var(--text-s);
}

.order-meta__wide {
    grid-column: 1 / -1;
}

.order-meta dt {
    color: var(--muted);
}

.order-meta dd {
    margin: 0;
    font-weight: 600;
}

/* ---------- About ---------- */
.story-hero {
    background: var(--slate-900);
    color: var(--stone-50);
}

.story-hero__inner {
    display: grid;
    gap: var(--space-6);
    align-items: center;
    padding-block: var(--space-7);
}

.story-hero .page-head__title {
    max-width: 16ch;
    font-size: var(--text-3xl);
}

.story-hero .page-head__lead {
    color: var(--slate-200);
}

.story-hero__media {
    width: min(100%, 480px);
    aspect-ratio: 1.1;
    justify-self: center;
    background-image: url("../images/site/about.jpg"), url("../images/placeholder.svg");
}

.story {
    display: grid;
    gap: var(--space-7);
    align-items: start;
}

.story__media {
    width: min(100%, 420px);
    aspect-ratio: 0.9;
    justify-self: center;
    background-image: url("../images/site/about-2.jpg"), url("../images/placeholder.svg");
}

@media (min-width: 900px) {
    .story-hero__inner {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
        gap: var(--space-8);
        padding-block: var(--space-8);
    }

    .story {
        grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
        gap: var(--space-8);
    }

    .story__media {
        position: sticky;
        top: calc(var(--header-height) + var(--space-5));
    }
}

.promise-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr));
    gap: var(--space-5);
    margin: var(--space-6) 0 0;
    padding: 0;
    list-style: none;
}

.promise {
    padding: var(--space-5);
    border-radius: var(--radius-l);
    background: var(--stone-50);
}

.promise h3 {
    font-size: var(--text-l);
}

.promise p {
    margin-top: var(--space-2);
    color: var(--ink-soft);
    font-size: var(--text-s);
    line-height: 1.6;
}

.contact {
    display: grid;
    gap: var(--space-6);
}

.contact__list {
    display: grid;
    gap: var(--space-4);
    margin: 0;
}

.contact__list dt {
    color: var(--muted);
    font-size: var(--text-s);
    font-weight: 600;
}

.contact__list dd {
    margin: 0;
    font-size: var(--text-l);
    overflow-wrap: anywhere;
}

@media (min-width: 768px) {
    .contact {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
        gap: var(--space-8);
    }
}

/* ---------- Status pages ---------- */
.status-page {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-4);
    text-align: center;
}

.status-page .page-head__lead {
    margin-top: 0;
}

.status-page__art {
    display: grid;
    place-items: center;
    width: 170px;
    height: 140px;
    background: var(--slate-900);
    background-image: none;
    color: var(--sand-300);
    font-family: var(--font-display);
    font-size: 2.6rem;
}

.status-page__actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: var(--space-3) var(--space-5);
    margin-top: var(--space-3);
}

.status-page__ref {
    color: var(--muted);
    font-size: var(--text-xs);
    overflow-wrap: anywhere;
}

/* ---------- Footer ---------- */
.site-footer {
    margin-top: auto;
    background: var(--slate-950);
    color: var(--slate-200);
    font-size: var(--text-s);
}

/* One column, then 2 × 2 from 640 px, then four columns from 1100 px with the short link list narrowest; the address column
   stays wide enough for the e-mail address on one line (auto-fit left it alone in a third-width column at 768 px). */
.site-footer__grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: var(--space-6);
    padding-block: var(--space-8) var(--space-6);
}

@media (min-width: 640px) {
    .site-footer__grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (min-width: 1100px) {
    .site-footer__grid {
        grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr) minmax(0, 1.1fr) minmax(0, 1.2fr);
    }
}

.brand--footer {
    --logo-highlight: var(--slate-950);
    color: var(--stone-50);
}

.brand--footer:hover {
    color: var(--stone-50);
}

.brand--footer .logo-mark {
    color: var(--sand-300);
}

.brand--footer .brand__sub {
    color: var(--slate-300);
}

.site-footer__brand p {
    max-width: 30ch;
    margin-top: var(--space-4);
}

.site-footer__heading {
    margin-bottom: var(--space-3);
    color: var(--stone-50);
    font-family: var(--font-body);
    font-size: var(--text-s);
    font-weight: 700;
    letter-spacing: 0;
}

.site-footer__links,
.site-footer__trust {
    display: grid;
    gap: var(--space-2);
    margin: 0;
    padding: 0;
    list-style: none;
}

.site-footer a {
    color: var(--stone-50);
}

.site-footer a:hover {
    color: var(--sand-300);
}

.site-footer__address {
    font-style: normal;
    line-height: 1.7;
    overflow-wrap: break-word;
}

.site-footer__legal {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: var(--space-2) var(--space-5);
    padding-block: var(--space-5);
    border-top: 1px solid var(--slate-800);
    color: var(--slate-300);
    font-size: var(--text-xs);
}

/* ---------- Motion preferences ---------- */
@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
