/**
 * Comparix Theme — Premium sticky bottom navigation (mobile only).
 */

:root {
	--cx-theme-bottom-nav-h: 60px;
}

@media (min-width: 1024px) {
	body.cx-theme-bottom-nav {
		padding-bottom: 0;
	}

	.cx-theme-bottom-nav {
		display: none;
	}
}

@media (max-width: 1023px) {
	body.cx-theme-bottom-nav {
		padding-bottom: calc(var(--cx-theme-bottom-nav-h) + env(safe-area-inset-bottom, 0px));
	}

	body.cx-theme-bottom-nav .cx-theme-back-to-top {
		bottom: calc(var(--cx-theme-bottom-nav-h) + 12px + env(safe-area-inset-bottom, 0px));
	}

	body.cx-theme-mobile-menu-open .cx-theme-bottom-nav,
	body.cx-ps-open .cx-theme-bottom-nav {
		transform: translate3d(0, 110%, 0);
		transition: transform 0.28s cubic-bezier(0.32, 0.72, 0, 1);
	}
}

.cx-theme-bottom-nav {
	position: fixed;
	left: 0;
	right: 0;
	bottom: 0;
	z-index: 95;
	height: calc(var(--cx-theme-bottom-nav-h) + env(safe-area-inset-bottom, 0px));
	padding-bottom: env(safe-area-inset-bottom, 0px);
	background: color-mix(in srgb, var(--cx-theme-bg) 78%, transparent);
	border-top: 1px solid color-mix(in srgb, var(--cx-theme-border) 70%, transparent);
	box-shadow:
		0 -8px 32px color-mix(in srgb, var(--cx-theme-text) 6%, transparent),
		inset 0 1px 0 color-mix(in srgb, #fff 8%, transparent);
	backdrop-filter: blur(20px) saturate(1.4);
	-webkit-backdrop-filter: blur(20px) saturate(1.4);
	transition: transform 0.28s cubic-bezier(0.32, 0.72, 0, 1);
}

.cx-theme-bottom-nav__list {
	display: flex;
	align-items: stretch;
	justify-content: space-around;
	list-style: none;
	margin: 0;
	padding: 0;
	height: var(--cx-theme-bottom-nav-h);
}

.cx-theme-bottom-nav__link {
	position: relative;
	display: flex;
	flex: 1;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 3px;
	min-width: 0;
	padding: 6px 4px;
	border: 0;
	background: none;
	color: var(--cx-theme-text-muted);
	text-decoration: none;
	font-size: 10px;
	font-weight: 700;
	line-height: 1.1;
	cursor: pointer;
	overflow: hidden;
	transition: color 0.18s ease;
}

.cx-theme-bottom-nav__link:hover,
.cx-theme-bottom-nav__link:focus-visible {
	color: var(--cx-theme-primary);
	outline: none;
}

.cx-theme-bottom-nav__link.is-active {
	color: var(--cx-theme-primary);
}

.cx-theme-bottom-nav__link.is-active .cx-theme-bottom-nav__icon {
	transform: translateY(-1px);
}

.cx-theme-bottom-nav__link:focus-visible {
	outline: 2px solid var(--cx-theme-primary);
	outline-offset: -2px;
	border-radius: 10px;
}

.cx-theme-bottom-nav__icon {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 24px;
	height: 24px;
	transition: transform 0.18s ease;
}

.cx-theme-bottom-nav__icon svg {
	width: 22px;
	height: 22px;
}

.cx-theme-bottom-nav__label {
	max-width: 100%;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.cx-theme-bottom-nav__badge {
	position: absolute;
	top: 6px;
	right: calc(50% - 22px);
	min-width: 16px;
	height: 16px;
	padding: 0 4px;
	border-radius: 999px;
	background: #ef4444;
	color: #fff;
	font-size: 9px;
	font-weight: 800;
	line-height: 16px;
	text-align: center;
}

/* Ripple */
.cx-theme-bottom-nav .cx-ripple {
	isolation: isolate;
}

.cx-theme-bottom-nav .cx-ripple__wave {
	position: absolute;
	border-radius: 50%;
	background: color-mix(in srgb, var(--cx-theme-primary) 22%, transparent);
	transform: scale(0);
	animation: cx-theme-bottom-nav-ripple 0.55s ease-out forwards;
	pointer-events: none;
}

@keyframes cx-theme-bottom-nav-ripple {
	to {
		transform: scale(1);
		opacity: 0;
	}
}

@media (prefers-reduced-motion: reduce) {
	.cx-theme-bottom-nav,
	.cx-theme-bottom-nav__link,
	.cx-theme-bottom-nav__icon {
		transition: none;
	}

	.cx-theme-bottom-nav .cx-ripple__wave {
		animation: none;
		display: none;
	}
}
