/* ==========================================================================
   برگه ها: برگه ساده، تماس، همکاری و فروش عمده، لیست استعلام، جستجوی عمومی و 404
   (از contact.html و wholesale.html دمو). ظاهر عمومی فرم ها (.cn-form): تماس، همکاری
   و لیست استعلام.
   ========================================================================== */

/* ---- برگه ساده: متن با عرض ستون مقاله ---- */
.page-prose {
	max-width: var(--wp--style--global--content-size);
}

/* متن کوتاه زیر تیتر بخش (شرایط خرید عمده، سبد کامل)، مثل دمو زیر تیتر نه کنار آن */
.section .section-head > p:not(.more-link) {
	flex-basis: 100%;
	margin: 0;
	color: var(--wp--custom--color--text-muted);
}

/* ---- Page head actions: دو دکمه سر صفحه همکاری ---- */
.page-head .page-head__actions {
	margin-top: var(--wp--preset--spacing--3);
}

/* ---- Contact: مشخصات، نقشه، مسیر دسترسی ---- */
.contact-grid {
	display: grid;
	gap: var(--wp--preset--spacing--4);
}

.contact-card {
	display: grid;
	gap: var(--wp--preset--spacing--3);
	align-content: start;
	padding: var(--wp--preset--spacing--3);
	border: var(--wp--custom--border-width) solid var(--wp--custom--color--border);
	border-radius: var(--wp--preset--border-radius--default);
	background: var(--wp--custom--color--surface);
}

.contact-card .info-list {
	margin: 0;
}

/* پیام رسان ها و اینستاگرام در فهرست مشخصات: لینک با آیکن، کنار هم */
.contact-links {
	display: flex;
	flex-wrap: wrap;
	gap: 0 var(--wp--preset--spacing--2);
	margin: 0;
	padding: 0;
	list-style: none;
}

.contact-links a {
	display: inline-flex;
	align-items: center;
	gap: var(--wp--preset--spacing--half);
	min-height: var(--wp--custom--size--tap);
	font-weight: var(--wp--custom--font-weight--bold);
}

.contact-links .icon {
	width: var(--wp--custom--size--icon-sm);
	height: var(--wp--custom--size--icon-sm);
}

/* سه دکمه نقشه هم اندازه، در یک ردیف */
.btn-row.map-links > .btn {
	flex: 1 1 0;
	min-width: 0;
	padding-inline: var(--wp--preset--spacing--1);
}

.route-list {
	display: grid;
	gap: var(--wp--preset--spacing--2);
	margin: 0;
	padding: 0;
	list-style: none;
}

.route-list li {
	padding: var(--wp--preset--spacing--2);
	border-radius: var(--wp--preset--border-radius--default);
	background: var(--wp--custom--color--surface-alt);
}

.route-list strong {
	display: block;
}

@media (min-width: 64em) {
	.contact-grid {
		grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr);
		align-items: stretch;
	}

	.contact-grid .placeholder {
		min-height: 100%;
	}

	.contact-grid--even {
		grid-template-columns: 1fr 1fr;
	}
}

/* ---- کادر استعلام صفحه تماس: گروه هسته است. فاصله فرزندان مثل جعبه استعلام محصول ---- */
.section .inquiry.is-layout-flow > * {
	margin: 0 0 var(--wp--preset--spacing--2);
}

.section .inquiry.is-layout-flow > .inquiry__title {
	margin-bottom: var(--wp--preset--spacing--half);
}

.section .inquiry.is-layout-flow > .contact-actions {
	margin-bottom: var(--wp--preset--spacing--3);
}

.section .inquiry.is-layout-flow > :last-child,
.contact-actions > :last-child {
	margin-bottom: 0;
}

/* بخش فرم زیر دکمه ها، با خط جدا کننده مثل فرم صفحه محصول */
.cn-form-section {
	display: grid;
	gap: var(--wp--preset--spacing--2);
	padding-top: var(--wp--preset--spacing--3);
	border-top: var(--wp--custom--border-width) solid var(--wp--custom--color--border);
}

.section .cn-form-section > * {
	margin: 0;
}

.cn-form-section__title {
	font-size: var(--wp--preset--font-size--sm);
	font-weight: var(--wp--custom--font-weight--bold);
}

