/* D3AD — customer-facing site prototype
 * Minimalist e-commerce, light theme. No JS framework. ~3 KB minified.
 * Mobile-first responsive: 320px → 640px → 1024px breakpoints.
 */

:root {
    --bg: #FAFAF8;
    --surface: #FFFFFF;
    --surface-alt: #F4F4F1;
    --border: #E5E5E0;
    --border-strong: #D8D6D0;
    --text: #1A1A1A;
    --text-muted: #6B6B6B;
    --text-faint: #999990;
    --accent: #C91D2F;
    --accent-hover: #A8182A;
    --success: #1D7A3A;
    --warning: #B07700;
    --info: #1E5FB5;
    --radius: 6px;
    --radius-lg: 10px;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.08);
    --max-w: 1240px;
    --gap: 16px;
    --gap-lg: 32px;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    background: var(--bg);
    color: var(--text);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
    font-size: 15px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.mono, code, pre { font-family: ui-monospace, "SF Mono", Menlo, monospace; }

a {
    color: var(--accent);
    text-decoration: none;
    transition: color 0.15s;
}

a:hover { color: var(--accent-hover); }

h1, h2, h3, h4 {
    margin: 0 0 12px 0;
    font-weight: 600;
    letter-spacing: -0.01em;
}

h1 { font-size: 32px; line-height: 1.15; }
h2 { font-size: 22px; line-height: 1.25; }
h3 { font-size: 17px; line-height: 1.3; }
h4 { font-size: 14px; line-height: 1.3; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; }

p { margin: 0 0 12px 0; }

/* ── Top nav ────────────────────────────────────────────────────── */

header.topnav {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 14px 24px;
    display: flex;
    align-items: center;
    gap: 24px;
    position: sticky;
    top: 0;
    z-index: 10;
}

header.topnav .brand {
    font-weight: 700;
    font-size: 20px;
    letter-spacing: 0.08em;
    color: var(--text);
}

header.topnav .brand:hover { color: var(--accent); }

header.topnav nav {
    margin-left: auto;
    display: flex;
    gap: 20px;
    align-items: center;
}

header.topnav nav a {
    color: var(--text);
    font-weight: 500;
    font-size: 14px;
}

header.topnav nav a:hover { color: var(--accent); }

header.topnav .balance-pill {
    background: var(--surface-alt);
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 13px;
    color: var(--text-muted);
}

header.topnav .balance-pill b { color: var(--text); }

/* ── Container ──────────────────────────────────────────────────── */

main {
    max-width: var(--max-w);
    margin: 0 auto;
    padding: 32px 24px 80px;
}

main.narrow { max-width: 720px; }

main.full { max-width: none; padding: 32px; }

/* ── Hero (landing) ─────────────────────────────────────────────── */

.hero {
    text-align: center;
    padding: 80px 0 64px;
}

.hero h1 {
    font-size: 44px;
    letter-spacing: -0.02em;
    margin-bottom: 16px;
}

.hero .tagline {
    font-size: 19px;
    color: var(--text-muted);
    margin-bottom: 40px;
}

.hero .cta {
    display: inline-block;
    background: var(--text);
    color: var(--surface);
    padding: 16px 36px;
    border-radius: var(--radius);
    font-size: 16px;
    font-weight: 600;
    transition: background 0.15s, transform 0.1s;
}

.hero .cta:hover {
    background: var(--accent);
    color: var(--surface);
}

.hero .cta:active { transform: scale(0.98); }

.coins {
    margin-top: 28px;
    color: var(--text-faint);
    font-size: 13px;
    letter-spacing: 0.12em;
    font-weight: 500;
}

/* ── Card grid ──────────────────────────────────────────────────── */

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: var(--shadow-sm);
    transition: box-shadow 0.15s, transform 0.1s;
}

.card.hoverable:hover {
    box-shadow: var(--shadow);
    transform: translateY(-1px);
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: var(--gap);
}

.country-card {
    display: block;
    color: var(--text);
}

.country-card .flag {
    font-size: 32px;
    line-height: 1;
    margin-bottom: 12px;
}

.country-card h3 { margin-bottom: 6px; }

.country-card .meta {
    color: var(--text-muted);
    font-size: 13px;
    display: flex;
    justify-content: space-between;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px dashed var(--border);
}

.country-card .meta .price b {
    color: var(--text);
    font-size: 15px;
}

.country-card .stock {
    color: var(--success);
    font-weight: 600;
}

