/* ==========================================================================
   بیم‌لند — assets/shell.css  (هدر، فوتر، ناوبری موبایل، مودال، تبلیغ چرخان)
   همه‌ی رنگ‌ها از tokens.css؛ روشن/تیره خودکار.
   ========================================================================== */
html { overflow-x: hidden; max-width: 100%; }
:focus-visible { outline: 3px solid var(--bl-amber); outline-offset: 2px; border-radius: 6px; }

/* ------------------------------ هدر ------------------------------ */
.bl-topbar {
    position: sticky; top: 0; z-index: 500;
    background: var(--bl-surface); color: var(--bl-ink);
    border-bottom: 1px solid var(--bl-line);
    font-family: var(--bl-font); direction: rtl;
    transition: transform .28s ease;
}
.bl-topbar.is-hidden { transform: translateY(-100%); }
.bl-topbar-row {
    max-width: 1180px; margin-inline: auto; min-height: 62px;
    padding: 0 max(16px, env(safe-area-inset-left, 0px)) 0 max(16px, env(safe-area-inset-right, 0px));
    display: flex; align-items: center; gap: 14px;
}
.bl-brand { display: flex; align-items: center; gap: 10px; text-decoration: none; flex: none; color: var(--bl-ink); }
.bl-brand-mark { width: 34px; height: 34px; border-radius: 10px; background: var(--bl-deep); display: grid; place-items: center; flex: none; }
.bl-brand-logo { height: 30px; width: auto; max-width: 120px; }
.bl-brand-word { font-weight: 800; font-size: 18px; color: var(--bl-ink); }
.bl-brand-sub { display: block; font-size: 10.5px; font-weight: 500; color: var(--bl-muted); line-height: 1.2; }
.bl-nav { display: flex; gap: 4px; margin-inline-start: 8px; }
.bl-nav a { padding: 6px 12px; border-radius: 8px; font-weight: 500; font-size: 14px; color: var(--bl-muted); text-decoration: none; }
.bl-nav a:hover, .bl-nav a.is-cur { background: var(--bl-soft); color: var(--bl-ink); }
.bl-spacer { flex: 1; }
.bl-topbar-actions { display: flex; align-items: center; gap: 8px; }

.bl-btn {
    background: transparent; border: 1.5px solid var(--bl-line); color: var(--bl-ink);
    min-height: 40px; padding: 0 14px; border-radius: 10px; font: inherit; font-size: 13.5px; font-weight: 600;
    cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    white-space: nowrap; transition: background .15s, border-color .15s, transform .15s;
}
.bl-btn:hover { background: var(--bl-soft); border-color: var(--bl-brand); }
.bl-btn-user { background: var(--bl-brand); border-color: var(--bl-brand); color: var(--bl-brand-ink); font-weight: 700; }
.bl-btn-user:hover { background: var(--bl-brand); filter: brightness(1.08); transform: translateY(-1px); }
.bl-btn-icon { width: 40px; padding: 0; font-size: 17px; }
.bl-btn-danger { border-color: var(--bl-danger); color: var(--bl-danger); }

/* منوی «بیشتر» */
.bl-more-wrap { position: relative; display: inline-flex; }
.bl-more-menu {
    position: absolute; top: calc(100% + 8px); inset-inline-start: 0; min-width: 230px;
    background: var(--bl-surface); border: 1px solid var(--bl-line); border-radius: 12px;
    box-shadow: 0 16px 36px -12px rgba(0, 0, 0, .35); padding: 6px; display: none; flex-direction: column; gap: 2px; z-index: 600;
}
.bl-more-wrap.is-open .bl-more-menu { display: flex; }
.bl-more-item {
    background: transparent; border: none; color: var(--bl-ink); padding: 10px; border-radius: 8px; font: inherit;
    font-size: 13.5px; font-weight: 500; cursor: pointer; text-decoration: none; display: flex; align-items: center; gap: 8px;
    text-align: right; width: 100%; box-sizing: border-box;
}
.bl-more-item:hover { background: var(--bl-soft); }

/* بلوک عنوان محصول */
.bl-title-block { max-width: 1180px; margin-inline: auto; padding: 8px 16px 14px; text-align: center; border-top: 1px solid var(--bl-line); background: var(--bl-soft); }
.bl-product-title { margin: 0; font-size: clamp(18px, 3vw, 24px); font-weight: 800; color: var(--bl-ink); line-height: 1.6; }
.bl-product-subtitle { margin-top: 2px; font-size: 13px; color: var(--bl-muted); }
.bl-live-info { margin-top: 4px; display: flex; justify-content: center; flex-wrap: wrap; gap: 14px; font-size: 12.5px; color: var(--bl-muted); }
.bl-live-info b { color: var(--bl-ink); }

/* نوار وضعیت شبکه */
.bl-net-status {
    position: fixed; top: 0; inset-inline: 0; z-index: 900; transform: translateY(-100%); transition: transform .3s ease;
    background: var(--bl-warn); color: #fff; text-align: center; font-size: 13px; font-weight: 700; padding: 8px 12px; font-family: var(--bl-font);
}
.bl-net-status.show { transform: translateY(0); }
.bl-net-status.is-ok { background: var(--bl-ok); }

