.dsp-survey-box {
	direction: rtl;
	text-align: right;
	margin: 32px 0;
	padding: 24px;
	border: 1px solid #e5e5e5;
	border-radius: 12px;
	background: #fafafa;
	font-family: inherit;
}

.dsp-survey-box .dsp-title {
	margin: 0 0 8px;
	font-size: 20px;
}

.dsp-survey-box .dsp-intro {
	margin: 0 0 16px;
	color: #444;
}

.dsp-categories-grid,
.dsp-products-grid-inner {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
	gap: 10px;
}

.dsp-category-btn,
.dsp-product-btn {
	cursor: pointer;
	padding: 12px 14px;
	border: 1px solid transparent;
	border-radius: 8px;
	background: var( --dsp-btn-bg, #fff );
	color: var( --dsp-btn-text, #222 );
	border-color: var( --dsp-btn-bg, #ccc );
	font-size: 14px;
	transition: filter .15s ease;
}

.dsp-category-btn:hover,
.dsp-product-btn:hover {
	filter: brightness( 0.9 );
}

.dsp-back-btn {
	cursor: pointer;
	display: inline-block;
	margin: 0 0 12px;
	padding: 8px 18px;
	border: 1px solid #1a7d33;
	border-radius: 8px;
	background: #1a7d33;
	color: #fff;
	font-size: 14px;
	font-weight: 600;
	transition: background .15s ease;
}

.dsp-back-btn:hover {
	background: #146127;
	border-color: #146127;
	color: #fff;
}

.dsp-code-row {
	margin: 10px 0;
	display: flex;
	align-items: stretch;
	gap: 8px;
	flex-wrap: wrap;
}

.dsp-code-box {
	flex: 1;
	min-width: 160px;
	padding: 12px 16px;
	background: #fff;
	border: 2px dashed #1a7d33;
	color: #1a7d33;
	border-radius: 8px;
	font-size: 20px;
	font-weight: 700;
	letter-spacing: 1px;
	text-align: center;
	direction: ltr;
}

.dsp-copy-code-btn {
	padding: 10px 18px;
	border: none;
	border-radius: 8px;
	background: #1a7d33;
	color: #fff;
	cursor: pointer;
	font-size: 14px;
	font-weight: 600;
	white-space: nowrap;
	transition: background .15s ease;
}

.dsp-copy-code-btn:hover {
	background: #146127;
}

.dsp-copy-code-btn.dsp-copied {
	background: #146127;
}

.dsp-product-link-row {
	margin: 10px 0;
}

.dsp-product-link-btn {
	display: inline-block;
	padding: 10px 20px;
	border-radius: 8px;
	background: var( --dsp-btn-bg, #1a56c2 );
	color: var( --dsp-btn-text, #ffffff );
	text-decoration: none;
	font-size: 14px;
	font-weight: 600;
	transition: filter .15s ease;
}

.dsp-product-link-btn:hover {
	filter: brightness( 0.9 );
	color: var( --dsp-btn-text, #ffffff );
}

.dsp-leave-overlay {
	position: fixed;
	inset: 0;
	background: rgba(0, 0, 0, .55);
	display: none;
	align-items: center;
	justify-content: center;
	z-index: 999999;
	padding: 16px;
}

.dsp-leave-modal {
	direction: rtl;
	text-align: center;
	background: #fff;
	border-radius: 12px;
	padding: 24px 22px;
	max-width: 380px;
	width: 100%;
	box-shadow: 0 12px 34px rgba(0, 0, 0, .28);
}

.dsp-leave-modal p {
	margin: 0 0 18px;
	line-height: 1.9;
	font-size: 14px;
	color: #222;
}

.dsp-leave-actions {
	display: flex;
	gap: 10px;
	justify-content: center;
	flex-wrap: wrap;
}

.dsp-leave-stay-btn,
.dsp-leave-exit-btn {
	border-radius: 8px;
	padding: 10px 16px;
	font-size: 13px;
	cursor: pointer;
}

.dsp-leave-stay-btn {
	background: #222;
	color: #fff;
	border: none;
}

.dsp-leave-stay-btn:hover {
	background: #444;
}

.dsp-leave-exit-btn {
	background: #fff;
	color: #b32d2e;
	border: 1px solid #b32d2e;
}

.dsp-leave-exit-btn:hover {
	background: #fdeeee;
}

.dsp-result {
	margin-top: 18px;
	padding: 16px;
	border-radius: 8px;
	background: #eefaf0;
	border: 0;
	line-height: 1.9;
}

.dsp-result.dsp-error {
	background: #fdeeee;
	border-color: #f0b7b7;
}

.dsp-phone-form {
	margin-top: 14px;
	display: flex;
	gap: 8px;
	flex-wrap: wrap;
}

.dsp-phone-form input[type="tel"] {
	flex: 1;
	min-width: 200px;
	padding: 10px 12px;
	border: 1px solid #ccc;
	border-radius: 8px;
	font-size: 14px;
}

.dsp-phone-form button {
	padding: 10px 20px;
	border: none;
	border-radius: 8px;
	background: #1a7d33;
	color: #fff;
	cursor: pointer;
	font-size: 14px;
	font-weight: 600;
}

.dsp-phone-form button:hover {
	background: #146127;
}

.dsp-phone-form button:disabled {
	opacity: .7;
	cursor: default;
}

.dsp-phone-error {
	flex-basis: 100%;
	margin: 0;
	color: #b32d2e;
	font-size: 13px;
}

.dsp-loading {
	margin-top: 10px;
	color: #777;
	font-size: 13px;
}

/* --- Admin --- */
.dsp-admin-wrap table.dsp-products-table td,
.dsp-admin-wrap table.dsp-products-table th,
.dsp-admin-wrap table.dsp-product-fields td,
.dsp-admin-wrap table.dsp-product-fields th {
	padding: 8px;
}

.dsp-category-block {
	border: 1px solid #c3c4c7;
	border-radius: 10px;
	background: #f6f7f7;
	padding: 16px 18px;
	margin-bottom: 24px;
}

.dsp-category-block-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 6px;
}

.dsp-category-block-title {
	margin-top: 0;
}

.dsp-theme-table {
	margin: 10px 0 16px;
}

.dsp-theme-preview {
	display: inline-block;
	margin-inline-start: 12px;
	padding: 6px 14px;
	border-radius: 6px;
	font-size: 13px;
	vertical-align: middle;
}

.dsp-custom-color-row .wp-picker-container {
	display: inline-block;
	margin-inline-end: 16px;
}

.dsp-product-row {
	border: 1px solid #dcdcde;
	border-radius: 8px;
	background: #fff;
	padding: 14px 16px;
	margin-bottom: 18px;
}

.dsp-product-row-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 10px;
}

.dsp-product-row-title {
	font-size: 15px;
}

/* --- Admin: فهرست نظرسنجی‌ها و محل نمایش --- */
.dsp-surveys-table td {
	vertical-align: middle;
}

.dsp-scope-box {
	background: #fff;
	border: 1px solid #c3c4c7;
	border-radius: 8px;
	padding: 14px 18px;
	margin: 10px 0 24px;
	max-width: 760px;
}

.dsp-scope-option {
	display: block;
	margin: 6px 0;
	font-size: 14px;
}

.dsp-scope-panel {
	margin: 4px 0 12px;
	padding-inline-start: 26px;
}

.dsp-wpcat-list {
	max-height: 220px;
	overflow-y: auto;
	border: 1px solid #dcdcde;
	border-radius: 6px;
	background: #fafafa;
	padding: 8px 12px;
}

/* --- دکمه‌های مشاهده محصول (ادمین) --- */
.dsp-btn-row-item {
	border: 1px dashed #b5bfc9;
	border-radius: 8px;
	background: #fbfcfd;
	padding: 10px 14px;
	margin: 10px 0;
}

.dsp-btn-row-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 6px;
}

/* --- دکمه‌های مشاهده محصول (سایت) --- */
.dsp-product-link-row {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
}

.dsp-shortcode-box {
	background: #fff;
	border: 1px solid #c3c4c7;
	border-radius: 8px;
	padding: 12px 18px;
	margin: 0 0 24px;
	max-width: 760px;
}


/* =====================================================================
 * Admin: کلید فعال/غیرفعال، دکمه‌های عملیات و نمایش بهینه برای موبایل
 * ===================================================================== */

.dsp-table-scroll {
	width: 100%;
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
}

/* --- کلید فعال / غیرفعال --- */
.dsp-switch {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	cursor: pointer;
	user-select: none;
	-webkit-tap-highlight-color: transparent;
}

.dsp-switch input.dsp-status-toggle {
	position: absolute;
	opacity: 0;
	width: 1px;
	height: 1px;
	margin: 0;
	pointer-events: none;
}

.dsp-switch-track {
	position: relative;
	flex: 0 0 auto;
	direction: ltr;
	width: 46px;
	height: 26px;
	border-radius: 26px;
	background: #b32d2e;
	transition: background .2s ease;
}

.dsp-switch-knob {
	position: absolute;
	top: 3px;
	left: 3px;
	width: 20px;
	height: 20px;
	border-radius: 50%;
	background: #fff;
	box-shadow: 0 1px 3px rgba(0, 0, 0, .35);
	transition: transform .2s ease;
}

.dsp-switch.is-on .dsp-switch-track {
	background: #1a7d33;
}

.dsp-switch.is-on .dsp-switch-knob {
	transform: translateX(20px);
}

.dsp-switch input.dsp-status-toggle:focus-visible + .dsp-switch-track {
	outline: 2px solid #2271b1;
	outline-offset: 2px;
}

.dsp-switch.is-loading {
	opacity: .6;
	cursor: progress;
}

.dsp-switch-text {
	min-width: 48px;
	font-weight: 600;
	color: #b32d2e;
}

.dsp-switch.is-on .dsp-switch-text {
	color: #1a7d33;
}

.dsp-row-paused .dsp-col-name a {
	opacity: .7;
}

/* --- دکمه‌های عملیات ردیف --- */
.dsp-row-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
}

.dsp-row-actions .dsp-act {
	display: inline-block;
	padding: 5px 12px;
	border: 1px solid #2271b1;
	border-radius: 6px;
	background: #fff;
	color: #2271b1;
	font-size: 13px;
	line-height: 1.5;
	text-decoration: none;
	white-space: nowrap;
}

.dsp-row-actions .dsp-act:hover {
	background: #2271b1;
	color: #fff;
}

.dsp-row-actions .dsp-act-delete {
	border-color: #b32d2e;
	color: #b32d2e;
}

.dsp-row-actions .dsp-act-delete:hover {
	background: #b32d2e;
	color: #fff;
}

/* --- فیلدهای فرم‌ها هیچ‌وقت از صفحه بیرون نزنند --- */
.dsp-admin-wrap input[type="text"],
.dsp-admin-wrap input[type="url"],
.dsp-admin-wrap input[type="number"],
.dsp-admin-wrap select,
.dsp-admin-wrap textarea {
	max-width: 100%;
	box-sizing: border-box;
}

/* --- موبایل و تبلت (نقطهٔ شکست خود وردپرس) --- */
@media screen and (max-width: 782px) {

	.dsp-admin-wrap {
		margin-inline: 0;
	}

	.dsp-admin-wrap h1.wp-heading-inline {
		font-size: 20px;
		line-height: 1.4;
	}

	.dsp-admin-wrap .page-title-action {
		display: inline-block;
		margin: 8px 0;
		padding: 8px 14px;
		font-size: 14px;
	}

	/* جدول فهرست تخفیف‌ها → کارت */
	.dsp-surveys-table,
	.dsp-surveys-table tbody,
	.dsp-surveys-table tr,
	.dsp-surveys-table td {
		display: block;
		width: 100%;
		box-sizing: border-box;
	}

	.dsp-surveys-table {
		border: 0;
		background: transparent;
		box-shadow: none;
	}

	.dsp-surveys-table thead {
		display: none;
	}

	.dsp-surveys-table tr {
		margin: 0 0 14px;
		padding: 6px 14px;
		border: 1px solid #c3c4c7;
		border-radius: 10px;
		background: #fff;
		box-shadow: 0 1px 2px rgba(0, 0, 0, .05);
	}

	.dsp-surveys-table tr.dsp-row-paused {
		background: #fbf3f3;
	}

	.dsp-surveys-table td {
		display: flex;
		align-items: center;
		justify-content: space-between;
		gap: 12px;
		padding: 10px 0;
		border: 0;
		border-bottom: 1px dashed #dcdcde;
		text-align: start;
	}

	.dsp-surveys-table td:last-child {
		border-bottom: 0;
	}

	.dsp-surveys-table td::before {
		content: attr(data-label);
		flex: 0 0 auto;
		color: #646970;
		font-size: 12px;
		font-weight: 600;
	}

	.dsp-surveys-table td.dsp-col-id {
		display: none;
	}

	.dsp-surveys-table td.dsp-col-name {
		font-size: 15px;
	}

	.dsp-surveys-table td.dsp-col-scope {
		align-items: flex-start;
		word-break: break-word;
	}

	.dsp-surveys-table td.dsp-col-scope::before {
		padding-top: 2px;
	}

	.dsp-surveys-table td.dsp-col-scope > * {
		text-align: end;
	}

	.dsp-surveys-table td.dsp-col-actions {
		display: block;
	}

	.dsp-surveys-table td.dsp-col-actions::before {
		display: none;
	}

	.dsp-row-actions {
		display: grid;
		grid-template-columns: repeat(3, 1fr);
		gap: 8px;
	}

	.dsp-row-actions .dsp-act {
		padding: 10px 6px;
		font-size: 14px;
		text-align: center;
	}

	/* کلید بزرگ‌تر برای لمس با انگشت */
	.dsp-switch-track {
		width: 52px;
		height: 30px;
	}

	.dsp-switch-knob {
		top: 3px;
		left: 3px;
		width: 24px;
		height: 24px;
	}

	.dsp-switch.is-on .dsp-switch-knob {
		transform: translateX(22px);
	}

	/* فرم‌ها */
	.dsp-admin-wrap .form-table input.regular-text,
	.dsp-admin-wrap .form-table input[type="text"],
	.dsp-admin-wrap .form-table input[type="url"],
	.dsp-admin-wrap .form-table select,
	.dsp-admin-wrap .form-table textarea {
		width: 100% !important;
		max-width: 100% !important;
		min-height: 40px;
	}

	.dsp-admin-wrap .form-table th {
		width: auto !important;
		padding-bottom: 4px;
	}

	.dsp-scope-box,
	.dsp-shortcode-box {
		max-width: 100%;
		padding: 12px;
	}

	.dsp-scope-panel {
		padding-inline-start: 0;
	}

	.dsp-scope-option {
		padding: 6px 0;
	}

	.dsp-category-block {
		padding: 12px;
	}

	.dsp-product-row,
	.dsp-btn-row-item {
		padding: 10px;
	}

	.dsp-category-block-header,
	.dsp-product-row-header,
	.dsp-btn-row-header {
		flex-wrap: wrap;
		gap: 8px;
	}

	/* جدول‌های فیلدها (محصول، دکمه، تم رنگی) → زیر هم */
	.dsp-admin-wrap table.dsp-product-fields,
	.dsp-admin-wrap table.dsp-product-fields tbody,
	.dsp-admin-wrap table.dsp-product-fields tr,
	.dsp-admin-wrap table.dsp-product-fields th,
	.dsp-admin-wrap table.dsp-product-fields td,
	.dsp-admin-wrap table.dsp-theme-table,
	.dsp-admin-wrap table.dsp-theme-table tbody,
	.dsp-admin-wrap table.dsp-theme-table tr,
	.dsp-admin-wrap table.dsp-theme-table th,
	.dsp-admin-wrap table.dsp-theme-table td {
		display: block;
		width: 100% !important;
		box-sizing: border-box;
	}

	.dsp-admin-wrap table.dsp-product-fields th,
	.dsp-admin-wrap table.dsp-theme-table th {
		padding-bottom: 2px;
	}

	.dsp-admin-wrap table.dsp-product-fields td input,
	.dsp-admin-wrap table.dsp-theme-table td select {
		width: 100% !important;
		min-height: 40px;
	}

	.dsp-admin-wrap table.dsp-product-fields td input[type="number"] {
		width: 120px !important;
	}

	.dsp-theme-preview {
		display: inline-block;
		margin: 8px 0 0;
	}

	.dsp-custom-color-row label {
		display: block;
		margin: 0 0 10px;
	}

	/* دکمه‌های اصلی راحت‌تر لمس شوند */
	.dsp-admin-wrap .button,
	.dsp-admin-wrap .button-primary {
		min-height: 40px;
		padding: 6px 16px;
		line-height: 1.8;
	}

	.dsp-admin-wrap p.submit .button-primary {
		width: 100%;
	}

	/* جدول ورودی‌ها: اسکرول افقی روان */
	.dsp-entries-table {
		min-width: 900px;
	}
}