/* ── Shop layout (sidebar + content) ────────────────────────────── */

.shop-layout {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: var(--gap-lg);
    align-items: start;
}

.shop-sidebar {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
    position: sticky;
    top: 80px;
}

.shop-sidebar ul {
    list-style: none;
    padding: 0;
    margin: 0 0 20px 0;
}

.shop-sidebar li { margin: 0; }

.shop-sidebar a {
    display: block;
    padding: 9px 12px;
    color: var(--text);
    font-size: 14px;
    border-radius: var(--radius);
    transition: background 0.15s;
}

.shop-sidebar a:hover { background: var(--surface-alt); }

.shop-sidebar a.active {
    background: var(--text);
    color: var(--surface);
    font-weight: 600;
}

.shop-sidebar .divider {
    height: 1px;
    background: var(--border);
    margin: 16px 0;
}

.shop-sidebar h4 { margin-bottom: 8px; padding: 0 12px; }

/* ── Product page (filter + results) ────────────────────────────── */

.product-layout {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: var(--gap-lg);
    align-items: start;
}

.filter-panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
    position: sticky;
    top: 80px;
    max-height: calc(100vh - 100px);
    overflow-y: auto;
}

.filter-panel h4 { margin: 0 0 10px 0; padding-top: 16px; }
.filter-panel h4:first-child { padding-top: 0; }

.filter-panel label {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px 0;
    font-size: 14px;
    cursor: pointer;
    color: var(--text);
}

.filter-panel label:hover { color: var(--accent); }

.filter-panel label input { margin: 0; }

.filter-panel label .count {
    margin-left: auto;
    color: var(--text-faint);
    font-size: 12px;
    font-variant-numeric: tabular-nums;
}

.filter-panel .show-all {
    display: block;
    margin-top: 8px;
    font-size: 13px;
    color: var(--info);
}

.filter-panel .actions {
    display: flex;
    gap: 8px;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}

/* ── Product grid (card previews) ───────────────────────────────── */

.results-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 12px;
}

.results-header .count {
    color: var(--text-muted);
    font-size: 14px;
}

.results-header .count b {
    color: var(--text);
    font-size: 18px;
    font-weight: 600;
}

.preview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: var(--gap);
}

.preview-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    font-size: 13.5px;
}

.preview-card .row {
    display: flex;
    justify-content: space-between;
    padding: 3px 0;
    color: var(--text-muted);
}

.preview-card .row b {
    color: var(--text);
    font-weight: 500;
}

.preview-card .footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
}

.preview-card .price {
    font-size: 17px;
    font-weight: 600;
    color: var(--text);
}

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

.btn {
    display: inline-block;
    padding: 9px 18px;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    border: 1px solid var(--border-strong);
    background: var(--surface);
    color: var(--text);
    transition: all 0.15s;
    text-align: center;
}

.btn:hover {
    border-color: var(--text);
    color: var(--text);
}

.btn.primary {
    background: var(--text);
    color: var(--surface);
    border-color: var(--text);
}

.btn.primary:hover {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--surface);
}

.btn.accent {
    background: var(--accent);
    color: var(--surface);
    border-color: var(--accent);
}

.btn.accent:hover { background: var(--accent-hover); border-color: var(--accent-hover); }

.btn.small { padding: 6px 12px; font-size: 13px; }

.btn.full { display: block; width: 100%; }

.btn.add {
    background: var(--surface-alt);
    border-color: var(--border-strong);
    padding: 5px 12px;
    font-size: 13px;
    font-weight: 600;
}

.btn.add:hover {
    background: var(--text);
    color: var(--surface);
}

/* ── Forms ──────────────────────────────────────────────────────── */

input[type=text], input[type=email], input[type=number] {
    width: 100%;
    padding: 11px 14px;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius);
    background: var(--surface);
    font-size: 15px;
    font-family: inherit;
    color: var(--text);
}

input[type=text]:focus, input[type=email]:focus, input[type=number]:focus {
    outline: none;
    border-color: var(--text);
}

label { font-size: 14px; color: var(--text-muted); margin-bottom: 6px; display: block; }

/* ── How it works ───────────────────────────────────────────────── */

.howit {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 36px 32px;
    margin: 40px 0;
}

.howit h2 {
    margin-bottom: 24px;
    font-size: 13px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-weight: 600;
}

.howit ol { list-style: none; padding: 0; margin: 0; counter-reset: step; }

