/* ===========================================================
   WP Sell — ناوبری موبایل (استایل اینستاگرام)
   =========================================================== */

.wps-mobile-nav { display: none; }

@media (max-width: 782px) {

	body { padding-bottom: calc(68px + env(safe-area-inset-bottom)); }

	.wps-mobile-nav {
		position: fixed;
		inset-inline: 0;
		bottom: 0;
		z-index: 800;
		display: grid;
		grid-template-columns: repeat(5, 1fr);
		align-items: center;
		height: calc(68px + env(safe-area-inset-bottom));
		padding-bottom: env(safe-area-inset-bottom);
		background: var(--wps-surface);
		border-top: 1px solid var(--wps-border);
		box-shadow: 0 -4px 24px rgba(30, 27, 75, .08);
	}

	.wps-mnav-item {
		display: flex;
		flex-direction: column;
		align-items: center;
		justify-content: center;
		gap: 3px;
		height: 100%;
		min-height: 44px;
		padding: 0;
		background: transparent;
		border: none;
		color: var(--wps-text-soft);
		font-family: inherit;
		font-size: .62rem;
		font-weight: 600;
		cursor: pointer;
		-webkit-tap-highlight-color: transparent;
		transition: color .2s var(--wps-ease);
	}

	.wps-mnav-item:active { transform: scale(.92); }
	.wps-mnav-item.is-active { color: var(--wps-primary); }
	.wps-mnav-item.is-active svg { stroke-width: 2.5; }

	.wps-mnav-icon-wrap { position: relative; display: inline-flex; }

	.wps-mnav-badge {
		position: absolute;
		top: -5px;
		inset-inline-end: -7px;
		min-width: 17px;
		height: 17px;
		padding: 0 4px;
		display: flex;
		align-items: center;
		justify-content: center;
		background: var(--wps-accent);
		color: #fff;
		font-size: .6rem;
		font-weight: 800;
		border-radius: 20px;
		border: 2px solid var(--wps-surface);
	}
	.wps-mnav-badge.is-empty { display: none; }

	/* دکمه مرکزی شناور */
	.wps-mnav-center {
		display: flex;
		align-items: center;
		justify-content: center;
		justify-self: center;
		width: 52px;
		height: 52px;
		margin-top: -14px;
		background: linear-gradient(135deg, var(--wps-primary), var(--wps-secondary));
		border-radius: 17px;
		color: #fff;
		box-shadow: 0 8px 22px rgba(124, 58, 237, .42);
		transition: transform .2s var(--wps-ease), box-shadow .2s;
		-webkit-tap-highlight-color: transparent;
	}
	.wps-mnav-center:active { transform: scale(.93); }
	.wps-mnav-center.is-active { box-shadow: 0 8px 28px rgba(124, 58, 237, .58); }
	.wps-mnav-center:hover { color: #fff; }

	/* سبد خرید موبایل: از پایین بالا می‌آید */
	.wps-side-cart {
		inset-inline: 0;
		inset-inline-start: 0;
		top: auto;
		bottom: 0;
		width: 100%;
		height: 88vh;
		max-height: 88vh;
		border-radius: 24px 24px 0 0;
		transform: translateY(100%) !important;
		box-shadow: 0 -12px 48px rgba(0, 0, 0, .28);
	}
	.wps-side-cart.is-open { transform: translateY(0) !important; }

	.wps-sc-accent { border-radius: 24px 24px 0 0; }

	/* دستگیره کشیدن */
	.wps-side-cart::before {
		content: '';
		position: absolute;
		top: 10px;
		inset-inline: 0;
		margin-inline: auto;
		width: 40px;
		height: 4px;
		background: var(--wps-border);
		border-radius: 4px;
		z-index: 5;
	}
	.wps-sc-head { padding-top: var(--wps-space-5); }

	.wps-sc-foot { padding-bottom: max(var(--wps-space-5), env(safe-area-inset-bottom)); }

	/* پاپ‌آپ ورود: از پایین اسلاید می‌شود */
	.wps-modal { align-items: flex-end; padding: 0; }

	.wps-modal-card {
		width: 100%;
		max-width: 100%;
		max-height: 92vh;
		border-radius: 26px 26px 0 0;
		animation: wps-slide-up .35s var(--wps-ease);
		padding-bottom: env(safe-area-inset-bottom);
	}

	.wps-modal-accent { border-radius: 26px 26px 0 0; }

	.wps-modal-card::before {
		content: '';
		position: absolute;
		top: 11px;
		inset-inline: 0;
		margin-inline: auto;
		width: 40px;
		height: 4px;
		background: var(--wps-border);
		border-radius: 4px;
		z-index: 5;
	}

	.wps-modal-body { padding-top: var(--wps-space-7); }

	@keyframes wps-slide-up {
		from { transform: translateY(100%); }
	}

	/* جستجوی تمام‌صفحه موبایل */
	.wps-mobile-search {
		position: fixed;
		inset: 0;
		z-index: 960;
		background: var(--wps-surface);
		padding: var(--wps-space-4);
		display: flex;
		flex-direction: column;
		gap: var(--wps-space-4);
		transform: translateY(-100%);
		transition: transform .3s var(--wps-ease);
	}
	.wps-mobile-search.is-open { transform: translateY(0); }
	.wps-mobile-search-head { display: flex; align-items: center; gap: var(--wps-space-2); }
	.wps-mobile-search .wps-search { flex: 1; min-width: 0; }

	.wps-toast-stack { bottom: calc(84px + env(safe-area-inset-bottom)); inset-inline: 16px; }
	.wps-toast { min-width: 0; max-width: 100%; }
}

@media (min-width: 783px) {
	.wps-mobile-drawer, .wps-mobile-search { display: none !important; }
}

/* بهبود ناحیه لمسی روی همه دستگاه‌های لمسی */
@media (hover: none) {
	.wps-btn, .wps-icon-btn, .wps-sort-tab, .wps-qty button { min-height: 44px; }
	.wps-qty button { min-width: 36px; }
	.wps-sc-remove { width: 32px; height: 32px; }
}
