/**
 * MkWebTech CTA Studio - public styles.
 *
 * @package MkWebTech_CTA_Studio
 */

/* =========================================================================
   Body scroll lock
   ====================================================================== */

body.mkwebtech-cta-popup-open {
	overflow: hidden;
}

/* Fade fixed-position CTA variants while popup is open. */
body.mkwebtech-cta-popup-open .mkwebtech-cta--sticky {
	opacity: 0;
	transform: translateY( 12px );
	pointer-events: none;
}

/* =========================================================================
   Shared wrapper
   ====================================================================== */

.mkwebtech-cta-wrap {
	box-sizing: border-box;
	font-family: inherit;
	line-height: 1.6;
	font-size: 1rem;
	--mkwebtech-cta-content-gap: 10px;
}

@media ( min-width: 1025px ) {
	.mkwebtech-cta-hide-desktop {
		display: none !important;
	}
}

@media ( min-width: 768px ) and ( max-width: 1024px ) {
	.mkwebtech-cta-hide-tablet {
		display: none !important;
	}
}

@media ( max-width: 767px ) {
	.mkwebtech-cta-hide-mobile {
		display: none !important;
	}
}

.mkwebtech-cta-wrap *,
.mkwebtech-cta-wrap *::before,
.mkwebtech-cta-wrap *::after {
	box-sizing: inherit;
}

.mkwebtech-cta__content {
	min-width: 0;
}

.mkwebtech-cta__heading {
	margin: 0;
	line-height: 1.3;
}

.mkwebtech-cta__heading > * {
	margin: 0;
}

.mkwebtech-cta__heading > * + * {
	margin-top: .35em;
}

.mkwebtech-cta-timer {
	margin: 0;
	font-size: .875rem;
	font-weight: 600;
	line-height: 1.2;
	font-variant-numeric: tabular-nums;
	font-feature-settings: "tnum" 1, "lnum" 1;
	display: inline-flex;
	align-items: flex-start;
	gap: var(--mkwebtech-timer-digit-gap, 0px);
	padding: .2em .35em;
	border-radius: .65em;
	background: rgba( 255, 255, 255, .1 );
	box-shadow:
		inset 0 1px 0 rgba( 255, 255, 255, .16 ),
		0 10px 24px rgba( 0, 0, 0, .12 );
	contain: layout paint;
	-webkit-font-smoothing: antialiased;
	text-rendering: geometricPrecision;
}

.mkwebtech-cta-timer .mkwebtech-cta-timer-group {
	display: inline-flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	min-width: 2ch;
	transform: translateZ(0);
	will-change: transform, opacity;
}

.mkwebtech-cta-timer .mkwebtech-cta-timer-group.is-label-top {
	flex-direction: column-reverse;
}

.mkwebtech-cta-timer .mkwebtech-cta-timer-label {
	font-size: .75em;
	font-weight: 500;
	line-height: 1.1;
	margin-top: .2em;
	opacity: .82;
	white-space: nowrap;
}

.mkwebtech-cta-timer .mkwebtech-cta-timer-label.is-hidden {
	display: none;
}

.mkwebtech-cta-timer .mkwebtech-cta-timer-group.is-label-top .mkwebtech-cta-timer-label {
	margin-top: 0;
	margin-bottom: .2em;
}

.mkwebtech-cta-timer .mkwebtech-cta-timer-sep {
	display: var(--mkwebtech-timer-sep-display, inline-block);
	margin: 0;
	align-self: flex-start;
	line-height: .95;
	font-weight: 600;
	opacity: .72;
	transform: translateY(0);
	font-variant-numeric: tabular-nums;
	font-feature-settings: "tnum" 1, "lnum" 1;
	height: .95em;
}

.mkwebtech-cta-timer.is-label-top .mkwebtech-cta-timer-sep {
	margin-top: var(--mkwebtech-timer-label-offset, 1em);
}

