/* صفحه کیف پول — استایل مدرن */

@import url("https://fonts.googleapis.com/css2?family=Vazirmatn:wght@400;500;600;700;800&display=swap");

.bcm-user-wallet {
    --bcm-ink: #0b1220;
    --bcm-ink-soft: #1a2332;
    --bcm-surface: #f3f6f9;
    --bcm-card: #ffffff;
    --bcm-line: rgba(15, 23, 42, 0.08);
    --bcm-muted: #64748b;
    --bcm-accent: #0f766e;
    --bcm-accent-2: #134e4a;
    --bcm-credit: #047857;
    --bcm-debit: #b91c1c;
    --bcm-radius: 22px;
    --bcm-shadow: 0 18px 40px rgba(11, 18, 32, 0.08);
    max-width: 760px;
    margin: 0 auto;
    font-family: "Vazirmatn", Tahoma, sans-serif;
    color: var(--bcm-ink);
}

.bcm-wallet-shell {
    display: grid;
    gap: 18px;
}

.bcm-wallet-hero {
    position: relative;
    overflow: hidden;
    border-radius: var(--bcm-radius);
    padding: 28px 28px 26px;
    background:
        radial-gradient(1200px 280px at 100% -10%, rgba(45, 212, 191, 0.22), transparent 55%),
        linear-gradient(145deg, #0b1220 0%, #152033 48%, #0f3d3a 100%);
    color: #f8fafc;
    box-shadow: var(--bcm-shadow);
}

.bcm-wallet-hero::before {
    content: "";
    position: absolute;
    inset: auto -40px -60px auto;
    width: 220px;
    height: 220px;
    border-radius: 50%;
    background: rgba(45, 212, 191, 0.12);
    pointer-events: none;
}

.bcm-wallet-hero-top {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 28px;
}

.bcm-wallet-kicker {
    margin: 0 0 6px;
    font-size: 0.8rem;
    font-weight: 500;
    letter-spacing: 0.04em;
    opacity: 0.72;
}

.bcm-wallet-title {
    margin: 0;
    font-size: 1.35rem;
    font-weight: 700;
    color: #fff;
    line-height: 1.3;
}

.bcm-wallet-identity {
    margin-top: 14px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.bcm-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.12);
    font-size: 0.82rem;
    font-weight: 500;
    backdrop-filter: blur(6px);
}

.bcm-chip strong {
    font-weight: 700;
}

.bcm-chip[dir="ltr"] {
    letter-spacing: 0.02em;
}

.bcm-refresh-btn {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: 0;
    cursor: pointer;
    padding: 11px 16px;
    border-radius: 14px;
    background: #f0fdfa;
    color: var(--bcm-accent-2);
    font-family: inherit;
    font-size: 0.88rem;
    font-weight: 700;
    box-shadow: 0 8px 20px rgba(15, 118, 110, 0.18);
    transition: transform 0.18s ease, background 0.18s ease, opacity 0.18s ease;
}

.bcm-refresh-btn:hover {
    transform: translateY(-1px);
    background: #fff;
}

.bcm-refresh-btn:disabled {
    opacity: 0.7;
    cursor: wait;
    transform: none;
}

.bcm-refresh-btn .bcm-refresh-icon {
    width: 16px;
    height: 16px;
    display: inline-block;
    transition: transform 0.35s ease;
}

.bcm-refresh-btn.is-loading .bcm-refresh-icon {
    animation: bcm-spin 0.8s linear infinite;
}

@keyframes bcm-spin {
    to { transform: rotate(-360deg); }
}

.bcm-wallet-balance-block {
    position: relative;
    z-index: 1;
}

.bcm-balance-caption {
    margin: 0 0 8px;
    font-size: 0.9rem;
    opacity: 0.78;
}

.bcm-balance-row {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 10px 12px;
}

.bcm-balance-value {
    font-size: clamp(2rem, 5vw, 2.75rem);
    font-weight: 800;
    line-height: 1.05;
    letter-spacing: -0.02em;
    color: #fff;
}

.bcm-balance-value .bcm-amount-num {
    display: inline-block;
    direction: ltr;
    unicode-bidi: isolate;
}

