/* ==========================================================================
   BagToRiches Storefront Design System
   Source of truth: bag-design-system.md
   Warm, editorial, sparse — "a beautiful magazine spread about one bag at
   a time, not a marketplace."

   Never: pure white, cold grays, gradients, heavy shadows, % off framing.
   ========================================================================== */

/* ── Fonts ─────────────────────────────────────────────────────────────── */
@font-face {
    font-family: 'Fraunces';
    font-style: normal;
    font-weight: 400 600;
    font-display: swap;
    src: url('/static/fonts/fraunces-var-latin.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+2013-2014, U+2019, U+201C-201D;
}
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 400 600;
    font-display: swap;
    src: url('/static/fonts/inter-var-latin.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+2013-2014, U+2019, U+201C-201D;
}

/* ── Color tokens ──────────────────────────────────────────────────────── */
:root {
    --color-ivory:    #FAF6F1;
    --color-cream:    #F5EDE4;
    --color-taupe:    #D4C4B0;
    --color-espresso: #2C1E12;
    --color-cocoa:    #5C4033;
    --color-burgundy: #6B2D3E;
    --color-gold:     #B8860B;
    --color-sage:     #7A8B6F;
    --color-blush:    #E8D5CC;
    --color-error:    #8B3A3A;
    --color-success:  #4A6B4A;
    --color-info:     #3E5C6B;

    --border-thin:   1px solid var(--color-taupe);
    --border-medium: 1.5px solid var(--color-taupe);
    --border-strong: 2px solid var(--color-espresso);
    --divider:       1px solid var(--color-taupe);

    --radius-sm:   4px;
    --radius-md:   8px;
    --radius-lg:   12px;
    --radius-full: 9999px;

    --shadow-max: 0 1px 3px rgba(44, 30, 18, 0.06);

    --space-1:  4px;
    --space-2:  8px;
    --space-3:  12px;
    --space-4:  16px;
    --space-5:  24px;
    --space-6:  32px;
    --space-7:  48px;
    --space-8:  64px;
    --space-9:  96px;
    --space-10: 128px;
}

/* ── Base ──────────────────────────────────────────────────────────────── */
body.btr-store {
    background: var(--color-ivory);
    color: var(--color-espresso);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 16px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

.btr-container { max-width: 1200px; margin: 0 auto; padding: 0 var(--space-6); }

h1, h2, h3, .btr-serif {
    font-family: 'Fraunces', Georgia, 'Times New Roman', serif;
    font-weight: 500;
    color: var(--color-espresso);
}
h1 { font-size: 48px; line-height: 1.1; }            /* display */
h2 { font-size: 32px; line-height: 1.2; }
h3 { font-size: 22px; line-height: 1.3; font-weight: 400; }
@media (max-width: 640px) {
    h1 { font-size: 32px; line-height: 1.15; }
    h2 { font-size: 26px; }
}

.btr-caption {
    font-size: 13px;
    line-height: 1.5;
    color: var(--color-cocoa);
}

/* All-caps only for badges/nav/small tags (≤12px) */
.btr-tag {
    font-size: 11px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-cocoa);
}

/* ── Buttons ───────────────────────────────────────────────────────────── */
.btr-btn {
    display: inline-block;
    padding: 14px 28px;
    border-radius: var(--radius-md);
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 0.02em;
    line-height: 1.0;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
    border: none;
}
.btr-btn-primary { background: var(--color-burgundy); color: var(--color-ivory); }
.btr-btn-primary:hover { background: #5A2535; }
.btr-btn-primary:active { background: #4A1E2B; }

.btr-btn-secondary {
    background: transparent;
    color: var(--color-espresso);
    border: 1.5px solid var(--color-espresso);
    padding: 13px 28px;
}
.btr-btn-secondary:hover { background: var(--color-cream); }

.btr-btn-ghost {
    background: none;
    color: var(--color-burgundy);
    padding: 0;
    border-radius: 0;
}
.btr-btn-ghost:hover { text-decoration: underline; text-underline-offset: 2px; }

.btr-btn:disabled, .btr-btn-disabled {
    background: var(--color-taupe);
    color: var(--color-cream);
    cursor: not-allowed;
}

/* ── Badges & tags ─────────────────────────────────────────────────────── */
.btr-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    font-size: 11px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.btr-badge-condition {
    background: var(--color-cream);
    color: var(--color-cocoa);
    border: 1px solid var(--color-taupe);
}
.btr-badge-new {
    background: var(--color-burgundy);
    color: var(--color-ivory);
    border-radius: var(--radius-full);
    font-weight: 600;
}
.btr-badge-sold {
    background: var(--color-taupe);
    color: var(--color-espresso);
    text-decoration: line-through;
}

/* ── Nav (sticky, ivory) ───────────────────────────────────────────────── */
.btr-nav {
    background: var(--color-ivory);
    border-bottom: var(--border-thin);
    padding: var(--space-4) 0;
    position: sticky;
    top: 0;
    z-index: 100;
}
.btr-nav-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--space-6);
    display: flex;
    align-items: center;
    gap: var(--space-6);
}
.btr-nav-brand {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    text-decoration: none;
}
.btr-nav-brand img { width: 36px; height: 36px; }
.btr-nav-brand span {
    font-family: 'Fraunces', Georgia, serif;
    font-size: 20px;
    font-weight: 500;
    color: var(--color-espresso);
}
.btr-nav-links {
    display: flex;
    align-items: center;
    gap: var(--space-5);
    margin: 0 auto;
}
.btr-nav-links a {
    font-size: 14px;
    font-weight: 500;
    color: var(--color-espresso);
    text-decoration: none;
    transition: color 0.2s ease;
}
.btr-nav-links a:hover { color: var(--color-burgundy); text-decoration: underline; text-underline-offset: 3px; }
.btr-nav-bag { margin-left: auto; display: flex; align-items: center; gap: var(--space-2); }
.btr-nav-bag a {
    font-size: 14px;
    font-weight: 500;
    color: var(--color-espresso);
    text-decoration: none;
}
.btr-nav-bag a:hover { color: var(--color-burgundy); }
/* Category strip under the main nav — real top-level catalog categories */
.btr-nav-cats {
    background: var(--color-cream);
    border-top: 1px solid var(--color-taupe);
}
.btr-nav-cats-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: var(--space-2) var(--space-6);
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-5);
}
.btr-nav-cats a {
    font-size: 13px;
    font-weight: 500;
    color: var(--color-cocoa);
    text-decoration: none;
}
.btr-nav-cats a:hover { color: var(--color-burgundy); text-decoration: underline; text-underline-offset: 3px; }
@media (max-width: 640px) {
    .btr-nav-cats-inner { gap: var(--space-4); overflow-x: auto; flex-wrap: nowrap; }
}
@media (max-width: 640px) {
    .btr-nav-links { display: none; }
    .btr-nav-inner { justify-content: space-between; }
}

