/* =========================================================
   Category Product Carousel — استایل سبک و بهینه
   ========================================================= */

.cpc-wrapper {
	--cpc-accent: #25BFB2;
	--cpc-nav-color: #9AA1AC;
	--cpc-radius: 16px;
	--cpc-gap: 16px;
	--cpc-dark-bg: #1E2746;
	--cpc-dark-text: #FFFFFF;
	--cpc-light-bg: #FFFFFF;
	--cpc-light-text: #000000;
	position: relative;
	direction: rtl;
}

.cpc-track {
	--cpc-cols: 3;
	display: flex;
	gap: var(--cpc-gap);
	overflow-x: auto;
	scroll-snap-type: x mandatory;
	scroll-behavior: smooth;
	-webkit-overflow-scrolling: touch;
	scrollbar-width: none;
	padding: 2px 2px 8px;
	margin: -2px -2px -8px;
	cursor: grab;
	user-select: none;
}
.cpc-track::-webkit-scrollbar { display: none; }
.cpc-track.is-grabbing { cursor: grabbing; scroll-snap-type: none; }

.cpc-card {
	flex: 0 0 calc((100% - var(--cpc-gap) * (var(--cpc-cols) - 1)) / var(--cpc-cols));
	min-width: 0;
	scroll-snap-align: start;
	box-sizing: border-box;
	border-radius: var(--cpc-radius);
	padding: 20px 18px;
	display: flex;
	flex-direction: column;
}

.cpc-skin-dark  { background: var(--cpc-dark-bg);  color: var(--cpc-dark-text); }
.cpc-skin-light { background: var(--cpc-light-bg); color: var(--cpc-light-text); box-shadow: 0 1px 6px rgba(0,0,0,.08); }

/* ---------- رنگ متن: صریح و مستقل از تم/ووکامرس ---------- */
.cpc-skin-dark .cpc-card-title,
.cpc-skin-dark .cpc-card-subtitle,
.cpc-skin-dark .cpc-item-title,
.cpc-skin-dark .cpc-old-price,
.cpc-skin-dark .cpc-final-price,
.cpc-skin-dark .cpc-final-price .woocommerce-Price-amount,
.cpc-skin-dark .cpc-final-price bdi,
.cpc-skin-dark .cpc-old-price .woocommerce-Price-amount,
.cpc-skin-dark .cpc-old-price bdi {
	color: var( --cpc-dark-text ) !important;
}
.cpc-skin-light .cpc-card-title,
.cpc-skin-light .cpc-card-subtitle,
.cpc-skin-light .cpc-item-title,
.cpc-skin-light .cpc-old-price,
.cpc-skin-light .cpc-final-price,
.cpc-skin-light .cpc-final-price .woocommerce-Price-amount,
.cpc-skin-light .cpc-final-price bdi,
.cpc-skin-light .cpc-old-price .woocommerce-Price-amount,
.cpc-skin-light .cpc-old-price bdi {
	color: var( --cpc-light-text ) !important;
}

.cpc-card-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	margin-bottom: 16px;
}
.cpc-card-title { font-size: 15px; font-weight: 700; margin: 0; line-height: 1.4; }
.cpc-card-subtitle {
	font-size: 12px;
	opacity: .6;
	display: inline-flex;
	align-items: center;
	gap: 6px;
	white-space: nowrap;
	flex-shrink: 0;
}
.cpc-dash { width: 14px; height: 2px; border-radius: 2px; background: var(--cpc-accent); display: inline-block; }

/* ---------- لیست عمودی آیتم‌ها ---------- */
.cpc-list-viewport {
	overflow: hidden;
	position: relative;
	touch-action: none;
}
.cpc-list {
	list-style: none;
	margin: 0;
	padding: 0;
	will-change: transform;
	transition: transform .38s cubic-bezier(.22,.61,.36,1);
}
.cpc-card.is-dragging .cpc-list { transition: none; }

.cpc-item { box-sizing: border-box; }
.cpc-item-link {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	width: 100%;
	padding: 10px 8px;
	border: 2px solid transparent;
	border-radius: 12px;
	text-decoration: none;
	color: inherit;
	box-sizing: border-box;
	transition: border-color .25s ease;
}
.cpc-item.is-active .cpc-item-link {
	border-color: var(--cpc-accent);
	position: relative;
}
.cpc-item.is-active .cpc-item-link::before {
	content: '';
	position: absolute;
	inset-inline-end: -6px;
	top: 18%;
	bottom: 18%;
	width: 18px;
	border-radius: 999px;
	background: var(--cpc-accent);
}

