/* ===============================
   Mega Menu Widget - Base Styles
   =============================== */

.mm-mega-menu-wrap {
	position: relative;
	display: inline-block;
	width: 100%;
	direction: rtl;
	font-family: inherit;
	z-index: 100;
}

.mm-trigger {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	cursor: pointer;
	border: none;
	background: #f5f5f5;
	color: #222;
	font-size: 15px;
	line-height: 1;
	padding: 12px 18px;
	border-radius: 8px;
	transition: background-color .2s ease, color .2s ease;
	white-space: nowrap;
}

.mm-trigger-icon {
	display: inline-flex;
	font-size: 22px;
	line-height: 1;
}
.mm-trigger-icon svg { width: 1em; height: 1em; fill: currentColor; }

/* پنل اصلی */
.mm-panel {
	position: absolute;
	top: calc(100% + 6px);
	inset-inline-end: 0;
	background: #fff;
	border-radius: 10px;
	box-shadow: 0 12px 40px rgba(0,0,0,.12);
	padding: 28px;
	opacity: 0;
	visibility: hidden;
	transform: translateY(-8px);
	transition: opacity .22s ease, transform .22s ease, visibility .22s ease;
	z-index: 999;
}

.mm-width-full .mm-panel {
	inset-inline-start: 0;
	inset-inline-end: 0;
	width: 100%;
}

.mm-width-auto.mm-align-start .mm-panel { inset-inline-end: auto; inset-inline-start: 0; }
.mm-width-auto.mm-align-center .mm-panel { left: 50%; right: auto; transform: translate(-50%,-8px); }
.mm-width-auto.mm-align-end .mm-panel { inset-inline-start: auto; inset-inline-end: 0; }

.mm-anim-none .mm-panel { transition: none; }

/* حالت باز */
.mm-mega-menu-wrap.mm-active .mm-panel {
	opacity: 1;
	visibility: visible;
	transform: translateY(0);
}
.mm-width-auto.mm-align-center.mm-active .mm-panel { transform: translate(-50%,0); }

.mm-empty-notice {
	margin: 0;
	color: #999;
	font-size: 14px;
	text-align: center;
	padding: 20px;
}

/* شبکه ستون‌ها */
.mm-columns {
	display: grid;
	grid-template-columns: repeat(5, 1fr);
	column-gap: 32px;
	row-gap: 38px;
}

.mm-column { min-width: 0; }

.mm-no-divider .mm-columns .mm-column { border-inline-end: none !important; }

.mm-column-title-row {
	display: flex;
	align-items: center;
	gap: 8px;
	margin-bottom: 14px;
}

.mm-dot {
	display: inline-block;
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background: #e02b2b;
	flex-shrink: 0;
}

.mm-column-icon {
	display: inline-flex;
	font-size: 18px;
	line-height: 1;
	color: #e02b2b;
	flex-shrink: 0;
}
.mm-column-icon svg { width: 1em; height: 1em; fill: currentColor; }

.mm-column-title {
	font-weight: 700;
	font-size: 15px;
	color: #1a1a1a;
	text-decoration: none;
	flex-grow: 1;
}
.mm-column-title:hover { text-decoration: underline; }

/* برچسب‌ها (Badge) */
.mm-badge {
	display: inline-block;
	font-size: 10px;
	line-height: 1;
	padding: 3px 6px;
	border-radius: 4px;
	margin-inline-start: 6px;
	color: #fff;
	vertical-align: middle;
	transform: translateY(-1px);
}
.mm-badge-new { background-color: #2ecc71; }
.mm-badge-hot { background-color: #e74c3c; }
.mm-badge-sale { background-color: #f39c12; }
.mm-badge-custom { background-color: #3498db; }

/* سطح سوم (زیرِ زیرمجموعه) */
.mm-subsub-list {
	list-style: none;
	margin: 6px 0 0;
	padding-inline-start: 14px;
	border-inline-start: 2px solid #f0f0f0;
}
.mm-subsub-list li:not(:last-child) { margin-bottom: 6px; }
.mm-subsub-list a {
	display: block;
	font-size: 12.5px;
	color: #888;
	text-decoration: none;
	padding: 2px 4px;
}
.mm-subsub-list a:hover { color: #d4a017; }

/* کادر تبلیغاتی */
.mm-promo-box {
	background: #faf7f0;
	border-radius: 10px;
	overflow: hidden;
	height: 100%;
	display: flex;
	flex-direction: column;
}
.mm-promo-image {
	width: 100%;
	display: block;
	aspect-ratio: 16 / 10;
	object-fit: cover;
}
.mm-promo-content { padding: 16px; }
.mm-promo-title {
	font-weight: 700;
	font-size: 15px;
	color: #1a1a1a;
	margin-bottom: 6px;
}
.mm-promo-text {
	font-size: 12.5px;
	color: #666;
	margin: 0 0 12px;
	line-height: 1.6;
}
.mm-promo-button {
	display: inline-block;
	font-size: 13px;
	background: #d4a017;
	color: #fff;
	text-decoration: none;
	padding: 8px 16px;
	border-radius: 6px;
	transition: opacity .15s ease;
}
.mm-promo-button:hover { opacity: .85; }

.mm-accordion-toggle {
	display: none;
	font-size: 18px;
	line-height: 1;
	color: #999;
}

.mm-sub-list {
	list-style: none;
	margin: 0;
	padding: 0;
}

.mm-sub-list li:not(:last-child) { margin-bottom: 9px; }

.mm-sub-list a {
	display: block;
	color: #555;
	font-size: 13.5px;
	text-decoration: none;
	padding: 4px;
	border-radius: 5px;
	transition: color .15s ease, background-color .15s ease;
}
.mm-sub-list a:hover { color: #d4a017; }

/* ===============================
   موبایل / اکاردئون
   =============================== */
@media (max-width: 767px) {
	.mm-panel {
		position: fixed;
		top: var(--mm-header-h, 0);
		left: 0;
		right: 0;
		bottom: 0;
		width: 100%;
		height: auto;
		max-height: calc(100vh - var(--mm-header-h, 0px));
		overflow-y: auto;
		border-radius: 0;
		transform: none;
	}
	.mm-mega-menu-wrap.mm-active .mm-panel { transform: none; }

	.mm-columns {
		display: block;
	}

	.mm-column {
		border-inline-end: none !important;
		border-bottom: 1px solid #eee;
		padding-bottom: 10px;
		margin-bottom: 10px;
	}

	.mm-column-title-row { cursor: pointer; }
	.mm-accordion-toggle { display: inline-block; }

	.mm-sub-list {
		display: none;
		padding-inline-start: 4px;
		margin-top: 6px;
	}

	.mm-column.mm-open .mm-sub-list { display: block; }
	.mm-column.mm-open .mm-accordion-toggle { transform: rotate(45deg); }
}

/* دسترسی‌پذیری - فوکوس کیبورد */
.mm-trigger:focus-visible,
.mm-sub-list a:focus-visible,
.mm-column-title:focus-visible {
	outline: 2px solid #d4a017;
	outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
	.mm-panel { transition: none !important; }
}
