/* =========================================================
   AB Checkout Steps - Styles
   ========================================================= */

:root {
	--abchk-accent: #7f54b3;
}

/* --- Progress bar: shared base (used by the "Circles" style) --- */
.abchk-progress-bar {
	display: flex;
	align-items: center;
	justify-content: center;
	max-width: 640px;
	margin: 0 auto 32px;
	padding: 0 10px;
}

.abchk-progress-step {
	display: flex;
	flex-direction: column;
	align-items: center;
	flex: 0 0 auto;
	color: #9a9a9a;
	cursor: default;
}

.abchk-progress-step-completed {
	cursor: pointer;
}

.abchk-progress-circle {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 34px;
	height: 34px;
	border-radius: 50%;
	border: 2px solid #d9d9d9;
	background: #fff;
	color: #9a9a9a;
	font-weight: 600;
	font-size: 14px;
	transition: all 0.25s ease;
}

.abchk-progress-label {
	margin-top: 6px;
	font-size: 12px;
	white-space: nowrap;
}

.abchk-progress-line {
	flex: 1 1 auto;
	height: 2px;
	background: #d9d9d9;
	margin: 0 8px;
	margin-bottom: 22px;
	transition: background 0.25s ease;
}

.abchk-progress-step-active .abchk-progress-circle {
	border-color: var(--abchk-accent);
	color: var(--abchk-accent);
}

.abchk-progress-step-active .abchk-progress-label {
	color: #333;
	font-weight: 600;
}

.abchk-progress-step-completed .abchk-progress-circle {
	border-color: var(--abchk-accent);
	background: var(--abchk-accent);
	color: #fff;
}

.abchk-progress-line-completed {
	background: var(--abchk-accent);
}

/* --- Progress bar style: Chevron (connected arrow ribbon) --- */
body.abchk-style-chevron .abchk-progress-bar {
	max-width: 720px;
	padding: 0;
}

body.abchk-style-chevron .abchk-progress-bar > div:nth-child(even) {
	/* Hide the connector line divs; chevrons connect via overlap instead. */
	display: none;
}

body.abchk-style-chevron .abchk-progress-step {
	position: relative;
	flex-direction: row;
	flex: 1 1 0;
	min-height: 52px;
	padding: 14px 28px;
	background: #ded6cc;
	color: #3a3a3a;
	justify-content: center;
	clip-path: polygon( 0 0, calc( 100% - 22px ) 0, 100% 50%, calc( 100% - 22px ) 100%, 0 100%, 22px 50% );
}

body.abchk-style-chevron .abchk-progress-bar > div:nth-child(odd):first-child {
	clip-path: polygon( 0 0, calc( 100% - 22px ) 0, 100% 50%, calc( 100% - 22px ) 100%, 0 100% );
}

body.abchk-style-chevron .abchk-progress-bar > div:nth-child(odd):not(:first-child) {
	margin-left: -22px;
}

body.abchk-style-chevron .abchk-progress-circle {
	display: none;
}

body.abchk-style-chevron .abchk-progress-label {
	margin-top: 0;
	font-size: 14px;
	font-weight: 700;
}

body.abchk-style-chevron .abchk-progress-step-active,
body.abchk-style-chevron .abchk-progress-step-completed {
	background: var(--abchk-accent);
}

body.abchk-style-chevron .abchk-progress-step-active .abchk-progress-label,
body.abchk-style-chevron .abchk-progress-step-completed .abchk-progress-label {
	color: #fff;
}

/* --- Progress bar style: Minimal (plain text labels, no circles) --- */
body.abchk-style-minimal .abchk-progress-bar {
	max-width: 560px;
}

body.abchk-style-minimal .abchk-progress-circle {
	display: none;
}

body.abchk-style-minimal .abchk-progress-step {
	color: #b3b3b3;
}

body.abchk-style-minimal .abchk-progress-label {
	margin-top: 0;
	font-size: 14px;
	font-weight: 600;
	padding-bottom: 6px;
	border-bottom: 2px solid transparent;
}

body.abchk-style-minimal .abchk-progress-line {
	margin-bottom: 0;
	background: #e5e5e5;
}

body.abchk-style-minimal .abchk-progress-step-active .abchk-progress-label {
	color: var(--abchk-accent);
	border-bottom-color: var(--abchk-accent);
}

body.abchk-style-minimal .abchk-progress-step-completed .abchk-progress-label {
	color: #3a3a3a;
	border-bottom-color: var(--abchk-accent);
}

body.abchk-style-minimal .abchk-progress-line-completed {
	background: var(--abchk-accent);
}

/* --- Progress bar style: Progress Bar (thick track, small dot markers) --- */
body.abchk-style-bar .abchk-progress-line {
	height: 6px;
	border-radius: 3px;
}

body.abchk-style-bar .abchk-progress-circle {
	width: 14px;
	height: 14px;
	font-size: 0;
	border-width: 3px;
}

body.abchk-style-bar .abchk-progress-label {
	margin-top: 10px;
}

body.abchk-style-bar .abchk-progress-step-active .abchk-progress-circle,
body.abchk-style-bar .abchk-progress-step-completed .abchk-progress-circle {
	background: var(--abchk-accent);
	border-color: var(--abchk-accent);
}