/* ── Hero (70vh, editorial) ────────────────────────────────────────────── */
.btr-hero {
    min-height: 70vh;
    display: flex;
    align-items: center;
    background:
        linear-gradient(0deg, rgba(44, 30, 18, 0.08), rgba(44, 30, 18, 0.08)),
        var(--color-blush);
    border-bottom: var(--divider);
}
.btr-hero-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: var(--space-9) var(--space-6);
    width: 100%;
}
.btr-hero-tag {
    display: inline-block;
    margin-bottom: var(--space-4);
    background: var(--color-cream);
    border: 1px solid var(--color-taupe);
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    font-size: 11px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-cocoa);
}
.btr-hero h1 { max-width: 620px; margin-bottom: var(--space-5); }
.btr-hero p {
    max-width: 480px;
    color: var(--color-cocoa);
    margin-bottom: var(--space-6);
}
/* Above-the-fold email capture (pre-launch conversion point) */
.btr-hero-capture { max-width: 440px; margin-bottom: var(--space-5); }
.btr-hero-capture form { display: flex; gap: var(--space-2); }
.btr-hero-capture .btr-input { flex: 1; min-width: 0; background: var(--color-ivory); }
.btr-hero-capture .btr-btn { flex-shrink: 0; padding: 13px 22px; }
.btr-hero-capture .btr-form-status { color: var(--color-burgundy); margin: var(--space-3) 0 0; min-height: 1.4em; }
@media (max-width: 480px) {
    .btr-hero-capture form { flex-direction: column; }
    .btr-hero-capture .btr-btn { width: 100%; }
}
/* Warm placeholder composition until real photography is available */
.btr-hero-media {
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 45%;
    background: linear-gradient(160deg, var(--color-cream) 0%, var(--color-blush) 100%);
    border-left: var(--divider);
    display: flex;
    align-items: center;
    justify-content: center;
}
.btr-hero-media img { width: 55%; max-width: 340px; opacity: 0.9; }
.btr-hero-media svg { width: 55%; max-width: 340px; opacity: 0.9; }
/* Above-the-fold email capture (pre-launch conversion point) */
.btr-hero-capture { max-width: 440px; margin-bottom: var(--space-5); }
.btr-hero-capture form { display: flex; gap: var(--space-3); }
.btr-hero-capture .btr-input { flex: 1; min-width: 0; }
.btr-hero-capture .btr-btn { flex-shrink: 0; padding: 13px 22px; }
.btr-hero-capture .btr-form-status { color: var(--color-burgundy); margin: var(--space-3) 0 0; min-height: 1.4em; }
@media (max-width: 480px) {
    .btr-hero-capture form { flex-direction: column; }
    .btr-hero-capture .btr-btn { width: 100%; }
}
.btr-hero-actions { display: flex; align-items: center; gap: var(--space-4); flex-wrap: wrap; }
@media (max-width: 900px) {
    .btr-hero-media { display: none; }
    .btr-hero { min-height: 56vh; }
}

