
/* V166 - Structural price fix
   Current price and old price are separated into their own wrappers.
   This prevents the discount badge from ever covering the old price. */

body:not(.admin-layout) .v117-product-card .v117-price-row{
  display:grid!important;
  grid-template-columns:minmax(0,1fr) auto!important;
  grid-template-areas:
    "price discount"!important;
  align-items:end!important;
  column-gap:8px!important;
  row-gap:4px!important;
  width:100%!important;
  min-width:0!important;
  min-height:48px!important;
  overflow:visible!important;
}

body:not(.admin-layout) .v117-product-card .v117-price{
  grid-area:price!important;
  display:flex!important;
  flex-direction:column!important;
  align-items:flex-start!important;
  justify-content:flex-end!important;
  gap:3px!important;
  width:100%!important;
  min-width:0!important;
  white-space:normal!important;
  overflow:visible!important;
}

body:not(.admin-layout) .v117-product-card .v166-price-current{
  display:flex!important;
  align-items:baseline!important;
  gap:4px!important;
  width:100%!important;
  min-width:0!important;
  white-space:nowrap!important;
}

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

body:not(.admin-layout) .v117-product-card .v166-price-old{
  display:block!important;
  width:100%!important;
  min-width:0!important;
  line-height:1.2!important;
}

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

/* Discount is its own grid cell, never floating over the old price */
body:not(.admin-layout) .v117-product-card .v117-discount{
  grid-area:discount!important;
  position:static!important;
  inset:auto!important;
  transform:none!important;
  align-self:end!important;
  justify-self:end!important;
  display:inline-flex!important;
  align-items:center!important;
  justify-content:center!important;
  min-width:42px!important;
  height:31px!important;
  padding:0 7px!important;
  margin:0!important;
  box-sizing:border-box!important;
  white-space:nowrap!important;
  flex:none!important;
}

/* Product-list cards are narrower because of sidebar + 4/5 columns.
   Give old price a dedicated second line and slightly reduce its size. */
body:not(.admin-layout) .product-list-page .v117-product-card .v166-price-old del{
  font-size:10.5px!important;
}

body:not(.admin-layout) .product-list-page .v117-product-card .v117-price-row{
  min-height:53px!important;
}

/* Large desktop: retain good prominence */
@media(min-width:1500px){
  body:not(.admin-layout) .product-list-page .v117-product-card .v166-price-current strong{
    font-size:18px!important;
  }
}

/* Tablet/mobile */
@media(max-width:1199px){
  body:not(.admin-layout) .v117-product-card .v117-price-row{
    column-gap:5px!important;
  }

  body:not(.admin-layout) .v117-product-card .v166-price-current strong{
    font-size:16px!important;
  }

  body:not(.admin-layout) .v117-product-card .v166-price-current small{
    font-size:9px!important;
  }

  body:not(.admin-layout) .v117-product-card .v166-price-old del{
    font-size:9.5px!important;
  }

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