/* Shared purchase CTA language. Business logic remains owned by WooCommerce/FunnelKit. */
:root {
	--all4kids-cta-blue: #3452ef;
	--all4kids-cta-blue-hover: #2944d4;
	--all4kids-cta-blue-start: #315dff;
	--all4kids-cta-blue-end: #2f4de9;
	--all4kids-cta-focus: rgba(52, 82, 239, 0.26);
}

body.woocommerce-cart .wc-proceed-to-checkout .checkout-button,
body.woocommerce-checkout #place_order {
	position: relative;
	display: flex !important;
	align-items: center;
	justify-content: center;
	width: 100%;
	min-height: 74px;
	padding: 0 68px !important;
	border: 0 !important;
	border-radius: 999px !important;
	background-color: var(--all4kids-cta-blue) !important;
	background-image: linear-gradient(110deg, var(--all4kids-cta-blue-start), var(--all4kids-cta-blue-end)) !important;
	box-shadow: 0 16px 30px rgba(47, 77, 233, 0.24) !important;
	color: #fff !important;
	font-size: 18px !important;
	font-weight: 600 !important;
	letter-spacing: 0 !important;
	line-height: 1.25 !important;
	text-align: center;
	text-transform: uppercase !important;
	white-space: nowrap;
	transition: box-shadow 180ms ease, filter 180ms ease, transform 180ms ease !important;
}

body.woocommerce-cart .wc-proceed-to-checkout .checkout-button::before,
body.woocommerce-checkout #place_order::before,
body.woocommerce-cart .wc-proceed-to-checkout .checkout-button::after,
body.woocommerce-checkout #place_order::after {
	display: block !important;
	position: absolute !important;
	top: 50% !important;
	width: 52px;
	height: 36px;
	content: "" !important;
	margin: 0 !important;
	opacity: 1 !important;
	visibility: visible !important;
	transform: translateY(-50%) !important;
}

body.woocommerce-cart .wc-proceed-to-checkout .checkout-button::before,
body.woocommerce-checkout #place_order::before {
	left: 10px !important;
	right: auto !important;
	background: url("icons/shopping-bag-rounded.svg") center / 27px 27px no-repeat;
}

body.woocommerce-cart .wc-proceed-to-checkout .checkout-button::after,
body.woocommerce-checkout #place_order::after {
	left: auto !important;
	right: 10px !important;
	background: url("icons/chevron-right.svg") center / 19px 19px no-repeat;
}

/* FunnelKit positions its button loader on ::before; keep the normal CTA icon centered. */
body.woocommerce-checkout #wfacp-e-form .wfacp-order-place-btn-wrap #place_order::before {
	position: absolute !important;
	top: 50% !important;
	left: 10px !important;
	margin: 0 !important;
	transform: translateY(-50%) !important;
}

body.single-product .elementor-widget-wd_single_product_add_to_cart form.cart .single_add_to_cart_button,
body.single-product .elementor-widget-wd_single_product_add_to_cart form.cart #wd-add-to-cart,
.shopping-cart-widget-footer .woocommerce-mini-cart__buttons .checkout {
	position: relative;
	display: flex !important;
	align-items: center;
	justify-content: center;
	min-height: 54px;
	padding: 0 50px !important;
	border: 0 !important;
	border-radius: 999px !important;
	background-color: var(--all4kids-cta-blue) !important;
	background-image: linear-gradient(110deg, var(--all4kids-cta-blue-start), var(--all4kids-cta-blue-end)) !important;
	box-shadow: 0 10px 20px rgba(47, 77, 233, 0.19) !important;
	color: #fff !important;
	font-size: 16px !important;
	font-weight: 600 !important;
	letter-spacing: 0 !important;
	line-height: 1.2 !important;
	text-align: center;
	text-transform: uppercase !important;
	transition: box-shadow 180ms ease, filter 180ms ease, transform 180ms ease !important;
}

