/* =========================================================
 * Danh Muc Desktop Element
 * ========================================================= */

.wpthemify-danhmuc {
	position: relative;
	display: inline-flex;
}

/* --- Trigger Button --- */
.wpthemify-dm-trigger {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 8px 16px;
	background: var(--subColor, #6dbd45);
	color: #fff;
	border: none;
	border-radius: 8px;
	cursor: pointer;
	font-size: 14px;
	font-weight: 600;
	transition: background 0.2s;
	user-select: none;
	white-space: nowrap;
}

.wpthemify-dm-trigger:hover {
	background: var(--hover, #5aa838);
}

.wpthemify-dm-icon-bars {
	flex-shrink: 0;
}

.wpthemify-dm-icon-chevron {
	flex-shrink: 0;
	transition: transform 0.2s;
}

.wpthemify-danhmuc.is-open .wpthemify-dm-icon-chevron {
	transform: rotate(180deg);
}

/* --- Panel (mega menu) --- */
.wpthemify-dm-panel {
	position: absolute;
	top: calc(100% + 6px);
	left: 0;
	display: flex;
	width: 820px;
	min-height: 400px;
	background: #fff;
	border-radius: 12px;
	box-shadow: 0 8px 40px rgba(0, 0, 0, 0.12), 0 2px 8px rgba(0, 0, 0, 0.06);
	opacity: 0;
	visibility: hidden;
	transform: translateY(-8px);
	transition: opacity 0.2s, transform 0.2s, visibility 0.2s;
	z-index: 9999;
	overflow: hidden;
}

.wpthemify-danhmuc.is-open .wpthemify-dm-panel {
	opacity: 1;
	visibility: visible;
	transform: translateY(0);
}

/* --- Sidebar (left) --- */
.wpthemify-dm-sidebar {
	width: 230px;
	min-width: 230px;
	background: #f8f9fa;
	border-right: 1px solid #eee;
	padding: 8px 0;
	overflow-y: auto;
	max-height: 480px;
}

.wpthemify-dm-sidebar-item {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 11px 16px;
	color: #333 !important;
	text-decoration: none !important;
	font-size: 14px;
	font-weight: 500;
	transition: background 0.15s, color 0.15s;
	border-left: 3px solid transparent;
}

.wpthemify-dm-sidebar-item svg {
	flex-shrink: 0;
	color: #bbb;
	transition: color 0.15s;
}

.wpthemify-dm-sidebar-item:hover,
.wpthemify-dm-sidebar-item.is-active {
	background: #fff;
	color: var(--mainColor, #1a51a2) !important;
	border-left-color: var(--mainColor, #1a51a2);
}

.wpthemify-dm-sidebar-item:hover svg,
.wpthemify-dm-sidebar-item.is-active svg {
	color: var(--mainColor, #1a51a2);
}

/* --- Content (right) --- */
.wpthemify-dm-content {
	flex: 1;
	padding: 20px 24px;
	overflow-y: auto;
	max-height: 480px;
}

/* Tab panels */
.wpthemify-dm-tab {
	display: none;
}

.wpthemify-dm-tab.is-active {
	display: block;
}

/* Subcategory grid */
.wpthemify-dm-grid {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 16px;
}

/* Subcategory item */
.wpthemify-dm-subitem {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 8px;
	padding: 14px 8px;
	border-radius: 10px;
	text-decoration: none !important;
	color: #444 !important;
	font-size: 13px;
	font-weight: 500;
	text-align: center;
	transition: background 0.15s, color 0.15s;
	line-height: 1.3;
}

.wpthemify-dm-subitem:hover {
	background: #f0f7ff;
	color: var(--mainColor, #1a51a2) !important;
}

/* Subcategory icon */
.wpthemify-dm-subicon {
	width: 48px;
	height: 48px;
	object-fit: contain;
	border-radius: 8px;
}

.wpthemify-dm-subicon-placeholder {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 48px;
	height: 48px;
}

.wpthemify-dm-subicon-placeholder svg {
	opacity: 0.4;
}

/* Empty state */
.wpthemify-dm-empty {
	color: #999;
	font-size: 14px;
	text-align: center;
	padding: 40px 0;
}

/* --- Overlay to close when clicking outside --- */
.wpthemify-dm-overlay {
	position: fixed;
	inset: 0;
	z-index: 9998;
	display: none;
}

.wpthemify-danhmuc.is-open .wpthemify-dm-overlay {
	display: block;
}
