/* CT Suite — Mobile Bottom Navigation.
   Colours/sizes/spacing come from CSS custom properties + a small inline
   <style> block (see class-ctsuite-mobile-nav-frontend.php), both driven
   by the admin settings; this file only handles structural layout. */

.ctsuite-mnav {
	--ctmnav-icon-size: 22px;
	--ctmnav-text-size: 11px;
	--ctmnav-items-gap: 0px;
	--ctmnav-icon-text-gap: 4px;
	position: fixed;
	z-index: 99999;
	background-color: #ffffff;
	box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.08);
	display: none; /* toggled per-context by the media queries/rules below */
}

.ctsuite-mnav-item {
	display: flex;
	align-items: center;
	justify-content: center;
	text-decoration: none;
	color: inherit;
}

.ctsuite-mnav-icon {
	position: relative;
	display: inline-flex;
	flex-shrink: 0;
}

.ctsuite-mnav-icon svg {
	width: var(--ctmnav-icon-size);
	height: var(--ctmnav-icon-size);
	color: #555555;
}

.ctsuite-mnav-item.is-active .ctsuite-mnav-icon svg {
	color: #222222;
}

.ctsuite-mnav-label {
	font-size: var(--ctmnav-text-size);
	color: #555555;
	white-space: nowrap;
}

.ctsuite-mnav-item.is-active .ctsuite-mnav-label {
	color: #222222;
	font-weight: 600;
}

.ctsuite-mnav-badge {
	position: absolute;
	top: -6px;
	right: -8px;
	min-width: 15px;
	height: 15px;
	padding: 0 3px;
	border-radius: 999px;
	background-color: #e53935;
	color: #ffffff;
	font-size: 9px;
	line-height: 15px;
	text-align: center;
	font-weight: 700;
}

/* ---- Mobile: sticky bar across the bottom of the screen ---- */
.ctsuite-mnav-mobile {
	left: 0;
	right: 0;
	bottom: 0;
	padding: 8px 4px calc(8px + env(safe-area-inset-bottom, 0px));
	flex-direction: row;
	align-items: stretch;
	justify-content: space-around;
	gap: var(--ctmnav-items-gap);
}

.ctsuite-mnav-mobile .ctsuite-mnav-item {
	flex-direction: column;
	gap: var(--ctmnav-icon-text-gap);
	flex: 1 1 0;
	min-width: 0;
	padding: 2px 2px;
}

.ctsuite-mnav-mobile .ctsuite-mnav-label {
	overflow: hidden;
	text-overflow: ellipsis;
	max-width: 100%;
}

/* Leave room at the bottom of the page content so this fixed bar never
   sits on top of/hides the last bit of the page (footer, add-to-cart
   button, etc.) on phones. Scoped to the actual configured breakpoint via
   the inline <style> this pairs with (see build_dynamic_css()), not here,
   since it must match whatever width the admin has chosen. */

/* ---- Desktop: floating side dock, icon-only by default, label reveals
   on hover ---- */
.ctsuite-mnav-desktop {
	top: 50%;
	transform: translateY(-50%);
	flex-direction: column;
	align-items: stretch;
	padding: 10px 0;
	border-radius: 8px;
	gap: var(--ctmnav-items-gap, 10px);
}

.ctsuite-mnav-desktop-left {
	left: 0;
	border-radius: 0 8px 8px 0;
}

.ctsuite-mnav-desktop-right {
	right: 0;
	border-radius: 8px 0 0 8px;
}

.ctsuite-mnav-desktop .ctsuite-mnav-item {
	flex-direction: row;
	justify-content: flex-start;
	gap: var(--ctmnav-icon-text-gap);
	padding: 10px 14px;
}

.ctsuite-mnav-desktop-right .ctsuite-mnav-item {
	flex-direction: row-reverse;
}

.ctsuite-mnav-desktop .ctsuite-mnav-label {
	max-width: 0;
	opacity: 0;
	overflow: hidden;
	transition: max-width 0.2s ease, opacity 0.15s ease;
}

.ctsuite-mnav-desktop .ctsuite-mnav-item:hover .ctsuite-mnav-label,
.ctsuite-mnav-desktop .ctsuite-mnav-item:focus-visible .ctsuite-mnav-label {
	max-width: 160px;
	opacity: 1;
}