/* --- Progress bar style: Dots (compact, no numbers) --- */
body.abchk-style-dots .abchk-progress-bar {
	max-width: 480px;
}

body.abchk-style-dots .abchk-progress-circle {
	width: 12px;
	height: 12px;
	font-size: 0;
	border-width: 2px;
}

body.abchk-style-dots .abchk-progress-line {
	height: 2px;
	margin-bottom: 16px;
}

body.abchk-style-dots .abchk-progress-label {
	font-size: 11px;
	margin-top: 8px;
}

body.abchk-style-dots .abchk-progress-step-active .abchk-progress-circle,
body.abchk-style-dots .abchk-progress-step-completed .abchk-progress-circle {
	background: var(--abchk-accent);
	border-color: var(--abchk-accent);
}

/* --- Progress bar style: Boxes (solid numbered square blocks) --- */
body.abchk-style-boxes .abchk-progress-bar {
	max-width: 640px;
}

body.abchk-style-boxes .abchk-progress-circle {
	width: 40px;
	height: 40px;
	border-radius: 8px;
	font-size: 15px;
	border-width: 2px;
}

body.abchk-style-boxes .abchk-progress-label {
	font-weight: 600;
}

body.abchk-style-boxes .abchk-progress-step-active .abchk-progress-circle,
body.abchk-style-boxes .abchk-progress-step-completed .abchk-progress-circle {
	background: var(--abchk-accent);
	border-color: var(--abchk-accent);
	color: #fff;
}

/* --- Step content wrapper --- */
.abchk-step {
	display: none;
	animation: abchk-fade-in 0.25s ease;
}

.abchk-step.abchk-step-visible {
	display: block;
}

@keyframes abchk-fade-in {
	from {
		opacity: 0;
		transform: translateY(6px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

/* While a step is active, keep WooCommerce's default col2-set layout but
   make it a single full-width column, since only one side (billing or
   shipping) is shown at a time. */
body.abchk-multistep-active #customer_details.col2-set .col-1,
body.abchk-multistep-active #customer_details.col2-set .col-2 {
	float: none;
	width: 100%;
}

/* --- Center the checkout form and stop it from being squeezed into half
   the page. Some themes lay out the checkout form and order summary as
   2 side-by-side columns (grid/flex). Since multi-step mode only shows one
   section at a time, force it into a single centered column. --- */
body.abchk-multistep-active form.checkout,
body.abchk-multistep-active form.woocommerce-checkout {
	display: block !important;
	max-width: 720px;
	width: 100%;
	margin-left: auto !important;
	margin-right: auto !important;
	float: none !important;
}

body.abchk-multistep-active #customer_details,
body.abchk-multistep-active #order_review_heading,
body.abchk-multistep-active #order_review,
body.abchk-multistep-active [id^="abchk-step"] {
	width: 100% !important;
	max-width: 100% !important;
	float: none !important;
	margin-left: 0 !important;
	margin-right: 0 !important;
}

/* --- Navigation (Next / Back buttons) --- */
.abchk-step-nav {
	display: flex;
	justify-content: flex-end;
	gap: 12px;
	margin-top: 20px;
	margin-bottom: 30px;
}

.abchk-step-nav .abchk-btn-back {
	margin-right: auto;
}

/* Override the theme's button size (some themes make .button large/blocky
   for CTAs). Step nav buttons are kept at a standard size, and use the
   configured accent color for the primary ("Next") action. */
.abchk-step-nav button.button,
.abchk-btn-next,
.abchk-btn-back {
	display: inline-block !important;
	width: auto !important;
	height: auto !important;
	min-height: 0 !important;
	min-width: 0 !important;
	padding: 12px 24px !important;
	font-size: 14px !important;
	line-height: 1.4 !important;
	cursor: pointer;
}

.abchk-btn-next.button.alt {
	background-color: var(--abchk-accent) !important;
	border-color: var(--abchk-accent) !important;
	color: #fff !important;
}

/* --- Simple validation error message --- */
.abchk-step-error {
	background: #fcf0f1;
	border-left: 4px solid #e2401c;
	color: #611b1b;
	padding: 10px 14px;
	margin-bottom: 16px;
	font-size: 13px;
	border-radius: 2px;
}

/* --- Responsive --- */
@media (max-width: 480px) {
	body:not(.abchk-style-chevron):not(.abchk-style-minimal) .abchk-progress-label {
		display: none;
	}

	body.abchk-style-minimal .abchk-progress-label {
		font-size: 11px;
	}

	body.abchk-style-chevron .abchk-progress-step {
		padding: 10px 12px;
	}

	body.abchk-style-chevron .abchk-progress-label {
		font-size: 12px;
	}

	body.abchk-style-boxes .abchk-progress-circle {
		width: 32px;
		height: 32px;
		font-size: 13px;
	}

	.abchk-progress-bar {
		max-width: 320px;
	}

	body.abchk-style-chevron .abchk-progress-bar,
	body.abchk-style-minimal .abchk-progress-bar,
	body.abchk-style-bar .abchk-progress-bar,
	body.abchk-style-dots .abchk-progress-bar {
		max-width: 300px;
	}
}
