/**
 * استایل سمت کاربر — موبایل‌اول، RTL.
 * فونت MyVazirmatn روی هاست تعریف شده است و اینجا فقط فراخوانی می‌شود.
 */

.sam-widget,
.sam-archive {
	--sam-header-bg: #12301f;
	--sam-header-text: #ffffff;
	--sam-badge-bg: #e5384a;
	--sam-timer-bg: #e0562d;
	--sam-badge-text: #ffffff;
	--sam-price: #1f7a4d;
	--sam-card-bg: #ffffff;
	--sam-surface: #ffffff;
	--sam-radius: 16px;
	--sam-ratio: 3 / 4;
	--sam-muted: #8a8f8c;
	--sam-line: #eceeed;
	--sam-ink: #16211b;

	direction: rtl;
	font-family: "MyVazirmatn", "Vazirmatn", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
	color: var(--sam-ink);
	box-sizing: border-box;
}

.sam-widget *,
.sam-archive * {
	box-sizing: border-box;
}

/* ---------------------------------------------------------------- ویجت */

.sam-widget {
	background: var(--sam-header-bg);
	border-radius: var(--sam-radius);
	padding: 12px;
	margin: 16px 0;
	overflow: hidden;
}

.sam-widget__head {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 2px 4px 12px;
	color: var(--sam-header-text);
}

.sam-widget__brand {
	display: flex;
	align-items: center;
	gap: 6px;
	min-width: 0;
}

.sam-widget__icon {
	font-size: 18px;
	line-height: 1;
	color: var(--sam-timer-bg);
	font-weight: 700;
}

