/**
 * شورت‌کدهای مستقل: دکمه‌ی ثبت سفارش و نوار فروش/موجودی.
 *
 * همه‌ی فاصله‌ها منطقی‌اند تا در RTL و LTR یکسان کار کنند.
 */

.mah24-order-btn-wrap,
.mah24-sales {
	--mah24-wine: #380c1e;
	--mah24-wine-hover: #4e1229;
	--mah24-rail: #e4e0df;
	--mah24-ink: #2c2c2c;
	--mah24-muted: #8a8a8a;
	--mah24-warn: #d97706;
	--mah24-off: #b6adaa;

	box-sizing: border-box;
	font-family: inherit;
}

.mah24-order-btn-wrap *,
.mah24-sales * {
	box-sizing: border-box;
}

/* ------------------------------------------------- دکمه‌ی ثبت سفارش */

.mah24-order-btn-wrap {
	display: flex;
	margin: 0 0 14px;
}

.mah24-order-btn-wrap--right {
	justify-content: flex-start;
}

.mah24-order-btn-wrap--center {
	justify-content: center;
}

.mah24-order-btn-wrap--left {
	justify-content: flex-end;
}

.mah24-order-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	min-width: 210px;
	margin: 0;
	padding: 14px 32px;
	border: 0;
	border-radius: 999px;
	background: var(--mah24-wine);
	box-shadow: 0 6px 18px rgba(56, 12, 30, 0.22);
	color: #fff;
	font-family: inherit;
	font-size: 15px;
	font-weight: 700;
	line-height: 1.6;
	text-align: center;
	text-decoration: none;
	cursor: pointer;
	transition: background 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}

.mah24-order-btn:hover,
.mah24-order-btn:focus-visible {
	background: var(--mah24-wine-hover);
	box-shadow: 0 8px 22px rgba(56, 12, 30, 0.3);
	color: #fff;
	transform: translateY(-1px);
	text-decoration: none;
}

.mah24-order-btn:focus-visible {
	outline: 3px solid rgba(232, 180, 200, 0.6);
	outline-offset: 2px;
}

.mah24-order-btn:active {
	transform: translateY(0);
	box-shadow: 0 4px 12px rgba(56, 12, 30, 0.24);
}

.mah24-order-btn--full {
	display: flex;
	width: 100%;
}

.mah24-order-btn--sm {
	min-width: 160px;
	padding: 10px 24px;
	font-size: 13.5px;
}

.mah24-order-btn--lg {
	min-width: 260px;
	padding: 17px 38px;
	font-size: 16.5px;
}

/* آیکن اختیاری داخل دکمه؛ قاب و جایگاهش را هر پوسته‌ای می‌تواند بازنویسی کند. */
.mah24-order-btn__icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex: 0 0 auto;
}

.mah24-order-btn__label {
	display: inline-block;
}

.mah24-order-btn--out,
.mah24-order-btn[disabled] {
	background: var(--mah24-off);
	box-shadow: none;
	cursor: not-allowed;
	transform: none;
}

.mah24-order-btn--out:hover,
.mah24-order-btn[disabled]:hover {
	background: var(--mah24-off);
	box-shadow: none;
	transform: none;
}

/* --------------------------------------------- نوار فروش / موجودی */

.mah24-sales {
	display: flex;
	flex-direction: column;
	gap: 9px;
	width: 100%;
	margin: 0 0 14px;
}

.mah24-sales__track {
	position: relative;
	width: 100%;
	height: 12px;
	overflow: hidden;
	border-radius: 999px;
	background: var(--mah24-rail);
}

.mah24-sales__fill {
	display: block;
	position: absolute;
	inset-block: 0;
	inset-inline-start: 0;
	width: 0;
	border-radius: 999px;
	background: var(--mah24-wine);
	transition: width 0.5s cubic-bezier(0.22, 0.61, 0.36, 1), background 0.25s;
}

.mah24-sales__legend {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	flex-wrap: wrap;
	font-size: 13px;
	line-height: 1.7;
	color: var(--mah24-ink);
}

.mah24-sales__item {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	white-space: nowrap;
}

.mah24-sales__item b {
	font-weight: 800;
}

