/* استایل‌های فرانت‌اند افزونه فروش اقساطی — طراحی راست‌به‌چپ */

.ins-installment-box {
	direction: rtl;
	text-align: right;
	border: 1px solid #e0e0e0;
	border-radius: 8px;
	padding: 14px 16px;
	margin: 18px 0;
	background: #fafafa;
	font-family: inherit;
}

/* حالت «سرتاسری»: باکس زیر کل محصول (گالری + خلاصه) و با عرض کامل کانتینر محصول نمایش داده می‌شود،
   مستقل از باریک یا عریض بودن ستون خلاصه محصول در قالب سایت. */
/* حالت «سرتاسری»: به‌جای جابه‌جایی باکس در HTML (که به ساختار دقیق قالب وابسته و شکننده است)،
   از یک تکنیک خالص CSS برای «شکستن عرض کانتینر» استفاده می‌شود. باکس در همان محل قابل‌اعتماد
   قبلی (کنار قیمت/دکمه خرید) در جریان عادی صفحه باقی می‌ماند، ولی بصری از عرض ستون اطرافش
   عبور کرده و به‌اندازه کل عرض صفحه کشیده می‌شود — مستقل از اینکه آن ستون چقدر باریک باشد.
   این روش برخلاف جابه‌جایی با جاوااسکریپت، به هیچ کلاس یا ساختار خاصی از قالب وابسته نیست. */
.ins-installment-box-full-wrap {
	clear: both;
	direction: rtl;
	margin-top: 30px;
	margin-bottom: 30px;
	padding-top: 24px;
	border-top: 1px solid #eee;
	position: relative;
	left: 50%;
	right: 50%;
	width: 100vw;
	margin-left: -50vw;
	margin-right: -50vw;
	box-sizing: border-box;
	padding-left: max(16px, calc((100vw - 1200px) / 2 + 16px));
	padding-right: max(16px, calc((100vw - 1200px) / 2 + 16px));
}

.ins-installment-box-full-inner {
	max-width: 760px;
	margin: 0 auto;
}

.ins-installment-box-full-inner .ins-installment-box {
	margin: 0;
}

.ins-toggle-button {
	display: flex;
	align-items: center;
	gap: 8px;
	background: transparent;
	border: none;
	color: #2c6e49;
	font-weight: 700;
	cursor: pointer;
	padding: 0;
	font-size: 15px;
}

.ins-box-content {
	margin-top: 14px;
	border-top: 1px dashed #ddd;
	padding-top: 14px;
}

.ins-box-content.ins-collapsed {
	display: none;
}

.ins-toggle-icon {
	font-size: 16px;
}

.ins-summary-line {
	margin: 0 0 12px;
	font-size: 14px;
	color: #444;
}

.ins-field {
	margin-bottom: 14px;
}

.ins-field label {
	display: block;
	margin-bottom: 6px;
	font-weight: 600;
	font-size: 13px;
}

.ins-field input[type="range"] {
	width: 100%;
}

.ins-field select {
	width: 100%;
	padding: 6px 10px;
}

.ins-live-result {
	background: #fff;
	border: 1px solid #e5e5e5;
	border-radius: 6px;
	padding: 10px 14px;
	margin-bottom: 12px;
}

.ins-result-row {
	display: flex;
	justify-content: space-between;
	padding: 4px 0;
	font-size: 14px;
}

.ins-result-total {
	border-top: 1px solid #eee;
	margin-top: 4px;
	padding-top: 8px;
	font-size: 15px;
}

.ins-installment-box textarea {
	width: 100%;
	margin-bottom: 10px;
	padding: 8px;
	box-sizing: border-box;
}

.ins-submit-button {
	width: 100%;
}

.ins-form-message {
	margin-top: 10px;
	padding: 8px 12px;
	border-radius: 6px;
	font-size: 13px;
}

.ins-message-success {
	background: #e6f4ea;
	color: #1e4620;
}

.ins-message-error {
	background: #fdecea;
	color: #611a15;
}

/* نشان مورب/افقی اقساط روی تصویر محصول.
   به‌جای تکیه بر حذف overflow:hidden قالب (که در برخی قالب‌های سفارشی، خودشان روی
   عنصر بالادست همین ویژگی را دوباره تحمیل می‌کنند و کنترل ما را بی‌اثر می‌کنند)،
   نشان یک اندازه ثابت و مناسب دارد و اگر متن طولانی‌تر از جا باشد، با «...» به‌صورت
   تمیز کوتاه می‌شود؛ این تضمین می‌کند در هیچ قالبی نوشته به‌شکل بریده و ناخوانا درنیاید. */
