/**
 * NM Wallet Bridge — Stylesheet
 * Version: 2.0.0
 */

/* ── Wallet Summary Panel ───────────────────────────────────────────────── */

.nm-wallet-summary {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
    margin: 16px 0;
    font-family: inherit;
}

.nm-wallet-title {
    font-size: 1.1em;
    font-weight: 600;
    margin: 0 0 14px;
    color: #1a1a1a;
}

/* ── Buckets ────────────────────────────────────────────────────────────── */

.nm-wallet-buckets {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 14px;
}

.nm-wallet-bucket {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    border-radius: 6px;
    background: #f7f7f7;
    border-left: 4px solid #ccc;
    font-size: 0.95em;
}

.nm-bucket-cash           { border-left-color: #2ecc71; }
.nm-bucket-promo_credit   { border-left-color: #3498db; }
.nm-bucket-sponsor_credit { border-left-color: #9b59b6; }
.nm-bucket-gift_card      { border-left-color: #e74c3c; }
.nm-bucket-merchant_points{ border-left-color: #f39c12; }
.nm-bucket-network_points { border-left-color: #1abc9c; }

.nm-bucket-name {
    font-weight: 500;
    color: #333;
}

.nm-bucket-balance {
    font-weight: 700;
    color: #111;
    white-space: nowrap;
}

.nm-bucket-expires {
    font-size: 0.8em;
    color: #e74c3c;
    margin-left: 8px;
}

.nm-wallet-total {
    padding: 10px 0;
    border-top: 1px solid #eee;
    font-size: 1em;
    color: #333;
}

.nm-wallet-empty {
    color: #777;
    font-style: italic;
    padding: 10px 0;
}

/* ── Tender Splits Panel (checkout) ─────────────────────────────────────── */

.nm-wallet-panel {
    background: #f0f8ff;
    border: 1px solid #c0d8f0;
    border-radius: 6px;
    padding: 16px;
    margin: 0 0 16px;
}

.nm-wallet-panel h4 {
    margin: 0 0 10px;
    font-size: 1em;
    color: #1a5276;
}

#nm-tender-splits {
    margin: 0 0 8px;
}

.nm-tender-split {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    border-bottom: 1px solid #d6eaf8;
    font-size: 0.9em;
}

.nm-tender-split:last-child {
    border-bottom: none;
}

.nm-split-name {
    color: #2c3e50;
}

.nm-split-amount {
    font-weight: 600;
    color: #27ae60;
}

#nm-tender-total {
    font-weight: 700;
    color: #1a5276;
}

/* ── Activity Table ─────────────────────────────────────────────────────── */

.nm-activity-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9em;
    margin-top: 10px;
}

.nm-activity-table th,
.nm-activity-table td {
    padding: 8px 10px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.nm-activity-table th {
    background: #f5f5f5;
    font-weight: 600;
    color: #555;
}

.nm-tx-completed td:last-child { color: #27ae60; }
.nm-tx-reversed  td:last-child { color: #e74c3c; }
.nm-tx-pending   td:last-child { color: #f39c12; }

/* ── Gift Card Form ─────────────────────────────────────────────────────── */

.nm-gift-card-redeem {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
    margin: 16px 0;
}

.nm-gc-form {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    margin: 10px 0;
}

.nm-gc-form input[type="text"] {
    padding: 8px 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 0.95em;
    width: 200px;
}

.nm-gc-form .button {
    white-space: nowrap;
}

.nm-gc-result {
    margin-top: 10px;
    min-height: 24px;
}

/* ── QR Claim ───────────────────────────────────────────────────────────── */

.nm-qr-claim {
    text-align: center;
    padding: 30px 20px;
    background: #fff;
    border: 1px solid #eee;
    border-radius: 8px;
    margin: 20px 0;
}

.nm-qr-reward {
    font-size: 1.3em;
    font-weight: 700;
    color: #2c3e50;
    margin: 10px 0 20px;
}

.nm-qr-success {
    color: #27ae60;
    font-size: 1.1em;
}

/* ── Notices ─────────────────────────────────────────────────────────────── */

.nm-notice {
    padding: 10px 14px;
    border-radius: 4px;
    font-size: 0.9em;
    margin: 6px 0;
}

.nm-notice-success {
    background: #d5f5e3;
    color: #1e8449;
    border: 1px solid #a9dfbf;
}

.nm-notice-error {
    background: #fde8e8;
    color: #c0392b;
    border: 1px solid #f5b7b1;
}

/* ── Loading state ──────────────────────────────────────────────────────── */

.nm-loading {
    opacity: 0.6;
    cursor: wait;
}

.nm-wallet-login-prompt,
.nm-wallet-error,
.nm-activity-empty {
    color: #666;
    font-style: italic;
    padding: 10px 0;
}

.nm-wallet-refresh {
    margin-top: 12px;
    font-size: 0.85em;
}

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

@media (max-width: 600px) {
    .nm-gc-form {
        flex-direction: column;
        align-items: stretch;
    }
    .nm-gc-form input[type="text"] {
        width: 100%;
    }
    .nm-wallet-bucket {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }
}

/* ── Wallet display QR (Phase 1 — Smart Store Credit) ──────────────────────── */

.nm-wallet-qr {
    display: inline-block;
    padding: 16px;
    border: 1px solid #e1e1e1;
    border-radius: 8px;
    background: #fff;
    text-align: center;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.nm-wallet-qr-label {
    margin: 0 0 12px;
    font-size: 14px;
    color: #555;
}

.nm-wallet-qr-canvas {
    display: inline-block;
    background: #f8f8f8;
    border-radius: 4px;
    overflow: hidden;
    line-height: 0;
}

.nm-wallet-qr-canvas canvas {
    display: block;
    max-width: 100%;
    height: auto;
}

.nm-wallet-qr-meta {
    margin: 12px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    color: #888;
    gap: 12px;
}

.nm-wallet-qr-countdown {
    flex: 1;
    text-align: left;
}

.nm-wallet-qr-refresh {
    flex: 0 0 auto;
}

.nm-wallet-qr-error {
    margin: 0;
    padding: 12px;
    color: #b21f2d;
    font-size: 13px;
}

@media (max-width: 480px) {
    .nm-wallet-qr {
        display: block;
        max-width: 100%;
    }
    .nm-wallet-qr-meta {
        flex-direction: column;
        gap: 8px;
    }
    .nm-wallet-qr-countdown {
        text-align: center;
    }
}
