/* آخرین قیمت‌ها — استایل اختصاصی صفحه /prices (دنس، حرفه‌ای، وفادار به قالب) */

/* ---------- نشان زنده + خط به‌روزرسانی ---------- */
.pr-live-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
  margin: 4px 0 0;
}
.pr-live {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 4px 12px;
  border-radius: 999px;
  border: 1px solid rgba(34, 197, 94, 0.35);
  background: rgba(34, 197, 94, 0.1);
  color: #4ade80;
  font-size: 0.82rem;
  font-weight: 700;
}
.pr-live i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #22c55e;
  animation: pr-pulse 1.8s ease-in-out infinite;
}
.pr-live:not(.is-on) { opacity: 0.45; }
@keyframes pr-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.55); }
  55% { box-shadow: 0 0 0 6px rgba(34, 197, 94, 0); }
}
.pr-updated-inline { color: var(--text-muted); font-size: 0.86rem; }

/* ---------- نوار متحرک قیمت‌ها ---------- */
.pr-ticker {
  border-block: 1px solid var(--border);
  background: var(--bg-elevated);
  overflow: hidden;
  white-space: nowrap;
  position: relative;
}
.pr-ticker::before,
.pr-ticker::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  width: 56px;
  z-index: 2;
  pointer-events: none;
}
.pr-ticker::before { inset-inline-start: 0; background: linear-gradient(90deg, var(--bg-elevated), transparent); }
.pr-ticker::after { inset-inline-end: 0; background: linear-gradient(-90deg, var(--bg-elevated), transparent); }
.pr-ticker-track {
  display: inline-flex;
  align-items: center;
  gap: 22px;
  padding: 9px 0;
  animation: pr-ticker-scroll 70s linear infinite;
  will-change: transform;
}
.pr-ticker:hover .pr-ticker-track { animation-play-state: paused; }
@keyframes pr-ticker-scroll {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}
.tk-item { display: inline-flex; align-items: baseline; gap: 7px; font-size: 0.88rem; }
.tk-name { color: var(--text-muted); }
.tk-value { font-weight: 700; direction: ltr; unicode-bidi: plaintext; }
.tk-chg { font-size: 0.8rem; font-weight: 700; }
.tk-sep { color: var(--text-dim); }

/* ---------- کارت‌های اصلی ---------- */
.pr-featured { padding: 30px 0 4px; }
.pr-cards {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 14px;
}
.pr-card {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.14);
  overflow: hidden;
  transition: transform 0.18s ease, border-color 0.18s ease;
}
.pr-card:hover { transform: translateY(-2px); border-color: var(--border-strong); }
.pr-card::before {
  content: "";
  position: absolute;
  inset-inline: 0;
  top: 0;
  height: 3px;
  background: linear-gradient(90deg, #b45309, #fde68a);
  opacity: 0.9;
}
.pr-card-label { color: var(--text-muted); font-size: 0.9rem; }
.pr-card-value {
  font-size: clamp(1.15rem, 1.9vw, 1.6rem);
  font-weight: 800;
  letter-spacing: -0.5px;
  direction: ltr;
  unicode-bidi: plaintext;
  text-align: right;
}
.pr-card-unit { color: var(--text-dim); font-size: 0.8rem; }
.pr-card-change { font-size: 0.86rem; min-height: 1.2em; }
.pr-spark { display: block; margin-top: 8px; height: 44px; opacity: 0.95; }
.pr-spark-svg { width: 100%; height: 100%; display: block; }

/* ---------- نوار ابزار: جستجو ---------- */
.pr-tables { padding: 22px 0 44px; }
.pr-toolbar {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
}
.pr-search {
  position: relative;
  flex: 1;
  max-width: 460px;
}
.pr-search svg {
  position: absolute;
  inset-inline-start: 13px;
  top: 50%;
  transform: translateY(-50%);
  width: 17px;
  height: 17px;
  color: var(--text-dim);
  pointer-events: none;
}
.pr-search input {
  width: 100%;
  padding: 10px 40px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text);
  font: inherit;
  font-size: 0.92rem;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.pr-search input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.pr-search input::placeholder { color: var(--text-dim); }
.pr-count { color: var(--text-dim); font-size: 0.85rem; }

/* ---------- شبکهٔ پنل‌ها ---------- */
.pr-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  align-items: start;
}
.pr-grid .mm-panel { margin: 0; padding: 16px 16px 10px; }
.pr-panel--wide { grid-column: 1 / -1; }
.pr-panel-title { margin: 0 0 10px; font-size: 1.02rem; display: flex; align-items: center; gap: 8px; }
.pr-panel-title::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, var(--border-strong), transparent);
}

