/* ===================== دایره‌های استوری در صفحه ===================== */
.ise-story-wrapper {
	direction: rtl;
}

.ise-story-list {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-start;
	justify-content: center;
	gap: 16px;
}

.ise-story-item {
	display: flex;
	flex-direction: column;
	align-items: center;
	cursor: pointer;
	text-align: center;
	max-width: 110px;
}

/* ===================== حالت موبایل: اسکرول افقی به‌جای شکستن خط ===================== */
@media (max-width: 767px) {
	.ise-story-list {
		flex-wrap: nowrap;
		justify-content: flex-start;
		overflow-x: auto;
		overflow-y: hidden;
		-webkit-overflow-scrolling: touch;
		scroll-snap-type: x proximity;
		padding-bottom: 6px;
		/* مخفی کردن اسکرول‌بار */
		scrollbar-width: none; /* فایرفاکس */
		-ms-overflow-style: none; /* اینترنت اکسپلورر */
	}

	.ise-story-list::-webkit-scrollbar {
		display: none; /* کروم، سافاری */
	}

	.ise-story-item {
		flex: 0 0 auto;
		scroll-snap-align: start;
	}
}

.ise-story-circle-wrap {
	border-radius: 50%;
	background-color: #fff;
	display: inline-block;
	transition: transform 0.15s ease;
}

.ise-story-item:hover .ise-story-circle-wrap {
	transform: scale(1.05);
}

.ise-story-ring {
	--ise-ring-start: #f09433;
	--ise-ring-mid: #dc2743;
	--ise-ring-end: #bc1888;
	padding: 3px;
	border-radius: 50%;
	background: linear-gradient(45deg, var(--ise-ring-start), var(--ise-ring-mid), var(--ise-ring-end));
	display: inline-flex;
}

.ise-story-item.ise-seen .ise-story-ring {
	background: #c7c7c7;
}

.ise-story-circle {
	width: 80px;
	height: 80px;
	border-radius: 50%;
	background-size: cover;
	background-position: center;
	background-color: #eee;
	border: 3px solid #fff;
	box-sizing: border-box;
}

.ise-story-title {
	margin-top: 6px;
	font-size: 13px;
	color: #333;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	max-width: 100%;
}

.ise-slides-template {
	display: none !important;
}

/* ===================== لایت‌باکس / مودال استوری ===================== */
.ise-modal {
	position: fixed;
	inset: 0;
	z-index: 999999;
	display: none;
	align-items: center;
	justify-content: center;
	background: rgba(0, 0, 0, 0.9);
}

.ise-modal.ise-open {
	display: flex;
}

.ise-modal-inner {
	position: relative;
	width: 100%;
	max-width: 420px;
	height: 100%;
	max-height: 100vh;
	background: #000;
	overflow: hidden;
	margin: 0 auto;
}

@media (min-width: 600px) {
	.ise-modal-inner {
		max-height: 90vh;
		border-radius: 12px;
	}
}

.ise-progress-row {
	position: absolute;
	top: 8px;
	left: 8px;
	right: 8px;
	display: flex;
	gap: 4px;
	z-index: 20;
}

.ise-progress-bar {
	flex: 1;
	height: 3px;
	border-radius: 3px;
	background-color: rgba(255, 255, 255, 0.35);
	overflow: hidden;
}

.ise-progress-fill {
	height: 100%;
	width: 0%;
	background-color: #fff;
	border-radius: 3px;
}

.ise-progress-fill.ise-animating {
	transition-property: width;
	transition-timing-function: linear;
}

.ise-progress-fill.ise-filled {
	width: 100% !important;
}

.ise-modal-header {
	position: absolute;
	top: 20px;
	right: 12px;
	left: 12px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	z-index: 20;
}

.ise-modal-story-name {
	color: #fff;
	font-size: 14px;
	font-weight: 600;
	text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6);
}

.ise-close-btn {
	color: #fff;
	font-size: 26px;
	line-height: 1;
	cursor: pointer;
	background: none;
	border: none;
	padding: 4px 8px;
}

