/*
 * style.css — EscBay Pricing Calculator
 * توکن‌های طراحی: کرم/سفید + نارنجی EscBay + سبز لیمویی ملایم.
 */

@import url('https://fonts.googleapis.com/css2?family=Vazirmatn:wght@400;500;600;700;800&display=swap');

.escbay-calculator {
	--escbay-orange: #f4732a;
	--escbay-orange-dark: #d95d14;
	--escbay-lime: #b7db4b;
	--escbay-lime-dark: #96bd2e;
	--escbay-cream: #fffbf2;
	--escbay-white: #ffffff;
	--escbay-ink: #2b2420;
	--escbay-ink-soft: #706558;
	--escbay-line: #efe6d6;
	--escbay-danger: #d64545;
	--escbay-radius-lg: 20px;
	--escbay-radius-md: 12px;
	--escbay-shadow: 0 10px 30px -14px rgba(43, 36, 32, 0.22);

	font-family: 'Vazirmatn', Tahoma, Arial, sans-serif;
	color: var(--escbay-ink);
	background: var(--escbay-cream);
	border-radius: var(--escbay-radius-lg);
	padding: clamp(16px, 3vw, 32px);
	box-sizing: border-box;
	direction: rtl;
}

.escbay-calculator *,
.escbay-calculator *::before,
.escbay-calculator *::after {
	box-sizing: border-box;
}

.escbay-editor-wrap { direction: rtl; }
.escbay-editor-badge {
	background: #fff4e8;
	border: 1px dashed var(--escbay-orange);
	color: var(--escbay-orange-dark);
	border-radius: 10px;
	padding: 10px 14px;
	font-family: 'Vazirmatn', Tahoma, sans-serif;
	font-size: 13px;
	margin-bottom: 10px;
}

/* -------------------- چیدمان -------------------- */
.escbay-grid {
	display: grid;
	grid-template-columns: 1fr;
	gap: 28px;
}

@media (min-width: 960px) {
	.escbay-grid {
		grid-template-columns: 1.35fr 1fr;
		align-items: start;
	}
	.escbay-result {
		position: sticky;
		top: 24px;
	}
}

/* -------------------- فرم -------------------- */
.escbay-form {
	background: var(--escbay-white);
	border: 1px solid var(--escbay-line);
	border-radius: var(--escbay-radius-lg);
	padding: clamp(18px, 3vw, 28px);
	display: flex;
	flex-direction: column;
	gap: 20px;
}

.escbay-row {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 16px;
}

@media (max-width: 560px) {
	.escbay-row { grid-template-columns: 1fr; }
}

.escbay-field-group {
	display: flex;
	flex-direction: column;
	gap: 8px;
	border: none;
	padding: 0;
	margin: 0;
	min-width: 0;
}

.escbay-label {
	font-size: 14px;
	font-weight: 600;
	color: var(--escbay-ink);
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 8px;
}

.escbay-legend {
	font-size: 15px;
	font-weight: 700;
	color: var(--escbay-orange-dark);
	padding: 0 0 4px;
}

.escbay-live-value {
	font-weight: 700;
	color: var(--escbay-orange-dark);
	font-variant-numeric: tabular-nums;
}

.escbay-static-value {
	background: var(--escbay-cream);
	border: 1px solid var(--escbay-line);
	border-radius: var(--escbay-radius-md);
	padding: 10px 14px;
	font-weight: 600;
	color: var(--escbay-ink-soft);
}

