/*
 * نوارِ قیمتِ لحظه‌ای بالای هدر (HaghaniTheme 1.58.0؛ از hg-chrome.css جدا شد تا روی قالبِ «صفحه اصلی جدید» هم بار شود).
 * مارکاپ: partials/header/price-strip.php. بارشده از hg_price_strip_enqueue() در inc/theme-settings.php.
 * باریک (۳۲)، کم‌رنگ؛ کلِ نوار یک دکمه که جدولِ قیمت‌های dm-gold را باز می‌کند. یک سو قیمت‌ها + فلش، سوی دیگر زمان.
 * نقطهٔ سبزِ تپنده = قیمتِ تازه؛ کهنه = کهربایی و بی‌تپش.
 */
.hg-price-strip,
.hg-price-strip *,
.hg-price-strip *::before,
.hg-price-strip *::after { box-sizing: border-box; }
.hg-price-strip {
    /* 1.59.1: ظرفِ تمام‌عرض فقط زمینه است؛ محتوا (inner) وسط و حداکثر ۱۴۴۰، هم‌لبه با تاپ‌بارِ هدر. */
    display: flex;
    justify-content: center;
    direction: rtl;
    background: var(--c-bg-soft, #faf6f8);
    border-block-end: 1px solid var(--c-line, #ece4e8);
    font-size: 12px;
    line-height: 1.4;
    color: var(--c-ink-soft, #5d5459);
}
.hg-price-strip__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex: 1 1 auto;
    width: 100%;
    max-width: 1440px;
    min-height: 32px;
    margin: 0;
    padding: 0 var(--hg-gutter, 16px);
    border: 0;
    border-radius: 0;
    background: none;
    box-shadow: none;
    font: inherit;
    color: inherit;
    text-align: start;
}
button.hg-price-strip__inner { cursor: pointer; }
button.hg-price-strip__inner:focus-visible { outline: 2px solid var(--c-gold, #911a56); outline-offset: -2px; }
.hg-price-strip__main { display: flex; align-items: center; gap: 10px; min-width: 0; }
.hg-price-strip__list { display: flex; align-items: center; gap: 16px; min-width: 0; }
.hg-price-strip__item { display: inline-flex; align-items: baseline; gap: 6px; white-space: nowrap; }
.hg-price-strip__item + .hg-price-strip__item { padding-inline-start: 16px; border-inline-start: 1px solid var(--c-line, #ece4e8); }
.hg-price-strip__price { font-weight: 700; color: var(--c-ink, #2a2226); font-variant-numeric: tabular-nums; }
.hg-price-strip__unit { font-size: 11px; white-space: nowrap; }
/* فلشِ «جلو»: در راست‌به‌چپ جلو یعنی چپ؛ SVG به سمتِ چپ کشیده شده و در LTR آینه می‌شود.
   1.58.0 (بازبینی): مینیمال — زمینهٔ بسیار محو از رنگِ برند، خطِ نازک‌تر، کمی کم‌رنگ؛ هاور پررنگ‌ترش می‌کند. */
.hg-price-strip__arrow {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: color-mix(in srgb, var(--c-gold, #911a56) 8%, transparent);
    color: var(--c-gold, #911a56);
    opacity: .75;
    transition: transform .2s ease, opacity .2s ease, background .2s ease;
}
.hg-price-strip__arrow svg { width: 10px; height: 10px; display: block; stroke-width: 1.6; }
button.hg-price-strip__inner:hover .hg-price-strip__arrow { opacity: 1; background: color-mix(in srgb, var(--c-gold, #911a56) 14%, transparent); }
[dir="ltr"] .hg-price-strip__arrow svg { transform: scaleX(-1); }
button.hg-price-strip__inner:hover .hg-price-strip__arrow { transform: translateX(-3px); }
.hg-price-strip__pill { display: none; }
.hg-price-strip__time { display: inline-flex; align-items: center; gap: 6px; flex: 0 0 auto; white-space: nowrap; font-size: 11px; }
.hg-price-strip__dot { width: 8px; height: 8px; border-radius: 50%; background: #1f9d55; box-shadow: 0 0 0 0 rgba(31, 157, 85, .45); animation: hg-live-pulse 2s ease-out infinite; }
.hg-price-strip.is-stale .hg-price-strip__dot { background: #c98a0b; animation: none; }
.hg-price-strip.is-stale .hg-price-strip__time { color: #8a5d00; }
@keyframes hg-live-pulse {
    0% { box-shadow: 0 0 0 0 rgba(31, 157, 85, .45); }
    70% { box-shadow: 0 0 0 6px rgba(31, 157, 85, 0); }
    100% { box-shadow: 0 0 0 0 rgba(31, 157, 85, 0); }
}
/* دسکتاپ (همان نقطهٔ شکستِ ۹۹۲ هدر): بی‌فاصلهٔ کناری، مثلِ .hnd-topbar در homepage-new-design-header.css. */
@media (min-width: 993px) {
    .hg-price-strip__inner { padding-inline: 0; }
}
@media (max-width: 767.98px) {
    /* موبایل: قیمت‌ها اسکرولِ افقیِ بی‌نوار، زمان ثابت. */
    .hg-price-strip { font-size: 11px; }
    .hg-price-strip__inner { gap: 8px; }
    .hg-price-strip__main { gap: 6px; }
    .hg-price-strip__list { gap: 8px; overflow-x: auto; scrollbar-width: none; }
    .hg-price-strip__list::-webkit-scrollbar { display: none; }
    .hg-price-strip__item { gap: 4px; }
    .hg-price-strip__item + .hg-price-strip__item { padding-inline-start: 8px; }
    .hg-price-strip__unit,
    .hg-price-strip__time { font-size: 10px; }
    .hg-price-strip__arrow { width: 18px; height: 18px; }
    /* 1.64.4: زمان دو خط: بالا «به‌روزرسانی:» خیلی ریز، زیرش «N دقیقه پیش»؛ دو خط در همان ۳۲ پیکسل جا می‌شوند. */
    /* 1.64.5: موبایل: به‌جای نرخِ نقره (و فلشِ جدا) یک «دکمهٔ» ریز و مینیمال؛ کلِ نوار همچنان یک دکمه است. */
    .hg-price-strip__item--silver { display: none; }
    .hg-price-strip__arrow { display: none; }
    .hg-price-strip__pill {
        display: inline-flex; align-items: center; gap: 3px; flex: 0 0 auto; white-space: nowrap;
        padding: 2px 8px; border-radius: 999px; font-size: 10px; line-height: 1.4;
        color: var(--c-gold, #911a56);
        border: 1px solid color-mix(in srgb, var(--c-gold, #911a56) 35%, transparent);
        background: color-mix(in srgb, var(--c-gold, #911a56) 6%, transparent);
    }
    .hg-price-strip__pill svg { width: 8px; height: 8px; stroke-width: 2; }
    [dir="ltr"] .hg-price-strip__pill svg { transform: scaleX(-1); }
    .js-hg-ago { display: inline-flex; flex-direction: column; align-items: center; line-height: 1.15; }
    .hg-price-strip__ago-label { display: block; font-size: 8px; line-height: 1.1; opacity: .75; }
    /* 1.73.1: دکمهٔ «نرخ‌های خرید و فروش» همیشه کامل دیده شود: قیمت‌ها و زمان کوچک‌تر، دکمه به لبهٔ فهرست می‌چسبد (sticky) و روی قیمت‌های اسکرول‌شده می‌نشیند، با موجِ برقی. */
    .hg-price-strip__inner { gap: 6px; }
    .hg-price-strip__main { flex: 1 1 auto; }
    .hg-price-strip__list { gap: 6px; flex: 1 1 auto; }
    .hg-price-strip__item { gap: 3px; }
    .hg-price-strip__item + .hg-price-strip__item { padding-inline-start: 6px; }
    .hg-price-strip__name { font-size: 10px; }
    .hg-price-strip__price { font-size: 10.5px; }
    .hg-price-strip__unit { font-size: 9px; }
    .hg-price-strip__time { gap: 4px; font-size: 9px; }
    .hg-price-strip__ago-label { font-size: 7px; }
    .hg-price-strip__pill {
        position: sticky; inset-inline-end: 0; z-index: 1; overflow: hidden; isolation: isolate;
        margin-inline-start: auto; padding: 3px 9px; font-weight: 700; font-size: 10px;
        background-color: var(--c-bg-soft, #faf6f8);
        background-image: linear-gradient(color-mix(in srgb, var(--c-gold, #911a56) 10%, transparent), color-mix(in srgb, var(--c-gold, #911a56) 10%, transparent));
        animation: hg-pill-zap 2.4s ease-out infinite;
    }
    .hg-price-strip__pill::after {
        content: ""; position: absolute; inset-block: 0; inset-inline-start: -60%; width: 45%; z-index: -1;
        background: linear-gradient(100deg, transparent, color-mix(in srgb, var(--c-gold, #911a56) 45%, #fff) 50%, transparent);
        transform: skewX(-20deg);
        animation: hg-pill-wave 2.4s ease-in-out infinite;
    }
}
@keyframes hg-pill-zap {
    0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--c-gold, #911a56) 55%, transparent); }
    60%, 100% { box-shadow: 0 0 0 7px color-mix(in srgb, var(--c-gold, #911a56) 0%, transparent); }
}
@keyframes hg-pill-wave {
    0% { inset-inline-start: -60%; opacity: 0; }
    15% { opacity: 1; }
    70%, 100% { inset-inline-start: 115%; opacity: 0; }
}
@media (max-width: 420px) {
    /* گوشیِ باریک: «طلای» پنهان تا هر سه قیمت بی‌اسکرول جا شوند (برچسبِ زمان حالا دو خطی است و جا می‌گیرد). */
    .hg-price-strip__word { display: none; }
}
@media (prefers-reduced-motion: reduce) {
    .hg-price-strip__dot,
    .hg-price-strip__pill,
    .hg-price-strip__pill::after { animation: none; }
    .hg-price-strip__arrow { transition: none; }
}
