/* ABIS 3.5.1: compact quantity panels. No artificial card stretching.
   Existing desktop card dimensions and form/cart/checkout remain unchanged. */
@media (max-width:680px) {
  /* Restore proportionate card height: make room by reducing media size,
     not by increasing every card to fit an oversized overlay. */
  body .abis-hp-card:not(.abis-hp-card--featured):not(.abis-hp-card--insight) {
    box-sizing:border-box; height:auto; min-height:238px!important; padding:9px;
  }
  body .abis-hp-card:not(.abis-hp-card--featured):not(.abis-hp-card--insight) .abis-hp-card__image {
    height:125px!important; flex-basis:125px!important;
    min-height:0!important; padding:6px; margin-bottom:5px;
  }
  body .abis-hp-card:not(.abis-hp-card--featured):not(.abis-hp-card--insight) .abis-hp-card__name {
    min-height:39px; line-height:1.55!important; margin-bottom:5px!important;
  }
  /* Compact quantity panels for standard home cards and shop cards;
     special offers retain their supplied 3.5.0 layout below. */
  body .abis-hp-card .abis-hp-card__purchase-panel,
  body .abis-shop-content ul.products li.product.abis-product-card .abis-card__purchase-panel {
    box-sizing:border-box!important; position:absolute!important;
    inset:0!important; width:100%!important; height:100%!important;
    min-width:0!important; min-height:0!important;
    padding:clamp(7px,2vw,10px)!important;
    display:grid!important;
    grid-template-rows:30px minmax(38px,1fr) minmax(40px,auto)!important;
    gap:clamp(5px,1.8vw,8px)!important;
    align-items:stretch!important; overflow:hidden!important;
  }
  body .abis-hp-card__purchase-panel > *,
  body .abis-shop-content .abis-card__purchase-panel > * {
    box-sizing:border-box!important; min-width:0!important; max-width:100%!important;
  }
  body .abis-hp-card__purchase-back,
  body .abis-shop-content .abis-card__purchase-back {
    align-self:start!important; justify-self:start!important;
    width:30px!important; height:30px!important;
    max-height:30px!important; padding:0!important;
  }
  body .abis-hp-card__quantity,
  body .abis-shop-content .abis-card__quantity {
    width:100%!important; min-height:38px!important; height:38px!important;
    margin:0!important; align-self:center!important; justify-self:stretch!important;
    grid-template-columns:minmax(30px,1fr) minmax(25px,2fr) minmax(30px,1fr)!important;
  }
  body .abis-hp-card__purchase-submit,
  body .abis-shop-content ul.products li.product.abis-product-card .abis-card__purchase-submit {
    box-sizing:border-box!important; position:relative!important;
    width:100%!important; min-height:40px!important; height:auto!important;
    max-height:52px!important; max-width:100%!important;
    margin:0!important; padding:6px 4px!important;
    align-self:end!important; justify-self:stretch!important;
    display:flex!important; align-items:center!important; justify-content:center!important;
    font-size:clamp(9px,2.7vw,11px)!important;
    line-height:1.4!important; text-align:center!important;
    white-space:normal!important; overflow-wrap:anywhere!important;
  }
  body .abis-home-track{align-items:stretch}
}
@media (max-width:370px) {
  body .abis-hp-card:not(.abis-hp-card--featured):not(.abis-hp-card--insight) {min-height:234px!important}
}
@media (prefers-reduced-motion:reduce) {
  body .abis-hp-card__purchase-panel,
  body .abis-card__purchase-panel{transition:none!important}
}

/* Special offers: original 3.5.0 responsive layout, isolated from other grids. */
@media(max-width:680px) {
  body .abis-so .abis-so__card {box-sizing:border-box;min-height:258px}
  body .abis-so .abis-so__purchase-panel {
    box-sizing:border-box!important;
    top:0!important;right:0!important;bottom:0!important;left:0!important;
    width:100%!important;height:100%!important;max-height:100%!important;
    min-width:0!important;min-height:0!important;
    padding:10px!important;gap:8px!important;
    grid-template-rows:34px minmax(40px,1fr) minmax(42px,auto)!important;
    align-items:stretch!important;overflow:hidden!important;
  }
  body .abis-so .abis-so__purchase-panel > * {
    box-sizing:border-box!important;min-width:0!important;max-width:100%!important;
  }
  body .abis-so .abis-so__purchase-back {align-self:start!important;max-height:34px!important}
  body .abis-so .abis-so__quantity {
    width:100%!important;min-height:40px!important;height:40px!important;
    align-self:center!important;justify-self:center!important;margin:0!important;
    grid-template-columns:minmax(32px,1fr) minmax(25px,2fr) minmax(32px,1fr)!important;
  }
  body .abis-so .abis-so__purchase-submit {
    box-sizing:border-box!important;position:relative!important;display:flex!important;
    width:100%!important;max-width:100%!important;
    min-height:42px!important;height:auto!important;max-height:64px!important;
    align-self:end!important;justify-self:stretch!important;margin:0!important;
    padding:8px 5px!important;font-size:clamp(9px,2.8vw,12px)!important;
    text-align:center!important;line-height:1.5!important;white-space:normal!important;
    overflow-wrap:normal!important;
  }
  body .abis-so__track {align-items:stretch}
  body .abis-so .abis-so__card.is-purchase-open {isolation:isolate}
}
@media(max-width:370px) {
  body .abis-so .abis-so__purchase-panel {padding:8px!important;gap:5px!important}
  body .abis-so .abis-so__card {min-height:250px}
}
@media(prefers-reduced-motion:reduce) {
  body .abis-so .abis-so__purchase-panel {transition:none!important}
}
