/* استوری ساز حرفه‌ای دده‌وب - استایل فرانت‌اند */

.dwsp-story-bar {
	direction: rtl;
	font-family: var(--dwsp-font, inherit);
	width: 100%;
	box-sizing: border-box;
	padding: 12px 4px;
}

.dwsp-story-bar * { box-sizing: border-box; }

.dwsp-story-track {
	display: flex;
	gap: var(--dwsp-gap, 14px);
	overflow-x: auto;
	overflow-y: hidden;
	scroll-behavior: smooth;
	-webkit-overflow-scrolling: touch;
	scrollbar-width: none;
	cursor: grab;
	padding-bottom: 4px;
}

.dwsp-story-track:active { cursor: grabbing; }

.dwsp-story-track::-webkit-scrollbar { display: none; }

.dwsp-story-item {
	flex: 0 0 auto;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 6px;
	background: none;
	border: none;
	cursor: pointer;
	width: var(--dwsp-mobile-size, 70px);
	padding: 0;
	font-family: inherit;
}

@media (min-width: 782px) {
	.dwsp-story-item { width: var(--dwsp-desktop-size, 70px); }
}

.dwsp-story-ring {
	width: 100%;
	aspect-ratio: 1 / 1;
	border-radius: 50%;
	padding: 3px;
	background: var(--dwsp-item-ring, var(--dwsp-ring, #e1306c));
	display: flex;
	align-items: center;
	justify-content: center;
	transition: transform .15s ease;
}

.dwsp-story-item:hover .dwsp-story-ring,
.dwsp-story-item:focus-visible .dwsp-story-ring {
	transform: scale(1.05);
}

.dwsp-story-item.is-seen .dwsp-story-ring {
	background: #d0d0d0;
}

.dwsp-story-cover {
	width: 100%;
	height: 100%;
	border-radius: 50%;
	background-size: cover;
	background-position: center;
	border: 2px solid #fff;
}

.dwsp-story-title {
	font-size: 12px;
	color: #333;
	max-width: 100%;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	text-align: center;
}

/* ================= Viewer ================= */

.dwsp-viewer-overlay {
	position: fixed;
	inset: 0;
	background: #000;
	z-index: 999999;
	display: none;
	align-items: center;
	justify-content: center;
	direction: rtl;
}

.dwsp-viewer-overlay.is-open {
	display: flex;
	animation: dwspFadeIn .18s ease;
}

@keyframes dwspFadeIn {
	from { opacity: 0; }
	to { opacity: 1; }
}

.dwsp-viewer-inner {
	position: relative;
	width: 420px;
	max-width: 100%;
	height: 100%;
	max-height: 100vh;
	background: #111;
	overflow: hidden;
}

@media (min-width: 782px) {
	.dwsp-viewer-inner {
		height: 92vh;
		max-height: 860px;
		border-radius: 16px;
	}
}

.dwsp-viewer-progress {
	position: absolute;
	top: 10px;
	right: 10px;
	left: 10px;
	display: flex;
	gap: 4px;
	z-index: 5;
}

.dwsp-viewer-progress-bar {
	flex: 1;
	height: 3px;
	background: rgba(255,255,255,0.3);
	border-radius: 3px;
	overflow: hidden;
}

.dwsp-viewer-progress-bar span {
	display: block;
	height: 100%;
	width: 0%;
	background: #fff;
}

.dwsp-viewer-progress-bar.is-done span { width: 100% !important; }

.dwsp-viewer-header {
	position: absolute;
	top: 22px;
	right: 12px;
	left: 12px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	z-index: 5;
	color: #fff;
}

.dwsp-viewer-highlight-info {
	display: flex;
	align-items: center;
	gap: 8px;
}

.dwsp-viewer-cover {
	width: 30px;
	height: 30px;
	border-radius: 50%;
	background-size: cover;
	background-position: center;
	border: 1px solid rgba(255,255,255,0.6);
	display: inline-block;
}

.dwsp-viewer-highlight-title {
	font-size: 13px;
	font-weight: 600;
	text-shadow: 0 1px 3px rgba(0,0,0,0.5);
}

.dwsp-viewer-close {
	background: rgba(0,0,0,0.35);
	border: none;
	color: #fff;
	width: 32px;
	height: 32px;
	border-radius: 50%;
	font-size: 20px;
	line-height: 1;
	cursor: pointer;
}

.dwsp-viewer-stage {
	width: 100%;
	height: 100%;
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	overflow: hidden;
}

.dwsp-viewer-loading {
	color: #fff;
	font-size: 14px;
	opacity: .8;
}

.dwsp-slide {
	position: absolute;
	inset: 0;
	display: none;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	background-size: cover;
	background-position: center;
	animation: dwspSlideIn .25s ease;
}

.dwsp-slide.is-active { display: flex; }

@keyframes dwspSlideIn {
	from { opacity: 0; transform: scale(1.02); }
	to { opacity: 1; transform: scale(1); }
}

.dwsp-slide img.dwsp-slide-media,
.dwsp-slide video.dwsp-slide-media {
	max-width: 100%;
	max-height: 100%;
	width: 100%;
	height: 100%;
	object-fit: cover;
	position: absolute;
	inset: 0;
}

.dwsp-slide-overlay {
	position: absolute;
	inset: 0;
	background: linear-gradient(to top, rgba(0,0,0,0.65) 0%, rgba(0,0,0,0) 35%);
}

.dwsp-slide-content {
	position: absolute;
	bottom: 70px;
	right: 20px;
	left: 20px;
	color: #fff;
	z-index: 2;
	text-align: right;
}

.dwsp-slide-title {
	font-size: 18px;
	font-weight: 700;
	margin: 0 0 6px;
	text-shadow: 0 1px 4px rgba(0,0,0,0.5);
}

.dwsp-slide-desc {
	font-size: 13px;
	opacity: .95;
	margin: 0 0 10px;
	line-height: 1.7;
}

.dwsp-slide-price {
	display: flex;
	gap: 8px;
	align-items: center;
	margin-bottom: 10px;
}

.dwsp-slide-price .price-new { font-size: 16px; font-weight: 700; color: #fff; }
.dwsp-slide-price .price-old { font-size: 13px; text-decoration: line-through; opacity: .7; }
.dwsp-slide-price .price-off { background: #e1306c; padding: 2px 8px; border-radius: 20px; font-size: 11px; }

.dwsp-slide-cta {
	display: inline-block;
	background: #fff;
	color: #111 !important;
	padding: 10px 22px;
	border-radius: 30px;
	font-size: 13px;
	font-weight: 700;
	text-decoration: none;
	box-shadow: 0 4px 14px rgba(0,0,0,0.25);
}

.dwsp-viewer-nav {
	position: absolute;
	top: 0;
	bottom: 0;
	width: 30%;
	background: transparent;
	border: none;
	color: transparent;
	cursor: pointer;
	z-index: 3;
}

.dwsp-viewer-prev { right: 0; }
.dwsp-viewer-next { left: 0; }

.dwsp-viewer-footer {
	position: absolute;
	bottom: 0;
	right: 0;
	left: 0;
	z-index: 4;
}

/* لودینگ / حالت انتظار */
.dwsp-story-bar.is-loading .dwsp-story-track { opacity: .5; }

/* ریسپانسیو */
@media (max-width: 480px) {
	.dwsp-slide-content { bottom: 90px; }
}
