/* =========================================================================
   Jahaniyan — پوستهٔ اپلیکیشنی (App Shell / PWA look)
   - هدر بالا و منوی پایین ثابت؛ فقط محتوای میانی اسکرول می‌شود
   - احترام به Safe Area (ناچ / نوار ژست پایین)
   - رنگ ناحیه‌های سیستم‌عامل = سفید (با meta theme-color)
   - اندازهٔ جمع‌وجورتر صفحهٔ تک‌آگهی در دسکتاپ (مثل دیوار)
   این فایل آخرین CSS بارگذاری‌شده است و منطقی را تغییر نمی‌دهد.
   ========================================================================= */

:root{
  --jh-app-bg:#fff;
  --jh-sat:env(safe-area-inset-top,0px);
  --jh-sab:env(safe-area-inset-bottom,0px);
  --jh-sal:env(safe-area-inset-left,0px);
  --jh-sar:env(safe-area-inset-right,0px);
}

/* پس‌زمینهٔ یکدست: رنگ ناحیه‌های کشیده‌شده (overscroll / کنار ناچ) سفید */
html{background:var(--jh-app-bg);-webkit-text-size-adjust:100%;text-size-adjust:100%}
body{background:var(--jh-app-bg);-webkit-tap-highlight-color:transparent;overflow-x:clip}