.sam-widget__title {
	margin: 0;
	font-size: 15px;
	font-weight: 800;
	color: var(--sam-header-text);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.sam-timer {
	display: flex;
	align-items: center;
	gap: 3px;
	margin-inline-start: 6px;
	direction: rtl;
}

.sam-timer__box {
	background: var(--sam-timer-bg);
	color: #fff;
	font-size: 12px;
	font-weight: 700;
	line-height: 1;
	padding: 5px 6px;
	border-radius: 6px;
	min-width: 26px;
	text-align: center;
	font-variant-numeric: tabular-nums;
}

.sam-timer__sep {
	color: var(--sam-header-text);
	opacity: 0.7;
	font-size: 12px;
}

.sam-widget__all {
	margin-inline-start: auto;
	display: inline-flex;
	align-items: center;
	gap: 2px;
	color: var(--sam-header-text);
	text-decoration: none;
	font-size: 12px;
	font-weight: 600;
	border: 1px solid rgba(255, 255, 255, 0.35);
	border-radius: 999px;
	padding: 5px 10px;
	white-space: nowrap;
	transition: background-color 0.2s ease;
}

.sam-widget__all:hover {
	background: rgba(255, 255, 255, 0.12);
	color: var(--sam-header-text);
}

.sam-widget__all svg {
	width: 14px;
	height: 14px;
}

.sam-widget__body {
	background: var(--sam-surface);
	border-radius: calc(var(--sam-radius) - 2px);
	padding: 10px 8px 8px;
}

.sam-track {
	display: flex;
	gap: 8px;
	overflow-x: auto;
	overflow-y: hidden;
	-webkit-overflow-scrolling: touch;
	overscroll-behavior-x: contain;
	scrollbar-width: none;
	padding-bottom: 6px;
}

.sam-track::-webkit-scrollbar {
	display: none;
}

/* ---------------------------------------------------------------- کارت */

.sam-card {
	flex: 0 0 auto;
	width: 43vw;
	max-width: 168px;
	display: flex;
	flex-direction: column;
	background: var(--sam-card-bg);
	border-radius: 12px;
	padding: 6px;
	text-decoration: none;
	color: inherit;
	border: 1px solid transparent;
	transition: border-color 0.2s ease;
}

.sam-card:hover {
	border-color: var(--sam-line);
	color: inherit;
}

.sam-card__media {
	position: relative;
	width: 100%;
	aspect-ratio: var(--sam-ratio);
	border-radius: 10px;
	overflow: hidden;
	background: #f6f7f6;
}

.sam-card__img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.sam-card__title {
	margin: 8px 2px 6px;
	font-size: 12px;
	font-weight: 600;
	line-height: 1.7;
	color: var(--sam-ink);
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
	min-height: 3.4em;
}

.sam-card__foot {
	margin-top: auto;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 6px;
	padding: 0 2px 2px;
}

.sam-card__badge {
	background: var(--sam-badge-bg);
	color: var(--sam-badge-text);
	font-size: 11px;
	font-weight: 700;
	border-radius: 999px;
	padding: 3px 8px;
	line-height: 1.4;
	flex: 0 0 auto;
}

.sam-card__prices {
	display: flex;
	flex-direction: column;
	align-items: flex-end;
	gap: 1px;
	min-width: 0;
}

.sam-card__old {
	color: var(--sam-muted);
	font-size: 11px;
	text-decoration: line-through;
}

.sam-card__price {
	color: var(--sam-price);
	font-size: 13px;
	font-weight: 700;
	white-space: nowrap;
}

.sam-card__cur {
	font-style: normal;
	font-size: 10px;
	font-weight: 600;
	margin-inline-start: 2px;
}

/* ------------------------------------------------- اسلاید «مشاهده همه» */

.sam-slide-all {
	flex: 0 0 auto;
	width: 43vw;
	max-width: 140px;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 10px;
	text-decoration: none;
	color: var(--sam-badge-bg);
}

.sam-slide-all__circle {
	width: 48px;
	height: 48px;
	border-radius: 50%;
	border: 2px solid currentColor;
	display: flex;
	align-items: center;
	justify-content: center;
}

.sam-slide-all__circle svg {
	width: 22px;
	height: 22px;
}

.sam-slide-all__text {
	font-size: 12px;
	font-weight: 700;
}

/* ---------------------------------------------------- نوار پیشرفت اسکرول */

.sam-progress {
	height: 3px;
	background: var(--sam-line);
	border-radius: 999px;
	overflow: hidden;
	margin: 4px 6px 2px;
}

.sam-progress__bar {
	display: block;
	height: 100%;
	width: 20%;
	background: var(--sam-price);
	border-radius: 999px;
	will-change: transform;
}

/* ------------------------------------------------------- صفحه‌ی آرشیو */

.sam-archive {
	padding: 8px 0 32px;
}

.sam-archive__head {
	display: flex;
	align-items: baseline;
	gap: 8px;
	margin-bottom: 12px;
	flex-wrap: wrap;
}

.sam-archive__title {
	margin: 0;
	font-size: 18px;
	font-weight: 800;
}

.sam-archive__count {
	font-size: 12px;
	color: var(--sam-muted);
}

.sam-filters {
	position: sticky;
	top: 0;
	z-index: 5;
	background: var(--sam-surface);
	padding: 8px 0;
	margin-bottom: 12px;
	border-bottom: 1px solid var(--sam-line);
}

.sam-filters__row {
	display: flex;
	gap: 8px;
	overflow-x: auto;
	scrollbar-width: none;
	align-items: center;
}

.sam-filters__row::-webkit-scrollbar {
	display: none;
}

.sam-filter {
	position: relative;
	flex: 0 0 auto;
}

.sam-filter__toggle {
	list-style: none;
	cursor: pointer;
	border: 1px solid var(--sam-line);
	border-radius: 999px;
	padding: 7px 14px;
	font-size: 12px;
	font-weight: 600;
	white-space: nowrap;
	display: inline-flex;
	align-items: center;
	gap: 5px;
	background: #fff;
}

.sam-filter__toggle::-webkit-details-marker {
	display: none;
}

.sam-filter[open] > .sam-filter__toggle {
	border-color: var(--sam-price);
	color: var(--sam-price);
}

.sam-filter__count {
	background: var(--sam-price);
	color: #fff;
	border-radius: 999px;
	font-size: 10px;
	padding: 1px 6px;
}

.sam-filter__panel {
	position: absolute;
	inset-inline-start: 0;
	top: calc(100% + 6px);
	z-index: 10;
	background: #fff;
	border: 1px solid var(--sam-line);
	border-radius: 12px;
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
	padding: 8px;
	min-width: 200px;
	max-height: 260px;
	overflow-y: auto;
}

.sam-filter__item {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 6px 4px;
	font-size: 13px;
	cursor: pointer;
	border-radius: 8px;
}

.sam-filter__item:hover {
	background: #f6f7f6;
}

.sam-sort {
	flex: 0 0 auto;
	border: 1px solid var(--sam-line);
	border-radius: 999px;
	padding: 7px 12px;
	font-size: 12px;
	font-family: inherit;
	background: #fff;
	cursor: pointer;
}

.sam-filters__reset {
	flex: 0 0 auto;
	border: none;
	background: none;
	color: var(--sam-badge-bg);
	font-size: 12px;
	font-family: inherit;
	cursor: pointer;
	white-space: nowrap;
}

.sam-grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 10px;
}