.bcm-unit-badge {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    border-radius: 999px;
    background: rgba(45, 212, 191, 0.18);
    border: 1px solid rgba(45, 212, 191, 0.28);
    color: #99f6e4;
    font-size: 0.92rem;
    font-weight: 700;
}

.bcm-wallet-meta {
    margin-top: 16px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px 18px;
    font-size: 0.8rem;
    opacity: 0.72;
}

.bcm-wallet-toast {
    margin-top: 14px;
    padding: 10px 12px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.12);
    font-size: 0.82rem;
    display: none;
}

.bcm-wallet-toast.is-visible {
    display: block;
}

.bcm-wallet-toast.is-ok {
    background: rgba(16, 185, 129, 0.16);
    border-color: rgba(16, 185, 129, 0.28);
}

.bcm-wallet-toast.is-error {
    background: rgba(248, 113, 113, 0.16);
    border-color: rgba(248, 113, 113, 0.28);
}

.bcm-wallet-hint {
    margin: 0;
    font-size: 0.84rem;
    line-height: 1.7;
    color: var(--bcm-muted);
}

.bcm-transactions-section {
    background: var(--bcm-card);
    border: 1px solid var(--bcm-line);
    border-radius: var(--bcm-radius);
    padding: 22px;
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.04);
}

.bcm-transactions-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}

.bcm-transactions-head h2 {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--bcm-ink);
}

.bcm-transactions-count {
    font-size: 0.78rem;
    color: var(--bcm-muted);
    background: var(--bcm-surface);
    border-radius: 999px;
    padding: 5px 10px;
}

.bcm-tx-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 10px;
}

.bcm-tx-item {
    display: grid;
    grid-template-columns: 44px 1fr auto;
    gap: 12px;
    align-items: center;
    padding: 14px;
    border-radius: 16px;
    background: var(--bcm-surface);
    border: 1px solid transparent;
    transition: border-color 0.15s ease, transform 0.15s ease;
}

.bcm-tx-item:hover {
    border-color: rgba(15, 118, 110, 0.18);
    transform: translateY(-1px);
}

.bcm-tx-icon {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    display: grid;
    place-items: center;
    font-size: 1.1rem;
    font-weight: 800;
}

.bcm-tx-item.is-credit .bcm-tx-icon {
    background: rgba(4, 120, 87, 0.12);
    color: var(--bcm-credit);
}

.bcm-tx-item.is-debit .bcm-tx-icon {
    background: rgba(185, 28, 28, 0.1);
    color: var(--bcm-debit);
}

.bcm-tx-main {
    min-width: 0;
}

.bcm-tx-title {
    margin: 0 0 4px;
    font-size: 0.92rem;
    font-weight: 700;
    color: var(--bcm-ink);
}