.mkwebtech-cta-timer.is-label-hidden .mkwebtech-cta-timer-sep,
.mkwebtech-cta-timer.is-label-top.is-label-hidden .mkwebtech-cta-timer-sep {
	margin-top: 0;
}

.mkwebtech-cta-timer .mkwebtech-cta-timer-part {
	display: inline-flex;
	justify-content: center;
	min-width: 2ch;
	line-height: .95;
	font-weight: 600;
	font-variant-numeric: tabular-nums;
	font-feature-settings: "tnum" 1, "lnum" 1;
	letter-spacing: 0;
	white-space: nowrap;
}

.mkwebtech-cta-timer .mkwebtech-cta-timer-digit {
	display: inline-block;
	min-width: .62em;
	font-weight: 600;
	text-align: center;
	transform: translateZ(0);
	will-change: transform, opacity;
}

.mkwebtech-cta-timer .mkwebtech-cta-timer-digit.is-changing {
	animation: mkwebtech-cta-digit-change .22s cubic-bezier( .2, .8, .2, 1 );
}

.mkwebtech-cta-timer .mkwebtech-cta-timer-group.is-changing {
	animation: mkwebtech-cta-unit-change .22s cubic-bezier( .2, .8, .2, 1 );
}

@keyframes mkwebtech-cta-digit-change {
	0% {
		opacity: .25;
		transform: translate3d( 0, -.22em, 0 ) scale( .98 );
	}
	100% {
		opacity: 1;
		transform: translate3d( 0, 0, 0 ) scale( 1 );
	}
}

@keyframes mkwebtech-cta-unit-change {
	0% {
		transform: translate3d( 0, -.06em, 0 );
	}
	100% {
		transform: translate3d( 0, 0, 0 );
	}
}

@media ( prefers-reduced-motion: reduce ) {
	.mkwebtech-cta-timer .mkwebtech-cta-timer-digit.is-changing,
	.mkwebtech-cta-timer .mkwebtech-cta-timer-group.is-changing {
		animation: none;
	}
}

@media ( max-width: 600px ) {
	.mkwebtech-cta-timer {
		gap: calc( var(--mkwebtech-timer-digit-gap, 0px) * .7 );
		padding: .15em .25em;
	}

	.mkwebtech-cta-timer .mkwebtech-cta-timer-label {
		font-size: .65em;
	}
}

/* =========================================================================
   Button
   ====================================================================== */

.mkwebtech-cta__btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 5px;
	padding: 10px 20px;
	border-radius: 40px;
	color: #fff;
	text-decoration: none;
	font-weight: 700;
	font-size: .9375rem;
	white-space: nowrap;
	flex-shrink: 0;
	border: none;
	cursor: pointer;
	transition:
		transform  .18s ease,
		box-shadow .18s ease,
		filter     .18s ease;
	box-shadow: 0 2px 8px rgba( 0, 0, 0, .18 );
}

.mkwebtech-cta__btn-icon {
	display: inline-block;
	width: 1em;
	height: 1em;
	line-height: 1;
}

.mkwebtech-cta__btn:hover,
.mkwebtech-cta__btn:focus-visible {
	color: #fff;
	text-decoration: none;
	transform: translateY( -2px );
	filter: brightness( 1.08 );
	box-shadow: 0 8px 22px rgba( 0, 0, 0, .3 );
}

.mkwebtech-cta__btn:active {
	transform: translateY( 0 );
	filter: brightness( .96 );
	box-shadow: 0 1px 4px rgba( 0, 0, 0, .18 );
}

/* =========================================================================
   Inline CTA
   ====================================================================== */

.mkwebtech-cta--inline {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: var( --mkwebtech-cta-content-gap );
	padding: 1.375rem 1.75rem;
	margin: 2rem 0;
	border-radius: 12px;
	box-shadow: 0 2px 12px rgba( 0, 0, 0, .08 );
}

/* =========================================================================
   Sticky Bar CTA
   ====================================================================== */

