/* رویا رایانه – هدر ثابت، منوی «از پایین» و نوار پایین موبایل/تبلت */

/* ===== هدر ثابت ===== */
.wp-site-blocks > .wp-block-template-part:first-child {
	position: sticky;
	top: 0;
	z-index: 90;
	background: transparent;
}
body.admin-bar .wp-site-blocks > .wp-block-template-part:first-child { top: var(--wp-admin--admin-bar--height, 0px); }

/* ===== موبایل و تبلت: منوی همبرگری همیشه، منوی افقی مخفی ===== */
@media (max-width: 1023.98px) {
	.rr-hmenu .wp-block-navigation__responsive-container-open { display: flex !important; }
	.rr-hmenu .wp-block-navigation__responsive-container:not(.is-menu-open) { display: none !important; }
}

/* ===== منو به‌صورت پنل از پایین ===== */
.wp-block-navigation__responsive-container.is-menu-open {
	display: flex !important;
	align-items: flex-end;
	padding: 0 !important;
	background: rgba(10, 20, 30, .5) !important;
	color: var(--wp--preset--color--contrast, #1d2a33) !important;
	animation: rr-fade .2s ease-out;
}
.is-menu-open > .wp-block-navigation__responsive-close { width: 100%; max-width: none; margin: 0; }
.is-menu-open .wp-block-navigation__responsive-dialog {
	position: relative;
	background: #fff;
	border-radius: 26px 26px 0 0;
	max-height: 82vh;
	max-height: 82dvh;
	overflow-y: auto;
	overscroll-behavior: contain;
	padding: 56px 20px calc(24px + env(safe-area-inset-bottom));
	box-shadow: 0 -8px 30px rgba(0, 0, 0, .18);
	animation: rr-sheet-up .28s cubic-bezier(.2, .8, .2, 1);
}
.is-menu-open .wp-block-navigation__responsive-dialog::before {
	content: ""; position: absolute; top: 12px; left: 50%; transform: translateX(-50%);
	width: 44px; height: 5px; border-radius: 3px; background: #e6ebf3;
}
.is-menu-open .wp-block-navigation__responsive-container-close {
	top: 10px; left: auto; right: auto; inset-inline-end: 12px;
	background: #f2f3f5; border-radius: 12px; padding: 8px; color: inherit;
}
.is-menu-open .wp-block-navigation__responsive-container-content { padding: 0; }
.is-menu-open .wp-block-navigation__container { display: flex; flex-direction: column; align-items: stretch; gap: 0; width: 100%; }
.is-menu-open .wp-block-navigation-item { width: 100%; font-size: 1rem; }
.is-menu-open .wp-block-navigation-item__content { display: block; padding: 14px 4px; border-bottom: 1px solid #e6ebf3; }
.is-menu-open .wp-block-navigation__submenu-container { padding-inline-start: 16px !important; }
.is-menu-open .wp-block-navigation__submenu-container .wp-block-navigation-item__content { font-size: .9375rem; color: #6b7882; }
@keyframes rr-sheet-up { from { transform: translateY(100%); } to { transform: none; } }
@keyframes rr-fade { from { opacity: 0; } to { opacity: 1; } }

/* ===== نوار پایین (مطابق نمونه): خانه | دسته‌بندی‌ها | سبد خرید | علاقه‌مندی‌ها | حساب من ===== */
.rr-bar { display: none !important; } /* نسخه‌ی بلوکی قدیمی، اگر در دیتابیس مانده باشد */
.rrb { display: none; }

@media (max-width: 1023.98px) {
	body { padding-bottom: calc(88px + env(safe-area-inset-bottom)); }
	.rrb {
		display: flex; align-items: flex-start; justify-content: space-around;
		direction: rtl;
		position: fixed; inset-inline: 0; bottom: 0; z-index: 99990;
		margin: 0;
		background: #fff;
		border-top: 1px solid #e8e8e8;
		padding: 10px 2px calc(10px + env(safe-area-inset-bottom));
		font-family: inherit;
	}
	.rrb__item {
		flex: 1 1 0; min-width: 0;
		display: flex; flex-direction: column; align-items: center; gap: 6px;
		color: #6b6a70; text-decoration: none;
		font-size: .75rem; line-height: 1.5; font-weight: 400;
		-webkit-tap-highlight-color: transparent;
	}
	.rrb__item:hover, .rrb__item:focus { color: #6b6a70; }
	.rrb__icon { position: relative; display: block; width: 26px; height: 26px; color: #626262; }
	.rrb__icon svg { display: block; width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
	.rrb__item.is-active { color: #0b1b3d; font-weight: 500; }
	.rrb__item.is-active .rrb__icon { color: #0b1b3d; }
	.rrb__badge {
		position: absolute; top: -6px; right: -12px;
		min-width: 20px; height: 17px; padding: 0 4px;
		background: #ff5c39; color: #fff;
		border-radius: 2px;
		font-size: 11px; font-weight: 700; line-height: 17px; text-align: center;
	}
	.rrb__badge[hidden] { display: none; }
}

/* صفحه‌ی اصلی: هدر شناور روی هیرو (مثل گیف) */
.wp-site-blocks:has(.rr-scene) > .wp-block-template-part:first-child { margin-block-end: calc(var(--rr-hh, 90px) * -1); }