.howit li {
    counter-increment: step;
    padding: 14px 0 14px 56px;
    position: relative;
    border-bottom: 1px solid var(--border);
}

.howit li:last-child { border-bottom: none; }

.howit li::before {
    content: counter(step);
    position: absolute;
    left: 0;
    top: 12px;
    width: 36px;
    height: 36px;
    background: var(--text);
    color: var(--surface);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
}

.howit li b { color: var(--text); }

/* ── Stats strip ────────────────────────────────────────────────── */

.stats {
    text-align: center;
    padding: 40px 0;
    color: var(--text-muted);
    font-size: 15px;
}

.stats .num {
    color: var(--text);
    font-weight: 600;
    font-size: 17px;
}

/* ── Tags / badges ──────────────────────────────────────────────── */

.tag {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 999px;
    background: var(--surface-alt);
    border: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.02em;
}

.tag.success { background: rgba(29, 122, 58, 0.1); color: var(--success); border-color: rgba(29, 122, 58, 0.2); }
.tag.warning { background: rgba(176, 119, 0, 0.1); color: var(--warning); border-color: rgba(176, 119, 0, 0.2); }

/* ── Cart line ──────────────────────────────────────────────────── */

.cart-line {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
    margin-bottom: 12px;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 16px;
    align-items: center;
}

.cart-line h3 { margin: 0 0 4px 0; font-size: 16px; }

.cart-line .meta {
    color: var(--text-muted);
    font-size: 13px;
}

.cart-line .qty {
    display: flex;
    gap: 8px;
    align-items: center;
}

.cart-line .qty input {
    width: 70px;
    padding: 6px 8px;
    text-align: center;
    font-size: 14px;
}

.cart-line .price {
    font-size: 17px;
    font-weight: 600;
    text-align: right;
}

.cart-summary {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
    margin-top: 16px;
}

.cart-summary .row {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    color: var(--text-muted);
}

.cart-summary .row.total {
    border-top: 1px solid var(--border);
    margin-top: 8px;
    padding-top: 14px;
    font-size: 17px;
    font-weight: 600;
    color: var(--text);
}

.cart-summary .row b { color: var(--text); font-weight: 500; }

/* ── Coin grid ──────────────────────────────────────────────────── */

.coin-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin: 24px 0;
}

.coin-option {
    background: var(--surface);
    border: 2px solid var(--border);
    border-radius: var(--radius);
    padding: 18px 12px;
    text-align: center;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    color: var(--text);
    letter-spacing: 0.05em;
    transition: all 0.15s;
}

.coin-option:hover {
    border-color: var(--text);
    background: var(--surface-alt);
}

.coin-option.active {
    border-color: var(--accent);
    color: var(--accent);
    background: rgba(201, 29, 47, 0.04);
}

/* ── Footer ─────────────────────────────────────────────────────── */

footer.site-footer {
    border-top: 1px solid var(--border);
    padding: 40px 24px 32px;
    margin-top: 80px;
    text-align: center;
    color: var(--text-muted);
    font-size: 13px;
}

footer.site-footer a { color: var(--text-muted); margin: 0 12px; }
footer.site-footer a:hover { color: var(--accent); }

footer.site-footer .copy { margin-top: 12px; color: var(--text-faint); }

/* ── Responsive ─────────────────────────────────────────────────── */

@media (max-width: 1024px) {
    .shop-layout, .product-layout {
        grid-template-columns: 1fr;
    }
    .shop-sidebar, .filter-panel {
        position: static;
        max-height: none;
    }
}

@media (max-width: 640px) {
    header.topnav { padding: 12px 16px; gap: 14px; }
    header.topnav nav { gap: 12px; }
    header.topnav nav a { font-size: 13px; }
    header.topnav .balance-pill { display: none; }
    main { padding: 24px 16px 60px; }
    .hero { padding: 48px 0 36px; }
    .hero h1 { font-size: 32px; }
    .hero .tagline { font-size: 16px; }
    .hero .cta { padding: 14px 28px; font-size: 15px; }
    .card-grid, .preview-grid { grid-template-columns: 1fr; }
    .coin-grid { grid-template-columns: repeat(2, 1fr); }
    .cart-line { grid-template-columns: 1fr; }
    .cart-line .price { text-align: left; font-size: 22px; }
    .howit { padding: 24px 18px; }
    h1 { font-size: 24px; }
    h2 { font-size: 19px; }
}