/* ---- Steps: مراحل همکاری (فهرست شماره دار هسته). شماره فارسی با CSS ---- */
.steps {
	display: grid;
	gap: var(--wp--preset--spacing--2);
	margin: 0;
	padding: 0;
	list-style: none;
	counter-reset: step;
}

.steps li {
	counter-increment: step;
	position: relative;
	padding: var(--wp--preset--spacing--2);
	padding-inline-start: calc(var(--wp--preset--spacing--2) * 2 + var(--wp--custom--size--control));
	border: var(--wp--custom--border-width) solid var(--wp--custom--color--border);
	border-radius: var(--wp--preset--border-radius--default);
	background: var(--wp--custom--color--surface);
	color: var(--wp--custom--color--text-muted);
	font-size: var(--wp--preset--font-size--sm);
}

.steps li::before {
	content: counter(step, persian);
	position: absolute;
	inset-block-start: var(--wp--preset--spacing--2);
	inset-inline-start: var(--wp--preset--spacing--2);
	display: flex;
	align-items: center;
	justify-content: center;
	width: var(--wp--custom--size--control);
	height: var(--wp--custom--size--control);
	border-radius: var(--wp--preset--border-radius--default);
	background: var(--wp--preset--color--primary);
	color: var(--wp--custom--color--text-inverse);
	font-size: var(--wp--preset--font-size--lg);
	font-weight: var(--wp--custom--font-weight--black);
}

.steps strong {
	display: block;
	margin-bottom: var(--wp--preset--spacing--half);
	color: var(--wp--custom--color--text);
	font-size: var(--wp--preset--font-size--base);
	font-weight: var(--wp--custom--font-weight--bold);
	line-height: var(--wp--custom--line-height--tight);
}

@media (min-width: 64em) {
	.steps {
		grid-template-columns: repeat(4, minmax(0, 1fr));
		gap: var(--wp--preset--spacing--3);
	}

	.steps li {
		padding: var(--wp--preset--spacing--3);
	}

	.steps li::before {
		position: static;
		margin-bottom: var(--wp--preset--spacing--2);
	}
}

/* ---- Chips: دسته های سطح اول در «سبد کامل در یک جا». ظاهر برچسب ها در components.css ---- */
.chip-list .wp-block-term-name {
	margin: 0;
}

/* ---- Terms: جدول شرایط خرید عمده. جدول هسته با ظاهر جدول مقاله و سرستون سطری مثل
   جدول مشخصات محصول. عنوان جدول فقط برای صفحه خوان است. ---- */
.table-wrap.terms {
	position: relative;
	max-width: var(--wp--custom--size--lead);
	margin: 0;
}

.terms .table {
	min-width: 0;
}

.terms .table th {
	width: var(--wp--custom--size--row-head);
	color: var(--wp--custom--color--text-muted);
	font-weight: var(--wp--custom--font-weight--medium);
}

.terms .table caption {
	position: absolute;
	inset-block-start: 0;
	inset-inline-start: 0;
	padding: 0;
	overflow: hidden;
	white-space: nowrap;
	clip-path: inset(50%);
}

/* ---- Form card: کادر فرم همکاری ---- */
.form-card {
	max-width: var(--wp--custom--size--inquiry);
	padding: var(--wp--preset--spacing--3) var(--wp--preset--spacing--2);
	border: var(--wp--custom--border-width-thick) solid var(--wp--preset--color--primary);
	border-radius: var(--wp--preset--border-radius--default);
	background: var(--wp--custom--color--surface);
}

.section .form-card > * {
	margin: 0 0 var(--wp--preset--spacing--2);
}

.section .form-card > h2 {
	margin-bottom: var(--wp--preset--spacing--half);
	font-size: var(--wp--preset--font-size--lg);
}

.section .form-card > :last-child {
	margin-bottom: 0;
}

@media (min-width: 48em) {
	.form-card {
		padding: var(--wp--preset--spacing--4);
	}
}

/* ==========================================================================
   .cn-form: ظاهر عمومی فرم Fluent Forms (فرم تماس و فرم همکاری، بلوک cntech/form).
   همان ظاهر .field دمو. CSS پیش فرض Fluent Forms بار نمی شود (افزونه).
   ========================================================================== */
.cn-form form,
.cn-form fieldset {
	margin: 0;
}

.cn-form fieldset {
	display: grid;
	gap: var(--wp--preset--spacing--2);
	min-width: 0;
	padding: 0;
	border: 0;
}

