/* «نمودار قیمت تب‌دار» (.wpht-ptc) — every colour is a variable that this
   widget's own style controls set on its own wrapper; !important keeps
   theme / Elementor-kit button styles (button, button:hover…) off it. */
.wpht-ptc {
	--wpht-ptc-bg: #10244a;
	--wpht-ptc-radius: 18px;
	--wpht-ptc-height: 250px;
	--wpht-ptc-accent: #f5b42a;
	--wpht-ptc-on-accent: #1b2234;
	--wpht-ptc-tab-bg: rgba(255, 255, 255, 0.08);
	--wpht-ptc-tab-color: #e6eaf2;
	--wpht-ptc-tab-hover-bg: rgba(255, 255, 255, 0.16);
	--wpht-ptc-tab-hover-color: #ffffff;
	--wpht-ptc-tab-radius: 8px;
	--wpht-ptc-muted: #a9b4c8;
	--wpht-ptc-price: #ffffff;
	--wpht-ptc-unit: #a9b4c8;
	--wpht-ptc-note: #8c98ae;
	--wpht-ptc-line: #f5b42a;
	--wpht-ptc-line-width: 2;
	--wpht-ptc-fill-opacity: 0.45;
	--wpht-ptc-grid: rgba(255, 255, 255, 0.07);
	--wpht-ptc-axis: #8c98ae;
	--wpht-ptc-axis-size: 11px;
	--wpht-ptc-tip-bg: #ffffff;
	--wpht-ptc-tip-color: #1b2234;
	--wpht-ptc-range-bg: rgba(255, 255, 255, 0.08);
	--wpht-ptc-range-color: #e6eaf2;
	--wpht-ptc-up: #22c55e;
	--wpht-ptc-down: #ef4444;

	position: relative;
	box-sizing: border-box;
	width: 100%;
	max-width: 100%;
	min-width: 0;
	overflow: hidden;
	direction: rtl;
	background: var(--wpht-ptc-bg);
	border-radius: var(--wpht-ptc-radius);
	padding: 18px;
	color: var(--wpht-ptc-price);
	box-shadow: 0 12px 32px rgba(10, 20, 45, 0.25);
}
.wpht-ptc *, .wpht-ptc *::before, .wpht-ptc *::after { box-sizing: border-box; }
.wpht-ptc-empty { margin: 0; padding: 30px 10px; text-align: center; color: var(--wpht-ptc-muted); }

/* ---- Tabs ---- */
.wpht-ptc-tabs { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-start; margin-bottom: 16px; }
.wpht-ptc .wpht-ptc-tab,
.wpht-ptc .wpht-ptc-range {
	-webkit-appearance: none; appearance: none;
	display: inline-flex; align-items: center; justify-content: center;
	min-height: 0; margin: 0; width: auto;
	font: inherit; font-size: 13px; font-weight: 600; line-height: 1.5; letter-spacing: normal; text-transform: none !important;
	border: 0 !important; box-shadow: none !important; text-decoration: none !important;
	cursor: pointer; white-space: nowrap;
	transition: background-color .15s ease, color .15s ease;
	-webkit-tap-highlight-color: transparent;
}
.wpht-ptc .wpht-ptc-tab {
	padding: 7px 14px;
	border-radius: var(--wpht-ptc-tab-radius) !important;
	background: var(--wpht-ptc-tab-bg) !important;
	color: var(--wpht-ptc-tab-color) !important;
}
.wpht-ptc .wpht-ptc-tab:hover,
.wpht-ptc .wpht-ptc-tab:focus { background: var(--wpht-ptc-tab-hover-bg) !important; color: var(--wpht-ptc-tab-hover-color) !important; }
.wpht-ptc .wpht-ptc-tab.is-active,
.wpht-ptc .wpht-ptc-tab.is-active:hover,
.wpht-ptc .wpht-ptc-tab.is-active:focus { background: var(--wpht-ptc-accent) !important; color: var(--wpht-ptc-on-accent) !important; }
.wpht-ptc .wpht-ptc-tab:focus-visible,
.wpht-ptc .wpht-ptc-range:focus-visible { outline: 2px solid var(--wpht-ptc-accent); outline-offset: 2px; }

