/* ==========================================================================
   مدیریت درخواست خودرو — استایل فرانت‌اند نسخه ۲ (RTL، بزرگ‌تر و موبایل‌محور)
   رنگ‌ها از طریق متغیرها در تم شما قابل بازنویسی هستند.
   ========================================================================== */

.crm-wrap {
	--crm-accent: #0f766e;
	--crm-accent-hover: #0c5d56;
	--crm-bg: #ffffff;
	--crm-surface: #f1f5f9;
	--crm-border: #d8e0e8;
	--crm-text: #16202c;
	--crm-muted: #5b6b7a;
	--crm-success-bg: #ecfdf5;
	--crm-success-text: #065f46;
	--crm-error-bg: #fef2f2;
	--crm-error-text: #991b1b;
	--crm-radius: 16px;
	--crm-shadow: 0 1px 3px rgba(15, 23, 42, .07), 0 12px 34px rgba(15, 23, 42, .06);

	direction: rtl;
	text-align: right;
	color: var(--crm-text);
	font-family: inherit;
	font-size: 17px;
	line-height: 1.85;
	max-width: 1200px;
	margin: 0 auto;
	padding: 0 14px;
}

.crm-wrap *,
.crm-wrap *::before,
.crm-wrap *::after { box-sizing: border-box; }

.crm-title {
	font-size: 1.9rem;
	font-weight: 800;
	margin: 0 0 8px;
	letter-spacing: -.01em;
}

.crm-subtitle {
	color: var(--crm-muted);
	margin: 0 0 24px;
	font-size: 1.08rem;
}

.crm-note {
	margin-top: 18px;
	color: var(--crm-muted);
	font-size: .98rem;
	background: var(--crm-surface);
	border-radius: 12px;
	padding: 12px 16px;
}

/* ---------- کارت / فرم ---------- */

.crm-card {
	background: var(--crm-bg);
	border: 1px solid var(--crm-border);
	border-radius: var(--crm-radius);
	box-shadow: var(--crm-shadow);
	padding: 34px;
}

.crm-form-header { margin-bottom: 22px; }

.crm-grid {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: 22px;
}

.crm-field {
	display: flex;
	flex-direction: column;
	gap: 9px;
}

.crm-field-full { grid-column: 1 / -1; }

.crm-field label {
	font-weight: 700;
	font-size: 1.06rem;
}

