/**
 * TMA Policy Page — tabbed layout (HTML widget design)
 */

.tma-policy-page {
	--tma-green: #32be5b;
	--tma-green-light: #ebf9ef;
	--tma-black: #000000;
	--tma-text: #202020;
	--tma-border: #e7e7e7;
	--tma-container-width: 1440px;

	width: 100%;
	margin: 0 !important;
	padding: 0 !important;
	background: #ffffff;
	color: var(--tma-black);
	font-family: "Noto Kufi Arabic", sans-serif;
	position: relative;
	margin-top: -110px !important;
	z-index: 2;
}

.tma-policy-page,
.tma-policy-page * {
	box-sizing: border-box;
}

.elementor-widget-html:has(.tma-policy-page),
.elementor-widget-html:has(.tma-policy-page) > .elementor-widget-container,
.elementor-widget-tma_legal_page:has(.tma-policy-page),
.elementor-widget-tma_legal_page:has(.tma-policy-page) > .elementor-widget-container {
	margin-top: 0 !important;
	padding-top: 0 !important;
}

.e-con:has(.tma-policy-page),
.elementor-element:has(.tma-policy-page) {
	min-height: auto !important;
	height: auto !important;
	padding-top: 0 !important;
	margin-top: 0 !important;
	justify-content: flex-start !important;
	align-items: stretch !important;
}

.tma-policy-wrapper {
	width: min(var(--tma-container-width), calc(100% - 80px));
	margin: 0 auto !important;
	padding: 24px 0 80px !important;
}

.tma-policy-header {
	width: 100%;
	margin: 0 0 45px !important;
	padding: 0;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 40px;
}

.tma-policy-title {
	margin: 0 !important;
	padding: 0 !important;
	color: var(--tma-black);
	font-family: "Noto Kufi Arabic", sans-serif;
	font-size: 40px;
	font-weight: 600;
	line-height: normal;
	text-align: right;
}

.tma-policy-date {
	margin: 0 !important;
	padding: 0 !important;
	color: var(--tma-black);
	font-family: "Noto Kufi Arabic", sans-serif;
	font-size: 16px;
	font-weight: 400;
	line-height: normal;
	text-align: left;
	white-space: nowrap;
}

/* Arabic default — محتوى يسار، سايدبار يمين (direction: ltr يثبت المكان الفعلي) */
.tma-policy-layout {
	width: 100%;
	display: grid;
	grid-template-columns: minmax(0, 1fr) 250px;
	grid-template-areas: "content sidebar";
	column-gap: 100px;
	align-items: start;
	direction: ltr;
}

.tma-policy-content {
	grid-area: content;
	direction: rtl;
	width: 100%;
	min-width: 0;
}

.tma-policy-sidebar {
	grid-area: sidebar;
	direction: rtl;
	width: 250px;
	position: sticky;
	top: 100px;
}

.tma-policy-tabs {
	width: 100%;
	display: flex;
	flex-direction: column;
}

.tma-policy-tab {
	appearance: none;
	width: 100%;
	min-height: 52px;
	margin: 0;
	padding: 14px 16px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 15px;
	color: var(--tma-black);
	background: transparent;
	border: 0;
	border-bottom: 1px solid transparent;
	font-family: "Noto Kufi Arabic", sans-serif;
	font-size: 16px;
	font-weight: 400;
	line-height: normal;
	text-align: right;
	cursor: pointer;
	transition: color 0.25s ease, background-color 0.25s ease, border-color 0.25s ease;
}

.tma-policy-tab:hover {
	color: var(--tma-green);
	background: #f8fdf9;
}

.tma-policy-tab.active {
	color: var(--tma-black);
	background: var(--tma-green-light);
	border-bottom-color: var(--tma-green);
	font-weight: 600;
}

.tma-policy-arrow {
	flex: 0 0 auto;
	color: var(--tma-green);
	font-size: 20px;
	line-height: 1;
	opacity: 0;
	transform: translateX(-4px);
	transition: opacity 0.2s ease, transform 0.2s ease;
}

.tma-policy-tab.active .tma-policy-arrow,
.tma-policy-tab:hover .tma-policy-arrow {
	opacity: 1;
	transform: translateX(0);
}

.tma-policy-panel {
	display: none;
	width: 100%;
	margin: 0;
	padding: 0;
	animation: tmaPolicyFade 0.3s ease;
}

.tma-policy-panel.active {
	display: block;
}

.tma-policy-panel h2 {
	margin: 0 0 16px !important;
	padding: 0 !important;
	color: var(--tma-black);
	font-family: "Noto Kufi Arabic", sans-serif;
	font-size: 16px;
	font-weight: 600;
	line-height: 1.9;
	text-align: right;
}