/* ------------------------------ موبایل ------------------------------ */
@media (max-width:767.98px){

  /* محتوا زیر ناچ/گوشه‌های گرد نرود (حالت افقی) */
  body{padding-left:var(--jh-sal);padding-right:var(--jh-sar)}

  /* هدر موبایل: بالاترین نقطه، ثابت؛ ناحیهٔ ناچ هم سفید و جزو هدر است.
     (ارتفاع آن با padding-top بدنه توسط اسکریپت هدر جبران می‌شود: outerHeight شامل این padding است) */
  .jhe-header[data-mode=mobile]{
    padding-top:var(--jh-sat)!important;
    background:#fff!important;
    left:0!important;right:0!important;top:0!important;
    box-shadow:0 1px 0 #ececec!important;border-bottom:0!important;
  }
  body.admin-bar .jhe-header[data-mode=mobile]{top:46px!important}

  /* فوتر (منوی پایین): پایین‌ترین نقطه، ثابت؛ ناحیهٔ نوار ژست هم همرنگ منو */
  .jmfm-bar{
    background:var(--jmfm-bg,#f6f6f6)!important;
    padding-bottom:var(--jh-sab)!important;
    left:0!important;right:0!important;bottom:0!important;
  }
  .jmfm-bar .jmfm-shell{width:100%!important;max-width:100%!important;margin-bottom:0!important}

  /* فضای خالی انتهای صفحه تا آخرین آیتم زیر منوی ثابت نرود */
  body{padding-bottom:calc(72px + var(--jh-sab))}

  /* حس اپلیکیشن: عناصر رابط انتخاب‌شدنی/کپی‌شدنی نباشند */
  .jhe-header,.jmfm-bar,.jh-mbar,.contact-box.jh-mbottom,
  .jhe-header *,.jmfm-bar *,.jh-mbar *,.contact-box.jh-mbottom *{
    -webkit-user-select:none;user-select:none;-webkit-touch-callout:none;
  }
  img{-webkit-user-drag:none;-webkit-touch-callout:none}
  a,button,[role=button],input[type=submit],label{touch-action:manipulation}
}

/* ----------- وقتی از «افزودن به صفحهٔ اصلی» نصب شده (standalone) ----------- */
@media (display-mode:standalone),(display-mode:fullscreen),(display-mode:minimal-ui){
  /* بدون کشش لاستیکی و بدون Pull-to-refresh مرورگر */
  html,body{overscroll-behavior-y:none}
  /* جلوگیری از زوم دوبل‌تپ و حس سایت */
  body{touch-action:pan-x pan-y}
}

/* ----------------------- دسکتاپ: صفحهٔ تک‌آگهی جمع‌وجور ----------------------- */
/* مرجع: چیدمان دیوار — ظرف ۱۲۴۰px، ستون اطلاعات ۵۰۵px، ستون عکس ۶۱۰px */
@media (min-width:768px){
  body.jh-divar.single-product .jh-ad-title{font-size:24px;line-height:1.6;margin:0 0 6px}
  body.jh-divar.single-product .jh-ad-meta{font-size:14px;line-height:1.8;margin:0 0 10px}
  body.jh-divar.single-product .jh-ad-price{font-size:17px;margin:0 0 10px}
  body.jh-divar.single-product .jh-crumbs{font-size:12px;margin:0 0 14px}
  body.jh-divar.single-product main.content .container{padding-top:18px}

  body.jh-divar.single-product .sidebar .contact-box .btn{height:42px;font-size:14px}
  body.jh-divar.single-product .sidebar .contact-box .contact_info{min-width:130px}
  body.jh-divar.single-product .sidebar .contact-box .jh-chat-btn{min-width:92px}

  body.jh-divar.single-product .sidebar,
  body.jh-divar.single-product .sidebar .box,
  body.jh-divar.single-product .charsoogh-content{font-size:14px}
  body.jh-divar.single-product .sidebar table td,
  body.jh-divar.single-product .sidebar table th,
  body.jh-divar.single-product .sidebar .jh-row,
  body.jh-divar.single-product .sidebar .list-group-item{padding-top:12px;padding-bottom:12px;font-size:14px}
  body.jh-divar.single-product .sidebar .box-title,
  body.jh-divar.single-product .charsoogh-content .box-title{font-size:15px}

  /* گالری: نسبت ۴:۳ و ارتفاع محدود، تصویر بندانگشتی کوچک */
  body.jh-divar.single-product .charsoogh-content .highlight-main .carousel-cell img{
    width:100%;height:auto;aspect-ratio:4/3;max-height:460px;object-fit:cover;
  }
  body.jh-divar.single-product .charsoogh-content .highlight-thumbs img{
    width:85px;height:85px;object-fit:cover;
  }
}

/* عرض ثابت دو ستون فقط وقتی جا هست (≥۱۲۸۰px)؛ کوچک‌تر از آن درصدی می‌ماند */
@media (min-width:1280px){
  body.jh-divar.single-product main.content .container{max-width:1240px}
  body.jh-divar.single-product [id^="product-"].product > .row.flex-md-row{justify-content:space-between}
  body.jh-divar.single-product [id^="product-"].product > .row.flex-md-row > .col-md-4{
    flex:0 0 505px;max-width:505px;padding-inline-end:0;
  }
  body.jh-divar.single-product [id^="product-"].product > .row.flex-md-row > .charsoogh-content{
    flex:0 0 610px;max-width:610px;
  }
}


/* ------------- کادر دیدگاه تک‌آگهی: هم‌اندازهٔ کادر یادداشت ------------- */
body.single-product .comments-area .comment-form-comment textarea{
  display:block;width:100%;min-height:150px;height:150px;resize:vertical;
  border:1px solid #bdbdbd;border-radius:4px;padding:14px;
  font:inherit;font-size:16px;line-height:1.7;color:var(--jh-tx,#3a3a3a);
  background:#fff;box-shadow:none;box-sizing:border-box;
}
body.single-product .comments-area .comment-form-comment textarea:focus{border-color:var(--jh-red,#a62626)}
body.single-product .comments-area .comment-form-comment{margin:0 0 8px}
body.single-product .comments-area .comment-reply-title{font-size:15px;margin:0 0 8px}
@media (max-width:767.98px){
  body.single-product .comments-area .comment-form-comment textarea{
    min-height:76px;height:76px;padding:9px 10px;font-size:14px;
  }
}
