/* =====================================================================================
   سفیروت | استایل ماشین‌حساب هزینه
   پالت: زمینه‌ی روشن و گرم + سرمه‌ای عمیق (اصلی) + طلایی (تاکید/قیمت)
   الهام از نام برند (سفیروت / درخت زندگی): نشانگر مراحل به‌صورت گره‌های متصل
   ===================================================================================== */

#sephiroth-calculator-root {
	--sph-bg: #FAF7F2;
	--sph-surface: #FFFFFF;
	--sph-primary: #241B3A;
	--sph-primary-soft: #3C2E5C;
	--sph-accent: #C9932E;
	--sph-accent-soft: #F4E8D0;
	--sph-text: #241B3A;
	--sph-text-muted: #6B647F;
	--sph-border: #E5E0D8;
	--sph-success: #2F7D5D;
	--sph-success-soft: #E4F1EB;
	--sph-error: #B3392F;
	--sph-error-soft: #FBEAE8;
	--sph-radius: 14px;

	font-family: 'Vazirmatn', Tahoma, sans-serif;
	color: var(--sph-text);
	background: var(--sph-bg);
	border: 1px solid var(--sph-border);
	border-radius: var(--sph-radius);
	padding: 28px;
	max-width: 920px;
	margin: 0 auto;
	box-sizing: border-box;
	direction: rtl;
	text-align: right;
	line-height: 1.9;
}

#sephiroth-calculator-root *,
#sephiroth-calculator-root *::before,
#sephiroth-calculator-root *::after {
	box-sizing: border-box;
}

.sephiroth-calc-boot-message {
	text-align: center;
	color: var(--sph-text-muted);
	padding: 40px 0;
}

/* ---------------------------------------------------------------------------
   نشانگر مراحل (Stepper) - سه گره‌ی متصل، الهام از ساختار سفیروت
--------------------------------------------------------------------------- */

.sph-stepper {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	margin-bottom: 28px;
}

.sph-stepper .sph-step {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 6px;
	flex: 0 0 auto;
}

.sph-stepper .sph-dot {
	width: 30px;
	height: 30px;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 13px;
	font-weight: 700;
	background: var(--sph-surface);
	border: 2px solid var(--sph-border);
	color: var(--sph-text-muted);
	transition: all .25s ease;
}

.sph-stepper .sph-step.active .sph-dot {
	border-color: var(--sph-primary);
	color: var(--sph-primary);
	box-shadow: 0 0 0 4px var(--sph-accent-soft);
}

.sph-stepper .sph-step.done .sph-dot {
	background: var(--sph-accent);
	border-color: var(--sph-accent);
	color: #fff;
}

.sph-stepper .sph-label {
	font-size: 12px;
	color: var(--sph-text-muted);
}

.sph-stepper .sph-line {
	width: 48px;
	height: 2px;
	background: var(--sph-border);
	margin-bottom: 20px;
}

.sph-stepper .sph-line.done {
	background: var(--sph-accent);
}

/* ---------------------------------------------------------------------------
   انتخاب دسته (کارت‌های گرید)
--------------------------------------------------------------------------- */

.sph-category-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
	gap: 12px;
}

.sph-category-card {
	background: var(--sph-surface);
	border: 1px solid var(--sph-border);
	border-radius: 12px;
	padding: 18px 12px;
	text-align: center;
	cursor: pointer;
	transition: all .15s ease;
	position: relative;
}

.sph-category-card:hover:not(.disabled) {
	border-color: var(--sph-accent);
	transform: translateY(-2px);
	box-shadow: 0 6px 16px rgba(36, 27, 58, 0.08);
}

.sph-category-card .sph-icon {
	font-size: 28px;
	display: block;
	margin-bottom: 8px;
}

.sph-category-card .sph-cat-label {
	font-size: 13.5px;
	font-weight: 600;
}

.sph-category-card.disabled {
	opacity: .5;
	cursor: not-allowed;
}

.sph-category-card .sph-badge {
	position: absolute;
	top: 8px;
	left: 8px;
	font-size: 10px;
	background: var(--sph-accent-soft);
	color: var(--sph-accent);
	padding: 2px 7px;
	border-radius: 20px;
}