/* رو به اتمام */
.mah24-sales--low .mah24-sales__fill {
	background: var(--mah24-warn);
}

.mah24-sales--low .mah24-sales__item--remaining b {
	color: var(--mah24-warn);
}

/* ناموجود */
.mah24-sales--out .mah24-sales__fill {
	background: var(--mah24-off);
}

.mah24-sales--out .mah24-sales__item--remaining b {
	color: var(--mah24-off);
}

/* موجودی نامحدود: نوار پر با بافت راه‌راه تا با «تمام‌فروش» اشتباه نشود. */
.mah24-sales--unlimited .mah24-sales__fill {
	background-image: repeating-linear-gradient(
		135deg,
		var(--mah24-wine) 0 8px,
		var(--mah24-wine-hover) 8px 16px
	);
}

.mah24-sales--unlimited .mah24-sales__item--remaining b {
	color: var(--mah24-wine-hover);
}

@media (prefers-reduced-motion: reduce) {
	.mah24-sales__fill {
		transition: none;
	}

	.mah24-order-btn {
		transition: none;
	}

	.mah24-order-btn:hover {
		transform: none;
	}
}

@media (max-width: 420px) {
	.mah24-sales__legend {
		font-size: 12.5px;
	}

	.mah24-order-btn {
		min-width: 0;
		width: 100%;
		padding-inline: 20px;
	}
}

/* ------------------------------ نوار چسبان ثبت سفارش ------------------------------ */

/*
 * به کف صفحه می‌چسبد و فقط وقتی دیده می‌شود که دکمه‌ی اصلی از دید بیرون رفته
 * باشد. ارتفاعش را جاوااسکریپت روی --mah24-sbar-h می‌گذارد تا فوتر زیرش نماند.
 */
.mah24-sbar {
	--mah24-wine: #380c1e;
	--mah24-ink: #2c2c2c;
	--mah24-muted: #8a8a8a;

	position: fixed !important;
	inset-inline: 0 !important;
	bottom: 0 !important;
	z-index: 99990 !important;
	box-sizing: border-box !important;
	padding: 10px 14px calc(10px + env(safe-area-inset-bottom, 0px)) !important;
	border-top: 1px solid #eceaea !important;
	background: rgba(255, 255, 255, 0.97) !important;
	backdrop-filter: blur(6px) !important;
	box-shadow: 0 -10px 30px -22px rgba(20, 4, 12, 0.5) !important;
	/* تا وقتی روشن نشده، هم بیرون کادر است و هم برای کیبورد و صفحه‌خوان نیست. */
	visibility: hidden !important;
	transform: translateY(110%) !important;
	transition: transform 0.28s cubic-bezier(0.22, 0.61, 0.36, 1), visibility 0.28s !important;
	direction: rtl !important;
	text-align: start !important;
}

.mah24-sbar[hidden] {
	display: block !important;
	visibility: hidden !important;
}

/*
 * داخل ویرایشگر المنتور نوار باید داخل جریان صفحه و دیدنی باشد، وگرنه ارتفاع
 * ویجت صفر می‌شود و نه انتخاب می‌شود، نه جابه‌جا و نه حذف. روی سایت هیچ اثری
 * ندارد؛ این کلاس فقط در ویرایشگر روی نوار می‌نشیند.
 */
.mah24-sbar--editor {
	position: relative !important;
	inset: auto !important;
	z-index: auto !important;
	visibility: visible !important;
	transform: none !important;
	transition: none !important;
	border-top: 1px dashed #d9cfd3 !important;
	border-radius: 12px !important;
}

/* در ویرایشگر، «فقط موبایل» هم نباید نوار را از دید پنهان کند. */
.mah24-sbar--editor.mah24-sbar--mobile {
	display: block !important;
}

.mah24-sbar.is-on {
	visibility: visible !important;
	transform: translateY(0) !important;
}

.mah24-sbar * {
	box-sizing: border-box !important;
}

.mah24-sbar__inner {
	display: flex !important;
	align-items: center !important;
	gap: 14px !important;
	max-width: 1180px !important;
	margin: 0 auto !important;
}

