/* BAYS B2B PRO — Smart Ordering final polish
 * Replace: assets/css/smart-order-polish.css
 * Scope: only [data-bays-smart-order]
 */

[data-bays-smart-order]{
  display:grid!important;
  gap:18px!important;
  min-width:0!important;
}
[data-bays-smart-order] *{box-sizing:border-box}

/* FILTER BAR — search/category never overlap */
[data-bays-smart-order] .bays-smart-order-toolbar{
  display:block!important;
  width:100%!important;
  padding:16px!important;
  overflow:visible!important;
}
[data-bays-smart-order] .bays-smart-order-search{
  display:grid!important;
  grid-template-columns:minmax(320px,1.6fr) minmax(220px,.75fr) minmax(150px,auto) auto!important;
  gap:12px!important;
  align-items:end!important;
  width:100%!important;
  min-width:0!important;
}
[data-bays-smart-order] .bays-smart-order-search label{
  display:grid!important;
  grid-template-rows:auto 46px!important;
  gap:7px!important;
  min-width:0!important;
  width:100%!important;
  margin:0!important;
}
[data-bays-smart-order] .bays-smart-order-search label>span{
  display:block!important;
  position:static!important;
  margin:0!important;
  padding:0!important;
  color:#475569!important;
  font-size:11px!important;
  font-weight:800!important;
  line-height:1.25!important;
}
[data-bays-smart-order] .bays-smart-order-search input,
[data-bays-smart-order] .bays-smart-order-search select{
  display:block!important;
  position:static!important;
  width:100%!important;
  min-width:0!important;
  max-width:100%!important;
  height:46px!important;
  margin:0!important;
  padding:0 14px!important;
  border:1px solid #dfe5ed!important;
  border-radius:12px!important;
  background:#fff!important;
  color:#0f172a!important;
  box-shadow:none!important;
}
[data-bays-smart-order] .bays-smart-order-search button,
[data-bays-smart-order] .bays-smart-order-clear{
  align-self:end!important;
  height:46px!important;
  margin:0!important;
  white-space:nowrap!important;
}

/* THREE PREMIUM MODE CARDS */
[data-bays-smart-order] .bays-smart-order-tabs{
  display:grid!important;
  grid-template-columns:repeat(3,minmax(0,1fr))!important;
  gap:12px!important;
  width:100%!important;
  padding:0!important;
  overflow:visible!important;
  border:0!important;
  border-radius:0!important;
  background:transparent!important;
  box-shadow:none!important;
}
[data-bays-smart-order] .bays-smart-order-tabs a{
  position:relative!important;
  display:grid!important;
  grid-template-columns:44px minmax(0,1fr) auto!important;
  grid-template-areas:
    "icon title badge"
    "icon desc badge"!important;
  gap:3px 12px!important;
  align-items:center!important;
  min-width:0!important;
  min-height:88px!important;
  padding:15px 16px!important;
  border:1px solid #e2e8f0!important;
  border-radius:15px!important;
  background:#fff!important;
  color:#0f172a!important;
  box-shadow:0 7px 22px rgba(15,23,42,.045)!important;
  text-decoration:none!important;
  transform:none!important;
  transition:border-color .18s ease,background .18s ease,box-shadow .18s ease,transform .18s ease!important;
}
[data-bays-smart-order] .bays-smart-order-tabs a::before{
  grid-area:icon!important;
  content:"▦"!important;
  display:grid!important;
  place-items:center!important;
  width:44px!important;
  height:44px!important;
  border-radius:12px!important;
  background:#eef5ff!important;
  color:#1768ef!important;
  font-size:20px!important;
  font-weight:900!important;
}
[data-bays-smart-order] .bays-smart-order-tabs a:nth-child(2)::before{content:"↺"!important}
[data-bays-smart-order] .bays-smart-order-tabs a:nth-child(3)::before{content:"★"!important}
[data-bays-smart-order] .bays-smart-order-tabs a strong{
  grid-area:title!important;
  display:block!important;
  min-width:0!important;
  color:inherit!important;
  font-size:14px!important;
  font-weight:900!important;
  line-height:1.25!important;
}
[data-bays-smart-order] .bays-smart-order-tabs a small{
  grid-area:desc!important;
  display:block!important;
  min-width:0!important;
  color:#64748b!important;
  font-size:11px!important;
  line-height:1.35!important;
}
[data-bays-smart-order] .bays-smart-order-tabs a::after{
  grid-area:badge!important;
  content:"›"!important;
  display:grid!important;
  place-items:center!important;
  width:28px!important;
  height:28px!important;
  border:1px solid #e2e8f0!important;
  border-radius:999px!important;
  color:#64748b!important;
  font-size:18px!important;
}
[data-bays-smart-order] .bays-smart-order-tabs a:hover{
  border-color:#bdd3f7!important;
  box-shadow:0 10px 28px rgba(23,104,239,.08)!important;
  transform:translateY(-1px)!important;
}
[data-bays-smart-order] .bays-smart-order-tabs a.active{
  border-color:#8db7f5!important;
  background:#f4f8ff!important;
  color:#0f5fd7!important;
  box-shadow:0 10px 28px rgba(23,104,239,.09)!important;
}
[data-bays-smart-order] .bays-smart-order-tabs a.active::after{
  border-color:#b9d2f7!important;
  background:#1768ef!important;
  color:#fff!important;
}