.tma-policy-panel p {
	width: 100%;
	margin: 0 !important;
	padding: 0 !important;
	color: var(--tma-text);
	font-family: "Noto Kufi Arabic", sans-serif;
	font-size: 16px;
	font-weight: 400;
	line-height: 2.2;
	text-align: right;
}

@keyframes tmaPolicyFade {
	from {
		opacity: 0;
		transform: translateY(5px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

/* English LTR — عنوان يسار، تاريخ يمين | سايدبار يسار، محتوى يمين */
.tma-policy-page.is-ltr .tma-policy-header {
	flex-direction: row;
	direction: ltr;
}

.tma-policy-page.is-ltr .tma-policy-title {
	text-align: left;
}

.tma-policy-page.is-ltr .tma-policy-date {
	text-align: right;
}

.tma-policy-page.is-ltr .tma-policy-layout {
	grid-template-columns: 250px minmax(0, 1fr);
	grid-template-areas: "sidebar content";
}

.tma-policy-page.is-ltr .tma-policy-content,
.tma-policy-page.is-ltr .tma-policy-sidebar {
	direction: ltr;
}

.tma-policy-page.is-ltr .tma-policy-tab,
.tma-policy-page.is-ltr .tma-policy-panel h2,
.tma-policy-page.is-ltr .tma-policy-panel p {
	text-align: left;
}

.tma-policy-page.is-ltr .tma-policy-arrow {
	transform: translateX(4px);
}

.tma-policy-page.is-ltr .tma-policy-tab.active .tma-policy-arrow,
.tma-policy-page.is-ltr .tma-policy-tab:hover .tma-policy-arrow {
	transform: translateX(0);
}

@media (max-width: 1199px) {
	.tma-policy-page {
		margin-top: -80px !important;
	}

	.tma-policy-wrapper {
		width: calc(100% - 48px);
	}

	.tma-policy-layout {
		grid-template-columns: minmax(0, 1fr) 230px;
		column-gap: 65px;
	}

	.tma-policy-page.is-ltr .tma-policy-layout {
		grid-template-columns: 230px minmax(0, 1fr);
	}

	.tma-policy-sidebar {
		width: 230px;
	}
}

@media (max-width: 991px) {
	.tma-policy-page {
		margin-top: -45px !important;
	}

	.tma-policy-wrapper {
		width: calc(100% - 36px);
		padding-bottom: 60px !important;
	}

	.tma-policy-header {
		margin-bottom: 35px !important;
	}

	.tma-policy-title {
		font-size: 34px;
	}

	.tma-policy-date {
		font-size: 15px;
	}

	.tma-policy-layout {
		grid-template-columns: minmax(0, 1fr) 210px;
		column-gap: 40px;
	}

	.tma-policy-page.is-ltr .tma-policy-layout {
		grid-template-columns: 210px minmax(0, 1fr);
	}

	.tma-policy-sidebar {
		width: 210px;
	}

	.tma-policy-tab {
		min-height: 48px;
		padding: 12px 13px;
		font-size: 14px;
	}

	.tma-policy-panel h2,
	.tma-policy-panel p {
		font-size: 15px;
	}
}

@media (max-width: 767px) {
	.tma-policy-page {
		margin-top: 0 !important;
	}

	.tma-policy-wrapper {
		width: calc(100% - 30px);
		padding: 20px 0 50px !important;
	}

	.tma-policy-header {
		margin-bottom: 25px !important;
		flex-direction: column;
		align-items: flex-start;
		gap: 10px;
	}

	.tma-policy-title {
		width: 100%;
		font-size: 28px;
	}

	.tma-policy-date {
		width: 100%;
		font-size: 14px;
		white-space: normal;
	}

	.tma-policy-layout {
		display: flex;
		flex-direction: column;
		gap: 30px;
		direction: ltr;
	}

	.tma-policy-sidebar {
		position: static;
		order: 1;
		width: 100%;
	}

	.tma-policy-content {
		order: 2;
		width: 100%;
	}

	.tma-policy-tabs {
		max-height: 270px;
		overflow-y: auto;
		border: 1px solid var(--tma-border);
		border-radius: 8px;
	}

	.tma-policy-tab {
		min-height: 48px;
		padding: 12px 14px;
		border-bottom: 1px solid var(--tma-border);
		font-size: 14px;
	}

	.tma-policy-tab:last-child {
		border-bottom: 0;
	}

	.tma-policy-arrow {
		opacity: 1;
		transform: none;
		font-size: 18px;
	}

	.tma-policy-panel h2 {
		margin-bottom: 10px !important;
		font-size: 15px;
	}

	.tma-policy-panel p {
		font-size: 14px;
		line-height: 2;
	}
}