.mah24-sbar__info {
	display: flex !important;
	align-items: center !important;
	gap: 10px !important;
	flex: 1 1 auto !important;
	min-width: 0 !important;
}

.mah24-sbar__thumb {
	display: block !important;
	flex: 0 0 auto !important;
	width: 46px !important;
	height: 46px !important;
	overflow: hidden !important;
	border-radius: 12px !important;
	background: #faf7f8 !important;
}

.mah24-sbar__thumb img {
	display: block !important;
	width: 100% !important;
	height: 100% !important;
	margin: 0 !important;
	border-radius: 12px !important;
	object-fit: contain !important;
}

.mah24-sbar__texts {
	display: flex !important;
	flex-direction: column !important;
	gap: 2px !important;
	min-width: 0 !important;
}

.mah24-sbar a.mah24-sbar__name {
	color: var(--mah24-ink) !important;
	font-size: 13px !important;
	font-weight: 700 !important;
	line-height: 1.7 !important;
	text-decoration: none !important;
	overflow: hidden !important;
	text-overflow: ellipsis !important;
	white-space: nowrap !important;
}

.mah24-sbar__price {
	display: inline-flex !important;
	align-items: baseline !important;
	flex-wrap: wrap !important;
	gap: 6px !important;
	font-size: 12.5px !important;
}

.mah24-sbar__price-label {
	color: var(--mah24-muted) !important;
	font-size: 11.5px !important;
}

.mah24-sbar__now,
.mah24-sbar__now .amount,
.mah24-sbar__now bdi {
	color: var(--mah24-wine) !important;
	font-size: 14px !important;
	font-weight: 800 !important;
	white-space: nowrap !important;
}

.mah24-sbar__now .woocommerce-Price-currencySymbol {
	color: var(--mah24-muted) !important;
	font-size: 11px !important;
	font-weight: 500 !important;
}

.mah24-sbar__old,
.mah24-sbar__old .amount,
.mah24-sbar__old bdi {
	color: #bdb7b9 !important;
	font-size: 11.5px !important;
	font-weight: 500 !important;
	text-decoration: line-through !important;
	white-space: nowrap !important;
}

.mah24-sbar__actions {
	display: flex !important;
	align-items: center !important;
	gap: 10px !important;
	flex: 0 1 auto !important;
	min-width: 0 !important;
}

.mah24-sbar__actions .mah24-order-btn-wrap {
	flex: 1 1 auto !important;
	min-width: 150px !important;
}

.mah24-sbar__actions .mah24-order-btn {
	min-height: 44px !important;
}

.mah24-sbar__wish {
	display: inline-flex !important;
	align-items: center !important;
	justify-content: center !important;
	flex: 0 0 auto !important;
	width: 44px !important;
	height: 44px !important;
	border: 1px solid #eadfe4 !important;
	border-radius: 12px !important;
	background: #fff !important;
}

.mah24-sbar__wish .mah24-wish {
	width: 100% !important;
	height: 100% !important;
	border: 0 !important;
	background: none !important;
	box-shadow: none !important;
}

/* فضای کف صفحه تا نوار روی محتوا نیفتد. */
body.mah24-sbar-open {
	padding-bottom: var(--mah24-sbar-h, 76px) !important;
}

/* فقط ریزنمایش. */
@media screen and (min-width: 1025px) {
	.mah24-sbar--mobile {
		display: none !important;
	}
}

@media screen and (max-width: 560px) {
	.mah24-sbar {
		padding: 8px 10px calc(8px + env(safe-area-inset-bottom, 0px)) !important;
	}

	.mah24-sbar__inner {
		gap: 10px !important;
	}

	.mah24-sbar__thumb {
		width: 40px !important;
		height: 40px !important;
	}

	.mah24-sbar a.mah24-sbar__name {
		font-size: 12.5px !important;
	}

	/* جای کم: برچسب و قیمت قبل کنار می‌روند تا قیمت و دکمه یک خط بمانند. */
	.mah24-sbar__price-label,
	.mah24-sbar__old {
		display: none !important;
	}

	/* دکمه به اندازه‌ی متن خودش؛ نام محصول است که کوتاه می‌شود، نه دکمه. */
	.mah24-sbar__actions {
		flex: 0 0 auto !important;
	}

	.mah24-sbar__actions .mah24-order-btn-wrap {
		flex: 0 0 auto !important;
		min-width: 0 !important;
	}

	.mah24-sbar__actions .mah24-order-btn {
		padding-inline: 12px !important;
		font-size: 13px !important;
		white-space: nowrap !important;
	}

	.mah24-sbar__wish {
		width: 40px !important;
		height: 40px !important;
	}
}

