/* Chitrali Product Slider — frontend */

.cnps-wrap {
	--cnps-accent: #7cb518;
	--cnps-btn-color: #7cb518;
	--cnps-btn-text: #ffffff;
	--cnps-gap: 24px;
	--cnps-radius: 16px;
	position: relative;
	width: 100%;
	margin: 0 auto;
	box-sizing: border-box;
}

.cnps-wrap *,
.cnps-wrap *::before,
.cnps-wrap *::after {
	box-sizing: border-box;
}

.cnps-heading {
	text-align: center;
	font-size: clamp(22px, 3vw, 32px);
	font-weight: 700;
	margin: 0 0 26px;
	letter-spacing: -0.01em;
	color: inherit;
}

.cnps-heading::after {
	content: "";
	display: block;
	width: 54px;
	height: 3px;
	margin: 12px auto 0;
	border-radius: 3px;
	background: var(--cnps-accent);
}

/* Slider shell */
.cnps-slider {
	position: relative;
	padding: 6px 0 4px;
}

.cnps-viewport {
	overflow: hidden;
	width: 100%;
}

.cnps-track {
	display: flex;
	gap: var(--cnps-gap);
	will-change: transform;
	transition: transform 0.55s cubic-bezier(0.22, 0.61, 0.36, 1);
}

.cnps-track.cnps-no-anim {
	transition: none;
}

.cnps-slide {
	flex: 0 0 auto;
	min-width: 0;
}

/* Card */
.cnps-card {
	display: flex;
	flex-direction: column;
	height: 100%;
	background: #fff;
	border-radius: var(--cnps-radius);
	overflow: hidden;
	transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

.cnps-style-classic .cnps-card {
	box-shadow: 0 6px 24px rgba(17, 24, 39, 0.08);
}

.cnps-style-classic .cnps-card:hover {
	transform: translateY(-6px);
	box-shadow: 0 18px 40px rgba(17, 24, 39, 0.14);
}

.cnps-style-bordered .cnps-card {
	border: 1px solid #e5e7eb;
}

.cnps-style-bordered .cnps-card:hover {
	border-color: var(--cnps-accent);
	transform: translateY(-4px);
}

.cnps-style-minimal .cnps-card {
	background: transparent;
}

.cnps-style-minimal .cnps-card:hover {
	transform: translateY(-4px);
}

/* Media */
.cnps-media {
	position: relative;
	aspect-ratio: 1 / 1;
	background: #f6f7f5;
	overflow: hidden;
}

.cnps-style-minimal .cnps-media {
	border-radius: var(--cnps-radius);
}

.cnps-media-link {
	display: block;
	width: 100%;
	height: 100%;
}

.cnps-media .cnps-img,
.cnps-media img {
	width: 100%;
	height: 100%;
	object-fit: contain;
	padding: 14px;
	transition: transform 0.45s ease;
	display: block;
}

.cnps-card:hover .cnps-img {
	transform: scale(1.05);
}

.cnps-badge {
	position: absolute;
	top: 12px;
	left: 12px;
	background: var(--cnps-accent);
	color: #fff;
	font-size: 11px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	padding: 5px 10px;
	border-radius: 999px;
	line-height: 1;
	box-shadow: 0 3px 10px rgba(0, 0, 0, 0.15);
}

/* Body */
.cnps-body {
	display: flex;
	flex-direction: column;
	gap: 8px;
	padding: 16px 16px 18px;
	text-align: center;
	flex: 1 1 auto;
}

.cnps-style-minimal .cnps-body {
	padding: 14px 4px 4px;
}

.cnps-title {
	font-size: 15px;
	font-weight: 600;
	line-height: 1.35;
	margin: 0;
	min-height: 2.7em;
	display: flex;
	align-items: center;
	justify-content: center;
}

.cnps-title a {
	color: #1f2937;
	text-decoration: none;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.cnps-title a:hover {
	color: var(--cnps-accent);
}

/* Rating */
.cnps-rating {
	display: flex;
	justify-content: center;
}

.cnps-stars {
	--cnps-rating: 0%;
	position: relative;
	display: inline-block;
	width: 84px;
	height: 16px;
	font-size: 16px;
	line-height: 1;
}

.cnps-stars::before,
.cnps-stars::after {
	content: "\2605\2605\2605\2605\2605";
	position: absolute;
	inset: 0;
	letter-spacing: 1px;
}

.cnps-stars::before {
	color: #e2e5e9;
}

.cnps-stars::after {
	color: #f5a623;
	width: var(--cnps-rating);
	overflow: hidden;
	white-space: nowrap;
}

/* Price */
.cnps-price {
	font-size: 17px;
	font-weight: 700;
	color: #111827;
	line-height: 1.3;
}

.cnps-price del {
	color: #9ca3af;
	font-weight: 500;
	font-size: 14px;
	margin-right: 6px;
}

.cnps-price ins {
	text-decoration: none;
	color: var(--cnps-accent);
}

/* Button */
.cnps-actions {
	margin-top: auto;
	padding-top: 6px;
}

.cnps-btn.button {
	display: inline-block;
	width: 100%;
	border: none;
	background: var(--cnps-btn-color);
	color: var(--cnps-btn-text);
	font-size: 13px;
	font-weight: 600;
	letter-spacing: 0.02em;
	text-transform: uppercase;
	padding: 11px 14px;
	border-radius: 10px;
	cursor: pointer;
	text-decoration: none;
	text-align: center;
	transition: filter 0.2s ease, transform 0.15s ease, opacity 0.2s ease;
}

.cnps-btn.button:hover {
	filter: brightness(0.92);
	transform: translateY(-1px);
	color: var(--cnps-btn-text);
}

.cnps-btn.button.added {
	opacity: 0.85;
}

.cnps-btn.loading {
	opacity: 0.7;
	pointer-events: none;
}

/* Arrows */
.cnps-arrow {
	position: absolute;
	top: calc(50% - 40px);
	transform: translateY(-50%);
	z-index: 5;
	width: 46px;
	height: 46px;
	border: none;
	border-radius: 50%;
	background: #fff;
	color: #1f2937;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	box-shadow: 0 6px 18px rgba(17, 24, 39, 0.16);
	transition: background 0.2s ease, color 0.2s ease, opacity 0.2s ease, transform 0.2s ease;
}

.cnps-arrow:hover {
	background: var(--cnps-accent);
	color: #fff;
}

.cnps-prev {
	left: -8px;
}

.cnps-next {
	right: -8px;
}

.cnps-arrow.cnps-disabled {
	opacity: 0;
	pointer-events: none;
}

/* Dots */
.cnps-dots {
	display: flex;
	justify-content: center;
	gap: 8px;
	margin-top: 22px;
}

.cnps-dots button {
	width: 9px;
	height: 9px;
	padding: 0;
	border: none;
	border-radius: 50%;
	background: #d1d5db;
	cursor: pointer;
	transition: width 0.25s ease, background 0.25s ease;
}

.cnps-dots button.cnps-active {
	width: 24px;
	border-radius: 999px;
	background: var(--cnps-accent);
}

/* Grabbing cursor while dragging */
.cnps-slider.cnps-grabbing .cnps-track {
	cursor: grabbing;
}

.cnps-slider.cnps-grabbing .cnps-card {
	pointer-events: none;
}

@media (max-width: 600px) {
	.cnps-prev {
		left: 2px;
	}
	.cnps-next {
		right: 2px;
	}
	.cnps-arrow {
		width: 40px;
		height: 40px;
	}
}
