/* ========================================
   ESWMMS Front - Final Safe
   ======================================== */

.eswmms-enabled {
	position: relative;
}

.eswmms-enabled.eswmms-width-full {
	position: static !important;
}

.eswmms-panel {
	position: absolute;
	top: 100%;
	left: 0;
	min-width: 320px;
	width: auto;
	max-width: none;
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
	transform: translateY(8px);
	transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
	z-index: 99999;
}

.eswmms-enabled:hover > .eswmms-panel,
.eswmms-enabled:focus-within > .eswmms-panel,
.eswmms-enabled.is-open > .eswmms-panel {
	opacity: 1;
	visibility: visible;
	pointer-events: auto;
	transform: translateY(0);
}

/* ========================================
   Contained
   ======================================== */

.eswmms-width-contained {
	position: relative;
}

.eswmms-width-contained > .eswmms-panel {
	left: 0;
	right: auto;
	width: auto;
	min-width: 320px;
}

.eswmms-width-contained > .eswmms-panel .eswmms-panel__inner {
	width: auto;
	max-width: min(1240px, calc(100vw - 32px));
	box-sizing: border-box;
	margin-top: 14px;
	padding: 24px;
	background: #ffffff;
	border: 1px solid rgba(0, 0, 0, 0.08);
	border-radius: 18px;
	box-shadow: 0 20px 60px rgba(0, 0, 0, 0.14);
}

/* ========================================
   Full Width Mega Menu
   ======================================== */

.eswmms-width-full > .eswmms-panel {
	position: fixed !important;
	left: 0 !important;
	right: 0 !important;
	top: var(--eswmms-panel-top, 120px) !important;
	width: 100vw !important;
	max-width: 100vw !important;
	min-width: 0 !important;
	margin: 0 !important;
	padding: 0 !important;
	background: #f7f5f2;
	border-top: 1px solid rgba(0, 0, 0, 0.06);
	box-shadow: none;
	transform: translateY(8px);
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
	transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
	z-index: 99999;
}

/* فقط وقتی JS آماده شد اجازه نمایش بده */
.eswmms-width-full.eswmms-panel-ready:hover > .eswmms-panel,
.eswmms-width-full.eswmms-panel-ready:focus-within > .eswmms-panel,
.eswmms-width-full.eswmms-panel-ready.is-open > .eswmms-panel {
	opacity: 1;
	visibility: visible;
	pointer-events: auto;
	transform: translateY(0);
}

.eswmms-width-full > .eswmms-panel .eswmms-panel__inner {
	width: auto;
	max-width: min(1480px, calc(100vw - 80px));
	margin: 0 auto;
	padding: 40px 0 44px;
	box-sizing: border-box;
	background: transparent;
	border: 0;
	border-radius: 0;
	box-shadow: none;
}

/* optional plugin topbar */
.eswmms-width-full .eswmms-panel__topbar {
	display: none;
}

/* ========================================
   Elementor content inside panel
   فقط reset امن — بدون دستکاری layout
   ======================================== */

.eswmms-panel .elementor,
.eswmms-panel .elementor-section,
.eswmms-panel .elementor-top-section,
.eswmms-panel .elementor-container,
.eswmms-panel .elementor-row,
.eswmms-panel .e-con,
.eswmms-panel .e-parent {
	max-width: 100%;
	box-sizing: border-box;
}

/*
	مهم:
	قبلاً اینجا width:100% روی لایه‌های المنتور اعمال می‌شد
	و باعث می‌شد عرضی که داخل خود Elementor تنظیم شده در فرانت دیده نشود.
	عمداً حذف شد تا المنتور بتواند width / max-width / boxed layout خودش را نگه دارد.
*/

.eswmms-panel .elementor-container,
.eswmms-panel .elementor-row,
.eswmms-panel .e-con,
.eswmms-panel .e-parent {
	margin-left: 0;
	margin-right: 0;
}

.eswmms-panel .elementor-section,
.eswmms-panel .elementor-top-section,
.eswmms-panel .e-con,
.eswmms-panel .e-parent {
	background: transparent;
	min-height: auto;
}

/*
	اگر سکشن المنتور boxed باشد،
	عرضش باید از تنظیمات خود المنتور بیاید، نه از افزونه.
	پس max-width:100% اجباری را برمی‌داریم.
*/
.eswmms-panel .elementor-section-boxed > .elementor-container,
.eswmms-panel .elementor-section.elementor-section-boxed > .elementor-container {
	max-width: inherit;
}