/* ---------- ردیف‌ها ---------- */
.pr-rows { display: grid; grid-template-columns: 1fr; }
.pr-panel--wide .pr-rows { grid-template-columns: 1fr 1fr; column-gap: 26px; }
.pr-row { border-bottom: 1px solid var(--border); }
.pr-row:last-child { border-bottom: 0; }
.pr-row-main {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr) auto 14px;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 6px;
  background: none;
  border: 0;
  color: inherit;
  font: inherit;
  text-align: start;
  cursor: default;
  border-radius: var(--radius-sm);
  transition: background 0.12s ease;
}
.pr-row.is-expandable .pr-row-main { cursor: pointer; }
.pr-row.is-expandable .pr-row-main:hover { background: var(--bg-card-hover); }
.pr-name { font-weight: 600; font-size: 0.92rem; min-width: 0; }
.pr-code {
  display: inline-block;
  margin-inline-start: 7px;
  padding: 1px 7px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text-dim);
  font-size: 0.68rem;
  letter-spacing: 0.4px;
  direction: ltr;
  vertical-align: 1px;
}
.pr-unit { display: block; color: var(--text-dim); font-size: 0.74rem; margin-top: 1px; font-weight: 400; }
.pr-price { font-weight: 700; white-space: nowrap; direction: ltr; unicode-bidi: plaintext; text-align: end; font-size: 0.94rem; }
.pr-cur { font-style: normal; color: var(--text-dim); font-size: 0.72rem; font-weight: 400; }
.pr-chg { font-size: 0.84rem; white-space: nowrap; text-align: center; min-width: 64px; }
.pr-chev { color: var(--text-dim); font-size: 0.8rem; transition: transform 0.15s ease; text-align: center; }
.pr-row.is-open .pr-chev { transform: rotate(180deg); }
.pr-chev--none { visibility: hidden; }
.pr-empty { color: var(--text-dim); font-size: 0.88rem; padding: 14px 6px; }

/* ---------- جزئیات بازشو ---------- */
.pr-detail {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 22px;
  padding: 6px 12px 12px;
  margin: 0 4px 6px;
  border-inline-start: 2px solid var(--accent);
  background: var(--accent-soft);
  border-radius: var(--radius-sm);
}
.pr-d-item { color: var(--text-muted); font-size: 0.82rem; }
.pr-d-item b { color: var(--text); font-weight: 700; margin-inline-start: 5px; }
.pr-d-spark { width: 220px; height: 40px; }

/* ---------- رنگ تغییر ---------- */
.pr-up { color: #22c55e; }
.pr-down { color: #ef4444; }
.pr-flat { color: var(--text-dim); }

@keyframes pr-flash-up {
  0% { background: rgba(34, 197, 94, 0.28); }
  100% { background: transparent; }
}
@keyframes pr-flash-down {
  0% { background: rgba(239, 68, 68, 0.28); }
  100% { background: transparent; }
}
.pr-flash-up { animation: pr-flash-up 1.5s ease-out; border-radius: 8px; }
.pr-flash-down { animation: pr-flash-down 1.5s ease-out; border-radius: 8px; }

/* ---------- واکنش‌گرا ---------- */
@media (max-width: 1180px) {
  .pr-cards { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .pr-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .pr-grid { grid-template-columns: 1fr; }
  .pr-panel--wide .pr-rows { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .pr-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .pr-card-value { text-align: left; font-size: 1.05rem; }
  .pr-spark { height: 34px; }
  .pr-toolbar { flex-direction: column; align-items: stretch; }
  .pr-search { max-width: none; }
  .pr-row-main { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) auto 12px; gap: 7px; padding: 9px 4px; }
  .pr-chg { min-width: 52px; }
  .pr-d-spark { width: 100%; }
  .pr-ticker-track { animation-duration: 46s; }
}
