/* ST Sidebar — ساید بار و نوار بالای ریسپانسیو (v1.0)
 * فقط وقتی کلاس html.sb-rh-on داشته باشد اثر می‌کند؛ این کلاس را stsidebar-responsive-header.js می‌گذارد،
 * آن هم فقط وقتی HTML صفحه نسخه‌ی دسکتاپ است (#mobile_bar وجود ندارد) و عرض پنجره ≤ نقطه‌ی شکست تنظیمات ادمین است.
 * نقطه‌ی شکست، چسبیدن نوار و بخش‌ها از تنظیمات ماژول می‌آیند (کلاس‌های sb-rh-sticky روی html).
 */
html.sb-rh-on #header_left,html.sb-rh-on #header_right,html.sb-rh-on #top_extra,html.sb-rh-on .nav_full_container{display:none!important}
html.sb-rh-on #header_primary{display:none!important}
html.sb-rh-on.sb-rh-search #header_primary{display:block!important;background:#fff}
html.sb-rh-on #header_primary_row{display:flex!important;flex-wrap:wrap!important}
html.sb-rh-on #header_center{flex:1 1 100%!important;width:100%!important;max-width:100%!important;padding:6px 10px!important;margin:0!important}
html.sb-rh-on #header_center .header_box,html.sb-rh-on #header_center .search_widget_block{width:100%!important;max-width:none!important}
#sb-rh-bar,#sb-rh-drawer,#sb-rh-overlay{display:none}
html.sb-rh-on #sb-rh-bar{display:flex}
/* Always mode replaces the native mobile header as well; the bottom dock is untouched. */
html.sb-rh-on.sb-rh-always #mobile_bar{display:none!important}
#sb-rh-native-search{display:none}
html.sb-rh-on.sb-rh-search #sb-rh-native-search{display:block!important;padding:6px 10px;background:#fff}
html.sb-rh-on #sb-rh-native-search .search_widget_block{display:block!important;width:100%!important;max-width:none!important}
#sb-rh-bar{box-sizing:border-box;direction:rtl;align-items:center;gap:4px;min-height:56px;padding:6px max(8px,env(safe-area-inset-right)) 6px max(8px,env(safe-area-inset-left));background:#fff;border-bottom:1px solid #e6e8ec;font-family:inherit}
#sb-rh-bar *{box-sizing:border-box}
#sb-rh-bar .sb-rh-logo{display:flex;align-items:center;flex:0 1 auto;min-width:0;margin-inline-start:4px;margin-inline-end:auto}
#sb-rh-bar .sb-rh-logo img{display:block;height:34px;width:auto;max-width:44vw;object-fit:contain}
html.sb-rh-always #sb-rh-bar .sb-rh-logo{flex-shrink:1;overflow:hidden}
html.sb-rh-always #sb-rh-bar .sb-rh-logo img{max-width:100%;min-width:0}
.sb-rh-btn{position:relative;display:inline-flex;align-items:center;justify-content:center;flex:0 0 auto;width:44px;height:44px;padding:0;border:0;border-radius:12px;background:transparent;color:#2b2f36;cursor:pointer;text-decoration:none;-webkit-tap-highlight-color:transparent}
.sb-rh-btn svg{width:25px;height:25px;fill:none;stroke:currentColor;stroke-width:1.9;stroke-linecap:round;stroke-linejoin:round}
.sb-rh-btn:hover,.sb-rh-btn:focus-visible,.sb-rh-btn[aria-expanded="true"]{background:#f1f5fb;color:#1259ba;outline:0}
.sb-rh-btn:focus-visible{box-shadow:0 0 0 2px #1877f2 inset}
.sb-rh-btn:active svg{transform:scale(.92)}
.sb-rh-badge{position:absolute;top:3px;inset-inline-start:2px;min-width:17px;height:17px;padding:0 4px;border-radius:9px;background:#e5243b;color:#fff;font:700 10px/17px Tahoma,sans-serif;text-align:center}
.sb-rh-badge[hidden]{display:none}
#sb-rh-overlay{position:fixed;inset:0;z-index:99980;background:rgba(15,23,42,.45);opacity:0;transition:opacity .22s ease}
html.sb-rh-on #sb-rh-overlay{display:block;visibility:hidden}
html.sb-rh-drawer #sb-rh-overlay{visibility:visible;opacity:1}
#sb-rh-drawer{position:fixed;top:0;bottom:0;right:0;z-index:99990;width:min(88vw,360px);max-width:100%;flex-direction:column;direction:rtl;background:#fff;box-shadow:-10px 0 30px rgba(15,23,42,.18);transform:translateX(105%);visibility:hidden;transition:transform .26s cubic-bezier(.22,.8,.3,1),visibility 0s linear .26s;overscroll-behavior:contain}
html.sb-rh-on #sb-rh-drawer{display:flex}
html.sb-rh-drawer #sb-rh-drawer{transform:none;visibility:visible;transition:transform .26s cubic-bezier(.22,.8,.3,1)}
#sb-rh-drawer .sb-rh-dh{display:flex;align-items:center;justify-content:space-between;flex:0 0 auto;min-height:56px;padding:0 16px;border-bottom:1px solid #e6e8ec;font-weight:700;font-size:16px;color:#1b2a41}
#sb-rh-drawer .sb-rh-body{flex:1 1 auto;overflow-y:auto;-webkit-overflow-scrolling:touch;padding:8px 0 calc(24px + env(safe-area-inset-bottom,0px))}
#sb-rh-drawer h3{margin:14px 16px 6px;font-size:12px;font-weight:700;color:#6b7a90;letter-spacing:0}
#sb-rh-drawer a{color:#1b2a41;text-decoration:none}
#sb-rh-drawer .sb-rh-link{display:flex;align-items:center;gap:10px;min-height:46px;padding:8px 16px;font-size:14px;line-height:1.6}
#sb-rh-drawer .sb-rh-link:hover,#sb-rh-drawer .sb-rh-link:focus-visible{background:#f5f9ff;color:#1259ba;outline:0}
#sb-rh-drawer .sb-rh-link img{width:22px;height:22px;flex:0 0 22px;object-fit:contain}
#sb-rh-drawer .sb-rh-user{margin:6px 12px 2px;padding:12px;border-radius:12px;background:linear-gradient(135deg,#4b8ff8,#1f5fd0);color:#fff;font-weight:700;font-size:14px}
#sb-rh-drawer details{border-bottom:1px solid #eef3fc}
#sb-rh-drawer summary{display:flex;align-items:center;gap:10px;min-height:48px;padding:8px 16px;font-size:14px;font-weight:600;cursor:pointer;list-style:none;color:#1b2a41}
#sb-rh-drawer summary::-webkit-details-marker{display:none}
#sb-rh-drawer summary img{width:22px;height:22px;flex:0 0 22px;object-fit:contain}
#sb-rh-drawer summary span{flex:1 1 auto}
#sb-rh-drawer summary svg{width:18px;height:18px;flex:0 0 18px;fill:none;stroke:#6b7a90;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;transition:transform .2s ease}
#sb-rh-drawer details[open]>summary svg{transform:rotate(180deg)}
#sb-rh-drawer details[open]>summary{color:#1259ba}
#sb-rh-drawer .sb-rh-sub{padding:2px 0 10px;background:#fafcff}
#sb-rh-drawer .sb-rh-sub .sb-rh-link{min-height:42px;padding-inline-start:48px;font-size:13px}
#sb-rh-drawer .sb-rh-sub .sb-rh-grp{display:block;padding:10px 16px 2px 16px;padding-inline-start:48px;font-size:12px;font-weight:700;color:#1259ba}
#sb-rh-drawer .sb-rh-sub .sb-rh-grp a{color:inherit}
html.sb-rh-drawer body{overflow:hidden!important}
html.sb-rh-drawer #sbsc-floating-bar,html.sb-rh-drawer #sidebar_box{visibility:hidden!important}
@media (prefers-reduced-motion:reduce){#sb-rh-overlay,#sb-rh-drawer,#sb-rh-drawer summary svg{transition:none!important}}

/* ---------- نوار بالا: چسبیدن هنگام اسکرول (تنظیم ادمین) ---------- */
html.sb-rh-on.sb-rh-sticky #sb-rh-bar{position:fixed;top:0;left:0;right:0;z-index:99970;box-shadow:0 1px 8px rgba(15,23,42,.08)}
#sb-rh-spacer{display:none}
html.sb-rh-on.sb-rh-sticky #sb-rh-spacer{display:block;height:var(--sb-rh-h,57px)}
/* بخش «دسترسی سریع» داخل ساید بار */
#sb-rh-drawer .sb-rh-link .sb-rh-cnt{margin-inline-start:auto;min-width:22px;height:22px;padding:0 6px;border-radius:11px;background:#e5243b;color:#fff;font:700 11px/22px Tahoma,sans-serif;text-align:center}
#sb-rh-drawer .sb-rh-link .sb-rh-cnt[hidden]{display:none}
/* صفحه‌های بسیار کم‌عرض */
@media (max-width:359px){
  #sb-rh-bar{gap:0;padding-inline:4px}
  .sb-rh-btn{width:40px;height:44px}
  #sb-rh-bar .sb-rh-logo img{height:28px}
}
/* تبلت: ساید بار کمی عریض‌تر */
@media (min-width:600px){#sb-rh-drawer{width:min(70vw,400px)}}
