/* ==========================================================================
   Smart Jhuri — mobile bottom navigation
   Shown below 992px; hidden entirely on desktop, where the header carries the
   same destinations.
   ========================================================================== */

.sj-mbar {
	display: none;
	position: fixed;
	left: 0;
	right: 0;
	bottom: 0;
	z-index: 900;
	background: #fff;
	border-top: 1px solid var(--sj-line);
	box-shadow: 0 -6px 20px rgba(15, 23, 42, .08);
	/* Clears the iOS home indicator without leaving a gap on other phones. */
	padding-bottom: env(safe-area-inset-bottom, 0px);
	transition: transform 220ms cubic-bezier(.4, 0, .2, 1);
}

.sj-mbar.is-hidden { transform: translateY(110%); }

.sj-mbar__list {
	display: grid;
	grid-template-columns: repeat(var(--sj-mbar-cols, 5), minmax(0, 1fr));
	margin: 0;
	padding: 0;
	list-style: none;
}

.sj-mbar__link {
	position: relative;
	display: grid;
	justify-items: center;
	gap: 3px;
	padding: 8px 2px 7px;
	color: var(--sj-muted);
	font-family: var(--sj-font-head);
	font-size: 10.5px;
	font-weight: 600;
	line-height: 1.2;
	text-align: center;
	transition: color var(--sj-ease);
	-webkit-tap-highlight-color: transparent;
}

.sj-mbar__icon {
	position: relative;
	display: grid;
	place-items: center;
	width: 30px;
	height: 26px;
}

.sj-mbar__label {
	display: block;
	max-width: 100%;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

/* Active tab: brand colour plus a short bar tucked under the top edge. */
.sj-mbar__link.is-active { color: var(--sj-blue); }

.sj-mbar__link.is-active::before {
	content: "";
	position: absolute;
	top: -1px;
	left: 50%;
	transform: translateX(-50%);
	width: 26px;
	height: 3px;
	border-radius: 0 0 3px 3px;
	background: var(--sj-blue);
}

.sj-mbar__link:active { color: var(--sj-blue-600); }

/* Cart badge — same class the header uses, so the WooCommerce cart fragment
   swaps both of them in one go. */
.sj-mbar .sj-cart__count {
	position: absolute;
	top: -4px;
	right: -1px;
	display: grid;
	place-items: center;
	min-width: 17px;
	height: 17px;
	padding: 0 4px;
	border-radius: 999px;
	background: var(--sj-orange);
	color: #fff;
	font-size: 10px;
	font-weight: 700;
	font-variant-numeric: tabular-nums;
	line-height: 1;
}

.sj-mbar .sj-cart__count[data-count="0"] { display: none; }

@media (max-width: 991px) {
	.sj-mbar { display: block; }

	/*
	 * Keep the last of the page clear of the bar. The footer already has its
	 * own padding, so this only has to cover the bar's own height.
	 */
	body { padding-bottom: calc(58px + env(safe-area-inset-bottom, 0px)); }

	/* The drawer (1000) and the modals (1200+) already sit above the bar; this
	   only stops it showing through the part of the screen they leave clear. */
	body.sj-drawer-open .sj-mbar,
	body.sj-modal-open .sj-mbar { transform: translateY(110%); }
}

@media (prefers-reduced-motion: reduce) {
	.sj-mbar { transition: none; }
}