/* ---------------------------------------------------------------------------
   فرم فیلدهای دسته + خلاصه قیمت (چیدمان دو ستونه)
--------------------------------------------------------------------------- */

.sph-fields-layout {
	display: grid;
	grid-template-columns: 1fr;
	gap: 20px;
}

@media (min-width: 860px) {
	.sph-fields-layout {
		grid-template-columns: 1.6fr 1fr;
		align-items: start;
	}
}

.sph-field-group {
	background: var(--sph-surface);
	border: 1px solid var(--sph-border);
	border-radius: 12px;
	padding: 18px;
	margin-bottom: 14px;
}

.sph-field-group label.sph-field-label {
	display: block;
	font-weight: 700;
	margin-bottom: 10px;
	font-size: 14.5px;
}

/* quantity */
.sph-qty-control {
	display: flex;
	align-items: center;
	gap: 12px;
	justify-content: flex-start;
}

.sph-qty-btn {
	width: 34px;
	height: 34px;
	border-radius: 50%;
	border: 1px solid var(--sph-border);
	background: var(--sph-bg);
	font-size: 18px;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	color: var(--sph-primary);
}

.sph-qty-btn:hover { border-color: var(--sph-accent); color: var(--sph-accent); }

/* toggle: کلید روشن/خاموش
   نکته: سلکتورها رو با #sephiroth-calculator-root و !important تقویت کردیم چون بعضی
   قالب‌های وردپرس روی تگ button یا اندازه‌ی باکس‌ها استایل پیش‌فرض می‌ذارن که باعث
   به‌هم‌ریختن جاگذاری دکمه‌ی تاگل می‌شه. */
#sephiroth-calculator-root .sph-toggle-control {
	display: flex;
	align-items: center;
	gap: 10px;
}

#sephiroth-calculator-root .sph-toggle-switch {
	box-sizing: border-box !important;
	width: 52px !important;
	height: 28px !important;
	min-width: 52px;
	border-radius: 20px;
	border: none !important;
	background: var(--sph-border);
	position: relative;
	cursor: pointer;
	transition: background .2s ease;
	padding: 0 !important;
	margin: 0;
	flex-shrink: 0;
	display: inline-block;
	line-height: normal;
}

#sephiroth-calculator-root .sph-toggle-switch.on {
	background: var(--sph-success);
}

#sephiroth-calculator-root .sph-toggle-knob {
	box-sizing: border-box !important;
	position: absolute;
	top: 3px;
	right: 3px;
	left: auto;
	width: 22px !important;
	height: 22px !important;
	border-radius: 50%;
	background: #fff;
	box-shadow: 0 1px 3px rgba(0,0,0,.25);
	transition: left .2s ease, right .2s ease;
	margin: 0;
}

/* حالت روشن: به‌جای جابه‌جایی با transform (که با تغییر عرض باکس به‌هم می‌ریزه)،
   مستقیم right رو خالی و left رو ست می‌کنیم - همیشه دقیقه، صرف‌نظر از عرض واقعی باکس */
#sephiroth-calculator-root .sph-toggle-switch.on .sph-toggle-knob {
	right: auto;
	left: 3px;
}

#sephiroth-calculator-root .sph-toggle-state-label {
	font-size: 13.5px;
	color: var(--sph-text-muted);
	font-weight: 600;
}

/* duration: سه باکس مستقل ساعت/دقیقه/ثانیه */
.sph-duration-control {
	display: flex;
	gap: 14px;
	flex-wrap: wrap;
}

.sph-duration-box {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 8px;
}

.sph-duration-box-label {
	font-size: 12.5px;
	color: var(--sph-text-muted);
	font-weight: 600;
}

.sph-duration-btn {
	width: 30px;
	height: 30px;
	border-radius: 50%;
	border: 1px solid var(--sph-border);
	background: var(--sph-bg);
	font-size: 16px;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	color: var(--sph-primary);
}

.sph-duration-btn:hover { border-color: var(--sph-accent); color: var(--sph-accent); }

