/* Break header min-height feedback: nav row stays compact; hero padding uses --arsam-header-h (nav+ticker). */
.arsam-header:has(.arsam-fx-ticker) {
  min-height: 0;
  height: auto;
}

.arsam-header:has(.arsam-fx-ticker) .arsam-header__inner {
  min-height: var(--arsam-header-nav-h, 82px);
}

/* Arsam FX ticker — independent centered strip, responsive */
.arsam-fx-ticker {
  --arsam-fx-bg: rgba(7, 27, 43, 0.94);
  --arsam-fx-gold: #d3aa4f;
  --arsam-fx-text: #f5f2e9;
  --arsam-fx-muted: #aab5c1;
  --arsam-fx-line: rgba(211, 170, 79, 0.45);
  --arsam-fx-sep: rgba(170, 181, 193, 0.28);
  box-sizing: border-box;
  width: 100%;
  background: transparent;
  border: 0;
  color: var(--arsam-fx-text);
  padding: 0 0 10px;
  /* Keep below nav flyouts (ابزار آنلاین). Header itself is z-index 1000. */
  z-index: 1;
  position: relative;
  display: flex;
  justify-content: center;
}

.arsam-fx-ticker *,
.arsam-fx-ticker *::before,
.arsam-fx-ticker *::after {
  box-sizing: border-box;
}

.arsam-fx-ticker__inner {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: nowrap;
  gap: 14px;
  width: var(--arsam-fx-strip-w, max-content);
  max-width: min(100% - 32px, var(--arsam-container, 1200px));
  margin-inline: auto;
  min-height: 48px;
  padding: 8px 22px;
  background: var(--arsam-fx-bg);
  border: 1px solid var(--arsam-fx-line);
  border-radius: 12px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.22);
  overflow: hidden;
}

.arsam-fx-ticker__label {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  white-space: nowrap;
  font-size: 12px;
  font-weight: 600;
  color: var(--arsam-fx-gold);
  line-height: 1.2;
  padding-inline-end: 2px;
}

.arsam-fx-ticker__label-unit {
  color: var(--arsam-fx-muted);
  font-weight: 500;
}

.arsam-fx-ticker__track {
  flex: 0 1 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: nowrap;
  gap: 0;
  min-width: 0;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.arsam-fx-ticker__track::-webkit-scrollbar {
  display: none;
  height: 0;
}

.arsam-fx-ticker__label,
.arsam-fx-ticker__meta {
  flex-shrink: 0;
}

.arsam-fx-ticker__time {
  display: none !important;
}

.arsam-fx-ticker__item {
  position: relative;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
}

.arsam-fx-ticker__item + .arsam-fx-ticker__item::before {
  content: "";
  display: block;
  width: 1px;
  height: 18px;
  margin-inline: 12px;
  background: var(--arsam-fx-sep);
  flex: 0 0 auto;
}

.arsam-fx-ticker__chip {
  appearance: none;
  border: 0;
  background: transparent;
  color: inherit;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 4px 2px;
  margin: 0;
  cursor: pointer;
  font: inherit;
  line-height: 1.2;
  white-space: nowrap;
}

.arsam-fx-ticker__chip:focus-visible {
  outline: 2px solid var(--arsam-fx-gold);
  outline-offset: 2px;
  border-radius: 4px;
}

.arsam-fx-ticker__flag {
  width: 20px;
  height: 14px;
  object-fit: cover;
  border-radius: 2px;
  flex: 0 0 auto;
  display: block;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.12);
}

.arsam-fx-ticker__name {
  font-size: 12.5px;
  color: var(--arsam-fx-text);
  opacity: 0.92;
  flex: 0 0 auto;
}

.arsam-fx-ticker__price {
  display: inline-block;
  min-width: 5.5ch;
  font-size: 14px;
  font-weight: 600;
  color: var(--arsam-fx-text);
  font-variant-numeric: tabular-nums;
  direction: ltr;
  unicode-bidi: isolate;
  text-align: left;
  flex: 0 0 auto;
  letter-spacing: 0.01em;
}