.mkwebtech-cta--sticky {
	position: fixed;
	bottom: 0;
	left: 0;
	right: 0;
	display: none;
	flex-wrap: wrap;
	align-items: center;
	justify-content: center;
	gap: var( --mkwebtech-cta-content-gap );
	padding: 1rem 2rem;
	z-index: 9999;
	box-shadow: 0 -3px 20px rgba( 0, 0, 0, .12 );
}

.mkwebtech-cta--sticky.mkwebtech-cta--is-visible {
	display: flex;
}

/* =========================================================================
   Popup CTA
   ====================================================================== */

.mkwebtech-cta-overlay {
	position: fixed;
	inset: 0;
	background: rgba( 0, 0, 0, .45 );
	backdrop-filter: blur( 2px );
	-webkit-backdrop-filter: blur( 2px );
	z-index: 99998;
	display: none;
}

.mkwebtech-cta-overlay.mkwebtech-cta--is-visible {
	display: block;
}

.mkwebtech-cta--popup {
	position: fixed;
	top: 50%;
	left: 50%;
	transform: translate( -50%, -50% );
	padding: 2rem 2.25rem;
	border-radius: 1rem;
	z-index: 99999;
	box-shadow:
		0 1px 2px rgba( 0, 0, 0, .05 ),
		0 8px 24px rgba( 0, 0, 0, .12 );
	display: none;
}

.mkwebtech-cta--popup.mkwebtech-cta--is-visible {
	display: flex;
}

/* =========================================================================
   Floating Buttons CTA
   ====================================================================== */

.mkwebtech-cta--floating {
	position: fixed;
	z-index: 9999;
	display: flex;
	flex-direction: column;
	gap: var( --mkwebtech-cta-floating-gap, 12px );
	align-items: flex-end;
	pointer-events: none;
}

.mkwebtech-cta--floating .mkwebtech-cta-floating__btn {
	pointer-events: auto;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0;
	width: auto;
	min-width: 0;
	min-height: 0;
	padding: 0 !important;
	border-radius: 0;
	background: transparent !important;
	box-shadow: none !important;
	color: inherit;
	text-decoration: none;
	line-height: 1;
	filter: none !important;
	overflow: visible;
	transition:
		transform .18s ease;
}

.mkwebtech-cta--floating .mkwebtech-cta-floating__btn:hover,
.mkwebtech-cta--floating .mkwebtech-cta-floating__btn:focus {
	transform: translateY( -2px );
	box-shadow: none !important;
	filter: none !important;
	text-decoration: none;
}

.mkwebtech-cta-floating__icon {
	position: relative;
	z-index: 2;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: calc( var( --mkwebtech-cta-floating-icon-size, 24px ) + 24px );
	height: calc( var( --mkwebtech-cta-floating-icon-size, 24px ) + 24px );
	border-radius: var( --mkwebtech-cta-floating-icon-radius, 999px );
	background: var( --mkwebtech-cta-floating-icon-bg );
	color: var( --mkwebtech-cta-floating-icon-color );
	box-shadow: 0 12px 30px rgba( 0, 0, 0, .22 );
	font-size: var( --mkwebtech-cta-floating-icon-size, 24px );
	line-height: 1;
	transition:
		background .18s ease,
		color .18s ease,
		box-shadow .18s ease;
}

.mkwebtech-cta-floating__btn:hover .mkwebtech-cta-floating__icon,
.mkwebtech-cta-floating__btn:focus .mkwebtech-cta-floating__icon {
	background: var( --mkwebtech-cta-floating-icon-bg-hover );
	color: var( --mkwebtech-cta-floating-icon-color-hover );
	box-shadow: 0 16px 34px rgba( 0, 0, 0, .28 );
}

.mkwebtech-cta-floating__text {
	max-width: 0;
	overflow: hidden;
	white-space: nowrap;
	opacity: 0;
	margin-right: -8px;
	padding: 12px 0;
	border-radius: 999px 0 0 999px;
	background: var( --mkwebtech-cta-floating-text-bg );
	color: var( --mkwebtech-cta-floating-text-color );
	transition:
		max-width .22s ease,
		opacity .18s ease,
		padding .22s ease,
		background .18s ease,
		color .18s ease;
}

