/* Samaneh product scroller — responsive geometry is owned by Elementor. */
.samaneh-product-grid{display:grid;gap:18px}
.samaneh-product-card{overflow:hidden;background:#fff}
.samaneh-product-image{display:block}
.samaneh-product-image img{display:block;width:100%;height:auto}
.samaneh-product-body{padding:14px}
.samaneh-product-title{margin:0 0 8px}
.samaneh-product-title a{text-decoration:none}
.samaneh-product-sku{font-size:12px;opacity:.7;margin-bottom:6px}
.samaneh-product-price{margin-bottom:12px}
.samaneh-product-button{display:inline-flex;text-decoration:none;padding:9px 14px}

/* Geometry.
 * The widget renders these variables from the responsive values saved in Elementor.
 * No viewport gets a hard-coded card count here.
 */
.samaneh-product-scroller{
	position:relative;
	padding-inline:56px;
	min-width:0;
	overflow:visible;
	--samaneh-active-pv:var(--samaneh-pv-d,4);
	--samaneh-active-gap:var(--samaneh-gap-d,18px);
	--samaneh-active-basis:var(--samaneh-basis-d,calc(25% - 13.5px));
	--samaneh-active-manual-width:var(--samaneh-width-d,270px);
}
.samaneh-product-scroller-track{
	display:flex;
	gap:var(--samaneh-active-gap);
	overflow-x:auto;
	overflow-y:hidden;
	scroll-snap-type:x mandatory;
	scrollbar-width:none;
	padding:6px 2px;
	min-width:0;
	overscroll-behavior-inline:contain;
	-webkit-overflow-scrolling:touch;
}
.samaneh-product-scroller-track::-webkit-scrollbar{display:none}
.samaneh-product-scroller .samaneh-product-card{
	scroll-snap-align:start;
	box-sizing:border-box;
	min-width:0;
	display:flex;
	flex-direction:column;
	height:auto;
	isolation:isolate;
}

/* Per-view mode: Elementor decides exactly how many complete cards are visible. */
.samaneh-product-scroller.samaneh-card-sizing-per-view .samaneh-product-scroller-track>.samaneh-product-card{
	flex:0 0 var(--samaneh-active-basis)!important;
	width:var(--samaneh-active-basis)!important;
	max-width:var(--samaneh-active-basis)!important;
}

/* Manual mode remains controlled by Elementor's responsive width setting. */
.samaneh-product-scroller.samaneh-card-sizing-manual .samaneh-product-scroller-track>.samaneh-product-card{
	flex:0 0 var(--samaneh-active-manual-width);
	width:var(--samaneh-active-manual-width);
	max-width:var(--samaneh-active-manual-width);
}

/* Card structure only. Values exposed in Elementor (colors, radius, typography,
 * image height/fit, button styling...) are intentionally not overwritten here.
 */
.samaneh-product-scroller .samaneh-product-media{
	position:relative;
	min-width:0;
	overflow:hidden;
	box-sizing:border-box;
	padding:0!important;
	margin:0!important;
	line-height:0;
}
.samaneh-product-scroller .samaneh-product-image{
	width:100%;
	height:100%;
	min-width:0;
	overflow:hidden;
	display:block;
	box-sizing:border-box;
	margin:0!important;
	padding:0!important;
	line-height:0;
}
.samaneh-product-scroller .samaneh-product-media,
.samaneh-product-scroller .samaneh-product-image,
.samaneh-product-scroller .samaneh-product-image img{
	background:transparent!important;
	border:0!important;
	box-shadow:none!important;
}
.samaneh-product-scroller .samaneh-product-image{
	padding:0;
}
.samaneh-product-scroller .samaneh-product-image img{
	display:block;
	width:100%!important;
	height:100%!important;
	max-width:none;
	margin:0!important;
	padding:0!important;
	border:0!important;
	box-sizing:border-box;
	object-position:center center;
	transform:scale(var(--samaneh-image-fill,1.22));
	transform-origin:center center;
	transition:transform .22s ease;
}
.samaneh-product-scroller .samaneh-product-image img.attachment-woocommerce_thumbnail,
.samaneh-product-scroller .samaneh-product-image img.wp-post-image{
	display:block;
	width:100%!important;
	height:100%!important;
	margin:0!important;
	padding:0!important;
	border:0!important;
}
.samaneh-product-scroller .samaneh-product-card:hover .samaneh-product-image img{
	transform:scale(max(var(--samaneh-image-fill,1.22),var(--samaneh-image-hover,1.24)));
}
.samaneh-product-scroller .samaneh-product-body{
	box-sizing:border-box;
	min-width:0;
	width:100%;
	flex:1 1 auto;
	display:flex;
	flex-direction:column;
}
.samaneh-product-scroller .samaneh-product-category,
.samaneh-product-scroller .samaneh-product-title,
.samaneh-product-scroller .samaneh-product-rating,
.samaneh-product-scroller .samaneh-product-price,
.samaneh-product-scroller .samaneh-product-sku{
	width:100%;
	min-width:0;
	max-width:100%;
	box-sizing:border-box;
}
.samaneh-product-scroller .samaneh-product-title a{
	display:-webkit-box;
	-webkit-box-orient:vertical;
	-webkit-line-clamp:2;
	overflow:hidden;
	overflow-wrap:anywhere;
}
.samaneh-product-scroller .samaneh-product-price{
	display:flex;
	display:flex;
	align-items:baseline;
	align-content:flex-start;
	flex-wrap:wrap;
	gap:2px 6px;
	line-height:1.55;
	overflow:hidden;
}
.samaneh-product-scroller .samaneh-product-price del,
.samaneh-product-scroller .samaneh-product-price ins,
.samaneh-product-scroller .samaneh-product-price .woocommerce-Price-amount,
.samaneh-product-scroller .samaneh-product-price bdi{
	white-space:nowrap;
	max-width:100%;
}
.samaneh-product-scroller .samaneh-product-price del,
.samaneh-product-scroller .samaneh-product-price ins{display:inline-flex;align-items:baseline}
.samaneh-product-scroller .samaneh-product-price ins{text-decoration:none}
.samaneh-product-scroller .samaneh-product-button{
	box-sizing:border-box;
	max-width:100%;
	min-width:0;
	align-items:center;
	justify-content:center;
	text-align:center;
	white-space:normal;
	margin-top:auto;
}
.samaneh-product-scroller .samaneh-product-button>span{min-width:0}

/* These two Elementor controls existed in the widget but had no frontend CSS. */
.samaneh-product-scroller.samaneh-card-align-right .samaneh-product-body{text-align:right;align-items:flex-start}
.samaneh-product-scroller.samaneh-card-align-right .samaneh-product-price{justify-content:flex-start}
.samaneh-product-scroller.samaneh-card-align-center .samaneh-product-body{text-align:center;align-items:center}
.samaneh-product-scroller.samaneh-card-align-center .samaneh-product-price{justify-content:center}
.samaneh-product-scroller.samaneh-card-align-left .samaneh-product-body{text-align:left;align-items:flex-end}
.samaneh-product-scroller.samaneh-card-align-left .samaneh-product-price{justify-content:flex-end}
.samaneh-scroller-button-full-yes .samaneh-product-scroller .samaneh-product-button{width:100%}

/* Keep discount/stock badges inside the media instead of consuming card width. */
.samaneh-product-scroller .samaneh-product-badges{
	position:absolute;
	top:8px;
	right:8px;
	z-index:3;
	display:flex;
	flex-direction:column;
	align-items:flex-start;
	gap:5px;
	max-width:calc(100% - 16px);
	pointer-events:none;
}
.samaneh-product-scroller .samaneh-product-badge{box-sizing:border-box;max-width:100%}
.samaneh-product-scroller .samaneh-sale-badge{display:inline-flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;gap:1px;min-width:54px;min-height:50px;padding:6px 8px;line-height:1;background:var(--samaneh-discount-bg,#111827);color:var(--samaneh-discount-color,#fff);border-radius:15px;box-shadow:0 10px 22px rgba(15,23,42,.12)}
.samaneh-product-scroller .samaneh-sale-badge strong{display:block;line-height:1;font-size:1em}
.samaneh-product-scroller .samaneh-sale-badge small{display:block;font-size:.72em;line-height:1.05}
.samaneh-product-scroller .samaneh-stock-badge{display:inline-flex;padding:4px 7px;line-height:1.2;border-radius:999px}

/* Navigation. Arrows sit on the edge of the scroller, not over the card content. */
.samaneh-scroll-prev,.samaneh-scroll-next{
	position:absolute;
	top:50%;
	transform:translateY(-50%);
	z-index:8;
	width:44px;
	height:44px;
	border:1px solid rgba(15,23,42,.08);
	border-radius:999px;
	background:rgba(255,255,255,.96);
	box-shadow:0 10px 28px rgba(15,23,42,.14);
	display:flex;
	align-items:center;
	justify-content:center;
	padding:0;
	cursor:pointer;
	color:#0f172a;
	line-height:1;
	transition:transform .18s ease,box-shadow .18s ease,opacity .18s ease,background-color .18s ease;
}
.samaneh-scroll-prev svg,.samaneh-scroll-next svg{width:18px;height:18px;display:block;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
.samaneh-scroll-prev:hover,.samaneh-scroll-next:hover{transform:translateY(-50%) scale(1.04);box-shadow:0 14px 34px rgba(15,23,42,.18);background:#fff}
.samaneh-scroll-prev:focus-visible,.samaneh-scroll-next:focus-visible{outline:none;box-shadow:0 0 0 3px rgba(15,23,42,.10),0 10px 28px rgba(15,23,42,.16)}
.samaneh-scroll-prev.is-hidden,.samaneh-scroll-next.is-hidden{display:none!important}
.samaneh-scroll-prev.is-disabled,.samaneh-scroll-next.is-disabled{opacity:.42;cursor:default;box-shadow:none;pointer-events:none}
.samaneh-scroll-prev{right:6px}
.samaneh-scroll-next{left:6px}

/* Header gets room to wrap gracefully on narrow sections without changing any
 * Elementor typography or color setting. */
.samaneh-scroller-header{min-width:0}
.samaneh-scroller-heading{min-width:0}
.samaneh-scroller-title,.samaneh-scroller-subtitle{overflow-wrap:anywhere}

/* Card layout presets */
.samaneh-layout-card-compact .samaneh-product-body{padding:9px}
.samaneh-layout-card-compact .samaneh-product-title{margin-bottom:4px}
.samaneh-layout-card-compact .samaneh-product-price{margin-bottom:7px}
.samaneh-layout-card-compact .samaneh-product-button{padding:7px 10px}
.samaneh-layout-card-horizontal .samaneh-product-card{display:grid;grid-template-columns:minmax(90px,38%) minmax(0,1fr);align-items:stretch}
.samaneh-layout-card-horizontal .samaneh-product-image,.samaneh-layout-card-horizontal .samaneh-product-image img{height:100%}
.samaneh-layout-card-horizontal .samaneh-product-image img{object-fit:cover}
.samaneh-layout-card-minimal .samaneh-product-card{background:transparent!important;border-color:transparent!important;box-shadow:none!important}
.samaneh-layout-card-minimal .samaneh-product-body{padding-inline:0}
.samaneh-layout-card-minimal .samaneh-product-button{background:transparent!important;padding-inline:0}

/* Elementor tablet breakpoint. */
@media(max-width:1024px){
	.samaneh-product-scroller{
		padding-inline:42px;
		--samaneh-active-pv:var(--samaneh-pv-t,var(--samaneh-pv-d,3));
		--samaneh-active-gap:var(--samaneh-gap-t,var(--samaneh-gap-d,14px));
		--samaneh-active-basis:var(--samaneh-basis-t,var(--samaneh-basis-d,calc(33.33333% - 9.33333px)));
		--samaneh-active-manual-width:var(--samaneh-width-t,var(--samaneh-width-d,42%));
	}
	.samaneh-scroll-prev{right:2px}
	.samaneh-scroll-next{left:2px}
}

/* Elementor mobile breakpoint.
 * Critical fix: do not reserve ~80px inside a two-column carousel for arrows.
 * The full track width is available to Elementor's two cards; arrows float just
 * outside the edges. This is what prevents the narrow cards shown in the screenshot.
 */
@media(max-width:767px){
	.samaneh-product-scroller{
		padding-inline:0;
		--samaneh-active-pv:var(--samaneh-pv-m,var(--samaneh-pv-t,2));
		--samaneh-active-gap:var(--samaneh-gap-m,var(--samaneh-gap-t,12px));
		--samaneh-active-basis:var(--samaneh-basis-m,var(--samaneh-basis-t,calc(50% - 6px)));
		--samaneh-active-manual-width:var(--samaneh-width-m,var(--samaneh-width-t,72%));
	}
	.samaneh-product-scroller-track{padding-block:4px;padding-inline:2px}
	.samaneh-scroll-prev,.samaneh-scroll-next{width:32px;height:32px}
	.samaneh-scroll-prev svg,.samaneh-scroll-next svg{width:14px;height:14px}
	.samaneh-scroll-prev{right:-13px}
	.samaneh-scroll-next{left:-13px}
	.samaneh-product-scroller .samaneh-product-badges{top:6px;right:6px;max-width:calc(100% - 12px)}
	.samaneh-product-scroller .samaneh-sale-badge{min-width:48px;min-height:44px;padding:5px 7px;gap:1px}
	.samaneh-product-scroller .samaneh-product-price{gap:1px 5px}
	.samaneh-product-scroller .samaneh-product-button{min-height:0}

	/* Respect the dedicated Elementor “فلش در موبایل” switch. */
	.samaneh-product-scroller:not(.samaneh-mobile-arrows)>.samaneh-scroll-prev,
	.samaneh-product-scroller:not(.samaneh-mobile-arrows)>.samaneh-scroll-next{display:none!important}
}

@media(max-width:520px){
	.samaneh-layout-card-horizontal .samaneh-product-card{grid-template-columns:1fr}
	.samaneh-layout-card-horizontal .samaneh-product-image img{height:auto}
}

@media(prefers-reduced-motion:reduce){
	.samaneh-product-scroller *,
	.samaneh-product-scroller *::before,
	.samaneh-product-scroller *::after{scroll-behavior:auto!important;transition-duration:.01ms!important;animation-duration:.01ms!important}
}