.sam-grid .sam-card {
	width: auto;
	max-width: none;
	border: 1px solid var(--sam-line);
}

.sam-archive__foot {
	display: flex;
	justify-content: center;
	margin-top: 20px;
}

.sam-more {
	border: 1px solid var(--sam-price);
	background: #fff;
	color: var(--sam-price);
	border-radius: 999px;
	padding: 10px 26px;
	font-size: 13px;
	font-weight: 700;
	font-family: inherit;
	cursor: pointer;
	transition: background-color 0.2s ease, color 0.2s ease;
}

.sam-more:hover {
	background: var(--sam-price);
	color: #fff;
}

.sam-more[disabled] {
	opacity: 0.6;
	cursor: default;
}

.sam-empty {
	color: var(--sam-muted);
	font-size: 13px;
	text-align: center;
}

.sam-is-loading {
	opacity: 0.55;
	pointer-events: none;
}

/* ------------------------------------------------------------ دسکتاپ */

@media (min-width: 600px) {
	.sam-widget {
		padding: 16px;
	}

	.sam-widget__title {
		font-size: 17px;
	}

	.sam-timer__box {
		font-size: 13px;
		min-width: 30px;
		padding: 6px 8px;
	}

	.sam-card,
	.sam-slide-all {
		width: 30vw;
		max-width: 190px;
	}

	.sam-card__title {
		font-size: 13px;
	}

	.sam-card__price {
		font-size: 14px;
	}

	.sam-grid {
		grid-template-columns: repeat(3, minmax(0, 1fr));
		gap: 14px;
	}

	.sam-archive__title {
		font-size: 22px;
	}
}

@media (min-width: 992px) {
	.sam-widget__body {
		padding: 14px 12px 10px;
	}

	.sam-card,
	.sam-slide-all {
		width: 200px;
		max-width: 200px;
	}

	.sam-grid {
		grid-template-columns: repeat(5, minmax(0, 1fr));
	}

	.sam-track {
		gap: 10px;
	}
}

/* ------------------------- جمع‌وجورسازی فیلترها و هماهنگی دکمه‌ها با تم سایت */

.sam-filters__row {
	flex-wrap: wrap;
	row-gap: 8px;
}

.sam-archive .sam-filter__toggle,
.sam-archive .sam-sort {
	width: auto !important;
	min-width: 0 !important;
	max-width: none;
	height: auto !important;
	min-height: 0 !important;
	padding: 6px 12px !important;
	font-size: 12px !important;
	line-height: 1.7 !important;
	margin: 0 !important;
	box-shadow: none !important;
}

.sam-archive .sam-more {
	background: var(--sam-header-bg) !important;
	border: 1px solid var(--sam-header-bg) !important;
	color: #fff !important;
	border-radius: 999px !important;
	padding: 10px 30px !important;
	font-size: 13px !important;
	font-weight: 700 !important;
	line-height: 1.7 !important;
	box-shadow: none !important;
	text-shadow: none !important;
}

.sam-archive .sam-more:hover {
	filter: brightness(1.15);
	color: #fff !important;
}

.sam-archive .sam-filters__reset {
	border: 1px solid var(--sam-line) !important;
	background: #fff !important;
	color: var(--sam-header-bg) !important;
	border-radius: 999px !important;
	padding: 6px 12px !important;
	font-size: 12px !important;
	font-weight: 600 !important;
	line-height: 1.7 !important;
	box-shadow: none !important;
}

.sam-archive .sam-filters__reset:hover {
	background: #f4f6f5 !important;
}
