/* Main navigation — clinical rozcestník
 * Desktop: hover/focus dropdown panel + mini-mega for flagship pillars
 * Mobile: accordion + sticky bottom CTA bar (Objednat / Zavolat)
 */

.bb-nav {
	width: 100%;
	display: flex;
	align-items: center;
	justify-content: center;
	font-family: var(--wp--preset--font-family--body), sans-serif;
	font-size: 14px;
	min-width: 0;
}

.bb-nav__list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-wrap: nowrap;
	gap: 2px;
	align-items: center;
	justify-content: center;
}

@media (max-width: 1200px) {
	.bb-nav { font-size: 13px; }
	.bb-nav__list { gap: 0; }
}

.bb-nav__item {
	position: relative;
	display: inline-flex;
	align-items: center;
}

.bb-nav__link {
	position: relative;
	color: var(--wp--preset--color--dark);
	text-decoration: none;
	padding: 10px 12px;
	border-radius: 10px;
	font-weight: 500;
	letter-spacing: 0.1px;
	transition: color 0.18s ease, background 0.18s ease;
	white-space: nowrap;
}

/* Animated underline indicator — appears on hover, full width on active */
.bb-nav__link::after {
	content: '';
	position: absolute;
	left: 12px;
	right: 12px;
	bottom: 4px;
	height: 2px;
	background: var(--wp--preset--color--purple);
	border-radius: 1px;
	transform: scaleX(0);
	transform-origin: left center;
	transition: transform 0.22s ease;
}
.bb-nav__link:hover::after,
.bb-nav__link:focus-visible::after { transform: scaleX(1); }

@media (max-width: 1280px) {
	.bb-nav__link { padding: 10px 10px; }
}

@media (max-width: 1100px) {
	.bb-nav__link { padding: 9px 8px; font-size: 12.5px; }
}

.bb-nav__link:hover,
.bb-nav__link:focus-visible {
	color: var(--wp--preset--color--purple);
	background: rgba(107, 45, 123, 0.06);
}

.bb-nav__item--active > .bb-nav__link,
.bb-nav__item--active > .bb-nav__link:hover {
	color: var(--wp--preset--color--purple);
	font-weight: 600;
}
.bb-nav__item--active > .bb-nav__link::after,
.current-menu-item > .bb-nav__link::after {
	transform: scaleX(1);
}

.bb-nav__caret {
	background: transparent;
	border: 0;
	cursor: pointer;
	color: var(--wp--preset--color--text-tertiary);
	padding: 6px;
	margin-left: -6px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border-radius: 6px;
	transition: transform 0.2s ease, color 0.18s ease, background 0.18s ease;
}

.bb-nav__caret:hover,
.bb-nav__caret:focus-visible {
	color: var(--wp--preset--color--purple);
	background: rgba(107, 45, 123, 0.08);
}

.bb-nav__caret svg {
	width: 14px;
	height: 14px;
}

.bb-nav__item--has-children:hover > .bb-nav__caret,
.bb-nav__item--has-children:focus-within > .bb-nav__caret,
.bb-nav__item--open > .bb-nav__caret {
	transform: rotate(180deg);
	color: var(--wp--preset--color--purple);
}

/* ─── Submenu panel ──────────────────────────────────────── */
.bb-nav__panel {
	position: absolute;
	top: calc(100% + 6px);
	left: 0;
	min-width: 280px;
	background: #ffffff;
	border: 1px solid rgba(107, 45, 123, 0.12);
	border-top: 3px solid var(--wp--preset--color--green);
	border-radius: 12px;
	box-shadow: 0 8px 24px rgba(42, 36, 51, 0.08);
	padding: 12px 8px;
	z-index: 50;
	opacity: 0;
	transform: translateY(-4px);
	transition: opacity 0.18s ease, transform 0.18s ease;
}

.bb-nav__panel[hidden] {
	display: none;
}