/*
	گپ‌های ستونی المنتور نباید width را override کنند.
	فقط box-sizing نگه داشته می‌شود.
*/
.eswmms-panel .elementor-column-gap-default,
.eswmms-panel .elementor-column-gap-wide,
.eswmms-panel .elementor-column-gap-wider,
.eswmms-panel .elementor-column-gap-extended {
	box-sizing: border-box;
}

/* فقط جلوگیری از بیرون‌زدگی */
.eswmms-panel .elementor-column,
.eswmms-panel .elementor-widget-wrap,
.eswmms-panel .elementor-widget-container,
.eswmms-panel .e-child {
	min-width: 0;
	box-sizing: border-box;
}

/* عنوان‌ها */
.eswmms-panel .elementor-heading-title {
	line-height: 1.22;
	max-width: 100%;
}

/* لینک‌ها */
.eswmms-panel a {
	text-decoration: none;
}

/* اگر widget کارت داخل مگامنو استفاده شد */
.eswmms-panel .esw-featured-packages-slider,
.eswmms-panel .esw-featured-packages-slider__card {
	width: 100%;
	max-width: 100%;
}

.eswmms-panel::before,
.eswmms-panel::after {
	display: none !important;
	content: none !important;
}

/* ========================================
   Promo block fallback
   ======================================== */

.eswmms-promo {
	display: grid;
	grid-template-columns: minmax(240px, 460px) minmax(0, 1fr);
	gap: 24px;
	align-items: center;
}

.eswmms-promo__media {
	overflow: hidden;
	border-radius: 16px;
	background: #eeeeee;
}

.eswmms-promo__image {
	display: block;
	width: 100%;
	height: auto;
}

.eswmms-promo__title {
	margin: 0 0 12px;
	font-size: 32px;
	line-height: 1.1;
}

.eswmms-promo__text {
	margin-bottom: 18px;
	color: #666666;
	line-height: 1.75;
}

.eswmms-promo__button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 12px 18px;
	background: #111111;
	color: #ffffff;
	text-decoration: none;
	border-radius: 999px;
}

/* ========================================
   Prevent clipping in header wrappers
   ======================================== */

.elementor-location-header,
.elementor-location-header .elementor-element,
.elementor-location-header .elementor-widget-wrap,
.elementor-location-header nav,
.elementor-location-header .elementor-nav-menu,
.elementor-location-header .elementor-nav-menu--main,
.elementor-location-header .elementor-nav-menu__container,
.elementor-location-header .elementor-widget-nav-menu,
.elementor-location-header section,
.elementor-location-header .elementor-container,
.elementor-location-header .elementor-column,
.elementor-sticky--active {
	overflow: visible !important;
}

/* ========================================
   Tablet
   ======================================== */

@media (max-width: 1024px) {
	.eswmms-width-full > .eswmms-panel .eswmms-panel__inner {
		width: auto;
		max-width: calc(100vw - 40px);
		padding: 28px 0 34px;
	}

	.eswmms-width-contained > .eswmms-panel .eswmms-panel__inner {
		width: auto;
		max-width: calc(100vw - 24px);
		padding: 18px;
	}

	.eswmms-promo {
		grid-template-columns: 1fr;
		row-gap: 24px;
	}
}

/* ========================================
   Mobile
   ======================================== */

@media (max-width: 767px) {
	.eswmms-enabled,
	.eswmms-width-full {
		position: static !important;
	}

	.eswmms-panel,
	.eswmms-width-full > .eswmms-panel,
	.eswmms-width-contained > .eswmms-panel {
		position: static !important;
		display: none;
		opacity: 1;
		visibility: visible;
		pointer-events: auto;
		transform: none !important;
		width: 100% !important;
		max-width: 100% !important;
		min-width: 0 !important;
		margin: 10px 0 0 !important;
		border-top: 0;
		background: transparent;
	}

	.eswmms-enabled.is-open > .eswmms-panel {
		display: block;
	}

	.eswmms-width-full > .eswmms-panel .eswmms-panel__inner,
	.eswmms-width-contained > .eswmms-panel .eswmms-panel__inner,
	.eswmms-panel__inner {
		width: 100% !important;
		max-width: 100% !important;
		margin: 0 !important;
		padding: 18px 16px 24px !important;
		background: #f7f5f2;
		border: 0;
		border-radius: 0;
		box-shadow: none;
	}

	.eswmms-promo {
		grid-template-columns: 1fr;
	}
}