/* FirmaJet — Mobile drawer + bottom navigation */

:root {
	--fj-bottom-nav-h: 76px;
}

/* ── Hamburger icon ── */
.fj-header__toggle {
	position: relative;
	z-index: 2;
	padding: 0;
	border: 1px solid var(--fj-color-border);
	background: var(--fj-color-bg);
}

.fj-header__toggle-icon {
	display: flex;
	flex-direction: column;
	justify-content: center;
	gap: 5px;
	width: 18px;
	height: 18px;
}

.fj-header__toggle-icon span {
	display: block;
	height: 2px;
	width: 100%;
	background: currentColor;
	border-radius: 1px;
	transition: transform 0.25s ease, opacity 0.2s ease;
}

.fj-nav-open .fj-header__toggle-icon span:nth-child(1) {
	transform: translateY(7px) rotate(45deg);
}

.fj-nav-open .fj-header__toggle-icon span:nth-child(2) {
	opacity: 0;
}

.fj-nav-open .fj-header__toggle-icon span:nth-child(3) {
	transform: translateY(-7px) rotate(-45deg);
}

.fj-header__account-text {
	display: none;
}

@media (min-width: 480px) {
	.fj-header__account-text {
		display: inline;
	}
}

/* ── Mobile drawer (fixed: class-based, not hidden attr) ── */
.fj-mobile-nav {
	position: fixed;
	inset: 0;
	z-index: 1200;
	visibility: hidden;
	pointer-events: none;
}

.fj-mobile-nav.is-open {
	visibility: visible;
	pointer-events: auto;
}

.fj-mobile-nav__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(15, 23, 42, 0.55);
	opacity: 0;
	transition: opacity 0.3s ease;
}

.fj-mobile-nav.is-open .fj-mobile-nav__backdrop {
	opacity: 1;
}

.fj-mobile-nav__panel {
	position: absolute;
	top: 0;
	right: 0;
	bottom: 0;
	width: min(360px, 92vw);
	display: flex;
	flex-direction: column;
	background: var(--fj-color-bg);
	box-shadow: -8px 0 32px rgba(15, 23, 42, 0.15);
	transform: translateX(100%);
	transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
	overflow: hidden;
}

.fj-mobile-nav.is-open .fj-mobile-nav__panel {
	transform: translateX(0);
}

.fj-mobile-nav__pattern {
	opacity: 0.04;
}

.fj-mobile-nav__header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.75rem;
	padding: 1rem 1rem 0.75rem;
	border-bottom: 1px solid var(--fj-color-border-light);
	position: relative;
	z-index: 1;
}

.fj-mobile-nav__brand {
	display: flex;
	align-items: center;
	min-width: 0;
	color: var(--fj-color-text);
}

.fj-mobile-nav__brand img {
	max-height: 36px;
	width: auto;
}

.fj-logo--drawer {
	font-size: 0.9375rem;
}

.fj-mobile-nav__close {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	padding: 0;
	border: none;
	background: var(--fj-color-bg-alt);
	border-radius: var(--fj-radius-sm);
	cursor: pointer;
	color: var(--fj-color-text);
	flex-shrink: 0;
}

.fj-mobile-nav__close-icon {
	position: relative;
	width: 16px;
	height: 16px;
}

.fj-mobile-nav__close-icon::before,
.fj-mobile-nav__close-icon::after {
	content: "";
	position: absolute;
	top: 50%;
	left: 0;
	width: 100%;
	height: 2px;
	background: currentColor;
	border-radius: 1px;
}

.fj-mobile-nav__close-icon::before {
	transform: translateY(-50%) rotate(45deg);
}

.fj-mobile-nav__close-icon::after {
	transform: translateY(-50%) rotate(-45deg);
}

.fj-mobile-nav__user {
	padding: 0.875rem 1rem;
	border-bottom: 1px solid var(--fj-color-border-light);
	position: relative;
	z-index: 1;
}

.fj-mobile-nav__user-card {
	display: flex;
	align-items: center;
	gap: 0.625rem;
	margin-bottom: 0.625rem;
}

.fj-mobile-nav__avatar {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	background: var(--fj-color-primary-light);
	color: var(--fj-color-primary);
	border-radius: var(--fj-radius-sm);
}

