/* ============================================================
   split404 — "CANVAS" visual system
   Light, warm paper. Hairlines, no shadows, no rotation.
   One red accent used like a painter's signature.
   Token source: design_handoff_split404_canvas/split404-tokens.css
   ============================================================ */

/* Subset files must ship in latin + latin-ext pairs WITH unicode-range:
   a lone latin-ext file has no basic alphabet, so browsers draw accented
   glyphs / fall back per character. */
@font-face {
    font-family: 'Archivo';
    src: url('../fonts/archivo-latin.woff2') format('woff2');
    font-weight: 100 900;
    font-style: normal;
    font-display: swap;
    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: 'Archivo';
    src: url('../fonts/archivo-latin-ext.woff2') format('woff2');
    font-weight: 100 900;
    font-style: normal;
    font-display: swap;
    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: 'Red Hat Mono';
    src: url('../fonts/redhatmono-latin.woff2') format('woff2');
    font-weight: 300 700;
    font-style: normal;
    font-display: swap;
    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: 'Red Hat Mono';
    src: url('../fonts/redhatmono-latin-ext.woff2') format('woff2');
    font-weight: 300 700;
    font-style: normal;
    font-display: swap;
    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;
}

:root {
    /* ---- color ---- */
    --bg:        #F2EDE2;
    --surface:   #FAF7EF;
    --ink:       #1F1B16;
    --muted:     #7A7264;
    --line:      #DCD4C4;
    --accent:    #D2451E;
    --ok:        #467C4B;
    --art-ph:    #E6DECC;
    --on-ink:    #F2EDE2;
    --on-accent: #FAF7EF;

    /* ---- type ---- */
    --font-body: 'Archivo', system-ui, sans-serif;
    /* Client override 2026-07-12: Red Hat Mono (rounder) replaces the
       handoff's DM Mono for all mono micro-labels. */
    --font-mono: 'Red Hat Mono', ui-monospace, monospace;

    --fs-2xl: 38px;
    --fs-xl:  28px;
    --fs-lg:  22px;
    --fs-md:  17px;
    --fs-base:15px;
    --fs-sm:  13.5px;
    --fs-xs:  12px;
    --fs-2xs: 10.5px;

    --track-tight: -0.02em;
    --track-wide:  0.16em;

    /* ---- space ---- */
    --sp-1: 4px;  --sp-2: 8px;  --sp-3: 12px; --sp-4: 16px;
    --sp-5: 24px; --sp-6: 32px; --sp-7: 48px; --sp-8: 64px;

    /* ---- shape ---- */
    --radius: 3px;
    --radius-round: 50%;
    --border: 1px solid var(--line);

    /* ---- motion ---- */
    --t-fast: 120ms ease;
    --t-med:  200ms ease-out;

    /* ---- z ---- */
    --z-header: 40;  --z-sticky-cta: 45;  --z-player: 50;
}

/* ---------- Base ---------- */

* { box-sizing: border-box; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: var(--font-body);
    font-size: var(--fs-base);
    line-height: 1.6;
    padding-bottom: 80px; /* room for the player bar */
}

img { max-width: 100%; }

a { color: var(--ink); text-decoration: none; transition: color var(--t-fast); }
a:hover { color: var(--accent); }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

h1 {
    font-weight: 700;
    font-size: var(--fs-xl);
    letter-spacing: var(--track-tight);
    line-height: 1.2;
    margin: 0 0 var(--sp-4);
}

/* mono micro-label: ALWAYS uppercase */
.mono-label {
    font-family: var(--font-mono);
    font-size: var(--fs-2xs);
    letter-spacing: var(--track-wide);
    text-transform: uppercase;
    color: var(--muted);
}

.empty { color: var(--muted); padding: var(--sp-6) 0; }
.hint { color: var(--muted); font-size: 12.5px; }

.notice {
    background: var(--surface);
    border: var(--border);
    border-radius: var(--radius);
    padding: 10px 12px;
    margin: var(--sp-3) 0;
    font-size: var(--fs-sm);
}
.notice.error { border-left: 2px solid var(--accent); }

