/* STREETLEGEND V61: targeted storefront and shopping bag layout only.
   Loaded last on the homepage; does not alter purchase actions. */

/* Desktop shop: four normal-sized product cards per row, images never distorted. */
@media (min-width: 1024px) {
  body.sl-home .sl-shop__product-rail {
    display:grid!important;
    grid-template-columns:repeat(4,minmax(0,1fr))!important;
    gap:clamp(12px,1.35vw,20px)!important;
    align-items:start!important;
    overflow:visible!important;
  }
  body.sl-home .sl-shop-card {
    min-height:0!important;
    height:auto!important;
    aspect-ratio:4/5.1;
    border-radius:15px!important;
  }
  body.sl-home .sl-shop-card__details {
    padding:clamp(11px,1.3vw,18px)!important;
    gap:6px!important;
  }
  body.sl-home .sl-shop-card__copy {
    min-width:0!important;
    max-width:calc(100% - 83px)!important;
  }
  body.sl-home .sl-shop-card__copy h4 {
    font-size:clamp(14px,1.35vw,19px)!important;
    line-height:1.2!important;
    margin:5px 0 7px!important;
  }
  body.sl-home .sl-shop-card__copy > strong {
    font-size:clamp(14px,1.25vw,18px)!important;
  }
  body.sl-home .sl-shop-card__arrow {
    min-width:0!important;
    width:77px!important;
    max-width:77px!important;
    min-height:38px!important;
    padding:8px 6px!important;
    font-size:10px!important;
  }
}
@media (min-width:821px) and (max-width:1023px) {
  body.sl-home .sl-shop__product-rail {grid-template-columns:repeat(3,minmax(0,1fr))!important;gap:13px!important;}
  body.sl-home .sl-shop-card {min-height:0!important;height:auto!important;aspect-ratio:4/5.1;}
  body.sl-home .sl-shop-card__details {padding:13px!important;}
  body.sl-home .sl-shop-card__copy h4 {font-size:17px!important;}
}
@media (min-width:821px) {
  body.sl-home .sl-shop-card__picture {position:absolute!important;inset:0!important;height:100%!important;}
  body.sl-home .sl-shop-card__picture img {
    width:100%!important;
    height:100%!important;
    object-fit:contain!important;
    object-position:center 40%!important;
    box-sizing:border-box!important;
    padding:9px 9px 50px!important;
  }
}