/* ---- Price ---- */
.wpht-ptc-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.wpht-ptc-price { min-width: 0; }
.wpht-ptc-label { color: var(--wpht-ptc-muted); font-size: 13px; line-height: 1.6; }
.wpht-ptc-figure { display: flex; align-items: baseline; flex-wrap: wrap; gap: 6px; margin-top: 2px; }
.wpht-ptc-value { color: var(--wpht-ptc-price); font-size: 30px; font-weight: 800; line-height: 1.25; font-variant-numeric: tabular-nums; }
.wpht-ptc-unit { color: var(--wpht-ptc-unit); font-size: 12px; }
.wpht-ptc-note { color: var(--wpht-ptc-note); font-size: 11.5px; line-height: 1.6; text-align: end; padding-top: 22px; flex: 0 1 auto; }

/* ---- Chart ---- */
.wpht-ptc-chart { position: relative; width: 100%; height: var(--wpht-ptc-height); min-width: 0; touch-action: pan-y; user-select: none; -webkit-user-select: none; }
.wpht-ptc-chart svg { display: block; width: 100%; height: 100%; overflow: visible; }
.wpht-ptc-chart .wpht-ptc-grid { stroke: var(--wpht-ptc-grid); stroke-width: 1; shape-rendering: crispEdges; }
.wpht-ptc-chart .wpht-ptc-axis { fill: var(--wpht-ptc-axis); font-size: var(--wpht-ptc-axis-size); font-family: inherit; }
.wpht-ptc-chart .wpht-ptc-line { fill: none; stroke: var(--wpht-ptc-line); stroke-width: var(--wpht-ptc-line-width); stroke-linejoin: round; stroke-linecap: round; }
.wpht-ptc-chart .wpht-ptc-cross { stroke: var(--wpht-ptc-muted); stroke-width: 1; stroke-dasharray: 3 3; opacity: .7; }
.wpht-ptc-chart .wpht-ptc-dot { fill: var(--wpht-ptc-line); stroke: var(--wpht-ptc-bg); stroke-width: 2; }
.wpht-ptc-chart-msg { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; text-align: center; padding: 10px; color: var(--wpht-ptc-muted); font-size: 13px; }
.wpht-ptc-tip {
	position: absolute; top: 0; left: 0; z-index: 2; pointer-events: none;
	background: var(--wpht-ptc-tip-bg); color: var(--wpht-ptc-tip-color);
	border-radius: 8px; padding: 6px 10px; font-size: 12px; line-height: 1.6; white-space: nowrap; text-align: center;
	box-shadow: 0 6px 18px rgba(0, 0, 0, .25);
	opacity: 0; transition: opacity .12s ease;
}
.wpht-ptc-tip.is-visible { opacity: 1; }
.wpht-ptc-tip b { display: block; font-size: 13.5px; font-variant-numeric: tabular-nums; }

/* ---- Footer: ranges + change ---- */
.wpht-ptc-foot { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px 14px; margin-top: 14px; }
.wpht-ptc-ranges { display: flex; flex-wrap: wrap; gap: 6px; }
.wpht-ptc .wpht-ptc-range {
	padding: 6px 12px; font-size: 12.5px;
	border-radius: var(--wpht-ptc-tab-radius) !important;
	background: var(--wpht-ptc-range-bg) !important;
	color: var(--wpht-ptc-range-color) !important;
}
.wpht-ptc .wpht-ptc-range:hover,
.wpht-ptc .wpht-ptc-range:focus { background: var(--wpht-ptc-tab-hover-bg) !important; color: var(--wpht-ptc-tab-hover-color) !important; }
.wpht-ptc .wpht-ptc-range.is-active,
.wpht-ptc .wpht-ptc-range.is-active:hover,
.wpht-ptc .wpht-ptc-range.is-active:focus { background: var(--wpht-ptc-range-active-bg, var(--wpht-ptc-accent)) !important; color: var(--wpht-ptc-range-active-color, var(--wpht-ptc-on-accent)) !important; }
.wpht-ptc-change { font-size: 13px; font-weight: 700; color: var(--wpht-ptc-muted); white-space: nowrap; }
.wpht-ptc-change.is-up { color: var(--wpht-ptc-up); }
.wpht-ptc-change.is-down { color: var(--wpht-ptc-down); }

@media (max-width: 480px) {
	.wpht-ptc { padding: 14px; }
	.wpht-ptc-tabs { gap: 5px; margin-bottom: 12px; }
	.wpht-ptc .wpht-ptc-tab { padding: 6px 11px; font-size: 12.5px; }
	.wpht-ptc-value { font-size: 26px; }
	.wpht-ptc-note { padding-top: 0; font-size: 11px; }
	.wpht-ptc-head { flex-direction: column; gap: 4px; }
	.wpht-ptc .wpht-ptc-range { padding: 6px 10px; font-size: 12px; }
	.wpht-ptc-foot { gap: 8px; }
}