/* ---------- Site frame ---------- */

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--sp-4) var(--sp-6);
    border-bottom: var(--border);
    position: sticky;
    top: 0;
    background: var(--bg);
    z-index: var(--z-header);
}

.brand {
    font-weight: 700;
    font-size: 20px;
    letter-spacing: -0.03em;
    text-transform: lowercase;
}
.brand:hover { color: var(--ink); }
.brand-dot {
    display: inline-block;
    width: 0.24em;
    height: 0.24em;
    background: var(--accent);
    margin-left: 0.16em;
}

.topbar nav { display: flex; gap: 28px; align-items: center; }
.topbar nav a { font-weight: 500; font-size: var(--fs-sm); }
.topbar nav a.active {
    font-weight: 600;
    border-bottom: 2px solid var(--ink);
    padding-bottom: 2px;
}
.topbar nav a.active:hover { color: var(--ink); }

.cart-link { display: inline-flex; align-items: center; gap: 7px; }
.cart-count {
    font-family: var(--font-mono);
    font-weight: 500;
    font-size: 10px;
    background: var(--ink);
    color: var(--bg);
    border-radius: var(--radius);
    padding: 3px 6px;
    transition: transform 150ms ease;
}
.cart-count.pulse { transform: scale(1.15); }

.container { max-width: 1240px; margin: 0 auto; padding: var(--sp-5) var(--sp-6) var(--sp-7); }

.footer {
    border-top: var(--border);
    padding: 40px var(--sp-6) var(--sp-7);
    margin-top: var(--sp-7);
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: var(--sp-6);
    flex-wrap: wrap;
}
.footer-brand { display: flex; flex-direction: column; gap: var(--sp-2); }
.footer-brand .brand { font-size: 16px; }
.footer-copy {
    font-family: var(--font-mono);
    font-size: 10.5px;
    letter-spacing: 0.08em;
    color: var(--muted);
}

.newsletter { display: flex; flex-direction: column; gap: 10px; width: 380px; max-width: 100%; }
.newsletter-label { font-weight: 600; font-size: 14px; color: var(--ink); }
.newsletter-fields { display: flex; gap: var(--sp-2); }
.newsletter input[type="email"] { flex: 1; }
.newsletter-hint {
    font-family: var(--font-mono);
    font-size: 9.5px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
}
.newsletter-done { color: var(--ok); font-size: var(--fs-sm); }

/* ---------- Buttons ---------- */

.btn {
    display: inline-block;
    font: 500 var(--fs-sm)/1 var(--font-body);
    color: var(--ink);
    background: transparent;
    border: var(--border);
    border-radius: var(--radius);
    padding: 13px 16px;
    cursor: pointer;
    text-align: center;
    transition: border-color var(--t-fast), background var(--t-fast), color var(--t-fast);
}
.btn:hover { border-color: var(--ink); color: var(--ink); }

.btn.primary {
    font-weight: 600;
    color: var(--on-ink);
    background: var(--ink);
    border-color: var(--ink);
}
.btn.primary:hover { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }

.btn.paypal {
    font-weight: 600;
    color: var(--ink);
    background: var(--surface);
    border: 1px solid var(--ink);
}
.btn.paypal:hover { color: var(--ink); background: var(--bg); }

.btn.added, .btn.primary.added {
    background: var(--ok);
    border-color: var(--ok);
    color: var(--on-ink);
}
.btn:disabled { opacity: .55; cursor: default; }

/* ---------- Intro row + filters (catalog) ---------- */

.intro-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: var(--sp-4);
    padding-top: var(--sp-4);
    margin-bottom: 20px;
    flex-wrap: wrap;
}
.intro-row h1 { margin: 0; }

.filters {
    display: flex;
    flex-wrap: wrap;
    gap: var(--sp-3);
    align-items: center;
    margin-bottom: var(--sp-5);
}

.filters input,
.filters select,
.newsletter input[type="email"],
input.field {
    font: 400 var(--fs-sm)/1.2 var(--font-body);
    color: var(--ink);
    background: var(--surface);
    border: var(--border);
    border-radius: var(--radius);
    padding: 12px 14px;
    transition: border-color var(--t-fast);
}
.filters input::placeholder, .newsletter input::placeholder { color: var(--muted); }
.filters input:focus-visible, .filters select:focus-visible,
.newsletter input:focus-visible { outline: none; border-color: var(--ink); }

