/**
 * MGS Mobile Promo Products
 * Isolated mobile-first styles. No theme or slider dependency.
 */

.mgs-mpp,
.mgs-mpp * {
	box-sizing: border-box;
	font-family: var(--mgs-mpp-site-font) !important;
}

.mgs-mpp {
	--mgs-mpp-site-font: var(--e-global-typography-text-font-family, "Vazirmatn"), "Vazir", Tahoma, Arial, sans-serif;
	--mgs-mpp-surface: #f5f5f7;
	--mgs-mpp-card: #fff;
	--mgs-mpp-text: #29272b;
	--mgs-mpp-title-color: #29272b;
	--mgs-mpp-title-size: 12px;
	--mgs-mpp-price-color: #c60044;
	--mgs-mpp-price-size: 12px;
	--mgs-mpp-muted: #68656d;
	--mgs-mpp-accent: #c60044;
	--mgs-mpp-badge: #9d2870;
	--mgs-mpp-border: rgba(36, 31, 35, 0.08);
	--mgs-mpp-card-radius: 16px;
	--mgs-mpp-promo-radius: 18px;
	--mgs-mpp-promo-box-height: 155px;
	--mgs-mpp-promo-button-gap: 8px;
	--mgs-mpp-button-radius: 16px;
	--mgs-mpp-button-color-1: #00a6c7;
	--mgs-mpp-button-color-2: #007fa8;
	--mgs-mpp-button-angle: 135deg;
	--mgs-mpp-promo-width: 116px;
	--mgs-mpp-layout-gap: 8px;
	--mgs-mpp-product-gap: 8px;
	--mgs-mpp-card-width: 148px;
	--mgs-mpp-shadow: 0 8px 24px rgba(30, 20, 27, 0.08);
	display: none;
	width: 100%;
	max-width: 480px;
	min-width: 0;
	margin-inline: auto;
	direction: rtl;
	background: var(--mgs-mpp-surface);
	border: 1px solid var(--mgs-mpp-border);
	border-radius: 22px;
	overflow: hidden;
	isolation: isolate;
}

.mgs-mpp a {
	color: inherit;
	text-decoration: none;
}

.mgs-mpp__promo {
	display: grid !important;
	flex: 0 0 var(--mgs-mpp-promo-width) !important;
	width: var(--mgs-mpp-promo-width) !important;
	min-width: 0;
	min-height: 0 !important;
	grid-template-rows: auto auto;
	align-content: start !important;
	row-gap: 0 !important;
	align-self: flex-start !important;
	overflow: visible;
	border-radius: 0;
	background: transparent;
	touch-action: manipulation;
}

.mgs-mpp__promo-media {
	position: relative;
	flex: 0 0 auto;
	width: 100%;
	margin: 0 !important;
	height: var(--mgs-mpp-promo-box-height) !important;
	overflow: hidden;
	border-radius: var(--mgs-mpp-promo-radius);
	background: #ececef;
	box-shadow: none;
}

.mgs-mpp__promo-image {
	position: absolute !important;
	inset: 0;
	display: block !important;
	width: 100% !important;
	height: 100% !important;
	max-width: 100% !important;
	object-fit: cover !important;
	object-position: center;
	transition: transform 240ms ease;
}

.mgs-mpp--promo-full .mgs-mpp__promo-image {
	object-fit: contain !important;
}

.mgs-mpp__promo-button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 82%;
	min-width: 92px;
	max-width: 100%;
	min-height: 44px;
	margin: var(--mgs-mpp-promo-button-gap) auto 0 !important;
	padding: 8px 10px;
	border-radius: var(--mgs-mpp-button-radius);
	background: linear-gradient(var(--mgs-mpp-button-angle), var(--mgs-mpp-button-color-1), var(--mgs-mpp-button-color-2));
	color: #fff;
	font-size: 11px;
	font-weight: 700;
	line-height: 1.4;
	text-align: center;
	box-shadow: 0 5px 16px rgba(0, 127, 168, 0.22);
	box-shadow: 0 5px 16px color-mix(in srgb, var(--mgs-mpp-button-color-2) 26%, transparent);
}

.mgs-mpp__products {
	position: relative;
	flex: 1 1 auto;
	min-width: 0;
	align-self: stretch;
}

.mgs-mpp__viewport {
	width: 100%;
	height: 100%;
	min-width: 0;
	overflow-x: auto;
	overflow-y: hidden;
	scroll-snap-type: x mandatory;
	scroll-behavior: smooth;
	scrollbar-width: none;
	overscroll-behavior-inline: contain;
	-webkit-overflow-scrolling: touch;
	touch-action: pan-x pan-y;
}

.mgs-mpp__viewport::-webkit-scrollbar {
	display: none;
}

.mgs-mpp__viewport:focus-visible,
.mgs-mpp__promo:focus-visible,
.mgs-mpp__product-link:focus-visible,
.mgs-mpp__nav:focus-visible {
	outline: 3px solid var(--mgs-mpp-accent);
	outline: 3px solid color-mix(in srgb, var(--mgs-mpp-accent) 72%, white);
	outline-offset: 2px;
}

.mgs-mpp__track {
	display: flex;
	align-items: stretch;
	gap: var(--mgs-mpp-product-gap);
	width: max-content;
	min-width: 100%;
	height: 100%;
	padding-inline: 1px 4px;
}

