/*
 * Mobile-only chrome (< 900px): bottom navigation (.cw-mobile-nav) and floating cart bar (.cw-cart-bar).
 * Neither is printed in the cart and checkout pages. Layers: bar (--cw-z-cart-bar) < nav (--cw-z-mobile-nav)
 * < toast < overlay and drawers. The body reserves the nav height (body.cw-has-mobile-nav).
 */
.cw-mobile-nav,
.cw-cart-bar {
	display: none;
}

@media (max-width: 899px) {
	body.cw-has-mobile-nav {
		padding-bottom: calc(var(--cw-mobile-nav-h) + env(safe-area-inset-bottom, 0px));
	}

	/* The floating cart bar (visible when the cart has items; cart-drawer.js adds the class) sits above the nav. */
	body.cw-has-mobile-nav.cw-has-cart-bar {
		padding-bottom: calc(var(--cw-mobile-nav-h) + var(--cw-cart-bar-gap) + var(--cw-cart-bar-h) + var(--cw-cart-bar-gap) + env(safe-area-inset-bottom, 0px));
	}

	.cw-mobile-nav {
		position: fixed;
		z-index: var(--cw-z-mobile-nav);
		right: 0;
		bottom: 0;
		left: 0;
		display: flex;
		height: calc(var(--cw-mobile-nav-h) + env(safe-area-inset-bottom, 0px));
		padding-bottom: env(safe-area-inset-bottom, 0px);
		border-top: 1px solid var(--cw-color-line);
		background: var(--cw-color-surface);
	}

	.cw-mobile-nav__item {
		position: relative;
		display: flex;
		min-width: 0;
		flex: 1;
		flex-direction: column;
		align-items: center;
		gap: 4px;
		margin: 0;
		padding: 10px 4px 0;
		border: 0;
		background: transparent;
		color: var(--cw-color-muted);
		font-family: inherit;
		font-size: 11px;
		font-weight: 600;
		line-height: 1.2;
		text-decoration: none;
		cursor: pointer;
	}

	.cw-mobile-nav__item:hover,
	.cw-mobile-nav__item:focus-visible {
		color: var(--cw-color-ink);
	}

	.cw-mobile-nav__item.is-active {
		color: var(--cw-color-ink);
		font-weight: 800;
	}

	.cw-mobile-nav__item.is-active::before {
		content: "";
		position: absolute;
		top: 0;
		left: 50%;
		width: 28px;
		height: 3px;
		border-radius: 0 0 var(--cw-radius) var(--cw-radius);
		background: var(--cw-color-button);
		transform: translateX(-50%);
	}

	.cw-cart-bar {
		position: fixed;
		z-index: var(--cw-z-cart-bar);
		right: 16px;
		bottom: calc(var(--cw-mobile-nav-h) + var(--cw-cart-bar-gap) + env(safe-area-inset-bottom, 0px));
		left: 16px;
		display: flex;
		height: var(--cw-cart-bar-h);
		align-items: center;
		justify-content: space-between;
		gap: 12px;
		margin: 0;
		padding: 0 16px;
		border: 0;
		border-radius: var(--cw-radius);
		background: var(--cw-color-button);
		box-shadow: 0 10px 30px color-mix(in srgb, var(--cw-color-ink) 22%, transparent);
		color: var(--cw-color-button-ink);
		font-family: inherit;
		text-align: left;
		cursor: pointer;
	}

	.cw-cart-bar[hidden] {
		display: none;
	}

	.cw-cart-bar__main,
	.cw-cart-bar__end {
		display: flex;
		align-items: center;
		gap: 10px;
	}

	.cw-cart-bar__count {
		display: grid;
		min-width: 28px;
		height: 28px;
		padding: 0 6px;
		place-items: center;
		border-radius: var(--cw-radius);
		background: var(--cw-color-surface);
		color: var(--cw-color-ink);
		font-size: 12px;
		font-weight: 800;
		line-height: 1;
	}

	.cw-cart-bar__count[hidden] {
		display: none;
	}

	.cw-cart-bar__label {
		font-size: 15px;
		font-weight: 700;
	}

	.cw-cart-bar__subtotal {
		font-size: 15px;
		font-weight: 800;
	}

	.cw-cart-bar__end .cw-icon {
		width: 18px;
		height: 18px;
	}
}
