/* محدد المقاس الذكي — طبيب مارت
   يرث هوية قالب Woodmart عبر متغيراته، مع قيم احتياطية لو المتغيرات مش موجودة. */

.tsf-wrap {
	--tsf-primary: var(--wd-primary-color, #048ED6);
	--tsf-dark: var(--wd-alternative-color, #003159);
	--tsf-radius: var(--wd-brd-radius, 20px);
	--tsf-font: var(--wd-text-font, "Cairo", Arial, Helvetica, sans-serif);
	--tsf-title-font: var(--wd-title-font, "Cairo", Arial, Helvetica, sans-serif);
	--tsf-border: rgba(0, 49, 89, .14);
	--tsf-soft: rgba(4, 142, 214, .07);

	font-family: var(--tsf-font);
	direction: rtl;
	text-align: right;
	margin: 0 0 22px;
	border: 1px solid var(--tsf-border);
	border-radius: var(--tsf-radius);
	background: #fff;
	overflow: hidden;
}

/* ---------- الزر الرئيسي ---------- */

.tsf-wrap .tsf-trigger {
	display: flex;
	align-items: center;
	gap: 10px;
	width: 100%;
	margin: 0;
	padding: 13px 16px;
	border: 0;
	border-radius: 0;
	background: var(--tsf-soft);
	color: var(--tsf-dark);
	font-family: var(--tsf-title-font);
	font-size: 14px;
	font-weight: 700;
	line-height: 1.5;
	text-align: right;
	cursor: pointer;
	transition: background .18s ease;
	box-shadow: none;
	text-transform: none;
	letter-spacing: 0;
}

.tsf-wrap .tsf-trigger:hover,
.tsf-wrap .tsf-trigger:focus-visible {
	background: rgba(4, 142, 214, .13);
	color: var(--tsf-dark);
}

.tsf-trigger-ico {
	display: inline-flex;
	color: var(--tsf-primary);
	flex: 0 0 auto;
}

.tsf-trigger-txt {
	flex: 1 1 auto;
}

.tsf-chev {
	display: inline-flex;
	color: var(--tsf-primary);
	flex: 0 0 auto;
	transition: transform .22s ease;
}

.tsf-wrap.is-open .tsf-chev {
	transform: rotate(180deg);
}

/* ---------- اللوحة ---------- */

.tsf-panel {
	padding: 16px;
	border-top: 1px solid var(--tsf-border);
}

.tsf-panel[hidden] {
	display: none;
}

.tsf-lbl {
	display: block;
	margin-bottom: 6px;
	color: var(--tsf-dark);
	font-size: 13px;
	font-weight: 600;
}

.tsf-block {
	margin-bottom: 14px;
}

.tsf-pills {
	display: inline-flex;
	gap: 6px;
	padding: 4px;
	border-radius: 999px;
	background: rgba(0, 49, 89, .06);
}

.tsf-wrap .tsf-pill {
	margin: 0;
	padding: 7px 20px;
	border: 0;
	border-radius: 999px;
	background: transparent;
	color: var(--tsf-dark);
	font-family: inherit;
	font-size: 13px;
	font-weight: 600;
	line-height: 1.4;
	cursor: pointer;
	transition: background .16s ease, color .16s ease;
	box-shadow: none;
	text-transform: none;
	letter-spacing: 0;
}

.tsf-wrap .tsf-pill.is-active {
	background: var(--tsf-primary);
	color: #fff;
}

.tsf-fields {
	display: flex;
	gap: 12px;
	margin-bottom: 14px;
}

.tsf-field {
	flex: 1 1 0;
	min-width: 0;
	margin: 0;
}

.tsf-inp {
	position: relative;
	display: block;
}

.tsf-wrap .tsf-inp input {
	width: 100%;
	height: var(--wd-form-height, 42px);
	margin: 0;
	padding: 0 14px 0 42px;
	border: 1px solid var(--tsf-border);
	border-radius: 10px;
	background: #fff;
	color: var(--tsf-dark);
	font-family: inherit;
	font-size: 15px;
	font-weight: 600;
	line-height: normal;
	text-align: right;
	box-shadow: none;
	appearance: textfield;
	-moz-appearance: textfield;
}

.tsf-wrap .tsf-inp input::-webkit-outer-spin-button,
.tsf-wrap .tsf-inp input::-webkit-inner-spin-button {
	margin: 0;
	-webkit-appearance: none;
}

.tsf-wrap .tsf-inp input:focus {
	border-color: var(--tsf-primary);
	outline: 0;
	box-shadow: 0 0 0 3px rgba(4, 142, 214, .15);
}

.tsf-inp em {
	position: absolute;
	top: 50%;
	left: 14px;
	transform: translateY(-50%);
	color: #8a97a3;
	font-size: 12px;
	font-style: normal;
	font-weight: 600;
	pointer-events: none;
}

.tsf-wrap .tsf-go {
	display: block;
	width: 100%;
	margin: 0;
	padding: 12px 18px;
	border: 0;
	border-radius: 10px;
	background: var(--tsf-primary);
	color: #fff;
	font-family: var(--tsf-title-font);
	font-size: 14px;
	font-weight: 700;
	line-height: 1.5;
	cursor: pointer;
	transition: background .18s ease, transform .1s ease;
	box-shadow: none;
	text-transform: none;
	letter-spacing: 0;
}

.tsf-wrap .tsf-go:hover {
	background: var(--tsf-dark);
	color: #fff;
}

.tsf-wrap .tsf-go:active {
	transform: translateY(1px);
}

.tsf-wrap .tsf-go[disabled] {
	opacity: .6;
	cursor: default;
}

.tsf-disc {
	margin: 12px 0 0;
	color: #8a97a3;
	font-size: 11.5px;
	line-height: 1.7;
}

/* ---------- النتيجة ---------- */

.tsf-result {
	margin-top: 14px;
}

.tsf-result[hidden] {
	display: none;
}

.tsf-res {
	padding: 14px;
	border: 1px solid rgba(4, 142, 214, .3);
	border-radius: 12px;
	background: var(--tsf-soft);
	animation: tsf-in .22s ease;
}

@keyframes tsf-in {
	from { opacity: 0; transform: translateY(-4px); }
	to   { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
	.tsf-res { animation: none; }
	.tsf-chev { transition: none; }
}

.tsf-res-head {
	display: flex;
	align-items: center;
	gap: 10px;
	flex-wrap: wrap;
}

.tsf-res-cap {
	color: var(--tsf-dark);
	font-size: 13px;
	font-weight: 600;
}

.tsf-res-size {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 54px;
	padding: 4px 12px;
	border-radius: 10px;
	background: var(--tsf-primary);
	color: #fff;
	font-family: var(--tsf-title-font);
	font-size: 22px;
	font-weight: 800;
	line-height: 1.3;
	letter-spacing: .5px;
}

.tsf-res-badge {
	padding: 3px 10px;
	border-radius: 999px;
	background: #fff3d6;
	color: #8a6100;
	font-size: 11px;
	font-weight: 700;
}

.tsf-res-notes {
	margin: 10px 0 0;
	padding: 0 18px 0 0;
	color: #5b6b78;
	font-size: 12.5px;
	line-height: 1.85;
	list-style: disc;
}

.tsf-res-notes li {
	margin: 0;
}

.tsf-res-alt {
	margin-top: 10px;
	color: var(--tsf-dark);
	font-size: 12.5px;
	font-weight: 600;
}

.tsf-wrap .tsf-alt-btn {
	margin: 0 4px;
	padding: 3px 12px;
	border: 1px solid var(--tsf-primary);
	border-radius: 999px;
	background: #fff;
	color: var(--tsf-primary);
	font-family: inherit;
	font-size: 12.5px;
	font-weight: 700;
	line-height: 1.6;
	cursor: pointer;
	box-shadow: none;
	text-transform: none;
}

.tsf-wrap .tsf-alt-btn:hover {
	background: var(--tsf-primary);
	color: #fff;
}

.tsf-wrap .tsf-apply {
	display: block;
	width: 100%;
	margin: 12px 0 0;
	padding: 10px 16px;
	border: 0;
	border-radius: 10px;
	background: var(--tsf-dark);
	color: #fff;
	font-family: var(--tsf-title-font);
	font-size: 13.5px;
	font-weight: 700;
	line-height: 1.5;
	cursor: pointer;
	box-shadow: none;
	text-transform: none;
	letter-spacing: 0;
}

.tsf-wrap .tsf-apply:hover {
	background: var(--tsf-primary);
	color: #fff;
}

.tsf-err {
	margin: 12px 0 0;
	padding: 10px 14px;
	border-radius: 10px;
	background: #fdecec;
	color: #a4262c;
	font-size: 12.5px;
	font-weight: 600;
}

.tsf-toast {
	margin-top: 8px;
	color: #1e7a3c;
	font-size: 12.5px;
	font-weight: 700;
}

/* ---------- الموبايل ---------- */

@media (max-width: 480px) {
	.tsf-fields {
		gap: 8px;
	}

	.tsf-panel {
		padding: 14px;
	}

	.tsf-res-size {
		font-size: 20px;
	}
}

/* ---------- LTR ---------- */

html[dir="ltr"] .tsf-wrap {
	direction: ltr;
	text-align: left;
}

html[dir="ltr"] .tsf-wrap .tsf-trigger {
	text-align: left;
}

html[dir="ltr"] .tsf-wrap .tsf-inp input {
	padding: 0 42px 0 14px;
	text-align: left;
}

html[dir="ltr"] .tsf-inp em {
	right: 14px;
	left: auto;
}

html[dir="ltr"] .tsf-res-notes {
	padding: 0 0 0 18px;
}
