/* Native table is hidden only when button UI is rendered */
#product:has(.discounts_table[data-qdbuttons="1"]) .product-discounts,
.product-container:has(.discounts_table[data-qdbuttons="1"]) .product-discounts,
#product .product-discounts.qdbuttons-hidden,
.product-discounts.js-product-discounts.qdbuttons-hidden {
  display: none !important;
}

div.discounts_table {
  margin-bottom: 20px;
  margin-top: 10px;
}

div.discounts_table .product-discounts-title {
  margin-bottom: 10px;
}

ul.table-products {
  align-items: center;
  display: grid;
  grid-template-columns: repeat(3, minmax(140px, 1fr));
  gap: 5px;
  justify-content: flex-start;
  list-style: none;
  padding: 0;
  margin: 0;
}

ul.table-products li.table-products-item.selected {
  cursor: default;
  background-color: #EDFAFA;
  border: 1px solid #24b9d7;
}

ul.table-products li.table-products-item.selected:before {
  border-color: #24b9d7 transparent transparent;
  border-style: solid;
  border-width: 35px 35px 0 0;
  -webkit-clip-path: polygon(100% 0, 0 100%, 0 0);
  clip-path: polygon(100% 0, 0 100%, 0 0);
  content: "";
  height: 0;
  left: 0;
  position: absolute;
  top: -1px;
  width: 0;
}

ul.table-products li.table-products-item.selected:after {
  color: #fff;
  content: "✔";
  position: absolute;
  top: 1px;
  left: 5px;
  font-size: 14px;
}

ul.table-products p {
  margin-bottom: 0.5em;
  padding: 3px 7px;
}

ul.table-products p.qty {
  font-weight: bold;
  color: #000;
  font-size: 1.3em;
}

ul.table-products li.table-products-item {
  font-size: 12px;
  background-color: #fff;
  border: 1px solid #adada9;
  cursor: pointer;
  position: relative;
  text-decoration: none;
  padding: 10px;
  text-align: center;
  margin-bottom: 10px;
}

ul.table-products li.table-products-item a.table-item {
  color: inherit;
  text-decoration: none;
  display: block;
}

ul.table-products .save_amount {
  background-color: #24b9d7;
  color: #FFF;
}

@media only screen and (max-width: 599px) {
  ul.table-products {
    grid-template-columns: repeat(2, minmax(120px, 1fr));
  }
}
