/* NEXUS v765 — product UI polish: stable gallery, sticky section nav, trust rail, Plus card. */
body.nxd-page{--nx765-blue:#1677f5;--nx765-blue2:#38a4ff;--nx765-red:#e9364f;--nx765-border:rgba(100,140,190,.18);--nx765-soft:#f5f7fa}
html[data-theme="dark"] body.nxd-page{--nx765-border:rgba(150,190,240,.16);--nx765-soft:#111d2e}

/* 1) Gallery: the media itself is always centered; no layout-dependent left drift. */
html:root:root:root:root:root:root:root:root:root:root body.nxd-page .nxd-wrap .nxd-stage{display:flex!important;align-items:center!important;justify-content:center!important;box-sizing:border-box!important;line-height:0!important;overflow:hidden!important;width:100%!important;max-width:100%!important;min-height:420px!important}
html body.nxd-page .nxd-wrap .nxd-stage>#mainImg,
html body.nxd-page .nxd-wrap .nxd-stage .nx-gallery-main-img{display:block!important;width:auto!important;height:auto!important;max-width:100%!important;max-height:min(560px,70vh)!important;margin:0 auto!important;padding:0!important;object-fit:contain!important;object-position:center center!important;align-self:center!important;justify-self:center!important}
@media (max-width:991px){
  html:root:root:root:root:root:root:root:root:root:root body.nxd-page .nxd-wrap .nxd-stage{width:100%!important;max-width:100%!important;margin:0!important;padding:0!important;min-height:min(92vw,520px)!important;height:auto!important;aspect-ratio:auto!important;background:var(--nx765-soft)!important;border:0!important;border-radius:0!important}
  html body.nxd-page .nxd-wrap .nx718-rail{display:flex!important;align-items:stretch!important;width:100%!important;height:auto!important;min-height:0!important;overflow-x:auto!important;overflow-y:hidden!important;scroll-snap-type:x mandatory!important;direction:ltr!important}
  html body.nxd-page .nxd-wrap .nx718-slide{display:flex!important;align-items:center!important;justify-content:center!important;flex:0 0 100%!important;width:100%!important;min-width:100%!important;height:auto!important;min-height:0!important;padding:0!important;overflow:hidden!important;box-sizing:border-box!important}
  html body.nxd-page .nxd-wrap .nx718-slide img{display:block!important;width:auto!important;max-width:100%!important;height:auto!important;max-height:min(68vh,520px)!important;margin:0 auto!important;object-fit:contain!important;object-position:center center!important;align-self:center!important}
}

/* 2) Discount strip: independent row, never overlays the media. */
html body.nxd-page .nxd-wrap .nxd-offbar{position:relative!important;display:flex!important;align-items:center!important;justify-content:space-between!important;gap:12px!important;width:100%!important;min-height:48px!important;margin:0 0 10px!important;padding:9px 14px!important;box-sizing:border-box!important;border:1px solid rgba(233,54,79,.22)!important;border-radius:14px!important;background:linear-gradient(90deg,rgba(233,54,79,.10),rgba(255,255,255,.88))!important;color:#c62845!important;overflow:hidden!important;z-index:2!important}
html[data-theme="dark"] body.nxd-page .nxd-wrap .nxd-offbar{background:linear-gradient(90deg,rgba(233,54,79,.17),rgba(233,54,79,.07))!important;color:#ffb6c2!important;border-color:rgba(233,54,79,.28)!important}
html body.nxd-page .nxd-wrap .nxd-offbar b{font-size:14px!important;font-weight:900!important;white-space:nowrap!important}
html body.nxd-page .nxd-wrap .nxd-offbar>span{display:inline-flex!important;align-items:center!important;justify-content:center!important;flex:0 0 auto!important;min-width:46px!important;padding:3px 11px!important;border-radius:999px!important;background:var(--nx765-red)!important;color:#fff!important;font-size:12.5px!important;font-weight:900!important;line-height:1.6!important;direction:ltr!important;white-space:nowrap!important}
@media(max-width:520px){html body.nxd-page .nxd-wrap .nxd-offbar{min-height:44px!important;padding:8px 12px!important;margin-bottom:8px!important;border-radius:12px!important}html body.nxd-page .nxd-wrap .nxd-offbar b{font-size:13px!important}}

/* 3) Correct sticky offset: use the header's measured top-space, including the announcement bar. */
html body.nxd-page .nxd-tabs{position:sticky!important;top:max(var(--nx-top,72px),var(--nx681-bar,0px))!important;z-index:900!important;margin-top:18px!important;background:var(--p745-card,#fff)!important;border-bottom:1px solid var(--p745-bd,#e5e8ee)!important;box-shadow:0 6px 18px rgba(15,23,42,.06)!important;overscroll-behavior-x:contain!important}
html[data-theme="dark"] body.nxd-page .nxd-tabs{background:#0f1b2d!important;box-shadow:0 6px 18px rgba(0,0,0,.16)!important}
html body.nxd-page .nxd-tabs a{min-height:48px!important;display:inline-flex!important;align-items:center!important;justify-content:center!important}

/* 4) Mobile compact product header that appears only after the real title leaves the viewport. */
.nx765-mobile-product{display:none;box-sizing:border-box}
@media(max-width:760px){
  html body.nxd-page .nx765-mobile-product{position:fixed!important;top:max(var(--nx-top,62px),var(--nx681-bar,0px))!important;left:0!important;right:0!important;z-index:899!important;display:flex!important;align-items:center!important;justify-content:space-between!important;gap:10px!important;min-height:58px!important;padding:7px 12px!important;background:rgba(255,255,255,.96)!important;border-bottom:1px solid var(--p745-bd,#e5e8ee)!important;box-shadow:0 4px 16px rgba(15,23,42,.06)!important;transform:translateY(-120%)!important;opacity:0!important;pointer-events:none!important;transition:transform .18s ease,opacity .18s ease!important}
  html body.nxd-page .nx765-mobile-product.is-visible{transform:none!important;opacity:1!important;pointer-events:auto!important}
  html[data-theme="dark"] body.nxd-page .nx765-mobile-product{background:rgba(15,27,45,.97)!important}
  .nx765-mobile-product-main{display:flex;align-items:center;gap:9px;min-width:0}
  .nx765-mobile-product-main img{width:42px!important;height:42px!important;object-fit:contain!important;border-radius:8px!important;background:var(--nx765-soft)!important;flex:0 0 42px!important}
  .nx765-mobile-product-main span{font-size:12.5px;font-weight:800;line-height:1.65;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
  .nx765-mobile-product>strong{flex:0 0 auto;font-size:13px;color:var(--nx765-blue);white-space:nowrap}
  .nx765-mobile-product>strong small{font-size:10px;font-weight:700}
  html body.nxd-page .nxd-tabs{margin-top:0!important}
  body.nxd-page.nx765-summary-on .nxd-tabs{top:calc(max(var(--nx-top,62px),var(--nx681-bar,0px)) + 58px)!important}
}
@media(prefers-reduced-motion:reduce){html body.nxd-page .nx765-mobile-product{transition:none!important}}

/* 5) Three-image trust rail: lightweight existing assets, horizontal on phones. */
.nx765-proof-rail{margin:18px 0 8px;padding:0;overflow:hidden}
.nx765-proof-head{display:flex;align-items:end;justify-content:space-between;gap:18px;margin:0 0 12px;padding:0 2px}
.nx765-proof-head span{display:block;font-size:10px;font-weight:900;letter-spacing:1.5px;color:var(--nx765-blue);margin-bottom:2px}
.nx765-proof-head h2{margin:0;font-size:18px;line-height:1.5;font-weight:900}
.nx765-proof-head small{font-size:11.5px;color:var(--p746-mu,#6b7a90);white-space:nowrap}
.nx765-proof-track{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px}
.nx765-proof-card{display:flex;flex-direction:column;min-width:0;overflow:hidden;text-decoration:none;border:1px solid var(--p746-bd,#e5e8ee);border-radius:15px;background:var(--p746-card,#fff);color:var(--p746-tx,#14233b);box-shadow:0 5px 18px rgba(30,70,120,.05);transition:transform .16s ease,border-color .16s ease}
.nx765-proof-card:hover{transform:translateY(-1px);border-color:rgba(22,119,245,.28)}
.nx765-proof-card img{display:block;width:100%!important;height:auto!important;aspect-ratio:1000/181!important;object-fit:cover!important}
.nx765-proof-card span{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:8px 10px 9px;min-width:0}
.nx765-proof-card b{font-size:12.5px;line-height:1.6;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.nx765-proof-card small{font-size:10.5px;color:var(--p746-mu,#6b7a90);white-space:nowrap}
html[data-theme="dark"] .nx765-proof-card{background:#0f1b2d;color:#eaf2ff;border-color:rgba(150,190,240,.15)}
@media(max-width:760px){
  .nx765-proof-rail{margin-top:14px}
  .nx765-proof-head{align-items:flex-start;flex-direction:column;gap:2px;padding-inline:2px}
  .nx765-proof-head h2{font-size:16px}
  .nx765-proof-head small{font-size:11px;white-space:normal}
  .nx765-proof-track{display:flex;gap:9px;overflow-x:auto;overflow-y:hidden;padding:1px 2px 8px;scroll-snap-type:x proximity;scrollbar-width:none;-webkit-overflow-scrolling:touch}
  .nx765-proof-track::-webkit-scrollbar{display:none}
  .nx765-proof-card{flex:0 0 min(82vw,360px);scroll-snap-align:start}
  .nx765-proof-card span{padding:8px 10px}
}

/* 6) Nexus Plus: service-style, blue brand language, no fake payment flow. */
.nx765-plus{display:flex;align-items:center;gap:11px;margin-top:14px;padding:12px 13px;border:1px solid rgba(22,119,245,.18);border-radius:15px;background:linear-gradient(135deg,rgba(22,119,245,.10),rgba(56,164,255,.04));color:inherit;text-decoration:none;min-width:0}
.nx765-plus-icon{display:grid;place-items:center;flex:0 0 38px;width:38px;height:38px;border-radius:12px;background:linear-gradient(135deg,#1677f5,#3ca8ff);color:#fff;box-shadow:0 6px 16px rgba(22,119,245,.22)}
.nx765-plus-icon svg{width:20px;height:20px}
.nx765-plus-copy{display:flex;flex-direction:column;min-width:0;gap:1px}
.nx765-plus-copy b{font-size:13px;font-weight:900;color:var(--nx765-blue)}
.nx765-plus-copy small{font-size:11px;line-height:1.7;color:var(--p746-mu,#6b7a90);display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
.nx765-plus-arrow{margin-inline-start:auto;font-size:22px;color:var(--nx765-blue);line-height:1}
html[data-theme="dark"] .nx765-plus{background:linear-gradient(135deg,rgba(22,119,245,.16),rgba(56,164,255,.06));border-color:rgba(80,160,255,.22)}

/* Keep the existing fixed buy bar above the sticky sections and out of the image area. */
html body.nxd-page .nx689-sb{z-index:1200!important}
@media(max-width:760px){html body.nxd-page .nx689-sb .nxp-sb-in{min-height:64px!important}html body.nxd-page .nx689-sb button{background:var(--nx765-blue)!important}}

/* v766 — Digikala-style product media: 1 large image on the right + 2 previews on the left. */
html body.nxd-page .nxd-wrap .nxd-stage.nx-dk-gallery{
  position:relative!important;
  display:grid!important;
  grid-template-columns:minmax(0,2fr) minmax(120px,.82fr)!important;
  grid-template-rows:minmax(0,1fr)!important;
  grid-template-areas:"main side"!important;
  direction:rtl!important;
  gap:8px!important;
  width:100%!important;
  min-height:0!important;
  height:auto!important;
  aspect-ratio:1.28 / 1!important;
  padding:8px!important;
  box-sizing:border-box!important;
  overflow:hidden!important;
  border-radius:18px!important;
  background:var(--nx765-soft,#f5f7fa)!important;
}
html body.nxd-page .nx-dk-main-tile{
  grid-area:main!important;
  position:relative!important;
  min-width:0!important;
  min-height:0!important;
  display:flex!important;
  align-items:center!important;
  justify-content:center!important;
  overflow:hidden!important;
  border-radius:14px!important;
  background:#fff!important;
}
html[data-theme="dark"] body.nxd-page .nx-dk-main-tile{background:#111a28!important}
html body.nxd-page .nx-dk-main-tile>#mainImg,
html body.nxd-page .nx-dk-main-tile>.nx-gallery-main-img{
  position:relative!important;
  z-index:1!important;
  display:block!important;
  width:100%!important;
  height:100%!important;
  max-width:100%!important;
  max-height:100%!important;
  min-width:0!important;
  min-height:0!important;
  margin:0!important;
  padding:16px!important;
  box-sizing:border-box!important;
  object-fit:contain!important;
  object-position:center!important;
  border-radius:14px!important;
  background:transparent!important;
}
html body.nxd-page .nx-dk-main-tile>.nx-lq{position:absolute!important;z-index:0!important;width:24px!important;height:24px!important;max-width:none!important;max-height:none!important;left:50%!important;top:50%!important;transform:translate(-50%,-50%)!important;border-radius:6px!important;pointer-events:none!important}
html body.nxd-page .nx-dk-side{
  grid-area:side!important;
  min-width:0!important;
  min-height:0!important;
  display:grid!important;
  grid-template-rows:repeat(2,minmax(0,1fr))!important;
  gap:8px!important;
}
html body.nxd-page .nx-dk-side-tile{
  position:relative!important;
  min-width:0!important;
  min-height:0!important;
  width:100%!important;
  height:100%!important;
  padding:0!important;
  border:1px solid rgba(100,116,139,.14)!important;
  border-radius:14px!important;
  overflow:hidden!important;
  background:#fff!important;
  cursor:pointer!important;
  display:flex!important;
  align-items:center!important;
  justify-content:center!important;
  box-sizing:border-box!important;
  -webkit-tap-highlight-color:transparent!important;
}
html[data-theme="dark"] body.nxd-page .nx-dk-side-tile{background:#111a28!important;border-color:rgba(180,200,225,.14)!important}
html body.nxd-page .nx-dk-side-tile img{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:5px!important;box-sizing:border-box!important;background:transparent!important}
html body.nxd-page .nx-dk-side-tile::after{content:"";position:absolute;inset:0;border-radius:14px;box-shadow:inset 0 0 0 1px rgba(255,255,255,.28);pointer-events:none}
html body.nxd-page .nx-dk-more{position:absolute!important;inset:auto 8px 8px auto!important;z-index:2!important;min-width:42px!important;height:28px!important;padding:0 9px!important;display:inline-flex!important;align-items:center!important;justify-content:center!important;border-radius:999px!important;background:rgba(15,23,42,.72)!important;color:#fff!important;font-size:12px!important;font-weight:900!important;line-height:1!important;backdrop-filter:blur(5px)!important;-webkit-backdrop-filter:blur(5px)!important}
html body.nxd-page .nx-dk-progress{position:absolute!important;z-index:8!important;left:18px!important;right:18px!important;bottom:9px!important;height:3px!important;border-radius:999px!important;background:rgba(100,116,139,.22)!important;overflow:hidden!important;direction:ltr!important;pointer-events:none!important}
html body.nxd-page .nx-dk-progress-fill{display:block!important;height:100%!important;width:33.33%!important;border-radius:999px!important;background:#1677f5!important;transition:width .2s ease!important}
html body.nxd-page .nx-dk-count{position:absolute!important;z-index:9!important;left:18px!important;bottom:17px!important;display:inline-flex!important;align-items:baseline!important;gap:3px!important;min-width:52px!important;padding:5px 8px!important;border-radius:999px!important;background:rgba(15,23,42,.68)!important;color:#fff!important;font-size:10px!important;line-height:1!important;direction:ltr!important;backdrop-filter:blur(6px)!important;-webkit-backdrop-filter:blur(6px)!important;pointer-events:none!important}
html body.nxd-page .nx-dk-count b{font-size:12px!important;font-weight:900!important}.nx-dk-count span{opacity:.78;font-weight:700!important}
html body.nxd-page .nx-dk-gallery>.nx-gal-nav{display:none!important}
html body.nxd-page .nxd-thumbs{display:none!important}
@media(max-width:900px){
  html body.nxd-page .nxd-wrap .nxd-stage.nx-dk-gallery{width:100vw!important;max-width:none!important;margin-inline-start:calc(50% - 50vw)!important;margin-inline-end:0!important;aspect-ratio:1.28 / 1!important;padding:6px!important;gap:6px!important;border-radius:0!important;background:#f5f6f8!important}
  html body.nxd-page .nx-dk-main-tile,html body.nxd-page .nx-dk-side-tile{border-radius:12px!important}
  html body.nxd-page .nx-dk-main-tile>#mainImg,html body.nxd-page .nx-dk-main-tile>.nx-gallery-main-img{padding:10px!important;border-radius:12px!important}
  html body.nxd-page .nx-dk-side{gap:6px!important}
  html body.nxd-page .nx-dk-side-tile img{padding:3px!important}
  html body.nxd-page .nx-dk-progress{left:13px!important;right:13px!important;bottom:7px!important}
  html body.nxd-page .nx-dk-count{left:13px!important;bottom:15px!important}
}
@media(max-width:420px){
  html body.nxd-page .nxd-wrap .nxd-stage.nx-dk-gallery{aspect-ratio:1.18 / 1!important}
  html body.nxd-page .nx-dk-more{inset:auto 6px 6px auto!important;min-width:36px!important;height:25px!important;font-size:11px!important}
}
html body.nxd-page .nx-dk-side-count-0{display:none!important}
html body.nxd-page .nxd-stage.nx-dk-gallery:has(.nx-dk-side-count-0){grid-template-columns:minmax(0,1fr)!important;grid-template-areas:"main"!important}
html body.nxd-page .nx-dk-side-count-1{grid-template-rows:minmax(0,1fr)!important}


/* v768 — sticky product title + tabs: measured header stack, no overlap. */
html body.nxd-page{--nx768-header-h:var(--nx-top,62px)}
@media(max-width:760px){
  html body.nxd-page .nx765-mobile-product{
    top:var(--nx768-header-h)!important;
    min-height:56px!important;
    padding:6px 12px!important;
    border-bottom:1px solid var(--p745-bd,#e5e8ee)!important;
    box-shadow:0 5px 18px rgba(15,23,42,.08)!important;
    z-index:1100!important;
  }
  html body.nxd-page.nx765-summary-on .nxd-tabs{
    top:calc(var(--nx768-header-h) + 56px)!important;
  }
  html body.nxd-page .nxd-tabs{
    top:var(--nx768-header-h)!important;
    z-index:1050!important;
    margin-top:16px!important;
    min-height:48px!important;
    box-shadow:0 4px 16px rgba(15,23,42,.055)!important;
  }
  html body.nxd-page.nx765-summary-on .nxd-tabs{box-shadow:0 5px 18px rgba(15,23,42,.07)!important}
  html body.nxd-page .nx765-mobile-product-main span{font-size:12.5px!important;line-height:1.55!important}
  html body.nxd-page .nx765-mobile-product>strong{font-size:12.5px!important}
}

/* v768 — Nexus Plus entry card: purple membership language inspired by premium shopping services. */
.nx768-plus-entry{position:relative;overflow:hidden;border:1px solid rgba(124,58,237,.20)!important;background:linear-gradient(135deg,rgba(124,58,237,.11),rgba(168,85,247,.055) 55%,rgba(59,130,246,.04))!important}
.nx768-plus-entry:before{content:"";position:absolute;width:130px;height:130px;left:-55px;top:-65px;border-radius:50%;background:rgba(168,85,247,.14);filter:blur(2px);pointer-events:none}
.nx768-plus-icon{background:linear-gradient(135deg,#7c3aed,#a855f7)!important;box-shadow:0 7px 18px rgba(124,58,237,.25)!important}
.nx768-plus-copy b{color:#7c3aed!important}
.nx768-plus-arrow{color:#7c3aed!important}
html[data-theme="dark"] .nx768-plus-entry{background:linear-gradient(135deg,rgba(124,58,237,.18),rgba(168,85,247,.07) 55%,rgba(59,130,246,.05))!important;border-color:rgba(168,85,247,.22)!important}
html[data-theme="dark"] .nx768-plus-copy b,html[data-theme="dark"] .nx768-plus-arrow{color:#c084fc!important}
