/* ==========================================================================
   به‌نرخ‌روز — نمایش در سایت
   قالب‌آگنوستیک: رنگ‌ها از currentColor و متغیرهای قابل بازنویسی.
   ========================================================================== */

.bnr-box {
    --bnr-f-line: rgba(0, 0, 0, 0.08);
    --bnr-f-soft: rgba(0, 0, 0, 0.55);
    --bnr-f-accent: #0f6b5f;
    --bnr-f-up: #a4262c;
    --bnr-f-down: #1e7b34;
    --bnr-f-warn: #9a5b00;

    direction: rtl;
    margin: 12px 0 16px;
    padding: 12px 14px;
    border: 1px solid var(--bnr-f-line);
    border-radius: 10px;
    font-size: 13px;
    line-height: 1.9;
}

.bnr-box__row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 14px;
}

.bnr-box__price {
    margin: 0 0 8px;
    font-size: 20px;
    font-weight: 700;
}

.bnr-box__notice {
    margin: 0 0 10px;
    padding: 8px 11px;
    border-radius: 7px;
    font-size: 12.5px;
    font-weight: 500;
    background: rgba(0, 0, 0, 0.04);
}

.bnr-box__notice--up {
    color: var(--bnr-f-up);
    background: rgba(164, 38, 44, 0.07);
}

.bnr-box__notice--down {
    color: var(--bnr-f-down);
    background: rgba(30, 123, 52, 0.07);
}

.bnr-box__msg {
    margin: 10px 0 0;
    font-size: 12.5px;
    color: var(--bnr-f-soft);
}

.bnr-box__msg.is-up {
    color: var(--bnr-f-up);
    font-weight: 500;
}

.bnr-box__msg.is-down {
    color: var(--bnr-f-down);
    font-weight: 500;
}

.bnr-box__msg.is-error {
    color: var(--bnr-f-up);
}

.bnr-box__msg.is-wait {
    color: var(--bnr-f-warn);
}

/* ---------- زمان بروزرسانی ---------- */

.bnr-updated {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 12.5px;
    color: var(--bnr-f-soft, rgba(0, 0, 0, 0.55));
}

.bnr-updated::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--bnr-f-accent, #0f6b5f);
    flex: 0 0 auto;
}

/* ---------- شمارنده قفل ---------- */

.bnr-lock {
    display: inline-block;
    padding: 2px 9px;
    border-radius: 20px;
    background: rgba(15, 107, 95, 0.09);
    color: var(--bnr-f-accent, #0f6b5f);
    font-size: 12px;
    font-weight: 500;
    font-variant-numeric: tabular-nums;
}

.bnr-lock.is-ending {
    background: rgba(154, 91, 0, 0.1);
    color: var(--bnr-f-warn, #9a5b00);
}

.bnr-lock.is-expired {
    background: rgba(0, 0, 0, 0.05);
    color: var(--bnr-f-soft, rgba(0, 0, 0, 0.55));
}

/* ---------- دکمه بروزرسانی ---------- */

.bnr-refresh {
    margin-inline-start: auto;
    padding: 5px 13px;
    border: 1px solid var(--bnr-f-line, rgba(0, 0, 0, 0.12));
    border-radius: 7px;
    background: transparent;
    color: inherit;
    font: inherit;
    font-size: 12.5px;
    line-height: 1.8;
    cursor: pointer;
    transition: border-color 0.15s ease, background 0.15s ease;
}

.bnr-refresh:hover:not(:disabled) {
    border-color: var(--bnr-f-accent, #0f6b5f);
    color: var(--bnr-f-accent, #0f6b5f);
}

.bnr-refresh:disabled {
    opacity: 0.55;
    cursor: default;
}

.bnr-refresh:focus-visible {
    outline: 2px solid var(--bnr-f-accent, #0f6b5f);
    outline-offset: 2px;
}

/* ---------- قیمت و نرخ درون‌متنی ---------- */

.bnr-price {
    font-variant-numeric: tabular-nums;
    transition: color 0.3s ease;
}

.bnr-price.is-updated .bnr-price__value {
    animation: bnr-flash 1.5s ease;
}

.bnr-rate-inline {
    font-variant-numeric: tabular-nums;
    font-weight: 600;
}

.bnr-rate-inline--empty {
    font-weight: 400;
    opacity: 0.6;
}

.bnr-unit {
    font-size: 0.82em;
    font-weight: 400;
    opacity: 0.7;
}

@keyframes bnr-flash {
    0%, 100% {
        color: inherit;
    }
    18% {
        color: #0f6b5f;
    }
}

/* ---------- موبایل ---------- */

@media screen and (max-width: 600px) {
    .bnr-box {
        padding: 11px 12px;
    }

    .bnr-box__row {
        gap: 8px 10px;
    }

    .bnr-refresh {
        margin-inline-start: 0;
        width: 100%;
        text-align: center;
    }

    .bnr-box__price {
        font-size: 18px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .bnr-price.is-updated .bnr-price__value {
        animation: none;
    }

    .bnr-refresh,
    .bnr-price {
        transition: none;
    }
}
