/* =========================================================
   Cart & checkout shared: page heading, purchase steps,
   WooCommerce notices, policy links and mobile bottom bar.
   ========================================================= */
body.woocommerce-cart,
body.woocommerce-checkout {
	--vbxwoo-commerce-bar-h: calc(4.5rem + env(safe-area-inset-bottom, 0px));
}

.woocommerce-cart .site-main,
.woocommerce-checkout .site-main {
	background: var(--vbxwoo-background);
}

/* Two-column layouts stack with row-gap: Bootstrap's negative vertical gutter
 * would pull the row under floated notice buttons and narrow it. */
.vbxwoo-cart,
.vbxwoo-checkout-layout {
	row-gap: 1.5rem;
}

/* Heading and progress steps */
.vbxwoo-commerce-head {
	align-items: center;
	display: flex;
	flex-wrap: wrap;
	gap: 0.75rem 2rem;
	justify-content: space-between;
	margin-bottom: 1.5rem;
}

.vbxwoo-commerce-head__title {
	color: var(--vbxwoo-text);
	font-size: clamp(1.625rem, 3vw, 2.25rem);
	font-weight: 700;
	line-height: 1.2;
	margin: 0;
}

.vbxwoo-steps {
	align-items: center;
	display: flex;
	gap: 0.5rem;
	list-style: none;
	margin: 0;
	padding: 0;
}

.vbxwoo-steps__item {
	align-items: center;
	color: var(--vbxwoo-text-muted);
	display: flex;
	font-size: 0.875rem;
	gap: 0.5rem;
	line-height: 1.3;
}

.vbxwoo-steps__item + .vbxwoo-steps__item::before {
	background: var(--vbxwoo-border-strong);
	content: "";
	height: 1px;
	width: 1.5rem;
}

.vbxwoo-steps__link {
	align-items: center;
	color: inherit;
	display: inline-flex;
	gap: 0.5rem;
	text-decoration: none;
}

.vbxwoo-steps__link:hover .vbxwoo-steps__label {
	text-decoration: underline;
}

.vbxwoo-steps__marker {
	align-items: center;
	background: var(--vbxwoo-surface);
	border: 1px solid var(--vbxwoo-border-strong);
	border-radius: 50%;
	display: inline-flex;
	flex: 0 0 1.75rem;
	font-size: 0.8125rem;
	font-weight: 700;
	height: 1.75rem;
	justify-content: center;
	width: 1.75rem;
}

.vbxwoo-steps__item.is-current {
	color: var(--vbxwoo-text);
	font-weight: 700;
}

.vbxwoo-steps__item.is-current .vbxwoo-steps__marker {
	background: var(--vbxwoo-primary);
	border-color: var(--vbxwoo-primary);
	color: var(--vbxwoo-light);
}

.vbxwoo-steps__item.is-done {
	color: var(--vbxwoo-success);
}

.vbxwoo-steps__item.is-done .vbxwoo-steps__marker {
	border-color: var(--vbxwoo-success);
}

/* Notices: brand surface with a coloured edge instead of Woo's purple/blue bars. */
.woocommerce-cart .woocommerce-notices-wrapper:empty,
.woocommerce-checkout .woocommerce-notices-wrapper:empty {
	display: none;
}

body.woocommerce-cart :is(.woocommerce-message, .woocommerce-info, .woocommerce-error),
body.woocommerce-checkout :is(.woocommerce-message, .woocommerce-info, .woocommerce-error) {
	background: var(--vbxwoo-surface);
	border: 1px solid var(--vbxwoo-border);
	border-left: 4px solid var(--vbxwoo-info);
	border-radius: var(--vbx-radius-sm);
	color: var(--vbxwoo-text);
	font-size: 0.9375rem;
	line-height: 1.5;
	margin: 0 0 1rem;
	padding: 0.875rem 1rem 0.875rem 2.75rem;
}

body.woocommerce-cart :is(.woocommerce-message, .woocommerce-info, .woocommerce-error)::before,
body.woocommerce-checkout :is(.woocommerce-message, .woocommerce-info, .woocommerce-error)::before {
	color: var(--vbxwoo-info);
	left: 1rem;
	top: 0.95rem;
}