.ise-slide {
	position: absolute;
	inset: 0;
	display: none;
	background-color: #000;
	background-size: contain;
	background-position: center;
	background-repeat: no-repeat;
}

.ise-slide.ise-active {
	display: block;
}

.ise-slide-nav {
	position: absolute;
	top: 0;
	bottom: 0;
	width: 30%;
	z-index: 15;
	cursor: pointer;
}

.ise-slide-nav.ise-prev {
	right: 0;
}

.ise-slide-nav.ise-next {
	left: 0;
}

.ise-slide-btn {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	z-index: 22;
	width: 34px;
	height: 34px;
	border-radius: 50%;
	background-color: rgba(0, 0, 0, 0.35);
	color: #fff;
	border: none;
	font-size: 15px;
	line-height: 1;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
}

.ise-slide-btn-prev {
	right: 10px;
}

.ise-slide-btn-next {
	left: 10px;
}

.ise-slide-info {
	position: absolute;
	bottom: 0;
	right: 0;
	left: 0;
	padding: 20px 16px 24px;
	color: #fff;
	background: linear-gradient(to top, rgba(0, 0, 0, 0.75), rgba(0, 0, 0, 0));
	z-index: 18;
	text-align: right;
}

.ise-slide-title {
	font-size: 16px;
	font-weight: 700;
	margin-bottom: 6px;
}

.ise-slide-price {
	font-size: 14px;
	opacity: 0.9;
	margin-bottom: 12px;
}

.ise-buy-btn {
	display: inline-block;
	background-color: #fff;
	color: #000;
	padding: 10px 22px;
	border-radius: 30px;
	font-size: 14px;
	font-weight: 700;
	text-decoration: none;
	border: none;
	cursor: pointer;
}

.ise-buy-btn:hover {
	opacity: 0.85;
	color: #000;
}

.ise-modal-arrow {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	z-index: 25;
	background: rgba(255, 255, 255, 0.15);
	border: none;
	color: #fff;
	width: 38px;
	height: 38px;
	border-radius: 50%;
	font-size: 18px;
	cursor: pointer;
	display: none;
	align-items: center;
	justify-content: center;
}

@media (min-width: 600px) {
	.ise-modal-arrow {
		display: flex;
	}
}

.ise-arrow-right {
	right: -50px;
}

.ise-arrow-left {
	left: -50px;
}

/* =========================================================
 * ERFANIT responsive fixes - v1.0.1
 * 1) اسکرول افقی دایره‌ها وقتی تعداد زیاد است
 * 2) دکمه‌های قبلی/بعدی ریسپانسیو داخل استوری
 * ========================================================= */

/* لیست استوری‌ها همیشه یک‌ردیفه و در صورت نیاز قابل اسکرول */
.ise-story-list {
	flex-wrap: nowrap !important;
	justify-content: flex-start !important;
	overflow-x: auto !important;
	overflow-y: hidden !important;
	width: 100%;
	max-width: 100%;
	padding: 2px 4px 8px;
	-webkit-overflow-scrolling: touch;
	overscroll-behavior-inline: contain;
	scroll-behavior: smooth;
	scroll-snap-type: x proximity;
	scrollbar-width: none;
	-ms-overflow-style: none;
}

.ise-story-list::-webkit-scrollbar {
	display: none;
	width: 0;
	height: 0;
}

.ise-story-item {
	flex: 0 0 auto !important;
	scroll-snap-align: start;
}

/* دکمه‌های قبلی و بعدی داخل استوری */
.ise-slide-btn {
	width: clamp(34px, 8vw, 42px);
	height: clamp(34px, 8vw, 42px);
	min-width: 34px;
	min-height: 34px;
	padding: 0;
	font-size: clamp(14px, 4vw, 18px);
	border-radius: 50%;
	box-sizing: border-box;
	touch-action: manipulation;
	-webkit-tap-highlight-color: transparent;
}

