/* Karungali Products Scroll - Styles */

:root {
	--kps-primary-color: #ff9800;
	--kps-text-dark: #333333;
	--kps-text-light: #666666;
	--kps-background: #ffffff;
	--kps-border-color: #e0e0e0;
	--kps-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
	--kps-transition: all 0.3s ease;
}

/* Wrapper */
.kps-wrapper {
	font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
	color: var(--kps-text-dark);
	background-color: var(--kps-background);
	position: relative;
	width: 100%;
}

.kps-wrapper.kps-layout-full-width {
	width: 100vw;
	position: relative;
	left: 50%;
	right: 50%;
	margin-left: -50vw;
	margin-right: -50vw;
}

/* Category Tabs */
.kps-category-tabs {
	display: flex;
	gap: 0;
	background-color: #f5f5f5;
	border-bottom: 2px solid var(--kps-border-color);
	overflow-x: auto;
	scroll-behavior: smooth;
	padding: 0;
	margin: 0;
}

.kps-category-tabs.kps-tabs-left {
	flex-direction: column;
	border-bottom: none;
	border-right: 2px solid var(--kps-border-color);
	width: fit-content;
	min-width: 150px;
	display: inline-flex;
	vertical-align: top;
}

.kps-category-tabs.kps-tabs-right {
	flex-direction: column;
	border-bottom: none;
	border-left: 2px solid var(--kps-border-color);
	width: fit-content;
	min-width: 150px;
	display: inline-flex;
	vertical-align: top;
	float: right;
}

.kps-tab {
	padding: 12px 20px;
	background: transparent;
	border: none;
	border-bottom: 3px solid transparent;
	cursor: pointer;
	font-weight: 500;
	font-size: 14px;
	color: var(--kps-text-light);
	white-space: nowrap;
	transition: var(--kps-transition);
	flex-shrink: 0;
}

.kps-tabs-left .kps-tab,
.kps-tabs-right .kps-tab {
	border-bottom: none;
	border-left: 3px solid transparent;
	width: 100%;
	text-align: left;
}

.kps-tabs-right .kps-tab {
	border-left: none;
	border-right: 3px solid transparent;
	text-align: right;
}

.kps-tab:hover {
	background-color: rgba(255, 152, 0, 0.05);
	color: var(--kps-primary-color);
}

.kps-tab.active {
	color: var(--kps-primary-color);
	border-bottom-color: var(--kps-primary-color);
	background-color: rgba(255, 152, 0, 0.05);
}

.kps-tabs-left .kps-tab.active,
.kps-tabs-right .kps-tab.active {
	border-bottom: none;
}

.kps-tabs-left .kps-tab.active {
	border-left-color: var(--kps-primary-color);
}

.kps-tabs-right .kps-tab.active {
	border-right-color: var(--kps-primary-color);
}

/* Scroll Container */
.kps-scroll-container {
	display: flex;
	align-items: center;
	gap: 15px;
	position: relative;
	overflow: hidden;
}

.kps-layout-full-width .kps-scroll-container {
	padding: 30px 15px;
}

.kps-layout-normal .kps-scroll-container {
	margin: 30px 0;
}

.kps-layout-container .kps-scroll-container {
	margin: 30px auto;
	max-width: 1200px;
}

/* Products Wrapper */
.kps-products-wrapper {
	flex: 1;
	display: flex;
	align-items: center;
	gap: 15px;
	position: relative;
	overflow: hidden;
}

/* Products Scroll */
.kps-products-scroll {
	display: flex;
	gap: 20px;
	scroll-behavior: smooth;
	overflow-x: auto;
	overflow-y: hidden;
	flex-wrap: nowrap;
	padding: 10px 0;
	width: 100%;
}

.kps-direction-vertical .kps-products-scroll {
	flex-direction: column;
	overflow-x: hidden;
	overflow-y: auto;
	max-height: 500px;
}

/* Hide scrollbar for modern browsers */
.kps-products-scroll::-webkit-scrollbar {
	display: none;
}

.kps-products-scroll {
	-ms-overflow-style: none;
	scrollbar-width: none;
}

/* Products Group */
.kps-products-group {
	display: contents;
}

.kps-products-group[style*="display: none"] {
	display: none !important;
}

/* Product Card */
.kps-product-card {
	flex: 0 0 calc(100% / 3 - 15px);
	background-color: var(--kps-background);
	border: 1px solid var(--kps-border-color);
	border-radius: 8px;
	overflow: hidden;
	transition: var(--kps-transition);
	box-shadow: var(--kps-shadow);
	display: flex;
	flex-direction: column;
	height: 100%;
}