.ins-ribbon {
	position: absolute;
	width: 150px;
	padding: 5px 0;
	text-align: center;
	font-size: 11px;
	font-weight: 700;
	line-height: 1.4;
	z-index: 10;
	box-shadow: 0 2px 6px rgba(0,0,0,.25);
	pointer-events: none;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.ins-ribbon-top-right {
	right: -40px;
	transform: rotate(45deg);
	transform-origin: center;
}

.ins-ribbon-top-left {
	left: -40px;
	transform: rotate(-45deg);
	transform-origin: center;
}

.ins-ribbon-top-center {
	top: 0;
	left: 50%;
	width: auto;
	max-width: 88%;
	padding: 5px 14px;
	transform: translateX(-50%);
	border-radius: 0 0 6px 6px;
}

/* موقعیت مرجع برای نشان؛ اکثر قالب‌های ووکامرس این عنصر را از قبل position:relative دارند
   (چون نشان پیش‌فرض «حراج» هم به همین وابسته است)، اما برای اطمینان دوباره تنظیم می‌کنیم. */
.woocommerce ul.products li.product a {
	position: relative;
}

.woocommerce div.product div.images,
.woocommerce-product-gallery {
	position: relative;
}
.ins-banner {
	direction: rtl;
	position: relative;
	display: block;
	overflow: hidden;
	border-radius: 10px;
	margin: 24px 0;
	text-decoration: none;
	background-color: #2c6e49;
}

.ins-banner-image {
	width: 100%;
	height: auto;
	display: block;
}

.ins-banner-overlay {
	position: absolute;
	display: flex;
	flex-direction: column;
	gap: 14px;
	max-width: 60%;
	padding: 20px;
}

.ins-banner-pos-top-right   { top: 0;    right: 0;   align-items: flex-end; text-align: right; }
.ins-banner-pos-top-left    { top: 0;    left: 0;    align-items: flex-start; text-align: left; }
.ins-banner-pos-bottom-right{ bottom: 0; right: 0;   align-items: flex-end; text-align: right; }
.ins-banner-pos-bottom-left { bottom: 0; left: 0;    align-items: flex-start; text-align: left; }
.ins-banner-pos-center {
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	align-items: center;
	text-align: center;
	max-width: 80%;
}

.ins-banner-title {
	font-weight: 800;
	line-height: 1.5;
	text-shadow: 0 1px 6px rgba(0,0,0,.35);
}

.ins-banner-button {
	display: inline-block;
	background: #fff;
	color: #2c6e49;
	padding: 10px 26px;
	border-radius: 30px;
	font-weight: 700;
	white-space: nowrap;
}

/* حالتی که هیچ عکسی انتخاب نشده: نوار رنگی ساده و متمرکز */
.ins-banner-no-image {
	padding: 40px 20px;
	text-align: center;
}

.ins-banner-no-image .ins-banner-overlay {
	position: static;
	max-width: 100%;
	transform: none;
	align-items: center;
	padding: 0;
}

/* پنل من - وضعیت‌ها */
.ins-status-badge {
	display: inline-block;
	padding: 3px 10px;
	border-radius: 20px;
	font-size: 12px;
	font-weight: 600;
}

.ins-status-pending { background: #fff3cd; color: #7a5b00; }
.ins-status-info_requested { background: #cfe2ff; color: #1a3d7c; }
.ins-status-approved { background: #d1e7dd; color: #0f5132; }
.ins-status-rejected { background: #f8d7da; color: #842029; }
.ins-status-cancelled { background: #e2e3e5; color: #41464b; }
.ins-status-completed { background: #d1e7dd; color: #0f5132; }

.ins-notice {
	padding: 10px 14px;
	border-radius: 6px;
	margin: 10px 0;
}

.ins-notice-error {
	background: #f8d7da;
	color: #842029;
}

.ins-messages {
	list-style: none;
	margin: 0;
	padding: 0;
}

.ins-messages li {
	border: 1px solid #eee;
	border-radius: 6px;
	padding: 10px 14px;
	margin-bottom: 10px;
}

.ins-msg-date {
	font-size: 12px;
	color: #888;
}
