/* ============================================================
   WEKID Store — public-facing commerce pages
   Matches the candidate exam dark theme (sky/purple accents)
   ============================================================ */

:root {
    --store-bg: var(--bg-deep, #07111f);
    --store-card: var(--bg-elevated, #0f1a2c);
    --store-border: var(--border, rgba(255,255,255,0.08));
    --store-text: var(--text, #e6edf6);
    --store-muted: var(--muted, #8a9ab8);
    --store-accent: var(--accent, #7dd3fc);
    --store-accent-2: var(--accent-2, #a78bfa);
    --store-good: var(--good, #34d399);
    --store-warn: var(--warn, #fbbf24);
    --store-bad:  var(--bad,  #fb7185);
}

.store-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 32px 24px 48px;
}

.store-hero {
    text-align: center;
    padding: 24px 0 48px;
}
.store-hero .eyebrow {
    color: var(--store-accent);
    font-size: 0.78rem;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    margin: 0 0 12px;
}
.store-hero h1 {
    font-family: 'Fraunces', Georgia, serif;
    font-weight: 500;
    font-size: clamp(2rem, 5vw, 3.2rem);
    margin: 0 0 16px;
    line-height: 1.15;
}
.store-hero p {
    color: var(--store-muted);
    font-size: 1.1rem;
    max-width: 640px;
    margin: 0 auto;
    line-height: 1.6;
}

.store-promo-banner {
    background: linear-gradient(135deg, rgba(125,211,252,0.1), rgba(167,139,250,0.1));
    border: 1px solid rgba(125,211,252,0.3);
    border-radius: 12px;
    padding: 14px 24px;
    margin: 0 0 32px;
    text-align: center;
    font-size: 0.92rem;
    color: var(--store-text);
}
.store-promo-banner strong { color: var(--store-accent); }

.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 18px;
    margin: 0 0 32px;
}

.product-card {
    background: var(--store-card);
    border: 1px solid var(--store-border);
    border-radius: 14px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    transition: transform 120ms, border-color 120ms;
}
.product-card:hover {
    transform: translateY(-2px);
    border-color: rgba(125,211,252,0.4);
}
.product-card.bundle {
    background: linear-gradient(150deg, var(--store-card), rgba(167,139,250,0.06));
}
.product-card .pc-tag {
    display: inline-block;
    font-size: 0.7rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--store-accent-2);
    margin: 0 0 10px;
}
.product-card.exam .pc-tag { color: var(--store-accent); }

.product-card h3 {
    font-family: 'Fraunces', Georgia, serif;
    font-weight: 500;
    font-size: 1.3rem;
    margin: 0 0 8px;
    line-height: 1.3;
}
.product-card .pc-blurb {
    color: var(--store-muted);
    font-size: 0.92rem;
    line-height: 1.5;
    margin: 0 0 20px;
    flex: 1;
}

.pc-pricing {
    display: flex;
    align-items: baseline;
    gap: 10px;
    margin: 0 0 16px;
}
.pc-pricing .price-current {
    font-family: 'Fraunces', Georgia, serif;
    font-size: 1.9rem;
    color: var(--store-text);
    font-weight: 500;
}
.pc-pricing .price-was {
    color: var(--store-muted);
    font-size: 1rem;
    text-decoration: line-through;
}
.pc-pricing .price-savings {
    color: var(--store-good);
    font-size: 0.8rem;
    font-weight: 500;
    margin-left: auto;
}

.pc-cta {
    display: block;
    text-align: center;
    background: linear-gradient(135deg, var(--store-accent), var(--store-accent-2));
    color: #0a1320;
    padding: 12px 20px;
    border-radius: 999px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.92rem;
    transition: transform 120ms, box-shadow 120ms;
}
.pc-cta:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 18px -4px rgba(125,211,252,0.4);
}

/* ============= Product detail page ============= */
.product-detail {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 32px;
    margin: 0 0 48px;
}
@media (max-width: 800px) {
    .product-detail { grid-template-columns: 1fr; }
}

.pd-info h1 {
    font-family: 'Fraunces', Georgia, serif;
    font-weight: 500;
    font-size: 2.4rem;
    margin: 8px 0 16px;
    line-height: 1.15;
}
.pd-info .lead {
    font-size: 1.08rem;
    color: var(--store-text);
    line-height: 1.6;
    margin: 0 0 24px;
}

.pd-features {
    list-style: none;
    padding: 0;
    margin: 24px 0;
}
.pd-features li {
    padding: 10px 0;
    border-bottom: 1px solid var(--store-border);
    display: flex;
    gap: 12px;
    align-items: flex-start;
}
.pd-features li::before {
    content: "✓";
    color: var(--store-accent);
    font-weight: 700;
    flex-shrink: 0;
}

.pd-bundle-contents {
    background: var(--store-card);
    border-radius: 10px;
    padding: 16px 20px;
    margin: 16px 0 24px;
}
.pd-bundle-contents h4 {
    margin: 0 0 12px;
    color: var(--store-accent-2);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}
.pd-bundle-contents ul {
    list-style: none;
    padding: 0;
    margin: 0;
}
.pd-bundle-contents li {
    padding: 6px 0;
    color: var(--store-text);
    font-size: 0.92rem;
}

.pd-buy-box {
    background: var(--store-card);
    border: 1px solid var(--store-border);
    border-radius: 14px;
    padding: 24px;
    position: sticky;
    top: 20px;
    height: fit-content;
}

.pd-price-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding: 8px 0;
}
.pd-price-row .label { color: var(--store-muted); font-size: 0.88rem; }
.pd-price-row .value { font-family: 'JetBrains Mono', monospace; font-weight: 500; }
.pd-price-row.total {
    border-top: 1px solid var(--store-border);
    padding-top: 14px;
    margin-top: 8px;
}
.pd-price-row.total .label,
.pd-price-row.total .value {
    font-size: 1.1rem;
    color: var(--store-text);
    font-family: 'Fraunces', Georgia, serif;
    font-weight: 500;
}
.pd-price-row.discount .value { color: var(--store-good); }

.qty-selector {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 16px 0;
}
.qty-selector input[type="number"] {
    width: 80px;
    padding: 10px 12px;
    background: var(--store-bg);
    color: var(--store-text);
    border: 1px solid var(--store-border);
    border-radius: 8px;
    font-size: 1rem;
    text-align: center;
    font-family: 'JetBrains Mono', monospace;
}
.qty-selector .label { color: var(--store-muted); font-size: 0.88rem; }
.qty-selector .helper { color: var(--store-muted); font-size: 0.78rem; margin-left: auto; }

.pd-bulk-tiers {
    background: var(--store-bg);
    border-radius: 8px;
    padding: 12px;
    margin: 12px 0;
    font-size: 0.82rem;
}
.pd-bulk-tiers .tier {
    display: flex;
    justify-content: space-between;
    padding: 4px 0;
    color: var(--store-muted);
}
.pd-bulk-tiers .tier.active {
    color: var(--store-good);
    font-weight: 500;
}

.pd-promo {
    margin: 16px 0;
}
.pd-promo input {
    width: 100%;
    padding: 10px 12px;
    background: var(--store-bg);
    color: var(--store-text);
    border: 1px solid var(--store-border);
    border-radius: 8px;
    font-size: 0.92rem;
    text-transform: uppercase;
    font-family: 'JetBrains Mono', monospace;
    box-sizing: border-box;
}
.pd-promo .promo-msg { font-size: 0.78rem; padding: 6px 0; min-height: 20px; }
.pd-promo .promo-msg.ok  { color: var(--store-good); }
.pd-promo .promo-msg.err { color: var(--store-bad); }

.pd-buy-btn {
    display: block;
    width: 100%;
    background: linear-gradient(135deg, var(--store-accent), var(--store-accent-2));
    color: #0a1320;
    padding: 14px 20px;
    border: 0;
    border-radius: 999px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    margin: 16px 0 0;
    transition: transform 120ms, box-shadow 120ms;
}
.pd-buy-btn:hover { transform: translateY(-1px); box-shadow: 0 6px 18px -4px rgba(125,211,252,0.4); }
.pd-buy-btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; box-shadow: none; }

/* ============= Checkout ============= */
.checkout-grid {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 32px;
}
@media (max-width: 800px) { .checkout-grid { grid-template-columns: 1fr; } }

.checkout-section {
    background: var(--store-card);
    border: 1px solid var(--store-border);
    border-radius: 14px;
    padding: 24px;
    margin: 0 0 16px;
}
.checkout-section h2 {
    margin: 0 0 16px;
    font-family: 'Fraunces', Georgia, serif;
    font-weight: 500;
    font-size: 1.4rem;
}

.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.field { margin: 0 0 14px; }
.field.full { grid-column: 1 / -1; }
.field label {
    display: block;
    color: var(--store-muted);
    font-size: 0.78rem;
    margin: 0 0 6px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}
.field input, .field textarea {
    width: 100%;
    padding: 10px 12px;
    background: var(--store-bg);
    color: var(--store-text);
    border: 1px solid var(--store-border);
    border-radius: 8px;
    font-size: 0.95rem;
    box-sizing: border-box;
    font-family: inherit;
}
.field input:focus, .field textarea:focus {
    outline: none;
    border-color: var(--store-accent);
    box-shadow: 0 0 0 3px rgba(125,211,252,0.15);
}

#stripe-payment-element { padding: 4px 0; }

.checkout-summary { position: sticky; top: 20px; }
.checkout-summary .item-row {
    padding: 12px 0;
    border-bottom: 1px solid var(--store-border);
}
.checkout-summary .item-row:last-child { border-bottom: 0; }

.order-complete-hero {
    text-align: center;
    padding: 48px 24px;
}
.order-complete-hero .check-icon {
    width: 80px; height: 80px;
    margin: 0 auto 20px;
    border-radius: 50%;
    background: rgba(52,211,153,0.15);
    color: var(--store-good);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
}
.order-complete-hero h1 {
    font-family: 'Fraunces', Georgia, serif;
    font-size: 2.2rem;
    font-weight: 500;
    margin: 0 0 12px;
}
.token-list {
    background: var(--store-card);
    border: 1px solid var(--store-border);
    border-radius: 12px;
    padding: 24px;
    margin: 24px 0;
}
.token-list h3 {
    margin: 0 0 16px;
    font-family: 'Fraunces', Georgia, serif;
    font-weight: 500;
}
.token-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 16px;
    margin: 8px 0;
    background: var(--store-bg);
    border-radius: 8px;
    border: 1px solid var(--store-border);
}
.token-row .tok-info { flex: 1; }
.token-row .tok-info .ti-exam { color: var(--store-text); font-weight: 500; }
.token-row .tok-info .ti-status { color: var(--store-muted); font-size: 0.82rem; margin-top: 2px; }
.token-row .tok-code {
    font-family: 'JetBrains Mono', monospace;
    background: rgba(125,211,252,0.08);
    color: var(--store-accent);
    padding: 6px 12px;
    border-radius: 6px;
    font-weight: 500;
    font-size: 0.92rem;
    user-select: all;
}

.btn-row { display: flex; gap: 10px; flex-wrap: wrap; }
.store-btn {
    display: inline-block;
    padding: 10px 20px;
    border-radius: 999px;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.92rem;
    cursor: pointer;
    border: 0;
    font-family: inherit;
}
.store-btn.primary {
    background: linear-gradient(135deg, var(--store-accent), var(--store-accent-2));
    color: #0a1320;
}
.store-btn.ghost {
    background: transparent;
    color: var(--store-text);
    border: 1px solid var(--store-border);
}

.store-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    border-bottom: 1px solid var(--store-border);
    max-width: 1200px;
    margin: 0 auto;
}
.store-nav .brand {
    color: var(--store-text);
    text-decoration: none;
    font-family: 'Fraunces', Georgia, serif;
    font-weight: 500;
    font-size: 1.1rem;
}
.store-nav .brand .accent { color: var(--store-accent); }
.store-nav-links { display: flex; gap: 18px; align-items: center; }
.store-nav-links a {
    color: var(--store-muted);
    text-decoration: none;
    font-size: 0.88rem;
}
.store-nav-links a:hover { color: var(--store-text); }