.sph-duration-input {
	width: 52px;
	text-align: center;
	font-weight: 700;
	font-size: 15px;
	padding: 6px 2px;
	border: 1px solid var(--sph-border);
	border-radius: 8px;
	font-family: inherit;
	background: var(--sph-surface);
	color: var(--sph-text);
	-moz-appearance: textfield;
}

.sph-duration-input::-webkit-outer-spin-button,
.sph-duration-input::-webkit-inner-spin-button {
	-webkit-appearance: none;
	margin: 0;
}

.sph-duration-input:focus {
	outline: none;
	border-color: var(--sph-primary);
}

.sph-duration-total {
	margin-top: 12px;
	font-size: 13px;
	color: var(--sph-text-muted);
}

/* dimension: طول × عرض + واحد */
.sph-dimension-control {
	display: flex;
	align-items: flex-end;
	gap: 10px;
	flex-wrap: wrap;
}

.sph-dimension-box-group {
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.sph-dimension-sublabel {
	font-size: 12px;
	color: var(--sph-text-muted);
	font-weight: 600;
}

.sph-dimension-input {
	width: 90px;
	padding: 9px 10px;
	border: 1px solid var(--sph-border);
	border-radius: 8px;
	font-family: inherit;
	font-size: 14px;
	text-align: center;
	background: var(--sph-surface);
	color: var(--sph-text);
}

.sph-dimension-input:focus {
	outline: none;
	border-color: var(--sph-primary);
}

.sph-dimension-x {
	font-size: 16px;
	font-weight: 700;
	color: var(--sph-text-muted);
	padding-bottom: 9px;
}

.sph-dimension-unit {
	padding: 9px 10px;
	border-radius: 8px;
	border: 1px solid var(--sph-border);
	background: var(--sph-bg);
	font-family: inherit;
	font-size: 13.5px;
	color: var(--sph-text);
}

/* هشدار چشمک‌زن جهت‌گیری اشتباه ابعاد - عمداً پررنگ‌تر و جدی‌تر از وارنینگ معمولی */
.sph-dimension-orientation-warning {
	margin-top: 12px;
	padding: 10px 14px;
	border-radius: 8px;
	background: var(--sph-error);
	color: #fff;
	font-size: 13.5px;
	font-weight: 800;
	line-height: 1.8;
	animation: sph-blink 1s step-start infinite;
}

@keyframes sph-blink {
	50% { opacity: 0.35; }
}

@media (prefers-reduced-motion: reduce) {
	.sph-dimension-orientation-warning {
		animation: none;
	}
}

.sph-qty-value,
.sph-qty-input {
	min-width: 50px;
	max-width: 70px;
	text-align: center;
	font-weight: 700;
	font-size: 16px;
}

.sph-qty-input {
	padding: 7px 4px;
	border: 1px solid var(--sph-border);
	border-radius: 8px;
	font-family: inherit;
	background: var(--sph-surface);
	color: var(--sph-text);
	-moz-appearance: textfield;
}

.sph-qty-input::-webkit-outer-spin-button,
.sph-qty-input::-webkit-inner-spin-button {
	-webkit-appearance: none;
	margin: 0;
}

.sph-qty-input:focus {
	outline: none;
	border-color: var(--sph-primary);
}

/* range: اسلایدر */
.sph-range-control {
	padding: 6px 4px 0;
}

.sph-range-value {
	text-align: center;
	font-weight: 700;
	font-size: 17px;
	color: var(--sph-primary);
	margin-bottom: 14px;
}

.sph-range-input {
	width: 100%;
	-webkit-appearance: none;
	appearance: none;
	height: 6px;
	border-radius: 4px;
	background: var(--sph-border);
	outline: none;
	cursor: pointer;
	direction: ltr; /* برای اینکه کشیدن به راست = افزایش عدد باشه، مثل همه‌ی اسلایدرهای استاندارد */
}

.sph-range-input::-webkit-slider-thumb {
	-webkit-appearance: none;
	appearance: none;
	width: 22px;
	height: 22px;
	border-radius: 50%;
	background: var(--sph-primary);
	border: 3px solid #fff;
	box-shadow: 0 0 0 1px var(--sph-border), 0 2px 6px rgba(36,27,58,.25);
	cursor: pointer;
}

.sph-range-input::-moz-range-thumb {
	width: 22px;
	height: 22px;
	border-radius: 50%;
	background: var(--sph-primary);
	border: 3px solid #fff;
	box-shadow: 0 0 0 1px var(--sph-border), 0 2px 6px rgba(36,27,58,.25);
	cursor: pointer;
}

.sph-range-scale {
	display: flex;
	justify-content: space-between;
	font-size: 11.5px;
	color: var(--sph-text-muted);
	margin-top: 8px;
	direction: ltr;
}

/* select: cards */
.sph-option-cards {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
}

/* وقتی گزینه‌ها عکس دارن، چیدمان ثابت دو‌ستونه (نه بر اساس اندازه‌ی عکس‌ها) */
.sph-option-cards.has-images {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: 12px;
}

@media (max-width: 480px) {
	.sph-option-cards.has-images {
		grid-template-columns: 1fr;
	}
}

.sph-option-cards.has-images .sph-option-card {
	display: flex;
	flex-direction: column;
	align-items: center;
	text-align: center;
	padding: 10px;
}

.sph-option-card {
	border: 1.5px solid var(--sph-border);
	border-radius: 10px;
	padding: 10px 16px;
	cursor: pointer;
	font-size: 13.5px;
	transition: all .15s ease;
	background: var(--sph-bg);
}

.sph-option-card.selected {
	border-color: var(--sph-primary);
	background: var(--sph-primary);
	color: #fff;
}

.sph-option-card:hover:not(.selected) {
	border-color: var(--sph-accent);
}

.sph-option-img {
	display: block;
	width: 100%;
	aspect-ratio: 1 / 1;
	max-width: 140px;
	object-fit: cover;
	margin: 0 auto 8px;
	border-radius: 8px;
	background: #f2efe8;
}

.sph-field-warning {
	margin-top: 12px;
	padding: 10px 14px;
	border-radius: 8px;
	background: var(--sph-error-soft);
	color: var(--sph-error);
	font-size: 13px;
	line-height: 1.8;
}

/* note: جعبه‌ی پیام اطلاع‌رسانی ساده (بدون قیمت، بدون ورودی) */
.sph-note-box {
	background: var(--sph-accent-soft);
	border: 1px solid var(--sph-accent);
}

.sph-note-title {
	font-weight: 700;
	margin-bottom: 6px;
	color: var(--sph-primary);
}

.sph-note-text {
	font-size: 13.5px;
	color: var(--sph-text);
	line-height: 1.9;
}

/* subgroup: جعبه‌ی متمایز برای زیردسته‌ی فیلدها (مثلاً بخش عکاسی داخل کاتالوگ) */
.sph-subgroup-box {
	border: 1.5px dashed var(--sph-primary);
	border-radius: 14px;
	padding: 16px;
	margin-bottom: 14px;
	background: rgba(36, 27, 58, 0.02);
}

.sph-subgroup-title {
	font-weight: 800;
	color: var(--sph-primary);
	margin-bottom: 12px;
	font-size: 15px;
}

/* select: dropdown */
.sph-select-dropdown {
	width: 100%;
	padding: 10px 12px;
	border-radius: 8px;
	border: 1px solid var(--sph-border);
	background: var(--sph-bg);
	font-family: inherit;
	font-size: 14px;
	color: var(--sph-text);
}

/* multiselect (checkbox tags) */
.sph-checkbox-list {
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.sph-checkbox-item {
	display: flex;
	align-items: center;
	gap: 8px;
	font-size: 14px;
	cursor: pointer;
}

.sph-checkbox-item input {
	width: 17px;
	height: 17px;
	accent-color: var(--sph-primary);
}

/* ---------------------------------------------------------------------------
   پنل خلاصه‌ی قیمت (چسبان)
--------------------------------------------------------------------------- */

.sph-summary-panel.sph-luxury-panel {
	--lux-bg-1: #070707;
	--lux-bg-2: #121212;
	--lux-bg-3: #0a0a0a;
	--lux-gold: #C9A227;
	--lux-gold-soft: #D9B84C;
	--lux-gold-dim: rgba(201, 162, 39, 0.35);
	--lux-low: #E55A5A;
	--lux-text: #F3F1EA;
	--lux-text-dim: rgba(243, 241, 234, 0.55);

	position: relative;
	background:
		radial-gradient(120% 140% at 15% -10%, rgba(201,162,39,0.06), transparent 55%),
		linear-gradient(165deg, var(--lux-bg-2) 0%, var(--lux-bg-1) 45%, var(--lux-bg-3) 100%);
	color: var(--lux-text);
	border-radius: 18px;
	padding: 26px 22px;
	position: sticky;
	top: 20px;
	border: 1px solid transparent;
	background-clip: padding-box;
	box-shadow:
		0 0 0 1px rgba(201,162,39,0.28),
		0 0 24px rgba(201,162,39,0.10),
		inset 0 1px 0 rgba(255,255,255,0.04),
		inset 0 0 30px rgba(0,0,0,0.35);
}

/* هایلایت ظریف گوشه‌ها، شبیه انعکاس نور روی فلز */
.sph-summary-panel.sph-luxury-panel::before {
	content: '';
	position: absolute;
	inset: 0;
	border-radius: 18px;
	pointer-events: none;
	background: linear-gradient(135deg, rgba(255,255,255,0.05) 0%, transparent 18%);
}

.sph-summary-panel .sph-summary-service {
	font-weight: 400;
	font-size: 13.5px;
	color: var(--lux-text-dim);
	text-align: center;
	margin-bottom: 20px;
	letter-spacing: .2px;
}

/* قیمت جهانی (دلاری) */
.sph-global-price-block {
	text-align: center;
	margin-bottom: 24px;
}

.sph-global-price-label {
	font-size: 11.5px;
	font-weight: 400;
	color: var(--lux-text-dim);
	letter-spacing: 1px;
	margin-bottom: 8px;
}

.sph-global-price-value {
	font-size: 26px;
	font-weight: 800;
	color: var(--lux-text);
	direction: ltr;
}

.sph-global-price-value span {
	font-size: 13px;
	font-weight: 500;
	color: var(--lux-gold-soft);
	margin-right: 4px;
}

/* نوار بازه‌ی منصفانه */
.sph-range-track-wrap {
	margin-bottom: 24px;
}

.sph-range-track {
	position: relative;
	height: 6px;
	border-radius: 6px;
	margin: 0 4px 14px;
	background: linear-gradient(90deg, var(--lux-low) 0%, rgba(255,255,255,0.12) 50%, var(--lux-gold-soft) 100%);
	box-shadow: inset 0 1px 2px rgba(0,0,0,0.4);
	direction: ltr;
}

.sph-range-marker {
	position: absolute;
	top: 50%;
	width: 16px;
	height: 16px;
	border-radius: 50%;
	background: radial-gradient(circle at 35% 30%, #fff, var(--lux-gold) 70%);
	box-shadow: 0 0 10px rgba(201,162,39,0.7), 0 0 0 3px rgba(0,0,0,0.5);
	transform: translate(-50%, -50%);
}

.sph-range-labels {
	display: flex;
	justify-content: space-between;
	direction: ltr;
}

.sph-range-item {
	display: flex;
	flex-direction: column;
	gap: 4px;
}

.sph-range-item-max {
	align-items: flex-end;
	text-align: left;
}

.sph-range-tag {
	font-size: 10.5px;
	font-weight: 400;
	color: var(--lux-text-dim);
}

.sph-range-item .sph-range-value {
	font-size: 13px;
	font-weight: 600;
	color: var(--lux-text);
}

/* کارت استودیو - برجسته‌ترین بخش */
.sph-studio-card {
	display: flex;
	align-items: center;
	gap: 14px;
	padding: 16px 18px;
	border-radius: 14px;
	background: linear-gradient(160deg, rgba(255,255,255,0.05), rgba(255,255,255,0.015));
	border: 1px solid rgba(201,162,39,0.3);
	margin-bottom: 16px;
}

.sph-studio-logo {
	width: 34px;
	height: 34px;
	object-fit: contain;
	flex-shrink: 0;
}

.sph-studio-info {
	display: flex;
	flex-direction: column;
	gap: 3px;
}

.sph-studio-name {
	font-size: 12px;
	font-weight: 500;
	color: var(--lux-text-dim);
	font-family: 'Georgia', 'Times New Roman', serif;
	letter-spacing: .3px;
}

.sph-studio-price {
	font-size: 19px;
	font-weight: 800;
	color: var(--lux-gold-soft);
}

.sph-summary-panel.sph-luxury-panel .sph-dollar-note {
	font-size: 11px;
	font-weight: 400;
	color: var(--lux-text-dim);
	text-align: center;
	border-top: 1px solid rgba(255,255,255,0.08);
	padding-top: 12px;
	margin-top: 4px;
}

/* ---------------------------------------------------------------------------
   دکمه‌ها و ناوبری
--------------------------------------------------------------------------- */

.sph-nav-row {
	display: flex;
	justify-content: space-between;
	margin-top: 22px;
	gap: 10px;
}

.sph-btn {
	padding: 12px 22px;
	border-radius: 10px;
	border: none;
	font-family: inherit;
	font-size: 14.5px;
	font-weight: 700;
	cursor: pointer;
	transition: all .15s ease;
}

.sph-btn-primary {
	background: var(--sph-primary);
	color: #fff;
}

.sph-btn-primary:hover { background: var(--sph-primary-soft); }

.sph-btn-primary:disabled {
	opacity: .5;
	cursor: not-allowed;
}

.sph-btn-ghost {
	background: transparent;
	color: var(--sph-text-muted);
	border: 1px solid var(--sph-border);
}

.sph-btn-ghost:hover { border-color: var(--sph-text-muted); }

/* ---------------------------------------------------------------------------
   فرم ثبت سفارش
--------------------------------------------------------------------------- */

.sph-fluentform-host {
	padding: 4px 2px;
}

/* یه ظاهر پایه‌ی هماهنگ با بقیه‌ی سایت به ورودی‌های Fluent Forms می‌دیم؛
   اگه قالب/پوسته‌ی خود Fluent Forms قبلاً استایل داده باشه، همون قوی‌تر عمل می‌کنه */
.sph-fluentform-host .ff-el-form-control {
	border-radius: 9px !important;
	font-family: inherit !important;
}

.sph-order-form input[type="text"],
.sph-order-form input[type="tel"],
.sph-order-form input[type="email"],
.sph-order-form textarea {
	width: 100%;
	padding: 11px 14px;
	border-radius: 9px;
	border: 1px solid var(--sph-border);
	font-family: inherit;
	font-size: 14px;
	margin-bottom: 14px;
	background: var(--sph-surface);
	color: var(--sph-text);
}

.sph-order-form textarea {
	min-height: 100px;
	resize: vertical;
}

.sph-order-form label {
	display: block;
	font-size: 13px;
	font-weight: 600;
	margin-bottom: 6px;
	color: var(--sph-text-muted);
}

.sph-form-msg {
	padding: 12px 16px;
	border-radius: 10px;
	font-size: 13.5px;
	margin-top: 12px;
}

.sph-form-msg.success {
	background: var(--sph-success-soft);
	color: var(--sph-success);
}

.sph-form-msg.error {
	background: var(--sph-error-soft);
	color: var(--sph-error);
}

/* ---------------------------------------------------------------------------
   واکنش‌گرا برای موبایل
--------------------------------------------------------------------------- */

@media (max-width: 560px) {
	#sephiroth-calculator-root {
		padding: 18px;
	}
	.sph-summary-panel {
		position: static;
	}
	.sph-stepper .sph-line {
		width: 24px;
	}
}

/* احترام به تنظیم کاهش انیمیشن سیستم‌عامل */
@media (prefers-reduced-motion: reduce) {
	#sephiroth-calculator-root * {
		transition: none !important;
	}
}