.mgs-mpp__product {
	position: relative;
	display: flex;
	flex: 0 0 var(--mgs-mpp-card-width);
	width: var(--mgs-mpp-card-width);
	min-width: 0;
	min-height: 252px;
	overflow: hidden;
	scroll-snap-align: start;
	border: 1px solid var(--mgs-mpp-border);
	border-radius: var(--mgs-mpp-card-radius);
	background: var(--mgs-mpp-card);
	box-shadow: var(--mgs-mpp-shadow);
}

.mgs-mpp__product-link {
	display: flex;
	flex: 1 1 auto;
	min-width: 0;
	flex-direction: column;
	color: var(--mgs-mpp-text);
	touch-action: manipulation;
}

.mgs-mpp__image-wrap {
	position: relative;
	width: 100%;
	aspect-ratio: 1 / 1;
	overflow: hidden;
	background: linear-gradient(145deg, #fff 10%, #f7f7f8 100%);
}

.mgs-mpp__product-image,
.mgs-mpp__image-wrap img {
	display: block;
	width: 100%;
	height: 100%;
	margin: 0;
	object-fit: contain;
	transition: transform 220ms ease;
}

.mgs-mpp__sale,
.mgs-mpp__stock {
	position: absolute;
	top: 7px;
	z-index: 2;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 28px;
	padding: 4px 7px;
	border-radius: 999px;
	color: #fff;
	font-size: 10px;
	font-weight: 700;
	line-height: 1;
	white-space: nowrap;
}

.mgs-mpp__sale {
	right: 7px;
	background: var(--mgs-mpp-badge);
}

.mgs-mpp__stock {
	left: 7px;
	background: rgba(35, 32, 35, 0.76);
	backdrop-filter: blur(4px);
	-webkit-backdrop-filter: blur(4px);
}

.mgs-mpp__product-content {
	display: flex;
	flex: 1 1 auto;
	min-width: 0;
	flex-direction: column;
	padding: 9px 9px 10px;
}

.mgs-mpp__product-title {
	display: -webkit-box;
	min-height: 39px;
	margin: 0;
	overflow: hidden;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 2;
	color: var(--mgs-mpp-title-color) !important;
	font-size: var(--mgs-mpp-title-size);
	font-weight: 600;
	line-height: 1.65;
	text-align: right;
}

.mgs-mpp__price {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-end;
	justify-content: flex-end;
	gap: 3px 5px;
	min-height: 40px;
	margin-top: auto;
	color: var(--mgs-mpp-price-color) !important;
	font-size: var(--mgs-mpp-price-size);
	font-weight: 800;
	font-variant-numeric: tabular-nums;
	line-height: 1.55;
	text-align: left;
}

.mgs-mpp__price del {
	width: 100%;
	color: var(--mgs-mpp-muted);
	font-size: max(9px, calc(var(--mgs-mpp-price-size) - 2px));
	font-weight: 500;
	opacity: 0.78;
	text-decoration: line-through !important;
	text-decoration-thickness: 1px !important;
}

.mgs-mpp__price ins {
	color: inherit;
	font-weight: inherit;
	text-decoration: none;
}

.mgs-mpp__nav {
	position: absolute;
	top: 50%;
	z-index: 4;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	padding: 0;
	border: 1px solid rgba(35, 31, 34, 0.10);
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.94);
	color: #3c383d;
	box-shadow: 0 6px 20px rgba(35, 23, 30, 0.13);
	transform: translateY(-50%);
	cursor: pointer;
	touch-action: manipulation;
	transition: opacity 180ms ease, background-color 180ms ease, color 180ms ease;
}

.mgs-mpp__nav svg {
	width: 20px;
	height: 20px;
	fill: none;
	stroke: currentColor;
	stroke-width: 2;
	stroke-linecap: round;
	stroke-linejoin: round;
}

.mgs-mpp__nav--prev {
	right: 4px;
}

.mgs-mpp__nav--next {
	left: 4px;
}

.mgs-mpp__nav[disabled] {
	opacity: 0;
	pointer-events: none;
}

.mgs-mpp__empty {
	padding: 16px;
	border: 1px dashed #c8c5ca;
	border-radius: 12px;
	background: #fafafa;
	color: #5e5a61;
	font-family: inherit;
	font-size: 13px;
	text-align: center;
}

@media (max-width: 767px) {
	.mgs-mpp {
		display: flex;
		align-items: stretch;
		gap: var(--mgs-mpp-layout-gap);
	}
}

/* Keep the mobile-only widget editable in Elementor's canvas. */
.elementor-editor-active .mgs-mpp,
body.elementor-editor-preview .mgs-mpp {
	display: flex;
	align-items: stretch;
	gap: var(--mgs-mpp-layout-gap);
	max-width: 390px;
}

@media (hover: hover) and (pointer: fine) {
	.mgs-mpp__promo:hover .mgs-mpp__promo-image,
	.mgs-mpp__product-link:hover .mgs-mpp__product-image {
		transform: scale(1.025);
	}

	.mgs-mpp__nav:hover {
		background: #fff;
		color: var(--mgs-mpp-accent);
	}
}

@media (prefers-reduced-motion: reduce) {
	.mgs-mpp *,
	.mgs-mpp *::before,
	.mgs-mpp *::after {
		scroll-behavior: auto !important;
		transition-duration: 0.01ms !important;
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
	}
}