.bcm-tx-desc {
    margin: 0;
    font-size: 0.8rem;
    color: var(--bcm-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.bcm-tx-side {
    text-align: left;
}

.bcm-tx-amount {
    display: block;
    font-size: 0.95rem;
    font-weight: 800;
    direction: ltr;
    unicode-bidi: isolate;
}

.bcm-tx-item.is-credit .bcm-tx-amount {
    color: var(--bcm-credit);
}

.bcm-tx-item.is-debit .bcm-tx-amount {
    color: var(--bcm-debit);
}

.bcm-tx-date {
    display: block;
    margin-top: 4px;
    font-size: 0.72rem;
    color: var(--bcm-muted);
}

.bcm-status-badge {
    display: inline-block;
    margin-top: 6px;
    padding: 3px 8px;
    border-radius: 999px;
    font-size: 0.68rem;
    font-weight: 600;
}

.bcm-status-completed {
    background: #d1fae5;
    color: #065f46;
}

.bcm-status-pending {
    background: #fef3c7;
    color: #92400e;
}

.bcm-status-failed,
.bcm-status-cancelled {
    background: #fee2e2;
    color: #991b1b;
}

.bcm-no-transactions {
    text-align: center;
    padding: 36px 16px;
    color: var(--bcm-muted);
    background: var(--bcm-surface);
    border-radius: 16px;
}

.bcm-pagination {
    margin-top: 16px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: center;
}

.bcm-pagination a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 10px;
    border-radius: 10px;
    text-decoration: none;
    color: var(--bcm-ink-soft);
    background: var(--bcm-surface);
    border: 1px solid var(--bcm-line);
    font-size: 0.85rem;
    font-weight: 600;
}

.bcm-pagination a:hover,
.bcm-pagination a.current {
    background: var(--bcm-accent);
    border-color: var(--bcm-accent);
    color: #fff;
}

.bcm-wallet-guest {
    padding: 22px;
    border-radius: 16px;
    background: var(--bcm-surface);
    color: var(--bcm-muted);
    text-align: center;
}

@media (max-width: 640px) {
    .bcm-wallet-hero {
        padding: 22px 18px;
    }

    .bcm-wallet-hero-top {
        flex-direction: column;
    }

    .bcm-refresh-btn {
        width: 100%;
        justify-content: center;
    }

    .bcm-tx-item {
        grid-template-columns: 40px 1fr;
        grid-template-areas:
            "icon main"
            "icon side";
    }

    .bcm-tx-icon { grid-area: icon; }
    .bcm-tx-main { grid-area: main; }
    .bcm-tx-side {
        grid-area: side;
        text-align: right;
        padding-top: 4px;
    }
}

/* کارت‌های نقدی / اعتباری */
.bcm-wallet-cards {
    display: grid;
    gap: 14px;
}

.bcm-wallet-card {
    background: #fff;
    border: 1px solid var(--bcm-line);
    border-radius: 18px;
    padding: 18px;
    box-shadow: 0 8px 22px rgba(15, 23, 42, 0.04);
}

.bcm-wallet-card.is-default {
    border-color: rgba(15, 118, 110, 0.35);
}

.bcm-wallet-card.is-expiring,
.bcm-expiry-banner,
.bcm-installments li.is-expiring {
    animation: bcm-pulse-border 1.4s ease-in-out infinite;
}

@keyframes bcm-pulse-border {
    0%, 100% { box-shadow: 0 0 0 0 rgba(180, 83, 9, 0.25); }
    50% { box-shadow: 0 0 0 8px rgba(180, 83, 9, 0); }
}

.bcm-wallet-card-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.bcm-wallet-card-head h3 {
    margin: 0;
    font-size: 1rem;
}

.bcm-wallet-card-type {
    font-size: 0.75rem;
    padding: 4px 10px;
    border-radius: 999px;
    background: #ecfeff;
    color: #0f766e;
    font-weight: 700;
}

.bcm-wallet-card.is-credit .bcm-wallet-card-type {
    background: #fff7ed;
    color: #c2410c;
}

.bcm-wallet-card-balance {
    font-size: 1.45rem;
    font-weight: 800;
    margin-bottom: 8px;
}

.bcm-wallet-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 16px;
    font-size: 0.82rem;
    color: var(--bcm-muted);
    margin-bottom: 10px;
}

.bcm-installments h4 {
    margin: 0 0 8px;
    font-size: 0.9rem;
}

.bcm-installments ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 8px;
}

.bcm-installments li {
    display: grid;
    grid-template-columns: 40px 1fr 1fr auto;
    gap: 8px;
    align-items: center;
    padding: 10px;
    border-radius: 12px;
    background: var(--bcm-surface);
    font-size: 0.82rem;
}

.bcm-repay-btn {
    border: 0;
    border-radius: 10px;
    padding: 7px 12px;
    background: #0f766e;
    color: #fff;
    font-family: inherit;
    font-weight: 700;
    cursor: pointer;
}

.bcm-penalty-box {
    margin-top: 10px;
    padding: 10px;
    border-radius: 12px;
    background: #fef2f2;
    color: #991b1b;
    font-size: 0.82rem;
}

.bcm-reward-box {
    margin-top: 8px;
    padding: 10px;
    border-radius: 12px;
    background: #ecfdf5;
    color: #065f46;
    font-size: 0.82rem;
}