/* عنوان فرم برای صفحه خوان (legend خود Fluent Forms، که خودش اندازه صفر دارد) */
.cn-form .ff_screen_reader_title {
	position: absolute !important;
}

.cn-form .ff-el-group {
	display: grid;
	gap: var(--wp--preset--spacing--half);
	margin: 0;
}

.cn-form .ff-el-input--label label {
	font-size: var(--wp--preset--font-size--sm);
	font-weight: var(--wp--custom--font-weight--bold);
}

.cn-form .ff-el-form-control {
	width: 100%;
	min-height: var(--wp--custom--size--control);
	padding: 0 var(--wp--preset--spacing--2);
	border: var(--wp--custom--border-width-thick) solid var(--wp--custom--color--border-strong);
	border-radius: var(--wp--preset--border-radius--default);
	background-color: var(--wp--custom--color--surface);
	color: var(--wp--custom--color--text);
	font: inherit;
}

.cn-form textarea.ff-el-form-control {
	min-height: var(--wp--custom--size--textarea);
	padding-block: var(--wp--preset--spacing--1);
	line-height: var(--wp--custom--line-height--body);
	resize: vertical;
}

.cn-form .ff-el-form-control:focus-visible {
	outline: var(--wp--custom--focus--width) solid var(--wp--preset--color--primary-soft);
	outline-offset: 0;
	border-color: var(--wp--preset--color--primary);
}

/* موبایل چپ به راست است ولی مثل بقیه فیلدها از سمت شروع صفحه چیده می شود (دمو) */
.cn-form .ff-el-form-control[dir="ltr"],
.cn-form .ff-el-form-control[dir="ltr"]::placeholder {
	text-align: end;
}

.cn-form .ff-el-is-error .ff-el-form-control {
	border-color: var(--wp--custom--color--error);
}

.cn-form .error,
.cn-form .ff-errors-in-stack .error {
	color: var(--wp--custom--color--error);
	font-size: var(--wp--preset--font-size--sm);
	font-weight: var(--wp--custom--font-weight--bold);
}

.cn-form .error-clear,
.cn-form .ff-errors-in-stack:empty {
	display: none;
}

.cn-form .ff_submit_btn_wrapper {
	grid-column: 1 / -1;
	margin: 0;
}

.cn-form .ff-btn-submit {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: var(--wp--preset--spacing--1);
	width: 100%;
	min-height: var(--wp--custom--size--control);
	padding: 0 var(--wp--preset--spacing--3);
	border: var(--wp--custom--border-width-thick) solid var(--wp--preset--color--primary);
	border-radius: var(--wp--preset--border-radius--default);
	background: var(--wp--custom--color--surface);
	color: var(--wp--preset--color--primary);
	font-size: var(--wp--preset--font-size--base);
	font-weight: var(--wp--custom--font-weight--bold);
	line-height: var(--wp--custom--line-height--control);
	transition: background-color var(--wp--custom--duration), color var(--wp--custom--duration);
}

/* خط دار (فرم تماس): مثل .btn--outline و دکمه فرم صفحه محصول */
.cn-form--submit-outline .ff-btn-submit:hover {
	background: var(--wp--preset--color--primary-soft);
	color: var(--wp--preset--color--primary-strong);
}

/* پر (فرم همکاری): مثل .btn--primary، با آیکن ارسال دمو */
.cn-form--submit-primary .ff-btn-submit {
	border-color: transparent;
	background: var(--wp--preset--color--primary);
	color: var(--wp--custom--color--text-inverse);
}

.cn-form--submit-primary .ff-btn-submit:hover {
	background: var(--wp--preset--color--primary-strong);
}

.cn-form--submit-primary .ff-btn-submit::before {
	content: "";
	flex: none;
	width: var(--wp--custom--size--icon);
	height: var(--wp--custom--size--icon);
	background: currentColor;
	-webkit-mask: var(--cn-icon-send) center / contain no-repeat;
	mask: var(--cn-icon-send) center / contain no-repeat;
}

.cn-form .ff-btn-submit:disabled {
	opacity: var(--wp--custom--busy-opacity);
	cursor: wait;
}