.fj-mobile-nav__user-card strong {
	display: block;
	font-size: 0.9375rem;
}

.fj-mobile-nav__user-card span {
	font-size: 0.75rem;
	color: var(--fj-color-text-muted);
}

.fj-mobile-nav__auth {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 0.5rem;
}

.fj-mobile-nav__body {
	flex: 1;
	overflow-y: auto;
	padding: 0.5rem 0;
	position: relative;
	z-index: 1;
}

.fj-mobile-nav__list {
	list-style: none;
	margin: 0;
	padding: 0;
}

.fj-mobile-nav__list > li > a {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	padding: 0.875rem 1rem;
	font-size: 1rem;
	font-weight: 600;
	color: var(--fj-color-text);
	border-bottom: 1px solid var(--fj-color-border-light);
	transition: background var(--fj-transition), color var(--fj-transition);
}

.fj-mobile-nav__list > li > a:hover,
.fj-mobile-nav__list > .current-menu-item > a {
	background: var(--fj-color-primary-light);
	color: var(--fj-color-primary);
}

.fj-mobile-nav__footer {
	padding: 0.875rem 1rem calc(0.875rem + env(safe-area-inset-bottom, 0px));
	border-top: 1px solid var(--fj-color-border-light);
	position: relative;
	z-index: 1;
}

body.fj-nav-open {
	overflow: hidden;
}

/* Override legacy hidden-based rules */
.fj-mobile-nav[hidden] {
	display: block !important;
}

/* ── Bottom navigation (pill dock) ── */
.fj-bottom-nav {
	--fj-bn-radius: 999px;
	--fj-bn-pad: 0.35rem;
	position: fixed;
	left: 0;
	right: 0;
	bottom: 0;
	z-index: 1100;
	display: none;
	justify-content: center;
	align-items: flex-end;
	pointer-events: none;
	padding: 0 0.5rem calc(0.55rem + env(safe-area-inset-bottom, 0px));
	background: transparent;
	border: 0;
	box-shadow: none;
	min-height: 0;
}

.fj-bottom-nav__dock {
	pointer-events: auto;
	display: flex;
	align-items: stretch;
	gap: 0.25rem;
	width: min(calc(100vw - 1rem), 520px);
	max-width: none;
	min-width: 0;
	height: 56px;
	padding: var(--fj-bn-pad);
	border-radius: var(--fj-bn-radius);
	background: #fff;
	border: 1px solid rgba(15, 23, 42, 0.08);
	box-shadow:
		0 10px 30px rgba(15, 23, 42, 0.14),
		0 1px 0 rgba(255, 255, 255, 0.9) inset;
}

.fj-bottom-nav--glass .fj-bottom-nav__dock {
	background: rgba(255, 255, 255, 0.92);
	backdrop-filter: blur(18px) saturate(1.25);
	-webkit-backdrop-filter: blur(18px) saturate(1.25);
}

.fj-bottom-nav--solid .fj-bottom-nav__dock {
	background: #ffffff;
	backdrop-filter: none;
	-webkit-backdrop-filter: none;
}

.fj-bottom-nav--dark .fj-bottom-nav__dock {
	background: rgba(17, 24, 39, 0.96);
	border-color: rgba(255, 255, 255, 0.1);
	box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
}

.fj-bottom-nav--dark .fj-bottom-nav__item {
	color: rgba(255, 255, 255, 0.62);
}

.fj-bottom-nav--dark .fj-bottom-nav__item:hover,
.fj-bottom-nav--dark .fj-bottom-nav__item.is-active {
	color: #fff;
	background: rgba(255, 255, 255, 0.1);
}

.fj-bottom-nav--dark .fj-bottom-nav__item.is-active {
	background: rgba(220, 38, 38, 0.22);
	color: #fecaca;
}

body.fj-has-bottom-nav .fj-bottom-nav {
	display: flex;
}

body.fj-has-bottom-nav {
	padding-bottom: calc(var(--fj-bottom-nav-h) + env(safe-area-inset-bottom, 0px));
}

body.fj-has-bottom-nav.fj-nav-open {
	padding-bottom: 0;
}