body.single-product .elementor-widget-wd_single_product_add_to_cart form.cart .single_add_to_cart_button::before,
body.single-product .elementor-widget-wd_single_product_add_to_cart form.cart #wd-add-to-cart::before,
.shopping-cart-widget-footer .woocommerce-mini-cart__buttons .checkout::before,
body.single-product .elementor-widget-wd_single_product_add_to_cart form.cart .single_add_to_cart_button::after,
body.single-product .elementor-widget-wd_single_product_add_to_cart form.cart #wd-add-to-cart::after,
.shopping-cart-widget-footer .woocommerce-mini-cart__buttons .checkout::after {
	display: block !important;
	position: absolute !important;
	top: 50% !important;
	width: 36px;
	height: 28px;
	content: "" !important;
	margin: 0 !important;
	opacity: 1 !important;
	visibility: visible !important;
	transform: translateY(-50%) !important;
}

body.single-product .elementor-widget-wd_single_product_add_to_cart form.cart .single_add_to_cart_button::before,
body.single-product .elementor-widget-wd_single_product_add_to_cart form.cart #wd-add-to-cart::before,
.shopping-cart-widget-footer .woocommerce-mini-cart__buttons .checkout::before {
	left: 6px !important;
	right: auto !important;
	background: url("icons/shopping-bag-rounded.svg") center / 22px 22px no-repeat;
}

body.single-product .elementor-widget-wd_single_product_add_to_cart form.cart .single_add_to_cart_button::after,
body.single-product .elementor-widget-wd_single_product_add_to_cart form.cart #wd-add-to-cart::after,
.shopping-cart-widget-footer .woocommerce-mini-cart__buttons .checkout::after {
	left: auto !important;
	right: 6px !important;
	border: 0 !important;
	border-radius: 0 !important;
	background: url("icons/chevron-right.svg") center / 16px 16px no-repeat;
	animation: none !important;
}

body.single-product .elementor-widget-wd_single_product_add_to_cart form.cart .single_add_to_cart_button,
body.single-product .elementor-widget-wd_single_product_add_to_cart form.cart #wd-add-to-cart {
	flex: 1 1 0;
	min-width: 0;
	max-width: none;
	white-space: nowrap;
}

.shopping-cart-widget-footer .woocommerce-mini-cart__buttons .checkout {
	min-width: 0;
	padding: 0 36px !important;
	font-size: 13px !important;
}

.shopping-cart-widget-footer .woocommerce-mini-cart__buttons .checkout::before,
.shopping-cart-widget-footer .woocommerce-mini-cart__buttons .checkout::after {
	width: 30px;
}

.shopping-cart-widget-footer .woocommerce-mini-cart__buttons .checkout::before {
	left: 4px !important;
}

.shopping-cart-widget-footer .woocommerce-mini-cart__buttons .checkout::after {
	right: 4px !important;
}

.product-grid-item .wd-add-btn .add_to_cart_button,
.product-grid-item .wd-add-btn-replace .add-to-cart-loop {
	border-radius: 11px !important;
	background-color: var(--all4kids-cta-blue) !important;
	box-shadow: 0 6px 14px rgba(52, 82, 239, 0.14) !important;
	color: #fff !important;
	font-weight: 800 !important;
	letter-spacing: 0 !important;
	text-transform: uppercase !important;
	transition: background-color 180ms ease, box-shadow 180ms ease, transform 180ms ease !important;
}

body.woocommerce-cart .wc-proceed-to-checkout .checkout-button:hover,
body.woocommerce-checkout #place_order:hover,
body.single-product .elementor-widget-wd_single_product_add_to_cart form.cart .single_add_to_cart_button:hover,
body.single-product .elementor-widget-wd_single_product_add_to_cart form.cart #wd-add-to-cart:hover,
.shopping-cart-widget-footer .woocommerce-mini-cart__buttons .checkout:hover,
.product-grid-item .wd-add-btn .add_to_cart_button:hover,
.product-grid-item .wd-add-btn-replace .add-to-cart-loop:hover {
	background-color: var(--all4kids-cta-blue-hover) !important;
	box-shadow: 0 10px 22px rgba(41, 68, 212, 0.24) !important;
	color: #fff !important;
	filter: brightness(0.96);
	transform: translateY(-1px);
}