.bcm-expiry-banner {
    padding: 14px 16px;
    border-radius: 14px;
    background: linear-gradient(90deg, #fff7ed, #ffedd5);
    color: #9a3412;
    font-weight: 700;
    border: 1px solid #fdba74;
}

.bcm-expiry-pulse {
    animation: bcm-pulse-border 1.4s ease-in-out infinite;
}

.woocommerce-MyAccount-navigation .bcm-menu-wallet-alert a::after {
    content: "!";
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    margin-inline-start: 6px;
    border-radius: 50%;
    background: #ea580c;
    color: #fff;
    font-size: 11px;
    font-weight: 800;
    animation: bcm-pulse-border 1.2s ease-in-out infinite;
}

.bcm-expiry-popup {
    position: fixed;
    inset: 0;
    z-index: 99999;
    background: rgba(11, 18, 32, 0.45);
    display: grid;
    place-items: center;
    padding: 20px;
}

.bcm-expiry-popup[hidden] {
    display: none !important;
}

.bcm-expiry-popup-card {
    position: relative;
    width: min(420px, 100%);
    background: #fff;
    border-radius: 18px;
    padding: 24px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.2);
    font-family: "Vazirmatn", Tahoma, sans-serif;
}

.bcm-expiry-popup-card h3 {
    margin: 0 0 10px;
}

.bcm-expiry-popup-close {
    position: absolute;
    top: 10px;
    left: 12px;
    border: 0;
    background: transparent;
    font-size: 1.4rem;
    cursor: pointer;
}

.bcm-expiry-popup-cta {
    display: inline-flex;
    margin-top: 14px;
    padding: 10px 16px;
    border-radius: 12px;
    background: #0f766e;
    color: #fff !important;
    text-decoration: none;
    font-weight: 700;
}

/* کارت هدیه */
.bcm-gift-section {
    background: var(--bcm-card);
    border: 1px solid var(--bcm-line);
    border-radius: var(--bcm-radius);
    padding: 22px 22px 18px;
    box-shadow: var(--bcm-shadow);
    display: grid;
    gap: 14px;
}

.bcm-gift-head h2 {
    margin: 0 0 6px;
    font-size: 1.1rem;
    font-weight: 700;
}

.bcm-gift-head p {
    margin: 0;
    color: var(--bcm-muted);
    font-size: 0.9rem;
    line-height: 1.6;
}

.bcm-gift-form {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.bcm-gift-input {
    flex: 1 1 200px;
    min-height: 46px;
    border: 1px solid var(--bcm-line);
    border-radius: 14px;
    padding: 10px 14px;
    font-family: inherit;
    font-size: 0.95rem;
    background: #f8fafc;
}

.bcm-gift-submit,
.bcm-gift-check-btn {
    min-height: 46px;
    border: 0;
    border-radius: 14px;
    padding: 0 18px;
    background: linear-gradient(135deg, #0f766e, #134e4a);
    color: #fff;
    font-family: inherit;
    font-weight: 700;
    cursor: pointer;
}

.bcm-gift-check-btn {
    width: 100%;
    background: #0b1220;
}

.bcm-gift-feedback {
    min-height: 1.2em;
    font-size: 0.88rem;
}

.bcm-gift-feedback.is-ok {
    color: #047857;
}

.bcm-gift-feedback.is-error {
    color: #b91c1c;
}

.bcm-gift-usable {
    display: grid;
    gap: 8px;
    padding: 14px;
    border-radius: 16px;
    background: linear-gradient(180deg, #f8fafc, #eef2f7);
}

.bcm-gift-usable-row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    font-size: 0.9rem;
    color: var(--bcm-muted);
}

.bcm-gift-usable-row strong {
    color: var(--bcm-ink);
    font-weight: 700;
}

.bcm-gift-usable-row.is-accent strong {
    color: var(--bcm-accent);
}

.bcm-gift-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 10px;
}

.bcm-gift-item {
    border: 1px solid var(--bcm-line);
    border-radius: 14px;
    padding: 12px 14px;
    background: #fff;
}

.bcm-gift-item.is-blocked {
    border-color: rgba(185, 28, 28, 0.25);
    background: #fff7f7;
}

.bcm-gift-item-main {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    font-weight: 700;
}

.bcm-gift-item-meta {
    margin-top: 8px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px 12px;
    font-size: 0.8rem;
    color: var(--bcm-muted);
}

.bcm-gift-tag {
    color: #0f766e;
    font-weight: 600;
}

.bcm-gift-error {
    color: #b91c1c;
    width: 100%;
}

@media (max-width: 640px) {
    .bcm-gift-form {
        flex-direction: column;
    }
    .bcm-gift-submit {
        width: 100%;
    }
}