.filters input[type="search"] { flex: 1 1 280px; min-width: 200px; }

.filters select {
    appearance: none;
    -webkit-appearance: none;
    padding-right: 30px;
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='5'%3E%3Cpath d='M0 0l4 5 4-5z' fill='%237A7264'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    cursor: pointer;
}

/* segmented toggle */
.segmented {
    display: flex;
    border: var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--surface);
}
.segmented label { position: relative; cursor: pointer; }
.segmented input {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    left: 0;
    top: 0;
    margin: 0;
    cursor: pointer;
}
.segmented span {
    display: block;
    font: 500 13px/1 var(--font-body);
    color: var(--muted);
    padding: 12px 18px;
    transition: background var(--t-fast), color var(--t-fast);
}
.segmented input:checked + span {
    font-weight: 600;
    background: var(--ink);
    color: var(--bg);
}
.segmented input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: -2px; }

.bpm-range { display: flex; align-items: center; gap: 6px; }
.bpm-range input {
    width: 56px;
    font-family: var(--font-mono);
    font-size: var(--fs-xs);
    padding: 12px 10px;
}
.bpm-range input::-webkit-outer-spin-button,
.bpm-range input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.bpm-range .bpm-dash { font-family: var(--font-mono); font-size: 11px; color: var(--muted); }
.bpm-range .bpm-label {
    font-family: var(--font-mono);
    font-size: 10px;
    letter-spacing: 0.1em;
    color: var(--muted);
}

.filters .sort-field { margin-left: auto; }

/* active filter chips */
.filter-chips { display: flex; flex-wrap: wrap; gap: var(--sp-2); margin-bottom: var(--sp-4); }
.filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-family: var(--font-mono);
    font-size: var(--fs-2xs);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--ink);
    border: 1px solid var(--ink);
    border-radius: var(--radius);
    padding: 6px 10px;
}
.filter-chip:hover { color: var(--accent); border-color: var(--accent); }

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

.grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--sp-3);
}
@media (min-width: 640px) { .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--sp-5); } }
@media (min-width: 960px) { .grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

.card {
    background: var(--surface);
    border: var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: border-color var(--t-fast);
}
.card:hover { border-color: var(--ink); }

.card-cover { position: relative; display: block; }
.card-cover img {
    display: block;
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    background: var(--art-ph);
}

/* Pack cards: no chip, no meta — a muted inline suffix on the title instead */
.title-suffix { font-weight: 500; color: var(--muted); }

/* no-art placeholder: vinyl ghost */
.cover-placeholder {
    width: 100%;
    aspect-ratio: 1 / 1;
    background: var(--art-ph);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}
.cover-placeholder::before {
    content: '';
    width: 54%;
    aspect-ratio: 1 / 1;
    border-radius: var(--radius-round);
    border: 1px solid var(--muted);
    background: radial-gradient(var(--muted) 0 5.4%, transparent calc(5.4% + 1px));
}
.cover-placeholder::after {
    content: 'SPLIT404';
    position: absolute;
    bottom: 9px;
    left: 0;
    right: 0;
    text-align: center;
    font-family: var(--font-mono);
    font-size: 8.5px;
    letter-spacing: 0.24em;
    color: var(--muted);
}

.play-btn {
    position: absolute;
    left: 10px;
    bottom: 10px;
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: var(--radius-round);
    background: rgba(250, 247, 239, .94);
    color: var(--ink);
    font-size: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background var(--t-fast), color var(--t-fast), transform var(--t-fast);
}
.play-btn:hover { background: var(--ink); color: var(--surface); }
.play-btn:active { transform: scale(.94); }

.card-body { padding: 13px 14px 14px; display: flex; flex-direction: column; gap: 7px; flex: 1; }
.card-title { font-weight: 600; font-size: 15.5px; letter-spacing: -0.01em; }
.card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 0;
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--muted);
    text-transform: uppercase;
}
.card-meta span + span::before { content: ' · '; white-space: pre; }

