/* ==========================================================================
   PC46 — بازطراحی UX موبایل صفحه‌ی خانه
   فقط وقتی عرض صفحه < ۷۶۰px است فعال می‌شود؛ دسکتاپ و تبلت بدون تغییر.
   ۱) جابه‌جایی ترتیب بخش‌ها (دسته‌ها و محصولات زودتر از سیستم‌ساز)
   ۲) دسته‌بندی‌ها: شبکه‌ی آیکونی فشرده به‌جای ۸ کارت بلند
   ۳) هیرو: ویژگی‌ها به‌صورت چیپ‌های اسکرولی
   ۴) مراحل اقساط و بخش تعهدات: فشرده (۳ ستون / ۲×۲)
   ۵) نوار ناوبری پایین (خانه، فروشگاه، سیستم‌ساز، سبد، حساب)
   ========================================================================== */

.hbn{display:none}

@media(max-width:759px){
  :root{--hbn:calc(62px + env(safe-area-inset-bottom,0px));--hgut:clamp(16px,4vw,48px)}
  html{scroll-padding-top:calc(var(--hh,118px) + 10px)}

  /* ---------- ۱) ترتیب بخش‌ها ---------- */
  main#top{display:flex;flex-direction:column}
  main#top>*{min-width:0}
  #explorer,.hero-fade{order:0}
  #categories{order:1}
  #products{order:2}
  #builder{order:3}
  #installment{order:4}
  .latest-articles-home{order:5}
  #commitment{order:6}

  /* ---------- سرتیتر هم‌شکل با ریل محصولات ---------- */
  #categories.pad{padding-block:44px 22px}
  #categories .sec-head{text-align:start;max-width:none;margin:0 0 12px}
  #categories .sec-head .eyebrow{display:none}
  #categories .sec-head h2{margin:0;font-size:15.5px;line-height:1.75;font-weight:800}
  #categories .sec-head h2::before{content:"";display:inline-block;width:4px;height:18px;margin-inline-end:9px;vertical-align:-3px;border-radius:4px;background:var(--grad)}

  /* ---------- ۲) دسته‌بندی‌ها: شبکه‌ی آیکونی ۴ستونه ---------- */
  .cats{grid-template-columns:repeat(4,minmax(0,1fr));gap:18px 6px}
  .cat{align-items:center;text-align:center;gap:7px;padding:6px 2px 4px;border:0;border-radius:16px;background:transparent;backdrop-filter:none;-webkit-backdrop-filter:none;overflow:visible;-webkit-tap-highlight-color:transparent}
  .cat::before,.cat::after{display:none}
  .cat svg{width:58px;height:58px;padding:15px;margin:0;border-radius:19px;transition:transform .15s}
  .cat b{font-size:11px;line-height:1.55;font-weight:700;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
  .cat small{display:none}
  .cat:hover{transform:none;box-shadow:none;border-color:transparent}
  .cat:active svg{transform:scale(.92)}

  /* ---------- ۳) هیرو ---------- */
  .hero-grid{grid-template-columns:minmax(0,1fr)}
  .hero-grid>*{min-width:0}
  .hero .facts{display:flex;flex-wrap:nowrap;gap:8px;max-width:none;overflow-x:auto;margin-inline:calc(var(--hgut) * -1);padding:2px var(--hgut) 6px;scrollbar-width:none;-webkit-overflow-scrolling:touch}
  .hero .facts::-webkit-scrollbar{display:none}
  .hero .facts li{flex:none;align-items:center;gap:6px;padding:7px 12px 7px 14px;border:1px solid var(--line);border-radius:999px;background:#fff;white-space:nowrap;line-height:1.4;box-shadow:0 2px 8px rgba(15,23,42,.04)}
  .hero .facts .ic{margin-top:0;width:16px;height:16px}
  .hero .cta{margin-bottom:16px}

  /* ---------- سیستم‌ساز: چیپ‌های ویژگی در موبایل نمایش داده نشوند ---------- */
  #builder .chips{display:none}

  /* ---------- ۴) اقساط: مراحل افقی ---------- */
  .steps{max-width:none;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;margin-top:16px}
  .steps::before{display:none}
  .steps li{flex-direction:column;text-align:center;gap:8px;padding:12px 6px;border:1px solid var(--line);border-radius:14px;background:#fff}
  .steps li::before{width:34px;height:34px;border-radius:11px;font-size:14px}
  .steps b{font-size:12px}
  .steps small{font-size:10.5px;line-height:1.6;display:block}

  /* ---------- تعهدات: ۲×۲ فشرده ---------- */
  #commitment.pad{padding-bottom:26px}
  .commit{grid-template-columns:repeat(2,minmax(0,1fr));border-radius:20px}
  .commit>div{gap:10px;padding:16px 14px;border-inline-start:0!important;border-block-end:1px solid var(--line)}
  .commit>div:nth-child(odd){border-inline-end:1px solid var(--line)}
  .commit>div:nth-last-child(-n+2){border-block-end:0}
  .seal{width:40px;height:40px;border-radius:12px}
  .seal .ic{width:20px;height:20px}
  .commit h4{font-size:12.5px;line-height:1.6}
  .commit p{font-size:11px;line-height:1.85;display:-webkit-box;-webkit-line-clamp:4;-webkit-box-orient:vertical;overflow:hidden}

  /* ---------- ۵) نوار ناوبری پایین ---------- */
  body.has-hbn{padding-bottom:var(--hbn)}
  body.hbn-kbd{--hbn:0px}
  body.hbn-kbd .hbn{display:none}
  .hbn{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));position:fixed;inset-inline:0;bottom:0;z-index:50;height:var(--hbn);padding-bottom:env(safe-area-inset-bottom,0px);
    background:rgba(255,255,255,.94);-webkit-backdrop-filter:saturate(1.4) blur(16px);backdrop-filter:saturate(1.4) blur(16px);border-top:1px solid var(--line);box-shadow:0 -8px 28px rgba(15,23,42,.07)}
  .hbn a{position:relative;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px;min-width:0;font-size:10.5px;font-weight:700;color:var(--tx-3);-webkit-tap-highlight-color:transparent}
  .hbn .ic{width:23px;height:23px;transition:transform .15s}
  .hbn a:active .ic{transform:scale(.88)}
  .hbn a.on{color:var(--blue-3)}
  .hbn a.on::before{content:"";position:absolute;top:0;inset-inline:30%;height:3px;border-radius:0 0 4px 4px;background:var(--grad)}
  .hbn-badge{position:absolute;top:6px;inset-inline-start:calc(50% + 2px);min-width:17px;height:17px;padding:0 4px;border-radius:17px;background:#e0405c;color:#fff;font-size:10px;font-weight:800;line-height:17px;text-align:center;font-feature-settings:"tnum"}
  .hbn-badge[hidden]{display:none}
  /* دکمه‌ی چت، پیام چت و اعلان بالای نوار پایین */
  .fab{right:max(16px,env(safe-area-inset-right));bottom:calc(var(--hbn) + 14px)}
  #chat{bottom:calc(var(--hbn) + 14px + 70px)}
  #toast{bottom:calc(var(--hbn) + 20px)}
}
@media(max-width:759px) and (prefers-reduced-motion:reduce){.cat svg,.hbn .ic{transition:none}}