/* ── Sections ──────────────────────────────────────────────────────────── */
.btr-section { padding: var(--space-8) 0; }
.btr-section + .btr-section { border-top: var(--divider); }
.btr-section-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-bottom: var(--space-6);
}
.btr-section-head .btr-btn-ghost { font-size: 14px; }

/* ── Product grid (3 col desktop / 2 tablet / 1 mobile) ────────────────── */
.btr-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-6);
}
@media (max-width: 900px) { .btr-grid { grid-template-columns: repeat(2, 1fr); gap: var(--space-4); } }
@media (max-width: 560px) { .btr-grid { grid-template-columns: 1fr; } }
.btr-grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 900px) { .btr-grid-4 { grid-template-columns: repeat(2, 1fr); } }

/* ── Product card ──────────────────────────────────────────────────────── */
.btr-card {
    background: var(--color-ivory);
    border: var(--border-thin);
    border-radius: var(--radius-md);
    overflow: hidden;
    text-decoration: none;
    display: block;
    color: inherit;
    transition: border-color 0.2s ease;
}
.btr-card:hover { border-color: var(--color-espresso); }
.btr-card-media {
    aspect-ratio: 4 / 5;
    background: var(--color-cream);
    overflow: hidden;
}
.btr-card-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}
.btr-card:hover .btr-card-media img { transform: scale(1.02); }
/* Electronics-style goods: 1:1 box, contained (not cropped) media */
.btr-card-media-contain { aspect-ratio: 1 / 1; }
.btr-card-media-contain img { object-fit: contain; padding: var(--space-4); }
.btr-card-body { padding: var(--space-5); display: flex; flex-direction: column; gap: var(--space-2); }
.btr-card-body h3 { font-size: 22px; }
.btr-price {
    font-family: 'Inter', sans-serif;
    font-size: 18px;
    font-weight: 600;
    line-height: 1.2;
    color: var(--color-espresso);
}
.btr-retail { font-size: 13px; color: var(--color-cocoa); }
.btr-card-sold { opacity: 0.85; }
.btr-card-sold:hover { border-color: var(--color-taupe); }
.btr-card-sold:hover .btr-card-media img { transform: none; }