/* Bag: independent grid areas prevent pictures, totals and long names colliding. */
body.sl-home #sani-bag-dialog .sani-bag-dialog__scroll {
  box-sizing:border-box!important;
  min-width:0!important;
  min-height:0!important;
  overflow-x:hidden!important;
}
body.sl-home #sani-bag-dialog .sani-bag-dialog__items {
  align-content:start!important;
  grid-auto-rows:auto!important;
  min-width:0!important;
}
body.sl-home #sani-bag-dialog .sani-bag-dialog__item {
  display:grid!important;
  grid-template-columns:30px 74px minmax(0,1fr)!important;
  grid-template-areas:"remove image details" "remove image total"!important;
  align-items:center!important;
  column-gap:11px!important;
  row-gap:5px!important;
  min-width:0!important;
  min-height:0!important;
  box-sizing:border-box!important;
  overflow:hidden!important;
  padding:12px!important;
}
body.sl-home #sani-bag-dialog .sani-bag-dialog__item > .sani-cart-remove {
  grid-area:remove!important;position:static!important;margin:0!important;
  width:30px!important;height:30px!important;max-width:30px!important;
}
body.sl-home #sani-bag-dialog .sani-bag-dialog__item > img {
  grid-area:image!important;display:block!important;
  width:74px!important;height:90px!important;
  max-width:74px!important;max-height:90px!important;
  min-width:0!important;object-fit:contain!important;object-position:center!important;
  box-sizing:border-box!important;transform:none!important;
}
body.sl-home #sani-bag-dialog .sani-bag-dialog__item > .sani-bag-dialog__item-details {
  grid-area:details!important;display:grid!important;min-width:0!important;
  width:100%!important;overflow-wrap:anywhere!important;word-break:normal!important;
}
body.sl-home #sani-bag-dialog .sani-bag-dialog__item .sani-bag-item-name {
  display:block!important;min-width:0!important;max-width:100%!important;
  white-space:normal!important;overflow-wrap:anywhere!important;
  font-size:clamp(12px,1.2vw,15px)!important;line-height:1.35!important;
}
body.sl-home #sani-bag-dialog .sani-bag-dialog__item .sani-bag-dialog__qty {
  display:flex!important;align-items:center!important;max-width:100%!important;flex-wrap:wrap!important;
}
body.sl-home #sani-bag-dialog .sani-bag-dialog__item > .sani-bag-line-total {
  grid-area:total!important;min-width:0!important;white-space:normal!important;
  justify-self:start!important;align-self:start!important;
  overflow-wrap:anywhere!important;text-align:left!important;
  font-size:13px!important;
}
@media (min-width:701px) and (max-width:900px) {
  body.sl-home #sani-bag-dialog .sani-bag-dialog__items {grid-template-columns:1fr!important;}
}
@media (max-width:520px) {
  body.sl-home #sani-bag-dialog .sani-bag-dialog__item {
    grid-template-columns:28px 54px minmax(0,1fr)!important;
    column-gap:8px!important;padding:10px 8px!important;
  }
  body.sl-home #sani-bag-dialog .sani-bag-dialog__item > img {
    width:54px!important;max-width:54px!important;height:76px!important;max-height:76px!important;
  }
  body.sl-home #sani-bag-dialog .sani-bag-dialog__item > .sani-cart-remove {
    width:28px!important;height:28px!important;
  }
}
/* Added-to-bag preview must never spill into other cards or actions. */
body.sl-home #sani-bag-dialog .sani-added-preview:not([hidden]) {
  display:grid!important;
  grid-template-columns:minmax(0,1fr) minmax(120px,30%)!important;
  align-items:center!important;
  gap:clamp(8px,1.7vw,18px)!important;
  box-sizing:border-box!important;
  min-width:0!important;max-width:100%!important;
  overflow:hidden!important;
}
body.sl-home #sani-bag-dialog .sani-added-preview__copy {
  min-width:0!important;max-width:100%!important;overflow-wrap:anywhere!important;
}
body.sl-home #sani-bag-dialog .sani-added-preview > img {
  display:block!important;width:100%!important;max-width:100%!important;
  height:clamp(130px,21vh,235px)!important;max-height:235px!important;
  object-fit:contain!important;object-position:center!important;
  box-sizing:border-box!important;transform:none!important;
}
@media (max-width:520px) {
  body.sl-home #sani-bag-dialog .sani-added-preview:not([hidden]) {
    grid-template-columns:minmax(0,1fr) minmax(94px,29%)!important;
  }
  body.sl-home #sani-bag-dialog .sani-added-preview > img {
    height:clamp(116px,19vh,168px)!important;max-height:168px!important;
  }
}
/* Search-page 'You might like' discovery cards: no image or title spill. */
body.sls-page .sls-discovery-grid {align-items:start!important;min-width:0!important;}
body.sls-page .sls-discovery-card {min-width:0!important;max-width:100%!important;overflow:hidden!important;}
body.sls-page .sls-discovery-image {width:100%!important;min-width:0!important;overflow:hidden!important;}
body.sls-page .sls-discovery-image img {display:block!important;width:100%!important;height:100%!important;object-fit:contain!important;box-sizing:border-box!important;}
body.sls-page .sls-discovery-info {min-width:0!important;display:grid!important;grid-template-columns:minmax(0,1fr) auto!important;gap:7px!important;}
body.sls-page .sls-discovery-name {min-width:0!important;overflow-wrap:anywhere!important;}
