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

/* ------------------------------------------------------------------ */
/* ۱) فونت و ریست پایه اجزای افزونه                                     */
/* ------------------------------------------------------------------ */

.ny-icon-button,
.ny-primary-button,
.ny-link-button,
.ny-compare-bar,
.ny-compare-bar *,
.ny-compare-page,
.ny-compare-page *,
.ny-modal,
.ny-modal *,
.ny-global-toast{
  font-family:inherit;
  font-feature-settings:normal;
}

/* دکمه‌های بسته‌شدن با کاراکتر × : فونت متنی سایت گاهی این گلیف را ندارد. */
.ny-modal-x,
.ny-compare-chip-remove,
.ny-compare-col-remove,
.ny-compare-bar-close{
  font-family:Tahoma,Arial,"Segoe UI",sans-serif !important;
}

/* ------------------------------------------------------------------ */
/* ۲) دکمه‌های آیکونی (قالب گاهی padding/min-width تحمیل می‌کند)         */
/* ------------------------------------------------------------------ */

.ny-icon-button,
.ny-gallery-actions .ny-icon-button,
.ny-loop-actions .ny-icon-button,
.ny-related-actions .ny-icon-button,
.ny-wishlist-actions .ny-icon-button,
.ny-compare-col-actions .ny-icon-button{
  box-sizing:border-box !important;
  flex:0 0 auto !important;
  min-width:0 !important;
  min-height:0 !important;
  max-width:none !important;
  padding:0 !important;
  margin:0 !important;
  line-height:0 !important;
  font-size:0 !important;
  letter-spacing:normal !important;
  text-transform:none !important;
  box-shadow:none !important;
  appearance:none !important;
  -webkit-appearance:none !important;
}

.ny-gallery-actions .ny-icon-button{
  width:34px !important;
  height:34px !important;
  border:1px solid #dde2e8 !important;
  border-radius:8px !important;
  background:#fff !important;
  color:#53606f !important;
  display:grid !important;
  place-items:center !important;
}
.ny-gallery-actions .ny-icon-button .ny-icon{width:16px !important;height:16px !important}
.ny-gallery-actions .ny-icon-button .ny-icon svg{width:100% !important;height:100% !important}