body.woocommerce-cart .wc-proceed-to-checkout .checkout-button:focus-visible,
body.woocommerce-checkout #place_order:focus-visible,
body.single-product .elementor-widget-wd_single_product_add_to_cart form.cart .single_add_to_cart_button:focus-visible,
body.single-product .elementor-widget-wd_single_product_add_to_cart form.cart #wd-add-to-cart:focus-visible,
.shopping-cart-widget-footer .woocommerce-mini-cart__buttons .checkout:focus-visible,
.product-grid-item .wd-add-btn .add_to_cart_button:focus-visible,
.product-grid-item .wd-add-btn-replace .add-to-cart-loop:focus-visible {
	outline: 3px solid var(--all4kids-cta-focus) !important;
	outline-offset: 3px;
}

body.woocommerce-checkout #place_order:disabled,
body.single-product .elementor-widget-wd_single_product_add_to_cart form.cart .single_add_to_cart_button:disabled,
body.single-product .elementor-widget-wd_single_product_add_to_cart form.cart #wd-add-to-cart:disabled {
	cursor: not-allowed;
	box-shadow: none !important;
	opacity: 0.55;
	transform: none;
}

@media (max-width: 767px) {
	/* WoodMart's sticky bar should read as quantity + one clear purchase action. */
	body.single-product .wd-sticky-btn {
		min-height: 70px;
		padding: 8px 10px calc(8px + env(safe-area-inset-bottom)) !important;
		background: rgba(255, 253, 248, 0.97) !important;
		box-shadow: 0 -10px 28px rgba(29, 43, 80, 0.14) !important;
		backdrop-filter: blur(10px);
	}

	body.single-product .wd-sticky-btn .wd-sticky-btn-container {
		width: 100%;
		padding: 0 !important;
	}

	body.single-product .wd-sticky-btn .wd-sticky-btn-cart {
		width: 100%;
		margin: 0 !important;
	}

	body.single-product .wd-sticky-btn form.cart {
		display: grid !important;
		grid-template-columns: 82px minmax(0, 1fr);
		align-items: stretch;
		gap: 8px;
		width: 100%;
	}

	body.single-product .wd-sticky-btn form.cart .quantity {
		position: relative !important;
		inset: auto !important;
		width: 82px !important;
		height: 54px !important;
		min-height: 54px;
		border: 1px solid rgba(52, 82, 239, 0.16) !important;
		border-radius: 16px !important;
		background: #fff !important;
		box-shadow: 0 5px 14px rgba(29, 43, 80, 0.08);
		overflow: hidden;
	}

	body.single-product .wd-sticky-btn form.cart .quantity :is(.minus, .plus, .qty) {
		height: 54px !important;
		min-height: 54px !important;
		border: 0 !important;
		background: transparent !important;
		color: #24345d !important;
		font-size: 15px !important;
		font-weight: 700 !important;
	}

	body.single-product .wd-sticky-btn form.cart .single_add_to_cart_button {
		position: relative;
		grid-column: 2;
		width: 100%;
		min-width: 0;
		min-height: 54px;
		margin: 0 !important;
		padding: 0 42px !important;
		border: 0 !important;
		border-radius: 16px !important;
		background-color: var(--all4kids-cta-blue) !important;
		background-image: linear-gradient(110deg, var(--all4kids-cta-blue-start), var(--all4kids-cta-blue-end)) !important;
		box-shadow: 0 10px 22px rgba(47, 77, 233, 0.24) !important;
		color: #fff !important;
		font-size: 17px !important;
		font-weight: 800 !important;
		letter-spacing: 0 !important;
		line-height: 1.1 !important;
		text-align: center;
		text-transform: uppercase !important;
		white-space: nowrap;
	}

	body.single-product .wd-sticky-btn form.cart .single_add_to_cart_button::before,
	body.single-product .wd-sticky-btn form.cart .single_add_to_cart_button::after {
		display: block !important;
		position: absolute !important;
		top: 50% !important;
		width: 30px;
		height: 30px;
		content: "" !important;
		margin: 0 !important;
		opacity: 1 !important;
		visibility: visible !important;
		transform: translateY(-50%) !important;
	}

	body.single-product .wd-sticky-btn form.cart .single_add_to_cart_button::before {
		left: 7px !important;
		right: auto !important;
		background: url("icons/shopping-bag-rounded.svg") center / 22px 22px no-repeat;
	}

	body.single-product .wd-sticky-btn form.cart .single_add_to_cart_button::after {
		left: auto !important;
		right: 7px !important;
		border: 0 !important;
		background: url("icons/chevron-right.svg") center / 16px 16px no-repeat;
		animation: none !important;
	}

	body.woocommerce-cart .wc-proceed-to-checkout .checkout-button,
	body.woocommerce-checkout #place_order {
		min-height: 64px;
		padding: 0 58px !important;
		font-size: 18px !important;
	}

	body.woocommerce-cart .wc-proceed-to-checkout .checkout-button::before,
	body.woocommerce-checkout #place_order::before,
	body.woocommerce-cart .wc-proceed-to-checkout .checkout-button::after,
	body.woocommerce-checkout #place_order::after {
		width: 46px;
		height: 30px;
	}

	body.woocommerce-cart .wc-proceed-to-checkout .checkout-button::before,
	body.woocommerce-checkout #place_order::before {
		left: 7px !important;
	}

	body.woocommerce-cart .wc-proceed-to-checkout .checkout-button::after,
	body.woocommerce-checkout #place_order::after {
		right: 7px !important;
	}

	body.woocommerce-checkout #wfacp-e-form .wfacp-order-place-btn-wrap #place_order::before {
		left: 7px !important;
	}

	body.woocommerce-cart .wc-proceed-to-checkout .checkout-button::before,
	body.woocommerce-checkout #place_order::before {
		background-size: 24px 24px;
	}

	body.woocommerce-cart .wc-proceed-to-checkout .checkout-button::after,
	body.woocommerce-checkout #place_order::after {
		background-size: 17px 17px;
	}

	body.single-product .elementor-widget-wd_single_product_add_to_cart form.cart .single_add_to_cart_button,
	body.single-product .elementor-widget-wd_single_product_add_to_cart form.cart #wd-add-to-cart {
		font-size: 18px !important;
	}
}

