/* VIO Product Slider — بدون هیچ منبع خارجی */

.vio-ps {
	--vio-ps-star-size: 16px;
	--vio-ps-nav-offset: 8px;
	--vio-ps-spv: var(--vio-ps-spv-m, 2);
	--vio-ps-gap: var(--vio-ps-gap-m, 10px);
	--vio-ps-star: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2l3.09 6.26L22 9.27l-5 4.87 1.18 6.88L12 17.77l-6.18 3.25L7 14.14 2 9.27l6.91-1.01z'/%3E%3C/svg%3E");
	position: relative;
	width: 100%;
	box-sizing: border-box;
}

@media (min-width: 768px) {
	.vio-ps {
		--vio-ps-spv: var(--vio-ps-spv-t, 3);
		--vio-ps-gap: var(--vio-ps-gap-t, 12px);
	}
}

@media (min-width: 1025px) {
	.vio-ps {
		--vio-ps-spv: var(--vio-ps-spv-d, 5);
		--vio-ps-gap: var(--vio-ps-gap-d, 16px);
	}
}

.vio-ps *,
.vio-ps *::before,
.vio-ps *::after {
	box-sizing: border-box;
}

.vio-ps .screen-reader-text {
	position: absolute !important;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
}

/* ---------- سرتیتر ---------- */
.vio-ps__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	margin-bottom: 20px;
}

.vio-ps .vio-ps__title {
	margin: 0;
	font-size: 24px;
	font-weight: 700;
	line-height: 1.5;
	color: #222;
}

.vio-ps__title-hl {
	color: #e53935;
}

.vio-ps__all {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	flex-shrink: 0;
	color: #e53935;
	font-size: 15px;
	font-weight: 600;
	text-decoration: none;
	transition: color 0.2s;
}

.vio-ps__all svg {
	width: 16px;
	height: 16px;
}

.vio-ps[dir="rtl"] .vio-ps__all svg {
	transform: scaleX(-1);
}

/* ---------- اسلایدر ---------- */
.vio-ps__body {
	position: relative;
}

.vio-ps__swiper {
	position: relative;
	overflow: hidden;
	margin: 0;
	padding: 0;
	list-style: none;
}

.vio-ps .swiper-slide {
	height: auto;
	display: flex;
}

/* قبل از اجرای جاوااسکریپت، چیدمان تقریبی تا پرش صفحه نداشته باشیم */
.vio-ps__swiper:not(.swiper-initialized) .swiper-wrapper {
	display: flex;
	overflow: hidden;
}

.vio-ps__swiper:not(.swiper-initialized) .swiper-slide {
	flex: 0 0 calc((100% - (var(--vio-ps-spv) - 1) * var(--vio-ps-gap)) / var(--vio-ps-spv));
	margin-inline-end: var(--vio-ps-gap);
}

/* ---------- کارت ---------- */
.vio-ps__card {
	position: relative;
	display: flex;
	flex-direction: column;
	width: 100%;
	padding: 12px;
	background: #fff;
	border: 1px solid #ececec;
	border-radius: 12px;
	text-align: center;
}

.vio-ps__media {
	position: relative;
	display: block;
	aspect-ratio: 1 / 1;
	overflow: hidden;
	border-radius: 8px;
}

.vio-ps__media img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: contain;
	transition: transform 0.35s ease;
}

.vio-ps-zoom-yes .vio-ps__card:hover .vio-ps__media img {
	transform: scale(1.05);
}

/* ---------- بج تخفیف ---------- */
.vio-ps__badge {
	position: absolute;
	top: 8px;
	right: 8px;
	left: auto;
	z-index: 2;
	padding: 3px 9px;
	border-radius: 20px;
	background: #e53935;
	color: #fff;
	font-size: 12px;
	font-weight: 700;
	line-height: 1.6;
	direction: ltr;
	unicode-bidi: isolate;
	pointer-events: none;
}

.vio-ps-badge-left .vio-ps__badge {
	left: 8px;
	right: auto;
}

.vio-ps-badge-right .vio-ps__badge {
	right: 8px;
	left: auto;
}

/* ---------- عنوان ---------- */
.vio-ps .vio-ps__name {
	display: -webkit-box;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 2;
	line-clamp: 2;
	overflow: hidden;
	margin: 12px 0 6px;
	font-size: 14px;
	font-weight: 600;
	line-height: 1.7;
	text-transform: none;
	text-align: center;
}

.vio-ps .vio-ps__name a {
	color: #222;
	text-decoration: none;
	transition: color 0.2s;
}

.vio-ps .vio-ps__name a:hover {
	color: #e53935;
}

/* ---------- امتیاز ---------- */
.vio-ps__rating {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	margin-bottom: 4px;
	direction: ltr;
}

.vio-ps__stars {
	position: relative;
	display: inline-block;
	flex-shrink: 0;
	width: calc(var(--vio-ps-star-size) * 5);
	height: var(--vio-ps-star-size);
	background-color: #d9d9d9;
	-webkit-mask: var(--vio-ps-star) repeat-x 0 0 / var(--vio-ps-star-size) var(--vio-ps-star-size);
	mask: var(--vio-ps-star) repeat-x 0 0 / var(--vio-ps-star-size) var(--vio-ps-star-size);
}

