/**
 * Amazing Offers Module
 * Theme: KeyhanBazaar
 */

:root {
	--kb-amazing-bg: #ef394e;
	--kb-amazing-card-bg: #ffffff;
	--kb-amazing-text: #18181b;
	--kb-amazing-muted: #66666f;
	--kb-amazing-radius: 16px;
}

/* کانتینر اصلی */
.kb-amazing-wrapper {
	position: relative;
	overflow: hidden;
	padding: 14px 12px;
	border-radius: var(--kb-amazing-radius);
	background-color: var(--kb-amazing-bg, #ef394e);
}

/* هدر موبایل */
.kb-amazing-mobile-header {
	gap: 8px;
	padding: 0 12px 6px;
}

.kb-amazing-mobile-title {
	flex: 0 1 auto;
	min-width: 0;
	color: #ffffff;
	white-space: nowrap;
}

.kb-amazing-mobile-title .title-text {
	font-size: 16px;
	font-weight: 900;
	line-height: 1.5;
}

.kb-amazing-mobile-title .percent-badge {
	margin-right: 2px;
	font-size: 18px;
	font-weight: 900;
	line-height: 1;
}

.kb-amazing-see-all-mobile {
	flex: 0 0 auto;
	min-width: 44px;
	min-height: 44px;
	padding: 0 4px;
	color: #ffffff;
	font-size: 13px;
	font-weight: 700;
	line-height: 1.4;
	white-space: nowrap;
}

/* تایمر شمارش معکوس */
.kb-countdown {
	flex: 0 0 auto;
	direction: ltr;
	gap: 3px;
	margin: 0;
	white-space: nowrap;
}

.kb-timer-box {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	box-sizing: border-box;
	min-width: 30px;
	height: 24px;
	padding: 2px 5px;
	border-radius: 4px;
	background: #ffffff;
	color: #111827;
	font-size: 13px;
	font-weight: 800;
	font-variant-numeric: tabular-nums;
	line-height: 1;
	text-align: center;
}

.kb-timer-separator {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 4px;
	color: #ffffff;
	font-size: 12px;
	font-weight: 800;
	line-height: 1;
}

/* سایدبار ثابت دسکتاپ */
.kb-amazing-fixed-sidebar {
	z-index: 2;
	display: flex;
	flex: 0 0 145px;
	flex-direction: column;
	align-items: center;
	justify-content: space-between;
	box-sizing: border-box;
	width: 145px;
	padding: 10px 6px;
	text-align: center;
}

.kb-amazing-sidebar-title {
	margin-bottom: 0;
	color: #ffffff;
}

.kb-amazing-sidebar-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 44px;
	color: #ffffff !important;
	font-size: 13px;
}

.kb-svg-arrow {
	flex: 0 0 auto;
	width: 14px;
	height: 14px;
	margin-right: 2px;
	fill: none;
	stroke: currentColor;
	stroke-width: 2.5;
	stroke-linecap: round;
	stroke-linejoin: round;
}

/* ساختار اسلایدر */
.kb-slider-container-flex {
	position: relative;
	flex: 1 1 auto;
	min-width: 0;
	overflow: hidden;
}

.kb-amazing-slider {
	min-width: 0;
}

.kb-amazing-slider .uk-slider-items {
	display: flex !important;
	align-items: stretch;
	gap: 2px !important;
	margin: 0 !important;
	padding: 0 !important;
}

.kb-amazing-slider .uk-slider-items > li {
	flex: 0 0 38%;
	box-sizing: border-box;
	width: 38% !important;
	margin: 0 !important;
	padding: 0 !important;
}

/* کارت محصول */
.kb-amazing-slider .kb-deal-card {
	display: flex;
	box-sizing: border-box;
	height: 100%;
	padding: 10px 8px;
	border: 0 !important;
	border-radius: 0;
	background: var(--kb-amazing-card-bg);
}

/*
 * رزرو فضای تصویر پیش از دانلود فایل:
 * باعث کاهش Layout Shift در موبایل می‌شود.
 */
.kb-deal-card-img {
	display: block;
	width: 100%;
	height: 125px;
	margin: 0 auto;
	object-fit: contain;
	object-position: center;
}

/* عنوان محصول */
.kb-product-title-clamp {
	display: -webkit-box;
	min-height: 36px;
	overflow: hidden;
	color: #3f3f46;
	font-size: 12px;
	font-weight: 500;
	line-height: 1.5;
	overflow-wrap: anywhere;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 2;
}