@media (max-width: 350px) {
	body.single-product .wd-sticky-btn {
		padding-right: 6px !important;
		padding-left: 6px !important;
	}

	body.single-product .wd-sticky-btn form.cart {
		grid-template-columns: 72px minmax(0, 1fr);
		gap: 6px;
	}

	body.single-product .wd-sticky-btn form.cart .quantity {
		width: 72px !important;
	}

	body.single-product .wd-sticky-btn form.cart .single_add_to_cart_button {
		padding-right: 30px !important;
		padding-left: 30px !important;
		font-size: 16px !important;
	}

	body.single-product .wd-sticky-btn form.cart .single_add_to_cart_button::before,
	body.single-product .wd-sticky-btn form.cart .single_add_to_cart_button::after {
		width: 24px;
	}

	body.single-product .wd-sticky-btn form.cart .single_add_to_cart_button::before {
		left: 4px !important;
		background-size: 19px 19px;
	}

	body.single-product .wd-sticky-btn form.cart .single_add_to_cart_button::after {
		right: 4px !important;
		background-size: 14px 14px;
	}
}

/* Reveal quantity only when the customer asks to adjust the cart action. */
html.all4kids-quantity-reveal-enabled body.single-product .all4kids-purchase-controls .quantity {
	transition:
		width 380ms cubic-bezier(0.16, 1, 0.3, 1),
		max-width 380ms cubic-bezier(0.16, 1, 0.3, 1),
		margin 380ms cubic-bezier(0.16, 1, 0.3, 1),
		opacity 240ms ease,
		transform 380ms cubic-bezier(0.16, 1, 0.3, 1),
		filter 300ms ease,
		visibility 0s linear 0s;
}

