/* ============================================================
   NEXUS v370 — UI Fix pack
   - دسته‌ها موبایل: ردیف افقی + عکس ثابت و واضح
   - همه محصولات دسکتاپ: پر کردن عرض، بدون فضای خالی
   - جزئیات محصول موبایل: ریسپانسیو کامل
   - جداول مشخصات: تم روز/شب طبیعی
   ============================================================ */

/* ---------- ۱) دسته‌بندی‌ها — عکس ثابت و شفاف ---------- */
html body .nx-home-category-avatar,
.nx-home-category-avatar {
  position: relative !important;
  overflow: hidden !important;
  border-radius: 50% !important;
  flex-shrink: 0 !important;
}

html body .nx-home-category-avatar img,
.nx-home-category-avatar img {
  position: absolute !important;
  top: 50% !important;
  left: 50% !important;
  right: auto !important;
  bottom: auto !important;
  width: 86% !important;
  height: 86% !important;
  max-width: none !important;
  max-height: none !important;
  transform: translate(-50%, -50%) !important;
  border-radius: 50% !important;
  object-fit: cover !important;
  object-position: center center !important;
  display: block !important;
  z-index: 2 !important;
}

html body .nx-home-category-avatar .nx-home-category-icon,
.nx-home-category-avatar .nx-home-category-icon {
  position: absolute !important;
  top: 50% !important;
  left: 50% !important;
  right: auto !important;
  bottom: auto !important;
  width: 86% !important;
  height: 86% !important;
  transform: translate(-50%, -50%) !important;
  border-radius: 50% !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  z-index: 2 !important;
}

html body .nx-home-category strong,
.nx-home-category strong {
  writing-mode: horizontal-tb !important;
  text-orientation: mixed !important;
  direction: rtl !important;
  text-align: center !important;
  white-space: normal !important;
  transform: none !important;
}

@media (max-width: 600px) {
  html body .nx-home-category-grid,
  .nx-home-category-grid {
    display: flex !important;
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    justify-content: flex-start !important;
    gap: 12px !important;
    padding: 8px 14px 12px !important;
    scrollbar-width: none !important;
  }
  .nx-home-category-grid::-webkit-scrollbar { display: none !important; }

  html body a.nx-home-category,
  .nx-home-category {
    flex: 0 0 76px !important;
    width: 76px !important;
    min-width: 76px !important;
    max-width: 76px !important;
  }
}

/* ---------- ۲) صفحه همه محصولات — پر کردن عرض ---------- */
html body .nx-products-layout,
.nx-products-layout {
  display: block !important;
  grid-template-columns: none !important;
  width: 100% !important;
  max-width: 100% !important;
  gap: 0 !important;
}

html body .nx-filter-sidebar {
  display: none !important;
}

html body .nx-products-main,
.nx-products-main {
  display: block !important;
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  margin: 0 !important;
  float: none !important;
}

/* گرید کارت‌ها: ستون‌های مساوی، پر عرض */
html body .nxc-grid,
.nxc-grid,
#nxProductsGrid {
  display: grid !important;
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
  gap: 14px !important;
  grid-template-columns: repeat(var(--nxc-cols, 4), minmax(0, 1fr)) !important;
}

html body .nxc-grid > .nxc-card,
.nxc-grid > .nxc-card {
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
}

@media (max-width: 1100px) {
  html body .nxc-grid,
  #nxProductsGrid {
    grid-template-columns: repeat(var(--nxc-cols, 3), minmax(0, 1fr)) !important;
  }
}
@media (max-width: 800px) {
  html body .nxc-grid,
  #nxProductsGrid {
    grid-template-columns: repeat(var(--nxc-cols-mobile, 2), minmax(0, 1fr)) !important;
    gap: 10px !important;
  }
}
@media (max-width: 420px) {
  html body .nxc-grid,
  #nxProductsGrid {
    grid-template-columns: repeat(var(--nxc-cols-mobile, 2), minmax(0, 1fr)) !important;
    gap: 8px !important;
  }
}

/* حالت لیست تمام‌عرض */
html body .nxc-grid.is-list {
  display: flex !important;
  flex-direction: column !important;
  grid-template-columns: none !important;
}
html body .nxc-grid.is-list > .nxc-card {
  width: 100% !important;
  max-width: 100% !important;
}