.arsam-fx-ticker__item[data-status="delayed"] .arsam-fx-ticker__price,
.arsam-fx-ticker__item[data-status="archived"] .arsam-fx-ticker__price {
  color: #e8c97a;
}

.arsam-fx-ticker__item[data-status="empty"] .arsam-fx-ticker__price {
  color: var(--arsam-fx-muted);
  min-width: 2ch;
}

.arsam-fx-ticker__tip {
  position: absolute;
  top: calc(100% + 6px);
  inset-inline-start: 0;
  z-index: 20;
  max-width: min(320px, 80vw);
  padding: 8px 10px;
  background: #0a2233;
  color: var(--arsam-fx-text);
  border: 1px solid var(--arsam-fx-line);
  border-radius: 6px;
  font-size: 11px;
  line-height: 1.55;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35);
  white-space: normal;
}

.arsam-fx-ticker__tip[hidden] {
  display: none !important;
}

.arsam-fx-ticker__meta {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.arsam-fx-ticker__status {
  font-size: 11px;
  color: #e8c97a;
  white-space: nowrap;
}

.arsam-fx-ticker__status:empty,
.arsam-fx-ticker__status[hidden] {
  display: none !important;
}

.arsam-fx-ticker[data-status="empty"] .arsam-fx-ticker__status,
.arsam-fx-ticker[data-status="error"] .arsam-fx-ticker__status {
  color: #f0d9a0;
}

.arsam-fx-ticker[data-status="loading"] .arsam-fx-ticker__price {
  opacity: 0.55;
}

/* —— Laptop / large tablet landscape —— */
@media (max-width: 1200px) {
  .arsam-fx-ticker__inner {
    gap: 12px;
    padding: 8px 18px;
  }

  .arsam-fx-ticker__item + .arsam-fx-ticker__item::before {
    margin-inline: 10px;
  }

  .arsam-fx-ticker__name {
    font-size: 12px;
  }

  .arsam-fx-ticker__price {
    font-size: 13.5px;
  }
}

/*
 * Compact viewports: keep header in document flow (not absolute) so the FX strip
 * scrolls away with the page and does not overlay section text.
 */
@media (max-width: 992px) {
  body.arsam-home-v2 .arsam-header {
    position: relative !important;
    top: auto !important;
    background: var(--arsam-navy-950, #03172f) !important;
    background-color: var(--arsam-navy-950, #03172f) !important;
    box-shadow: none !important;
  }

  body.arsam-home-v2 .arsam-header.is-scrolled {
    position: relative !important;
    background: var(--arsam-navy-950, #03172f) !important;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.22) !important;
  }

  /* Header already occupies height in-flow — do not pad hero by full header again. */
  body.home.arsam-home-v2 .arsam-home-hero__inner,
  body.arsam-home-v2 .arsam-home-hero__inner {
    padding-top: clamp(16px, 3vw, 28px) !important;
    padding-bottom: clamp(40px, 7vw, 64px) !important;
  }
}

/* Marquee (only when JS adds .is-marquee on overflow + compact viewport) */
.arsam-fx-ticker.is-marquee .arsam-fx-ticker__track {
  overflow: hidden;
  /* Physical LTR so translate3d(-50%↔0) keeps a rail in the viewport. */
  direction: ltr;
  justify-content: flex-start;
  mask-image: linear-gradient(90deg, transparent 0, #000 12px, #000 calc(100% - 12px), transparent 100%);
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 12px, #000 calc(100% - 12px), transparent 100%);
}

.arsam-fx-ticker__marquee {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  width: max-content;
  will-change: transform;
}

.arsam-fx-ticker.is-marquee .arsam-fx-ticker__marquee,
.arsam-fx-ticker.is-marquee .arsam-fx-ticker__rail {
  direction: ltr;
}

.arsam-fx-ticker.is-marquee .arsam-fx-ticker__marquee {
  animation: arsam-fx-marquee-ltr var(--arsam-fx-marquee-dur, 28s) linear infinite;
}

.arsam-fx-ticker.is-marquee.is-marquee-paused .arsam-fx-ticker__marquee,
.arsam-fx-ticker.is-marquee:hover .arsam-fx-ticker__marquee,
.arsam-fx-ticker.is-marquee:focus-within .arsam-fx-ticker__marquee {
  animation-play-state: paused;
}

.arsam-fx-ticker__rail {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  flex: 0 0 auto;
}

.arsam-fx-ticker__rail + .arsam-fx-ticker__rail {
  margin-inline-start: 12px;
}

.arsam-fx-ticker__rail + .arsam-fx-ticker__rail::before {
  content: "";
  display: block;
  width: 1px;
  height: 18px;
  margin-inline-end: 12px;
  background: var(--arsam-fx-sep);
  flex: 0 0 auto;
  align-self: center;
}

/* Move strip left → right (prices cycle continuously). */
@keyframes arsam-fx-marquee-ltr {
  from {
    transform: translate3d(-50%, 0, 0);
  }
  to {
    transform: translate3d(0, 0, 0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .arsam-fx-ticker.is-marquee .arsam-fx-ticker__marquee {
    animation: none;
  }

  .arsam-fx-ticker.is-marquee .arsam-fx-ticker__track {
    overflow-x: auto;
    mask-image: none;
    -webkit-mask-image: none;
  }
}

/* —— Tablet —— */
@media (max-width: 992px) {
  .arsam-fx-ticker {
    padding-bottom: 8px;
  }

  .arsam-fx-ticker__inner {
    width: min(100% - 24px, var(--arsam-container, 1200px));
    max-width: min(100% - 24px, var(--arsam-container, 1200px));
    gap: 10px;
    min-height: 46px;
    padding: 7px 16px;
    border-radius: 10px;
    justify-content: flex-start;
  }

  .arsam-fx-ticker__track {
    flex: 1 1 auto;
    justify-content: flex-start;
  }

  .arsam-fx-ticker__label {
    font-size: 11.5px;
  }

  .arsam-fx-ticker__chip {
    gap: 6px;
  }

  .arsam-fx-ticker__name {
    font-size: 11.5px;
  }

  .arsam-fx-ticker__price {
    font-size: 13px;
    min-width: 5ch;
  }

  .arsam-fx-ticker__item + .arsam-fx-ticker__item::before {
    margin-inline: 9px;
  }
}

/* —— Mobile / small tablet —— */
@media (max-width: 768px) {
  .arsam-fx-ticker {
    padding-bottom: 6px;
  }

  .arsam-fx-ticker__inner {
    width: calc(100% - 16px);
    max-width: calc(100% - 16px);
    min-height: 44px;
    padding: 6px 14px;
    gap: 8px;
    border-radius: 10px;
  }

  .arsam-fx-ticker__label {
    font-size: 11px;
  }

  .arsam-fx-ticker__label-unit {
    display: none;
  }

  .arsam-fx-ticker__chip {
    gap: 5px;
    padding: 3px 1px;
  }

  .arsam-fx-ticker__flag {
    width: 18px;
    height: 13px;
  }

  .arsam-fx-ticker__name {
    font-size: 11px;
  }

  .arsam-fx-ticker__price {
    font-size: 12.5px;
    min-width: 4.5ch;
  }

  .arsam-fx-ticker__item + .arsam-fx-ticker__item::before {
    margin-inline: 8px;
    height: 16px;
  }
}

/* —— Narrow phones —— */
@media (max-width: 420px) {
  .arsam-fx-ticker__inner {
    width: calc(100% - 12px);
    max-width: calc(100% - 12px);
    padding: 6px 12px;
    border-radius: 9px;
  }

  .arsam-fx-ticker__label {
    font-size: 10.5px;
  }

  .arsam-fx-ticker__name {
    font-size: 10.5px;
  }

  .arsam-fx-ticker__price {
    font-size: 12px;
  }

  .arsam-fx-ticker__item + .arsam-fx-ticker__item::before {
    margin-inline: 7px;
  }
}