@media (prefers-reduced-motion: reduce) {
	.mah24-sbar {
		transition: none !important;
	}
}

/* ------------------------------ عنوان محصول (دوزبانه) ------------------------------ */

/*
 * عنوان صفحه‌ی محصول: خط اول فارسی و خط دوم نام لاتین. اندازه‌ها با متغیر
 * می‌آیند تا در المنتور یا پوسته به‌راحتی بازنویسی شوند.
 */
.mah24-ptitle {
	--mah24-ptitle-ink: #2c2c2c;
	--mah24-ptitle-soft: #8a8a8a;
	--mah24-ptitle-size: clamp(20px, 2.4vw, 28px);
	--mah24-ptitle-en-size: clamp(12px, 1.3vw, 15px);

	display: flex !important;
	flex-direction: column !important;
	gap: 4px !important;
	margin: 0 0 10px !important;
	padding: 0 !important;
	color: var(--mah24-ptitle-ink) !important;
	font-size: var(--mah24-ptitle-size) !important;
	font-weight: 800 !important;
	line-height: 1.7 !important;
	text-align: start !important;
}

.mah24-ptitle--center {
	align-items: center !important;
	text-align: center !important;
}

.mah24-ptitle--end {
	align-items: flex-end !important;
	text-align: end !important;
}

.mah24-ptitle__fa {
	display: block !important;
	color: inherit !important;
	font-size: inherit !important;
	font-weight: inherit !important;
	overflow-wrap: anywhere !important;
}

.mah24-ptitle__en {
	display: block !important;
	color: var(--mah24-ptitle-soft) !important;
	direction: ltr !important;
	font-size: var(--mah24-ptitle-en-size) !important;
	font-weight: 500 !important;
	line-height: 1.8 !important;
	overflow-wrap: anywhere !important;
	/* خودِ خط چپ‌چین است، ولی باید زیر شروع خط فارسی بنشیند. */
	text-align: end !important;
}

.mah24-ptitle--center .mah24-ptitle__en {
	text-align: center !important;
}

.mah24-ptitle--end .mah24-ptitle__en {
	text-align: start !important;
}

.mah24-ptitle a.mah24-ptitle__link {
	display: flex !important;
	flex-direction: column !important;
	gap: 4px !important;
	color: inherit !important;
	text-decoration: none !important;
}

.mah24-ptitle a.mah24-ptitle__link:hover .mah24-ptitle__fa {
	color: #4e1229 !important;
}

/* ------------------------------------------------- ناحیه‌ی قسط اسنپ‌پی */

/*
 * فقط جعبه‌دانِ ناحیه؛ خودِ کارت را افزونه‌ی اسنپ‌پی می‌سازد و استایلش را هم
 * همراه خودش می‌آورد. اینجا نه رنگی عوض می‌شود نه چیدمانی، تا با به‌روزرسانی
 * آن افزونه چیزی نشکند.
 */
.mah24-snapppay {
	/* فاصله‌ی جعبه از دکمه؛ متغیر است تا بدون ویرایش این فایل هم قابل تغییر باشد. */
	--mah24-snapppay-gap: 10px;

	box-sizing: border-box;
	width: 100%;
	margin: 0 0 14px;
}

.mah24-snapppay * {
	box-sizing: border-box;
}

/*
 * جعبه نباید به دکمه بچسبد: رَپِ دکمه خودش ۱۴ پیکسل فاصله‌ی پایین دارد و این
 * هم رویش سوار می‌شود، پس در مجموع نفسی بین دکمه و جعبه می‌ماند.
 */
.mah24-order-btn-wrap + .mah24-snapppay {
	margin-top: var(--mah24-snapppay-gap, 10px);
}
