/* ==========================================================
   نمایش قیمت طلا — شورت‌کد [woo_jew_gold_price]
   ========================================================== */

.wjg,
.wjg * {
    box-sizing: border-box;
}

.wjg {
    /* تم پیش‌فرض: تیره و لوکس */
    --wjg-bg: linear-gradient(135deg, #150f07 0%, #2b1f0b 50%, #150f07 100%);
    --wjg-border: rgba(234, 191, 84, .55);
    --wjg-shadow: 0 8px 26px rgba(21, 15, 7, .30);
    --wjg-text: #f6ecd2;
    --wjg-muted: rgba(246, 236, 210, .68);
    --wjg-gold: linear-gradient(90deg, #f9e79f 0%, #e0b03a 32%, #fff3bf 55%, #d29b1e 100%);
    --wjg-divider: rgba(234, 191, 84, .35);
    --wjg-up: #4ade80;
    --wjg-down: #ff7b7b;
    --wjg-sheen: rgba(255, 235, 160, .20);

    position: relative;
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 8px 22px;
    max-width: 100%;
    padding: 9px 20px;
    margin: 0;
    border: 1px solid var(--wjg-border);
    border-radius: 16px;
    background: var(--wjg-bg);
    box-shadow: var(--wjg-shadow);
    color: var(--wjg-text);
    direction: rtl;
    text-align: right;
    font-family: inherit;
    font-size: 14px;
    line-height: 1.5;
    overflow: hidden;
    isolation: isolate;
}

/* تم طلایی */
.wjg--gold {
    --wjg-bg: linear-gradient(135deg, #f7dc83 0%, #e2b23c 48%, #f3d373 100%);
    --wjg-border: rgba(122, 82, 0, .45);
    --wjg-shadow: 0 8px 22px rgba(160, 110, 10, .30);
    --wjg-text: #3a2600;
    --wjg-muted: rgba(58, 38, 0, .72);
    --wjg-gold: linear-gradient(90deg, #3a2600, #3a2600);
    --wjg-divider: rgba(58, 38, 0, .28);
    --wjg-up: #0d7a34;
    --wjg-down: #b3261e;
    --wjg-sheen: rgba(255, 255, 255, .45);
}

/* تم روشن */
.wjg--light {
    --wjg-bg: linear-gradient(135deg, #ffffff 0%, #fff8e3 100%);
    --wjg-border: rgba(196, 146, 24, .55);
    --wjg-shadow: 0 6px 20px rgba(196, 146, 24, .18);
    --wjg-text: #3b2a08;
    --wjg-muted: rgba(59, 42, 8, .62);
    --wjg-gold: linear-gradient(90deg, #8a5a00 0%, #c58c0e 45%, #8a5a00 100%);
    --wjg-divider: rgba(196, 146, 24, .35);
    --wjg-up: #13833b;
    --wjg-down: #c62828;
    --wjg-sheen: rgba(255, 214, 102, .35);
}

/* درخشش متحرک روی کادر */
.wjg::after {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    width: 100%;
    background: linear-gradient(110deg, transparent 38%, var(--wjg-sheen) 50%, transparent 62%);
    transform: translateX(-110%);
    animation: wjg-sheen 7s ease-in-out infinite;
    pointer-events: none;
}

/* ---------- سر: آیکون + عنوان + نقطه‌ی زنده ---------- */
.wjg__head {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    white-space: nowrap;
}

.wjg__icon {
    flex: 0 0 auto;
    width: 24px;
    height: 24px;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, .25));
    animation: wjg-float 3.4s ease-in-out infinite;
}

.wjg__titlebox {
    display: inline-flex;
    flex-direction: column;
    gap: 1px;
}

.wjg__titleline {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.wjg__title {
    color: var(--wjg-text);
    letter-spacing: -.1px;
}

.wjg__live {
    position: relative;
    flex: 0 0 auto;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #34d399;
}

.wjg__live::after {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    border-radius: 50%;
    background: #34d399;
    animation: wjg-pulse 1.8s ease-out infinite;
}

/* ---------- قیمت‌ها ---------- */
.wjg__items {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 0;
}

.wjg__item {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 0 18px;
    white-space: nowrap;
}

.wjg__item + .wjg__item {
    border-right: 1px solid var(--wjg-divider);
}

.wjg__item:first-child {
    padding-right: 0;
}

.wjg__item:last-child {
    padding-left: 0;
}

.wjg__label {
    color: var(--wjg-muted);
    font-size: .92em;
}

.wjg__price {
    display: inline-flex;
    align-items: baseline;
    gap: 5px;
}

.wjg__num {
    font-size: 1.22em;
    font-weight: 800;
    color: #e8c05a;
    background: var(--wjg-gold);
    background-size: 220% auto;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: wjg-shine 5s linear infinite;
}

.wjg__unit {
    color: var(--wjg-muted);
    font-size: .8em;
}

/* فلش افزایش / کاهش */
.wjg__chg {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 1px 7px;
    border-radius: 999px;
    font-size: .78em;
    font-weight: 700;
    background: rgba(255, 255, 255, .08);
}

.wjg__chg::before {
    content: "";
    width: 0;
    height: 0;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
}

.wjg__chg--up {
    color: var(--wjg-up);
}

.wjg__chg--up::before {
    border-bottom: 6px solid currentColor;
}

.wjg__chg--down {
    color: var(--wjg-down);
}

.wjg__chg--down::before {
    border-top: 6px solid currentColor;
}

.wjg--light .wjg__chg,
.wjg--gold .wjg__chg {
    background: rgba(0, 0, 0, .06);
}

/* ---------- زمان ---------- */
.wjg__time {
    color: var(--wjg-muted);
    font-size: .74em;
    font-weight: 400;
    white-space: nowrap;
}

/* ---------- نسخه‌ی فشرده ---------- */
.wjg--compact {
    gap: 4px 14px;
    padding: 5px 14px;
    border-radius: 999px;
    font-size: 13px;
}

.wjg--compact .wjg__icon {
    width: 20px;
    height: 20px;
}

.wjg--compact .wjg__item {
    padding: 0 12px;
}

.wjg--compact .wjg__num {
    font-size: 1.12em;
}

/* ---------- یادآوری برای مدیر ---------- */
.wjg--notice {
    display: block;
    padding: 8px 14px;
    border: 1px dashed #c58c0e;
    border-radius: 10px;
    background: #fff8e3;
    color: #6b4a00;
    font-size: 13px;
}

/* ---------- موبایل ---------- */
@media (max-width: 640px) {
    .wjg {
        display: flex;
        width: 100%;
        gap: 8px 14px;
        padding: 9px 12px;
        border-radius: 14px;
        font-size: 13px;
    }

    .wjg__head {
        justify-content: center;
        width: 100%;
    }

    .wjg__titlebox {
        align-items: flex-start;
    }

    .wjg__items {
        display: flex;
        flex-wrap: nowrap;
        width: 100%;
    }

    /* هر قیمت یک ستون: برچسب + فلش بالا، عدد پایین */
    .wjg__item {
        display: grid;
        grid-template-columns: auto auto;
        grid-template-areas: "l c" "p p";
        flex: 1 1 0;
        justify-content: space-between;
        align-items: center;
        gap: 2px 6px;
        padding: 0 10px;
        min-width: 0;
    }

    .wjg__item:first-child {
        padding-right: 0;
    }

    .wjg__item:last-child {
        padding-left: 0;
    }

    .wjg__label {
        grid-area: l;
        font-size: .86em;
    }

    .wjg__chg {
        grid-area: c;
        justify-self: end;
    }

    .wjg__price {
        grid-area: p;
    }

    .wjg__item:only-child {
        flex: 0 1 auto;
        margin: 0 auto;
    }

    .wjg--compact {
        border-radius: 14px;
    }
}

/* ---------- انیمیشن‌ها ---------- */
@keyframes wjg-sheen {
    0%, 55% {
        transform: translateX(-110%);
    }
    100% {
        transform: translateX(110%);
    }
}

@keyframes wjg-shine {
    0% {
        background-position: 0% center;
    }
    100% {
        background-position: -220% center;
    }
}

@keyframes wjg-pulse {
    0% {
        transform: scale(1);
        opacity: .65;
    }
    100% {
        transform: scale(3.2);
        opacity: 0;
    }
}

@keyframes wjg-float {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-2px);
    }
}

@media (prefers-reduced-motion: reduce) {
    .wjg::after,
    .wjg__icon,
    .wjg__live::after,
    .wjg__num {
        animation: none;
    }
}

/* ==========================================================
   باکس راهنما در صفحه‌ی تنظیمات افزونه (مدیریت)
   ========================================================== */
.woo-jew-gold-box {
    margin-top: 28px;
    padding: 16px 18px;
    border: 1px solid #e2c572;
    border-radius: 10px;
    background: #fffdf5;
}

.woo-jew-gold-box h2 {
    margin-top: 0;
}

.woo-jew-gold-box__copy {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin: 10px 0 14px;
}

.woo-jew-gold-box__copy input[type="text"] {
    min-width: 220px;
    direction: ltr;
    text-align: left;
    font-family: monospace;
}

.woo-jew-gold-box__preview {
    padding: 14px;
    border-radius: 8px;
    background: #ece7da;
    overflow-x: auto;
}

.woo-jew-gold-box__opts {
    margin-top: 12px;
}

.woo-jew-gold-box__opts summary {
    cursor: pointer;
    font-weight: 600;
}

.woo-jew-gold-box__opts code {
    direction: ltr;
    unicode-bidi: embed;
}