/* ---------- ۳) جزئیات محصول موبایل — ریسپانسیو ---------- */
@media (max-width: 900px) {
  html body .product-detail,
  .product-detail {
    display: flex !important;
    flex-direction: column !important;
    grid-template-columns: none !important;
    gap: 18px !important;
    width: 100% !important;
    max-width: 100% !important;
    padding: 0 12px !important;
    box-sizing: border-box !important;
  }

  html body .product-detail .gallery,
  html body .product-detail .nx-buy-panel,
  html body .product-detail .buy-box,
  .product-detail > * {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
  }

  .gallery-main img,
  .gallery-main {
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    max-height: 55vh !important;
    object-fit: contain !important;
  }

  .nx-buy-row {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 10px !important;
    width: 100% !important;
  }
  .nx-buy-row .nx-qty {
    flex: 0 0 72px !important;
    max-width: 90px !important;
  }
  .nx-buy-row .nx-buy-btn,
  .nx-buy-row .btn {
    flex: 1 1 auto !important;
    min-width: 140px !important;
  }

  .nx-product-bottom {
    width: 100% !important;
    padding: 0 12px 24px !important;
    box-sizing: border-box !important;
  }

  .nx-product-tabs {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 6px !important;
  }
  .nx-product-tabs .nx-tab {
    flex: 1 1 auto !important;
    min-width: 100px !important;
    font-size: 13px !important;
  }

  .nx-family-grid {
    display: flex !important;
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    gap: 10px !important;
    -webkit-overflow-scrolling: touch !important;
  }
  .nx-family-item {
    flex: 0 0 auto !important;
    min-width: 110px !important;
  }

  .nx-key-specs-public,
  .nx-full-specs-wrap {
    width: 100% !important;
    max-width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
  }
}

@media (max-width: 520px) {
  .product-detail { padding: 0 10px !important; gap: 14px !important; }
  .nx-detail-price { font-size: 15px !important; }
  .nx-product-attrs { font-size: 12px !important; }
  .nx-buy-chip { font-size: 11px !important; }
}

/* ---------- ۴) جداول مشخصات — تم روز/شب طبیعی ---------- */
table.product-attributes.shop_attributes {
  width: 100% !important;
  border-collapse: collapse !important;
  border-radius: 12px !important;
  overflow: hidden !important;
  border: 1px solid rgba(100, 150, 200, 0.18) !important;
  background: transparent !important;
  box-shadow: none !important;
}

table.product-attributes.shop_attributes th,
table.product-attributes.shop_attributes td {
  padding: 11px 14px !important;
  font-size: 13px !important;
  line-height: 1.55 !important;
  border-bottom: 1px solid rgba(100, 150, 200, 0.12) !important;
  vertical-align: top !important;
  text-align: right !important;
}

table.product-attributes.shop_attributes th {
  width: 38% !important;
  font-weight: 700 !important;
  color: inherit !important;
  opacity: 0.85 !important;
  background: rgba(80, 140, 220, 0.06) !important;
}

table.product-attributes.shop_attributes td {
  font-weight: 500 !important;
  color: inherit !important;
  background: transparent !important;
}

table.product-attributes.shop_attributes tbody tr:last-child th,
table.product-attributes.shop_attributes tbody tr:last-child td {
  border-bottom: 0 !important;
}

html[data-theme="light"] table.product-attributes.shop_attributes {
  border-color: rgba(30, 60, 100, 0.12) !important;
  background: #fff !important;
}
html[data-theme="light"] table.product-attributes.shop_attributes th {
  background: #f4f7fb !important;
  color: #1e293b !important;
  opacity: 1 !important;
}
html[data-theme="light"] table.product-attributes.shop_attributes td {
  color: #334155 !important;
}
html[data-theme="light"] table.product-attributes.shop_attributes th,
html[data-theme="light"] table.product-attributes.shop_attributes td {
  border-bottom-color: rgba(30, 60, 100, 0.08) !important;
}

html[data-theme="dark"] table.product-attributes.shop_attributes,
html:not([data-theme="light"]) table.product-attributes.shop_attributes {
  border-color: rgba(120, 170, 230, 0.16) !important;
  background: rgba(10, 18, 32, 0.55) !important;
}
html[data-theme="dark"] table.product-attributes.shop_attributes th,
html:not([data-theme="light"]) table.product-attributes.shop_attributes th {
  background: rgba(40, 80, 140, 0.18) !important;
  color: #c8daf0 !important;
}
html[data-theme="dark"] table.product-attributes.shop_attributes td,
html:not([data-theme="light"]) table.product-attributes.shop_attributes td {
  color: #e8f0ff !important;
}