/* ------------------------------ فوتر ------------------------------ */
.bl-footer {
    background: var(--bl-deep); color: var(--bl-deep-ink); font-family: var(--bl-font); direction: rtl;
    padding: 36px max(16px, env(safe-area-inset-right, 0px)) 24px max(16px, env(safe-area-inset-left, 0px)); margin-top: 48px;
}
.bl-footer-in { max-width: 1180px; margin-inline: auto; }
.bl-fcols { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 28px; }
.bl-fcols > div { min-width: 0; }
.bl-fcols h4 { margin: 0 0 8px; font-size: 14.5px; font-weight: 700; }
.bl-fcols a { display: block; color: var(--bl-deep-ink); opacity: .75; text-decoration: none; font-size: 13.5px; padding: 3px 0; }
.bl-fcols a:hover { opacity: 1; }
.bl-fbrand b { font-size: 18px; }
.bl-fbrand p { margin: 6px 0 0; font-size: 13.5px; opacity: .8; }
.bl-site-extra { display: flex; flex-wrap: wrap; gap: 6px 16px; justify-content: center; margin-bottom: 18px; font-size: 13px; }
.bl-site-extra a { color: var(--bl-deep-ink); opacity: .85; text-decoration: none; }
.bl-footer-bottom { border-top: 1px solid rgba(255, 255, 255, .14); margin-top: 26px; padding-top: 14px; font-size: 12px; opacity: .72; line-height: 1.9; }

/* ------------------------ ناوبری پایین موبایل ------------------------ */
.bl-bnav {
    position: fixed; inset: auto 0 0 0; z-index: 550; display: none; background: var(--bl-surface); border-top: 1px solid var(--bl-line);
    padding: 6px max(8px, env(safe-area-inset-left, 0px)) calc(6px + env(safe-area-inset-bottom, 0px)); font-family: var(--bl-font); direction: rtl;
}
.bl-bnav a { flex: 1; display: grid; justify-items: center; gap: 1px; font-size: 11px; color: var(--bl-muted); padding: 4px 0; text-decoration: none; }
.bl-bnav a span { font-size: 18px; line-height: 1.3; }
.bl-bnav a.is-cur { color: var(--bl-brand); font-weight: 700; }

/* مودال */
.bl-modal-overlay { position: fixed; inset: 0; background: rgba(2, 10, 12, .62); z-index: 2000; display: flex; align-items: center; justify-content: center; padding: 16px; }
.bl-modal { background: var(--bl-surface); color: var(--bl-ink); border: 1px solid var(--bl-line); border-radius: 16px; max-width: 480px; width: 100%; max-height: 80vh; overflow: hidden; display: flex; flex-direction: column; font-family: var(--bl-font); text-align: right; }
.bl-modal-head { display: flex; justify-content: space-between; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--bl-line); font-weight: 700; }
.bl-modal-head button { background: none; border: none; color: var(--bl-muted); font-size: 18px; cursor: pointer; }
.bl-modal-body { padding: 14px 16px; overflow-y: auto; }
.bl-changelog-entry { margin-bottom: 14px; }
.bl-changelog-date { color: var(--bl-brand); font-size: 13px; margin-bottom: 6px; font-weight: 700; }
.bl-changelog-entry ul { margin: 0; padding-inline-start: 18px; color: var(--bl-muted); font-size: 13px; line-height: 1.9; }

/* تبلیغ چرخان کناری */
.bl-ad-rotator { position: sticky; top: 90px; width: 100%; height: 400px; }
.bl-ad-slide {
    position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
    padding: 14px 8px; text-align: center; text-decoration: none; color: var(--bl-ink); background: var(--bl-surface); border: 1px solid var(--bl-line); border-radius: 16px;
    opacity: 0; pointer-events: none; transform: translateY(6px) scale(.97); transition: opacity .7s ease, transform .7s ease;
}
.bl-ad-slide.is-active { opacity: 1; pointer-events: auto; transform: none; }
.bl-ad-slide-icon { width: 54px; height: 54px; border-radius: 50%; display: grid; place-items: center; font-size: 24px; background: var(--bl-soft); border: 1px solid var(--bl-line); }
.bl-ad-slide-title { font-size: 13px; font-weight: 800; line-height: 1.5; }
.bl-ad-slide-desc { font-size: 11px; color: var(--bl-muted); line-height: 1.6; }
.bl-ad-slide-cta { font-size: 11px; font-weight: 700; color: var(--bl-amber-ink); background: var(--bl-amber); padding: 5px 12px; border-radius: 8px; }
.bl-ad-dots { position: absolute; bottom: 10px; inset-inline: 0; display: flex; justify-content: center; gap: 4px; }
.bl-ad-dot { width: 5px; height: 5px; border-radius: 50%; background: var(--bl-line); transition: background .3s, transform .3s; }
.bl-ad-dot.is-active { background: var(--bl-brand); transform: scale(1.4); }

/* ------------------------------ واکنش‌گرا ------------------------------ */
@media (max-width: 860px) {
    .bl-nav, .bl-hide-m { display: none; }
    .bl-bnav { display: flex; }
    body { padding-bottom: 68px; }
    .bl-fcols { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 420px) {
    .bl-topbar-row { gap: 8px; }
    .bl-btn { padding: 0 10px; font-size: 12.5px; }
    .bl-brand-sub { display: none; }
}
@media (prefers-reduced-motion: reduce) { .bl-topbar, .bl-ad-slide { transition: none; } }
@media print { .bl-topbar, .bl-bnav, .bl-footer { display: none !important; } }

/* پس‌زمینهٔ یکسان همهٔ صفحات (جایگزین گرادیان قدیمی style.css) */
html body { background: var(--bl-bg); color: var(--bl-ink); padding: 0; margin: 0; }