.mkwebtech-cta-floating__btn.has-hover-text:hover .mkwebtech-cta-floating__text,
.mkwebtech-cta-floating__btn.has-hover-text:focus .mkwebtech-cta-floating__text {
	max-width: 220px;
	opacity: 1;
	padding-left: 16px;
	padding-right: 20px;
	background: var( --mkwebtech-cta-floating-text-bg-hover );
	color: var( --mkwebtech-cta-floating-text-color-hover );
}

.mkwebtech-cta-floating--bottom-left .mkwebtech-cta-floating__btn,
.mkwebtech-cta-floating--top-left .mkwebtech-cta-floating__btn,
.mkwebtech-cta-floating--middle-left .mkwebtech-cta-floating__btn {
	flex-direction: row-reverse;
}

.mkwebtech-cta-floating--bottom-left .mkwebtech-cta-floating__text,
.mkwebtech-cta-floating--top-left .mkwebtech-cta-floating__text,
.mkwebtech-cta-floating--middle-left .mkwebtech-cta-floating__text {
	margin-right: 0;
	margin-left: -8px;
	border-radius: 0 999px 999px 0;
}

.mkwebtech-cta-floating--bottom-right {
	right: 24px;
	bottom: 24px;
}

.mkwebtech-cta-floating--bottom-left {
	left: 24px;
	bottom: 24px;
	align-items: flex-start;
}

.mkwebtech-cta-floating--top-right {
	right: 24px;
	top: 24px;
}

.mkwebtech-cta-floating--top-left {
	left: 24px;
	top: 24px;
	align-items: flex-start;
}

.mkwebtech-cta-floating--middle-right {
	right: 24px;
	top: 50%;
	transform: translateY( -50% );
}

.mkwebtech-cta-floating--middle-left {
	left: 24px;
	top: 50%;
	transform: translateY( -50% );
	align-items: flex-start;
}

.mkwebtech-cta-wrap button.mkwebtech-cta__close,
.mkwebtech-cta-wrap [type="button"].mkwebtech-cta__close {
	position: absolute;
	top: 3px;
	right: 3px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 24px;
	height: 24px;
	min-width: 24px;
	min-height: 24px;
	appearance: none;
	-webkit-appearance: none;
	background: rgba( 0, 0, 0, .2 ) !important;
	border: 0 !important;
	border-radius: 50%;
	box-shadow: none !important;
	text-shadow: none;
	outline: 0;
	cursor: pointer;
	pointer-events: auto;
	padding: 0;
	line-height: 1;
	font-size: 16px;
	color: inherit;
	opacity: 1;
	z-index: 2;
	transition:
		background .15s ease;
}

.mkwebtech-cta__close .dashicons {
	font-size: 16px;
	width: 16px;
	height: 16px;
	line-height: 16px;
}

.mkwebtech-cta__close:hover {
	background: rgba( 0, 0, 0, .2 ) !important;
}

/* =========================================================================
   Responsive
   ====================================================================== */

@media ( max-width: 600px ) {
	.mkwebtech-cta--inline,
	.mkwebtech-cta--sticky {
		flex-direction: column;
		text-align: center;
		gap: var( --mkwebtech-cta-content-gap );
	}

	.mkwebtech-cta--popup {
		padding: 2.25rem 1.75rem;
	}

	.mkwebtech-cta__btn {
		width: 100%;
	}

	.mkwebtech-cta--floating .mkwebtech-cta-floating__btn {
		width: auto;
	}

	.mkwebtech-cta-floating--bottom-right,
	.mkwebtech-cta-floating--top-right,
	.mkwebtech-cta-floating--middle-right {
		right: 16px;
	}

	.mkwebtech-cta-floating--bottom-left,
	.mkwebtech-cta-floating--top-left,
	.mkwebtech-cta-floating--middle-left {
		left: 16px;
	}
}
