/**
 * Netstreet Stories – Frontend Styles
 */

/* ===== Stories bar ===== */
.ns-stories {
	width: 100%;
	margin: 0px auto 0px;
	position: relative;
	z-index: 100;
	background: #f4f4f4; 
}

.ns-stories__inner {
	max-width: 1280px;
	margin: 0 auto;
	padding: 10px 15px 8px;
	display: flex;
	align-items: center;
	gap: 10px;
}

.ns-stories__list {
	flex: 1;
	display: grid;
	grid-auto-flow: column;
	grid-auto-columns: minmax(var(--ns-avatar-size, 68px), 1fr);
	align-items: stretch;
	column-gap: 12px;
	overflow-x: auto;
	padding: 6px 4px;
	scrollbar-width: none;
}

.ns-stories__list::-webkit-scrollbar {
	display: none;
}

.ns-story {
	position: relative;
	text-decoration: none;
	display: flex;
	flex-direction: column;
	align-items: center;
	cursor: pointer;
}

.ns-story__ring {
	position: absolute;
	inset: -2px 22px 55px;	
	border-radius: 999px;
	padding: 1px;
	background: var(--ns-ring-gradient, conic-gradient(from 180deg, #f97316, #ec4899, #8b5cf6, #22c55e, #f97316));
	-webkit-mask: radial-gradient(farthest-side, transparent 70%, #000 71%);
	mask: radial-gradient(farthest-side, transparent 70%, #000 71%);
}

.ns-story__avatar {
	position: relative;
	display: block;
	width: var(--ns-avatar-size, 68px);
	height: var(--ns-avatar-size, 68px);
	border-radius: 999px;
	background: #020617;
	padding: 3px;
	box-sizing: border-box;
	overflow: hidden;
}

.ns-story__avatar img {
	width: 100%;
	height: 100%;
	border-radius: 999px;
	object-fit: cover;
	display: block;
}

.ns-story__avatar-placeholder {
	display: block;
	width: 100%;
	height: 100%;
	border-radius: 999px;
	background: #1e293b;
}

.ns-story__title {
	display: block;
	margin-top: 11px;
	font-size: 11px;
	line-height: 1.4;
	text-align: center;
	color: #111827;
	overflow: hidden;
	text-overflow: ellipsis;
	max-width: var(--ns-avatar-size, 68px);
}

.ns-story.is-seen .ns-story__ring {
	background: linear-gradient(135deg, #9ca3af, #e5e7eb);
}

.ns-stories__nav {
	border: none;
	background: rgba(15, 23, 42, 0.06);
	color: #4b5563;
	width: 28px;
	height: 28px;
	border-radius: 999px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	flex-shrink: 0;
	transition: background 0.2s, transform 0.2s, color 0.2s;
}

.ns-stories__nav:hover {
	background: rgba(15, 23, 42, 0.12);
	color: #111827;
	transform: translateY(-1px);
}

.ns-stories__nav:disabled {
	opacity: 0.35;
	cursor: default;
	transform: none;
}

/* ===== Fullscreen viewer ===== */
.ns-viewer {
	position: fixed;
	inset: 0;
	z-index: 99999;
	display: none;
}

.ns-viewer.is-active {
	display: block;
}

.ns-viewer__backdrop {
	position: absolute;
	inset: 0;
	background: radial-gradient(circle at top, rgba(15,23,42,0.85), rgba(15,23,42,0.97));
}

.ns-viewer__dialog {
	position: relative;
	margin: 0 auto;
	max-width: 960px;
	height: 100%;
	display: flex;
	flex-direction: column;
	padding: 24px 16px 32px;
	box-sizing: border-box;
}

.ns-viewer__close {
	position: absolute;
	top: 18px;
	left: 22px;
	border: none;
	background: rgba(15,23,42,0.6);
	color: #e5e7eb;
	width: 32px;
	height: 32px;
	border-radius: 999px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	font-size: 16px;
	line-height: 1;
}

.ns-viewer__progress {
	display: flex;
	gap: 4px;
	margin-bottom: 18px;
}

.ns-viewer__progress-segment {
	flex: 1;
	height: 3px;
	border-radius: 999px;
	background: rgba(148, 163, 184, 0.4);
	overflow: hidden;
}

.ns-viewer__progress-bar {
	height: 100%;
	width: 0;
	background: #fbbf24;
	border-radius: 999px;
	transition: width linear;
}

.ns-viewer__content {
	flex: 1;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 16px;
}

.ns-viewer__media {
	max-width: 520px;
	aspect-ratio: 1 / 1;
	border-radius: 20px;
	overflow: hidden;
	background: #020617;
	box-shadow: 0 25px 80px rgba(0,0,0,0.85);
	display: flex;
	align-items: center;
	justify-content: center;
}

#ns-viewer-image {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.ns-viewer__nav {
	border: none;
	background: rgba(15,23,42,0.6);
	color: #e5e7eb;
	width: 40px;
	height: 40px;
	border-radius: 999px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	font-size: 22px;
	line-height: 1;
}

.ns-viewer__meta {
	margin-top: 16px;
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 16px;
	color: #e5e7eb;
}

.ns-viewer__meta-left {
	flex: 1;
	min-width: 0;
}

.ns-viewer__title {
	font-size: 15px;
	font-weight: 500;
	margin-bottom: 6px;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.ns-viewer__details {
	font-size: 13px;
	line-height: 1.6;
}

.ns-details__price {
	font-weight: 600;
	margin-bottom: 4px;
}

.ns-details__excerpt {
	margin-bottom: 6px;
	color: #cbd5e1;
}

.ns-details__cart .cart,
.ns-details__cart .variations {
	margin-top: 6px;
}

.ns-details__add-to-cart {
	margin-top: 4px;
}

.ns-viewer__btn {
	border-radius: 999px;
	padding: 8px 18px;
	background: linear-gradient(135deg, #a21caf, #7c3aed);
	color: #fff;
	font-size: 14px;
	font-weight: 500;
	text-decoration: none;
	white-space: nowrap;
	display: inline-block;
}

.ns-no-scroll {
	overflow: hidden !important;
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
	.ns-stories__inner {
		padding-inline: 10px;
		gap: 6px;
	}

	.ns-stories__nav {
		display: none;
	}

	.ns-viewer__dialog {
		padding-inline: 8px;
	}

	.ns-viewer__content {
		gap: 8px;
	}

	.ns-viewer__nav {
		display: none;
	}

	.ns-viewer__meta {
		flex-direction: column;
		align-items: stretch;
	}
}
