
/* V165 - Fix product price row:
   old price must never be covered by the discount badge. */

body:not(.admin-layout) .v117-product-card .v117-price-row{
  display:flex!important;
  align-items:center!important;
  justify-content:space-between!important;
  gap:8px!important;
  width:100%!important;
  min-width:0!important;
  overflow:visible!important;
}

body:not(.admin-layout) .v117-product-card .v117-price{
  display:flex!important;
  align-items:baseline!important;
  flex-wrap:wrap!important;
  gap:3px 8px!important;
  min-width:0!important;
  flex:1 1 auto!important;
  overflow:visible!important;
}

body:not(.admin-layout) .v117-product-card .v117-price strong{
  flex:0 0 auto!important;
  white-space:nowrap!important;
}

body:not(.admin-layout) .v117-product-card .v117-price small{
  flex:0 0 auto!important;
  white-space:nowrap!important;
}

body:not(.admin-layout) .v117-product-card .v117-price del{
  display:inline-block!important;
  position:static!important;
  flex:0 1 auto!important;
  min-width:0!important;
  max-width:100%!important;
  margin:0!important;
  padding:0!important;
  white-space:nowrap!important;
  overflow:visible!important;
  text-overflow:clip!important;
}

/* Discount becomes a normal flex item, never absolute over the old price */
body:not(.admin-layout) .v117-product-card .v117-discount{
  position:static!important;
  inset:auto!important;
  transform:none!important;
  flex:0 0 auto!important;
  display:inline-flex!important;
  align-items:center!important;
  justify-content:center!important;
  min-width:42px!important;
  height:32px!important;
  padding:0 7px!important;
  margin:0!important;
  white-space:nowrap!important;
  z-index:auto!important;
}

/* On narrower cards, old price moves cleanly to line 2 instead of being clipped. */
@media(min-width:768px) and (max-width:1499px){
  body:not(.admin-layout) .v117-product-card .v117-price{
    row-gap:2px!important;
  }

  body:not(.admin-layout) .v117-product-card .v117-price del{
    flex-basis:auto!important;
    font-size:11px!important;
  }

  body:not(.admin-layout) .v117-product-card .v117-discount{
    min-width:39px!important;
    height:30px!important;
    padding:0 6px!important;
  }
}

/* Mobile: price can wrap without overlap */
@media(max-width:767px){
  body:not(.admin-layout) .v117-product-card .v117-price-row{
    align-items:flex-end!important;
    gap:5px!important;
  }

  body:not(.admin-layout) .v117-product-card .v117-price{
    display:flex!important;
    flex-wrap:wrap!important;
    gap:1px 5px!important;
  }

  body:not(.admin-layout) .v117-product-card .v117-price del{
    flex-basis:100%!important;
    font-size:10px!important;
    line-height:1.2!important;
  }

  body:not(.admin-layout) .v117-product-card .v117-discount{
    min-width:36px!important;
    height:27px!important;
    padding:0 5px!important;
    font-size:11px!important;
  }
}