.vio-ps__stars-fill {
	position: absolute;
	top: 0;
	bottom: 0;
	left: 0;
	background-color: #ffb400;
}

/* در حالت راست‌چین ستاره‌ها از راست پر می‌شوند */
.vio-ps[dir="rtl"] .vio-ps__stars {
	-webkit-mask-position: 100% 0;
	mask-position: 100% 0;
}

.vio-ps[dir="rtl"] .vio-ps__stars-fill {
	left: auto;
	right: 0;
}

.vio-ps__rnum {
	color: #777;
	font-size: 12px;
	letter-spacing: 1px;
}

/* ---------- قیمت ---------- */
.vio-ps .vio-ps__price {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 2px;
	margin: 6px 0 12px;
	color: #e53935;
	font-size: 16px;
	font-weight: 700;
	line-height: 1.6;
}

.vio-ps .vio-ps__price del {
	display: block;
	color: #9a9a9a;
	font-size: 0.9em;
	font-weight: 400;
	text-decoration: line-through;
}

.vio-ps .vio-ps__price ins {
	display: block;
	background: none;
	color: inherit;
	text-decoration: none;
}

/* ---------- دکمه ---------- */
.vio-ps__btn-wrap {
	margin-top: auto;
}

.vio-ps .vio-ps__btn {
	display: block;
	width: 100%;
	padding: 10px 12px;
	border: 0;
	border-radius: 8px;
	background: #e53935;
	color: #fff;
	font-size: 14px;
	font-weight: 600;
	line-height: 1.6;
	text-align: center;
	text-decoration: none;
	cursor: pointer;
	transition: background-color 0.2s, color 0.2s, opacity 0.2s;
}

.vio-ps .vio-ps__btn:hover {
	background: #c62828;
	color: #fff;
}

.vio-ps .vio-ps__btn.loading {
	opacity: 0.6;
	pointer-events: none;
}

.vio-ps .vio-ps__btn--oos {
	background: #bdbdbd;
	color: #fff;
}

.vio-ps .vio-ps__btn--oos:hover {
	background: #a8a8a8;
}

/* لینک «مشاهده سبد خرید» که ووکامرس بعد از افزودن می‌سازد */
.vio-ps .added_to_cart {
	display: none !important;
}

/* ---------- فلش‌ها ---------- */
/* ظاهر فلش‌ها (قابل تغییر از پنل المنتور) */
.vio-ps__nav {
	width: 40px;
	height: 40px;
	border-radius: 50%;
	background-color: #fff;
	color: #333;
	box-shadow: 0 2px 10px rgba(0, 0, 0, 0.18);
	transition: background-color 0.2s, color 0.2s, opacity 0.2s;
}

/* چیدمان فلش‌ها: با specificity بالاتر تا استایل دکمه‌های قالب/المنتور دخالت نکند */
.vio-ps .vio-ps__body > .vio-ps__nav {
	position: absolute;
	top: 50%;
	z-index: 5;
	display: flex;
	align-items: center;
	justify-content: center;
	margin: 0;
	padding: 0;
	border: 0;
	min-height: 0;
	line-height: 1;
	transform: translateY(-50%);
	cursor: pointer;
	user-select: none;
	-webkit-tap-highlight-color: transparent;
}

.vio-ps__nav svg {
	display: block;
	width: 20px;
	height: 20px;
	pointer-events: none;
}

.vio-ps .vio-ps__body > .vio-ps__nav--prev {
	inset-inline-start: var(--vio-ps-nav-offset);
	inset-inline-end: auto;
}

.vio-ps .vio-ps__body > .vio-ps__nav--next {
	inset-inline-end: var(--vio-ps-nav-offset);
	inset-inline-start: auto;
}

.vio-ps[dir="rtl"] .vio-ps__nav svg {
	transform: scaleX(-1);
}

.vio-ps__nav:hover {
	background: #e53935;
	color: #fff;
}

.vio-ps__nav.swiper-button-disabled {
	opacity: 0.35;
	cursor: default;
	pointer-events: none;
}

.vio-ps .vio-ps__body > .vio-ps__nav.swiper-button-lock {
	display: none;
}

@media (max-width: 767px) {
	.vio-ps-nav-m-hide .vio-ps .vio-ps__body > .vio-ps__nav {
		display: none !important;
	}
}

/* ---------- نقطه‌ها ---------- */
.vio-ps .vio-ps__dots.swiper-pagination {
	position: relative;
	inset: auto;
	width: 100%;
	margin-top: 14px;
	text-align: center;
	line-height: 1;
}

.vio-ps__dots .swiper-pagination-bullet {
	width: 8px;
	height: 8px;
	background: #cfcfcf;
	opacity: 1;
}

.vio-ps__dots .swiper-pagination-bullet-active {
	background: #e53935;
}

.vio-ps__dots.swiper-pagination-lock {
	display: none;
}

/* ---------- پیام ادیتور ---------- */
.vio-ps-notice {
	padding: 24px;
	border: 2px dashed #d0d0d0;
	border-radius: 8px;
	background: #fafafa;
	color: #666;
	font-size: 14px;
	text-align: center;
}
