/**
 * هدر یکپارچه موبایل - viraving
 *
 * در تمام صفحات (خانه، پنل، ورود، تماس) یکسان:
 * سمت چپ: لوگو
 * سمت راست: منوی همبرگر
 *
 * @package Viraving
 */

/* ============================================================
   هدر یکپارچه موبایل - فقط دو عنصر: لوگو + همبرگر
   ============================================================ */
@media (max-width: 1024px) {
	/* تبدیل هدر به نوار ساده */
	.site-header {
		padding: 0 !important;
	}

	.header-inner {
		display: flex !important;
		flex-direction: row !important;
		align-items: center !important;
		justify-content: space-between !important;
		border-radius: 0 !important;
		border: none !important;
		border-bottom: 1px solid var(--border-color) !important;
		padding: 0.625rem 0.875rem !important;
		padding-top: max(0.625rem, env(safe-area-inset-top)) !important;
		box-shadow: var(--shadow-sm) !important;
		max-width: 100% !important;
		gap: 0.5rem !important;
		min-height: 56px;
	}

	/* فقط لوگو و همبرگر نمایش داده شوند
	   در RTL با order: همبرگر راست (order:1)، لوگو چپ (order:2) */
	.site-branding {
		display: flex !important;
		align-items: center;
		flex: 0 1 auto;
		order: 2;
		margin-left: 0 !important;
		margin-inline-start: 0 !important;
		min-width: 0;
	}

	.site-logo-text {
		font-size: 1rem !important;
		gap: 0.375rem;
	}

	.site-logo-text .logo-mark {
		width: 32px !important;
		height: 32px !important;
		font-size: 0.9375rem !important;
	}

	.site-logo-text span:not(.logo-mark) {
		font-size: 0.9375rem !important;
	}

	.site-logo img {
		max-height: 32px !important;
	}

	/* همبرگر در سمت راست */
	.header-actions {
		display: flex !important;
		align-items: center;
		gap: 0.375rem;
		flex-shrink: 0;
		order: 1;
	}

	.menu-toggle {
		display: flex !important;
		width: 40px !important;
		height: 40px !important;
	}

	.menu-toggle svg {
		width: 22px;
		height: 22px;
	}

	/* مخفی کردن سایر عناصر هدر در موبایل */
	.main-navigation {
		display: none !important;
	}

	.header-cta {
		display: none !important;
	}

	.theme-toggle {
		display: none !important;
	}

	.header-login {
		display: none !important;
	}

	.header-dashboard-link {
		display: none !important;
	}

	/* نوار بالایی مخفی */
	.top-bar {
		display: none !important;
	}

	/* مخفی کردن topbar تلگرامی چون هدر یکپارچه داریم */
	.mobile-app-topbar {
		display: none !important;
	}
}

/* ============================================================
   صفحه پنل کاربری - هدر یکپارچه (بدون قوانین اضافی)
   ============================================================ */
@media (max-width: 1024px) {
	/* حذف همه قوانین قبلی is-panel-page برای هدر */
	body.is-panel-page .site-header {
		position: sticky;
		top: 0;
		z-index: 1000;
		padding: 0 !important;
	}

	/* در پنل هم فقط لوگو + همبرگر */
	body.is-panel-page .site-branding {
		display: flex !important;
	}

	body.is-panel-page .menu-toggle {
		display: flex !important;
	}

	/* سایدبار قدیمی مخفی */
	body.is-panel-page .panel-sidebar {
		display: none !important;
	}

	/* چیدمان پنل تک‌ستونی */
	body.is-panel-page .viraving-panel {
		grid-template-columns: 1fr !important;
		margin: 0 !important;
		padding: 0 !important;
		padding-bottom: calc(100px + env(safe-area-inset-bottom, 0px)) !important;
		min-height: calc(100vh - 60px);
		gap: 0 !important;
	}

	body.is-panel-page .panel-content,
	body.is-panel-page .viraving-panel-content {
		padding: 1rem !important;
		min-width: 0;
	}
}

/* ============================================================
   موبایل کوچک‌تر (<= 480px)
   ============================================================ */
@media (max-width: 480px) {
	.header-inner {
		padding: 0.5rem 0.625rem !important;
		padding-top: max(0.5rem, env(safe-area-inset-top)) !important;
		gap: 0.375rem !important;
	}

	.menu-toggle {
		width: 38px !important;
		height: 38px !important;
	}

	.site-logo-text .logo-mark {
		width: 30px !important;
		height: 30px !important;
	}
}

/* ============================================================
   حالت تاریک
   ============================================================ */
html[data-theme="dark"] .header-inner,
.color-mode-dark .header-inner {
	background: rgba(19, 31, 28, 0.85) !important;
	border-bottom-color: rgba(255, 255, 255, 0.08) !important;
}