.card-buy {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: var(--sp-2);
    margin-top: auto;
}
.price { font-weight: 700; font-size: 14px; color: var(--accent); }
.price.big { font-size: var(--fs-lg); color: var(--ink); }
.card-buy-note { font-family: var(--font-mono); font-size: 10px; color: var(--muted); }

/* ---------- Empty state ---------- */

/* The `hidden` attribute must always win: a component rule like
   `.empty-state { display: flex }` otherwise overrides the UA
   `[hidden] { display: none }`, leaving JS-toggled blocks stuck visible
   (this is why the empty cart message showed above real cart items). */
[hidden] { display: none !important; }

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: var(--sp-3);
    padding: 56px var(--sp-5);
}
.vinyl-ghost {
    width: 88px;
    height: 88px;
    border-radius: var(--radius-round);
    border: 1px solid var(--muted);
    background: radial-gradient(var(--muted) 0 4.5px, transparent 5.5px);
}
.empty-state h2 { font-weight: 600; font-size: var(--fs-md); margin: var(--sp-2) 0 0; }
.empty-state p { color: var(--muted); font-size: var(--fs-sm); margin: 0; max-width: 40ch; }
.empty-state .btn { margin-top: var(--sp-2); }

/* ---------- Product page ---------- */

.breadcrumb {
    display: inline-block;
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: var(--track-wide);
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: var(--sp-5);
}
.breadcrumb:hover { color: var(--ink); }

.product-page {
    display: grid;
    grid-template-columns: minmax(280px, 440px) minmax(0, 1fr);
    gap: var(--sp-7);
    align-items: start;
}
@media (max-width: 760px) { .product-page { grid-template-columns: minmax(0, 1fr); gap: var(--sp-5); } }

.product-cover { display: flex; flex-direction: column; gap: 10px; }
.product-cover .cover-frame { position: relative; border: var(--border); border-radius: var(--radius); overflow: hidden; }
.product-cover img { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; display: block; background: var(--art-ph); }
.product-cover .play-btn { width: 56px; height: 56px; left: 14px; bottom: 14px; font-size: 16px; }
.preview-note {
    font-family: var(--font-mono);
    font-size: 10px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--muted);
}

.product-info { max-width: 620px; min-width: 0; }
.product-info h1 { font-size: 34px; margin-bottom: var(--sp-2); }
@media (max-width: 760px) { .product-info h1 { font-size: 24px; } }

.product-meta {
    font-family: var(--font-mono);
    font-size: var(--fs-xs);
    color: var(--muted);
    text-transform: uppercase;
    margin-bottom: var(--sp-4);
}
.product-meta span + span::before { content: ' · '; }
.badge {
    font-family: var(--font-mono);
    font-size: 9px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    background: var(--bg);
    border: var(--border);
    padding: 4px 8px;
    border-radius: var(--radius);
    margin-right: var(--sp-2);
}

.description { color: var(--ink); font-size: var(--fs-base); line-height: 1.6; max-width: 58ch; white-space: pre-line; }

.tags { display: flex; flex-wrap: wrap; gap: var(--sp-2); margin: var(--sp-4) 0; }
.tag {
    font-family: var(--font-mono);
    font-size: var(--fs-2xs);
    text-transform: lowercase;
    color: var(--muted);
    border: var(--border);
    border-radius: var(--radius);
    padding: 6px 10px;
    transition: border-color var(--t-fast), color var(--t-fast);
}
.tag:hover { border-color: var(--ink); color: var(--ink); }

h2.pick-license {
    font-weight: 600;
    font-size: var(--fs-md);
    margin: var(--sp-5) 0 var(--sp-3);
}

.license-list { display: flex; flex-direction: column; gap: var(--sp-2); margin-bottom: var(--sp-4); }
.license-option {
    display: flex;
    align-items: center;
    gap: var(--sp-3);
    border: var(--border);
    border-radius: var(--radius);
    padding: 14px 16px;
    cursor: pointer;
    background: transparent;
    transition: border-color var(--t-fast), background var(--t-fast);
}
.license-option:hover { border-color: var(--ink); }
.license-option:has(input:checked) { border-color: var(--ink); background: var(--surface); }

