.epc-configurator {
	--epc-primary: #2271b1;
	--epc-primary-dark: #135e96;
	--epc-border: #e3e6ea;
	--epc-bg: #f7f8fa;
	--epc-radius: 10px;
	direction: rtl;
	text-align: right;
	font-family: inherit;
	max-width: 880px;
	margin: 0 auto;
	background: #fff;
	border: 1px solid var(--epc-border);
	border-radius: var(--epc-radius);
	box-shadow: 0 2px 14px rgba(20,30,50,.06);
	overflow: hidden;
}
.epc-configurator * { box-sizing: border-box; }

/* پیمایش بالا (پیل‌ها) */
.epc-pills {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	padding: 12px 16px;
	background: var(--epc-bg);
	border-bottom: 1px solid var(--epc-border);
}
.epc-pill {
	font-size: 12px;
	padding: 5px 12px;
	border-radius: 999px;
	background: #fff;
	border: 1px solid var(--epc-border);
	color: #777;
	cursor: pointer;
	white-space: nowrap;
	transition: all .15s ease;
}
.epc-pill.is-passed { border-color: var(--epc-primary); color: var(--epc-primary); }
.epc-pill.is-active { background: var(--epc-primary); border-color: var(--epc-primary); color: #fff; font-weight: 600; }

.epc-layout { display: flex; flex-wrap: wrap; gap: 0; }
.epc-preview-pane {
	flex: 1 1 260px;
	max-width: 280px;
	padding: 16px;
	background: var(--epc-bg);
	border-left: 1px solid var(--epc-border);
}
.epc-steps-pane { flex: 1 1 380px; padding: 16px 20px; min-height: 280px; display: flex; flex-direction: column; }

/* استیج پیش‌نمایش */
.epc-preview-stage {
	position: relative;
	width: 100%;
	height: 220px;
	margin: 0 auto;
	background: #fff;
	border: 1px solid var(--epc-border);
	border-radius: 8px;
	overflow: hidden;
	transition: width .2s ease, height .2s ease;
}
.epc-body-image { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; z-index: 1; }
.epc-color-overlay { position: absolute; inset: 0; mix-blend-mode: multiply; z-index: 2; pointer-events: none; display: none; }
.epc-lights-layer { position: absolute; inset: 0; z-index: 3; }
.epc-light-dot {
	position: absolute; width: 14px; height: 14px; border-radius: 50%;
	border: 2px solid #fff; box-shadow: 0 0 5px rgba(0,0,0,.4);
	transform: translate(-50%, -50%); cursor: grab;
}
.epc-light-dot:active { cursor: grabbing; }
.epc-resize-handle {
	position: absolute; bottom: 4px; left: 4px; width: 20px; height: 20px;
	background: rgba(34,113,177,.92); color: #fff; border-radius: 4px;
	display: flex; align-items: center; justify-content: center; font-size: 11px;
	cursor: nwse-resize; z-index: 4; user-select: none;
}
.epc-dims-readout { text-align: center; margin-top: 10px; font-size: 12px; color: #555; min-height: 16px; }
.epc-total-price { text-align: center; margin-top: 6px; font-size: 17px; font-weight: 700; color: #1d2327; }
.epc-total-price .epc-currency { font-size: 12px; font-weight: 400; color: #777; }

/* محتوای مرحله */
.epc-step-heading h4 { margin: 0 0 4px; font-size: 15px; }
.epc-req-star { color: #d63638; }
.epc-step-help { font-size: 12px; color: #777; margin: 0 0 10px; }
.epc-step-content { flex: 1; }

.epc-text-field { width: 100%; max-width: 360px; border: 1px solid var(--epc-border); border-radius: 6px; padding: 9px 12px; font-size: 14px; font-family: inherit; }
textarea.epc-text-field { resize: vertical; }
.epc-select-field { width: 100%; max-width: 360px; border: 1px solid var(--epc-border); border-radius: 6px; padding: 9px 12px; font-size: 14px; }

.epc-options-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.epc-opt {
	display: flex; align-items: center; gap: 6px;
	border: 1.5px solid var(--epc-border); border-radius: 8px;
	padding: 7px 12px; cursor: pointer; font-size: 13px;
	transition: border-color .15s ease, background .15s ease;
}
.epc-opt:hover { border-color: #bcc4cc; }
.epc-opt.is-selected { border-color: var(--epc-primary); background: #eaf3fa; }

.epc-mode-image_choice .epc-opt { flex-direction: column; text-align: center; padding: 8px; min-width: 86px; }
.epc-mode-image_choice .epc-opt img { width: 56px; height: 56px; object-fit: contain; }

.epc-swatch { width: 26px; height: 26px; border-radius: 50%; border: 1px solid #ccc; display: block; }
.epc-radio-dot { width: 14px; height: 14px; border-radius: 50%; border: 2px solid #bbb; display: inline-block; flex-shrink: 0; }
.epc-opt.is-selected .epc-radio-dot { border-color: var(--epc-primary); background: var(--epc-primary); box-shadow: inset 0 0 0 2px #fff; }
.epc-check-box { width: 16px; height: 16px; border: 2px solid #bbb; border-radius: 3px; display: flex; align-items: center; justify-content: center; font-size: 11px; color: #fff; flex-shrink: 0; }
.epc-opt.is-selected .epc-check-box { background: var(--epc-primary); border-color: var(--epc-primary); }
.epc-opt-price { color: var(--epc-primary); font-size: 11px; }

.epc-range-wrap { display: flex; align-items: center; gap: 10px; max-width: 420px; }
.epc-range-wrap input[type="range"] { flex: 1; }
.epc-range-number { width: 75px; border: 1px solid var(--epc-border); border-radius: 6px; padding: 6px 8px; }
.epc-range-unit { font-size: 12px; color: #777; }

.epc-pos-row { margin-bottom: 10px; }
.epc-pos-toggle { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; cursor: pointer; }
.epc-pos-colors { display: flex; gap: 6px; margin: 6px 0 0 24px; }
.epc-pos-color-dot { width: 22px; height: 22px; border-radius: 50%; border: 2px solid #ddd; cursor: pointer; }
.epc-pos-color-dot.is-selected { border-color: var(--epc-primary); }

/* کلید روشن/خاموش */
.epc-toggle-wrap { display: flex; align-items: center; gap: 10px; cursor: pointer; font-size: 13px; }
.epc-toggle-switch { position: relative; display: inline-block; width: 40px; height: 22px; }
.epc-toggle-switch input { opacity: 0; width: 0; height: 0; }
.epc-toggle-slider { position: absolute; inset: 0; background: #ccc; border-radius: 999px; transition: .2s; }
.epc-toggle-slider::before { content: ""; position: absolute; width: 16px; height: 16px; right: 3px; top: 3px; background: #fff; border-radius: 50%; transition: .2s; }
.epc-toggle-switch input:checked + .epc-toggle-slider { background: var(--epc-primary); }
.epc-toggle-switch input:checked + .epc-toggle-slider::before { transform: translateX(-18px); }

/* آپلود فایل */
.epc-file-wrap { display: flex; flex-direction: column; gap: 6px; max-width: 360px; }
.epc-file-status { font-size: 12px; color: #555; }
.epc-file-status a { color: var(--epc-primary); }

/* ناوبری */
.epc-nav-row { display: flex; justify-content: space-between; gap: 10px; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--epc-border); }
.epc-btn { border: none; border-radius: 7px; padding: 10px 22px; font-size: 13px; cursor: pointer; font-family: inherit; }
.epc-btn-primary { background: var(--epc-primary); color: #fff; }
.epc-btn-primary:hover { background: var(--epc-primary-dark); }
.epc-btn-primary:disabled { opacity: .6; cursor: default; }
.epc-btn-ghost { background: #fff; border: 1px solid var(--epc-border); color: #444; }
.epc-btn-ghost:disabled { opacity: .4; cursor: default; }

/* خلاصه سفارش */
.epc-summary-step h4 { margin: 0 0 10px; font-size: 15px; }
.epc-summary-table { width: 100%; border-collapse: collapse; margin-bottom: 14px; font-size: 12px; }
.epc-summary-table td { padding: 6px 4px; border-bottom: 1px solid var(--epc-border); }
.epc-summary-table td:last-child { text-align: left; color: #555; }

.epc-customer-form { display: flex; flex-direction: column; gap: 10px; margin-bottom: 14px; max-width: 360px; }
.epc-customer-form label { font-size: 12px; font-weight: 600; display: flex; flex-direction: column; gap: 4px; }
.epc-customer-form input, .epc-customer-form textarea {
	border: 1px solid var(--epc-border); border-radius: 6px; padding: 8px 10px; font-size: 13px; font-family: inherit;
}
.epc-captcha-label { flex-direction: row !important; align-items: center; gap: 8px !important; font-weight: 600; }
.epc-captcha-answer { width: 70px !important; }

.epc-order-message { margin-top: 10px; font-size: 13px; }
.epc-order-message.is-success { color: #1a7f37; }
.epc-order-message.is-error { color: #b32d2e; }

/* پاپ‌آپ موفقیت */
.epc-modal-overlay {
	position: fixed; inset: 0; background: rgba(20,25,35,.5);
	display: flex; align-items: center; justify-content: center; z-index: 99999; padding: 16px;
}
.epc-modal-box {
	background: #fff; border-radius: 12px; padding: 30px 26px; max-width: 360px; width: 100%;
	text-align: center; box-shadow: 0 10px 40px rgba(0,0,0,.25);
}
.epc-modal-icon {
	width: 56px; height: 56px; border-radius: 50%; background: #e6f6ec; color: #1a7f37;
	display: flex; align-items: center; justify-content: center; font-size: 26px; margin: 0 auto 14px;
}
.epc-modal-box h3 { margin: 0 0 8px; font-size: 17px; }
.epc-modal-text { font-size: 13px; color: #666; margin: 0 0 18px; line-height: 1.8; }

@media (max-width: 720px) {
	.epc-layout { flex-direction: column; }
	.epc-preview-pane { max-width: 100%; border-left: none; border-bottom: 1px solid var(--epc-border); }
	.epc-preview-stage { height: 200px; }
}
