/* Base: page chrome, typography, buttons, forms, toasts, utilities */

* { box-sizing: border-box; }

html { scroll-padding-top: calc(var(--topbar-h) + 12px); }

body.db {
    margin: 0;
    background:
        radial-gradient(1200px 600px at 50% -200px, #1f1a14 0%, var(--bg-0) 60%)
        var(--bg-0);
    color: var(--text-1);
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.5;
    font-feature-settings: "tnum" 1;
}

h1, h2, .display-face {
    font-family: var(--font-display);
    font-weight: 600;
    color: var(--gold);
    letter-spacing: .02em;
}

a { color: var(--gold); text-decoration: none; }
a:hover { color: var(--gold-strong); text-decoration: underline; }

.dim { color: var(--text-3); font-size: 13px; }

:focus-visible {
    outline: 2px solid var(--gold-strong);
    outline-offset: 2px;
    box-shadow: 0 0 0 4px rgba(242, 201, 76, .25);
    border-radius: var(--r-sm);
}

.skip-link {
    position: absolute; left: -9999px; top: 8px; z-index: 300;
    background: var(--gold-strong); color: var(--ink);
    padding: 8px 16px; border-radius: var(--r-sm); font-weight: 600;
}
.skip-link:focus { left: 8px; }

/* ---------- top bar ---------- */
.topbar {
    position: sticky; top: 0; z-index: 100;
    height: var(--topbar-h);
    display: flex; align-items: center; gap: var(--sp-4);
    padding: 0 var(--sp-4);
    background: var(--bg-1);
    border-bottom: 2px solid var(--gold);
    box-shadow: var(--shadow-1);
}
.brand {
    display: flex; align-items: center; gap: var(--sp-2);
    font-family: var(--font-display); font-weight: 700; font-size: 18px;
    letter-spacing: .06em; text-transform: uppercase; color: var(--gold);
    white-space: nowrap;
}
.brand:hover { text-decoration: none; color: var(--gold-strong); }
.brand svg { width: 26px; height: 26px; flex: 0 0 auto; }

.topbar nav { display: none; gap: var(--sp-4); }
.topbar nav a { color: var(--text-2); font-size: 14px; font-weight: 500; }
.topbar nav a:hover { color: var(--text-1); text-decoration: none; }
@media (min-width: 992px) { .topbar nav { display: flex; } }

.topbar .spacer { flex: 1; }

.mode-pill {
    font-size: 12px; font-weight: 600; letter-spacing: .04em;
    background: var(--bg-3); color: var(--gold);
    border: 1px solid var(--border-input);
    padding: 3px 10px; border-radius: var(--r-pill); white-space: nowrap;
}

.cart-chip {
    display: inline-flex; align-items: center; gap: var(--sp-2);
    background: var(--bg-2); border: 1px solid var(--border-input);
    color: var(--text-1); font-size: 14px; font-weight: 600;
    padding: 7px 14px; border-radius: var(--r-pill);
    cursor: pointer; white-space: nowrap;
    transition: transform var(--t-med) var(--ease), border-color var(--t-fast);
}
.cart-chip:hover { border-color: var(--gold); }
.cart-chip.bump { transform: scale(1.08); }
.cart-chip .chip-icon { color: var(--gold); }

/* ---------- buttons ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center;
    gap: var(--sp-2);
    font-family: var(--font-body); font-weight: 600; font-size: 15px;
    border-radius: var(--r-sm); border: 1px solid transparent;
    padding: 9px 18px; min-height: 40px; cursor: pointer;
    transition: background var(--t-fast), border-color var(--t-fast),
                color var(--t-fast);
    text-decoration: none;
}
.btn:hover { text-decoration: none; }
.btn:disabled { opacity: .55; cursor: not-allowed; }

.btn-cta {
    background: var(--ember); color: #fff;
    border-color: rgba(255, 255, 255, .12);
    min-height: 44px; font-size: 16px;
}
.btn-cta:hover:not(:disabled) { background: var(--ember-hover); color: #fff; }

.btn-gold { background: transparent; color: var(--gold); border-color: var(--gold); }
.btn-gold:hover:not(:disabled) { background: rgba(227, 184, 79, .12); color: var(--gold-strong); }

.btn-ghost { background: transparent; color: var(--text-2); }
.btn-ghost:hover:not(:disabled) { background: var(--bg-2); color: var(--text-1); }
.btn-ghost.danger { color: var(--danger-text); }

.btn-icon {
    width: 36px; height: 36px; min-height: 36px; padding: 0;
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--bg-2); color: var(--text-1);
    border: 1px solid var(--border-input); border-radius: var(--r-sm);
    font-size: 18px; font-weight: 700; cursor: pointer;
}
.btn-icon:hover:not(:disabled) { border-color: var(--gold); color: var(--gold-strong); }

.w-100 { width: 100%; }

/* ---------- forms ---------- */
.db input[type="text"], .db input[type="email"], .db input[type="number"],
.db input[type="search"], .db select, .db textarea {
    background: var(--bg-2); color: var(--text-1);
    border: 1px solid var(--border-input); border-radius: var(--r-sm);
    padding: 8px 12px; min-height: 40px; font-family: var(--font-body);
    font-size: 15px; width: 100%;
}
.db textarea { min-height: 70px; }
.db input::placeholder, .db textarea::placeholder { color: var(--text-3); }
.db select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23c4b9a4' stroke-width='2' d='m2 6 6 5 6-5'/%3e%3c/svg%3e");
    background-repeat: no-repeat; background-position: right 10px center;
    background-size: 14px; padding-right: 32px;
}
.field-label {
    display: block; font-size: 12px; font-weight: 600; letter-spacing: .08em;
    text-transform: uppercase; color: var(--text-2); margin: 0 0 var(--sp-2);
}