.license-option input {
    appearance: none;
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    border-radius: var(--radius-round);
    border: 1.5px solid var(--muted);
    margin: 0;
    cursor: pointer;
    transition: border-color var(--t-fast);
}
.license-option input:checked {
    border-color: var(--ink);
    background: radial-gradient(var(--accent) 0 4px, transparent 4.5px);
}

.license-text { display: flex; flex-direction: column; gap: 3px; flex: 1; }
.license-name { font-weight: 600; font-size: 14px; }
.license-files {
    font-family: var(--font-mono);
    font-size: var(--fs-2xs);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--muted);
}
.license-price { font-weight: 700; font-size: var(--fs-base); color: var(--ink); }

.buy-box { display: flex; flex-direction: column; gap: 10px; }
.buy-box .btn.primary { width: 100%; padding: 15px 16px; font-size: 14px; }
.trust-line {
    font-family: var(--font-mono);
    font-size: 10px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--muted);
    text-align: center;
}
@media (max-width: 760px) {
    .buy-box {
        position: sticky;
        bottom: 64px;
        background: var(--bg);
        border-top: var(--border);
        padding: var(--sp-3) 0;
        z-index: var(--z-sticky-cta);
    }
}

/* free download (email gate) */
.free-dl {
    background: var(--surface);
    border: var(--border);
    border-radius: var(--radius);
    padding: var(--sp-4);
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: var(--sp-4) 0;
}
.free-dl-label { font-weight: 600; font-size: 14px; color: var(--ink); }
.free-dl-form { display: flex; gap: var(--sp-2); position: relative; }
.free-dl-form input[type="email"] {
    flex: 1;
    min-width: 0;
    font: 400 var(--fs-sm)/1.2 var(--font-body);
    color: var(--ink);
    background: var(--bg);
    border: var(--border);
    border-radius: var(--radius);
    padding: 12px 14px;
    transition: border-color var(--t-fast);
}
.free-dl-form input[type="email"]:focus-visible { outline: none; border-color: var(--ink); }
.free-dl-hint {
    font-family: var(--font-mono);
    font-size: 9.5px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
}
.free-dl-done { color: var(--ok); font-size: var(--fs-sm); }
.free-dl-error { margin: 0; }

/* single-price module */
.single-price-box {
    background: var(--surface);
    border: var(--border);
    border-radius: var(--radius);
    padding: var(--sp-4);
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: var(--sp-4) 0;
}
.single-price-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: var(--sp-3);
}
.single-price-head .label { font-weight: 600; font-size: 14px; }
.single-price-lines {
    font-family: var(--font-mono);
    font-size: var(--fs-2xs);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--muted);
    line-height: 1.7;
}

/* ---------- Cart ---------- */

.cart-page { max-width: 640px; margin: 0 auto; padding-top: var(--sp-5); }

.cart-items { display: flex; flex-direction: column; margin-bottom: var(--sp-4); }
.cart-row {
    display: flex;
    align-items: center;
    gap: 14px;
    border-top: var(--border);
    padding: var(--sp-4) 0;
}
.cart-row:last-child { border-bottom: var(--border); }
.cart-cover {
    width: 56px;
    height: 56px;
    border: var(--border);
    border-radius: var(--radius);
    object-fit: cover;
    background: var(--art-ph);
    flex-shrink: 0;
}
.cart-row .cover-placeholder.cart-cover::before { width: 60%; }
.cart-row .cover-placeholder.cart-cover::after { content: none; }
.cart-row-info { flex: 1; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.cart-row-info a { font-weight: 600; font-size: var(--fs-base); }
.cart-license {
    font-family: var(--font-mono);
    font-size: var(--fs-2xs);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--muted);
}
.cart-price { font-weight: 600; font-size: 14px; color: var(--ink); }
.remove-item {
    background: none;
    border: 0;
    color: var(--muted);
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    padding: var(--sp-2);
    transition: color var(--t-fast);
}
.remove-item:hover { color: var(--ink); }

.cart-total {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: var(--sp-5);
    padding-top: var(--sp-2);
}
.cart-total-label {
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: var(--track-wide);
    text-transform: uppercase;
    color: var(--muted);
}
.cart-total strong { font-weight: 700; font-size: 24px; }

