/**
 * MHB Price Ticker Widget
 * Styled to match MISC IR price ticker look-and-feel.
 */

.mhb-price-ticker {
	--mhb-pt-bg: #dde4ee;
	--mhb-pt-card-bg: #ffffff;
	--mhb-pt-card-border: #d0d7e1;
	--mhb-pt-text: #20272b;
	--mhb-pt-text-muted: #5a6470;
	--mhb-pt-divider: #e6eaf0;
	--mhb-pt-btn-bg: #1872c4;
	--mhb-pt-btn-bg-hover: #135ba0;
	--mhb-pt-up: #2ea84a;
	--mhb-pt-down: #d83a3a;
	--mhb-pt-link: #1872c4;

	background: var(--mhb-pt-bg);
	padding: 30px 24px;
	border-radius: 6px;
	box-sizing: border-box;
	color: var(--mhb-pt-text);
	font-family: inherit;
	font-size: 15px;
	line-height: 1.5;
	width: 100%;
}

.mhb-price-ticker *,
.mhb-price-ticker *::before,
.mhb-price-ticker *::after {
	box-sizing: border-box;
}

/* -------- Top bar with Update button -------- */

.mhb-price-ticker__topbar {
	display: flex;
	justify-content: flex-end;
	margin-bottom: 18px;
}

.mhb-price-ticker__update {
	display: inline-block;
	background: var(--mhb-pt-btn-bg);
	color: #fff !important;
	text-decoration: none !important;
	font-weight: 700;
	font-size: 14px;
	letter-spacing: 0.6px;
	text-transform: uppercase;
	padding: 12px 32px;
	border-radius: 30px;
	border: none;
	cursor: pointer;
	transition: background 0.2s ease, transform 0.1s ease;
	box-shadow: 0 2px 6px rgba(24, 114, 196, 0.18);
}

.mhb-price-ticker__update:hover,
.mhb-price-ticker__update:focus {
	background: var(--mhb-pt-btn-bg-hover);
	color: #fff !important;
	text-decoration: none !important;
}

.mhb-price-ticker__update:active {
	transform: translateY(1px);
}

/* -------- Card container -------- */

.mhb-price-ticker__card {
	background: var(--mhb-pt-card-bg);
	border: 1px solid var(--mhb-pt-card-border);
	border-radius: 4px;
	padding: 28px 30px;
}

/* -------- Header (company + price) -------- */

.mhb-price-ticker__header {
	display: grid;
	grid-template-columns: 1.6fr 1fr;
	gap: 30px;
	padding-bottom: 12px;
}

.mhb-price-ticker__company {
	min-width: 0;
}

.mhb-price-ticker__name {
	margin: 0 0 4px;
	font-size: 17px;
	font-weight: 700;
	color: var(--mhb-pt-text);
	letter-spacing: 0.2px;
	line-height: 1.3;
}

.mhb-price-ticker__code {
	margin: 0 0 24px;
	font-size: 14px;
	color: var(--mhb-pt-text);
	font-weight: 400;
}

/* Board / Sector / Shariah */
.mhb-price-ticker__meta {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 10px;
	text-align: center;
	margin-top: 6px;
}

.mhb-price-ticker__meta-item {
	display: flex;
	flex-direction: column;
	gap: 6px;
	padding: 4px 6px;
}

.mhb-price-ticker__meta-label {
	font-size: 14px;
	color: var(--mhb-pt-text);
	font-weight: 400;
}

.mhb-price-ticker__meta-value {
	font-size: 15px;
	color: var(--mhb-pt-text);
	font-weight: 700;
}

/* -------- Price block (right side of header) -------- */

.mhb-price-ticker__price-block {
	display: flex;
	flex-direction: column;
	gap: 0;
}

.mhb-price-ticker__price-row {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 10px 0;
	border-bottom: 1px solid var(--mhb-pt-divider);
}

.mhb-price-ticker__price-row:last-child {
	border-bottom: none;
}

.mhb-price-ticker__price-row--main {
	font-weight: 700;
	font-size: 15px;
}