.bb-nav__item--has-children:hover > .bb-nav__panel:not([hidden]),
.bb-nav__item--has-children:focus-within > .bb-nav__panel:not([hidden]),
.bb-nav__item--open > .bb-nav__panel:not([hidden]) {
	opacity: 1;
	transform: translateY(0);
}

.bb-nav__panel--mega {
	min-width: 380px;
	padding: 18px 18px 16px;
}

.bb-nav__panel-head {
	border-bottom: 1px solid rgba(0, 0, 0, 0.06);
	padding-bottom: 12px;
	margin-bottom: 8px;
}

.bb-nav__panel-title {
	display: block;
	font-family: var(--wp--preset--font-family--display), sans-serif;
	font-weight: 600;
	font-size: 16px;
	color: var(--wp--preset--color--dark);
	text-decoration: none;
	letter-spacing: -0.005em;
	margin-bottom: 6px;
}

.bb-nav__panel-title:hover {
	color: var(--wp--preset--color--purple);
}

.bb-nav__panel-desc {
	font-size: 12.5px;
	line-height: 1.55;
	color: var(--wp--preset--color--text-secondary);
	margin: 0;
}

.bb-nav__panel-overview {
	display: block;
	padding: 10px 12px;
	margin-bottom: 4px;
	font-size: 12px;
	font-weight: 600;
	letter-spacing: 0.4px;
	text-transform: uppercase;
	color: var(--wp--preset--color--text-tertiary);
	text-decoration: none;
	border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.bb-nav__panel-overview:hover { color: var(--wp--preset--color--purple); }
.bb-nav__panel-overview strong { color: var(--wp--preset--color--dark); }

.bb-nav__sublist {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 1px;
}

.bb-nav__subitem { display: block; }

.bb-nav__sublink {
	display: flex;
	align-items: center;
	gap: 10px;
	min-height: 42px;
	padding: 8px 12px;
	color: var(--wp--preset--color--dark);
	text-decoration: none;
	font-size: 13.5px;
	line-height: 1.4;
	border-radius: 8px;
	transition: background 0.18s ease, color 0.18s ease;
}

.bb-nav__sublink:hover,
.bb-nav__sublink:focus-visible {
	background: var(--wp--preset--color--purple-soft);
	color: var(--wp--preset--color--purple);
}

.bb-nav__subdot {
	width: 6px;
	height: 6px;
	border-radius: 50%;
	background: transparent;
	flex-shrink: 0;
	transition: background 0.18s ease;
}

.bb-nav__sublink:hover .bb-nav__subdot { background: var(--wp--preset--color--green); }

.bb-nav__subitem--active .bb-nav__sublink {
	color: var(--wp--preset--color--purple);
	font-weight: 600;
	background: rgba(107, 45, 123, 0.04);
}

.bb-nav__subitem--active .bb-nav__subdot {
	background: var(--wp--preset--color--green);
}

.bb-nav__panel-cta {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	margin-top: 12px;
	padding: 10px 16px;
	background: var(--wp--preset--color--purple);
	color: var(--wp--preset--color--white);
	text-decoration: none;
	font-size: 13px;
	font-weight: 600;
	border-radius: 999px;
	transition: background 0.2s ease, transform 0.15s ease;
}

.bb-nav__panel-cta:hover {
	background: var(--wp--preset--color--purple-deep);
	transform: translateY(-1px);
}

.bb-nav__panel-cta svg {
	width: 14px;
	height: 14px;
}

/* ─── Mobile toggle ──────────────────────────────────────── */
.bb-nav__toggle {
	display: none;
	background: transparent;
	border: 0;
	cursor: pointer;
	padding: 8px;
	width: 36px;
	height: 36px;
	flex-direction: column;
	gap: 5px;
	align-items: center;
	justify-content: center;
	margin-left: auto;
}

.bb-nav__toggle-bar {
	display: block;
	width: 22px;
	height: 2px;
	background: var(--wp--preset--color--dark);
	border-radius: 2px;
	transition: transform 0.25s ease, opacity 0.2s ease;
}

.bb-nav--open .bb-nav__toggle-bar:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.bb-nav--open .bb-nav__toggle-bar:nth-child(2) { opacity: 0; }
.bb-nav--open .bb-nav__toggle-bar:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ─── Sticky mobile CTA bar (only visible on small screens) ─ */
.bb-mobile-cta {
	display: none;
}

@media (max-width: 900px) {
	.bb-nav { justify-content: flex-end; }
	.bb-nav__toggle { display: inline-flex; }

	.bb-nav__list {
		display: none;
		position: absolute;
		top: 100%;
		left: 0;
		right: 0;
		background: #ffffff;
		flex-direction: column;
		gap: 0;
		padding: 8px 12px 16px;
		border-top: 3px solid var(--wp--preset--color--green);
		border-bottom: 1px solid rgba(0, 0, 0, 0.06);
		box-shadow: 0 12px 32px rgba(42, 36, 51, 0.12);
		z-index: 40;
		max-height: calc(100vh - 200px);
		overflow-y: auto;
	}

	.bb-nav--open .bb-nav__list { display: flex; }

	.bb-nav__item {
		width: 100%;
		flex-wrap: wrap;
		border-bottom: 1px solid rgba(0, 0, 0, 0.05);
	}

	.bb-nav__item:last-child { border-bottom: 0; }

	.bb-nav__link {
		flex: 1 1 auto;
		padding: 14px 12px;
		font-size: 16px;
		min-height: 48px;
		display: flex;
		align-items: center;
	}

	.bb-nav__caret {
		flex: 0 0 48px;
		min-height: 48px;
		margin-left: 0;
	}

	.bb-nav__caret svg { width: 18px; height: 18px; }

	.bb-nav__panel {
		position: static;
		flex: 1 1 100%;
		min-width: 0;
		box-shadow: none;
		border: 0;
		border-top: 1px solid rgba(0, 0, 0, 0.05);
		border-radius: 0;
		padding: 8px 4px 12px 24px;
		background: rgba(107, 45, 123, 0.025);
		opacity: 1;
		transform: none;
	}

	.bb-nav__panel--mega { min-width: 0; }

	.bb-nav__panel-head {
		padding-bottom: 8px;
		margin-bottom: 6px;
	}

	.bb-nav__panel-title { font-size: 14px; }
	.bb-nav__panel-desc { font-size: 12px; }

	.bb-nav__sublink {
		min-height: 44px;
		font-size: 14px;
	}

	.bb-mobile-cta {
		display: grid;
		grid-template-columns: 1fr 1fr;
		gap: 8px;
		position: fixed;
		bottom: 0;
		left: 0;
		right: 0;
		padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
		background: rgba(255, 255, 255, 0.96);
		backdrop-filter: blur(8px);
		border-top: 1px solid rgba(0, 0, 0, 0.06);
		box-shadow: 0 -4px 12px rgba(42, 36, 51, 0.08);
		z-index: 100;
	}

	.bb-mobile-cta__btn {
		display: inline-flex;
		align-items: center;
		justify-content: center;
		gap: 6px;
		padding: 12px 14px;
		border-radius: 999px;
		font-family: var(--wp--preset--font-family--body), sans-serif;
		font-weight: 600;
		font-size: 14px;
		text-decoration: none;
		min-height: 44px;
	}

	.bb-mobile-cta__btn--primary {
		background: var(--wp--preset--color--purple);
		color: var(--wp--preset--color--white);
	}

	.bb-mobile-cta__btn--secondary {
		background: var(--wp--preset--color--green);
		color: var(--wp--preset--color--white);
	}

	.bb-mobile-cta__btn svg { width: 16px; height: 16px; }

	body { padding-bottom: 72px; }
}
