/**
 * SosWoo Buy Now Button — base structural styles.
 *
 * @package SosWoo\BNB
 */

/* -------------------------------------------------------------------------
 * Custom Style Mode — full structural styling
 *
 * These rules apply only when the plugin's style_mode = custom. In
 * default mode, the theme's own `.button` styling is used instead.
 * ---------------------------------------------------------------------- */

.soswoo-bnb-button {
	display: inline-block;
	box-sizing: border-box;
	text-align: center;
	text-decoration: none;
	cursor: pointer;
	line-height: 1.2;
	font-weight: 600;
	border-style: solid;
	border-width: 1px;
	border-radius: 4px;
	padding: 0.75em 1.5em;
	transition:
		background-color 0.2s ease,
		color 0.2s ease,
		border-color 0.2s ease,
		opacity 0.2s ease;
	-webkit-appearance: none;
	appearance: none;
	vertical-align: middle;
}

/* When in Default style mode, do NOT impose any structural padding /
 * sizing — the theme's .button class supplies it. This rule overrides
 * the padding declared above. */
.soswoo-bnb-button.soswoo-bnb-button--theme-style {
	padding: inherit;
	line-height: inherit;
	font-weight: inherit;
	font-size: inherit;
	border-radius: inherit;
}

.soswoo-bnb-button:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 2px;
}

.soswoo-bnb-button.soswoo-bnb-button--loading {
	opacity: 0.7;
	pointer-events: none;
}

.soswoo-bnb-button.soswoo-bnb-button--full-width {
	display: block;
	width: 100%;
}

/* -------------------------------------------------------------------------
 * Wrappers
 * ---------------------------------------------------------------------- */

.soswoo-bnb-archive-wrap {
	display: block;
	width: 100%;
	margin: 0.75em 0;
	clear: both;
}

.soswoo-bnb-single-wrap {
	display: inline-flex;
	align-items: center;
	vertical-align: middle;
	margin: 0 0 0 8px;
	line-height: 1;
}

.soswoo-bnb-single-wrap--before {
	display: block;
	margin: 0 0 10px 0;
}

.soswoo-bnb-shortcode-wrap {
	display: inline-block;
	vertical-align: middle;
	margin: 0.5em 0;
}

/* -------------------------------------------------------------------------
 * Variable product button — disabled until a variation is selected
 * ---------------------------------------------------------------------- */

.soswoo-bnb-button.soswoo-bnb-button--disabled,
.soswoo-bnb-button:disabled {
	opacity: 0.5;
	cursor: not-allowed;
	pointer-events: none;
	filter: grayscale(0.4);
}

.soswoo-bnb-button.soswoo-bnb-button--enabled {
	opacity: 1;
	cursor: pointer;
	pointer-events: auto;
	filter: none;
}

/* -------------------------------------------------------------------------
 * Mobile-friendly layout
 * ---------------------------------------------------------------------- */

@media (max-width: 480px) {
	ul.products .soswoo-bnb-archive-wrap .soswoo-bnb-button {
		width: 100%;
		display: block;
	}
}