/* ── Categories (brand tiles) ──────────────────────────────────────────── */
.btr-brand-tile {
    background: var(--color-cream);
    border: var(--border-thin);
    border-radius: var(--radius-md);
    aspect-ratio: 1 / 1;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: border-color 0.2s ease, background 0.2s ease;
}
.btr-brand-tile:hover { border-color: var(--color-espresso); background: var(--color-blush); }
.btr-brand-tile span {
    font-family: 'Fraunces', Georgia, serif;
    font-size: 22px;
    font-weight: 500;
    color: var(--color-espresso);
}

/* ── Next drop strip ───────────────────────────────────────────────────── */
.btr-nextdrop {
    text-align: center;
    max-width: 560px;
    margin: 0 auto;
}
.btr-nextdrop h2 { margin-bottom: var(--space-2); }
.btr-nextdrop p { color: var(--color-cocoa); margin-bottom: var(--space-5); }
.btr-nextdrop .btr-caption {
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-size: 12px;
    color: var(--color-cocoa);
    margin-bottom: var(--space-2);
}

/* ── Horizontal scroll strip (recently sold) ───────────────────────────── */
.btr-strip {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: 240px;
    gap: var(--space-4);
    overflow-x: auto;
    padding-bottom: var(--space-2);
    scrollbar-width: thin;
    scrollbar-color: var(--color-taupe) transparent;
}

/* ── Trust (3 gold-icon columns) ───────────────────────────────────────── */
.btr-trust { max-width: 780px; margin: 0 auto; text-align: center; }
.btr-trust h2 { margin-bottom: var(--space-6); }
.btr-trust-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-6);
}
@media (max-width: 640px) { .btr-trust-grid { grid-template-columns: 1fr; gap: var(--space-5); } }
.btr-trust-item svg { width: 28px; height: 28px; stroke: var(--color-gold); margin-bottom: var(--space-3); }
.btr-trust-item h3 { font-size: 18px; margin-bottom: var(--space-1); }
.btr-trust-item p { font-size: 14px; color: var(--color-cocoa); }

/* ── About / story (2-col) ─────────────────────────────────────────────── */
.btr-about {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-8);
    align-items: center;
}
@media (max-width: 900px) { .btr-about { grid-template-columns: 1fr; } }
.btr-about-media {
    aspect-ratio: 4 / 5;
    background: var(--color-cream);
    border: var(--border-thin);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
}
.btr-about-media svg { width: 45%; opacity: 0.85; }
.btr-about-text h2 { margin-bottom: var(--space-4); }
.btr-about-text p { color: var(--color-cocoa); margin-bottom: var(--space-5); max-width: 460px; }

/* ── Forms ─────────────────────────────────────────────────────────────── */
.btr-input {
    background: var(--color-ivory);
    border: var(--border-thin);
    border-radius: var(--radius-md);
    padding: 13px 16px;
    font-family: 'Inter', sans-serif;
    font-size: 16px;
    color: var(--color-espresso);
    outline: none;
    transition: border-color 0.2s ease;
}
.btr-input:focus { border: var(--border-medium); border-color: var(--color-burgundy); }
.btr-input::placeholder { color: var(--color-cocoa); opacity: 0.7; }

