/* ════════════════════════════════════════════════════════════════
   شل موبایل — هدر + اسکرول‌بار + باتم نَو
   ════════════════════════════════════════════════════════════════ */

.ad-shell {
	position: relative;
	max-width: var(--ad-shell-max);
	margin: 0 auto;
	min-height: 100vh;
	min-height: 100dvh;
	background: var(--ad-bg);
	display: flex;
	flex-direction: column;
}

/* روی دسکتاپ، شل موبایل وسط صفحه */
@media (min-width: 600px) {
	body.ad-app {
		background: linear-gradient(135deg, #E8F4F5 0%, #F2F9FA 50%, #ECF7F0 100%);
		display: flex;
		justify-content: center;
		align-items: stretch;
		min-height: 100vh;
		min-height: 100dvh;
	}
	.ad-shell,
	.ad-shell--centered,
	body.ad-app > .ad-payment-result,
	body.ad-app > .ad-login-shell {
		max-width: var(--ad-shell-max);
		width: 100%;
		min-height: 100vh;
		background: var(--ad-bg);
		border-left: 1px solid var(--ad-border);
		border-right: 1px solid var(--ad-border);
	}
}

/* روی موبایل (کوچک‌تر از 600)، عرض کامل */
@media (max-width: 599px) {
	.ad-shell,
	.ad-shell--centered {
		max-width: 100%;
		width: 100%;
	}
}

/* ───── Header ───── */
.ad-header {
	position: sticky;
	top: 0;
	z-index: 50;
	background: var(--ad-surface);
	border-bottom: 1px solid var(--ad-border-soft);
	min-height: var(--ad-header-h);
	display: flex;
	align-items: center;
	padding: 0 var(--ad-sp-4);
	gap: var(--ad-sp-3);
}

.ad-header__back {
	width: 36px;
	height: 36px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	color: var(--ad-text-2);
	background: transparent;
	border: 0;
	border-radius: var(--ad-r-md);
	transition: background var(--ad-dur-fast) var(--ad-easing);
}
.ad-header__back:hover { background: var(--ad-bg-2); color: var(--ad-text); }

.ad-header__title {
	flex: 1;
	font-size: var(--ad-fs-lg);
	font-weight: 600;
	color: var(--ad-text);
	margin: 0;
}

.ad-header__action {
	width: 36px;
	height: 36px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	color: var(--ad-text-2);
	background: transparent;
	border: 0;
	border-radius: var(--ad-r-md);
}
.ad-header__action:hover { background: var(--ad-bg-2); color: var(--ad-primary); }

/* ───── Header welcome (home pages) ───── */
.ad-welcome-header {
	background: linear-gradient(135deg, var(--ad-primary) 0%, var(--ad-primary-dark) 100%);
	padding: var(--ad-sp-3) var(--ad-sp-4);
	color: #fff;
	position: relative;
}
.ad-welcome-header__top {
	display: flex;
	align-items: center;
	gap: var(--ad-sp-2);
}
.ad-welcome-header__menu {
	width: 38px;
	height: 38px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	color: #fff;
	background: rgba(255,255,255,.15);
	border: 0;
	border-radius: var(--ad-r-pill);
	cursor: pointer;
	flex-shrink: 0;
	transition: background var(--ad-dur-fast) var(--ad-easing);
}
.ad-welcome-header__menu:hover { background: rgba(255,255,255,.25); }

.ad-welcome-header__center {
	flex: 1;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	min-width: 0;
}
.ad-welcome-header__side {
	flex-shrink: 0;
}
.ad-welcome-header__avatar {
	width: 44px;
	height: 44px;
	border-radius: var(--ad-r-pill);
	border: 2px solid rgba(255,255,255,.3);
	background: var(--ad-primary-tint);
	overflow: hidden;
	flex-shrink: 0;
}
.ad-welcome-header__avatar img { width: 100%; height: 100%; object-fit: cover; }

/* لوگوی سایت در وسط هدر (دایره‌ای، مثل صفحه‌ی ورود) */
.ad-welcome-header__logo {
	display: flex;
	align-items: center;
	justify-content: center;
	text-decoration: none;
}
.ad-welcome-header__logo-circle {
	width: 56px;
	height: 56px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	background: #fff;
	border: 3px solid rgba(255, 255, 255, 0.55);
	border-radius: 50%;
	overflow: hidden;
	flex-shrink: 0;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}
.ad-welcome-header__logo-circle img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.ad-welcome-header__greeting {
	min-width: 0;
	text-align: right;
}
.ad-welcome-header__hello {
	font-size: var(--ad-fs-sm);
	color: rgba(255,255,255,.85);
	margin: 0 0 2px;
}
.ad-welcome-header__name {
	font-size: var(--ad-fs-md);
	font-weight: 700;
	margin: 0;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.ad-welcome-header__bell {
	width: 38px;
	height: 38px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	color: #fff;
	background: rgba(255,255,255,.15);
	border: 0;
	border-radius: var(--ad-r-pill);
	position: relative;
	cursor: pointer;
	flex-shrink: 0;
	transition: background var(--ad-dur-fast) var(--ad-easing);
}
.ad-welcome-header__bell:hover { background: rgba(255,255,255,.25); }

/* ───── Body / Main ───── */
.ad-main {
	flex: 1;
	padding: var(--ad-sp-4);
	padding-bottom: calc(var(--ad-nav-h) + var(--ad-sp-7));
	overflow-y: auto;
}
.ad-main--no-pad-x { padding-left: 0; padding-right: 0; }
.ad-main--no-pad   { padding: 0; padding-bottom: calc(var(--ad-nav-h) + var(--ad-sp-7)); }

/* ───── Bottom Nav ───── */
.ad-nav {
	position: fixed;
	bottom: 0;
	left: 50%;
	transform: translateX(-50%);
	width: 100%;
	max-width: var(--ad-shell-max);
	height: var(--ad-nav-h);
	background: var(--ad-surface);
	border-top: 1px solid var(--ad-border);
	display: flex;
	z-index: 100;
	padding-bottom: env(safe-area-inset-bottom);
}

.ad-nav__item {
	flex: 1;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 4px;
	padding: 8px 4px;
	color: var(--ad-text-muted);
	background: transparent;
	border: 0;
	font-size: 11px;
	font-weight: 500;
	text-decoration: none;
	transition: color var(--ad-dur-fast) var(--ad-easing);
	position: relative;
}
.ad-nav__item:hover { color: var(--ad-primary); }
.ad-nav__item.is-active {
	color: var(--ad-primary);
	font-weight: 600;
}
.ad-nav__item.is-active::before {
	content: '';
	position: absolute;
	top: 0;
	left: 50%;
	transform: translateX(-50%);
	width: 28px;
	height: 3px;
	background: var(--ad-primary);
	border-radius: 0 0 4px 4px;
}
.ad-nav__icon {
	width: 22px;
	height: 22px;
	display: flex;
	align-items: center;
	justify-content: center;
}
.ad-nav__label {
	font-size: 11px;
	line-height: 1;
}

/* ───── Page (تب فعال) ───── */
.ad-page {
	display: none;
	animation: ad-fade-in var(--ad-dur-base) var(--ad-easing);
}
.ad-page.is-active {
	display: block;
}

@keyframes ad-fade-in {
	from { opacity: 0; transform: translateY(4px); }
	to   { opacity: 1; transform: translateY(0); }
}

/* ───── Loader شل ───── */
.ad-app-loader {
	position: fixed;
	inset: 0;
	background: var(--ad-bg);
	display: flex;
	align-items: center;
	justify-content: center;
	z-index: 9999;
	transition: opacity var(--ad-dur-slow) var(--ad-easing);
}
.ad-app-loader.is-hidden {
	opacity: 0;
	pointer-events: none;
}
.ad-app-loader__icon {
	width: 48px;
	height: 48px;
	color: var(--ad-primary);
	animation: ad-spin 1s linear infinite;
}
@keyframes ad-spin { to { transform: rotate(360deg); } }
