/*
 * DSPRO Buy Now
 *
 * Everything is namespaced under .dspro-bn so nothing here can reach into the
 * agency theme. Sizing uses rem with explicit line-heights rather than inheriting
 * the theme's typography, which keeps the button identical on both language trees.
 */

.dspro-bn {
	--dspro-bn-accent: #0b74b1;
	--dspro-bn-accent-hover: color-mix(in srgb, var(--dspro-bn-accent) 82%, #000);
	--dspro-bn-fg: #fff;
	--dspro-bn-radius: 6px;
	--dspro-bn-shadow: 0 1px 2px rgba(0, 0, 0, .18), 0 6px 18px -8px rgba(0, 0, 0, .35);

	box-sizing: border-box;
	margin: 2rem 0;
	font-family: inherit;
}

.dspro-bn *,
.dspro-bn *::before,
.dspro-bn *::after {
	box-sizing: border-box;
}

/* color-mix has broad support, but the fallback keeps older browsers sane. */
@supports not (color: color-mix(in srgb, red 50%, blue)) {
	.dspro-bn {
		--dspro-bn-accent-hover: var(--dspro-bn-accent);
	}
}

.dspro-bn__button {
	display: inline-flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: .15rem;

	min-height: 3rem;
	padding: .75rem 2rem;

	background: var(--dspro-bn-accent);
	color: var(--dspro-bn-fg);
	border: 0;
	border-radius: var(--dspro-bn-radius);
	box-shadow: var(--dspro-bn-shadow);

	font-size: 1rem;
	font-weight: 600;
	line-height: 1.25;
	letter-spacing: .01em;
	text-align: center;
	text-decoration: none;

	cursor: pointer;
	transition: background-color .15s ease, transform .15s ease, box-shadow .15s ease;
}

.dspro-bn__button:hover,
.dspro-bn__button:focus-visible {
	background: var(--dspro-bn-accent-hover);
	color: var(--dspro-bn-fg);
	text-decoration: none;
	transform: translateY(-1px);
}

.dspro-bn__button:active {
	transform: translateY(0);
	box-shadow: 0 1px 2px rgba(0, 0, 0, .2);
}

/* Never rely on the theme's focus ring; it may be suppressed. */
.dspro-bn__button:focus-visible {
	outline: 3px solid var(--dspro-bn-accent);
	outline-offset: 3px;
}

.dspro-bn__label {
	display: block;
}

.dspro-bn__note {
	display: block;
	font-size: .8125rem;
	font-weight: 400;
	line-height: 1.3;
	opacity: .85;
}

/* Full-width variant for narrow theme columns: [dspro_buy_now style="block"] */
.dspro-bn--block .dspro-bn__button {
	display: flex;
	width: 100%;
}

/*
 * Sticky bar. This is the placement that guarantees the CTA appears on every
 * Etherface screen, because it does not depend on the_content being filtered.
 */
.dspro-bn-sticky {
	position: fixed;
	z-index: 9990;
	right: 0;
	bottom: 0;
	left: 0;

	display: flex;
	justify-content: center;

	padding: .625rem 1rem;
	padding-bottom: calc(.625rem + env(safe-area-inset-bottom, 0px));

	background: rgba(255, 255, 255, .92);
	border-top: 1px solid rgba(0, 0, 0, .1);
	backdrop-filter: blur(8px);
}

.dspro-bn-sticky .dspro-bn {
	margin: 0;
	width: 100%;
	max-width: 26rem;
}

.dspro-bn-sticky .dspro-bn__button {
	display: flex;
	width: 100%;
	box-shadow: none;
}

.dspro-bn-sticky .dspro-bn__button:hover,
.dspro-bn-sticky .dspro-bn__button:focus-visible {
	transform: none;
}

/* Reserve room so the bar never sits on top of the footer's last line. */
.dspro-bn-has-sticky {
	padding-bottom: 4.5rem;
}

@media (min-width: 783px) {
	.dspro-bn-sticky--mobile-only {
		display: none;
	}

	.dspro-bn-has-sticky--mobile-only {
		padding-bottom: 0;
	}
}

@media (prefers-color-scheme: dark) {
	.dspro-bn-sticky {
		background: rgba(20, 20, 22, .92);
		border-top-color: rgba(255, 255, 255, .14);
	}
}

@media (prefers-reduced-motion: reduce) {
	.dspro-bn__button {
		transition: none;
	}

	.dspro-bn__button:hover,
	.dspro-bn__button:focus-visible,
	.dspro-bn__button:active {
		transform: none;
	}
}

@media print {
	.dspro-bn-sticky {
		display: none;
	}
}
