/* NEXUS v344 — fix all-products mobile grid/list spacing */
.nxc-grid{box-sizing:border-box!important;width:100%!important;max-width:100%!important}
@media(max-width:768px){
  .nx-products-layout,.nx-products-main,#productsGrid{width:100%!important;max-width:100%!important;min-width:0!important}
  .nx-products-main{overflow:visible!important}
  .nxc-grid:not(.is-list){display:grid!important;grid-template-columns:repeat(var(--nxc-cols-mobile,2),minmax(0,1fr))!important;gap:10px!important;align-items:stretch!important}
  .nxc-grid:not(.is-list)>.nxc-card{width:100%!important;min-width:0!important;max-width:none!important;height:100%!important}
  .nxc-grid:not(.is-list)>.nxc-card .nxc-link{min-width:0!important;width:100%!important}
  .nxc-grid.is-list{display:flex!important;flex-direction:column!important;gap:10px!important;width:100%!important;margin:0!important}
  .nxc-grid.is-list>.nxc-card{display:grid!important;grid-template-columns:92px minmax(0,1fr) auto!important;direction:rtl!important;width:100%!important;max-width:none!important;min-width:0!important;min-height:96px!important;overflow:hidden!important}
  .nxc-grid.is-list .nxc-link{display:contents!important}
  .nxc-grid.is-list .nxc-media{grid-column:1!important;grid-row:1!important;width:92px!important;min-width:92px!important;max-width:92px!important;height:92px!important;margin:auto!important;border-radius:14px!important}
  .nxc-grid.is-list .nxc-body{grid-column:2!important;grid-row:1!important;min-width:0!important;width:auto!important;padding:8px 8px!important;overflow:hidden!important;justify-content:center!important}
  .nxc-grid.is-list .nxc-title{font-size:13px!important;line-height:1.5!important;display:-webkit-box!important;-webkit-line-clamp:2!important;-webkit-box-orient:vertical!important;overflow:hidden!important;white-space:normal!important}
  .nxc-grid.is-list .nxc-cond{max-width:100%!important;overflow:hidden!important;text-overflow:ellipsis!important;white-space:nowrap!important}
  .nxc-grid.is-list .nxc-prices{min-width:0!important}
  .nxc-grid.is-list .nxc-form{grid-column:3!important;grid-row:1!important;align-self:center!important;margin:0 4px!important;width:auto!important}
  .nxc-grid.is-list .nxc-btn{width:42px!important;min-width:42px!important;height:42px!important;padding:0!important;margin:0!important;border-radius:12px!important}
  .nxc-grid.is-list .nxc-btn span{display:none!important}
}


/* v355 — mobile products layout + polished grid/list switch */
@media (max-width:900px){
  .nx-products-layout{
    display:grid!important;
    grid-template-columns:minmax(0,1fr)!important;
    width:100%!important;
    max-width:100%!important;
    gap:10px!important;
  }
  .nx-products-main{
    grid-column:1!important;
    width:100%!important;
    min-width:0!important;
  }
  .nx-filter-sidebar{
    grid-column:1!important;
  }
}