/* پیام موفقیت، مثل .form-status دمو */
.cn-form .ff-message-success {
	padding: var(--wp--preset--spacing--1) var(--wp--preset--spacing--2);
	border-radius: var(--wp--preset--border-radius--default);
	background: var(--wp--preset--color--primary-soft);
	color: var(--wp--preset--color--primary-strong);
	font-size: var(--wp--preset--font-size--sm);
	font-weight: var(--wp--custom--font-weight--bold);
}

.cn-form .ff-message-success p {
	margin: 0;
}

/* پیش نمایش ویرایشگر: فقط جای فرم */
.cn-form--preview {
	padding: var(--wp--preset--spacing--2);
	border: var(--wp--custom--border-width-thick) dashed var(--wp--custom--color--border-strong);
	border-radius: var(--wp--preset--border-radius--default);
	color: var(--wp--custom--color--text-muted);
}

/* فرم تماس: موبایل دو ستون و «کالا یا کد مدل» تمام عرض، از 48em سه ستون (دمو) */
@media (min-width: 30em) {
	.cn-form--contact fieldset {
		grid-template-columns: 1fr 1fr;
	}

	.cn-form--contact .ff-el-group:has([name="item"]) {
		grid-column: 1 / -1;
	}
}

@media (min-width: 48em) {
	.cn-form--contact fieldset {
		grid-template-columns: 1fr 1fr 1.4fr;
	}

	.cn-form--contact .ff-el-group:has([name="item"]) {
		grid-column: auto;
	}

	/* فرم همکاری: دو ستون. «نوع فعالیت» و توضیح تمام عرض (کلاس field--full فیلد) */
	.cn-form--wholesale fieldset {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.cn-form--wholesale .field--full {
		grid-column: 1 / -1;
	}
}

.cn-form--wholesale .ff_submit_btn_wrapper {
	margin-top: var(--wp--preset--spacing--1);
}

/* فرم لیست استعلام: نام و موبایل کنار هم از 30em، توضیح تمام عرض (کلاس field--full فیلد) */
@media (min-width: 30em) {
	.cn-form--inquiry_list fieldset {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.cn-form--inquiry_list .field--full {
		grid-column: 1 / -1;
	}
}

/* ==========================================================================
   برگه لیست استعلام (بلوک cntech/inquiry-list، جلسه 10ب). ردیف ها را view.js افزونه
   می سازد. کادر «فرستادن لیست» همان کادر استعلام (.inquiry در components.css) است.
   چیدمان (جلسه 18): موبایل یک ستون. از 64em دو ستون، ردیف ها راست و کادر «فرستادن لیست»
   چپ که با اسکرول همراه می ماند (پایین فایل).
   ========================================================================== */
.inquiry-list {
	display: grid;
	gap: var(--wp--preset--spacing--3);
}

.inquiry-list p,
.inquiry-list__rows {
	margin: 0;
}

.inquiry-list__app,
.inquiry-list__main {
	display: grid;
	gap: var(--wp--preset--spacing--3);
	align-content: start;
}

.inquiry-list__nojs {
	display: grid;
	gap: var(--wp--preset--spacing--2);
}

/* خط «… از لیست برداشته شد» و خطای خواندن */
.inquiry-list__note {
	padding: var(--wp--preset--spacing--1) var(--wp--preset--spacing--2);
	border-radius: var(--wp--preset--border-radius--default);
	background: var(--wp--custom--color--surface-alt);
	color: var(--wp--custom--color--text-muted);
	font-size: var(--wp--preset--font-size--sm);
}

.inquiry-list__rows {
	padding: 0;
	list-style: none;
	border-block-start: var(--wp--custom--border-width) solid var(--wp--custom--color--border);
}

.inquiry-list__rows:empty {
	border: 0;
}

/* هر ردیف. موبایل: عکس کنار نام، تعداد و حذف زیر نام. از 48em هر سه در یک ردیف. */
.inquiry-row {
	display: grid;
	grid-template-columns: var(--wp--custom--size--inquiry-thumb) minmax(0, 1fr);
	gap: var(--wp--preset--spacing--1) var(--wp--preset--spacing--2);
	align-items: center;
	padding-block: var(--wp--preset--spacing--2);
	border-block-end: var(--wp--custom--border-width) solid var(--wp--custom--color--border);
}

/* کادر عکس مثل کارت محصول: نسبت ثابت، زمینه سفید، عکس کامل و بدون بزرگ شدن */
.inquiry-row__media {
	grid-row: span 2;
	align-self: start;
	display: flex;
	align-items: center;
	justify-content: center;
	aspect-ratio: 1;
	border: var(--wp--custom--border-width) solid var(--wp--custom--color--border);
	border-radius: var(--wp--preset--border-radius--default);
	background: var(--wp--preset--color--white);
	overflow: hidden;
}

.inquiry-row__media img {
	display: block;
	width: auto;
	height: auto;
	max-width: 100%;
	max-height: 100%;
	object-fit: contain;
}

.inquiry-row__media img.is-placeholder {
	width: 100%;
	height: 100%;
}

.inquiry-row__title {
	color: var(--wp--custom--color--text);
	font-weight: var(--wp--custom--font-weight--bold);
	line-height: var(--wp--custom--line-height--tight);
	text-decoration: none;
}

.inquiry-row__title:hover {
	color: var(--wp--preset--color--primary);
	text-decoration: underline;
}

.inquiry-list .inquiry-row__model {
	margin-block-start: var(--wp--preset--spacing--half);
	color: var(--wp--custom--color--text-muted);
	font-size: var(--wp--preset--font-size--sm);
}

.inquiry-row__controls {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: var(--wp--preset--spacing--1);
}

/* تعداد با دکمه کم و زیاد: .qty در components.css (صفحه محصول هم دارد، جلسه 18) */

.inquiry-row__remove {
	display: inline-flex;
	align-items: center;
	gap: var(--wp--preset--spacing--half);
	min-height: var(--wp--custom--size--tap);
	padding: 0 var(--wp--preset--spacing--1);
	border: 0;
	border-radius: var(--wp--preset--border-radius--default);
	background: transparent;
	color: var(--wp--custom--color--text-muted);
	font-size: var(--wp--preset--font-size--sm);
	font-weight: var(--wp--custom--font-weight--bold);
}

.inquiry-row__remove:hover {
	background: var(--wp--custom--color--surface-muted);
	color: var(--wp--custom--color--error);
}

.inquiry-row__remove .icon {
	width: var(--wp--custom--size--icon-sm);
	height: var(--wp--custom--size--icon-sm);
}

/* لیست خالی: وسط صفحه، با عرض خوانا */
.inquiry-list__empty {
	display: grid;
	gap: var(--wp--preset--spacing--2);
	justify-items: center;
	justify-self: center;
	width: 100%;
	max-width: var(--wp--custom--size--inquiry);
	padding: var(--wp--preset--spacing--4) var(--wp--preset--spacing--2);
	border: var(--wp--custom--border-width) dashed var(--wp--custom--color--border-strong);
	border-radius: var(--wp--preset--border-radius--default);
	text-align: center;
}

.inquiry-list__tools {
	display: flex;
	justify-content: flex-end;
}

/* کادر «فرستادن لیست»: پیام رسان ها و «کپی لیست»، بعد فرم */
.inquiry-send__ways > * {
	margin: 0 0 var(--wp--preset--spacing--2);
}

.inquiry-send__ways > :last-child {
	margin-bottom: 0;
}

/* خط ثابت زیر پیام رسان ها: ایتا، بله و روبیکا متن را با کپی می گیرند */
.inquiry-list .inquiry-send__hint {
	margin-block-start: var(--wp--preset--spacing--1);
	color: var(--wp--custom--color--text-muted);
	font-size: var(--wp--preset--font-size--sm);
}

/* کادر فقط خواندنی «متن پیام» و دکمه «کپی متن» (جلسه 18) */
.inquiry-send__text {
	display: grid;
	gap: var(--wp--preset--spacing--half);
	margin-block-start: var(--wp--preset--spacing--2);
}

.inquiry-send__text label {
	font-size: var(--wp--preset--font-size--sm);
	font-weight: var(--wp--custom--font-weight--bold);
}

.inquiry-send__text textarea {
	width: 100%;
	min-height: var(--wp--custom--size--textarea);
	padding: var(--wp--preset--spacing--1) var(--wp--preset--spacing--2);
	border: var(--wp--custom--border-width-thick) solid var(--wp--custom--color--border-strong);
	border-radius: var(--wp--preset--border-radius--default);
	background: var(--wp--custom--color--surface-alt);
	color: var(--wp--custom--color--text);
	font-size: var(--wp--preset--font-size--sm);
	line-height: var(--wp--custom--line-height--body);
	resize: vertical;
}

.inquiry-send__text textarea:focus-visible {
	outline: var(--wp--custom--focus--width) solid var(--wp--preset--color--primary-soft);
	outline-offset: 0;
	border-color: var(--wp--preset--color--primary);
}

.inquiry-list .inquiry-send__copy {
	margin-block-start: var(--wp--preset--spacing--half);
}

.inquiry-send__copy .btn {
	width: 100%;
}

@media (min-width: 48em) {
	.inquiry-row {
		grid-template-columns: var(--wp--custom--size--inquiry-thumb-lg) minmax(0, 1fr) auto;
		column-gap: var(--wp--preset--spacing--3);
	}

	.inquiry-row__media {
		grid-row: auto;
	}

	.inquiry-row__controls {
		gap: var(--wp--preset--spacing--3);
	}

	.inquiry-send__copy .btn {
		width: auto;
	}
}

/* دسکتاپ: دو ستون. ردیف ها راست، کادر «فرستادن لیست» چپ و همراه اسکرول (بالای کادر،
   پیام رسان ها، همیشه دیده می شود). کادر اسکرول داخلی ندارد: اگر از صفحه بلندتر است، فرم
   پایینش با رسیدن به آخر لیست دیده می شود. وقتی کادر پنهان است (لیست خالی) ستون ردیف ها
   تمام عرض است. */
@media (min-width: 64em) {
	.inquiry-list__app {
		display: flex;
		align-items: flex-start;
		gap: var(--wp--preset--spacing--5);
	}

	.inquiry-list__main {
		flex: 1 1 0;
		min-width: 0;
	}

	.inquiry-list .inquiry-send {
		position: sticky;
		top: var(--wp--preset--spacing--2);
		flex: 0 0 var(--wp--custom--size--inquiry-send);
		max-width: none;
	}

	/* ستون باریک: پیام رسان ها دو ستون، مثل موبایل */
	.inquiry-send .inquiry__messengers ul {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		grid-auto-flow: row;
	}

	.inquiry-list .inquiry-send__copy .btn {
		width: 100%;
	}
}

/* ---- 404: کادر جستجوی محصول ---- */
.page-head .not-found__search {
	max-width: var(--wp--custom--size--search-max);
	margin-top: var(--wp--preset--spacing--3);
}

/* ==========================================================================
   برگه مقایسه (بلوک cntech/compare، جلسه 23). جدول را view.js افزونه می سازد.
   ستون ها محصول ها، ستون اول نام ویژگی ها. موبایل: جدول افقی اسکرول می شود و ستون اول ثابت
   می ماند (sticky). دو محصول در 400 پیکسل بدون اسکرول جا می شوند. --compare-cols تعداد
   ستون محصول است و view.js آن را می نویسد.
   ========================================================================== */
.compare,
.compare__app {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: var(--wp--preset--spacing--3);
}

.compare p {
	margin: 0;
}

.compare__note {
	padding: var(--wp--preset--spacing--1) var(--wp--preset--spacing--2);
	border-radius: var(--wp--preset--border-radius--default);
	background: var(--wp--custom--color--surface-alt);
	color: var(--wp--custom--color--text-muted);
	font-size: var(--wp--preset--font-size--sm);
}

.compare__empty {
	display: grid;
	gap: var(--wp--preset--spacing--2);
	justify-items: center;
	justify-self: center;
	width: 100%;
	max-width: var(--wp--custom--size--inquiry);
	padding: var(--wp--preset--spacing--4) var(--wp--preset--spacing--2);
	border: var(--wp--custom--border-width) dashed var(--wp--custom--color--border-strong);
	border-radius: var(--wp--preset--border-radius--default);
	text-align: center;
}

.compare__tools {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: var(--wp--preset--spacing--1) var(--wp--preset--spacing--3);
}

.compare__diff {
	display: inline-flex;
	align-items: center;
	gap: var(--wp--preset--spacing--1);
	min-height: var(--wp--custom--size--tap);
	font-weight: var(--wp--custom--font-weight--bold);
}

.compare__diff input {
	width: var(--wp--custom--size--icon);
	height: var(--wp--custom--size--icon);
	margin: 0;
	accent-color: var(--wp--preset--color--primary);
}

.compare__hint {
	color: var(--wp--custom--color--text-muted);
	font-size: var(--wp--preset--font-size--sm);
}

.compare__hint:empty {
	display: none;
}

/* relative: متن پنهان صفحه خوان (visually-hidden، absolute) داخل ستون های بیرون از دید هم با جدول
   اسکرول و بریده می شود، وگرنه صفحه را در موبایل پهن می کند. */
.compare__wrap {
	position: relative;
}

.table--compare-list {
	table-layout: fixed;
	min-width: calc(var(--wp--custom--size--compare-head) + var(--compare-cols, 2) * var(--wp--custom--size--compare-col));
}

.table--compare-list th,
.table--compare-list td {
	overflow-wrap: anywhere;
}

/* ستون اول: نام ویژگی ها، ثابت هنگام اسکرول افقی */
.table--compare-list tr > :first-child {
	position: sticky;
	inset-inline-start: 0;
	z-index: 1;
	width: var(--wp--custom--size--compare-head);
	border-inline-end: var(--wp--custom--border-width) solid var(--wp--custom--color--border);
	background: var(--wp--custom--color--surface);
}

.table--compare-list tbody tr:nth-child(even) > :first-child {
	background: var(--wp--custom--color--surface-alt);
}

.table--compare-list tbody th {
	color: var(--wp--custom--color--text-muted);
	font-weight: var(--wp--custom--font-weight--medium);
}

/* سرستون محصول: عکس و نام */
.table--compare-list thead th,
.table--compare-list thead td {
	background: var(--wp--custom--color--surface);
	white-space: normal;
}

.table--compare-list thead tr:first-child > * {
	border-bottom: 0;
}

.table--compare-list .compare__media {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	max-width: var(--wp--custom--size--compare-thumb);
	min-height: 0;
	aspect-ratio: 1;
	margin: 0 0 var(--wp--preset--spacing--1);
	border: var(--wp--custom--border-width) solid var(--wp--custom--color--border);
	border-radius: var(--wp--preset--border-radius--default);
	background: var(--wp--preset--color--white);
	overflow: hidden;
}

.compare__media img {
	display: block;
	width: auto;
	height: auto;
	max-width: 100%;
	max-height: 100%;
	object-fit: contain;
}

.compare__media img.is-placeholder {
	width: 100%;
	height: 100%;
}

.table--compare-list .compare__title {
	display: block;
	min-height: 0;
	margin: 0;
	color: var(--wp--custom--color--text);
	line-height: var(--wp--custom--line-height--tight);
	text-decoration: none;
}

.table--compare-list .compare__title:hover {
	color: var(--wp--custom--color--link);
	text-decoration: underline;
}

/* ردیف کارها: وضعیت، حذف، افزودن به لیست استعلام */
.compare__actions > * + * {
	margin-block-start: var(--wp--preset--spacing--1);
}

.compare__actions .compare__badge {
	display: inline-flex;
}

.compare__remove {
	display: flex;
	align-items: center;
	gap: var(--wp--preset--spacing--half);
	min-height: var(--wp--custom--size--tap);
	padding: 0 var(--wp--preset--spacing--1);
	margin-inline-start: calc(var(--wp--preset--spacing--1) * -1);
	border: 0;
	border-radius: var(--wp--preset--border-radius--default);
	background: transparent;
	color: var(--wp--custom--color--text-muted);
	font-size: var(--wp--preset--font-size--sm);
	font-weight: var(--wp--custom--font-weight--bold);
}

.compare__remove:hover {
	background: var(--wp--custom--color--surface-muted);
	color: var(--wp--custom--color--error);
}

.compare__remove .icon {
	width: var(--wp--custom--size--icon-sm);
	height: var(--wp--custom--size--icon-sm);
}

.compare__actions .list-toggle-btn {
	display: flex;
	width: 100%;
	padding-inline: var(--wp--preset--spacing--1);
	white-space: normal;
}

.compare__missing {
	color: var(--wp--custom--color--text-muted);
}

@media (min-width: 64em) {
	.table--compare-list {
		min-width: calc(var(--wp--custom--size--compare-head-lg) + var(--compare-cols, 2) * var(--wp--custom--size--compare-col));
	}

	.table--compare-list tr > :first-child {
		width: var(--wp--custom--size--compare-head-lg);
	}

	.table--compare-list .compare__media {
		max-width: var(--wp--custom--size--compare-thumb-lg);
	}
}