.crm-req { color: #e11d48; margin-inline-start: 3px; }
.crm-unit { color: var(--crm-muted); font-weight: 600; font-size: .92rem; }

.crm-field input,
.crm-field select,
.crm-field textarea {
	width: 100%;
	padding: 15px 16px;
	border: 1.5px solid var(--crm-border);
	border-radius: 12px;
	background: var(--crm-surface);
	color: var(--crm-text);
	font: inherit;
	font-size: 1.08rem;
	transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}

.crm-field select { cursor: pointer; }

.crm-field input:focus,
.crm-field select:focus,
.crm-field textarea:focus {
	outline: none;
	border-color: var(--crm-accent);
	background: #fff;
	box-shadow: 0 0 0 4px rgba(15, 118, 110, .14);
}

.crm-field textarea {
	resize: vertical;
	min-height: 120px;
}

.crm-price-input {
	letter-spacing: .04em;
	font-variant-numeric: tabular-nums;
}

.crm-file-input {
	width: 100%;
	padding: 13px 16px;
	border: 1.5px dashed var(--crm-border);
	border-radius: 12px;
	background: var(--crm-surface);
	font: inherit;
	font-size: 1.02rem;
	cursor: pointer;
}
.crm-file-input::file-selector-button {
	font: inherit;
	font-weight: 700;
	margin-inline-end: 12px;
	padding: 9px 18px;
	border: none;
	border-radius: 9px;
	background: var(--crm-accent);
	color: #fff;
	cursor: pointer;
}
.crm-file-hint {
	font-size: .9rem;
	color: var(--crm-muted);
}

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

.crm-chips { display: flex; flex-wrap: wrap; gap: 10px; }

.crm-chip { position: relative; margin: 0; }
.crm-chip input { position: absolute; opacity: 0; width: 0; height: 0; }
.crm-chip span {
	display: inline-block;
	padding: 11px 20px;
	border: 1.5px solid var(--crm-border);
	border-radius: 999px;
	background: var(--crm-surface);
	color: var(--crm-text);
	cursor: pointer;
	font-weight: 700;
	font-size: 1.04rem;
	user-select: none;
	transition: background .12s ease, color .12s ease, border-color .12s ease;
}
.crm-chip span:hover { border-color: var(--crm-accent); }
.crm-chip input:checked + span { background: var(--crm-accent); color: #fff; border-color: var(--crm-accent); }
.crm-chip input:focus-visible + span { box-shadow: 0 0 0 4px rgba(15, 118, 110, .18); }

.crm-field-hint { font-size: .9rem; color: var(--crm-muted); }

/* ---------- کمبوباکس جستجوی شهر ---------- */

.crm-native-hidden { display: none !important; }

.crm-combo { position: relative; width: 100%; }

.crm-combo-button {
	width: 100%;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	padding: 15px 16px;
	border: 1.5px solid var(--crm-border);
	border-radius: 12px;
	background: var(--crm-surface);
	color: var(--crm-text);
	font: inherit;
	font-size: 1.08rem;
	cursor: pointer;
	text-align: right;
}
.crm-combo-button:hover { border-color: #b9c6d2; }
.crm-combo.open .crm-combo-button {
	border-color: var(--crm-accent);
	background: #fff;
	box-shadow: 0 0 0 4px rgba(15, 118, 110, .14);
}
.crm-combo-ph { color: var(--crm-muted); }
.crm-combo-value { font-weight: 700; }
.crm-combo-chev { color: var(--crm-muted); font-size: .9rem; transition: transform .15s ease; }
.crm-combo.open .crm-combo-chev { transform: rotate(180deg); }

.crm-combo-panel {
	display: none;
	position: absolute;
	z-index: 50;
	top: calc(100% + 6px);
	inset-inline: 0;
	background: #fff;
	border: 1.5px solid var(--crm-border);
	border-radius: 12px;
	box-shadow: 0 14px 38px rgba(15, 23, 42, .16);
	overflow: hidden;
}
.crm-combo.open .crm-combo-panel { display: block; }

.crm-combo-search {
	position: sticky;
	top: 0;
	background: #fff;
	padding: 12px;
	border-bottom: 1px solid var(--crm-border);
}
.crm-combo-search input {
	width: 100%;
	padding: 12px 14px;
	border: 1.5px solid var(--crm-border);
	border-radius: 10px;
	background: var(--crm-surface);
	font: inherit;
	font-size: 1.04rem;
	color: var(--crm-text);
}
.crm-combo-search input:focus {
	outline: none;
	border-color: var(--crm-accent);
	background: #fff;
}

.crm-combo-list { max-height: 280px; overflow-y: auto; padding: 6px; }

.crm-combo-group {
	font-size: .9rem;
	font-weight: 800;
	color: var(--crm-muted);
	padding: 10px 12px 6px;
	position: sticky;
	top: 0;
	background: #fff;
}

.crm-combo-option {
	padding: 12px 14px;
	border-radius: 9px;
	cursor: pointer;
	font-size: 1.06rem;
	line-height: 1.4;
}
.crm-combo-option:hover,
.crm-combo-option.crm-active { background: rgba(15, 118, 110, .1); color: var(--crm-accent-hover); }
.crm-combo-option.crm-selected { font-weight: 800; color: var(--crm-accent); }

.crm-combo-empty { padding: 22px 14px; text-align: center; color: var(--crm-muted); }

.crm-field-error {
	font-size: .92rem;
	color: var(--crm-error-text);
	min-height: 1em;
}

.crm-field.crm-has-error input,
.crm-field.crm-has-error select,
.crm-field.crm-has-error textarea {
	border-color: #e11d48;
	box-shadow: 0 0 0 4px rgba(225, 29, 72, .12);
}

/* تله اسپم پنهان */
.crm-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* ---------- دکمه‌ها ---------- */

.crm-submit-row { margin-top: 28px; }

.crm-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	background: var(--crm-accent);
	color: #fff;
	border: none;
	border-radius: 12px;
	padding: 16px 40px;
	font: inherit;
	font-weight: 800;
	font-size: 1.12rem;
	cursor: pointer;
	text-decoration: none;
	transition: background .15s ease, transform .05s ease;
}

.crm-btn:hover { background: var(--crm-accent-hover); color: #fff; }
.crm-btn:active { transform: translateY(1px); }
.crm-btn:disabled { opacity: .65; cursor: not-allowed; }

.crm-btn-sm { padding: 12px 22px; font-size: 1rem; }

.crm-spinner {
	width: 18px; height: 18px;
	border: 2.5px solid rgba(255, 255, 255, .45);
	border-top-color: #fff;
	border-radius: 50%;
	animation: crm-spin .7s linear infinite;
}
@keyframes crm-spin { to { transform: rotate(360deg); } }

/* ---------- اعلان‌ها ---------- */

.crm-alert {
	border-radius: 12px;
	padding: 16px 18px;
	margin-bottom: 20px;
	font-weight: 700;
	font-size: 1.04rem;
}
.crm-alert-success { background: var(--crm-success-bg); color: var(--crm-success-text); border: 1px solid #a7f3d0; }
.crm-alert-error { background: var(--crm-error-bg); color: var(--crm-error-text); border: 1px solid #fecaca; }

/* ---------- دروازه ورود ---------- */

.crm-login-gate {
	text-align: center;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 16px;
	color: var(--crm-text);
}
.crm-login-gate svg { color: var(--crm-accent); }
.crm-login-gate p { font-size: 1.15rem; margin: 0; max-width: 420px; }

/* ---------- لیست ---------- */

.crm-list-header {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-end;
	justify-content: space-between;
	gap: 18px;
	margin-bottom: 28px;
}

.crm-filters {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
	align-items: center;
}

.crm-filters input,
.crm-filters select {
	padding: 13px 16px;
	border: 1.5px solid var(--crm-border);
	border-radius: 12px;
	background: var(--crm-surface);
	font: inherit;
	font-size: 1.02rem;
	color: var(--crm-text);
}
.crm-filters input:focus,
.crm-filters select:focus {
	outline: none;
	border-color: var(--crm-accent);
	box-shadow: 0 0 0 4px rgba(15, 118, 110, .14);
}

.crm-cards {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
	gap: 26px;
}

.crm-car-card {
	background: var(--crm-bg);
	border: 1px solid var(--crm-border);
	border-radius: var(--crm-radius);
	overflow: hidden;
	box-shadow: var(--crm-shadow);
	display: flex;
	flex-direction: column;
	transition: transform .18s ease, box-shadow .18s ease;
}
.crm-car-card:hover { transform: translateY(-5px); box-shadow: 0 16px 38px rgba(15, 23, 42, .14); }

.crm-car-media {
	position: relative;
	display: block;
	aspect-ratio: 16 / 10;
	background: var(--crm-surface);
	overflow: hidden;
}
.crm-car-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.crm-car-noimg { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; color: #b6c2cf; }

.crm-badges { position: absolute; top: 14px; inset-inline-end: 14px; display: flex; flex-wrap: wrap; gap: 7px; }

.crm-badge {
	font-size: .86rem;
	font-weight: 800;
	padding: 6px 14px;
	border-radius: 999px;
	background: rgba(15, 23, 42, .72);
	color: #fff;
	backdrop-filter: blur(4px);
}
.crm-badge-customer { background: rgba(15, 118, 110, .92); }
.crm-badge-business { background: rgba(180, 83, 9, .92); }

.crm-car-body {
	padding: 22px;
	display: flex;
	flex-direction: column;
	gap: 14px;
	flex: 1;
}

.crm-car-title { font-size: 1.32rem; font-weight: 800; margin: 0; line-height: 1.5; }
.crm-car-title a { color: inherit; text-decoration: none; }
.crm-car-title a:hover { color: var(--crm-accent); }

.crm-car-price { font-size: 1.22rem; font-weight: 800; color: var(--crm-accent); }

.crm-car-specs {
	list-style: none; margin: 0; padding: 0;
	display: grid; grid-template-columns: 1fr 1fr; gap: 10px 16px;
}
.crm-car-specs li {
	display: flex; justify-content: space-between; gap: 8px;
	font-size: 1rem; border-bottom: 1px dashed var(--crm-border); padding-bottom: 8px;
}
.crm-spec-label { color: var(--crm-muted); }
.crm-spec-val { font-weight: 700; }

.crm-car-cta {
	margin-top: auto;
	display: block;
	text-align: center;
	background: var(--crm-accent);
	color: #fff;
	border-radius: 12px;
	padding: 13px;
	font-weight: 800;
	font-size: 1.06rem;
	text-decoration: none;
	transition: background .15s ease;
}
.crm-car-cta:hover { background: var(--crm-accent-hover); color: #fff; }

.crm-empty {
	text-align: center; padding: 70px 20px;
	color: var(--crm-muted);
	background: var(--crm-surface);
	border: 1px dashed var(--crm-border);
	border-radius: var(--crm-radius);
	font-size: 1.1rem;
}

/* ---------- صفحه‌بندی ---------- */

.crm-pagination { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 38px; }
.crm-page {
	min-width: 48px; height: 48px;
	display: inline-flex; align-items: center; justify-content: center;
	border: 1.5px solid var(--crm-border); border-radius: 12px;
	text-decoration: none; color: var(--crm-text); font-weight: 700; font-size: 1.05rem;
	transition: all .15s ease;
}
.crm-page:hover { border-color: var(--crm-accent); color: var(--crm-accent); }
.crm-page-current { background: var(--crm-accent); color: #fff; border-color: var(--crm-accent); }

/* ---------- صفحه تکی ---------- */

.crm-single { padding-top: 28px; padding-bottom: 28px; }

.crm-single-head {
	display: grid;
	grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
	gap: 30px;
	align-items: start;
	background: var(--crm-bg);
	border: 1px solid var(--crm-border);
	border-radius: var(--crm-radius);
	box-shadow: var(--crm-shadow);
	padding: 26px;
	margin-bottom: 30px;
}
.crm-single-media { border-radius: 12px; overflow: hidden; background: var(--crm-surface); }
.crm-single-media img { width: 100%; height: 100%; object-fit: cover; display: block; }

.crm-single-info { display: flex; flex-direction: column; gap: 14px; }
.crm-single-title { font-size: 2rem; font-weight: 800; margin: 4px 0 0; }

.crm-single-specs {
	list-style: none; margin: 6px 0 0; padding: 0;
	display: grid; grid-template-columns: 1fr 1fr; gap: 12px 18px;
}
.crm-single-specs li {
	display: flex; justify-content: space-between; gap: 8px;
	font-size: 1.08rem; border-bottom: 1px dashed var(--crm-border); padding-bottom: 9px;
}
.crm-single-desc { font-size: 1.06rem; color: var(--crm-text); }
.crm-single-desc p { margin: 0 0 10px; }

.crm-single-offer { margin-top: 8px; }
.crm-offer-card { border-top: 4px solid var(--crm-accent); }

/* ---------- ریسپانسیو ---------- */

@media (max-width: 860px) {
	.crm-single-head { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
	.crm-wrap { font-size: 16.5px; }
	.crm-grid { grid-template-columns: 1fr; gap: 18px; }
	.crm-card { padding: 22px 18px; }
	.crm-title { font-size: 1.55rem; }
	.crm-single-title { font-size: 1.6rem; }
	.crm-list-header { flex-direction: column; align-items: stretch; }
	.crm-filters { width: 100%; }
	.crm-filters input { flex: 1 1 100%; }
	.crm-filters select { flex: 1 1 calc(50% - 6px); }
	.crm-car-specs, .crm-single-specs { grid-template-columns: 1fr; }
	.crm-cards { grid-template-columns: 1fr; }
	.crm-btn { width: 100%; }
	.crm-field input, .crm-field select, .crm-field textarea { font-size: 16px; } /* جلوگیری از زوم خودکار iOS */
	.crm-combo-button, .crm-combo-search input, .crm-combo-option { font-size: 16px; }
}