.checkout-box { display: flex; flex-direction: column; gap: var(--sp-3); }
.checkout-box h2 { font-weight: 600; font-size: var(--fs-md); margin: 0; }
.pay-buttons { display: flex; flex-direction: column; gap: 10px; }
.pay-buttons .btn { padding: 15px 16px; font-size: 14px; }

/* ---------- Thank-you / downloads ---------- */

.order-page { max-width: 640px; margin: 0 auto; padding-top: var(--sp-6); display: flex; flex-direction: column; gap: var(--sp-5); }

.success-mark, .ok-circle {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-round);
    border: 1.5px solid var(--ok);
    color: var(--ok);
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.order-page h1 { font-size: 30px; margin: 0; }
.order-lede { color: var(--muted); font-size: var(--fs-base); margin: 0; }

.chip-row { display: flex; flex-wrap: wrap; gap: var(--sp-2); }
.chip {
    font-family: var(--font-mono);
    font-size: var(--fs-2xs);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    border: var(--border);
    border-radius: var(--radius);
    padding: 6px 10px;
    color: var(--muted);
}
.chip.chip-ink { color: var(--ink); }

.order-items { display: flex; flex-direction: column; }
.order-item {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
    border-top: var(--border);
    padding: var(--sp-4) 0;
}
.order-item:last-child { border-bottom: var(--border); }
.order-item-info { flex: 1; min-width: 180px; display: flex; flex-direction: column; gap: 3px; }
.order-item-info h3 { font-weight: 600; font-size: var(--fs-base); margin: 0; }
.download-buttons { display: flex; flex-wrap: wrap; gap: var(--sp-2); }
.download-buttons .btn { font-weight: 600; font-size: 12.5px; padding: 9px 14px; }

/* opt-in card */
.optin-card {
    background: var(--surface);
    border: var(--border);
    border-radius: var(--radius);
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--sp-4);
    flex-wrap: wrap;
}
.optin-text { display: flex; flex-direction: column; gap: 3px; flex: 1; min-width: 220px; }
.optin-text h2 { font-weight: 600; font-size: 14.5px; margin: 0; }
.optin-text p { color: var(--muted); font-size: 12.5px; margin: 0; }

/* pending state */
.pending-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: var(--sp-3);
    padding: var(--sp-7) var(--sp-5);
}
.spinner {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-round);
    border: 1.5px solid var(--line);
    border-top-color: var(--accent);
    animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.pending-state h1 { font-weight: 600; font-size: 18px; margin: 0; }
.pending-state p { color: var(--muted); font-size: var(--fs-sm); margin: 0; max-width: 44ch; }

/* ---------- Player bar ---------- */

.player-bar {
    position: fixed;
    inset: auto 0 0 0;
    z-index: var(--z-player);
    display: flex;
    align-items: center;
    gap: var(--sp-4);
    background: var(--surface);
    border-top: var(--border);
    padding: 10px var(--sp-6);
    transform: translateY(100%);
    transition: transform var(--t-med);
}
.player-bar.is-open { transform: none; }

.player-toggle {
    width: 34px;
    height: 34px;
    flex-shrink: 0;
    border: 0;
    border-radius: var(--radius-round);
    background: var(--ink);
    color: var(--surface);
    font-size: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background var(--t-fast), transform var(--t-fast);
}
.player-toggle:hover { background: var(--accent); }
.player-toggle:active { transform: scale(.94); }

.player-info { flex: 1; display: flex; align-items: center; gap: var(--sp-4); min-width: 0; }
#player-title {
    font-weight: 500;
    font-size: var(--fs-xs);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 40%;
}

#player-seek {
    appearance: none;
    -webkit-appearance: none;
    flex: 1;
    height: 2px;
    margin: 0;
    background: linear-gradient(to right, var(--accent) var(--seek, 0%), var(--line) var(--seek, 0%));
    border-radius: 0;
    cursor: pointer;
}
#player-seek::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 10px;
    height: 10px;
    border-radius: var(--radius-round);
    background: var(--ink);
    border: 0;
}
#player-seek::-moz-range-thumb {
    width: 10px;
    height: 10px;
    border-radius: var(--radius-round);
    background: var(--ink);
    border: 0;
}
#player-seek::-moz-range-track { height: 2px; background: transparent; }

