/* shop.css — 404 Places Reward Shop
   CSS tokens match index.html canonical standard (DESIGN_IMPLEMENTATION.md).
   Primary reference: jamfor1 (auth screen) — NOT jamfor2 (purple/gradient).     */

:root {
    --bg:        #F8FAFC;
    --text:      #0F172A;
    --text-2:    #475569;
    --muted:     #94A3B8;
    --line:      #E2E8F0;
    --signal:    #2563EB;
    --r-special: #CA8A04;
    --success:   #16A34A;
    --danger:    #DC2626;
    --header-bg: #0a0f1e;
    --radius:    11px;
    --shadow:    0 2px 8px rgba(0,0,0,.07);
    --shadow-h:  0 8px 24px rgba(0,0,0,.12);
    --rg:    linear-gradient(90deg,#ff3b3b,#ff8c00,#ffd700,#00c853,#00b4d8,#7c4dff);
    --rg135: linear-gradient(135deg,#ff3b3b,#ff8c00,#ffd700,#00c853,#00b4d8,#7c4dff);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body { background: var(--bg); color: var(--text); line-height: 1.5; min-height: 100dvh; font-family: 'DM Sans', system-ui, sans-serif; }

/* ── Header ─────────────────────────────────────────── */
.site-header {
    background: var(--header-bg);
    /* 3px rainbow top bar — same pattern as admin panel + auth screen */
    border-top: 3px solid transparent;
    border-image: var(--rg) 1;
    border-bottom: 1px solid rgba(255,255,255,.05);
    padding: 0 1.5rem;
    position: sticky;
    top: 0;
    z-index: 100;
}
.header-inner {
    max-width: 1140px;
    margin: 0 auto;
    height: 58px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

/* Logo — "404" DM Mono + "Places" DM Sans rainbow gradient, mirrors auth screen */
.logo {
    display: flex;
    align-items: baseline;
    text-decoration: none;
    line-height: 1;
    gap: 0;
}
.logo-404 {
    font-family: 'DM Mono', monospace;
    font-size: 20px;
    font-weight: 500;
    color: #e2e8f0;
    letter-spacing: -.02em;
}
.logo-places {
    font-family: 'DM Sans', sans-serif;
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -.04em;
    background: var(--rg);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    margin-left: 5px;
}
.logo-shop-tag {
    font-family: 'DM Mono', monospace;
    font-size: 9px;
    letter-spacing: .18em;
    color: #475569;
    margin-left: 9px;
    align-self: center;
    text-transform: uppercase;
}

/* Player context — RP chip matches hud-chip-rp from main app */
.player-context {
    display: flex;
    align-items: center;
    gap: .65rem;
}
.player-name {
    font-family: 'DM Mono', monospace;
    font-size: 11px;
    font-weight: 500;
    letter-spacing: .03em;
    color: #e2e8f0;
}
.rp-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: #FFFBEB;
    border: 1px solid #F59E0B;
    border-radius: 6px;
    padding: 3px 8px;
    font-family: 'DM Mono', monospace;
    font-size: 11px;
    font-weight: 500;
    color: #92400E;
    white-space: nowrap;
}
.rp-diamond { color: #F59E0B; }
.btn-ghost-sm {
    font-family: 'DM Mono', monospace;
    font-size: 10px;
    letter-spacing: .04em;
    color: #64748b;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 4px;
    transition: color .15s;
}
.btn-ghost-sm:hover { color: #e2e8f0; }
.guest-note {
    font-family: 'DM Mono', monospace;
    font-size: 10px;
    letter-spacing: .04em;
    color: #475569;
}

/* ── Page intro ─────────────────────────────────────── */
.site-main {
    max-width: 1140px;
    margin: 0 auto;
    padding: 2rem 1.5rem 4rem;
}
.page-intro { margin-bottom: 2rem; }

/* Signal pill — matches auth screen .auth-sig-pill */
.sig-pill {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-family: 'DM Mono', monospace;
    font-size: 10px;
    letter-spacing: .06em;
    color: var(--text-2);
    margin-bottom: 10px;
}
.sig-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #00c853;
    box-shadow: 0 0 0 3px rgba(0,200,83,.14);
    flex-shrink: 0;
}
.page-title {
    font-family: 'DM Mono', monospace;
    font-size: 18px;
    font-weight: 700;
    letter-spacing: -.01em;
    color: var(--text);
    margin-bottom: 5px;
}
.page-sub {
    font-family: 'DM Sans', sans-serif;
    font-size: 13px;
    color: var(--muted);
    max-width: 520px;
    line-height: 1.55;
}

/* ── Product grid ───────────────────────────────────── */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.25rem;
}
.loading, .empty {
    font-family: 'DM Mono', monospace;
    font-size: 12px;
    letter-spacing: .04em;
    color: var(--muted);
    padding: 2rem 0;
}

/* ── Product card ───────────────────────────────────── */
.product-card {
    background: #fff;
    border: 1px solid rgba(0,0,0,.08);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: box-shadow .2s ease, transform .2s ease;
}
.product-card:hover {
    box-shadow: var(--shadow-h);
    transform: translateY(-2px);
}

/* Image area */
.card-img {
    width: 100%;
    aspect-ratio: 16 / 7;
    overflow: hidden;
    background: #F1F5F9;
}
.card-img img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* No-image fallback — dark tile with rainbow border */
.card-img-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: .3rem;
    background: linear-gradient(135deg, #0a0f1e 0%, #1e1b4b 100%);
    border-bottom: 2px solid transparent;
    border-image: var(--rg) 1;
}
.no-img-diamond {
    font-size: 1.6rem;
    background: var(--rg);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}
.no-img-label {
    font-family: 'DM Mono', monospace;
    font-size: .6rem;
    font-weight: 700;
    letter-spacing: .2em;
    color: #475569;
}

/* Card body */
.card-body {
    padding: 1rem 1.25rem 1.25rem;
    display: flex;
    flex-direction: column;
    gap: .5rem;
    flex: 1;
}
.card-meta {
    display: flex;
    align-items: center;
    gap: .35rem;
    font-family: 'DM Mono', monospace;
    font-size: 9.5px;
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--muted);
}
.card-meta-sep { color: var(--line); }
.card-partner { color: var(--text-2); }
.card-category { color: var(--muted); }
.card-name {
    font-family: 'DM Sans', sans-serif;
    font-size: 15px;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -.01em;
    line-height: 1.25;
}
.card-desc {
    font-family: 'DM Sans', sans-serif;
    font-size: 12px;
    color: var(--text-2);
    line-height: 1.5;
}
.card-prices {
    display: flex;
    flex-wrap: wrap;
    gap: .4rem;
    margin-top: .1rem;
}
.card-actions {
    display: flex;
    flex-direction: column;
    gap: .5rem;
    margin-top: auto;
    padding-top: .75rem;
}

/* ── Badges ─────────────────────────────────────────── */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-family: 'DM Mono', monospace;
    font-size: 10px;
    font-weight: 700;
    padding: 3px 7px;
    border-radius: 5px;
    white-space: nowrap;
    letter-spacing: .03em;
}
/* RP amber — matches hud-chip-rp / badge-special / --r-special */
.badge-rp      { background: #FFFBEB; color: #92400E; border: 1px solid #F59E0B; }
/* SEK blue — matches badge-rare / --signal */
.badge-sek     { background: #EFF6FF; color: #1D4ED8; border: 1px solid rgba(37,99,235,.25); }
/* Limited edition — special gold */
.badge-limited { background: #FFFBEB; color: #92400E; border: 1px solid #FDE68A; }
/* Low stock / sold out — danger */
.badge-low-stock { background: #FEF2F2; color: var(--danger); border: 1px solid #FECACA; }

/* ── Buttons ─────────────────────────────────────────── */

/* Primary claim — exact .auth-btn-rb style from main app */
.btn-claim {
    width: 100%;
    min-height: 48px;
    border-radius: var(--radius);
    background: linear-gradient(#fff,#fff) padding-box, var(--rg135) border-box;
    border: 2px solid transparent;
    font-family: 'DM Mono', monospace;
    font-size: 12px;
    font-weight: 500;
    letter-spacing: .06em;
    color: var(--text);
    box-shadow: 0 8px 24px -10px rgba(124,77,255,.25);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: box-shadow .2s, transform .1s;
}
.btn-claim:hover:not(:disabled) { box-shadow: 0 10px 28px -8px rgba(124,77,255,.38); }
.btn-claim:active:not(:disabled) { transform: scale(.98); }
.btn-claim:disabled {
    background: #F1F5F9;
    border-color: transparent;
    color: var(--muted);
    cursor: default;
    box-shadow: none;
}
/* CLR locked state */
.btn-locked:disabled {
    background: #F5F3FF;
    border: 1px solid #DDD6FE;
    color: #5B21B6;
    font-size: 11px;
}
/* Insufficient RP */
.btn-insufficient:disabled {
    background: #FFFBEB;
    border: 1px solid #FDE68A;
    color: #92400E;
}
/* Rainbow arrow — matches .auth-arr in main app */
.btn-arr {
    font-size: 14px;
    font-weight: 300;
    background: var(--rg);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
.btn-price {
    font-size: 10px;
    font-weight: 400;
    opacity: .7;
}

/* Secondary buy — exact .auth-btn-ghost style from main app */
.btn-buy {
    width: 100%;
    min-height: 44px;
    border-radius: 10px;
    background: linear-gradient(#FAFAFB,#FAFAFB) padding-box,
                linear-gradient(90deg,
                    rgba(255,59,59,.3),rgba(255,140,0,.3),rgba(255,215,0,.3),
                    rgba(0,200,83,.3),rgba(0,180,216,.3),rgba(124,77,255,.3)) border-box;
    border: 1.5px solid transparent;
    font-family: 'DM Mono', monospace;
    font-size: 10.5px;
    letter-spacing: .04em;
    color: var(--text-2);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: color .15s;
}
.btn-buy:hover { color: var(--text); }

/* ── Toast ──────────────────────────────────────────── */
.toast {
    position: fixed;
    bottom: 1.5rem;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: var(--text);
    color: #fff;
    font-family: 'DM Mono', monospace;
    font-size: 11px;
    letter-spacing: .03em;
    padding: .65rem 1.25rem;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,.2);
    opacity: 0;
    transition: opacity .22s, transform .22s;
    pointer-events: none;
    max-width: min(400px, calc(100vw - 3rem));
    text-align: center;
    z-index: 200;
    white-space: nowrap;
}
.toast-show    { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast-success { background: #14532d; }
.toast-error   { background: #7f1d1d; }
.toast-info    { background: var(--text); }

/* ── Responsive ─────────────────────────────────────── */
@media (max-width: 480px) {
    .site-main { padding: 1.5rem 1rem 3rem; }
    .product-grid { grid-template-columns: 1fr; }
    .page-title { font-size: 16px; }
    .card-name { font-size: 14px; }
    .logo-shop-tag { display: none; }
}
