/**
 * اصلاح ابعاد دکمه‌های کنار گالری و ریسپانسیو صفحه محصول.
 *
 * آخرین استایل صفحه محصول است؛ استایل عمومی button در قالب، این دکمه‌ها را
 * بزرگ و بدشکل می‌کرد و روی تصویر اصلی می‌افتاد. به همین دلیل ابعاد اینجا
 * با !important تثبیت شده است.
 */

/* ------------------------------------------------------------------ */
/* دکمه‌های ابزار کنار تصویر                                            */
/* ------------------------------------------------------------------ */

.nyp-product-page .nyp-gallery-actions{
  position:absolute;top:10px;right:9px;left:auto;z-index:4;
  display:flex;flex-direction:column;gap:6px;
  width:32px;
}

.nyp-product-page .nyp-gallery-actions button{
  box-sizing:border-box !important;
  flex:0 0 auto !important;
  width:32px !important;
  height:32px !important;
  min-width:0 !important;
  min-height:0 !important;
  max-width:none !important;
  max-height:none !important;
  padding:0 !important;
  margin:0 !important;
  border:1px solid var(--nyp-border,#e3e7ec) !important;
  border-radius:7px !important;
  background:#fff !important;
  color:#68707c !important;
  display:grid !important;
  place-items:center !important;
  font-size:0 !important;
  line-height:0 !important;
  letter-spacing:normal !important;
  text-transform:none !important;
  box-shadow:none !important;
  cursor:pointer;
  appearance:none !important;
  -webkit-appearance:none !important;
  transition:border-color .18s ease,background .18s ease;
}

.nyp-product-page .nyp-gallery-actions button svg,
.nyp-product-page .nyp-gallery-actions button img,
.nyp-product-page .nyp-gallery-actions button .nyp-asset-icon{
  width:17px !important;
  height:17px !important;
  display:block !important;
  object-fit:contain;
}

.nyp-product-page .nyp-gallery-actions button:hover{
  border-color:#aab9c7 !important;
  background:#f5f8fb !important;
}
.nyp-product-page .nyp-gallery-actions button:focus{outline:0}
.nyp-product-page .nyp-gallery-actions button:focus-visible{
  outline:2px solid rgba(255,191,23,.6);
  outline-offset:2px;
}

/* حالت انتخاب‌شده: هایلایت ملایم، نه پرشدن کامل با رنگ قالب. */
.nyp-product-page .nyp-gallery-actions button[aria-pressed="true"],
.nyp-product-page .nyp-gallery-actions button.is-active{
  background:#fff7e2 !important;
  border-color:var(--nyp-yellow,#ffbf17) !important;
  color:#062d59 !important;
}
.nyp-product-page .nyp-gallery-actions button:active{
  transform:scale(.97);
}

/* دکمه‌های ردیف اشتراک‌گذاری هم همین مشکل را دارند. */
.nyp-product-page .nyp-share-line a,
.nyp-product-page .nyp-share-line button,
.nyp-product-page .nyp-social-actions button{
  box-sizing:border-box !important;
  flex:0 0 auto !important;
  width:24px !important;height:24px !important;
  min-width:0 !important;min-height:0 !important;
  padding:0 !important;margin:0 !important;
  font-size:0 !important;line-height:0 !important;
  box-shadow:none !important;
  appearance:none !important;-webkit-appearance:none !important;
}
.nyp-product-page .nyp-share-line svg,
.nyp-product-page .nyp-social-actions svg,
.nyp-product-page .nyp-share-line .nyp-asset-icon,
.nyp-product-page .nyp-social-actions .nyp-asset-icon{
  width:13px !important;height:13px !important;display:block !important;
}

/* بندانگشتی‌ها */
.nyp-product-page .nyp-thumb{
  box-sizing:border-box !important;
  flex:0 0 50px !important;
  height:48px !important;
  min-width:0 !important;min-height:0 !important;
  padding:3px !important;margin:0 !important;
  font-size:0 !important;line-height:0 !important;
  appearance:none !important;-webkit-appearance:none !important;
}
.nyp-product-page .nyp-thumb img{width:100% !important;height:100% !important;object-fit:contain}
.nyp-product-page .nyp-gallery-arrow{
  box-sizing:border-box !important;
  width:26px !important;height:36px !important;
  min-width:0 !important;min-height:0 !important;
  padding:0 !important;margin:0 !important;
  font-size:14px !important;line-height:1 !important;
}

/* تصویر اصلی هرگز نباید از ظرفش بزند بیرون. */
.nyp-product-page .nyp-main-image-wrap{min-width:0}
.nyp-product-page .nyp-main-image-wrap img{
  max-width:100% !important;max-height:100% !important;
  width:auto !important;height:auto !important;
}

/* ------------------------------------------------------------------ */
/* ریسپانسیو                                                           */
/* ------------------------------------------------------------------ */

/* روی موبایل دکمه‌ها به یک ردیف افقی زیر گالری می‌روند تا عرض تصویر
   اصلی آزاد شود. */
@media (max-width:600px){
  .nyp-product-page .nyp-gallery-actions{
    position:static;
    width:auto;
    order:3;
    flex-direction:row;
    justify-content:center;
    flex-wrap:wrap;
    gap:8px;
    margin-top:10px;
  }
  .nyp-product-page .nyp-gallery-actions button{
    width:36px !important;height:36px !important;
  }
  .nyp-product-page .nyp-main-image-wrap{
    order:1;
    height:240px !important;
    padding:8px !important;
  }
  .nyp-product-page .nyp-thumb-row{order:2;margin-top:10px !important}
}

/* جلوگیری از اسکرول افقی کل صفحه محصول */
.nyp-product-page .nyp-container,
.nyp-product-page .nyp-product-main,
.nyp-product-page .nyp-summary,
.nyp-product-page .nyp-gallery{min-width:0;max-width:100%}
.nyp-product-page .nyp-content img,
.nyp-product-page .nyp-content iframe,
.nyp-product-page .nyp-content table{max-width:100% !important}
.nyp-product-page .nyp-content table{display:block;overflow-x:auto}
