.plasko-stories {
	--story-primary: var(--plasko-color-primary, #042656);
	--story-accent: var(--plasko-color-accent, #9ce76a);
	font-family: var(--plasko-font-body, inherit);
	position: relative;
	width: 100%;
}

.plasko-stories__rail {
	display: flex;
	align-items: center;
	gap: 24px;
	width: 100%;
	min-width: 0;
	margin-inline: auto;
}

.plasko-stories__track {
	--plasko-stories-gap: 24px;
	display: flex;
	flex: 1;
	gap: var(--plasko-stories-gap);
	overflow-x: auto;
	overscroll-behavior-inline: contain;
	scroll-behavior: smooth;
	scroll-snap-type: inline mandatory;
	scrollbar-width: none;
}

.plasko-stories__track::-webkit-scrollbar { display: none; }

.plasko-stories__item {
	appearance: none;
	background: none;
	border: 0;
	color: inherit;
	cursor: pointer;
	display: flex;
	flex: 0 0 112px;
	flex-direction: column;
	align-items: center;
	gap: 12px;
	min-width: 0;
	padding: 0;
	scroll-snap-align: start;
}

.plasko-stories__ring {
	background: linear-gradient(135deg, #9ce76a 0%, #f0d71b 42%, #f01b31 100%);
	border-radius: 50%;
	display: grid;
	place-items: center;
	position: relative;
	width: 104px;
	height: 104px;
}

.plasko-stories__ring::before {
	background: #fff;
	border-radius: inherit;
	content: "";
	position: absolute;
	inset: 4px;
}

.plasko-stories__ring img {
	border-radius: 50%;
	display: block;
	position: relative;
	width: 88px;
	height: 88px;
	object-fit: cover;
}

.plasko-stories__badge {
	background: #f01b31;
	border: 2px solid #fff;
	border-radius: 50%;
	color: #fff;
	display: grid;
	font-size: 11px;
	font-weight: 700;
	place-items: center;
	position: absolute;
	top: 5px;
	right: 5px;
	width: 22px;
	height: 22px;
}

.plasko-stories__title {
	color: var(--story-primary);
	display: block;
	font-size: 12px;
	font-weight: 600;
	line-height: 16px;
	max-width: 112px;
	overflow: hidden;
	text-align: center;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.plasko-stories__item:focus-visible .plasko-stories__ring {
	outline: 3px solid var(--story-primary);
	outline-offset: 3px;
}

.plasko-stories__arrow {
	background: #fff;
	border: 1px solid #ededed;
	border-radius: 999px;
	box-shadow: 0 4px 16px rgba(4, 38, 86, .08);
	color: var(--story-primary);
	cursor: pointer;
	flex: 0 0 40px;
	font-family: Arial, sans-serif;
	font-size: 32px;
	line-height: 1;
	width: 40px;
	height: 72px;
}

.plasko-stories__arrow[disabled] { opacity: .35; cursor: default; }
.plasko-stories__empty { padding: 24px; border: 1px dashed #c3c4c7; text-align: center; }

.plasko-stories__overlay {
	background: rgba(4, 18, 38, .72);
	display: grid;
	inset: 0;
	padding: 16px;
	place-items: center;
	position: fixed;
	z-index: 100000;
}

.plasko-stories__overlay[hidden] { display: none !important; }

.plasko-stories__dialog {
	background: #fff;
	border: 1px solid #f7f5f2;
	border-radius: 32px;
	box-shadow: 0 24px 80px rgba(0, 0, 0, .28);
	height: min(698px, calc(100dvh - 32px));
	overflow: hidden;
	padding: 8px;
	position: relative;
	width: min(400px, calc(100vw - 32px));
}

.plasko-stories__media,
.plasko-stories__media img,
.plasko-stories__media video {
	border-radius: 24px;
	display: block;
	width: 100%;
	height: 100%;
}

.plasko-stories__media { background: #111; overflow: hidden; }
.plasko-stories__media img,
.plasko-stories__media video { object-fit: cover; }

.plasko-stories__close {
	background: #fff;
	border: 0;
	border-radius: 50%;
	color: var(--story-primary);
	cursor: pointer;
	font: 300 28px/1 Arial, sans-serif;
	position: absolute;
	top: 16px;
	right: 16px;
	z-index: 5;
	width: 36px;
	height: 36px;
}

.plasko-stories__tap {
	background: transparent;
	border: 0;
	bottom: 132px;
	position: absolute;
	top: 64px;
	width: 34%;
	z-index: 2;
}
.plasko-stories__tap--prev { right: 8px; }
.plasko-stories__tap--next { left: 8px; }

.plasko-stories__bottom {
	bottom: 16px;
	display: flex;
	flex-direction: column;
	gap: 16px;
	left: 16px;
	pointer-events: none;
	position: absolute;
	right: 16px;
	z-index: 4;
}

.plasko-stories__timeline {
	align-items: center;
	display: flex;
	gap: 12px;
	pointer-events: auto;
}

.plasko-stories__play {
	background: transparent;
	border: 0;
	cursor: pointer;
	padding: 4px;
	width: 20px;
	height: 24px;
}

.plasko-stories__play span {
	border-bottom: 7px solid transparent;
	border-right: 11px solid #fff;
	border-top: 7px solid transparent;
	display: block;
}

.plasko-stories__play.is-playing span {
	border: 0;
	border-left: 4px solid #fff;
	border-right: 4px solid #fff;
	height: 14px;
	width: 12px;
}

.plasko-stories__progress {
	background: rgba(255, 255, 255, .25);
	border-radius: 999px;
	flex: 1;
	height: 2px;
	overflow: hidden;
}

.plasko-stories__progress span {
	background: #fff;
	display: block;
	height: 100%;
	transform: scaleX(0);
	transform-origin: right center;
	width: 100%;
}

.plasko-stories__time {
	color: #fff;
	direction: rtl;
	font-size: 14px;
	font-weight: 600;
	min-width: 42px;
	text-align: left;
}

.plasko-stories__product {
	align-items: stretch;
	background: #fff;
	border-radius: 16px;
	color: var(--story-primary);
	display: flex;
	gap: 12px;
	min-height: 104px;
	padding: 16px;
	pointer-events: auto;
	text-decoration: none;
}

.plasko-stories__product[hidden] { display: none; }
.plasko-stories__product-image { background: #f6f6f6; border-radius: 12px; flex: 0 0 72px; object-fit: cover; }
.plasko-stories__product-content { display: flex; flex: 1; flex-direction: column; justify-content: space-between; min-width: 0; }
.plasko-stories__product-title { display: -webkit-box; font-size: 13px; line-height: 20px; overflow: hidden; text-align: right; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.plasko-stories__product-row { align-items: center; display: flex; justify-content: space-between; }
.plasko-stories__product-arrow { align-items: center; background: var(--story-accent); border-radius: 999px; display: flex; font-size: 13px; justify-content: center; width: 28px; height: 20px; }
.plasko-stories__product-price { align-items: center; display: flex; direction: ltr; gap: 4px; font-size: 16px; }
.plasko-stories__product-price img { width: 14px; height: 12px; }

body.plasko-story-open { overflow: hidden; }

@media (max-width: 767px) {
	.plasko-stories__rail { width: 100%; }
	.plasko-stories__track { --plasko-stories-gap: 12px; padding-inline: var(--plasko-mobile-gutter, 12px); }
	.plasko-stories__item { flex-basis: 76px; gap: 8px; }
	.plasko-stories__ring { width: 72px; height: 72px; }
	.plasko-stories__ring img { width: 60px; height: 60px; }
	.plasko-stories__title { max-width: 76px; }
	.plasko-stories__badge { font-size: 9px; right: 1px; top: 1px; width: 19px; height: 19px; }
	.plasko-stories__arrow { display: none; }
	.plasko-stories__overlay { padding: 8px; }
	.plasko-stories__dialog { height: min(698px, calc(100dvh - 16px)); width: min(400px, calc(100vw - 16px)); }
}

@media (prefers-reduced-motion: reduce) {
	.plasko-stories__track { scroll-behavior: auto; }
}