/* گروه‌های مشخصات کامل */
.nx-spec-group {
  border: 1px solid rgba(100, 150, 200, 0.14) !important;
  border-radius: 12px !important;
  margin-bottom: 10px !important;
  overflow: hidden !important;
  background: transparent !important;
}
.nx-spec-group-head {
  padding: 10px 14px !important;
  background: rgba(80, 140, 220, 0.08) !important;
  border-bottom: 1px solid rgba(100, 150, 200, 0.1) !important;
}
.nx-spec-group-head h3 {
  margin: 0 !important;
  font-size: 13.5px !important;
  font-weight: 800 !important;
}
.nx-spec-item {
  display: flex !important;
  justify-content: space-between !important;
  gap: 12px !important;
  padding: 9px 14px !important;
  font-size: 13px !important;
  border-bottom: 1px solid rgba(100, 150, 200, 0.08) !important;
}
.nx-spec-item:last-child { border-bottom: 0 !important; }
.nx-spec-key { opacity: 0.8; font-weight: 600; }
.nx-spec-val { font-weight: 500; text-align: left; }

html[data-theme="light"] .nx-spec-group {
  background: #fff !important;
  border-color: rgba(30, 60, 100, 0.1) !important;
}
html[data-theme="light"] .nx-spec-group-head {
  background: #f4f7fb !important;
  border-bottom-color: rgba(30, 60, 100, 0.08) !important;
}
html[data-theme="light"] .nx-spec-item {
  border-bottom-color: rgba(30, 60, 100, 0.06) !important;
  color: #1e293b !important;
}

/* هدر مشخصات کلیدی — ساده‌تر، کمتر «AI» */
.nx-key-specs-public-head {
  background: transparent !important;
  border: 0 !important;
  padding: 8px 4px 10px !important;
}
.nx-key-specs-public-kicker {
  font-size: 11px !important;
  opacity: 0.65 !important;
  letter-spacing: 0.02em !important;
  font-weight: 600 !important;
}
.nx-key-specs-public-head h2 {
  font-size: 15px !important;
  font-weight: 800 !important;
  margin: 2px 0 0 !important;
}
.nx-key-specs-public-count {
  font-size: 11px !important;
  opacity: 0.55 !important;
  background: rgba(80, 140, 220, 0.1) !important;
  border-radius: 999px !important;
  padding: 3px 9px !important;
}

/* دکمه مشخصات کامل — تم‌سازگار */
.nx-full-specs-toggle {
  background: rgba(80, 140, 220, 0.1) !important;
  border: 1px solid rgba(100, 150, 200, 0.2) !important;
  color: inherit !important;
  border-radius: 12px !important;
  font-weight: 700 !important;
}
html[data-theme="light"] .nx-full-specs-toggle {
  background: #f0f5fb !important;
  border-color: rgba(30, 60, 100, 0.12) !important;
  color: #0f172a !important;
}
.nx-full-specs-panel {
  background: transparent !important;
  border-color: rgba(100, 150, 200, 0.12) !important;
}
html[data-theme="light"] .nx-full-specs-panel {
  background: #fafbfd !important;
  border-color: rgba(30, 60, 100, 0.1) !important;
}

/* ---------- ۵) عکس مغازه / showcase ---------- */
.showcase-section {
  display: grid !important;
  grid-template-columns: 1fr 1fr !important;
  align-items: center !important;
  gap: 24px !important;
  width: 100% !important;
}
.showcase-image {
  width: 100% !important;
  min-height: 200px !important;
  border-radius: 20px !important;
  overflow: hidden !important;
  background: rgba(8, 16, 30, 0.5) !important;
}
.showcase-image img {
  display: block !important;
  width: 100% !important;
  height: auto !important;
  min-height: 220px !important;
  max-height: 360px !important;
  object-fit: cover !important;
  object-position: center center !important;
}
@media (max-width: 700px) {
  .showcase-section {
    grid-template-columns: 1fr !important;
  }
  .showcase-image img {
    min-height: 180px !important;
    max-height: 260px !important;
  }
}

/* ============================================================
   v370.2 — contact mobile + login pill + product tap + light tables
   ============================================================ */

/* تماس موبایل — پنل ثابت و قابل‌کلیک */
.nx-contact-wrap { position: relative !important; z-index: 13000 !important; }
.nx-contact-btn {
  position: relative !important;
  z-index: 13001 !important;
  pointer-events: auto !important;
  touch-action: manipulation !important;
  min-width: 40px !important;
  min-height: 40px !important;
}
.nx-contact-panel {
  z-index: 13010 !important;
  pointer-events: auto !important;
}
@media (max-width: 768px) {
  .nx-contact-wrap.is-open .nx-contact-panel,
  .nx-contact-panel:not([hidden]) {
    position: fixed !important;
    top: auto !important;
    bottom: 16px !important;
    left: 12px !important;
    right: 12px !important;
    width: auto !important;
    max-width: none !important;
    max-height: min(70vh, 480px) !important;
    overflow-y: auto !important;
    border-radius: 16px !important;
    padding: 14px !important;
    background: rgba(8, 16, 30, 0.98) !important;
    border: 1px solid rgba(100, 170, 230, 0.25) !important;
    box-shadow: 0 12px 40px rgba(0,0,0,.45) !important;
    display: block !important;
  }
  html[data-theme="light"] .nx-contact-wrap.is-open .nx-contact-panel,
  html[data-theme="light"] .nx-contact-panel:not([hidden]) {
    background: #fff !important;
    border-color: rgba(30, 60, 100, 0.15) !important;
    color: #0f172a !important;
  }
  .nx-header-actions .nx-contact-btn {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    pointer-events: auto !important;
  }
}

