/* =========================================================
   AUTONEER ORDERS – SUPPLIER NAVIGATION
   Desktop (>= 992px): fixed, collapsible left sidebar
   (adapted from AUTONEER-PWA leftnavbar).
   Mobile (< 992px): compact fixed top bar + Bootstrap 5
   offcanvas panel (offcanvas-lg in navigation.hbs).
   ========================================================= */

/* ============================================
   MOBILE TOP BAR
   ============================================ */

.app-topbar {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	height: var(--au-topbar-h);
	display: flex;
	align-items: center;
	gap: var(--au-space-3);
	padding: 0 var(--au-space-3);
	background-color: var(--au-slate);
	color: var(--au-text-on-dark);
	z-index: 1040;
	box-shadow: var(--au-shadow-sm);
}

.app-topbar__menu {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	border: 1px solid rgba(255, 255, 255, 0.5);
	border-radius: var(--au-radius-sm);
	background: transparent;
	color: var(--au-text-on-dark);
	font-size: 22px;
	line-height: 1;
	cursor: pointer;
}

.app-topbar__brand {
	display: flex;
	align-items: center;
	gap: var(--au-space-2);
	color: var(--au-text-on-dark);
	text-decoration: none;
	font-size: var(--au-font-size-lg);
	font-weight: 600;
	min-width: 0;
}

.app-topbar__brand:hover,
.app-topbar__brand:focus {
	color: var(--au-text-on-dark);
}

.app-topbar__brand img {
	height: 32px;
	width: auto;
}

.app-topbar__brand-text {
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

/* ============================================
   SIDEBAR / OFFCANVAS PANEL
   The element uses Bootstrap's .offcanvas-lg:
   below lg Bootstrap turns it into a slide-in
   panel; at lg+ it renders inline and the rules
   below pin it as a fixed sidebar.
   ============================================ */

.supplier-nav {
	background-color: var(--au-bg-alt);
	border-right: 1px solid var(--au-border-strong);
}

.supplier-nav .offcanvas-header {
	background-color: var(--au-slate);
	color: var(--au-text-on-dark);
}

.supplier-nav .offcanvas-header .btn-close {
	filter: invert(1) grayscale(100%) brightness(200%);
}

.supplier-nav__brand {
	display: flex;
	align-items: center;
	gap: var(--au-space-2);
	font-weight: 600;
	color: var(--au-text-on-dark);
}

.supplier-nav__brand img {
	height: 34px;
	width: auto;
}

.supplier-nav__body {
	display: flex;
	flex-direction: column;
	height: 100%;
	padding: 0;
}

/* Desktop-only brand block at the top of the sidebar */
.supplier-nav__identity {
	display: none;
}

.supplier-nav__items {
	display: flex;
	flex-direction: column;
	flex: 1 1 auto;
	overflow-y: auto;
	overflow-x: hidden;
	padding: var(--au-space-2) 0;
	padding-right: 3px;
}

/* ============================================
   NAV LINKS
   ============================================ */

.supplier-nav__link {
	position: relative;
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 12px;
	min-height: 44px;
	margin-bottom: 4px;
	background-color: var(--au-bg);
	color: var(--au-text);
	text-decoration: none;
	font-size: var(--au-font-size);
	text-align: left;
	transition: background-color 0.2s ease, border-radius 0.2s ease;
}

.supplier-nav__link i {
	font-size: var(--au-font-size-lg);
	flex-shrink: 0;
}

.supplier-nav__link:hover,
.supplier-nav__link:focus-visible {
	background-color: var(--au-border-strong);
	color: var(--au-text);
	border-radius: 0 15px 15px 0;
}

.supplier-nav__link.active {
	background: var(--au-nav-active-gradient);
	color: var(--au-text-on-dark);
	border-radius: 0 15px 15px 0;
	box-shadow: 0 0 2px rgba(0, 0, 0, 0.5);
	margin-right: 2px;
}

.supplier-nav__label {
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	transition: max-width 0.2s ease, opacity 0.2s ease;
}

.supplier-nav__count {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 1.6rem;
	height: 1.35rem;
	margin-left: auto;
	padding: 0 0.4rem;
	border-radius: 999px;
	background: var(--au-border-strong);
	color: var(--au-text-on-dark);
	font-size: var(--au-font-size-sm);
	font-weight: 700;
	line-height: 1;
	flex-shrink: 0;
}

.supplier-nav__count[hidden] {
	display: none;
}

.supplier-nav__count--active,
.supplier-nav__link.active .supplier-nav__count--active {
	background: var(--au-success);
	color: var(--au-text-on-dark);
}

/* ============================================
   DESKTOP SIDEBAR (lg and up)
   ============================================ */

@media (min-width: 992px) {
	.supplier-nav {
		position: fixed;
		top: 0;
		left: 0;
		bottom: 0;
		width: var(--au-sidebar-w);
		z-index: 1030;
		transition: width 0.2s ease;
	}

	.supplier-nav__identity {
		display: flex;
		flex-direction: column;
		align-items: center;
		gap: var(--au-space-1);
		padding: var(--au-space-4) var(--au-space-2);
		border-bottom: 1px solid var(--au-border-strong);
	}

	.supplier-nav__identity img {
		height: 48px;
		width: auto;
		max-width: 100%;
		object-fit: contain;
	}

	.left-navbar-collapsed .supplier-nav__identity {
		padding-left: var(--au-space-1);
		padding-right: var(--au-space-1);
		overflow: hidden;
	}

	.left-navbar-collapsed .supplier-nav__identity img {
		height: 28px;
	}

	.supplier-nav__identity-text {
		font-size: var(--au-font-size-sm);
		font-weight: 600;
		color: var(--au-slate);
		letter-spacing: 0.06em;
		text-transform: uppercase;
		white-space: nowrap;
		overflow: hidden;
	}

	/* Collapse toggle (desktop only) */
	.supplier-nav__toggle {
		display: flex;
		align-items: center;
		justify-content: center;
		width: 26px;
		height: 26px;
		position: absolute;
		bottom: 12px;
		left: 100%;
		transform: translateX(-50%);
		background-color: var(--au-slate);
		color: var(--au-text-on-dark);
		border: 1px solid #fff;
		border-radius: 999px;
		box-shadow: 1px 2px 3px rgba(0, 0, 0, 0.5);
		cursor: pointer;
		z-index: 2;
		transition: background-color 0.15s ease;
	}

	.supplier-nav__toggle:hover {
		background-color: var(--au-gold);
	}

	/* Collapsed state (class stored on <html>) */
	.left-navbar-collapsed .supplier-nav {
		width: var(--au-sidebar-w-collapsed);
	}

	.left-navbar-collapsed .supplier-nav__label,
	.left-navbar-collapsed .supplier-nav__identity-text {
		max-width: 0;
		opacity: 0;
		overflow: hidden;
	}

	.left-navbar-collapsed .supplier-nav__link {
		justify-content: center;
		gap: 2px;
		padding-left: 0;
		padding-right: 0;
	}

	.left-navbar-collapsed .supplier-nav__count {
		position: absolute;
		top: 3px;
		right: 3px;
		min-width: 1.15rem;
		height: 1.15rem;
		padding: 0 0.25rem;
		font-size: 0.65rem;
	}

	.left-navbar-collapsed .supplier-nav__toggle i {
		transform: rotate(180deg);
	}
}

@media (max-width: 991.98px) {
	.supplier-nav__toggle {
		display: none;
	}
}
