/* تأیید جدول سایز شیتان پیتان — استایل فرانت‌اند */

html.sp-scg-lock { overflow: hidden; }

.sp-scg-overlay {
	position: fixed;
	inset: 0;
	z-index: 999999;
	display: none;
	align-items: center;
	justify-content: center;
	padding: 12px;
	background: rgba( 17, 17, 17, 0.55 );
	-webkit-backdrop-filter: blur( 2px );
	backdrop-filter: blur( 2px );
	direction: rtl;
}
.sp-scg-overlay.is-open { display: flex; }

/* مودال = ستون فلکس با ارتفاع محدود به صفحه؛ هیچ اسکرولی اتفاق نمی‌افتد */
.sp-scg-modal {
	position: relative;
	display: flex;
	flex-direction: column;
	width: 100%;
	max-width: 480px;
	max-height: 92vh;
	max-height: 92dvh;
	overflow: hidden;
	background: #fff;
	border-radius: 16px;
	box-shadow: 0 20px 60px rgba( 0, 0, 0, 0.3 );
	text-align: right;
	font-family: inherit;
	animation: sp-scg-pop 0.16s ease-out;
}
@keyframes sp-scg-pop {
	from { transform: translateY( 10px ) scale( 0.985 ); opacity: 0; }
	to   { transform: none; opacity: 1; }
}

/* سر مودال (ثابت) */
.sp-scg-head {
	flex: 0 0 auto;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	padding: 12px 16px 8px;
}
.sp-scg-title {
	margin: 0;
	font-size: 17px;
	font-weight: 700;
	color: #1f1f1f;
}
.sp-scg-x {
	flex: 0 0 auto;
	width: 32px;
	height: 32px;
	line-height: 1;
	font-size: 24px;
	color: #888;
	background: transparent;
	border: 0;
	cursor: pointer;
	border-radius: 50%;
}
.sp-scg-x:hover { background: #f1f1f1; color: #222; }

/* بدنه = ناحیه‌ی تصویر که فضای باقی‌مانده را می‌گیرد و عکس را جا می‌دهد (بدون اسکرول) */
.sp-scg-body {
	flex: 1 1 auto;
	min-height: 0;
	display: flex;
	padding: 4px 14px;
}
.sp-scg-figure {
	position: relative;
	flex: 1 1 auto;
	min-height: 0;
	width: 100%;
	display: flex;
	align-items: center;
	justify-content: center;
	border: 1px solid #eee;
	border-radius: 12px;
	background: #fafafa;
	overflow: hidden;
	cursor: zoom-in;
}
.sp-scg-img {
	display: block;
	max-width: 100%;
	max-height: 100%;
	width: auto;
	height: auto;
	object-fit: contain;
	border-radius: 8px;
	transition: opacity 0.2s ease;
}
.sp-scg-figure.is-loading .sp-scg-img { opacity: 0; }
.sp-scg-figure:not(.is-loading) .sp-scg-spinner { display: none; }
.sp-scg-spinner {
	position: absolute;
	width: 38px;
	height: 38px;
	border-radius: 50%;
	border: 3px solid #e6e6e6;
	border-top-color: #1f1f1f;
	animation: sp-scg-spin 0.8s linear infinite;
}
@keyframes sp-scg-spin { to { transform: rotate( 360deg ); } }

/* پاورقی (ثابت، همیشه دیده می‌شود) */
.sp-scg-foot {
	flex: 0 0 auto;
	padding: 8px 16px 14px;
}
.sp-scg-zoom-hint {
	display: block;
	margin: 2px 0 8px;
	font-size: 11px;
	color: #999;
	text-align: center;
}
.sp-scg-size {
	margin: 0 0 8px;
	padding: 7px 12px;
	background: #f4f6ff;
	border-radius: 10px;
	font-size: 13px;
	font-weight: 600;
	color: #2c3e8f;
}
.sp-scg-ack {
	display: flex;
	align-items: flex-start;
	gap: 9px;
	margin: 0 0 10px;
	padding: 10px 12px;
	background: #fff8ec;
	border: 1px solid #ffe3b3;
	border-radius: 10px;
	cursor: pointer;
	font-size: 13.5px;
	line-height: 1.7;
	color: #5a4a2a;
}
.sp-scg-ack-check {
	flex: 0 0 auto;
	width: 20px;
	height: 20px;
	margin-top: 1px;
	accent-color: #d98b1f;
	cursor: pointer;
}
.sp-scg-actions {
	display: flex;
	gap: 10px;
	flex-direction: row-reverse;
}
.sp-scg-confirm,
.sp-scg-cancel {
	flex: 1 1 auto;
	border: 0;
	border-radius: 10px;
	padding: 13px 16px;
	font-size: 15px;
	font-weight: 700;
	font-family: inherit;
	cursor: pointer;
	transition: opacity 0.15s, background 0.15s;
}
.sp-scg-confirm {
	color: #fff;
	background: #1f1f1f;
}
.sp-scg-confirm:disabled {
	opacity: 0.45;
	cursor: not-allowed;
}
.sp-scg-confirm:not(:disabled):hover { background: #000; }
.sp-scg-cancel {
	flex: 0 0 auto;
	min-width: 92px;
	color: #444;
	background: #ededed;
}
.sp-scg-cancel:hover { background: #e2e2e2; }

/* ---- زوم تمام‌صفحه ---- */
.sp-scg-zoom {
	position: fixed;
	inset: 0;
	z-index: 1000000;
	display: none;
	background: rgba( 0, 0, 0, 0.92 );
}
.sp-scg-zoom.is-open { display: block; }
.sp-scg-zoom-stage {
	position: absolute;
	inset: 0;
	overflow: auto;
	-webkit-overflow-scrolling: touch;
	touch-action: pinch-zoom;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 12px;
}
.sp-scg-zoom-img {
	max-width: 100%;
	max-height: 100%;
	height: auto;
	cursor: zoom-in;
	transition: transform 0.05s;
}
.sp-scg-zoom-img.is-zoomed {
	max-width: none;
	max-height: none;
	width: auto;
	cursor: zoom-out;
}
.sp-scg-zoom-close {
	position: fixed;
	top: 14px;
	left: 14px;
	z-index: 2;
	width: 44px;
	height: 44px;
	font-size: 28px;
	color: #fff;
	background: rgba( 255, 255, 255, 0.12 );
	border: 0;
	border-radius: 50%;
	cursor: pointer;
}
.sp-scg-zoom-close:hover { background: rgba( 255, 255, 255, 0.25 ); }

@media ( max-width: 480px ) {
	.sp-scg-overlay { padding: 8px; }
	.sp-scg-modal { max-height: 94vh; max-height: 94dvh; border-radius: 14px; }
	.sp-scg-title { font-size: 16px; }
	.sp-scg-head { padding: 10px 14px 6px; }
	.sp-scg-body { padding: 4px 10px; }
	.sp-scg-foot { padding: 6px 14px 12px; }
	.sp-scg-ack { font-size: 13px; margin-bottom: 8px; }
	.sp-scg-confirm, .sp-scg-cancel { padding: 12px; font-size: 14px; }
}