/* ---------- panels / cards ---------- */
.panel {
    background: var(--bg-1); border: 1px solid var(--border);
    border-radius: var(--r-lg); box-shadow: var(--shadow-1);
}
.panel-pad { padding: var(--sp-5); }
.center { text-align: center; }
.page-narrow { max-width: 640px; margin: var(--sp-6) auto; padding: 0 var(--sp-4); }
.page-wide { max-width: 860px; margin: var(--sp-6) auto; padding: 0 var(--sp-4); }
.big-icon { font-size: 44px; color: var(--success); }
.callout {
    background: var(--bg-2); border-left: 3px solid var(--gold);
    border-radius: var(--r-sm); padding: var(--sp-3) var(--sp-4);
    margin: var(--sp-4) 0;
}
.section-label {
    font-family: var(--font-body); font-size: 12px; font-weight: 600;
    letter-spacing: .08em; text-transform: uppercase; color: var(--text-2);
    margin: var(--sp-5) 0 var(--sp-2);
}
.lead-line { font-size: 18px; }

.table-scroll { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; }
.data-table th, .data-table td {
    text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--border);
}
.data-table th { color: var(--text-2); font-size: 13px; }
.data-table .num, .totals-table .num { text-align: right; }
.totals-table { width: 100%; max-width: 320px; border-collapse: collapse; }
.totals-table td { padding: 4px 10px 4px 0; }
.totals-table .grand td { font-weight: 700; border-top: 1px solid var(--border); padding-top: 8px; }

.status-line .status-paid, .status-line .status-printing,
.status-line .status-shipped, .status-line .status-complete { color: var(--success); }
.status-line .status-pending, .status-line .status-expired { color: var(--warn); }
.status-line .status-on_hold, .status-line .status-cancelled,
.status-line .status-refunded { color: var(--danger-text); }

/* ---------- how-it-works strip ---------- */
.strip {
    display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-3);
    background: var(--bg-1); border: 1px solid var(--border);
    border-radius: var(--r-md); padding: var(--sp-3) var(--sp-4);
    margin: var(--sp-4) 0; font-size: 14px;
}
.strip .step { display: inline-flex; align-items: center; gap: var(--sp-2); color: var(--text-2); }
.strip .step b { color: var(--text-1); }
.strip .step-num {
    width: 22px; height: 22px; border-radius: 50%;
    background: var(--gold); color: var(--ink);
    display: inline-flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 12px;
}
.strip .trust { color: var(--text-3); font-size: 13px; }
.strip .strip-close { margin-left: auto; }

