/*
 * Suta Phone Commerce — Buy Now row (spec 16). Two compact rows on one left edge:
 *   [ qty ][        এখনই কিনুন  (primary)        ]
 *   [   Add to cart (outline) ][ WhatsApp (outline) ]
 * The row is the element that holds the buttons: form.cart (simple) or
 * .woocommerce-variation-add-to-cart (variable). Colours/radius follow the Elementor globals.
 */
.spc-has-buy-now {
	--spc-rose: var(--e-global-color-primary, #d6335c);
	--spc-rose-dark: var(--e-global-color-rosetxt, #b8284f);
	--spc-green: #1a7f37;
	--spc-line: #e6dcd8;
	--spc-radius: var(--hb-r-btn, 12px);
	display: flex !important;
	flex-wrap: wrap !important;
	align-items: stretch !important;
	gap: 10px !important;
	margin: 0 0 20px !important;
}

.spc-has-buy-now::before,
.spc-has-buy-now::after {
	/* theme clearfix pseudo-elements would become flex items and push the row */
	display: none !important;
}

.spc-has-buy-now > * {
	margin: 0 !important;
	box-sizing: border-box;
}

/* ── quantity stepper: same height and corners as the primary button ── */
.spc-has-buy-now .quantity {
	order: 1;
	flex: 0 0 120px;
	display: flex !important;
	align-items: center;
	height: 52px !important;
	border: 1.5px solid var(--spc-line) !important;
	border-radius: var(--spc-radius) !important;
	background: #fff;
	overflow: hidden;
}

.spc-has-buy-now .quantity .minus,
.spc-has-buy-now .quantity .plus {
	flex: 0 0 36px;
	display: flex !important;
	align-items: center;
	justify-content: center;
	height: 100% !important;
	border: 0 !important;
	background: transparent !important;
	color: var(--e-global-color-text, #1e2b26) !important;
	font-size: 18px !important;
	line-height: 1 !important;
}

.spc-has-buy-now .quantity .minus:hover,
.spc-has-buy-now .quantity .plus:hover {
	background: #faf3f1 !important;
}

.spc-has-buy-now .quantity .qty {
	flex: 1 1 auto;
	width: 100% !important;
	min-width: 0;
	height: 100% !important;
	padding: 0 !important;
	border: 0 !important;
	background: transparent !important;
	font-size: 16px !important;
	font-weight: 600;
	text-align: center;
	-moz-appearance: textfield;
}

.spc-has-buy-now .quantity .qty::-webkit-outer-spin-button,
.spc-has-buy-now .quantity .qty::-webkit-inner-spin-button {
	-webkit-appearance: none;
	margin: 0;
}

/* ── Buy Now: the focus action ── */
.spc-buy-now {
	order: 2;
	flex: 1 1 calc(100% - 130px) !important;
	display: inline-flex !important;
	align-items: center;
	justify-content: center;
	gap: 8px;
	min-height: 52px;
	padding: 0 18px !important;
	border: 0 !important;
	border-radius: var(--spc-radius) !important;
	background: var(--spc-rose) !important;
	color: #fff !important;
	font-family: inherit;
	font-size: 17px !important;
	font-weight: 700 !important;
	line-height: 1.2 !important;
	box-shadow: 0 6px 16px rgba(214, 51, 92, 0.25);
	cursor: pointer;
	transition: background-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.spc-buy-now:hover {
	background: var(--spc-rose-dark) !important;
	box-shadow: 0 8px 20px rgba(214, 51, 92, 0.32);
	transform: translateY(-1px);
}

.spc-buy-now:active {
	transform: none;
}

.spc-buy-now__icon,
.spc-has-buy-now .spc-wa-button__icon {
	flex: 0 0 auto;
	width: 20px !important;
	height: 20px !important;
	min-width: 20px;
}

.spc-buy-now.is-disabled {
	opacity: 0.5;
	box-shadow: none;
	transform: none;
	cursor: not-allowed;
}

.spc-buy-now.is-loading {
	opacity: 0.8;
	pointer-events: none;
}

/* ── second row: two quiet outline buttons ── */
.spc-has-buy-now .single_add_to_cart_button {
	order: 3;
	flex: 1 1 calc(50% - 5px) !important;
	width: auto !important;
	min-height: 46px !important;
	height: auto !important;
	padding: 8px 12px !important;
	font-size: 15px !important;
	line-height: 1.2 !important;
}

.spc-restyle-cart .single_add_to_cart_button {
	border: 1.5px solid var(--spc-rose) !important;
	border-radius: var(--spc-radius) !important;
	background: #fff !important;
	color: var(--spc-rose-dark) !important;
	font-weight: 600 !important;
	box-shadow: none !important;
}

.spc-restyle-cart .single_add_to_cart_button:hover {
	background: #fff1f4 !important;
	color: var(--spc-rose-dark) !important;
}

.spc-has-buy-now .spc-wa-inline {
	order: 4;
	flex: 1 1 calc(50% - 5px) !important;
	width: auto !important;
	min-height: 46px;
	margin: 0 !important;
	padding: 8px 12px !important;
	border: 1.5px solid var(--spc-green) !important;
	border-radius: var(--spc-radius) !important;
	background: #fff !important;
	color: var(--spc-green) !important;
	font-size: 15px !important;
	font-weight: 600 !important;
	line-height: 1.2;
	box-shadow: none !important;
}

.spc-has-buy-now .spc-wa-inline:hover,
.spc-has-buy-now .spc-wa-inline:focus {
	background: #effaf2 !important;
	color: var(--spc-green) !important;
}

.spc-buy-now:focus-visible,
.spc-has-buy-now .single_add_to_cart_button:focus-visible,
.spc-has-buy-now .spc-wa-inline:focus-visible {
	outline: 3px solid rgba(214, 51, 92, 0.35);
	outline-offset: 2px;
}

/* Astra's sticky add-to-cart bar keeps its compact single button. */
.ast-sticky-add-to-cart .spc-buy-now,
.ast-sticky-add-to-cart .spc-wa-inline {
	display: none !important;
}

@media (max-width: 420px) {
	.spc-has-buy-now .quantity {
		flex-basis: 108px;
	}
	.spc-buy-now {
		flex-basis: calc(100% - 118px);
		font-size: 16px !important;
	}
	.spc-has-buy-now .single_add_to_cart_button,
	.spc-has-buy-now .spc-wa-inline {
		gap: 6px;
		padding: 8px 6px !important;
		font-size: 14px !important;
		white-space: nowrap;
	}
}

@media (prefers-reduced-motion: reduce) {
	.spc-buy-now {
		transition: none;
	}
}
