/* NEXUS v741 — product gallery/offer/quantity fixes */

/* Desktop: main image + vertical thumbnail strip on the right, like a real product gallery */
@media (min-width:992px){
  html body.nxd-page .nxd-wrap .nxd-gallery{position:relative!important;}
  html body.nxd-page .nxd-wrap .nxd-g-top{
    position:relative!important;display:block!important;margin:0!important;padding:0 104px 0 0!important;
  }
  html body.nxd-page .nxd-wrap .nxd-stage{
    width:100%!important;max-width:none!important;height:min(600px,48vw)!important;min-height:420px!important;
    aspect-ratio:auto!important;margin:0!important;border:0!important;border-radius:0!important;box-shadow:none!important;
    background:#f6f7f9!important;overflow:hidden!important;
  }
  html[data-theme="dark"] body.nxd-page .nxd-wrap .nxd-stage{background:#111827!important}
  html body.nxd-page .nxd-wrap .nxd-stage .nx-gallery-main-img,
  html body.nxd-page .nxd-wrap .nxd-stage > #mainImg{
    display:block!important;width:100%!important;height:100%!important;max-width:100%!important;max-height:100%!important;
    object-fit:contain!important;object-position:center!important;padding:18px!important;margin:0!important;border-radius:0!important;
    background:transparent!important;
  }
  /* vertical thumbs */
  html body.nxd-page .nxd-wrap .nxd-thumbs{
    display:flex!important;position:absolute!important;top:0!important;right:0!important;width:88px!important;height:min(600px,48vw)!important;min-height:420px!important;
    margin:0!important;padding:0 0 0 2px!important;box-sizing:border-box!important;flex-direction:column!important;flex-wrap:nowrap!important;
    gap:10px!important;overflow-y:auto!important;overflow-x:hidden!important;scrollbar-width:thin!important;scrollbar-color:#9aa4b2 transparent!important;
    background:transparent!important;align-items:stretch!important;justify-content:flex-start!important;
  }
  html body.nxd-page .nxd-wrap .nxd-thumbs::-webkit-scrollbar{width:7px!important}
  html body.nxd-page .nxd-wrap .nxd-thumbs::-webkit-scrollbar-thumb{background:#aab3bf!important;border-radius:10px!important}
  html body.nxd-page .nxd-wrap .nxd-thumbs .nx-thumb{
    flex:0 0 84px!important;width:84px!important;height:84px!important;padding:3px!important;margin:0!important;
    border:1px solid #d7dce2!important;border-radius:10px!important;background:#fff!important;opacity:1!important;
    overflow:hidden!important;position:relative!important;cursor:pointer!important;
  }
  html body.nxd-page .nxd-wrap .nxd-thumbs .nx-thumb img{
    width:100%!important;height:100%!important;display:block!important;object-fit:contain!important;border-radius:7px!important;background:#fff!important;
  }
  html body.nxd-page .nxd-wrap .nxd-thumbs .nx-thumb.is-active{border:2px solid #2563eb!important;box-shadow:0 0 0 1px rgba(37,99,235,.12)!important}
  html body.nxd-page .nxd-wrap .nxd-thumbs .nx-thumb.is-active::after{display:none!important}
  /* no synthetic mobile gallery on desktop */
  html body.nxd-page .nx718-rail,html body.nxd-page .nx718-dots,html body.nxd-page .nx718-cnt,html body.nxd-page .nx718-vid{display:none!important}
  html body.nxd-page .nxd-gallery-benefits{margin-top:14px!important}
}

/* Mobile: keep the gallery full width, but remove count/dots and let the native horizontal rail scroll cleanly */
@media (max-width:991px){
  html body.nxd-page .nx718-dots,
  html body.nxd-page .nx718-cnt{display:none!important}
  html body.nxd-page .nxd-wrap .nxd-stage{touch-action:pan-x!important;overscroll-behavior-x:contain!important}
  html body.nxd-page .nx718-rail{touch-action:pan-x!important;overscroll-behavior-x:contain!important;scroll-behavior:smooth!important}
  /* Never let the discount ribbon overlap the product title */
  html body.nxd-page .nxd-wrap .nxd-offbar{
    position:relative!important;z-index:5!important;margin:0!important;padding:10px 14px!important;
    border-radius:14px 14px 0 0!important;min-height:48px!important;box-sizing:border-box!important;
  }
  html body.nxd-page .nxd-wrap .nxd-info{
    position:relative!important;z-index:6!important;margin:0!important;border-radius:0!important;
    padding-top:18px!important;
  }
  /* Quantity control: fixed, symmetric and vertically centered */
  html body.nxd-page .nxd-buyrow{display:flex!important;align-items:center!important;gap:10px!important;flex-wrap:nowrap!important}
  html body.nxd-page .nxd-buyrow .nxd-qty{width:116px!important;min-width:116px!important;flex:0 0 116px!important;height:48px!important;margin:0!important;display:block!important}
  html body.nxd-page .nxd-qty .nx-qty-wrap{
    width:116px!important;height:48px!important;min-height:48px!important;margin:0!important;padding:0!important;
    display:flex!important;flex-direction:row!important;align-items:stretch!important;justify-content:stretch!important;
    border:1px solid var(--nxd-line,#dfe5ec)!important;border-radius:12px!important;background:var(--nxd-card2,#f1f5f9)!important;overflow:hidden!important;
  }
  html body.nxd-page .nxd-qty .nx-qty-wrap button{
    flex:0 0 36px!important;width:36px!important;height:48px!important;min-height:48px!important;margin:0!important;padding:0!important;
    display:grid!important;place-items:center!important;border:0!important;background:transparent!important;color:var(--nxd-text,#0f172a)!important;
    font-size:21px!important;font-weight:800!important;line-height:1!important;
  }
  html body.nxd-page .nxd-qty .nx-qty-wrap input.nx-qty{
    flex:1 1 auto!important;width:auto!important;min-width:0!important;height:48px!important;margin:0!important;padding:0!important;
    border:0!important;border-radius:0!important;background:transparent!important;text-align:center!important;line-height:48px!important;
    font-size:16px!important;font-weight:800!important;appearance:textfield!important;-moz-appearance:textfield!important;
  }
  html body.nxd-page .nxd-qty .nx-qty-wrap input.nx-qty::-webkit-outer-spin-button,
  html body.nxd-page .nxd-qty .nx-qty-wrap input.nx-qty::-webkit-inner-spin-button{appearance:none!important;margin:0!important}
  html body.nxd-page .nxd-buyrow .nxd-cta{height:48px!important;min-height:48px!important;align-self:center!important}
}

@media (min-width:992px){
  /* legacy bundled slider must not replace the desktop gallery */
  html body.nxd-page .nx576-track{display:none!important}
  html body.nxd-page .nx576-on #mainImg{visibility:visible!important}
  html body.nxd-page .nx576-on .nx-gal-nav{display:none!important}
}

/* NEXUS v742 — final product-page cleanup */
/* حذف کامل مفهوم «مرجع خانواده» از UI؛ family_code فقط گروه رنگ/نسخه را نگه می‌دارد. */

/* پیشنهاد ویژه باید یک نوار مستقل باشد و هرگز روی عکس قرار نگیرد. */
html body.nxd-page .nxd-wrap .nxd-offbar{
  position:relative!important;
  inset:auto!important;
  display:flex!important;
  align-items:center!important;
  justify-content:space-between!important;
  width:100%!important;
  min-height:46px!important;
  margin:0 0 10px!important;
  padding:10px 14px!important;
  box-sizing:border-box!important;
  z-index:4!important;
  border-radius:12px!important;
  background:#fff1f2!important;
  color:#be123c!important;
  border:1px solid #fecdd3!important;
  overflow:visible!important;
}
html[data-theme="dark"] body.nxd-page .nxd-wrap .nxd-offbar{
  background:rgba(127,29,29,.22)!important;
  color:#fecdd3!important;
  border-color:rgba(248,113,113,.25)!important;
}
html body.nxd-page .nxd-wrap .nxd-offbar b{font-size:14px!important;font-weight:900!important}
html body.nxd-page .nxd-wrap .nxd-offbar span{font-size:13px!important;font-weight:900!important;direction:ltr!important}
/* یک نشان کافی است؛ نشان روی خود تصویر حذف شد تا روی عکس چیزی نیفتد. */
html body.nxd-page .nxd-wrap .nxd-stage-off{display:none!important}

/* کنترل تعداد کمی پایین‌تر از دکمه خرید بنشیند و تراز عمودی‌اش حفظ شود. */
html body.nxd-page .nxd-wrap .nxd-buyrow .nxd-qty{
  transform:translateY(5px)!important;
}
html body.nxd-page .nxd-wrap .nxd-buyrow .nxd-cta{
  transform:none!important;
}
@media(max-width:991px){
  html body.nxd-page .nxd-wrap .nxd-buyrow .nxd-qty{transform:translateY(5px)!important}
}

/* موبایل: گالری بدون فضای سفید اضافه و بدون تداخل اسلایدرهای قدیمی. */
@media(max-width:991px){
  html body.nxd-page .nxd-wrap .nxd-gallery{padding:0 0 10px!important;background:var(--nxd-card)!important}
  html body.nxd-page .nxd-wrap .nxd-g-top{padding:0!important;margin:0!important;gap:0!important}
  html body.nxd-page .nxd-wrap .nxd-stage{
    width:100vw!important;
    margin-inline-start:calc(50% - 50vw)!important;
    margin-inline-end:0!important;
    min-height:0!important;
    aspect-ratio:auto!important;
    height:auto!important;
    border-radius:0!important;
    border:0!important;
  }
  html body.nxd-page .nxd-wrap .nx718-slide img{
    max-height:68vh!important;
    height:auto!important;
  }
  html body.nxd-page .nxd-wrap .nxd-info{
    margin-top:0!important;
    padding-top:16px!important;
  }
  /* ابزارها در موبایل روی خود تصویر، ولی خارج از جریان عکس */
  html body.nxd-page .nxd-wrap .nxd-tools{z-index:12!important}
}

/* دسکتاپ: حذف کامل شمارنده بازدید از هر جای صفحه محصول. */
html body.nxd-page .nxd-chip-plain{display:none!important}