html.all4kids-quantity-reveal-enabled body.single-product .all4kids-purchase-controls:not(.all4kids-quantity-ready) .quantity {
	width: 0 !important;
	min-width: 0 !important;
	max-width: 0 !important;
	flex-basis: 0 !important;
	margin-right: -10px !important;
	opacity: 0;
	visibility: hidden;
	transform: translateX(10px) scale(0.96);
	filter: blur(2px);
	pointer-events: none;
	overflow: hidden;
}

html.all4kids-quantity-reveal-enabled body.single-product .all4kids-purchase-controls .single_add_to_cart_button {
	transition:
		flex-basis 380ms cubic-bezier(0.16, 1, 0.3, 1),
		max-width 380ms cubic-bezier(0.16, 1, 0.3, 1),
		box-shadow 180ms ease,
		filter 180ms ease,
		transform 180ms ease !important;
}

html.all4kids-quantity-reveal-enabled body.single-product .all4kids-purchase-controls:not(.all4kids-quantity-ready) .single_add_to_cart_button {
	max-width: none;
}

/* Buy now is deliberately secondary to the normal cart flow. */
body.single-product .elementor-widget-wd_single_product_add_to_cart form.cart #wd-add-to-cart {
	border: 1px solid rgba(52, 82, 239, 0.24) !important;
	background: #eef3ff !important;
	box-shadow: 0 7px 16px rgba(36, 63, 137, 0.1) !important;
	color: #24458a !important;
	font-weight: 700 !important;
}

body.single-product .elementor-widget-wd_single_product_add_to_cart form.cart #wd-add-to-cart::before {
	background: url("icons/zap-blue.svg") center / 22px 22px no-repeat;
}

body.single-product .elementor-widget-wd_single_product_add_to_cart form.cart #wd-add-to-cart::after {
	background: url("icons/chevron-right-blue.svg") center / 16px 16px no-repeat;
}

body.single-product .elementor-widget-wd_single_product_add_to_cart form.cart #wd-add-to-cart:hover {
	border-color: rgba(52, 82, 239, 0.4) !important;
	background: #e2eaff !important;
	box-shadow: 0 9px 20px rgba(36, 63, 137, 0.15) !important;
	color: #1d3b7a !important;
}

