/*
 * Cart page additions (ALC_Cart, mockup idea 4). Ours: the step strip, the pickup hint and the
 * bottom bar for phones. The theme cart template is untouched; on phones its rows only get small
 * CSS touches (the theme fixes the thumbnail size with !important, so it is left as is).
 * Everything is scoped to body.alc-page-cart.
 */

body.alc-page-cart {
	--alc-ink: #070707;
	--alc-text: #454545;
	--alc-muted: #838383;
	--alc-line: #e3e3e3;
}

.alc-cart-steps {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 6px;
	max-width: 760px;
	margin: 0 auto 24px;
	padding: 0;
	list-style: none;
}

.alc-cart-steps li {
	margin: 0;
	padding-top: 5px;
	border-top: 4px solid var(--alc-line);
	font-size: 13px;
	font-weight: 600;
	color: var(--alc-muted);
}

.alc-cart-steps li.is-on {
	border-top-color: var(--alc-ink);
	font-weight: 800;
	color: var(--alc-ink);
}

.alc-cart-hint {
	margin: 12px 0 0;
	font-size: 13px;
	text-align: center;
	color: var(--alc-text);
}

.alc-cart-bar {
	display: none;
}

@media (max-width: 767px) {
	body.alc-page-cart {
		padding-bottom: calc(136px + env(safe-area-inset-bottom));
	}

	.alc-cart-bar {
		display: block;
		position: fixed;
		right: 0;
		bottom: 0;
		left: 0;
		z-index: 50;
		padding: 8px 12px env(safe-area-inset-bottom);
		border-top: 1px solid var(--alc-line);
		background: #fff;
		box-shadow: 0 -6px 16px -10px rgba(0, 0, 0, 0.25);
		direction: rtl;
	}

	.alc-cart-bar[hidden] {
		display: none;
	}

	.alc-cart-bar-row {
		display: flex;
		align-items: baseline;
		justify-content: space-between;
		padding: 0 2px 6px;
		font-size: 14px;
		color: var(--alc-text);
	}

	.alc-cart-bar-row b {
		font-size: 17px;
		font-weight: 800;
		color: var(--alc-ink);
	}

	.alc-cart-bar .alc-cart-bar-cta {
		display: block;
		min-height: 50px;
		padding: 13px;
		background: var(--alc-ink);
		font-size: 16px;
		font-weight: 800;
		text-align: center;
		text-decoration: none;
		color: #fff;
	}

	.alc-cart-bar .alc-cart-bar-back {
		display: flex;
		align-items: center;
		justify-content: center;
		min-height: 44px;
		font-size: 13px;
		text-decoration: underline;
		color: var(--alc-muted);
	}

	/* The "continue" link stays black in every state (the theme recolours links and buttons on hover/focus). */
	.alc-cart-bar .alc-cart-bar-cta:hover,
	.alc-cart-bar .alc-cart-bar-cta:focus,
	.alc-cart-bar .alc-cart-bar-cta:active,
	.alc-cart-bar .alc-cart-bar-cta:visited {
		background: var(--alc-ink);
		color: #fff;
	}

	.alc-cart-bar .alc-cart-bar-back:hover,
	.alc-cart-bar .alc-cart-bar-back:focus,
	.alc-cart-bar .alc-cart-bar-back:active {
		color: var(--alc-muted);
	}

	.alc-cart-bar a:focus-visible {
		outline: 2px solid #c69657;
		outline-offset: 2px;
	}

	/* The bar is the main button on phones: the theme's checkout button would repeat it. */
	body.alc-page-cart .wc-proceed-to-checkout {
		display: none;
	}

	/* The floating WhatsApp would cover the bar; Click to Chat writes inline styles, so only !important hides it. */
	body.alc-page-cart #ht-ctc-chat {
		display: none !important;
	}

	/* Theme cart rows as cards. */
	body.alc-page-cart .c-cart__shop-thead {
		display: none;
	}

	body.alc-page-cart .c-cart__thumbnail {
		border: 1px solid var(--alc-line);
	}

	body.alc-page-cart .c-cart__shop-td--product-name {
		font-size: 15px;
		font-weight: 700;
		line-height: 1.3;
	}

	body.alc-page-cart .c-cart__shop-td--product-subtotal {
		font-weight: 800;
	}
}