.fj-bottom-nav__item {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0;
	position: relative;
	flex: 1 1 0;
	height: auto;
	min-width: 0;
	min-height: 0;
	max-height: none;
	padding: 0 0.65rem;
	margin: 0;
	font-family: inherit;
	font-size: 0.75rem;
	font-weight: 650;
	line-height: 1;
	letter-spacing: -0.01em;
	color: #64748b;
	background: transparent;
	border: none;
	border-radius: var(--fj-bn-radius);
	text-decoration: none !important;
	cursor: pointer;
	transition:
		background 0.2s ease,
		color 0.2s ease,
		transform 0.15s ease,
		gap 0.2s ease,
		flex-grow 0.28s cubic-bezier(0.22, 1, 0.36, 1);
	-webkit-tap-highlight-color: transparent;
}

.fj-bottom-nav__item:active {
	transform: scale(0.97);
}

.fj-bottom-nav__item:hover {
	background: #f1f5f9;
	color: #0f172a;
}

.fj-bottom-nav__item.is-active {
	flex: 1.55 1 0;
	background: color-mix(in srgb, var(--fj-color-primary, #dc2626) 12%, transparent);
	color: var(--fj-color-primary, #dc2626);
	gap: 0.4rem;
	padding-left: 0.75rem;
	padding-right: 0.85rem;
	border-radius: 50px;
}

.fj-bottom-nav__item--cta:not(.is-active) .fj-bottom-nav__icon {
	width: 34px;
	height: 34px;
	border-radius: var(--fj-bn-radius);
	background: var(--fj-color-primary, #dc2626);
	color: #fff;
	box-shadow: 0 4px 12px rgba(220, 38, 38, 0.28);
}

.fj-bottom-nav__item--cta:not(.is-active) .fj-bottom-nav__icon .lucide {
	width: 18px;
	height: 18px;
	stroke-width: 2.25;
}

.fj-bottom-nav__item--cta.is-active {
	background: var(--fj-color-primary, #dc2626);
	color: #fff;
	border-radius: 50px;
}

.fj-bottom-nav__item--cta.is-active .fj-bottom-nav__icon {
	background: transparent;
	box-shadow: none;
	color: #fff;
}

.fj-bottom-nav__icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	width: 22px;
	height: 22px;
	line-height: 0;
}

.fj-bottom-nav__icon .lucide,
.fj-bottom-nav__icon svg {
	width: 22px;
	height: 22px;
	stroke-width: 1.85;
}

.fj-bottom-nav__label-wrap {
	display: grid;
	grid-template-columns: 0fr;
	opacity: 0;
	overflow: hidden;
	transition:
		grid-template-columns 0.28s cubic-bezier(0.22, 1, 0.36, 1),
		opacity 0.18s ease;
}

.fj-bottom-nav__item.is-active .fj-bottom-nav__label-wrap {
	grid-template-columns: 1fr;
	opacity: 1;
}

.fj-bottom-nav__label {
	min-width: 0;
	max-width: 5.25rem;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	font-size: 0.72rem;
	font-weight: 650;
	line-height: 1.2;
	user-select: none;
}

/* Auth pages keep bottom nav (same as other public pages) */

@media (min-width: 1024px) {
	.fj-bottom-nav {
		display: none !important;
	}

	body.fj-has-bottom-nav {
		padding-bottom: 0;
	}

	.fj-header__toggle {
		display: none !important;
	}
}

@media (prefers-reduced-motion: reduce) {
	.fj-bottom-nav__item,
	.fj-bottom-nav__label-wrap {
		transition: none;
	}
}

@media (max-width: 1023px) {
	.fj-header__account,
	.fj-header__actions > .fj-btn--primary {
		display: none !important;
	}

	.fj-header__toggle {
		display: flex !important;
	}
}

/* Company single keeps its own bar */
body.single-firmajet_company.fj-has-bottom-nav {
	padding-bottom: 0;
}

body.single-firmajet_company .fj-bottom-nav {
	display: none !important;
}

/* Top bar styles moved to assets/css/hero.css (.fj-tbar) */

body.fj-auth-page .fj-topbar,
body.fj-crm-page .fj-topbar {
	display: none;
}
