/* Sadattoys Mobile AddToCart - Frontend Styles */

.samac-box {
	/* Hidden by default. Shown only under the mobile breakpoint below. */
	display: none;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 14px;
	width: 100%;
	direction: rtl;
	text-align: right;
	font-family: 'Vazirmatn', 'IRANSans', 'Estedad', Tahoma, sans-serif;
	background: #ffffff;
	box-sizing: border-box;
}

.samac-box * {
	box-sizing: border-box;
}

.samac-price-col {
	display: flex;
	flex-direction: column;
	gap: 4px;
	min-width: 0;
	flex: 1 1 auto;
}

.samac-price-top {
	display: flex;
	align-items: center;
	gap: 8px;
}

.samac-badge {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	background: #e0234f;
	color: #ffffff;
	font-size: 13px;
	font-weight: 700;
	line-height: 1;
	padding: 4px 10px;
	border-radius: 6px;
	white-space: nowrap;
	direction: ltr;
}

.samac-old-price {
	text-decoration: line-through;
	color: #a3a3a3;
	font-size: 14px;
	white-space: nowrap;
}

.samac-final-price {
	display: flex;
	align-items: baseline;
	flex-wrap: wrap;
	gap: 4px;
	font-size: 20px;
	font-weight: 700;
	color: #1a1a1a;
	line-height: 1.3;
}

.samac-final-price .woocommerce-Price-currencySymbol {
	display: block;
	font-size: 12px;
	font-weight: 400;
	color: #9a9a9a;
	margin-top: 2px;
}

.samac-stepper {
	display: flex;
	align-items: center;
	gap: 6px;
	background: #f5f5f5;
	border-radius: 8px;
	padding: 4px;
	flex-shrink: 0;
}

.samac-stepper-btn {
	appearance: none;
	border: none;
	background: transparent;
	color: inherit;
	font-size: 18px;
	line-height: 1;
	width: 28px;
	height: 28px;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	border-radius: 6px;
}

.samac-stepper-btn:hover {
	background: rgba(0, 0, 0, 0.06);
}

.samac-stepper-input {
	width: 36px;
	text-align: center;
	border: none;
	background: transparent;
	font-size: 15px;
	font-weight: 600;
	color: inherit;
	-moz-appearance: textfield;
}

.samac-stepper-input::-webkit-outer-spin-button,
.samac-stepper-input::-webkit-inner-spin-button {
	-webkit-appearance: none;
	margin: 0;
}

.samac-cart-btn {
	appearance: none;
	border: none;
	cursor: pointer;
	flex-shrink: 0;
	background: #d6236f;
	color: #ffffff;
	font-size: 16px;
	font-weight: 700;
	font-family: inherit;
	padding: 14px 20px;
	border-radius: 10px;
	transition: opacity 0.2s ease, background-color 0.2s ease;
	white-space: nowrap;
}

.samac-cart-btn:disabled {
	opacity: 0.65;
	cursor: progress;
}

.samac-cart-btn.is-success {
	background: #2fa84f;
}

.samac-notice {
	flex: 1 0 100%;
	font-size: 12px;
	min-height: 0;
}

.samac-notice.samac-notice-success {
	color: #2fa84f;
}

.samac-notice.samac-notice-error {
	color: #d63638;
}

/* Show only on mobile. */
@media (max-width: 768px) {
	.samac-box {
		display: flex;
	}
}

@media (max-width: 360px) {
	.samac-cart-btn {
		padding: 12px 14px;
		font-size: 14px;
	}

	.samac-final-price {
		font-size: 17px;
	}
}

/* ---------------- Sticky mode (footer-aware) ---------------- */
.samac-box.samac-sticky {
	position: fixed;
	left: 0;
	right: 0;
	bottom: 0;
	z-index: 9999;
	box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.1);
	transition: transform 0.25s ease;
	padding-bottom: calc(14px + env(safe-area-inset-bottom, 0px));
}

/* Slid out of the way once the site footer becomes visible, so it never
   sits on top of footer content. Toggled by script.js via IntersectionObserver. */
.samac-box.samac-sticky.samac-sticky-hidden {
	transform: translateY(110%);
	pointer-events: none;
}