.cpc-item-info { flex: 1 1 auto; min-width: 0; }
.cpc-item-title {
	font-size: 12px;
	font-weight: 600;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	margin: 0 0 6px;
}
.cpc-item-price-row { display: flex; align-items: center; gap: 6px; min-height: 16px; margin-bottom: 3px; }
.cpc-discount {
	background: var(--cpc-accent);
	color: #fff;
	font-size: 10px;
	font-weight: 700;
	line-height: 1;
	border-radius: 5px;
	padding: 3px 6px;
	white-space: nowrap;
}
.cpc-old-price { font-size: 10px; opacity: .7; text-decoration: line-through; white-space: nowrap; }
.cpc-final-price { font-size: 12px; font-weight: 700; white-space: nowrap; }
.cpc-final-price .woocommerce-Price-currencySymbol,
.cpc-old-price .woocommerce-Price-currencySymbol { font-size: .85em; opacity: .8; }

.cpc-item-thumb {
	flex: 0 0 auto;
	width: 96px;
	height: 96px;
	border-radius: 14px;
	overflow: hidden;
	position: relative;
	background: transparent;
}
.cpc-item-thumb img {
	width: 100%;
	height: 100%;
	object-fit: contain;
	display: block;
	opacity: 0;
	transition: opacity .35s ease;
}
.cpc-item-thumb.is-loaded img { opacity: 1; }

.cpc-thumb-skeleton {
	position: absolute;
	inset: 0;
	border-radius: inherit;
	pointer-events: none;
	background: linear-gradient(90deg, rgba(127,127,127,.12) 25%, rgba(127,127,127,.26) 37%, rgba(127,127,127,.12) 63%);
	background-size: 400% 100%;
	animation: cpc-shimmer 1.4s ease-in-out infinite;
	transition: opacity .25s ease;
}
.cpc-item-thumb.is-loaded .cpc-thumb-skeleton { opacity: 0; }
@keyframes cpc-shimmer {
	0%   { background-position: 100% 0; }
	100% { background-position: 0 0; }
}
@media (prefers-reduced-motion: reduce) {
	.cpc-thumb-skeleton { animation: none; }
}
.cpc-thumb-dots {
	position: absolute;
	bottom: 3px;
	left: 50%;
	transform: translateX(-50%);
	display: flex;
	gap: 2px;
}
.cpc-thumb-dots i { width: 3px; height: 3px; border-radius: 50%; background: rgba(127,127,127,.5); }
.cpc-thumb-dots i:first-child { background: var(--cpc-accent); }

/* ---------- دکمه نمایش بیشتر ---------- */
.cpc-toggle {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 30px;
	height: 30px;
	margin: 14px auto 0;
	border-radius: 50%;
	border: 1px solid currentColor;
	opacity: .5;
	background: transparent;
	color: inherit;
	cursor: pointer;
	transition: transform .3s ease, opacity .2s ease;
	flex-shrink: 0;
}
.cpc-toggle:hover, .cpc-toggle:focus-visible { opacity: .9; }
.cpc-card.is-expanded .cpc-toggle { transform: rotate(180deg); }
.cpc-card.is-expanded .cpc-list-viewport { height: auto !important; overflow: visible; touch-action: auto; }

/* ---------- نویگیشن افقی: پیکان‌های قبلی/بعدی + نقاط (فقط موبایل) ---------- */
.cpc-nav { display: none; justify-content: center; align-items: center; gap: 10px; margin-top: 14px; }
.cpc-nav-arrow {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 28px;
	height: 28px;
	flex-shrink: 0;
	border: 1px solid var(--cpc-nav-color);
	border-radius: 50%;
	background: transparent;
	color: var(--cpc-nav-color);
	cursor: pointer;
	opacity: .85;
	transition: opacity .2s ease, transform .15s ease;
}
.cpc-nav-arrow:hover { opacity: 1; }
.cpc-nav-arrow:active { transform: scale(.92); }

@media (max-width: 767px) {
	.cpc-wrapper.has-overflow .cpc-nav { display: flex; }
}

/* ---------- نقاط (Dots) کاروسل افقی ---------- */
.cpc-dots { display: flex; justify-content: center; align-items: center; gap: 6px; }
.cpc-dots button {
	width: 6px;
	height: 6px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: currentColor;
	opacity: .25;
	cursor: pointer;
	transition: width .25s ease, opacity .25s ease, border-radius .25s ease;
}
.cpc-dots button.is-active { opacity: 1; width: 18px; border-radius: 3px; background: var(--cpc-nav-color); }

/* ---------- دسترس‌پذیری ---------- */
.cpc-item-link:focus-visible,
.cpc-toggle:focus-visible,
.cpc-nav-arrow:focus-visible,
.cpc-dots button:focus-visible { outline: 2px solid var(--cpc-accent); outline-offset: 2px; }

@media (prefers-reduced-motion: reduce) {
	.cpc-list, .cpc-track { transition: none !important; scroll-behavior: auto !important; }
}

/* ---------- موبایل: هر کارت دقیقا فضای یک اسلاید ---------- */
@media (max-width: 767px) {
	.cpc-card { flex-basis: 100%; }
}
