/* ---- Magic nav: a dock of the shop's core destinations ----
   Desktop: a floating pill bar docked under the header. Phone: a fixed dock pinned to the
   bottom of the screen. One set of markup, repositioned here by media query. */

.cb-magic-nav {
	--mn-brand: var(--cb-primary, #2563eb);
	--mn-brand-d: var(--cb-primary-dark, #1d4ed8);
	--mn-glow: color-mix(in srgb, var(--mn-brand) 65%, #7dd3fc);
	--mn-ink: #0f172a;
	/* Settings -> Site design -> Colors -> Navigation bar overrides these two; left alone, the
	   dock keeps its brand-derived dark gradient exactly as before. */
	--mn-bg: var(--cb-nav-bg, color-mix(in srgb, var(--mn-brand) 38%, #0b1120));
	--mn-bg2: var(--cb-nav-bg2, color-mix(in srgb, var(--mn-brand-d) 32%, #0b1120));
	position: relative;
	z-index: 1;
	display: flex;
	align-items: flex-end;
	justify-content: center;
	gap: 6px;
	width: fit-content;
	max-width: calc(100vw - 24px);
	margin: 10px auto 14px;
	padding: 10px 14px 8px;
	background: linear-gradient(145deg, var(--mn-bg), var(--mn-bg2));
	border-radius: 999px;
	box-shadow:
		0 16px 34px -18px rgba(8, 11, 24, 0.65),
		inset 0 0 0 1px color-mix(in srgb, var(--mn-brand) 45%, rgba(255, 255, 255, 0.18)),
		inset 0 1px 0 rgba(255, 255, 255, 0.1);
	backdrop-filter: blur(10px);
	overflow-x: auto;
	overflow-y: visible;
	scrollbar-width: none;
}
.cb-magic-nav::-webkit-scrollbar { display: none; }

.cb-magic-item {
	position: relative;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 2px;
	flex: none;
	width: 56px;
	padding: 8px 4px 7px;
	border-radius: 18px;
	color: rgba(255, 255, 255, 0.72);
	text-decoration: none;
	cursor: pointer;
	transition: transform 0.32s cubic-bezier(0.3, 1.5, 0.4, 1), color 0.2s ease, background 0.25s ease;
}
.cb-magic-item:hover,
.cb-magic-item:focus-visible {
	color: #fff;
	background: rgba(255, 255, 255, 0.1);
}
.cb-magic-item:focus-visible { outline: 2px solid var(--mn-glow); outline-offset: 2px; }

.cb-magic-icon {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 34px;
	height: 34px;
}
.cb-magic-icon svg { width: 22px; height: 22px; transition: transform 0.3s cubic-bezier(0.3, 1.6, 0.4, 1); }

.cb-magic-count {
	position: absolute;
	top: -4px;
	right: -6px;
	min-width: 16px;
	height: 16px;
	padding: 0 4px;
	border-radius: 999px;
	background: #ef4444;
	color: #fff;
	font: 700 10px/16px -apple-system, "Segoe UI", sans-serif;
	text-align: center;
	box-shadow: 0 0 0 2px rgba(15, 23, 42, 0.92);
}

.cb-magic-label {
	max-width: 0;
	overflow: hidden;
	white-space: nowrap;
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.01em;
	opacity: 0;
	transform: translateY(2px);
	transition: max-width 0.3s ease, opacity 0.25s ease, transform 0.25s ease;
}

/* ---- the magic: lift + neon glow + dots, on the active destination and on hover ---- */
.cb-magic-item.is-active,
.cb-magic-item:hover,
.cb-magic-item:focus-visible {
	transform: translateY(-9px);
}
.cb-magic-item.is-active .cb-magic-icon,
.cb-magic-item:hover .cb-magic-icon,
.cb-magic-item:focus-visible .cb-magic-icon {
	color: #fff;
}
.cb-magic-item.is-active .cb-magic-icon svg,
.cb-magic-item:hover .cb-magic-icon svg,
.cb-magic-item:focus-visible .cb-magic-icon svg {
	filter: drop-shadow(0 0 7px var(--mn-glow)) drop-shadow(0 0 14px color-mix(in srgb, var(--mn-glow) 60%, transparent));
	transform: scale(1.08);
}
/* the truly active item gets its own bright capsule, not just a glow, so it's obvious at a glance */
.cb-magic-item.is-active .cb-magic-icon {
	background: #fff;
	border-radius: 50%;
	color: var(--mn-brand);
}
.cb-magic-item.is-active .cb-magic-icon svg {
	filter: none;
	color: var(--mn-brand);
}
.cb-magic-item.is-active .cb-magic-label,
.cb-magic-item:hover .cb-magic-label,
.cb-magic-item:focus-visible .cb-magic-label {
	max-width: 90px;
	opacity: 1;
	transform: none;
}
.cb-magic-item.is-active .cb-magic-icon::after,
.cb-magic-item:hover .cb-magic-icon::after,
.cb-magic-item:focus-visible .cb-magic-icon::after {
	content: "";
	position: absolute;
	inset: -5px;
	border-radius: 50%;
	background: color-mix(in srgb, var(--mn-brand) 35%, transparent);
	filter: blur(6px);
	z-index: -1;
	animation: cb-magic-pulse 1.8s ease-in-out infinite;
}

/* the orbiting dots, only on the truly active (not merely hovered) item, so the dock stays calm */
.cb-magic-dots { position: absolute; inset: -6px; pointer-events: none; opacity: 0; transition: opacity 0.3s ease; }
.cb-magic-item.is-active .cb-magic-dots { opacity: 1; }
.cb-magic-dots i {
	position: absolute;
	top: 50%;
	left: 50%;
	width: 3px;
	height: 3px;
	border-radius: 50%;
	background: var(--mn-glow);
	box-shadow: 0 0 6px 1px var(--mn-glow);
	transform-origin: 0 0;
	animation: cb-magic-orbit 3.6s linear infinite;
}
.cb-magic-dots i:nth-child(1) { animation-delay: 0s; }
.cb-magic-dots i:nth-child(2) { animation-delay: -1.2s; }
.cb-magic-dots i:nth-child(3) { animation-delay: -2.4s; }

@keyframes cb-magic-pulse {
	0%, 100% { opacity: 0.55; }
	50% { opacity: 0.95; }
}
@keyframes cb-magic-orbit {
	from { transform: rotate(0deg) translateX(26px) rotate(0deg); }
	to { transform: rotate(360deg) translateX(26px) rotate(-360deg); }
}

/* ---- alternate styles (Settings -> Site design -> Colors -> Navigation bar -> Style) ---- */

/* Glass: a translucent, blurred bar that picks up whatever is behind it, rather than a solid
   brand-coloured capsule. Icons default to a dark, muted tone (readable on most light/photo
   headers); the active item keeps the same white-capsule treatment the pill style uses. */
.cb-magic-nav-glass {
	background: rgba(255, 255, 255, 0.22);
	box-shadow: 0 10px 30px -14px rgba(15, 23, 42, 0.35), inset 0 0 0 1px rgba(255, 255, 255, 0.4);
	backdrop-filter: blur(20px) saturate(160%);
}
.cb-magic-nav-glass .cb-magic-item { color: rgba(15, 23, 42, 0.55); }
.cb-magic-nav-glass .cb-magic-item:hover,
.cb-magic-nav-glass .cb-magic-item:focus-visible { color: #0f172a; background: rgba(255, 255, 255, 0.35); }
.cb-magic-nav-glass .cb-magic-item:hover .cb-magic-icon,
.cb-magic-nav-glass .cb-magic-item:focus-visible .cb-magic-icon { color: #0f172a; }

/* Minimal: a plain light bar, no capsule or glow — the active item is just a coloured icon
   with a short underline, closer to a conventional tab bar. */
.cb-magic-nav-minimal {
	background: #fff;
	box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06), inset 0 0 0 1px #e7eaf0;
	backdrop-filter: none;
	padding: 6px 10px;
}
.cb-magic-nav-minimal .cb-magic-item { color: #64748b; border-radius: 12px; }
.cb-magic-nav-minimal .cb-magic-item.is-active,
.cb-magic-nav-minimal .cb-magic-item:hover,
.cb-magic-nav-minimal .cb-magic-item:focus-visible { transform: none; background: #f8fafc; }
.cb-magic-nav-minimal .cb-magic-item.is-active .cb-magic-icon,
.cb-magic-nav-minimal .cb-magic-item:hover .cb-magic-icon,
.cb-magic-nav-minimal .cb-magic-item:focus-visible .cb-magic-icon {
	background: transparent;
	border-radius: 0;
	color: var(--mn-brand);
}
.cb-magic-nav-minimal .cb-magic-item.is-active .cb-magic-icon svg,
.cb-magic-nav-minimal .cb-magic-item:hover .cb-magic-icon svg,
.cb-magic-nav-minimal .cb-magic-item:focus-visible .cb-magic-icon svg { filter: none; transform: none; }
.cb-magic-nav-minimal .cb-magic-icon::after { content: none; }
.cb-magic-nav-minimal .cb-magic-dots { display: none; }
.cb-magic-nav-minimal .cb-magic-item.is-active::after {
	content: "";
	position: absolute;
	left: 16px;
	right: 16px;
	bottom: 3px;
	height: 2px;
	border-radius: 2px;
	background: var(--mn-brand);
}

/* ---- phone: pin it to the bottom as a dock, full-width ---- */
@media (max-width: 767px) {
	.cb-magic-nav {
		position: fixed;
		top: auto;
		bottom: 0;
		left: 0;
		right: 0;
		z-index: 60;
		width: 100%;
		max-width: none;
		margin: 0;
		padding: 8px max(10px, env(safe-area-inset-left)) calc(8px + env(safe-area-inset-bottom)) max(10px, env(safe-area-inset-right));
		border-radius: 20px 20px 0 0;
		justify-content: space-between;
		box-shadow: 0 -10px 30px -10px rgba(15, 23, 42, 0.45);
	}
	.cb-magic-item { width: auto; flex: 1 1 0; }
	.cb-magic-item.is-active,
	.cb-magic-item:hover,
	.cb-magic-item:focus-visible { transform: translateY(-5px); }
	/* no room to spare at the bottom of a phone screen for the hover-only label everywhere */
	.cb-magic-label { font-size: 10px; }
	/* room at the foot of every page so the fixed dock never covers the last bit of content */
	body { padding-bottom: calc(64px + env(safe-area-inset-bottom)); }
}
@media (min-width: 768px) {
	.cb-magic-nav { margin-top: -1px; }
}

@media (prefers-reduced-motion: reduce) {
	.cb-magic-item,
	.cb-magic-icon svg,
	.cb-magic-label { transition: none !important; }
	.cb-magic-item.is-active,
	.cb-magic-item:hover,
	.cb-magic-item:focus-visible { transform: none; }
	.cb-magic-dots i { animation: none; }
	.cb-magic-item.is-active .cb-magic-icon::after { animation: none; opacity: 0.8; }
}