/* ── Footer (espresso, ivory text) ─────────────────────────────────────── */
.btr-footer {
    background: var(--color-espresso);
    color: var(--color-ivory);
    margin-top: var(--space-8);
}
.btr-footer-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: var(--space-9) var(--space-6) var(--space-7);
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1.5fr;
    gap: var(--space-7);
}
@media (max-width: 900px) { .btr-footer-inner { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .btr-footer-inner { grid-template-columns: 1fr; } }
.btr-footer-brand {
    font-family: 'Fraunces', Georgia, serif;
    font-size: 22px;
    font-weight: 500;
    color: var(--color-ivory);
    margin-bottom: var(--space-3);
}
.btr-footer-col h4 {
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-taupe);
    margin-bottom: var(--space-3);
}
.btr-footer-col ul { list-style: none; padding: 0; }
.btr-footer-col li { margin-bottom: var(--space-2); }
.btr-footer-col a {
    color: var(--color-ivory);
    text-decoration: none;
    font-size: 14px;
}
.btr-footer-col a:hover { color: var(--color-blush); text-decoration: underline; text-underline-offset: 2px; }
.btr-footer-news { display: flex; gap: var(--space-2); }
.btr-footer-news .btr-input {
    flex: 1;
    background: rgba(250, 246, 241, 0.08);
    border-color: rgba(212, 196, 176, 0.4);
    color: var(--color-ivory);
    min-width: 0;
}
.btr-footer-news .btr-input::placeholder { color: var(--color-taupe); }
.btr-footer-news .btr-btn { padding: 13px 20px; }
.btr-form-status {
    margin: var(--space-3) 0 0;
    font-size: 14px;
    color: var(--color-blush);
    min-height: 1.4em;
}
.btr-footer-bottom {
    border-top: 1px solid rgba(212, 196, 176, 0.25);
}
.btr-footer-bottom-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: var(--space-4) var(--space-6);
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: var(--space-2);
    font-size: 13px;
    color: var(--color-taupe);
}

/* ── Micro-interactions: section fade-in (200ms) ───────────────────────── */
.btr-fade { opacity: 0; transform: translateY(8px); transition: opacity 0.2s ease, transform 0.2s ease; }
.btr-fade.btr-fade-in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
    .btr-fade { opacity: 1; transform: none; transition: none; }
    .btr-card-media img, .btr-card { transition: none; }
}

/* ── Empty state ───────────────────────────────────────────────────────── */
.btr-empty {
    border: var(--border-thin);
    border-radius: var(--radius-md);
    background: var(--color-cream);
    padding: var(--space-8) var(--space-5);
    text-align: center;
    color: var(--color-cocoa);
}

/* ── Legacy component warm-over ──────────────────────────────────────────
   Server-rendered fragments (drops, bin store) reuse responsive.css classes
   (.btn-primary, .drop-card, .queue-box). Scope warm overrides to the
   storefront body class so admin pages keep their utility look. */
body.btr-store .btn-primary {
    background: var(--color-burgundy);
    color: var(--color-ivory);
}
body.btr-store .btn-primary:hover { background: #5A2535; }
body.btr-store .btn-secondary {
    background: transparent;
    color: var(--color-espresso);
    border: 1.5px solid var(--color-espresso);
}
body.btr-store .drop-card,
body.btr-store .queue-box {
    background: var(--color-ivory);
    border: var(--border-thin);
    border-radius: var(--radius-md);
    box-shadow: none;
    transition: border-color 0.2s ease;
}
body.btr-store .drop-card:hover {
    border-color: var(--color-espresso);
    box-shadow: none;
    transform: none;
}
body.btr-store .drop-title { color: var(--color-espresso); font-family: 'Fraunces', Georgia, serif; }
body.btr-store .drop-price { color: var(--color-espresso); }
body.btr-store .drop-meta,
body.btr-store .hint,
body.btr-store .countdown { color: var(--color-cocoa); }
body.btr-store .countdown h2 { color: var(--color-espresso); }
body.btr-store .loading { color: var(--color-cocoa); }