/* ---------- maker note (Maxine) ---------- */
.maker-note {
    display: flex; align-items: flex-start; gap: var(--sp-3);
    background: var(--bg-1); border: 1px solid var(--border);
    border-left: 3px solid var(--gold);
    border-radius: var(--r-md); padding: var(--sp-3) var(--sp-4);
    margin: 0 0 var(--sp-4); font-size: 14px; line-height: 1.5;
    color: var(--text-2);
}
.maker-note strong { color: var(--text-1); }
.maker-note__mark { color: var(--gold); flex: none; line-height: 1.5; }
.maker-note a { color: var(--gold); white-space: nowrap; }
@media (max-width: 575.98px) {
    .maker-note { font-size: 13px; padding: var(--sp-3); }
}

/* ---------- banner ---------- */
.share-banner {
    display: flex; align-items: center; gap: var(--sp-3);
    background: var(--bg-2); border: 1px solid var(--gold);
    border-radius: var(--r-md); padding: var(--sp-3) var(--sp-4);
    margin: var(--sp-4) 0; font-size: 14px;
}

/* ---------- toasts ---------- */
#toasts {
    position: fixed; left: 50%; transform: translateX(-50%);
    bottom: calc(84px + env(safe-area-inset-bottom, 0px));
    /* above Bootstrap offcanvas (1045) and modal (1055) */
    z-index: 1090; display: flex; flex-direction: column; gap: var(--sp-2);
    width: min(420px, calc(100vw - 32px));
    pointer-events: none;
}
@media (min-width: 992px) { #toasts { bottom: 24px; } }
.toast-db {
    pointer-events: auto;
    display: flex; align-items: center; gap: var(--sp-3);
    background: var(--bg-3); color: var(--text-1);
    border: 1px solid var(--border-input); border-left: 3px solid var(--gold);
    border-radius: var(--r-md); box-shadow: var(--shadow-2);
    padding: var(--sp-3) var(--sp-4); font-size: 14px;
    animation: toast-in var(--t-slow) var(--ease);
}
.toast-db.error { border-left-color: var(--danger); }
.toast-db.success { border-left-color: var(--success); }
.toast-db .toast-action {
    margin-left: auto; background: none; border: none; cursor: pointer;
    color: var(--gold-strong); font-weight: 700; font-size: 14px; padding: 4px 8px;
}
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

/* ---------- footer ---------- */
.site-footer {
    margin-top: var(--sp-7);
    background: var(--bg-1); border-top: 2px solid var(--gold);
    padding: var(--sp-5) var(--sp-4);
    color: var(--text-3); font-size: 14px;
}
.site-footer .foot-inner {
    max-width: 1400px; margin: 0 auto;
    display: flex; flex-wrap: wrap; gap: var(--sp-4); align-items: center;
    justify-content: space-between;
}
.site-footer nav { display: flex; flex-wrap: wrap; gap: var(--sp-4); }
.site-footer a { color: var(--text-2); }

/* ---------- spinner ---------- */
.spinner {
    width: 36px; height: 36px; margin: 0 auto var(--sp-4);
    border: 3px solid var(--border-input); border-top-color: var(--gold);
    border-radius: 50%; animation: spin 800ms linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- fake pay (dev) ---------- */
.fake-pay-form { display: grid; gap: var(--sp-3); text-align: left; max-width: 360px; margin: 0 auto; }
.fake-pay-form label { font-size: 13px; color: var(--text-2); }
.fake-pay-actions { display: flex; gap: var(--sp-3); margin-top: var(--sp-3); }

/* ---------- reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
    .db .cart-chip, .db .toast-db, .db .piece, .db .piece img,
    .db .btn, .db .meter-fill {
        transition: none !important; animation: none !important;
    }
}
