/* Combined Price History block — explicit spacing, immune to expand/collapse jitter. */
.chspex-price-block .content > .chspex-retail-history-wrapper {
	margin-top: 0;
	margin-bottom: 0;
}

.chspex-price-block .chspex-retail-history-wrapper > .chspex-retail-history-table {
	margin-bottom: 0;
}

.chspex-price-block .chspex-price-chart-wrapper {
	margin-top: 20px;
	padding-top: 0;
	border-top: 0;
}

/* On Woodmart, .prod_info_additional.show adds `table { margin-bottom: 10px }` — neutralize it inside this block. */
.chspex-price-block.show .chspex-retail-history-table {
	margin-bottom: 0;
}

/* Both child headings share the same typography for visual consistency. */
.chspex-price-block .chspex-retail-history-heading,
.chspex-price-block .chspex-price-chart-heading {
	margin: 0 0 10px 0;
	padding: 0;
	font-size: 14px;
	font-weight: 600;
	line-height: 1.4;
	color: #242424;
	text-transform: none;
}

.chspex-price-block .chspex-retail-history-heading strong {
	font-size: inherit;
	font-weight: inherit;
}

.chspex-price-chart-wrapper {
	width: 100%;
	margin-top: 20px;
	margin-left: 0;
	margin-right: 0;
	padding-left: 0;
	padding-right: 0;
	box-sizing: border-box;
	clear: both;
}

.chspex-price-chart-wrapper > .chspex-price-chart-heading {
	margin-bottom: 10px;
	font-weight: 600;
	font-size: 14px;
	color: #242424;
}

.chspex-price-chart {
	position: relative;
	min-height: 280px;
}

.chspex-price-chart.is-loading::after {
	content: "";
	position: absolute;
	inset: 0;
	background: rgba(255, 255, 255, 0.6) url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='28' height='28' viewBox='0 0 24 24'><circle cx='12' cy='12' r='9' fill='none' stroke='%23999' stroke-width='2' stroke-dasharray='40 20'><animateTransform attributeName='transform' type='rotate' from='0 12 12' to='360 12 12' dur='0.8s' repeatCount='indefinite'/></circle></svg>") no-repeat center;
}

.chspex-price-chart.is-error::after {
	content: "Failed to load chart.";
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	color: #c33;
	font-size: 13px;
}

.chspex-price-chart-canvas {
	width: 100%;
}

/* Make uPlot's inner wrap and legend span the full container width
   so the chart canvas reaches the right edge (same width as .u-legend). */
.chspex-price-chart-canvas .uplot,
.chspex-price-chart-canvas .u-wrap,
.chspex-price-chart-canvas .u-legend {
	width: 100% !important;
}

.chspex-price-chart-canvas .u-over,
.chspex-price-chart-canvas .u-under {
	width: 100% !important;
}

.chspex-price-chart-range {
	display: flex;
	gap: 6px;
	margin-top: 8px;
}

.chspex-price-chart-range button {
	padding: 4px 10px;
	border: 1px solid rgba(0, 0, 0, 0.12);
	background: transparent;
	color: #555;
	font-size: 12px;
	font-weight: 600;
	cursor: pointer;
	transition: all 0.15s ease;
	border-radius: 3px;
}

.chspex-price-chart-range button:hover {
	border-color: rgb(50, 120, 210);
	color: rgb(50, 120, 210);
}

.chspex-price-chart-range button.is-active {
	background: rgb(50, 120, 210);
	border-color: rgb(50, 120, 210);
	color: #fff;
}

.chspex-price-chart-empty {
	padding: 30px 0;
	text-align: center;
	color: #999;
	font-size: 13px;
}

.u-legend {
	font-size: 12px;
}

.chspex-price-chart-legend {
	display: flex;
	flex-wrap: wrap;
	gap: 6px 16px;
	margin-top: 8px;
	padding: 6px 4px 0;
	font-size: 12px;
	color: #333;
	border-top: 1px solid rgba(0, 0, 0, 0.06);
}

.chspex-price-chart-legend .chspex-legend-item em {
	font-style: normal;
	color: #666;
	margin-right: 4px;
}

.chspex-price-chart-legend .chspex-legend-avg {
	color: rgb(50, 120, 210);
	font-weight: 600;
}

/* Retail Price History table */
.chspex-retail-history-wrapper {
	margin-top: 10px;
	font-size: 10pt;
}

.chspex-retail-history-heading {
	margin-bottom: 6px;
}

.chspex-retail-history-table {
	border-collapse: collapse;
	width: 100%;
	margin: 0;
}

.chspex-retail-history-table th,
.chspex-retail-history-table td {
	padding: 6px 8px;
	border: 1px solid rgba(0, 0, 0, 0.1);
	text-align: left;
	font-size: 10pt;
}

.chspex-retail-history-table thead th {
	background: rgba(0, 0, 0, 0.04);
	font-weight: 700;
}

.chspex-retail-history-table tbody tr:nth-child(even) td {
	background: rgba(0, 0, 0, 0.02);
}

.chspex-retail-history-source {
	margin-top: 6px;
	font-size: 10pt;
	color: rgba(0, 0, 0, 0.6);
}

.chspex-retail-history-source em {
	font-style: italic;
}
