.wbkb-ot-widget {
	max-width: 640px;
	margin: 0 auto;
	direction: rtl;
	text-align: right;
	box-sizing: border-box;
}

.wbkb-ot-widget *,
.wbkb-ot-widget *::before,
.wbkb-ot-widget *::after {
	box-sizing: border-box;
}

.wbkb-ot-heading {
	margin: 0 0 16px;
	font-size: 20px;
	font-weight: 700;
	color: #1f2937;
}

.wbkb-ot-form {
	display: flex;
	gap: 10px;
	flex-wrap: wrap;
}

.wbkb-ot-input {
	flex: 1 1 220px;
	min-width: 0;
	padding: 12px 14px;
	border: 1px solid #d1d5db;
	border-radius: 8px;
	font-size: 15px;
	direction: rtl;
}

.wbkb-ot-input:focus {
	outline: none;
	border-color: var(--wbkb-color-primary, #093C75);
}

.wbkb-ot-submit {
	position: relative;
	padding: 12px 24px;
	background: var(--wbkb-color-primary, #093C75);
	color: #fff;
	border: none;
	border-radius: 8px;
	font-size: 15px;
	cursor: pointer;
	transition: background 0.2s;
}

.wbkb-ot-submit:hover {
	filter: brightness(1.1);
}

.wbkb-ot-submit:disabled {
	cursor: default;
	opacity: 0.8;
}

.wbkb-ot-submit .wbkb-ot-spinner {
	display: none;
	position: absolute;
	top: 50%;
	left: 50%;
	width: 18px;
	height: 18px;
	margin: -9px 0 0 -9px;
	border: 2px solid rgba(255, 255, 255, 0.4);
	border-top-color: #fff;
	border-radius: 50%;
	animation: wbkb-ot-spin 0.7s linear infinite;
}

.wbkb-ot-submit.is-loading .wbkb-ot-submit-text {
	visibility: hidden;
}

.wbkb-ot-submit.is-loading .wbkb-ot-spinner {
	display: block;
}

@keyframes wbkb-ot-spin {
	to {
		transform: rotate(360deg);
	}
}

.wbkb-ot-message {
	margin-top: 14px;
	padding: 10px 14px;
	background: #fef2f2;
	color: #b91c1c;
	border-radius: 8px;
	font-size: 14px;
}

.wbkb-ot-result {
	margin-top: 20px;
}

.wbkb-ot-order-head {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 10px;
	padding: 12px 14px;
	background: #f9fafb;
	border-radius: 8px;
	margin-bottom: 18px;
}

.wbkb-ot-order-number {
	font-weight: 700;
	color: #1f2937;
	font-size: 14px;
}

.wbkb-ot-order-date {
	color: #6b7280;
	font-size: 13px;
}

.wbkb-ot-order-status {
	margin-inline-start: auto;
	padding: 4px 10px;
	border-radius: 999px;
	color: #fff;
	font-size: 12px;
	white-space: nowrap;
}

/* Timeline — پیش‌فرض موبایل: ستونی */
.wbkb-ot-timeline {
	display: flex;
	flex-direction: column;
}

.wbkb-ot-ms {
	position: relative;
	display: flex;
	align-items: flex-start;
	gap: 12px;
	padding-bottom: 24px;
	padding-right: 4px;
}

.wbkb-ot-ms:last-child {
	padding-bottom: 0;
}

.wbkb-ot-ms-dot {
	position: relative;
	flex: 0 0 18px;
	width: 18px;
	height: 18px;
	border-radius: 50%;
	background: #e5e7eb;
	border: 3px solid #e5e7eb;
	z-index: 1;
}

.wbkb-ot-ms:not(:last-child)::before {
	content: '';
	position: absolute;
	top: 18px;
	right: 12px;
	bottom: 0;
	width: 2px;
	background: #e5e7eb;
}

.wbkb-ot-ms-body {
	display: flex;
	flex-direction: column;
	gap: 2px;
	padding-top: 1px;
}

.wbkb-ot-ms-label {
	font-size: 14px;
	font-weight: 600;
	color: #6b7280;
}

.wbkb-ot-ms-date {
	font-size: 12px;
	color: #9ca3af;
}

.wbkb-ot-ms--done .wbkb-ot-ms-dot,
.wbkb-ot-ms--current .wbkb-ot-ms-dot {
	background: #16a34a;
	border-color: #16a34a;
}

.wbkb-ot-ms--done:not(:last-child)::before {
	background: #16a34a;
}

.wbkb-ot-ms--done .wbkb-ot-ms-label {
	color: #1f2937;
}

.wbkb-ot-ms--current .wbkb-ot-ms-dot {
	background: var(--wbkb-color-primary, #093C75);
	border-color: var(--wbkb-color-primary, #093C75);
	box-shadow: 0 0 0 4px rgba(9, 60, 117, 0.15);
}

.wbkb-ot-ms--current .wbkb-ot-ms-label {
	color: var(--wbkb-color-primary, #093C75);
}

.wbkb-ot-ms--cancelled .wbkb-ot-ms-dot {
	background: #dc2626;
	border-color: #dc2626;
}

.wbkb-ot-ms--cancelled .wbkb-ot-ms-label {
	color: #dc2626;
}

/* دسکتاپ: افقی (شبیه نمودار پیگیری سفارش دیجی‌کالا) */
@media (min-width: 768px) {

	.wbkb-ot-timeline {
		flex-direction: row;
		align-items: flex-start;
	}

	.wbkb-ot-ms {
		flex: 1;
		flex-direction: column;
		align-items: center;
		text-align: center;
		gap: 8px;
		padding-bottom: 0;
		padding-right: 0;
	}

	.wbkb-ot-ms:not(:last-child)::before {
		top: 8px;
		right: 50%;
		bottom: auto;
		left: auto;
		width: 100%;
		height: 2px;
	}

	.wbkb-ot-ms-body {
		padding-top: 0;
	}
}

/* جعبه کد رهگیری پستی — نمایش‌داده‌شده فقط وقتی ادمین کد را از صفحه سفارش ثبت کرده باشد */
.wbkb-ot-postal-box {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 14px;
	margin-top: 20px;
	padding: 16px;
	background: linear-gradient(135deg, #eef4fb, #f7fafc);
	border: 1px solid #dbe7f3;
	border-radius: 12px;
}

.wbkb-ot-postal-icon {
	flex: 0 0 auto;
	font-size: 28px;
	line-height: 1;
}

.wbkb-ot-postal-body {
	display: flex;
	flex-direction: column;
	gap: 2px;
	flex: 1 1 auto;
	min-width: 0;
}

.wbkb-ot-postal-label {
	font-size: 12px;
	color: #6b7280;
}

.wbkb-ot-postal-code-row {
	display: flex;
	align-items: center;
	gap: 8px;
}

.wbkb-ot-postal-code {
	font-size: 16px;
	font-weight: 700;
	color: var(--wbkb-color-primary, #093C75);
	direction: ltr;
	unicode-bidi: embed;
	word-break: break-all;
}

.wbkb-ot-postal-copy {
	flex: 0 0 auto;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 26px;
	height: 26px;
	padding: 0;
	background: #fff;
	border: 1px solid #dbe7f3;
	border-radius: 6px;
	font-size: 13px;
	line-height: 1;
	cursor: pointer;
}

.wbkb-ot-postal-copy.is-copied {
	width: auto;
	padding: 0 10px;
	color: #16a34a;
	border-color: #16a34a;
	font-size: 12px;
	font-weight: 600;
	white-space: nowrap;
}

.wbkb-ot-postal-link {
	flex: 0 0 auto;
	padding: 8px 16px;
	background: var(--wbkb-color-primary, #093C75);
	color: #fff;
	border-radius: 8px;
	font-size: 13px;
	text-decoration: none;
	white-space: nowrap;
}

.wbkb-ot-postal-link:hover {
	color: #fff !important;	
	background: #0b4a92;
}

@media (max-width: 480px) {

	.wbkb-ot-postal-link {
		width: 100%;
		text-align: center;
	}
}