.nx-view-toggle{
  display:inline-flex!important;
  align-items:stretch!important;
  gap:3px!important;
  padding:3px!important;
  border-radius:15px!important;
  border:1px solid rgba(120,170,230,.22)!important;
  background:rgba(15,28,48,.72)!important;
  box-shadow:0 6px 18px rgba(0,0,0,.10), inset 0 1px 0 rgba(255,255,255,.06)!important;
  margin-inline-start:0!important;
}
.nx-view-toggle button{
  position:relative!important;
  display:inline-flex!important;
  align-items:center!important;
  justify-content:center!important;
  gap:6px!important;
  width:auto!important;
  min-width:72px!important;
  height:38px!important;
  padding:0 11px!important;
  border-radius:11px!important;
  border:1px solid transparent!important;
  background:transparent!important;
  color:inherit!important;
  opacity:.72;
  font:inherit!important;
  font-size:12px!important;
  font-weight:700!important;
  transition:all .18s ease!important;
}
.nx-view-toggle button svg{width:17px!important;height:17px!important;flex:0 0 auto}
.nx-view-toggle button:hover{opacity:1!important;background:rgba(255,255,255,.06)!important}
.nx-view-toggle button.is-active{
  opacity:1!important;
  background:linear-gradient(135deg,rgba(20,132,255,.24),rgba(95,92,255,.18))!important;
  border-color:rgba(80,160,255,.38)!important;
  box-shadow:0 4px 12px rgba(0,110,255,.12), inset 0 1px 0 rgba(255,255,255,.08)!important;
}
html[data-theme="light"] .nx-view-toggle{
  background:#f3f6fb!important;
  border-color:rgba(40,90,150,.12)!important;
}
html[data-theme="light"] .nx-view-toggle button.is-active{
  background:#fff!important;
  border-color:rgba(30,120,220,.18)!important;
  box-shadow:0 4px 12px rgba(30,80,140,.10)!important;
}
@media(max-width:480px){
  .nx-view-toggle button{
    min-width:58px!important;
    height:36px!important;
    padding:0 8px!important;
    font-size:11px!important;
  }
  .nx-view-toggle button svg{width:16px!important;height:16px!important}
}
/* NEXUS v356 — HARD MOBILE PRODUCTS LAYOUT + CONTROLS FIX */
@media screen and (max-width:900px){
  html body .nx-products-section .nx-products-layout{display:block!important;width:100%!important;max-width:none!important;min-width:0!important;margin:0!important;padding:0!important;box-sizing:border-box!important;grid-template-columns:none!important;grid-template-areas:none!important;columns:auto!important}
  html body .nx-products-section .nx-filter-sidebar{position:fixed!important;inset:0 0 0 auto!important;width:min(320px,88vw)!important;max-width:88vw!important;height:100dvh!important;max-height:none!important;margin:0!important;z-index:12010!important}
  html body .nx-products-section .nx-products-main{display:block!important;width:100%!important;max-width:none!important;min-width:0!important;margin:0!important;padding:0!important;box-sizing:border-box!important;float:none!important;position:relative!important;grid-column:auto!important}
  html body .nx-products-section #productsGrid{display:block!important;width:100%!important;max-width:none!important;min-width:0!important;margin:0!important;padding:0!important;box-sizing:border-box!important;float:none!important}
  html body .nx-products-section #nxProductsGrid{width:100%!important;max-width:none!important;min-width:0!important;margin:0!important;padding:0!important;box-sizing:border-box!important}
  html body .nx-products-section .nxc-grid:not(.is-list){display:grid!important;width:100%!important;max-width:none!important;min-width:0!important;margin-inline:0!important;padding-inline:0!important;grid-template-columns:repeat(var(--nxc-cols-mobile,2),minmax(0,1fr))!important;gap:10px!important;box-sizing:border-box!important}
}
@media screen and (max-width:768px){
  html body .nx-products-section .nx-filter-toolbar{display:flex!important;flex-wrap:wrap!important;align-items:center!important;justify-content:space-between!important;gap:8px!important;width:100%!important;margin:0 0 12px!important;padding:0!important;box-sizing:border-box!important}
  html body .nx-products-section .nx-filter-open{order:1!important;height:44px!important;min-height:44px!important;padding:0 15px!important;border-radius:15px!important;font-size:13px!important;font-weight:800!important;white-space:nowrap!important;box-shadow:0 5px 16px rgba(30,90,160,.10)!important}
  html body .nx-products-section .nx-filter-count{order:2!important;margin-inline-start:auto!important;margin-inline-end:2px!important;font-size:13px!important;font-weight:700!important;white-space:nowrap!important}
  html body .nx-products-section .nx-view-toggle{order:3!important;display:inline-flex!important;flex:0 0 auto!important;align-items:center!important;gap:3px!important;padding:3px!important;min-height:44px!important;border-radius:15px!important;background:rgba(255,255,255,.72)!important;border:1px solid rgba(55,120,190,.16)!important;box-shadow:0 6px 18px rgba(30,80,140,.10)!important;box-sizing:border-box!important}
  html[data-theme="dark"] body .nx-products-section .nx-view-toggle{background:rgba(12,25,43,.86)!important;border-color:rgba(110,180,240,.18)!important}
  html body .nx-products-section .nx-view-toggle button{min-width:62px!important;width:auto!important;height:36px!important;padding:0 9px!important;border-radius:11px!important;font-size:11px!important;font-weight:800!important}
  html body .nx-products-section .nx-view-toggle button.is-active{background:linear-gradient(135deg,#2f8dff,#6b63ff)!important;color:#fff!important;border-color:transparent!important;box-shadow:0 5px 12px rgba(47,141,255,.20)!important}
  html body .nx-products-section .nx-cols-toggle{order:4!important;display:inline-flex!important;align-items:center!important;gap:3px!important;min-height:44px!important;padding:3px 4px!important;border-radius:15px!important;background:rgba(255,255,255,.72)!important;border:1px solid rgba(55,120,190,.16)!important;box-shadow:0 6px 18px rgba(30,80,140,.10)!important;box-sizing:border-box!important}
  html[data-theme="dark"] body .nx-products-section .nx-cols-toggle{background:rgba(12,25,43,.86)!important;border-color:rgba(110,180,240,.18)!important}
  html body .nx-products-section .nx-cols-toggle::before{content:"چیدمان"!important;display:inline-flex!important;align-items:center!important;padding:0 5px!important;font-size:10px!important;font-weight:800!important;opacity:.72!important;white-space:nowrap!important}
  html body .nx-products-section .nx-cols-toggle button{display:inline-flex!important;align-items:center!important;justify-content:center!important;min-width:30px!important;width:30px!important;height:36px!important;padding:0!important;border-radius:10px!important;border:1px solid transparent!important;background:transparent!important;color:inherit!important;font-size:11px!important;font-weight:800!important}
  html body .nx-products-section .nx-cols-toggle button.is-active{background:linear-gradient(135deg,#2f8dff,#6b63ff)!important;color:#fff!important;border-color:transparent!important;box-shadow:0 5px 12px rgba(47,141,255,.20)!important}
  html body .nx-products-section .nx-sort-form{order:5!important;flex:1 1 100%!important;width:100%!important;margin:0!important;padding:0!important;display:flex!important;align-items:center!important;gap:7px!important}
  html body .nx-products-section .nx-sort-form label{font-size:11px!important;opacity:.68!important}
  html body .nx-products-section .nx-sort-form select{flex:1 1 auto!important;min-width:0!important;width:100%!important;height:40px!important;border-radius:13px!important;font-size:12px!important}
}
@media screen and (max-width:430px){
  html body .nx-products-section .nx-view-toggle button{min-width:52px!important;padding:0 7px!important}
  html body .nx-products-section .nx-cols-toggle::before{font-size:9px!important;padding:0 3px!important}
  html body .nx-products-section .nx-cols-toggle button{min-width:27px!important;width:27px!important}
}
