/*
 * Checkout progress bar: .wa-checkout-progress-bar (ol) with __iconbox steps and __connector lines between them.
 * Used above the cart and the checkout / order received (mobilky_checkout_progress_bar()). The active step
 * follows the WooCommerce body class, as snippets 490229 and 500 did.
 */

.wa-checkout-progress-bar {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-start;
	justify-content: space-between;
	width: 100%;
	margin: 0 0 var(--space-xl);
	padding: 0;
	list-style: none;
}

@media (min-width: 501px) {
	.wa-checkout-progress-bar {
		padding-inline: 5%;
	}
}

.wa-checkout-progress-bar__iconbox {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
}

.wa-checkout-progress-bar__step {
	display: flex;
	flex-direction: column;
	align-items: center;
	color: inherit;
	text-decoration: none;
}

/* Clickable step (cart → checkout, checkout → cart): brand colour so it doesn't look disabled. */
a.wa-checkout-progress-bar__step .wa-checkout-progress-bar__iconbox__icon,
a.wa-checkout-progress-bar__step .wa-checkout-progress-bar__iconbox__title {
	color: var(--primary);
}

/* Clickable step (cart → checkout, checkout → cart). */
a.wa-checkout-progress-bar__step:hover .wa-checkout-progress-bar__iconbox__icon,
a.wa-checkout-progress-bar__step:focus-visible .wa-checkout-progress-bar__iconbox__icon {
	background-color: var(--secondary);
	color: var(--primary);
}

a.wa-checkout-progress-bar__step:hover .wa-checkout-progress-bar__iconbox__title,
a.wa-checkout-progress-bar__step:focus-visible .wa-checkout-progress-bar__iconbox__title {
	color: var(--primary);
}

.wa-checkout-progress-bar__iconbox__icon {
	display: inline-flex;
	transition: background-color var(--transition-duration), color var(--transition-duration);
	align-items: center;
	justify-content: center;
	width: 52px;
	height: 52px;
	border-radius: 50%;
	background-color: var(--shade-ultra-light);
	color: var(--shade-light);
}

.wa-checkout-progress-bar__iconbox__icon > svg {
	width: 32px;
	height: 32px;
	fill: currentcolor;
}

.wa-checkout-progress-bar__iconbox__title {
	color: var(--shade-ultra-dark-trans-10);
	line-height: 1.5;
}

/* The line between two steps, level with the icon centres. */
.wa-checkout-progress-bar__connector {
	display: flex;
	flex-direction: column;
	flex-grow: 2;
	align-items: center;
	padding-top: 2.6rem;
}

.wa-checkout-progress-bar__connector::before {
	content: "";
	width: 96%;
	height: 2px;
	background-color: var(--shade-ultra-light);
}

/* Active step: 1 on the cart, 2 on the checkout, 3 on the order received page. */
.woocommerce-cart .wa-checkout-progress-bar__iconbox:nth-child(1) .wa-checkout-progress-bar__iconbox__icon,
.woocommerce-checkout:not(.woocommerce-order-received) .wa-checkout-progress-bar__iconbox:nth-child(3) .wa-checkout-progress-bar__iconbox__icon,
.woocommerce-order-received .wa-checkout-progress-bar__iconbox:nth-child(5) .wa-checkout-progress-bar__iconbox__icon {
	background-color: var(--secondary);
	color: var(--primary);
}

.woocommerce-cart .wa-checkout-progress-bar__iconbox:nth-child(1) .wa-checkout-progress-bar__iconbox__title,
.woocommerce-checkout:not(.woocommerce-order-received) .wa-checkout-progress-bar__iconbox:nth-child(3) .wa-checkout-progress-bar__iconbox__title,
.woocommerce-order-received .wa-checkout-progress-bar__iconbox:nth-child(5) .wa-checkout-progress-bar__iconbox__title {
	color: var(--shade-medium);
}

@media (max-width: 767px) {
	.wa-checkout-progress-bar__iconbox__title {
		font-size: var(--text-xs);
	}
}

/* Snippet 500: no progress bar on the order received page on small phones. */
@media (max-width: 480px) {
	.woocommerce-order-received .wa-checkout-progress-bar {
		display: none;
	}
}