/* PRODUCT LIST — preserve existing layout */
[data-bays-smart-order] .bays-smart-order-row{
  grid-template-columns:minmax(310px,2fr) minmax(90px,.55fr) minmax(120px,.7fr) 104px minmax(120px,.7fr) 136px!important;
  gap:16px!important;
  padding-right:20px!important;
}

/* SAME QUANTITY STEPPER LANGUAGE AS PRODUCT DETAIL */
[data-bays-smart-order] .bays-smart-order-qty{
  display:block!important;
  width:102px!important;
  min-width:102px!important;
  height:42px!important;
  margin:0!important;
  padding:0!important;
  border:0!important;
  background:transparent!important;
  box-shadow:none!important;
}
[data-bays-smart-order] .bays-smart-order-qty>div{
  display:grid!important;
  grid-template-columns:32px 38px 32px!important;
  width:102px!important;
  height:42px!important;
  overflow:hidden!important;
  border:1px solid #dbe3ee!important;
  border-radius:10px!important;
  background:#fff!important;
  box-shadow:0 2px 7px rgba(15,23,42,.035)!important;
}
[data-bays-smart-order] .bays-smart-order-qty button{
  display:grid!important;
  place-items:center!important;
  width:32px!important;
  min-width:32px!important;
  height:42px!important;
  margin:0!important;
  padding:0!important;
  border:0!important;
  border-radius:0!important;
  background:#f8fafc!important;
  color:#1768ef!important;
  box-shadow:none!important;
  font-size:16px!important;
  font-weight:900!important;
  line-height:1!important;
}
[data-bays-smart-order] .bays-smart-order-qty button:hover{
  background:#eef5ff!important;
}
[data-bays-smart-order] .bays-smart-order-qty input{
  display:block!important;
  width:38px!important;
  min-width:38px!important;
  height:42px!important;
  margin:0!important;
  padding:0!important;
  border:0!important;
  border-right:1px solid #e2e8f0!important;
  border-left:1px solid #e2e8f0!important;
  border-radius:0!important;
  background:#fff!important;
  color:#0f172a!important;
  -webkit-text-fill-color:#0f172a!important;
  box-shadow:none!important;
  text-align:center!important;
  font-size:13px!important;
  font-weight:900!important;
  line-height:42px!important;
  appearance:textfield!important;
}
[data-bays-smart-order] .bays-smart-order-qty input::-webkit-outer-spin-button,
[data-bays-smart-order] .bays-smart-order-qty input::-webkit-inner-spin-button{
  -webkit-appearance:none!important;
  margin:0!important;
}

/* MINIMAL ROW ACTION */
[data-bays-smart-order] .bays-smart-order-add{
  display:inline-flex!important;
  align-items:center!important;
  justify-content:center!important;
  justify-self:start!important;
  gap:7px!important;
  width:132px!important;
  min-width:132px!important;
  max-width:132px!important;
  height:40px!important;
  min-height:40px!important;
  margin:0!important;
  padding:0 12px!important;
  border:1px solid #cfe0fa!important;
  border-radius:10px!important;
  background:#fff!important;
  color:#1768ef!important;
  box-shadow:none!important;
  font-size:11px!important;
  font-weight:900!important;
  line-height:1!important;
  white-space:nowrap!important;
  transform:none!important;
}
[data-bays-smart-order] .bays-smart-order-add svg{
  display:block!important;
  width:15px!important;
  height:15px!important;
  flex:0 0 15px!important;
}
[data-bays-smart-order] .bays-smart-order-add:hover{
  border-color:#afc9f2!important;
  background:#f6f9ff!important;
  color:#0b57d0!important;
}
[data-bays-smart-order] .bays-smart-order-add:disabled{
  border-color:#e2e7ee!important;
  background:#f7f8fa!important;
  color:#a2aab7!important;
}

@media(max-width:1180px){
  [data-bays-smart-order] .bays-smart-order-search{
    grid-template-columns:minmax(0,1fr) 220px auto!important;
  }
  [data-bays-smart-order] .bays-smart-order-clear{display:none!important}
  [data-bays-smart-order] .bays-smart-order-row{
    grid-template-columns:minmax(250px,1.7fr) 86px 110px 104px 110px 136px!important;
  }
}
@media(max-width:900px){
  [data-bays-smart-order] .bays-smart-order-search{
    grid-template-columns:1fr 1fr!important;
  }
  [data-bays-smart-order] .bays-smart-order-search button{
    grid-column:1/-1!important;
  }
  [data-bays-smart-order] .bays-smart-order-tabs{
    grid-template-columns:1fr!important;
  }
  [data-bays-smart-order] .bays-smart-order-row{
    grid-template-columns:1fr 1fr!important;
  }
  [data-bays-smart-order] .bays-smart-order-add{
    grid-column:1/-1!important;
    width:100%!important;
    max-width:none!important;
    justify-self:stretch!important;
  }
}
@media(max-width:560px){
  [data-bays-smart-order] .bays-smart-order-search{
    grid-template-columns:1fr!important;
  }
  [data-bays-smart-order] .bays-smart-order-search button{
    grid-column:auto!important;
  }
  [data-bays-smart-order] .bays-smart-order-row{
    grid-template-columns:1fr!important;
  }
}

/* BAYS B2B PRO — Smart Ordering search width hotfix
 * Upload as: assets/css/smart-order-search-fix.css
 * Or append to the end of smart-order-polish.css
 */

@media (min-width: 1181px) {
  [data-bays-smart-order] .bays-smart-order-search {
    grid-template-columns:
      minmax(280px, 1.25fr)
      minmax(280px, .85fr)
      minmax(150px, auto)
      auto !important;
  }
}