/* دکمه ورود — بزرگ‌تر با حلقه دایره‌ای مثل اپ */
a.nx-login-pill,
.nx-header-actions a.nx-login-pill {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 8px !important;
  min-height: 44px !important;
  padding: 0 18px 0 16px !important;
  border-radius: 999px !important;
  font-weight: 800 !important;
  font-size: 14px !important;
  text-decoration: none !important;
  color: #fff !important;
  background: linear-gradient(135deg, #0a6bff 0%, #5b5cff 100%) !important;
  border: 2px solid rgba(255,255,255,.35) !important;
  box-shadow:
    0 0 0 3px rgba(10, 107, 255, 0.22),
    0 6px 16px rgba(10, 107, 255, 0.28) !important;
  position: relative !important;
  z-index: 5 !important;
  transition: transform .15s ease, box-shadow .15s ease !important;
}
a.nx-login-pill:hover {
  transform: translateY(-1px) scale(1.03) !important;
  box-shadow:
    0 0 0 4px rgba(10, 107, 255, 0.28),
    0 8px 20px rgba(10, 107, 255, 0.35) !important;
}
a.nx-login-pill svg,
a.nx-login-pill .nx-icon {
  width: 20px !important;
  height: 20px !important;
  color: #fff !important;
  stroke: #fff !important;
}
html[data-theme="light"] a.nx-login-pill {
  color: #fff !important;
  border-color: rgba(255,255,255,.5) !important;
}
@media (max-width: 600px) {
  a.nx-login-pill {
    min-height: 42px !important;
    padding: 0 14px !important;
    font-size: 13px !important;
  }
}

/* کلیک محصول موبایل — لینک کارت همیشه قابل لمس */
html body .nxc-card {
  position: relative !important;
  z-index: 1 !important;
}
html body .nxc-card .nxc-link {
  position: relative !important;
  z-index: 2 !important;
  pointer-events: auto !important;
  touch-action: manipulation !important;
  -webkit-tap-highlight-color: rgba(47,141,255,.15) !important;
}
html body .nxc-card .nxc-form {
  position: relative !important;
  z-index: 3 !important;
  pointer-events: auto !important;
}
html body .nxc-card .nxc-btn {
  pointer-events: auto !important;
  touch-action: manipulation !important;
}
/* جلوگیری از پوشش کل کارت توسط لایه نامرئی */
html body .nxc-grid .nxc-card::before,
html body .nxc-grid .nxc-card::after {
  pointer-events: none !important;
}

/* جدول مشخصات — تم روز خوانا */
html[data-theme="light"] table.product-attributes.shop_attributes {
  background: #ffffff !important;
  border: 1px solid #d8e2ef !important;
  color: #0f172a !important;
}
html[data-theme="light"] table.product-attributes.shop_attributes th {
  background: #eef3f9 !important;
  color: #0f172a !important;
  opacity: 1 !important;
  font-weight: 800 !important;
}
html[data-theme="light"] table.product-attributes.shop_attributes td {
  background: #ffffff !important;
  color: #1e293b !important;
  font-weight: 600 !important;
}
html[data-theme="light"] table.product-attributes.shop_attributes th,
html[data-theme="light"] table.product-attributes.shop_attributes td {
  border-bottom: 1px solid #e2e8f0 !important;
}
html[data-theme="light"] .nx-key-specs-public-head h2 {
  color: #0f172a !important;
}
html[data-theme="light"] .nx-key-specs-public-kicker {
  color: #475569 !important;
  opacity: 1 !important;
}
html[data-theme="light"] .nx-spec-group {
  background: #fff !important;
  border-color: #d8e2ef !important;
}
html[data-theme="light"] .nx-spec-group-head {
  background: #eef3f9 !important;
  color: #0f172a !important;
}
html[data-theme="light"] .nx-spec-item {
  color: #1e293b !important;
  border-bottom-color: #e8eef6 !important;
}
html[data-theme="light"] .nx-spec-key { color: #334155 !important; }
html[data-theme="light"] .nx-spec-val { color: #0f172a !important; }
