/**
 * FM Buy Now Button - Frontend Styles.
 *
 * The button inherits theme styles via .button.alt classes.
 * JS syncs computed styles from the Add to Cart button for consistency.
 * Dynamic overrides are set via inline <style> from PHP when configured.
 * This file provides state styles and layout adjustments only.
 */

/* Base: inherit theme button styles via .button.alt, add minimal overrides */
.fm-buynow-btn {
	cursor: pointer;
	text-decoration: none;
	text-align: center;
	box-sizing: border-box;
	vertical-align: middle;
	transition: background-color 0.2s ease;
}

/* Focus state for accessibility */
.fm-buynow-btn:focus-visible {
	outline: 2px solid #005fcc;
	outline-offset: 2px;
}

/* Disabled state */
.fm-buynow-btn.fm-buynow-disabled,
.fm-buynow-btn:disabled {
	opacity: 0.5;
	cursor: not-allowed;
}

/* Loading state */
.fm-buynow-btn.fm-buynow-loading {
	opacity: 0.7;
	cursor: wait;
	position: relative;
}

/* Single product page: hidden until JS syncs styles from ATC button */
.fm-buynow-single {
	margin-left: 10px;
	opacity: 0;
	visibility: hidden;
	transition: none !important; /* Block theme's transition:all during style sync */
}

/* Show after JS style sync or when dynamic overrides are present */
#fm-buynow-dynamic-styles ~ * .fm-buynow-single,
.fm-buynow-single.fm-buynow-styled {
	opacity: 1;
	visibility: visible;
	transition: all 0.2s ease !important; /* Match theme button transition */
}

/* When button is after the form (outside), stack below */
.woocommerce div.product form.cart + .fm-buynow-single {
	display: block;
	margin-left: 0;
	margin-top: 10px;
	float: none;
}

/* Archive/shop page button */
.fm-buynow-archive {
	margin-top: 5px;
	display: block;
	text-align: center;
}

/* Link-style buttons (for variable/grouped on archive) */
a.fm-buynow-btn {
	display: inline-block;
}

a.fm-buynow-archive {
	display: block;
}

/* Notice styles */
.fm-buynow-notice {
	margin: 10px 0;
	padding: 10px 15px;
}

/* Responsive: keep buttons inline on mobile, reduce gap slightly */
@media (max-width: 768px) {
	.fm-buynow-single {
		margin-left: 10px !important;
	}
}