@media (max-width: 767px) {
	body.single-product .elementor-widget-wd_single_product_add_to_cart .all4kids-purchase-controls {
		display: grid !important;
		grid-template-columns: 82px minmax(0, 1fr);
		align-items: stretch;
		column-gap: 10px;
		row-gap: 10px;
		width: 100%;
	}

	body.single-product .elementor-widget-wd_single_product_add_to_cart .all4kids-purchase-controls .quantity {
		grid-column: 1;
		grid-row: 1;
		width: 82px !important;
		margin: 0 !important;
	}

	body.single-product .elementor-widget-wd_single_product_add_to_cart form.cart.all4kids-purchase-controls .single_add_to_cart_button {
		grid-column: 2;
		grid-row: 1;
		width: 100%;
		max-width: none;
		margin: 0 !important;
	}

	body.single-product .elementor-widget-wd_single_product_add_to_cart .all4kids-purchase-controls #wd-add-to-cart {
		grid-column: 1 / -1;
		grid-row: 2;
		width: 100%;
		max-width: none;
		margin: 0 !important;
	}

	html.all4kids-quantity-reveal-enabled body.single-product .elementor-widget-wd_single_product_add_to_cart .all4kids-purchase-controls {
		transition:
			grid-template-columns 380ms cubic-bezier(0.16, 1, 0.3, 1),
			column-gap 380ms cubic-bezier(0.16, 1, 0.3, 1);
	}

	html.all4kids-quantity-reveal-enabled body.single-product .elementor-widget-wd_single_product_add_to_cart .all4kids-purchase-controls:not(.all4kids-quantity-ready) {
		grid-template-columns: 0 minmax(0, 1fr);
		column-gap: 0;
	}

	html.all4kids-quantity-reveal-enabled body.single-product .elementor-widget-wd_single_product_add_to_cart .all4kids-purchase-controls:not(.all4kids-quantity-ready) .quantity {
		margin: 0 !important;
	}

	html.all4kids-quantity-reveal-enabled body.single-product .wd-sticky-btn .all4kids-purchase-controls {
		transition:
			grid-template-columns 380ms cubic-bezier(0.16, 1, 0.3, 1),
			gap 380ms cubic-bezier(0.16, 1, 0.3, 1);
	}

	html.all4kids-quantity-reveal-enabled body.single-product .wd-sticky-btn .all4kids-purchase-controls:not(.all4kids-quantity-ready) {
		grid-template-columns: 0 minmax(0, 1fr);
		gap: 0;
	}

	html.all4kids-quantity-reveal-enabled body.single-product .wd-sticky-btn .all4kids-purchase-controls:not(.all4kids-quantity-ready) .quantity {
		width: 0 !important;
		margin-right: 0 !important;
	}
}

@media (max-width: 350px) {
	body.single-product .elementor-widget-wd_single_product_add_to_cart .all4kids-purchase-controls {
		grid-template-columns: 72px minmax(0, 1fr);
		column-gap: 6px;
	}

	body.single-product .elementor-widget-wd_single_product_add_to_cart .all4kids-purchase-controls .quantity {
		width: 72px !important;
	}

	body.single-product .elementor-widget-wd_single_product_add_to_cart form.cart.all4kids-purchase-controls .single_add_to_cart_button {
		padding-right: 24px !important;
		padding-left: 24px !important;
		font-size: 11.5px !important;
	}

	body.single-product .elementor-widget-wd_single_product_add_to_cart form.cart.all4kids-purchase-controls .single_add_to_cart_button::before,
	body.single-product .elementor-widget-wd_single_product_add_to_cart form.cart.all4kids-purchase-controls .single_add_to_cart_button::after {
		width: 22px;
	}

	body.single-product .elementor-widget-wd_single_product_add_to_cart form.cart.all4kids-purchase-controls .single_add_to_cart_button::before {
		left: 0 !important;
		background-size: 13px 13px;
	}

	body.single-product .elementor-widget-wd_single_product_add_to_cart form.cart.all4kids-purchase-controls .single_add_to_cart_button::after {
		right: 2px !important;
		background-size: 12px 12px;
	}
}

@media (prefers-reduced-motion: reduce) {
	body.woocommerce-cart .wc-proceed-to-checkout .checkout-button,
	body.woocommerce-checkout #place_order,
	body.single-product .elementor-widget-wd_single_product_add_to_cart form.cart .single_add_to_cart_button,
	body.single-product .elementor-widget-wd_single_product_add_to_cart form.cart #wd-add-to-cart,
	.shopping-cart-widget-footer .woocommerce-mini-cart__buttons .checkout,
	.product-grid-item .wd-add-btn .add_to_cart_button,
	.product-grid-item .wd-add-btn-replace .add-to-cart-loop {
		transition: none !important;
	}

	html.all4kids-quantity-reveal-enabled body.single-product .all4kids-purchase-controls,
	html.all4kids-quantity-reveal-enabled body.single-product .all4kids-purchase-controls .quantity,
	html.all4kids-quantity-reveal-enabled body.single-product .all4kids-purchase-controls .single_add_to_cart_button {
		transition: none !important;
	}
}
