/* =========================================================
   SELORA MOBILE BOTTOM NAVIGATION — V12
   Compact floating dock / no notch / no protruding cart
   ========================================================= */

nav.mobile-bottom-nav[data-selora-mobile-nav],
.mobile-bottom-nav__spacer[data-mobile-nav-spacer] {
	display: none;
}

@media (max-width: 768px) {
	:root {
		/*
		 * Shared bottom clearance for every floating mobile surface.
		 * JS replaces this fallback with measured nav geometry on real devices.
		 */
		--selora-mobile-nav-height: 64px;
		--selora-mobile-nav-edge: calc(8px + env(safe-area-inset-bottom, 0px));
		--selora-mobile-nav-gap: 10px;
		--selora-mobile-nav-clearance: calc(
			var(--selora-mobile-nav-height) + var(--selora-mobile-nav-edge) +
				var(--selora-mobile-nav-gap)
		);
	}

	nav.mobile-bottom-nav[data-selora-mobile-nav] {
		--mobile-nav-primary: #2a39c6;
		--mobile-nav-primary-soft: rgba(42, 57, 198, 0.09);
		--mobile-nav-ink: #172033;
		--mobile-nav-muted: #7a8292;
		--mobile-nav-surface: rgba(255, 255, 255, 0.85);
		--mobile-nav-border: rgba(15, 23, 42, 0.08);

		position: fixed !important;
		left: 50% !important;
		right: auto !important;
		bottom: var(--selora-mobile-nav-edge) !important;
		width: min(560px, calc(100vw - 20px)) !important;
		max-width: calc(100vw - 20px) !important;
		transform: translateX(-50%) !important;
		z-index: 1990 !important;

		display: grid !important;
		grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
		align-items: stretch;

		height: var(--selora-mobile-nav-height) !important;
		padding: 4px 5px !important;

		overflow: visible !important;

		border: 1px solid var(--mobile-nav-border) !important;
		border-radius: 22px !important;
		background: var(--mobile-nav-surface) !important;
		box-shadow:
			0 12px 34px rgba(15, 23, 42, 0.12),
			0 2px 8px rgba(15, 23, 42, 0.035) !important;

		backdrop-filter: blur(24px) saturate(130%);
		-webkit-backdrop-filter: blur(24px) saturate(130%);
		isolation: isolate;
	}

	nav.mobile-bottom-nav[data-selora-mobile-nav]::before,
	nav.mobile-bottom-nav[data-selora-mobile-nav]::after {
		content: none !important;
	}

	nav.mobile-bottom-nav[data-selora-mobile-nav] .mobile-bottom-nav__item {
		position: relative;
		z-index: 1;

		min-width: 0;
		min-height: 54px;
		display: flex !important;
		flex-direction: column;
		align-items: center;
		justify-content: center;
		gap: 1px;
		padding: 3px 1px 2px;

		border-radius: 16px;
		color: var(--mobile-nav-muted);
		text-decoration: none;
		-webkit-tap-highlight-color: transparent;

		transition:
			color 0.16s ease,
			background-color 0.16s ease,
			transform 0.12s ease;
	}

	nav.mobile-bottom-nav[data-selora-mobile-nav]
		.mobile-bottom-nav__item:active {
		transform: scale(0.965);
	}

	nav.mobile-bottom-nav[data-selora-mobile-nav]
		.mobile-bottom-nav__cart-float {
		position: static !important;
		width: auto !important;
		height: auto !important;
		display: contents !important;
		transform: none !important;
		background: transparent !important;
		border: 0 !important;
		box-shadow: none !important;
	}

	nav.mobile-bottom-nav[data-selora-mobile-nav] .mobile-bottom-nav__icon {
		position: relative;
		width: 34px;
		height: 34px;
		flex: 0 0 34px;
		display: grid;
		place-items: center;

		border: 1px solid transparent;
		border-radius: 12px;
		background: transparent;
		color: inherit;

		transition:
			background-color 0.16s ease,
			border-color 0.16s ease,
			color 0.16s ease;
	}

	nav.mobile-bottom-nav[data-selora-mobile-nav] .mobile-bottom-nav__icon svg {
		width: 21px;
		height: 21px;
		fill: none;
		stroke: currentColor;
		stroke-width: 1.75;
		stroke-linecap: round;
		stroke-linejoin: round;
	}

	nav.mobile-bottom-nav[data-selora-mobile-nav] .mobile-bottom-nav__label {
		max-width: 100%;
		overflow: hidden;
		color: inherit;
		font-size: 9.6px;
		font-weight: 570;
		line-height: 14px;
		text-overflow: ellipsis;
		white-space: nowrap;
	}

	/* Active state is deliberately quiet: no giant bubble, no raised item. */
	nav.mobile-bottom-nav[data-selora-mobile-nav]
		.mobile-bottom-nav__item[aria-current="page"] {
		color: var(--mobile-nav-primary);
		background: rgba(42, 57, 198, 0.025);
	}

	nav.mobile-bottom-nav[data-selora-mobile-nav]
		.mobile-bottom-nav__item[aria-current="page"]
		.mobile-bottom-nav__icon {
		border-color: rgba(42, 57, 198, 0.08);
		background: var(--mobile-nav-primary-soft);
		color: var(--mobile-nav-primary);
	}

	nav.mobile-bottom-nav[data-selora-mobile-nav]
		.mobile-bottom-nav__item[aria-current="page"]
		.mobile-bottom-nav__label {
		font-weight: 690;
	}

	/* Cart behaves exactly like the other destinations. */
	nav.mobile-bottom-nav[data-selora-mobile-nav]
		.mobile-bottom-nav__item--cart {
		grid-column: auto !important;
		grid-row: auto !important;
		transform: none !important;
		overflow: visible !important;
	}

	nav.mobile-bottom-nav[data-selora-mobile-nav]
		.mobile-bottom-nav__item--cart
		.mobile-bottom-nav__icon {
		width: 34px;
		height: 34px;
		border-radius: 12px;
		background: transparent;
		color: inherit;
		box-shadow: none;
	}

	nav.mobile-bottom-nav[data-selora-mobile-nav]
		.mobile-bottom-nav__item--cart[aria-current="page"]
		.mobile-bottom-nav__icon {
		border-color: rgba(42, 57, 198, 0.08);
		background: var(--mobile-nav-primary-soft);
		color: var(--mobile-nav-primary);
	}

	nav.mobile-bottom-nav[data-selora-mobile-nav] .mobile-bottom-nav__badge {
		position: absolute;
		top: -3px;
		right: -5px;
		z-index: 2;

		min-width: 17px;
		height: 17px;
		display: inline-flex;
		align-items: center;
		justify-content: center;
		padding: 0 4px;

		border: 2px solid rgba(255, 255, 255, 0.96);
		border-radius: 999px;
		background: var(--mobile-nav-primary);
		color: #fff;

		font-size: 8px;
		font-weight: 800;
		line-height: 1;
		box-shadow: 0 2px 6px rgba(42, 57, 198, 0.16);
	}

	.mobile-bottom-nav__spacer[data-mobile-nav-spacer] {
		display: block;
		height: calc(var(--selora-mobile-nav-clearance) + 8px);
		pointer-events: none;
	}

	@media (max-width: 370px) {
		nav.mobile-bottom-nav[data-selora-mobile-nav] {
			width: calc(100vw - 14px) !important;
			max-width: calc(100vw - 14px) !important;
			padding-inline: 3px !important;
		}

		nav.mobile-bottom-nav[data-selora-mobile-nav]
			.mobile-bottom-nav__label {
			font-size: 9px;
		}
	}

	@media (prefers-reduced-motion: reduce) {
		nav.mobile-bottom-nav[data-selora-mobile-nav] .mobile-bottom-nav__item,
		nav.mobile-bottom-nav[data-selora-mobile-nav] .mobile-bottom-nav__icon {
			transition: none !important;
		}
	}
}
