/**
 * Bottom navigation bar (Custom_Addons_Mobile_Nav).
 * Phones and tablets only (≤ 991px, the theme's hamburger breakpoint).
 * Colors follow the global layout (--ca-*), with the Modern palette as fallback.
 */
.ca-mobile-nav {
	display: none;
}

@media only screen and (max-width: 991px) {
	.ca-mobile-nav {
		position: fixed;
		left: 0;
		right: 0;
		bottom: 0;
		z-index: 9990;
		display: grid;
		grid-template-columns: repeat(var(--ca-mobile-nav-count, 5), minmax(0, 1fr));
		align-items: stretch;
		gap: 4px;
		padding: 8px 8px calc(8px + env(safe-area-inset-bottom, 0px));
		background: var(--ca-card-bg, #ffffff);
		border-top: 1px solid var(--ca-border, #ebe6dc);
		box-shadow: 0 -6px 20px rgba(0, 0, 0, .06);
		box-sizing: border-box;
	}

	.ca-mobile-nav__item {
		display: flex;
		flex-direction: column;
		align-items: center;
		justify-content: center;
		gap: 4px;
		min-width: 0;
		padding: 4px 2px;
		color: var(--ca-muted, #6b716d);
		font-size: 12px;
		font-weight: 500;
		line-height: 1.2;
		text-align: center;
		text-decoration: none;
		-webkit-tap-highlight-color: transparent;
	}

	.ca-mobile-nav__item:hover,
	.ca-mobile-nav__item:focus,
	.ca-mobile-nav__item:visited {
		color: var(--ca-muted, #6b716d);
		text-decoration: none;
	}

	.ca-mobile-nav__icon {
		position: relative;
		display: inline-flex;
		align-items: center;
		justify-content: center;
		width: 48px;
		height: 32px;
		border-radius: 16px;
		transition: background-color .15s ease;
	}

	.ca-mobile-nav__icon svg {
		width: 22px;
		height: 22px;
	}

	.ca-mobile-nav__label {
		max-width: 100%;
		overflow: hidden;
		white-space: nowrap;
		text-overflow: ellipsis;
	}

	.ca-mobile-nav__item.is-active,
	.ca-mobile-nav__item.is-active:hover,
	.ca-mobile-nav__item.is-active:focus,
	.ca-mobile-nav__item.is-active:visited {
		color: var(--ca-primary, #0f4c3a);
		font-weight: 700;
	}

	.ca-mobile-nav__item.is-active .ca-mobile-nav__icon {
		background: var(--ca-icon-bg, #eef2ef);
	}

	.ca-mobile-nav__badge {
		position: absolute;
		top: -2px;
		right: 6px;
		min-width: 18px;
		height: 18px;
		padding: 0 5px;
		border: 2px solid var(--ca-card-bg, #ffffff);
		border-radius: 9px;
		background: #e5383b;
		color: #ffffff;
		font-size: 10px;
		font-weight: 700;
		line-height: 14px;
		text-align: center;
		box-sizing: border-box;
	}

	/* The bar replaces the hamburger menu. */
	body.ca-has-mobile-nav .site-header .ham-icon,
	body.ca-has-mobile-nav .site-header .main-navigation {
		display: none !important;
	}

	/* Keep the page end and the scroll-to-top button above the bar. */
	body.ca-has-mobile-nav {
		padding-bottom: calc(72px + env(safe-area-inset-bottom, 0px));
	}

	body.ca-has-mobile-nav #toTop,
	body.ca-has-mobile-nav #toTop.slide-in {
		bottom: calc(84px + env(safe-area-inset-bottom, 0px));
	}
}

/* Narrow phones: smaller pill so five items fit. */
@media only screen and (max-width: 360px) {
	.ca-mobile-nav__icon {
		width: 40px;
	}

	.ca-mobile-nav__item {
		font-size: 11px;
	}
}
