/* --------------------------------------------------------------------------
   6. Nested Navigation (Built-in Appliances)
   The nested dropdown replaces the main nav bar instead of opening below it.
   -------------------------------------------------------------------------- */

/* The nested dropdown overlays the main nav bar */
.niu-nav-mega-dropdown--nested {
	top: 0 !important;
	left: 0 !important;
	right: 0 !important;
	bottom: auto;
	border-radius: 0;
	box-shadow: none;
	z-index: 1001;
	overflow: visible;
	/* height: 60px; */
	/* border: 2px solid red; */
	max-width: 1330px;
}

/* When active or moved to container, animate in */
.niu-nav-top-item--active > .niu-nav-mega-dropdown--nested,
.niu-nav-menu__container > .niu-nav-mega-dropdown--nested {
	opacity: 1;
	visibility: visible;
	transform: none;
	position: relative;
	width: 100%;
	animation: niuNestedBarIn 0.4s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes niuNestedBarIn {
	from {
		opacity: 0;
		max-width: 200px;
	}
	to {
		opacity: 1;
		max-width: 1330px;
	}
}

.niu-nav-mega-dropdown--nested .niu-nav-mega-dropdown__inner {
	padding: 0;
	flex-direction: column;
	gap: 0;
}

/* Secondary nav bar - replaces the main top bar */
.niu-nav-nested-bar {
	background: #fff;
	border-top: 1px solid #eaeaea;
	box-shadow: 0 4px 12px 0 rgba(0, 0, 0, 0.08);
	padding: 8px 0;
}

.niu-nav-nested-bar__list {
	display: flex;
	list-style: none;
	margin: 0;
	padding: 0;
	overflow-x: auto;
	white-space: nowrap;
	scrollbar-width: none;
	align-items: center;
	height: 45px;
}

.niu-nav-nested-bar__list::-webkit-scrollbar {
	display: none;
}

.niu-nav-nested-bar__item {
	flex-shrink: 0;
	position: static;
	display: flex;
	align-items: center;
	height: 100%;
}

.niu-nav-nested-bar__link {
	display: flex;
	align-items: center;
	gap: 4px;
	padding: 0 12px;
	height: 100%;
	font-family: 'Gotham', sans-serif;
	font-size: 13px;
	font-weight: 500;
	color: #1E1E1C;
	text-decoration: none;
	overflow:visible;
	border-bottom: 2px solid transparent;
	transition: color 0.2s ease, border-color 0.2s ease;
	box-sizing: border-box;
}

.niu-nav-nested-bar__link:hover,
.niu-nav-nested-bar__link:focus {
	color: #e41b1c;
	text-decoration: none;
	outline: none;
}

/* Only show red border on items that have a panel */
.niu-nav-nested-bar__item--has-panel:hover > .niu-nav-nested-bar__link,
.niu-nav-nested-bar__item--has-panel > .niu-nav-nested-bar__link:focus {
	border-bottom-color: #e41b1c;
}

/* No border on items without panels */
.niu-nav-nested-bar__item:not(.niu-nav-nested-bar__item--has-panel) > .niu-nav-nested-bar__link {
	border-bottom-color: transparent !important;
}

.niu-nav-nested-bar__item--active > .niu-nav-nested-bar__link {
	color: #e41b1c;
	border-bottom-color: #e41b1c;
}

/* .niu-nav-nested-bar__item.niu-nav-nested-bar__item--back {
	margin-right: -8px;
} */

.niu-nav-nested-bar__item--back {
	position: sticky;
	left: 0;
	z-index: 4;
	background: #fff;
}

.niu-nav-nested-bar__item--back .niu-nav-nested-bar__link {
	color: #A5A5A5;
	font-weight: 400;
	font-size: 13px;
	gap: 8px;
	font-family: inter;
	border-bottom: none;
}

.niu-nav-nested-bar__item--back .niu-nav-nested-bar__link:hover {
	color: #e41b1c;
}

/* "Built-In Appliances >" label — scrolls under the back button */
.niu-nav-nested-bar__item--label {
	margin-right: 12px;
	border-right: 1px solid #eaeaea;
	padding-right: 12px;
	z-index: 2;
}

.niu-nav-nested-bar__item--label .niu-nav-nested-bar__link {
	white-space: nowrap;
	border-radius: 4px;
	background: rgba(229, 231, 235, 0.40);
	display: flex;
	flex-direction: row;
	align-items: center;
	padding: 10px 16px;
	gap: 6px;
	color: #1e1e1c;
	font-family: 'Gotham', sans-serif;
	font-size: 13px;
	font-weight: 500;
	line-height: 19.5px;
	height: auto;
	border-bottom: none;
}

.niu-nav-nested-chevron {
	font-size: 8px;
	transition: transform 0.2s ease;
}

.niu-nav-nested-bar__item--active .niu-nav-nested-chevron {
	transform: rotate(180deg);
}

/* Nested panels (tab content) — dropdown below secondary bar */
.niu-nav-nested-panel {
	display: none;
	position: absolute;
	left: 0;
	right: 0;
	top: 100%;
	background: #fff;
	padding: 30px 30px 12px;
	border-radius: 8px;
	box-shadow: 0 8px 40px rgba(0, 0, 0, 0.12);
	z-index: 998;
}

.niu-nav-nested-bar__item--active > .niu-nav-nested-panel {
	display: block;
}

/* Nested panel inner flex row (categories + slider side by side) */
.niu-nav-nested-panel__row {
	display: flex;
	gap: 30px;
	flex-wrap: nowrap;
}
