/* نقشه قیمت — رنگ‌ها و فونت هم‌راستا با قالب ایران ای ترید */
.itpm {
  --itpm-primary: #4964af;     /* آبی اصلی سایت */
  --itpm-primary-dark: #2b4c96;
  --itpm-navy: #0f172b;        /* عنوان‌ها و هاور کشور */
  --itpm-text: #241e20;
  --itpm-muted: #8f8f8f;
  --itpm-bg: #fbfbfb;          /* پس‌زمینه (اقیانوس) */
  --itpm-land: #e3e6ee;        /* کشورهای بدون قیمت */
  --itpm-tint: #e8ecf8;
  --itpm-surface: #ffffff;
  --itpm-soft: #f8f8f8;
  --itpm-line: rgba(85, 95, 123, .18);
  --itpm-up: #16a34a;
  --itpm-up-bg: rgba(34, 197, 94, .12);
  --itpm-down: #d93025;
  --itpm-down-bg: rgba(217, 48, 37, .1);
  --itpm-shadow: 0 10px 30px rgba(15, 23, 43, .08);
  --itpm-font: inherit;

  direction: rtl;
  font-family: var(--itpm-font);
  color: var(--itpm-text);
  background: var(--itpm-bg);
  display: grid;
  gap: 20px;
}

/* Header — same pattern as "بازار زنده" on the home page */
.itpm-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; }
.itpm-head-title { display: flex; align-items: center; gap: 12px; }
.itpm-head-icon {
  width: 44px; height: 44px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--itpm-primary); color: #fff;
  box-shadow: -2px -3.4px 4px 1px rgba(31, 80, 154, .37);
}
.itpm-head-icon svg { width: 24px; height: 24px; }
.itpm-head h3 { margin: 0; font-size: 24px; font-weight: 800; color: var(--itpm-navy); text-wrap: balance; }
.itpm-head-meta { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.itpm-head-sub { font-size: 13.5px; color: var(--itpm-muted); }
.itpm-updated { font-size: 20px; font-weight: 700; color: var(--itpm-primary); }

/* Map */
.itpm-map { position: relative; direction: ltr; }
.itpm .svgMap-wrapper,
.itpm .svgMap-container,
.itpm .svgMap-map-container,
.itpm .svgMap-map-wrapper { background: transparent; }
.itpm .svgMap-map-wrapper { padding-top: 50%; }
.itpm .svgMap-country {
  fill: var(--itpm-land) !important;
  stroke: var(--itpm-bg);
  stroke-width: .6;
  cursor: pointer;
  transition: fill .15s ease;
}
.itpm .svgMap-country.itpm-priced { fill: var(--itpm-primary) !important; }
.itpm .svgMap-country:hover,
.itpm .svgMap-country.svgMap-active {
  fill: var(--itpm-navy) !important;
  stroke: var(--itpm-navy) !important;
  stroke-width: 1.5 !important;
}
.itpm .svgMap-map-controls-wrapper { right: auto; bottom: auto; top: 10px; left: 10px; box-shadow: var(--itpm-shadow); border-radius: 10px; overflow: hidden; }
.itpm .svgMap-control-button { background: var(--itpm-surface); }
.itpm .svgMap-control-button:hover { background: var(--itpm-tint); }

/* Tooltip (svgMap adds it to <body>, so it is not scoped under .itpm) */
.svgMap-tooltip.itpm-tooltip {
  direction: rtl;
  text-align: right;
  font-family: var(--itpm-tip-font, inherit);
  color: #241e20;
  background: #fff;
  border: 1px solid rgba(85, 95, 123, .18) !important;
  border-radius: 14px;
  box-shadow: 0 10px 30px rgba(15, 23, 43, .12);
  margin-top: -10px;
}
.svgMap-tooltip.itpm-tooltip.svgMap-tooltip-flipped { margin-top: 10px; }
.svgMap-tooltip.itpm-tooltip .svgMap-tooltip-pointer { display: none; }
.itpm-tip { padding: 12px 14px; min-width: 230px; display: grid; gap: 8px; }
.itpm-tip-head { display: flex; align-items: center; gap: 8px; }
.itpm-tip-flag { width: 22px; height: 16px; object-fit: cover; border-radius: 3px; box-shadow: 0 0 0 1px rgba(85, 95, 123, .18); }
.itpm-tip-country { font-weight: 700; font-size: 15px; color: #0f172b; }
.itpm-tip-line {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  background: #f8f8f8; border-radius: 8px; padding: 6px 10px; font-size: 13px;
}
.itpm-tip-label { color: #8f8f8f; font-size: 11.5px; font-weight: 500; }
.itpm-tip-value { font-weight: 700; color: #0f172b; }
.itpm-tip-price { font-size: 18px; font-weight: 800; color: #0f172b; }
.itpm-tip-unit { font-size: 11.5px; color: #8f8f8f; font-weight: 500; margin-right: 4px; }
.itpm-tip-change {
  font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 999px;
  color: #555; background: #f0f0f0; white-space: nowrap;
}
.itpm-tip-change.is-up { color: #16a34a; background: rgba(34, 197, 94, .12); }
.itpm-tip-change.is-down { color: #d93025; background: rgba(217, 48, 37, .1); }
.itpm-tip-pack { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: #555; }
.itpm-tip-pack svg { width: 18px; height: 18px; flex: none; color: #4964af; }
.itpm-tip-note { font-size: 12px; color: #8f8f8f; }
.itpm-tip-contact { font-size: 13px; color: #4964af; font-weight: 600; }

/* Legend */
.itpm-legend {
  /* bottom-left sits over the Pacific, where no priced country is hidden */
  position: absolute; left: 20px; bottom: 20px; z-index: 3;
  direction: rtl;
  background: var(--itpm-surface);
  border: 1px solid var(--itpm-line);
  border-radius: 18px;
  box-shadow: var(--itpm-shadow);
  padding: 16px 18px;
  display: grid; gap: 12px;
  min-width: 190px;
}
.itpm-legend h4 { margin: 0; font-size: 15px; font-weight: 800; color: var(--itpm-navy); }
.itpm-legend ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.itpm-legend li { display: flex; align-items: center; gap: 10px; font-size: 13.5px; }
.itpm-legend li svg { width: 22px; height: 22px; flex: none; color: var(--itpm-primary); }
.itpm-legend-keys { display: flex; gap: 14px; font-size: 12px; color: var(--itpm-muted); border-top: 1px solid var(--itpm-line); padding-top: 10px; }
.itpm-legend-keys span { display: inline-flex; align-items: center; gap: 6px; }
.itpm-legend-keys i { width: 12px; height: 12px; border-radius: 4px; display: inline-block; }

.itpm-empty { margin: 0; text-align: center; color: var(--itpm-muted); font-size: 14px; }

@media (max-width: 760px) {
  .itpm-head h3 { font-size: 20px; }
  .itpm-updated { font-size: 16px; }
  .itpm-legend { position: static; margin-top: 12px; min-width: 0; }
  .itpm-legend ul { grid-template-columns: 1fr 1fr; }
}

/* Reserve the map's final height before svgMap runs, so content below does not jump (CLS). */
.itpm-map:empty { padding-top: 50%; }
@media (max-width: 760px) {
  .itpm-map:empty { padding-top: calc(50% + 176px); }
}

/* English (LTR) site: reading direction and text contrast (WCAG AA). */
.itpm[dir="ltr"] { --itpm-muted: #636363; }
.itpm[dir="ltr"] .itpm-legend { direction: ltr; }