/* تخفیف و قیمت‌ها */
.kb-deal-badge {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 30px;
	min-height: 20px;
	box-sizing: border-box;
	padding: 1px 6px;
	border-radius: 12px;
	background: var(--kb-amazing-bg, #ef394e) !important;
	color: #ffffff !important;
	font-size: 11px;
	font-weight: 800;
	line-height: 1.4;
	white-space: nowrap;
}

.kb-deal-old-price {
	color: #66666f;
	font-size: 11px;
	line-height: 1.4;
	text-decoration: line-through;
	white-space: nowrap;
}

.kb-price-row {
	display: flex;
	align-items: baseline;
	justify-content: flex-start !important;
	width: 100%;
	gap: 4px;
	direction: ltr;
	text-align: left;
	white-space: nowrap;
}

.kb-final-price {
	color: var(--kb-amazing-text);
	font-size: 13px;
	font-weight: 800;
	font-variant-numeric: tabular-nums;
	line-height: 1.4;
}

.kb-price-currency {
	color: var(--kb-amazing-muted);
	font-size: 10px;
	line-height: 1.4;
	white-space: nowrap;
}

/* کارت مشاهده همه */
.kb-deal-see-all-card {
	min-height: 200px;
}

.kb-amazing-slider .uk-slider-items > li.kb-last-item .kb-deal-card {
	border-radius: 0 !important;
}

.kb-see-all-icon-wrap {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	border-radius: 50%;
	background: #fef2f2;
}

.kb-see-all-icon {
	width: 20px;
	height: 20px;
	fill: none;
	stroke: var(--kb-amazing-bg, #ef394e);
	stroke-width: 2.6;
	stroke-linecap: round;
	stroke-linejoin: round;
}

.kb-see-all-text {
	color: #27272a;
	font-size: 12px;
}

/* دکمه‌های اسلایدر */
.kb-slider-nav-btn {
	position: absolute;
	z-index: 10;
	top: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	box-sizing: border-box;
	width: 44px;
	height: 44px;
	border: 1px solid #e4e4e7;
	border-radius: 50%;
	background: #ffffff;
	box-shadow: 0 4px 12px rgb(0 0 0 / 15%);
	color: #3f3f46;
	text-decoration: none !important;
	cursor: pointer;
	transform: translateY(-50%);
	transition:
		color 0.2s ease,
		box-shadow 0.2s ease,
		transform 0.2s ease;
}

.kb-slider-nav-btn:hover {
	background: #ffffff;
	box-shadow: 0 6px 16px rgb(0 0 0 / 22%);
	color: #000000;
	transform: translateY(-50%) scale(1.05);
}

.kb-slider-nav-btn:focus-visible,
.kb-amazing-see-all-mobile:focus-visible,
.kb-amazing-sidebar-btn:focus-visible,
.kb-deal-card a:focus-visible {
	outline: 3px solid #ffffff;
	outline-offset: 2px;
}

.kb-slider-nav-btn svg {
	width: 18px;
	height: 18px;
	fill: none;
	stroke: currentColor;
	stroke-width: 2.8;
	stroke-linecap: round;
	stroke-linejoin: round;
}

.kb-slider-nav-next {
	left: 6px;
}

.kb-slider-nav-prev {
	right: 6px;
}

/* تبلت */
@media (min-width: 640px) {
	.kb-amazing-slider .uk-slider-items > li {
		flex-basis: 30%;
		width: 30% !important;
	}

	.kb-amazing-slider .uk-slider-items > li:first-child .kb-deal-card {
		border-top-right-radius: 12px;
		border-bottom-right-radius: 12px;
	}
}

/* دسکتاپ */
@media (min-width: 960px) {
	.kb-amazing-slider .uk-slider-items > li {
		flex-basis: 22%;
		width: 22% !important;
	}
}

/* دسکتاپ عریض */
@media (min-width: 1200px) {
	.kb-amazing-slider .uk-slider-items > li {
		flex-basis: 17.5%;
		width: 17.5% !important;
	}
}

/* موبایل */
@media (max-width: 639px) {
	.kb-amazing-section {
		padding-right: 0 !important;
		padding-left: 0 !important;
	}

	.kb-amazing-wrapper {
		padding: 10px 0 !important;
		border-radius: 0 !important;
	}

	.kb-amazing-slider .uk-slider-items > li:first-child .kb-deal-card {
		border-top-right-radius: 10px;
		border-bottom-right-radius: 10px;
	}

	.kb-amazing-mobile-header .kb-countdown {
		margin-right: auto;
		margin-left: auto;
	}

	.kb-deal-card-img {
		height: 120px;
	}
}

/* گوشی‌های باریک */
@media (max-width: 374px) {
	.kb-amazing-mobile-header {
		gap: 4px;
		padding-right: 8px;
		padding-left: 8px;
	}

	.kb-amazing-mobile-title .title-text {
		font-size: 14px;
	}

	.kb-amazing-mobile-title .percent-badge {
		font-size: 16px;
	}

	.kb-timer-box {
		min-width: 27px;
		padding-right: 4px;
		padding-left: 4px;
		font-size: 12px;
	}

	.kb-amazing-see-all-mobile {
		min-width: 40px;
		padding: 0;
		font-size: 12px;
	}
}

/* احترام به تنظیم کاهش حرکت سیستم کاربر */
@media (prefers-reduced-motion: reduce) {
	.kb-slider-nav-btn {
		transition: none;
	}

	.kb-slider-nav-btn:hover {
		transform: translateY(-50%);
	}
}