.player-time {
    font-family: var(--font-mono);
    font-size: 10px;
    color: var(--muted);
    flex-shrink: 0;
    min-width: 66px;
    text-align: right;
}

/* ---------- Mobile (360 base) ---------- */

@media (max-width: 639px) {
    .topbar { padding: 14px var(--sp-4); }
    .brand { font-size: 17px; }
    .container { padding: var(--sp-4) var(--sp-4) var(--sp-5); }
    .footer { padding: var(--sp-6) var(--sp-4) var(--sp-7); flex-direction: column; }
    .newsletter { width: 100%; }

    .card-body { padding: 10px 11px 11px; gap: 5px; }
    .card-title { font-size: 13.5px; }
    .card-meta { font-size: 9.5px; }
    .card-meta .meta-genre { display: none; }
    .price { font-size: 12.5px; }
    .play-btn { left: 8px; bottom: 8px; }

    .filters {
        display: grid;
        grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
    }
    .filters > * { min-width: 0; }
    .filters input[type="search"] { grid-column: 1 / -1; width: 100%; }
    .segmented span { padding: 12px 4px; font-size: 12px; }
    .filters select { width: 100%; }
    .filters .sort-field { margin-left: 0; }
    .segmented label { flex: 1; }
    .segmented span { text-align: center; padding: 12px 8px; }
    .bpm-range { grid-column: 1 / -1; order: 7; }
    .bpm-range input { flex: 1; width: auto; }

    .player-bar { padding: 10px var(--sp-4); }
    #player-title { font-size: 11.5px; }
    .player-time { display: none; }
}

/* ---------- Deals, discount codes & limited quantities ---------- */

.stock-badge { color: var(--accent); border-color: currentColor; }
.stock-badge.sold { background: var(--ink); color: var(--on-ink); border-color: var(--ink); }

.stock-note { color: var(--accent); }
.soldout-label {
    font-family: var(--font-mono);
    font-size: var(--fs-2xs);
    letter-spacing: var(--track-wide);
    text-transform: uppercase;
    color: var(--muted);
}

.soldout-box {
    border: var(--border);
    border-left: 2px solid var(--accent);
    border-radius: var(--radius);
    background: var(--surface);
    padding: var(--sp-5);
    display: flex;
    flex-direction: column;
    gap: var(--sp-2);
    align-items: flex-start;
}
.soldout-box .soldout-title {
    font-family: var(--font-mono);
    font-size: var(--fs-xs);
    letter-spacing: var(--track-wide);
    text-transform: uppercase;
    color: var(--accent);
}
.soldout-box p { margin: 0; color: var(--muted); font-size: var(--fs-sm); }

.deal-hint {
    font-family: var(--font-mono);
    font-size: var(--fs-2xs);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--accent);
    border: 1px dashed var(--accent);
    border-radius: var(--radius);
    padding: 9px 12px;
    margin-bottom: var(--sp-4);
}

.code-form {
    display: flex;
    gap: var(--sp-2);
    margin-bottom: var(--sp-4);
    max-width: 340px;
}
.code-form input {
    flex: 1;
    min-width: 0;
    font-family: var(--font-mono);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}
.code-error {
    color: var(--accent);
    font-size: var(--fs-sm);
    margin: calc(-1 * var(--sp-3)) 0 var(--sp-4);
}

.cart-summary {
    display: flex;
    flex-direction: column;
    gap: var(--sp-2);
    margin-bottom: var(--sp-5);
    border-top: var(--border);
    padding-top: var(--sp-3);
}
.summary-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    font-size: var(--fs-sm);
}
.summary-row.cart-total { margin-bottom: 0; padding-top: var(--sp-1); }
.summary-saving { color: var(--ok); }
.summary-saving .cart-total-label { color: var(--ok); }
.code-chip {
    font-family: var(--font-mono);
    color: var(--ink);
    border: var(--border);
    border-radius: var(--radius);
    padding: 1px 6px;
}
.remove-code {
    border: 0;
    background: none;
    color: var(--muted);
    cursor: pointer;
    font-size: 14px;
    padding: 0 2px;
}
.remove-code:hover { color: var(--accent); }