.ise-slide-btn-prev {
	right: max(8px, env(safe-area-inset-right)) !important;
	left: auto !important;
}

.ise-slide-btn-next {
	left: max(8px, env(safe-area-inset-left)) !important;
	right: auto !important;
}

/* موبایل */
@media (max-width: 767px) {
	.ise-story-list {
		gap: 12px;
		padding-inline: 4px 12px;
		padding-bottom: 8px;
	}

	.ise-story-item {
		max-width: 92px;
	}

	.ise-slide-btn {
		width: 36px;
		height: 36px;
		min-width: 36px;
		min-height: 36px;
		font-size: 15px;
		background-color: rgba(0,0,0,.28);
	}

	.ise-slide-btn-prev {
		right: max(7px, env(safe-area-inset-right)) !important;
	}

	.ise-slide-btn-next {
		left: max(7px, env(safe-area-inset-left)) !important;
	}
}

/* موبایل‌های باریک */
@media (max-width: 390px) {
	.ise-story-list {
		gap: 10px;
	}

	.ise-slide-btn {
		width: 32px;
		height: 32px;
		min-width: 32px;
		min-height: 32px;
		font-size: 13px;
	}

	.ise-slide-btn-prev {
		right: max(5px, env(safe-area-inset-right)) !important;
	}

	.ise-slide-btn-next {
		left: max(5px, env(safe-area-inset-left)) !important;
	}
}

.ise-story-title[hidden]{display:none!important}

/* v1.2: اندازه قابل تنظیم کاورها در شورت‌کد */
.ise-admin-shortcode .ise-story-circle{width:var(--ise-cover-size,80px);height:var(--ise-cover-size,80px)}
.ise-admin-shortcode .ise-story-item{width:calc(var(--ise-cover-size,80px) + 16px);max-width:none}
.ise-admin-shortcode .ise-story-title{width:100%;white-space:normal;line-height:1.5;overflow-wrap:anywhere}
@media(max-width:767px){
 .ise-admin-shortcode .ise-story-circle{width:var(--ise-cover-size-mobile,68px);height:var(--ise-cover-size-mobile,68px)}
 .ise-admin-shortcode .ise-story-item{width:calc(var(--ise-cover-size-mobile,68px) + 16px);max-width:none}
}

/* فلش‌های بیرون نمایشگر مطابق نمونه، ناوبری اسلایدها */
@media(min-width:600px){
 .ise-modal.ise-admin-view{background:rgba(0,0,0,.58)}
 .ise-modal.ise-admin-view .ise-modal-inner{max-width:466px;max-height:min(826px,95vh);box-shadow:0 22px 70px rgba(0,0,0,.3)}
 .ise-modal.ise-admin-view .ise-slide-btn{display:none!important}
 .ise-modal.ise-admin-view .ise-modal-arrow{position:absolute;top:50%;width:44px;height:44px;min-width:44px;padding:0;border:0;border-radius:50%;background:#fff;color:#282e35;box-shadow:0 4px 18px rgba(0,0,0,.15);transform:translateY(-50%);align-items:center;justify-content:center;z-index:30}
 .ise-modal.ise-admin-view .ise-modal-arrow:not([style*="display: none"]){display:flex}
 .ise-modal.ise-admin-view .ise-arrow-right{left:auto;right:calc(50% - min(233px, 39vw) - 16px)}
 .ise-modal.ise-admin-view .ise-arrow-left{right:auto;left:calc(50% - min(233px, 39vw) - 16px)}
 .ise-modal.ise-admin-view .ise-modal-arrow svg{width:21px;height:21px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
 .ise-modal.ise-admin-view .ise-modal-arrow:hover{background:#f3f3f3}
}
@media(max-width:599px){
 .ise-modal.ise-admin-view .ise-slide-btn{background:#fff;color:#282e35;box-shadow:0 2px 10px rgba(0,0,0,.2)}
}

@media(max-width:599px){.ise-modal.ise-admin-view .ise-modal-arrow{display:none!important}}