/* Responsive product card width */
@media (max-width: 1200px) {
	.kps-product-card {
		flex: 0 0 calc(100% / 2 - 15px);
	}
}

@media (max-width: 768px) {
	.kps-product-card {
		flex: 0 0 calc(100% - 15px);
	}
}

/* Dynamic product card sizing - Desktop */
.kps-wrapper[data-products-per-view-desktop="1"] .kps-product-card {
	flex: 0 0 calc(100% - 15px);
}

.kps-wrapper[data-products-per-view-desktop="2"] .kps-product-card {
	flex: 0 0 calc(100% / 2 - 15px);
}

.kps-wrapper[data-products-per-view-desktop="3"] .kps-product-card {
	flex: 0 0 calc(100% / 3 - 15px);
}

.kps-wrapper[data-products-per-view-desktop="4"] .kps-product-card {
	flex: 0 0 calc(100% / 4 - 15px);
}

.kps-wrapper[data-products-per-view-desktop="5"] .kps-product-card {
	flex: 0 0 calc(100% / 5 - 15px);
}

.kps-wrapper[data-products-per-view-desktop="6"] .kps-product-card {
	flex: 0 0 calc(100% / 6 - 15px);
}

.kps-wrapper[data-products-per-view-desktop="7"] .kps-product-card {
	flex: 0 0 calc(100% / 7 - 15px);
}

.kps-wrapper[data-products-per-view-desktop="8"] .kps-product-card {
	flex: 0 0 calc(100% / 8 - 15px);
}

.kps-wrapper[data-products-per-view-desktop="9"] .kps-product-card {
	flex: 0 0 calc(100% / 9 - 15px);
}

.kps-wrapper[data-products-per-view-desktop="10"] .kps-product-card {
	flex: 0 0 calc(100% / 10 - 15px);
}

.kps-product-card:hover {
	box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
	transform: translateY(-4px);
}

/* Product Image */
.kps-product-image {
	position: relative;
	overflow: hidden;
	background-color: #f9f9f9;
	aspect-ratio: 1;
}

.kps-product-image img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: var(--kps-transition);
	display: block;
}

.kps-product-card:hover .kps-product-image img {
	transform: scale(1.05);
}