.ny-gallery-actions .ny-icon-button:hover,
.ny-gallery-actions .ny-icon-button:focus-visible{
  border-color:var(--ny-yellow,#ffbd00) !important;
  color:var(--ny-navy,#001e46) !important;
  background:#fff !important;
}
.ny-gallery-actions .ny-icon-button:focus{outline:0}
.ny-gallery-actions .ny-icon-button:focus-visible{
  outline:2px solid rgba(255,189,0,.55);outline-offset:2px;
}

/* حالت فعال: پس‌زمینه‌ی روشن، نه پرکردن کامل با رنگ قالب. */
.ny-gallery-actions .ny-icon-button.is-active,
.ny-gallery-actions .ny-compare-button.is-active,
.ny-gallery-actions .ny-wishlist-button.is-active{
  background:#fff9e8 !important;
  border-color:var(--ny-yellow,#ffbd00) !important;
}
.ny-gallery-actions .ny-wishlist-button.is-active{color:var(--ny-red,#ec174c) !important}
.ny-gallery-actions .ny-compare-button.is-active{color:var(--ny-navy,#001e46) !important}

/* ------------------------------------------------------------------ */
/* ۳) گالری و تصویر اصلی محصول                                          */
/* ------------------------------------------------------------------ */

.ny-gallery-wrap{padding:0 42px 0 0 !important}
.ny-gallery-actions{
  position:absolute;right:0;top:2px;
  display:flex;flex-direction:column;gap:8px;z-index:3;
  width:34px;
}
.ny-main-image-button{
  width:100% !important;
  max-width:100% !important;
  min-height:0 !important;
  background:#fff !important;
  border:0 !important;
  box-shadow:none !important;
}
.ny-main-image{width:100% !important;height:100% !important;max-width:100% !important;object-fit:contain}

/* بندانگشتی‌ها هم نباید با استایل عمومی button پخش شوند. */
.ny-thumbs{flex-wrap:wrap;max-width:100%}
.ny-thumbs .ny-thumb{
  box-sizing:border-box !important;
  flex:0 0 auto !important;
  width:50px !important;height:50px !important;
  min-width:0 !important;min-height:0 !important;
  padding:4px !important;margin:0 !important;
  font-size:0 !important;line-height:0 !important;
  box-shadow:none !important;
  appearance:none !important;-webkit-appearance:none !important;
}
.ny-thumbs .ny-thumb img{width:100% !important;height:100% !important;object-fit:contain}
.ny-thumbs .ny-thumb:hover,
.ny-thumbs .ny-thumb.is-active{
  border-color:var(--ny-yellow,#ffbd00) !important;
  box-shadow:0 0 0 2px rgba(255,189,0,.18) !important;
}

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

/* ------------------------------------------------------------------ */
/* ۴) نوار شناور مقایسه                                                 */
/* ------------------------------------------------------------------ */

.ny-compare-bar{
  position:fixed;inset-inline:0;bottom:0;z-index:2147483000;
  background:#fff;border-top:1px solid var(--ny-border,#e1e5eb);
  box-shadow:0 -8px 30px rgba(3,29,65,.12);
  transform:translateY(105%);transition:transform .28s ease;
  direction:rtl;
  padding-bottom:env(safe-area-inset-bottom,0);
  max-height:min(46vh,260px);
  overflow:auto;
  overscroll-behavior:contain;
}
.ny-compare-bar[hidden]{display:none}
.ny-compare-bar.is-visible{transform:translateY(0)}

.ny-compare-bar-inner{
  width:min(1180px,calc(100% - 24px));margin:0 auto;
  display:flex;align-items:center;gap:14px;padding:10px 0;
  flex-wrap:nowrap;
}

.ny-compare-bar-head{
  display:flex;align-items:center;gap:8px;
  flex:0 0 auto;font-size:13px;color:var(--ny-navy,#001e46);
  white-space:nowrap;
}
.ny-compare-bar-head .ny-icon{width:20px !important;height:20px !important;flex:0 0 20px}

/* چیپ‌ها به‌جای شکستن به چند سطر، افقی اسکرول می‌شوند. */
.ny-compare-bar-items{
  display:flex;gap:8px;flex:1 1 auto;min-width:0;
  flex-wrap:nowrap;
  overflow-x:auto;
  overflow-y:hidden;
  padding:2px 1px;
  scrollbar-width:thin;
  -webkit-overflow-scrolling:touch;
}
.ny-compare-bar-items::-webkit-scrollbar{height:4px}
.ny-compare-bar-items::-webkit-scrollbar-thumb{background:#d5dae1;border-radius:4px}

.ny-compare-chip{
  position:relative;display:flex;align-items:center;gap:7px;
  padding:6px 8px 6px 26px;
  border:1px solid var(--ny-border,#e1e5eb);border-radius:9px;background:#fff;
  flex:0 0 auto;width:186px;max-width:56vw;min-height:48px;
}
.ny-compare-chip img{width:34px !important;height:34px !important;flex:0 0 34px;object-fit:contain}
.ny-compare-chip>span{
  flex:1;min-width:0;font-size:11px;line-height:1.7;
  overflow:hidden;text-overflow:ellipsis;white-space:nowrap;
}
.ny-compare-chip.is-empty{
  justify-content:center;width:104px;border-style:dashed;color:#b6bcc5;
  font-size:11px;padding:6px 10px;
}

/* دکمه × داخل چیپ: قالب اجازه ندارد بزرگش کند. */
.ny-compare-chip-remove{
  position:absolute;top:5px;left:5px;
  box-sizing:border-box !important;
  width:20px !important;height:20px !important;
  min-width:0 !important;min-height:0 !important;max-width:none !important;
  padding:0 !important;margin:0 !important;
  display:grid !important;place-items:center !important;
  border:0 !important;border-radius:50% !important;
  background:#f0f2f5 !important;color:#7a828d !important;
  font-size:14px !important;line-height:1 !important;font-weight:700;
  cursor:pointer;box-shadow:none !important;
  appearance:none !important;-webkit-appearance:none !important;
  transition:background .18s ease,color .18s ease;
}
.ny-compare-chip-remove:hover,
.ny-compare-chip-remove:focus-visible{
  background:var(--ny-red,#ec174c) !important;color:#fff !important;
}

.ny-compare-bar-actions{
  display:flex;align-items:center;gap:10px;flex:0 0 auto;
}
.ny-compare-bar-actions .ny-compare-clear{
  background:none !important;border:0 !important;padding:0 !important;
  color:var(--ny-muted,#737b87);font-size:12px;cursor:pointer;white-space:nowrap;
  box-shadow:none !important;
}
.ny-compare-bar-actions .ny-compare-clear:hover{color:var(--ny-red,#ec174c)}
.ny-compare-go{
  display:inline-flex !important;align-items:center;justify-content:center;
  padding:10px 20px !important;border-radius:8px !important;
  background:var(--ny-yellow,#ffbd00) !important;color:var(--ny-navy,#001e46) !important;
  font-weight:800;font-size:13px;text-decoration:none;white-space:nowrap;
}
.ny-compare-go:hover{filter:brightness(.95);color:var(--ny-navy,#001e46) !important}

/* بستن کامل نوار */
.ny-compare-bar-close{
  box-sizing:border-box !important;
  flex:0 0 auto;
  width:30px !important;height:30px !important;
  min-width:0 !important;min-height:0 !important;
  padding:0 !important;margin:0 !important;
  display:grid !important;place-items:center !important;
  border:1px solid var(--ny-border,#e1e5eb) !important;border-radius:8px !important;
  background:#fff !important;color:#7a828d !important;
  font-size:17px !important;line-height:1 !important;
  cursor:pointer;box-shadow:none !important;
  appearance:none !important;-webkit-appearance:none !important;
  transition:.18s ease;
}
.ny-compare-bar-close:hover,
.ny-compare-bar-close:focus-visible{
  background:var(--ny-red,#ec174c) !important;
  border-color:var(--ny-red,#ec174c) !important;
  color:#fff !important;
}

/* فاصله‌ی انتهای صفحه بر اساس ارتفاع واقعی نوار (JS مقدار را ست می‌کند). */
body.ny-has-compare-bar{
  padding-bottom:var(--ny-compare-bar-h,88px) !important;
}

@media (max-width:860px){
  .ny-compare-bar-inner{
    flex-wrap:wrap;gap:8px;padding:9px 0;
    width:min(1180px,calc(100% - 20px));
  }
  /* سطر ۱: عنوان + دکمه بستن، سطر ۲: چیپ‌ها، سطر ۳: اکشن‌ها */
  .ny-compare-bar-head{
    order:1;flex:1 1 auto;width:auto !important;
    justify-content:flex-start;font-size:12px;
  }
  .ny-compare-bar-close{order:2;flex:0 0 auto}
  .ny-compare-bar-items{order:3;flex:1 1 100%;width:100% !important}
  .ny-compare-bar-actions{
    order:4;flex:1 1 100%;width:100% !important;justify-content:space-between;
  }
  .ny-compare-go{flex:1;margin-inline-start:10px}
}

@media (max-width:600px){
  /* جای خالی‌ها روی موبایل فقط فضا می‌گیرند. */
  .ny-compare-chip.is-empty{display:none}
}

@media (max-width:420px){
  .ny-compare-chip{width:160px;min-height:44px}
  .ny-compare-chip img{width:30px !important;height:30px !important;flex:0 0 30px}
  .ny-compare-chip.is-empty{width:84px}
  .ny-compare-bar-head strong{font-size:12px}
}

/* ------------------------------------------------------------------ */
/* ۵) مودال (نمودار قیمت، یادآور، اشتراک‌گذاری)                          */
/* ------------------------------------------------------------------ */

/* هدر چسبان سایت z-index بسیار بالایی دارد؛ مودال باید بالاتر بنشیند. */
.ny-modal{
  position:fixed;inset:0;z-index:2147483600;
  display:flex;align-items:center;justify-content:center;
  padding:16px;
  overscroll-behavior:contain;
}
.ny-modal-backdrop{position:absolute;inset:0;background:rgba(4,18,38,.62)}

.ny-modal-box{
  position:relative;background:#fff;border-radius:14px;
  width:min(680px,100%);
  max-width:100%;
  max-height:calc(100dvh - 32px);
  display:flex;flex-direction:column;overflow:hidden;
  box-shadow:0 30px 70px rgba(3,29,65,.3);
}
@supports not (height:100dvh){
  .ny-modal-box{max-height:calc(100vh - 32px)}
}

.ny-modal-header{flex:0 0 auto}
.ny-modal-content{
  padding:18px;overflow:auto;overscroll-behavior:contain;
  -webkit-overflow-scrolling:touch;min-height:0;
}

.ny-modal-x{
  box-sizing:border-box !important;
  flex:0 0 auto;
  width:32px !important;height:32px !important;
  min-width:0 !important;min-height:0 !important;
  padding:0 !important;margin:0 !important;
  display:grid !important;place-items:center !important;
  border:1px solid var(--ny-border,#e1e5eb) !important;border-radius:8px !important;
  background:#fff !important;color:#7a828d !important;
  font-size:19px !important;line-height:1 !important;
  cursor:pointer;box-shadow:none !important;
  appearance:none !important;-webkit-appearance:none !important;
}
.ny-modal-x:hover,.ny-modal-x:focus-visible{
  background:var(--ny-red,#ec174c) !important;
  border-color:var(--ny-red,#ec174c) !important;color:#fff !important;
}

@media (max-width:640px){
  .ny-modal{padding:0;align-items:flex-end}
  .ny-modal-box{
    width:100%;
    border-radius:16px 16px 0 0;
    max-height:92dvh;
    padding-bottom:env(safe-area-inset-bottom,0);
  }
  @supports not (height:100dvh){
    .ny-modal-box{max-height:92vh}
  }
  .ny-modal-content{padding:14px}
}

/* ------------------------------------------------------------------ */
/* ۶) نمودار و آمار قیمت                                                */
/* ------------------------------------------------------------------ */

.ny-price-ranges{display:flex;gap:7px;margin-bottom:14px;flex-wrap:wrap}
.ny-price-range-button{
  box-sizing:border-box !important;
  min-width:0 !important;min-height:0 !important;
  padding:7px 15px !important;margin:0 !important;
  border:1px solid var(--ny-border,#e1e5eb) !important;border-radius:7px !important;
  background:#fff !important;color:var(--ny-muted,#737b87) !important;
  font-size:12px !important;font-family:inherit !important;line-height:1.4 !important;
  cursor:pointer;box-shadow:none !important;
  appearance:none !important;-webkit-appearance:none !important;
}
.ny-price-range-button.is-active{
  background:var(--ny-navy,#001e46) !important;
  border-color:var(--ny-navy,#001e46) !important;
  color:#fff !important;font-weight:700;
}

.ny-price-stats{
  display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px;margin-bottom:12px;
}
.ny-price-stat{min-width:0}
.ny-price-stat strong{
  font-size:14px;overflow-wrap:anywhere;word-break:break-word;line-height:1.5;
}

.ny-price-trend{overflow-wrap:anywhere}

.ny-chart-holder{
  position:relative;overflow:hidden;
  background:#fff;border:1px solid var(--ny-border,#e1e5eb);border-radius:10px;padding:6px;
}
.ny-chart-canvas{display:block;width:100%;min-width:0}
/* ارتفاع از viewBox می‌آید تا نمودار در هر عرضی نسبت درست داشته باشد. */
.ny-price-chart{
  display:block;width:100% !important;height:auto !important;max-width:100%;
}
.ny-chart-tooltip{max-width:calc(100% - 16px);white-space:normal}
/* [hidden] در برابر display:flex پایه بی‌اثر می‌شد. */
.ny-chart-tooltip[hidden],
.ny-compare-search-results[hidden],
.ny-compare-bar[hidden]{display:none !important}

@media (max-width:600px){
  .ny-price-stats{grid-template-columns:repeat(2,minmax(0,1fr))}
  .ny-price-stat strong{font-size:13px}
  .ny-price-ranges .ny-price-range-button{flex:1 1 auto;padding:8px 10px !important}
}

@media (max-width:380px){
  .ny-price-stats{grid-template-columns:1fr 1fr;gap:6px}
}

/* ------------------------------------------------------------------ */
/* ۷) صفحه مقایسه                                                       */
/* ------------------------------------------------------------------ */

.ny-compare-page{width:min(1180px,calc(100% - 24px));margin:0 auto}
.ny-compare-table-wrap{
  overflow-x:auto;-webkit-overflow-scrolling:touch;overscroll-behavior-x:contain;
}
.ny-compare-col-remove{
  box-sizing:border-box !important;
  width:26px !important;height:26px !important;
  min-width:0 !important;min-height:0 !important;
  padding:0 !important;margin:0 !important;
  display:grid !important;place-items:center !important;
  border:1px solid var(--ny-border,#e1e5eb) !important;border-radius:50% !important;
  background:#fff !important;color:#8a9099 !important;
  font-size:15px !important;line-height:1 !important;
  box-shadow:none !important;
  appearance:none !important;-webkit-appearance:none !important;
}
.ny-compare-col-remove:hover{
  background:var(--ny-red,#ec174c) !important;
  border-color:var(--ny-red,#ec174c) !important;color:#fff !important;
}
.ny-compare-share-input,.ny-share-copy input{min-width:0}

/* ------------------------------------------------------------------ */
/* ۸) اشتراک‌گذاری و توست                                               */
/* ------------------------------------------------------------------ */

.ny-share-grid{grid-template-columns:repeat(4,minmax(0,1fr))}
@media (max-width:520px){
  .ny-share-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
  .ny-share-copy{flex-wrap:wrap}
  .ny-share-copy input{flex:1 1 100%}
}

.ny-global-toast{
  z-index:2147483601;
  bottom:calc(26px + var(--ny-compare-bar-h,0px));
  max-width:min(360px,calc(100% - 32px));
}

/* ------------------------------------------------------------------ */
/* ۹) کاهش انیمیشن                                                      */
/* ------------------------------------------------------------------ */

@media (prefers-reduced-motion:reduce){
  .ny-compare-bar,.ny-modal-box,.ny-global-toast{transition:none;animation:none}
}
