/**
 * WpToolsBD Buy Now Button - frontend styles
 * All rules are scoped to .wpb-* so themes are never affected.
 */

.wpb-buy-now-wrap {
	display: flex;
	align-items: center;
	justify-content: var(--wpb-justify, flex-start);
	margin: 14px 0;
	width: 100%;
	max-width: 100%;
	box-sizing: border-box;
	clear: both;
}

.wpb-wrap-shortcode {
	margin: 0;
}

.wpb-buy-now-wrap form.wpb-buy-now-form {
	margin: 0;
	padding: 0;
	display: contents;
	border: 0;
	background: none;
	box-shadow: none;
}

.wpb-buy-now-wrap.wpb-display-block,
.wpb-buy-now-wrap:has(.wpb-display-block) {
	display: flex;
}

.wpb-buy-now-button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.55em;
	box-sizing: border-box;
	margin: 0;
	max-width: 100%;
	min-width: var(--wpb-min-width, 0);
	width: var(--wpb-width, auto);
	min-height: var(--wpb-height, 46px);
	padding: var(--wpb-pv, 12px) var(--wpb-ph, 24px);
	background-color: var(--wpb-bg, #111827);
	color: var(--wpb-color, #ffffff);
	border: var(--wpb-bw, 0px) solid var(--wpb-border, transparent);
	border-radius: var(--wpb-radius, 8px);
	font-family: inherit;
	font-size: var(--wpb-font-size, 15px);
	font-weight: var(--wpb-font-weight, 600);
	line-height: 1.2;
	letter-spacing: var(--wpb-ls, 0);
	text-transform: var(--wpb-transform, none);
	text-decoration: none;
	text-align: center;
	white-space: normal;
	cursor: pointer;
	position: relative;
	overflow: hidden;
	-webkit-appearance: none;
	appearance: none;
	transition:
		background-color var(--wpb-transition, 200ms) ease,
		color var(--wpb-transition, 200ms) ease,
		border-color var(--wpb-transition, 200ms) ease,
		box-shadow var(--wpb-transition, 200ms) ease,
		transform var(--wpb-transition, 200ms) ease;
}

.wpb-buy-now-button:hover,
.wpb-buy-now-button:focus-visible {
	background-color: var(--wpb-bg-hover, #2563eb);
	color: var(--wpb-color-hover, #ffffff);
	border-color: var(--wpb-bg-hover, #2563eb);
}

.wpb-buy-now-button:focus-visible {
	outline: 3px solid var(--wpb-focus, #2563eb);
	outline-offset: 3px;
}

.wpb-buy-now-button:disabled,
.wpb-buy-now-button.wpb-loading {
	cursor: progress;
	opacity: 0.85;
}

/* Alignment */
.wpb-buy-now-wrap.wpb-align-full .wpb-buy-now-button,
.wpb-buy-now-wrap .wpb-buy-now-button.wpb-align-full,
.wpb-buy-now-wrap .wpb-buy-now-button.wpb-display-block {
	width: 100%;
	flex: 1 1 100%;
}

.wpb-buy-now-wrap.wpb-align-full {
	justify-content: stretch;
}

/* Icon */
.wpb-buy-now-button .wpb-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex: 0 0 auto;
	line-height: 0;
}

.wpb-buy-now-button .wpb-icon svg {
	width: var(--wpb-icon-size, 16px);
	height: var(--wpb-icon-size, 16px);
	display: block;
}

.wpb-buy-now-button .wpb-btn-text {
	display: inline-block;
}

/* Shadows */
.wpb-shadow-sm { box-shadow: 0 1px 2px rgba(15, 23, 42, 0.12); }
.wpb-shadow-md { box-shadow: 0 4px 10px rgba(15, 23, 42, 0.14); }
.wpb-shadow-lg { box-shadow: 0 10px 24px rgba(15, 23, 42, 0.18); }
.wpb-shadow-xl { box-shadow: 0 18px 40px rgba(15, 23, 42, 0.24); }

/* Hover animations */
.wpb-anim-lift:hover { transform: translateY(-2px); }
.wpb-anim-scale:hover { transform: scale(1.025); }
.wpb-anim-glow:hover { box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.18), 0 10px 26px rgba(15, 23, 42, 0.22); }

.wpb-anim-shine::after {
	content: "";
	position: absolute;
	top: 0;
	left: -70%;
	width: 45%;
	height: 100%;
	background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.35), transparent);
	transform: skewX(-18deg);
	transition: left 0.55s ease;
	pointer-events: none;
}

.wpb-anim-shine:hover::after { left: 130%; }

/* Loading spinner */
.wpb-buy-now-button .wpb-spinner {
	display: none;
	width: 1em;
	height: 1em;
	border: 2px solid currentColor;
	border-right-color: transparent;
	border-radius: 50%;
	animation: wpb-spin 0.65s linear infinite;
	flex: 0 0 auto;
}

.wpb-buy-now-button.wpb-loading .wpb-spinner { display: inline-block; }

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

/* Inline messages */
.wpb-buy-now-wrap .wpb-message {
	flex-basis: 100%;
	margin-top: 8px;
	padding: 9px 12px;
	border-radius: 6px;
	font-size: 13px;
	line-height: 1.45;
	background: #fef2f2;
	color: #991b1b;
	border: 1px solid #fecaca;
}

.wpb-buy-now-wrap .wpb-message[hidden] { display: none; }

.wpb-buy-now-wrap .wpb-message.wpb-message-info {
	background: #eff6ff;
	color: #1e40af;
	border-color: #bfdbfe;
}

/* Shake on error */
.wpb-buy-now-wrap.wpb-has-error .wpb-buy-now-button {
	animation: wpb-shake 0.4s ease;
}

@keyframes wpb-shake {
	0%, 100% { transform: translateX(0); }
	20% { transform: translateX(-5px); }
	40% { transform: translateX(5px); }
	60% { transform: translateX(-3px); }
	80% { transform: translateX(3px); }
}

/* ------------------------------------------------------------------ */
/* Responsive                                                          */
/* ------------------------------------------------------------------ */

@media (max-width: 1024px) {
	.wpb-buy-now-button {
		width: var(--wpb-w-tablet, var(--wpb-width, auto));
		min-height: var(--wpb-h-tablet, var(--wpb-height, 46px));
		font-size: var(--wpb-f-tablet, var(--wpb-font-size, 15px));
	}

	.wpb-buy-now-wrap {
		justify-content: var(--wpb-justify-tablet, var(--wpb-justify, flex-start));
	}
}

@media (max-width: 782px) {
	.wpb-buy-now-button {
		width: var(--wpb-w-mobile, var(--wpb-width, auto));
		min-height: var(--wpb-h-mobile, var(--wpb-height, 46px));
		font-size: var(--wpb-f-mobile, var(--wpb-font-size, 15px));
	}

	.wpb-buy-now-wrap {
		justify-content: var(--wpb-justify-mobile, var(--wpb-justify, flex-start));
	}

	.wpb-mobile-full .wpb-buy-now-button,
	.wpb-buy-now-wrap.wpb-mobile-full .wpb-buy-now-button {
		width: 100%;
	}
}

/* Visibility */
@media (min-width: 1025px) {
	.wpb-hide-desktop { display: none !important; }
}

@media (min-width: 783px) and (max-width: 1024px) {
	.wpb-hide-tablet { display: none !important; }
}

@media (max-width: 782px) {
	.wpb-hide-mobile { display: none !important; }
}

/* Loop / archive polish: keep buttons from breaking grid cards */
.woocommerce ul.products li.product .wpb-buy-now-wrap,
.wc-block-grid__product .wpb-buy-now-wrap,
.wp-block-woocommerce-product-template .wpb-buy-now-wrap {
	margin: 10px 0 6px;
}

.woocommerce ul.products li.product .wpb-buy-now-button {
	min-height: var(--wpb-height, 42px);
}

/* Hide WooCommerce's own submit button when requested. The variations form
   itself stays visible so shoppers can pick attributes. */
.wpb-hide-add-to-cart .single_add_to_cart_button,
.wpb-hide-add-to-cart .variations_form .single_add_to_cart_button {
	display: none !important;
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
	.wpb-buy-now-button,
	.wpb-anim-shine::after {
		transition: none !important;
		animation: none !important;
	}

	.wpb-anim-lift:hover,
	.wpb-anim-scale:hover {
		transform: none;
	}
}