/* Sale Badge */
.kps-sale-badge {
	position: absolute;
	top: 10px;
	right: 10px;
	background-color: #e74c3c;
	color: white;
	padding: 6px 12px;
	border-radius: 4px;
	font-size: 12px;
	font-weight: 600;
	text-transform: uppercase;
	z-index: 10;
	box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Product Content */
.kps-product-content {
	padding: 15px;
	flex: 1;
	display: flex;
	flex-direction: column;
	gap: 10px;
}

/* Product Title */
.kps-product-title {
	margin: 0;
	font-size: 14px;
	font-weight: 600;
	line-height: 1.4;
	color: var(--kps-text-dark);
	transition: var(--kps-transition);
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
	min-height: 2.8em;
}

.kps-product-title a {
	color: inherit;
	text-decoration: none;
}

.kps-product-title a:hover {
	color: var(--kps-primary-color);
}

/* Product Rating */
.kps-product-rating {
	font-size: 12px;
	display: flex;
	align-items: center;
	gap: 5px;
}

.kps-product-rating .star-rating {
	display: inline-flex;
}

/* Product Price */
.kps-product-price {
	font-size: 16px;
	font-weight: 700;
	color: var(--kps-primary-color);
	margin: 5px 0;
}

.kps-product-price del {
	color: var(--kps-text-light);
	font-size: 13px;
	font-weight: normal;
	opacity: 0.7;
	margin-right: 5px;
}

/* Product Action */
.kps-product-action {
	margin-top: auto;
}

.kps-product-action .button {
	width: 100%;
	background-color: var(--kps-primary-color);
	color: white;
	border: none;
	padding: 10px;
	border-radius: 4px;
	cursor: pointer;
	font-weight: 600;
	font-size: 13px;
	transition: var(--kps-transition);
}

.kps-product-action .button:hover {
	background-color: #f57c00;
	box-shadow: 0 4px 8px rgba(255, 152, 0, 0.3);
}

.kps-product-action .button.loading {
	opacity: 0.7;
	pointer-events: none;
}

/* Navigation Arrows */
.kps-arrow {
	background-color: white;
	border: none;
	width: 40px;
	height: 40px;
	border-radius: 50%;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	color: var(--kps-primary-color);
	font-size: 20px;
	transition: var(--kps-transition);
	box-shadow: var(--kps-shadow);
	flex-shrink: 0;
	z-index: 20;
}

.kps-arrow:hover {
	background-color: var(--kps-primary-color);
	color: white;
	box-shadow: 0 6px 12px rgba(255, 152, 0, 0.4);
	transform: scale(1.1);
}

.kps-arrow:active {
	transform: scale(0.95);
}

.kps-arrow-prev,
.kps-arrow-next {
	position: static;
}

.kps-arrow-prev-inside,
.kps-arrow-next-inside {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	z-index: 15;
	width: 36px;
	height: 36px;
	font-size: 18px;
}

.kps-arrow-prev-inside {
	left: 10px;
}

.kps-arrow-next-inside {
	right: 10px;
}

.kps-arrow-prev-inside:disabled,
.kps-arrow-next-inside:disabled,
.kps-arrow-prev:disabled,
.kps-arrow-next:disabled {
	opacity: 0.3;
	cursor: not-allowed;
	pointer-events: none;
}

/* Scroll Hint */
.kps-scroll-hint {
	display: none;
	text-align: center;
	padding: 15px;
	font-size: 14px;
	color: var(--kps-text-light);
}

.kps-scroll-hint.kps-hint-top {
	padding-top: 0;
	padding-bottom: 15px;
}

.kps-scroll-hint.kps-hint-bottom {
	padding-top: 15px;
	padding-bottom: 0;
}

.kps-hint-content {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	flex-wrap: wrap;
}

.kps-hand-gesture {
	font-size: 24px;
	display: inline-block;
	user-select: none;
}

/* Hand Gesture Animations */
.kps-hand-bounce {
	animation: kps-bounce 1.5s ease-in-out infinite;
}

.kps-hand-pulse {
	animation: kps-pulse 1.5s ease-in-out infinite;
}

.kps-hand-wave {
	animation: kps-wave 1s ease-in-out infinite;
	transform-origin: bottom center;
}

@keyframes kps-bounce {
	0%, 100% {
		transform: translateY(0);
	}
	50% {
		transform: translateY(-10px);
	}
}

@keyframes kps-pulse {
	0%, 100% {
		opacity: 1;
	}
	50% {
		opacity: 0.5;
	}
}

@keyframes kps-wave {
	0%, 100% {
		transform: rotateZ(0deg);
	}
	25% {
		transform: rotateZ(14deg);
	}
	75% {
		transform: rotateZ(-14deg);
	}
}

.kps-hint-text {
	font-weight: 500;
	white-space: nowrap;
}
.kps-pagination-dots {
	display: flex;
	justify-content: center;
	gap: 8px;
	margin-top: 20px;
	flex-wrap: wrap;
}

.kps-pagination-dot {
	width: 10px;
	height: 10px;
	border-radius: 50%;
	background-color: var(--kps-border-color);
	cursor: pointer;
	transition: var(--kps-transition);
	border: none;
	padding: 0;
}

.kps-pagination-dot:hover {
	background-color: #ccc;
}

.kps-pagination-dot.active {
	background-color: var(--kps-primary-color);
	transform: scale(1.2);
}

/* No Categories Message */
.kps-no-categories {
	padding: 20px;
	text-align: center;
	color: var(--kps-text-light);
	font-size: 14px;
	margin: 0;
}

/* Responsive Design */
@media (max-width: 768px) {
	.kps-category-tabs {
		gap: 0;
		padding: 0;
	}

	.kps-tab {
		padding: 10px 15px;
		font-size: 13px;
	}

	.kps-scroll-container {
		gap: 10px;
	}

	.kps-products-scroll {
		gap: 15px;
	}

	.kps-product-card {
		border-radius: 6px;
	}

	.kps-product-content {
		padding: 12px;
		gap: 8px;
	}

	.kps-product-title {
		font-size: 13px;
	}

	.kps-product-price {
		font-size: 14px;
	}

	.kps-arrow {
		width: 36px;
		height: 36px;
		font-size: 18px;
	}

	.kps-sale-badge {
		padding: 4px 8px;
		font-size: 11px;
	}
}

@media (max-width: 480px) {
	.kps-tab {
		padding: 8px 12px;
		font-size: 12px;
	}

	.kps-product-card {
		flex: 0 0 calc(100% - 15px) !important;
	}

	.kps-arrow {
		width: 32px;
		height: 32px;
		font-size: 16px;
	}

	.kps-scroll-container {
		gap: 8px;
	}

	.kps-product-content {
		padding: 10px;
	}

	/* Hide arrows on very small mobile if no hand gesture */
	.kps-wrapper[data-show-hand-gesture="yes"] .kps-arrow {
		display: none;
	}

	.kps-hint-content {
		font-size: 12px;
	}

	.kps-hand-gesture {
		font-size: 20px;
	}
}

/* Tablet Responsive (768px - 1024px) */
@media (max-width: 1024px) {
	/* Tablet devices - use tablet settings */
	.kps-wrapper[data-products-per-view-tablet="1"] .kps-product-card {
		flex: 0 0 calc(100% - 15px) !important;
	}

	.kps-wrapper[data-products-per-view-tablet="2"] .kps-product-card {
		flex: 0 0 calc(100% / 2 - 15px) !important;
	}

	.kps-wrapper[data-products-per-view-tablet="3"] .kps-product-card {
		flex: 0 0 calc(100% / 3 - 15px) !important;
	}

	.kps-wrapper[data-products-per-view-tablet="4"] .kps-product-card {
		flex: 0 0 calc(100% / 4 - 15px) !important;
	}

	.kps-wrapper[data-products-per-view-tablet="5"] .kps-product-card {
		flex: 0 0 calc(100% / 5 - 15px) !important;
	}

	.kps-wrapper[data-products-per-view-tablet="6"] .kps-product-card {
		flex: 0 0 calc(100% / 6 - 15px) !important;
	}

	.kps-wrapper[data-products-per-view-tablet="7"] .kps-product-card {
		flex: 0 0 calc(100% / 7 - 15px) !important;
	}

	.kps-wrapper[data-products-per-view-tablet="8"] .kps-product-card {
		flex: 0 0 calc(100% / 8 - 15px) !important;
	}

	.kps-wrapper[data-products-per-view-tablet="9"] .kps-product-card {
		flex: 0 0 calc(100% / 9 - 15px) !important;
	}

	.kps-wrapper[data-products-per-view-tablet="10"] .kps-product-card {
		flex: 0 0 calc(100% / 10 - 15px) !important;
	}
}

/* Mobile Responsive (Below 768px) */
@media (max-width: 768px) {
	.kps-scroll-hint {
		display: block;
	}

	/* Mobile devices - use mobile settings */
	.kps-wrapper[data-products-per-view-mobile="1"] .kps-product-card {
		flex: 0 0 calc(100% - 15px) !important;
	}

	.kps-wrapper[data-products-per-view-mobile="2"] .kps-product-card {
		flex: 0 0 calc(100% / 2 - 15px) !important;
	}

	.kps-wrapper[data-products-per-view-mobile="3"] .kps-product-card {
		flex: 0 0 calc(100% / 3 - 15px) !important;
	}

	.kps-wrapper[data-products-per-view-mobile="4"] .kps-product-card {
		flex: 0 0 calc(100% / 4 - 15px) !important;
	}

	.kps-wrapper[data-products-per-view-mobile="5"] .kps-product-card {
		flex: 0 0 calc(100% / 5 - 15px) !important;
	}

	.kps-wrapper[data-products-per-view-mobile="6"] .kps-product-card {
		flex: 0 0 calc(100% / 6 - 15px) !important;
	}

	.kps-wrapper[data-products-per-view-mobile="7"] .kps-product-card {
		flex: 0 0 calc(100% / 7 - 15px) !important;
	}

	.kps-wrapper[data-products-per-view-mobile="8"] .kps-product-card {
		flex: 0 0 calc(100% / 8 - 15px) !important;
	}

	.kps-wrapper[data-products-per-view-mobile="9"] .kps-product-card {
		flex: 0 0 calc(100% / 9 - 15px) !important;
	}

	.kps-wrapper[data-products-per-view-mobile="10"] .kps-product-card {
		flex: 0 0 calc(100% / 10 - 15px) !important;
	}
@keyframes fadeIn {
	from {
		opacity: 0;
		transform: translateY(10px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

.kps-product-card {
	animation: fadeIn 0.5s ease-out backwards;
}

.kps-product-card:nth-child(1) {
	animation-delay: 0.05s;
}

.kps-product-card:nth-child(2) {
	animation-delay: 0.1s;
}

.kps-product-card:nth-child(3) {
	animation-delay: 0.15s;
}

.kps-product-card:nth-child(4) {
	animation-delay: 0.2s;
}

.kps-product-card:nth-child(5) {
	animation-delay: 0.25s;
}

.kps-product-card:nth-child(6) {
	animation-delay: 0.3s;
}