body.woocommerce-cart .woocommerce-message,
body.woocommerce-checkout .woocommerce-message {
	border-left-color: var(--vbxwoo-success);
}

body.woocommerce-cart .woocommerce-message::before,
body.woocommerce-checkout .woocommerce-message::before {
	color: var(--vbxwoo-success);
}

body.woocommerce-cart .woocommerce-error,
body.woocommerce-checkout .woocommerce-error {
	border-left-color: var(--vbxwoo-primary);
}

body.woocommerce-cart .woocommerce-error::before,
body.woocommerce-checkout .woocommerce-error::before {
	color: var(--vbxwoo-primary);
}

body.woocommerce-cart .woocommerce-error li + li,
body.woocommerce-checkout .woocommerce-error li + li {
	margin-top: 0.25rem;
}

body.woocommerce-cart :is(.woocommerce-message, .woocommerce-info, .woocommerce-error) a,
body.woocommerce-checkout :is(.woocommerce-message, .woocommerce-info, .woocommerce-error) a {
	color: var(--vbxwoo-primary);
	font-weight: 700;
}

body.woocommerce-cart :is(.woocommerce-message, .woocommerce-info) .button,
body.woocommerce-checkout :is(.woocommerce-message, .woocommerce-info) .button {
	background: transparent;
	border: 0;
	color: var(--vbxwoo-primary);
	font-size: 0.9375rem;
	font-weight: 700;
	line-height: 1.5;
	padding: 0;
	text-decoration: underline;
}

/* Purchase policy links under the order summary */
.vbxwoo-purchase-policies {
	background: var(--vbxwoo-surface);
	border: 1px solid var(--vbxwoo-border);
	border-radius: var(--vbx-radius-md);
	margin-top: 1rem;
	padding: 0.5rem;
}

.vbxwoo-purchase-policies__list {
	display: grid;
	gap: 0.125rem;
	list-style: none;
	margin: 0;
	padding: 0;
}

.vbxwoo-purchase-policies__link {
	align-items: center;
	border-radius: var(--vbx-radius-sm);
	color: var(--vbxwoo-text);
	display: flex;
	font-size: 0.9375rem;
	gap: 0.75rem;
	min-height: 44px;
	padding: 0.375rem 0.625rem;
	text-decoration: none;
}

.vbxwoo-purchase-policies__link:hover {
	background: var(--vbxwoo-surface-soft);
	color: var(--vbxwoo-primary);
}

.vbxwoo-purchase-policies__icon {
	color: var(--vbxwoo-primary);
	display: inline-flex;
	flex: 0 0 1.5rem;
	height: 1.5rem;
	width: 1.5rem;
}

.vbxwoo-purchase-policies__icon svg {
	height: 100%;
	width: 100%;
}

/* Keep the Zalo chat bubble off the summary column and the mobile order bar.
 * The widget positions itself with inline styles, so the override needs !important. */
body.woocommerce-cart .zalo-chat-widget,
body.woocommerce-checkout .zalo-chat-widget {
	bottom: 1rem !important;
	right: 0.75rem !important;
}

@media (max-width: 991.98px) {
	body.woocommerce-cart:has(.vbxwoo-cart-bar),
	body.woocommerce-checkout:has(.vbxwoo-checkout #place_order) {
		padding-bottom: var(--vbxwoo-commerce-bar-h);
	}

	body.woocommerce-cart:has(.vbxwoo-cart-bar) .zalo-chat-widget,
	body.woocommerce-checkout:has(.vbxwoo-checkout #place_order) .zalo-chat-widget {
		bottom: calc(var(--vbxwoo-commerce-bar-h) + 0.75rem) !important;
	}
}

@media (max-width: 575.98px) {
	.vbxwoo-commerce-head {
		margin-bottom: 1rem;
	}

	.vbxwoo-steps {
		align-items: flex-start;
		width: 100%;
	}

	.vbxwoo-steps__item,
	.vbxwoo-steps__link {
		flex: 1 1 0;
		flex-direction: column;
		font-size: 0.75rem;
		gap: 0.25rem;
		text-align: center;
	}

	.vbxwoo-steps__item + .vbxwoo-steps__item::before {
		display: none;
	}
}