.mhb-price-ticker__price-label {
	color: var(--mhb-pt-text);
}

.mhb-price-ticker__price-label small {
	font-size: 11px;
	font-weight: 400;
	color: var(--mhb-pt-text-muted);
	margin-left: 2px;
}

.mhb-price-ticker__price-value {
	font-weight: 700;
	color: var(--mhb-pt-text);
	display: inline-flex;
	align-items: center;
	gap: 6px;
}

.mhb-price-ticker__price-row--main .mhb-price-ticker__price-value {
	font-size: 17px;
}

.mhb-price-ticker__price-row.is-up .mhb-price-ticker__price-value {
	color: var(--mhb-pt-up);
}

.mhb-price-ticker__price-row.is-down .mhb-price-ticker__price-value {
	color: var(--mhb-pt-down);
}

/* -------- Arrows -------- */

.mhb-price-ticker__arrow {
	font-size: 11px;
	line-height: 1;
}

.mhb-price-ticker__arrow--up {
	color: var(--mhb-pt-up);
}

.mhb-price-ticker__arrow--down {
	color: var(--mhb-pt-down);
}

/* -------- Body (2-column tables) -------- */

.mhb-price-ticker__body {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 30px;
	margin-top: 8px;
}

.mhb-price-ticker__col {
	min-width: 0;
}

.mhb-price-ticker__table {
	width: 100%;
	border-collapse: collapse;
	margin: 0;
}

.mhb-price-ticker__table td {
	padding: 12px 4px;
	border-bottom: 1px solid var(--mhb-pt-divider);
	font-size: 14px;
	color: var(--mhb-pt-text);
	background: transparent;
}

.mhb-price-ticker__table tr:last-child td {
	border-bottom: none;
}

.mhb-price-ticker__table .mhb-price-ticker__val {
	text-align: right;
	font-weight: 700;
	white-space: nowrap;
}

/* -------- Footer -------- */

.mhb-price-ticker__footer {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 20px;
	margin-top: 22px;
	padding-top: 16px;
	font-size: 13px;
	color: var(--mhb-pt-text-muted);
}

.mhb-price-ticker__footer p {
	margin: 0 0 4px;
	line-height: 1.5;
}

.mhb-price-ticker__footer a {
	color: var(--mhb-pt-link);
	text-decoration: none;
}

.mhb-price-ticker__footer a:hover {
	text-decoration: underline;
}

.mhb-price-ticker__footer-right {
	text-align: right;
}

/* -------- Error state -------- */

.mhb-price-ticker--error {
	padding: 30px;
	background: #fff5f5;
	border: 1px solid #f5c2c2;
	color: #8a2c2c;
	border-radius: 4px;
	text-align: center;
}

/* -------- Responsive -------- */

@media (max-width: 991px) {
	.mhb-price-ticker {
		padding: 24px 18px;
	}

	.mhb-price-ticker__card {
		padding: 22px 20px;
	}

	.mhb-price-ticker__header {
		grid-template-columns: 1fr;
		gap: 20px;
	}

	.mhb-price-ticker__price-block {
		border-top: 1px solid var(--mhb-pt-divider);
		padding-top: 8px;
	}

	.mhb-price-ticker__body {
		grid-template-columns: 1fr;
		gap: 0;
	}

	.mhb-price-ticker__footer {
		grid-template-columns: 1fr;
		text-align: left;
	}

	.mhb-price-ticker__footer-right {
		text-align: left;
	}
}

@media (max-width: 480px) {
	.mhb-price-ticker {
		padding: 18px 12px;
	}

	.mhb-price-ticker__card {
		padding: 18px 14px;
	}

	.mhb-price-ticker__update {
		padding: 10px 22px;
		font-size: 13px;
	}

	.mhb-price-ticker__meta {
		grid-template-columns: 1fr;
		gap: 8px;
		text-align: left;
	}

	.mhb-price-ticker__meta-item {
		flex-direction: row;
		justify-content: space-between;
		padding: 6px 0;
		border-bottom: 1px solid var(--mhb-pt-divider);
	}
}
