/**
 * AMC Product Buttons — Frontend & Editor Styles
 */

/* ── Container ── */
.amc-product-buttons {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	align-items: center;
}

/* ── Base button ── */
.amc-pb-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 10px 20px;
	border: 2px solid #2FB3C9;
	border-radius: 30px;
	font-size: 14px;
	font-weight: 600;
	line-height: 1.4;
	text-decoration: none;
	text-align: center;
	cursor: pointer;
	transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease, transform 0.1s ease;
	box-sizing: border-box;
	white-space: nowrap;
}

.amc-pb-btn:active {
	transform: scale(0.97);
}

/* ── Add to Cart — outlined / transparent ── */
.amc-pb-btn--add-to-cart,
.amc-pb-btn--add-to-cart:focus,
.amc-pb-btn--add-to-cart:active,
.amc-pb-btn--add-to-cart:focus-visible {
	flex: 1 1 auto;
	min-width: 0;
	background: transparent;
	color: #2FB3C9;
	border-color: #2FB3C9;
	outline: none;
}

.amc-pb-btn--add-to-cart:hover {
	background: rgba(47, 179, 201, 0.08);
	color: #269AAD;
	border-color: #269AAD;
}

/* Loading — keep same look, just prevent double-clicks */
.amc-pb-btn--add-to-cart.amc-pb-btn--loading,
.amc-pb-btn--add-to-cart.amc-pb-btn--loading:focus,
.amc-pb-btn--add-to-cart.amc-pb-btn--loading:active {
	background: transparent;
	color: #2FB3C9;
	border-color: #2FB3C9;
	pointer-events: none;
}

/* Added — keep outlined teal style, just swap the text to checkmark */
.amc-pb-btn--add-to-cart.amc-pb-btn--added,
.amc-pb-btn--add-to-cart.amc-pb-btn--added:focus,
.amc-pb-btn--add-to-cart.amc-pb-btn--added:active {
	background: transparent;
	color: #2FB3C9;
	border-color: #2FB3C9;
}

/* ── Buy Now — solid teal #2FB3C9, hover #279AAE (matches small/agree-link variant) ── */
.amc-pb-btn--buy-now,
.amc-pb-btn--buy-now:focus,
.amc-pb-btn--buy-now:active,
.amc-pb-btn--buy-now:focus-visible {
	flex: 1 1 auto;
	min-width: 0;
	background: #2FB3C9;
	color: #fff;
	border-color: transparent;
	outline: none;
}

.amc-pb-btn--buy-now:hover {
	background: #279AAE;
	color: #fff;
	border-color: transparent;
}

/* Loading — keep same look, just prevent double-clicks */
.amc-pb-btn--buy-now.amc-pb-btn--loading,
.amc-pb-btn--buy-now.amc-pb-btn--loading:focus,
.amc-pb-btn--buy-now.amc-pb-btn--loading:active {
	background: #2FB3C9;
	color: #fff;
	border-color: transparent;
	pointer-events: none;
}

/* ── Select Options (variable products) — outlined style to match Add to Cart, full width ── */
.amc-pb-btn--select-options,
a.amc-pb-btn--select-options,
a.amc-pb-btn--select-options:visited {
	display: flex !important;
	width: 100% !important;
	flex: 1 1 100% !important;
	background: transparent;
	color: #2FB3C9 !important;
	border-color: #2FB3C9;
}

.amc-pb-btn--select-options:hover,
a.amc-pb-btn--select-options:hover {
	background: rgba(47, 179, 201, 0.08);
	color: #269AAD !important;
	border-color: #269AAD;
}

.amc-pb-btn--select-options:focus,
.amc-pb-btn--select-options:active,
a.amc-pb-btn--select-options:focus,
a.amc-pb-btn--select-options:active {
	background: transparent;
	color: #2FB3C9 !important;
	border-color: #2FB3C9;
	outline: none;
}

/* ── Single-button containers — full-width container + button ── */
.amc-product-buttons--single {
	margin-top: 0 !important;
	width: 100%;
}
.amc-product-buttons--single .amc-pb-btn {
	display: flex !important;
	width: 100% !important;
	flex: 1 1 100% !important;
}

/* ── Disabled states — full width ── */
.amc-pb-btn--disabled {
	width: 100%;
	cursor: not-allowed;
	pointer-events: none;
}

.amc-pb-btn--out-of-stock {
	background: rgba(220, 53, 69, 0.08);
	color: #a94442;
	border-color: rgba(220, 53, 69, 0.2);
}

.amc-pb-btn--coming-soon {
	background: #fff3cd;
	color: #856404;
	border-color: #fff3cd;
}

/* ── Hide WooCommerce "View Cart" link injected after add-to-cart ── */
.amc-product-buttons .added_to_cart {
	display: none !important;
}

/* ── Inline spinner (for Buy Now loading) ── */
.amc-pb-btn__spinner {
	display: inline-block;
	width: 16px;
	height: 16px;
	border: 2px solid rgba(255, 255, 255, 0.3);
	border-top-color: #fff;
	border-radius: 50%;
	animation: amc-spin 0.6s linear infinite;
	margin-right: 6px;
	vertical-align: middle;
}

/* Spinner color variant for outlined buttons */
.amc-pb-btn--add-to-cart .amc-pb-btn__spinner,
.amc-pb-btn--select-options .amc-pb-btn__spinner {
	border-color: rgba(47, 179, 201, 0.3);
	border-top-color: #2FB3C9;
}

@keyframes amc-spin {
	to { transform: rotate(360deg); }
}

/* ── Added checkmark ── */
.amc-pb-btn__added {
	font-size: 14px;
}

/* ── Editor preview ── */
.amc-product-buttons--editor .amc-pb-btn {
	pointer-events: none;
}
.amc-product-buttons--editor {
	gap: 8px;
}

/* ── Responsive: when container is too narrow, buttons stack full-width ── */
@media ( max-width: 480px ) {
	.amc-pb-btn--add-to-cart,
	.amc-pb-btn--buy-now {
		flex: 1 1 100%;
	}
}


/* Agree-required product link — styled like Buy Now, full width */
.amc-pb-btn--agree-link,
a.amc-pb-btn--agree-link,
a.amc-pb-btn--agree-link:visited {
	display: flex !important;
	width: 100% !important;
	flex: 1 1 100% !important;
	background: #2FB3C9 !important;
	color: #fff !important;
	border-color: transparent !important;
	text-align: center;
}
.amc-pb-btn--agree-link:hover,
a.amc-pb-btn--agree-link:hover {
	background: #279AAE !important;
	color: #fff !important;
}
