/* Naildaze Mega Panel — 桌面左右分栏 Tab，移动端隐藏面板走原生手风琴 */
@media (max-width: 782px) {
	.nd-mega__panel-wrap { display: none !important; }
}
@media (min-width: 783px) {
	/* 顶级 li 做定位锚；主题已把 desktop nav 设 static，这里只保证面板能居中 */
	nav.header-desktop-nav li.nd-mega { position: static !important; }
	/* 桌面隐藏原生嵌套 ul，只看面板 */
	nav.header-desktop-nav li.nd-mega > ul.wp-block-navigation__submenu-container { display: none !important; }

	.nd-mega__panel-wrap {
		display: none;
		position: absolute;
		top: 100%;
		left: 50%;
		transform: translateX(-50%);
		width: var(--nd-mega-width, 720px);
		max-width: min(92vw, 860px);
		z-index: 200;
		padding-top: 0;
		margin-top: -1px;
	}
	/* 隐形桥：盖住触发项和面板之间的空隙，鼠标下滑不断层 */
	.nd-mega__panel-wrap::before {
		content: "";
		display: block;
		height: 22px;
		margin-top: -22px;
		background: transparent;
	}
	/* hover / 键盘聚焦 / JS 展开态都可打开（JS 带延迟关闭，防抖） */
	li.nd-mega:hover > .nd-mega__panel-wrap,
	li.nd-mega:focus-within > .nd-mega__panel-wrap,
	li.nd-mega.is-open > .nd-mega__panel-wrap { display: block; }

	.nd-mega__panel {
		display: grid;
		grid-template-columns: 220px 1fr 190px;
		gap: 0;
		background: #fff;
		border: 1px solid var(--wp--preset--color--border-light, #eee);
		border-radius: 0;
		box-shadow: 0 18px 50px rgba(0, 0, 0, .14);
		overflow: hidden;
		padding: 12px;
	}
	/* 无促销卡时退化为两列 */
	.nd-mega__panel-wrap:not(:has(.nd-mega__promo)) .nd-mega__panel { grid-template-columns: 220px 1fr; }

	.nd-mega__tabs {
		display: flex;
		flex-direction: column;
		gap: 2px;
		border-right: 1px solid var(--wp--preset--color--border-light, #eee);
		padding-right: 10px;
	}
	.nd-mega__tab {
		display: flex;
		align-items: center;
		justify-content: space-between;
		gap: 8px;
		width: 100%;
		padding: 11px 12px;
		border: 0;
		border-radius: 0;
		background: transparent;
		cursor: pointer;
		font-size: .78rem;
		font-weight: 600;
		letter-spacing: 1px;
		text-transform: uppercase;
		color: var(--wp--preset--color--main, #1e1e26);
		text-align: left;
	}
	.nd-mega__tab:hover { background: #f6f6f8; }
	.nd-mega__tab.is-active {
		background: #f1efff;
		color: #6c5ce7;
	}
	.nd-mega__tab-chev { display: inline-flex; opacity: .7; }
	.nd-mega__tab.is-active .nd-mega__tab-chev svg { transform: rotate(180deg); }

	.nd-mega__panels { padding: 4px 6px 4px 18px; min-width: 0; max-height: 340px; overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; }
	.nd-mega__panels::-webkit-scrollbar { width: 6px; }
	.nd-mega__panels::-webkit-scrollbar-thumb { background: #d5d5db; border-radius: 0; }
	.nd-mega__panels::-webkit-scrollbar-track { background: transparent; }
	.nd-mega__links-panel { display: none; }
	.nd-mega__links-panel.is-active { display: block; animation: nd-mega-in .18s ease; }
	@keyframes nd-mega-in { from { opacity: 0; transform: translateY(4px); } }

	.nd-mega__links-title {
		display: none;
		margin: 0 0 6px;
		font-size: .72rem;
		letter-spacing: 1.5px;
		text-transform: uppercase;
		color: #999;
	}
	.nd-mega__links { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
	.nd-mega__link {
		display: flex;
		align-items: center;
		gap: 8px;
		padding: 9px 10px;
		border-radius: 0;
		text-decoration: none;
		font-size: .82rem;
		font-weight: 500;
		letter-spacing: 1px;
		text-transform: uppercase;
		color: var(--wp--preset--color--main, #1e1e26);
	}
	.nd-mega__link:hover { background: #f6f6f8; color: var(--wp--preset--color--primary, #6c5ce7); }
	.nd-mega__link .wp-block-navigation-item__icon { display: inline-flex; }
	.nd-mega__link .wp-block-navigation-item__icon svg { width: 1.1em; height: 1.1em; }

	.nd-mega__promo {
		display: flex;
		flex-direction: column;
		border-radius: 0;
		overflow: hidden;
		text-decoration: none;
		background: linear-gradient(160deg, #2b2b38, #4b3f72);
		color: #fff;
		min-height: 100%;
	}
	.nd-mega__promo-img { width: 100%; height: 150px; object-fit: cover; display: block; }
	.nd-mega__promo-ph { display: block; height: 150px; background: linear-gradient(140deg, rgba(255,255,255,.25), rgba(255,255,255,0) 60%), radial-gradient(circle at 70% 20%, #a78bfa, #6c5ce7 60%, #2b2b38); }
	.nd-mega__promo-text { display: flex; flex-direction: column; gap: 4px; padding: 14px; }
	.nd-mega__promo-kicker { font-size: .65rem; letter-spacing: 2px; text-transform: uppercase; opacity: .7; }
	.nd-mega__promo-title { font-size: .95rem; font-weight: 700; letter-spacing: .3px; }
}
