/* AminH Sticky Buy Bar — Digikala-style bottom bar, phones and tablets only. */

.aminh-sbb {
	display: none;
}

@media (max-width: 1024px) {
	.aminh-sbb {
		--aminh-sbb-blue: #06277e; /* the cart's «ثبت سفارش» button (.bg-color-special) */
		--aminh-sbb-red: #d32f2f;
		display: block;
		position: fixed;
		right: 0;
		bottom: 0;
		left: 0;
		z-index: 390; /* above Woodmart toolbar/sticky bar (340-350), below off-canvas panels (400+) */
		direction: rtl;
		background: #fff;
		border-top: 1px solid #e0e0e2;
		padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px));
		box-sizing: border-box;
		font-family: inherit;
		-webkit-tap-highlight-color: transparent;
	}

	.aminh-sbb[hidden] {
		display: none !important;
	}

	/*
	 * Woodmart's bottom toolbar stays (the cart is one tap away). The bar's white
	 * background runs down behind it, and the floating toolbar is lifted above the
	 * bar so it is drawn on top of that white area (it pads the home indicator itself).
	 */
	body.aminh-sbb-has-tb .aminh-sbb {
		padding-bottom: calc(12px + var(--aminh-sbb-tb, 0px));
	}

	body.aminh-sbb-has-tb .wd-toolbar {
		z-index: 391;
	}

	.aminh-sbb-inner {
		display: flex;
		align-items: center;
		justify-content: space-between;
		gap: 12px;
		max-width: 1024px;
		margin: 0 auto;
	}

	.aminh-sbb .aminh-sbb-btn {
		flex: 0 0 46%;
		max-width: 46%;
		height: 48px;
		min-height: 48px;
		margin: 0;
		padding: 0 12px;
		border: 0;
		border-radius: 8px;
		background: var(--aminh-sbb-blue);
		color: #fff;
		font-family: inherit;
		font-size: 15px;
		font-weight: 700;
		line-height: 48px;
		text-align: center;
		white-space: nowrap;
		overflow: hidden;
		text-overflow: ellipsis;
		box-shadow: none;
		cursor: pointer;
		transition: opacity 0.15s ease;
	}

	.aminh-sbb .aminh-sbb-btn:hover,
	.aminh-sbb .aminh-sbb-btn:focus {
		background: var(--aminh-sbb-blue);
		color: #fff;
	}

	/* Woodmart draws keyboard focus with an !important dotted outline built from
	   these variables; tune them instead of fighting the !important. */
	.aminh-sbb .aminh-sbb-btn {
		--wd-otl-style: solid;
		--wd-otl-color: var(--aminh-sbb-blue);
		--wd-otl-offset: 2px;
	}

	.aminh-sbb .aminh-sbb-btn:focus-visible {
		outline: 2px solid var(--aminh-sbb-blue);
		outline-offset: 2px;
	}

	.aminh-sbb .aminh-sbb-btn.aminh-sbb-loading {
		opacity: 0.7;
		pointer-events: none;
	}

	.aminh-sbb .aminh-sbb-btn[hidden] {
		display: none;
	}

	.aminh-sbb .aminh-sbb-btn[disabled],
	.aminh-sbb .aminh-sbb-btn[disabled]:hover {
		background: #e0e0e2;
		color: #9e9e9e;
		cursor: default;
	}

	/* Digikala-style quantity stepper: + on the right, trash (or −) on the left. */
	.aminh-sbb-stepper {
		flex: 0 0 46%;
		max-width: 46%;
		height: 48px;
		display: flex;
		align-items: center;
		justify-content: space-between;
		box-sizing: border-box;
		padding: 0 4px;
		border: 1px solid #e0e0e2;
		border-radius: 8px;
		background: #fff;
		box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
	}

	.aminh-sbb-stepper[hidden] {
		display: none;
	}

	.aminh-sbb .aminh-sbb-step {
		flex: 0 0 40px;
		width: 40px;
		height: 40px;
		min-height: 40px;
		margin: 0;
		padding: 0;
		border: 0;
		border-radius: 6px;
		background: transparent;
		color: var(--aminh-sbb-red);
		display: flex;
		align-items: center;
		justify-content: center;
		box-shadow: none;
		cursor: pointer;
		--wd-otl-style: solid;
		--wd-otl-color: var(--aminh-sbb-blue);
	}

	/* Hover/focus tint only for mouse and keyboard: on a phone it would stick after the tap. */
	.aminh-sbb .aminh-sbb-step:focus {
		background: transparent;
		color: var(--aminh-sbb-red);
	}

	.aminh-sbb .aminh-sbb-step:focus-visible {
		background: #f5f5f5;
	}

	@media (hover: hover) {
		.aminh-sbb .aminh-sbb-step:hover {
			background: #f5f5f5;
			color: var(--aminh-sbb-red);
		}
	}

	.aminh-sbb .aminh-sbb-step[disabled] {
		color: #bdbdbd;
		background: transparent;
		cursor: default;
	}

	.aminh-sbb-step svg {
		display: block;
	}

	.aminh-sbb-stepper .aminh-sbb-ic-trash,
	.aminh-sbb-stepper.aminh-sbb-last .aminh-sbb-ic-minus {
		display: none;
	}

	.aminh-sbb-stepper.aminh-sbb-last .aminh-sbb-ic-trash {
		display: block;
	}

	.aminh-sbb-qty {
		flex: 1 1 auto;
		text-align: center;
		color: var(--aminh-sbb-red);
		font-size: 18px;
		font-weight: 700;
		line-height: 48px;
	}

	.aminh-sbb-stepper.aminh-sbb-busy .aminh-sbb-qty {
		opacity: 0.5;
	}

	/* On phones the bar is the only buy button: hide the form's own quantity + add-to-cart. */
	body.aminh-sbb-on .aminh-sbb-form .single_add_to_cart_button,
	body.aminh-sbb-on .aminh-sbb-form div.quantity {
		display: none !important;
	}

	.aminh-sbb-price {
		display: flex;
		flex-direction: column;
		align-items: flex-end; /* left edge in RTL */
		justify-content: center;
		min-width: 0;
		line-height: 1.2;
	}

	.aminh-sbb-price.aminh-sbb-no-price {
		visibility: hidden;
	}

	.aminh-sbb-was {
		display: flex;
		align-items: center;
		gap: 6px;
		margin-bottom: 4px;
	}

	.aminh-sbb-was[hidden] {
		display: none;
	}

	.aminh-sbb-off {
		display: inline-block;
		padding: 1px 8px;
		border-radius: 999px;
		background: var(--aminh-sbb-red);
		color: #fff;
		font-size: 12px;
		font-weight: 700;
		line-height: 18px;
		white-space: nowrap;
	}

	.aminh-sbb-regular {
		color: #9e9e9e;
		font-size: 13px;
		line-height: 18px;
		text-decoration: line-through;
		white-space: nowrap;
	}

	.aminh-sbb-now {
		display: flex;
		align-items: center;
		gap: 4px;
		color: #212121;
		white-space: nowrap;
	}

	.aminh-sbb-amount {
		font-size: 19px;
		font-weight: 800;
		line-height: 24px;
	}

	.aminh-sbb-currency {
		font-size: 11px;
		font-weight: 700;
		line-height: 1;
	}

	/* Briefly marks the field the shopper still has to fill in. */
	.aminh-sbb-attention {
		outline: 2px solid #06277e;
		outline-offset: 4px;
		border-radius: 6px;
		transition: outline-color 0.3s ease;
	}

	/*
	 * Room for the bar (its measured height includes the toolbar area). Woodmart's
	 * tablet sticky add-to-cart would duplicate the bar.
	 */
	body.aminh-sbb-on {
		padding-bottom: calc(var(--aminh-sbb-h, 73px) + env(safe-area-inset-bottom, 0px)) !important;
	}

	body.aminh-sbb-on .wd-sticky-btn {
		display: none !important;
	}

	/* Scroll-to-top button and the site's «added to cart» toast sit above the bar. */
	body.aminh-sbb-on .scrollToTop,
	body.aminh-sbb-on #erfan-cart-notice {
		bottom: calc(var(--aminh-sbb-h, 73px) + 12px) !important;
	}
}

/* «برو به سبد خرید» added to the site's toast (all widths). */
#erfan-cart-notice .aminh-sbb-go-cart {
	flex: 0 0 auto;
	margin-inline-start: auto;
	padding: 6px 10px;
	border: 1px solid #06277e;
	border-radius: 8px;
	color: #06277e;
	font-size: 13px;
	font-weight: 700;
	line-height: 1.4;
	white-space: nowrap;
	text-decoration: none;
}

#erfan-cart-notice .aminh-sbb-go-cart:hover,
#erfan-cart-notice .aminh-sbb-go-cart:focus {
	background: #06277e;
	color: #fff;
}