/* چیپ‌های انتخاب نوع دستگاه */
.escbay-chip-group {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.escbay-chip {
	font-family: inherit;
	font-size: 14px;
	font-weight: 600;
	background: var(--escbay-cream);
	border: 1.5px solid var(--escbay-line);
	color: var(--escbay-ink);
	border-radius: 999px;
	padding: 9px 18px;
	cursor: pointer;
	transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.1s ease;
}

.escbay-chip:hover { border-color: var(--escbay-orange); }

.escbay-chip:active { transform: scale(0.97); }

.escbay-chip[aria-checked="true"] {
	background: var(--escbay-orange);
	border-color: var(--escbay-orange);
	color: #fff;
}

/* فیلدهای انتخاب و ورودی */
.escbay-select,
.escbay-form input[type='text'],
.escbay-form input[type='tel'],
.escbay-form textarea {
	font-family: inherit;
	font-size: 14px;
	background: var(--escbay-white);
	border: 1.5px solid var(--escbay-line);
	border-radius: var(--escbay-radius-md);
	padding: 10px 14px;
	color: var(--escbay-ink);
	width: 100%;
	appearance: none;
}

.escbay-select {
	background-image: linear-gradient(45deg, transparent 50%, var(--escbay-ink-soft) 50%),
		linear-gradient(135deg, var(--escbay-ink-soft) 50%, transparent 50%);
	background-position: left 16px center, left 10px center;
	background-size: 6px 6px, 6px 6px;
	background-repeat: no-repeat;
}

.escbay-select:disabled {
	color: var(--escbay-ink-soft);
	background-color: var(--escbay-cream);
	cursor: not-allowed;
}

.escbay-select:focus-visible,
.escbay-form input:focus-visible,
.escbay-form textarea:focus-visible,
.escbay-chip:focus-visible,
.escbay-btn:focus-visible,
.escbay-range:focus-visible {
	outline: 2.5px solid var(--escbay-orange);
	outline-offset: 2px;
}

/* چک‌باکس‌ها */
.escbay-checkbox-grid {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: 10px;
}

@media (max-width: 560px) {
	.escbay-checkbox-grid { grid-template-columns: 1fr; }
}

.escbay-checkbox {
	display: flex;
	align-items: center;
	gap: 8px;
	font-size: 14px;
	background: var(--escbay-cream);
	border: 1.5px solid var(--escbay-line);
	border-radius: var(--escbay-radius-md);
	padding: 9px 12px;
	cursor: pointer;
	user-select: none;
}

.escbay-checkbox input { accent-color: var(--escbay-orange); width: 17px; height: 17px; flex-shrink: 0; }

.escbay-checkbox-block { grid-column: 1 / -1; }

/* اسلایدر سلامت باتری */
.escbay-range {
	width: 100%;
	accent-color: var(--escbay-lime-dark);
	height: 6px;
	cursor: pointer;
}

/* دستگاه‌های اختصاصی آیفون */
.escbay-iphone-only {
	background: #fff8ef;
	border: 1px solid #fde4c8;
	border-radius: var(--escbay-radius-md);
	padding: 16px;
	display: flex;
	flex-direction: column;
	gap: 14px;
}

.escbay-iphone-only[hidden] { display: none; }

/* دکمه‌ها */
.escbay-btn {
	font-family: inherit;
	font-size: 14px;
	font-weight: 700;
	border-radius: 999px;
	padding: 12px 22px;
	border: 1.5px solid transparent;
	cursor: pointer;
	transition: filter 0.15s ease, transform 0.1s ease, background 0.15s ease;
}

.escbay-btn:active { transform: scale(0.98); }

.escbay-btn-primary {
	background: var(--escbay-orange);
	color: #fff;
}
.escbay-btn-primary:hover { filter: brightness(1.06); }
.escbay-btn-primary:disabled { opacity: 0.6; cursor: not-allowed; }

.escbay-btn-outline {
	background: transparent;
	border-color: var(--escbay-ink);
	color: var(--escbay-ink);
}
.escbay-btn-outline:hover { background: var(--escbay-ink); color: #fff; }

.escbay-btn-ghost {
	background: transparent;
	border-color: var(--escbay-line);
	color: var(--escbay-ink-soft);
}
.escbay-btn-ghost:hover { border-color: var(--escbay-ink-soft); color: var(--escbay-ink); }

.escbay-actions { display: flex; justify-content: flex-start; }

/* -------------------- ستون نتیجه -------------------- */
.escbay-result-card {
	background: linear-gradient(180deg, #ffffff 0%, var(--escbay-cream) 100%);
	border: 1px solid var(--escbay-line);
	border-radius: var(--escbay-radius-lg);
	box-shadow: var(--escbay-shadow);
	padding: clamp(20px, 3vw, 28px);
	display: flex;
	flex-direction: column;
	align-items: center;
	text-align: center;
	gap: 12px;
}

.escbay-device-visual {
	width: 56px;
	height: 56px;
	color: var(--escbay-orange);
}
.escbay-device-visual svg { width: 100%; height: 100%; }

.escbay-result-title {
	font-size: 18px;
	font-weight: 700;
	margin: 0;
}

/* گیج دایره‌ای — عنصر شاخص صفحه */
.escbay-dial-wrap {
	position: relative;
	width: 140px;
	height: 140px;
	margin: 4px 0;
}

.escbay-dial { width: 100%; height: 100%; transform: rotate(-90deg); }

.escbay-dial-track {
	fill: none;
	stroke: var(--escbay-line);
	stroke-width: 10;
}

.escbay-dial-value {
	fill: none;
	stroke: var(--escbay-lime-dark);
	stroke-width: 10;
	stroke-linecap: round;
	stroke-dasharray: 326.7256;
	stroke-dashoffset: 326.7256;
	transition: stroke-dashoffset 0.6s ease, stroke 0.4s ease;
}

.escbay-dial-center {
	position: absolute;
	inset: 0;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
}

.escbay-dial-score {
	font-size: 26px;
	font-weight: 800;
	font-variant-numeric: tabular-nums;
	color: var(--escbay-ink);
}

.escbay-dial-score-label {
	font-size: 11px;
	color: var(--escbay-ink-soft);
}

.escbay-price-range {
	font-size: 22px;
	font-weight: 800;
	color: var(--escbay-orange-dark);
	line-height: 1.5;
}

.escbay-price-range.is-review {
	color: var(--escbay-danger);
	font-size: 18px;
}

.escbay-base-price {
	font-size: 13px;
	color: var(--escbay-ink-soft);
}
.escbay-base-price span { font-weight: 700; color: var(--escbay-ink); }

.escbay-summary {
	font-size: 13px;
	color: var(--escbay-ink-soft);
	line-height: 1.9;
}

.escbay-factors {
	width: 100%;
	display: flex;
	flex-direction: column;
	gap: 6px;
	text-align: right;
}

.escbay-factor-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	font-size: 12.5px;
	background: var(--escbay-white);
	border: 1px solid var(--escbay-line);
	border-radius: 10px;
	padding: 8px 12px;
}

.escbay-factor-name { color: var(--escbay-ink); }

.escbay-factor-tag {
	font-weight: 700;
	white-space: nowrap;
	border-radius: 999px;
	padding: 2px 10px;
	font-size: 11.5px;
}
.escbay-factor-tag.positive { background: #eef7d9; color: #5b7a17; }
.escbay-factor-tag.low { background: #fdeedc; color: #b5620f; }
.escbay-factor-tag.medium { background: #fbe0cc; color: #a2470f; }
.escbay-factor-tag.high { background: #fadada; color: #a52424; }

.escbay-disclaimer {
	font-size: 11.5px;
	color: var(--escbay-ink-soft);
	line-height: 1.7;
	margin: 4px 0 0;
}

.escbay-result-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	justify-content: center;
	width: 100%;
	margin-top: 6px;
}

/* -------------------- مودال درخواست بررسی -------------------- */
.escbay-modal {
	position: fixed;
	inset: 0;
	z-index: 999999;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;
}
.escbay-modal[hidden] { display: none; }

.escbay-modal-overlay {
	position: absolute;
	inset: 0;
	background: rgba(43, 36, 32, 0.5);
}

.escbay-modal-box {
	position: relative;
	background: #fff;
	border-radius: var(--escbay-radius-lg);
	padding: 24px;
	width: min(420px, 100%);
	display: flex;
	flex-direction: column;
	gap: 10px;
	box-shadow: var(--escbay-shadow);
	font-family: 'Vazirmatn', Tahoma, sans-serif;
	direction: rtl;
}

.escbay-modal-box h3 { margin: 0 0 6px; font-size: 17px; }

.escbay-modal-actions {
	display: flex;
	gap: 10px;
	margin-top: 6px;
}

.escbay-request-status {
	font-size: 13px;
	min-height: 18px;
	margin: 4px 0 0;
}
.escbay-request-status.success { color: #5b7a17; }
.escbay-request-status.error { color: var(--escbay-danger); }

/* -------------------- چاپ -------------------- */
@media print {
	.escbay-form,
	.escbay-result-actions,
	.escbay-modal { display: none !important; }
	.escbay-grid { display: block; }
	.escbay-result-card { box-shadow: none; border: 1px solid #ccc; }
}

/* -------------------- کاهش حرکت -------------------- */
@media (prefers-reduced-motion: reduce) {
	.escbay-dial-value,
	.escbay-btn,
	.escbay-chip {
		transition: none !important;
	}
}

/* ==========================================================================
   موارد اضافه‌شده: هشدار قرمز روی «همراه دستگاه نیست»، توضیح محاسبه،
   تگ سال عرضه، حالت غیرفعال بخش ایرادها (وقتی «کاملاً نو» زده شود)،
   و چک‌باکس هشدار Activation Lock.
   ========================================================================== */
.escbay-defect-heading {
	color: var(--escbay-danger);
	font-weight: 800;
	font-size: 14px;
	margin: 18px 0 10px;
}

.escbay-year-tag {
	display: inline-block;
	margin-top: 6px;
	font-size: 11.5px;
	color: var(--escbay-ink-soft);
	background: var(--escbay-bg-soft, #f3f3f3);
	border-radius: 999px;
	padding: 3px 10px;
}

.escbay-calc-explain {
	font-size: 12px;
	color: var(--escbay-ink-soft);
	line-height: 1.9;
	background: var(--escbay-bg-soft, #f6f6f6);
	border-radius: 10px;
	padding: 10px 12px;
	margin-top: 6px;
}
.escbay-calc-explain strong { color: var(--escbay-ink); }

.escbay-disclaimer--strong {
	color: var(--escbay-danger);
	font-weight: 700;
	font-size: 12.5px;
}

.escbay-defect-section.is-disabled {
	opacity: 0.45;
	pointer-events: none;
}

.escbay-checkbox--highlight {
	background: #fff7e6;
	border: 1px dashed var(--escbay-orange);
	border-radius: 10px;
	padding: 10px 12px;
}

.escbay-checkbox--warning span { color: var(--escbay-danger); font-weight: 700; }

/* ==========================================================================
   موارد اضافه‌شده: هشدار قرمز روی «همراه دستگاه نیست»، توضیح محاسبه،
   تگ سال عرضه، حالت غیرفعال بخش ایرادها، چک‌باکس هشدار Activation Lock،
   دکمهٔ accent، لغزندهٔ سلامت باتری، عکس مدل، پیام هشدار «نوع دستگاه»،
   جعبهٔ تیزر اپل، و ردیف لینک‌های ارتباطی.
   ========================================================================== */
.escbay-defect-heading {
	color: var(--escbay-danger);
	font-weight: 800;
	font-size: 14px;
	margin: 18px 0 10px;
}

.escbay-year-tag {
	display: inline-block;
	margin-top: 6px;
	font-size: 11.5px;
	color: var(--escbay-ink-soft);
	background: var(--escbay-bg-soft, #f3f3f3);
	border-radius: 999px;
	padding: 3px 10px;
}

.escbay-calc-explain {
	font-size: 12px;
	color: var(--escbay-ink-soft);
	line-height: 1.9;
	background: var(--escbay-bg-soft, #f6f6f6);
	border-radius: 10px;
	padding: 10px 12px;
	margin-top: 16px;
}
.escbay-calc-explain strong { color: var(--escbay-ink); }

.escbay-disclaimer--strong {
	color: var(--escbay-danger);
	font-weight: 700;
	font-size: 12.5px;
}

.escbay-defect-section.is-disabled {
	opacity: 0.45;
	pointer-events: none;
}

.escbay-checkbox--highlight {
	background: #fff7e6;
	border: 1px dashed var(--escbay-orange);
	border-radius: 10px;
	padding: 10px 12px;
}

.escbay-checkbox--warning span { color: var(--escbay-danger); font-weight: 700; }

.escbay-btn-accent {
	background: var(--escbay-ink);
	color: #fff;
}
.escbay-btn-accent:hover { filter: brightness(1.15); }

.escbay-slider {
	width: 100%;
	accent-color: var(--escbay-orange);
	height: 6px;
	cursor: pointer;
}

.escbay-model-image {
	display: block;
	width: 100%;
	max-height: 220px;
	object-fit: contain;
	border-radius: 12px;
	background: var(--escbay-bg-soft, #f3f3f3);
	margin: 10px 0 16px;
}

.escbay-warning-flash {
	display: none;
	color: var(--escbay-danger);
	font-weight: 800;
	font-size: 12.5px;
	margin-top: 6px;
}
.escbay-warning-flash.is-flash {
	display: block;
	animation: escbay-flash-in 0.35s ease;
}
@keyframes escbay-flash-in {
	0% { opacity: 0; transform: translateY(-4px); }
	100% { opacity: 1; transform: translateY(0); }
}

.escbay-tradein-teaser {
	margin-top: 18px;
	padding: 14px;
	border-radius: 12px;
	border: 1px dashed var(--escbay-line);
	text-align: center;
}
.escbay-tradein-teaser p { margin: 0 0 10px; font-weight: 700; font-size: 13px; }

.escbay-contact-row {
	margin-top: 14px;
	display: flex;
	gap: 12px;
	align-items: center;
	flex-wrap: wrap;
	font-size: 12.5px;
}
.escbay-contact-row__label { color: var(--escbay-ink-soft); }
.escbay-contact-row a {
	color: var(--escbay-orange);
	font-weight: 700;
	text-decoration: underline;
}

/* پیشنهاد اقدام (ریموو اپل آیدی / صفحه تعمیرات) — کنار چک‌باکس مربوطه */
.escbay-suggestion {
	margin-top: 8px;
	padding: 10px 12px;
	background: #fff4e5;
	border: 1px dashed var(--escbay-orange);
	border-radius: 8px;
	font-size: 12.5px;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px;
}
