/* Checkout: block «Товары в заказе» — layout from front-legend checkout.html */

.checkout-page .product-table-row.new {
  grid-template-columns: 1fr !important;
  cursor: pointer;
}

.checkout-page .product-table-row.new:not(:last-child) {
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.checkout-page .product-table-row.new:nth-child(2n) {
  background: #fff !important;
}

.checkout-page .product-table.type6 .product-table-body .product-table-row.new {
  background: #fff;
}

/* Как в вёрстке: ~1/3 название, ~2/3 вариации */
.checkout-page .product-table-row.new .product-table-cell {
  gap: 12px;
  display: grid !important;
  grid-template-columns: 1fr 2fr !important;
  align-items: flex-start !important;
  width: 100%;
}

.checkout-page .product-table-row.new .product-table-cell .product-header {
  gap: 12px;
  grid-template-columns: max-content 1fr !important;
  align-items: flex-start;
  min-width: 0;
}

.checkout-page .product-table-row.new .product-table-cell .product-header .imgholder {
  max-width: 80px !important;
  max-height: 80px !important;
  margin-right: 0 !important;
  flex-shrink: 0;
}

/* В вёрстке название ~13px / 700, не 16–20 */
.checkout-page .product-table-row.new .product-table-cell .product-header .right a,
.checkout-page .product-table-row.new .product-table-cell .product-header .right > span {
  font-size: 13px !important;
  font-weight: 700 !important;
  line-height: 1.5 !important;
  color: #1d1f20;
  text-decoration: none;
}

.checkout-page .product-table-row.new .product-table-cell .labels .label:not(.grey-noborder) {
  display: none;
}

.checkout-page .product-detail-choose {
  margin: 0;
  width: 100%;
  min-width: 0;
  overflow: visible;
}

.checkout-page .product-table-row.new .product-table-cell .product-detail-choose .product-detail-choose-item {
  position: relative;
  gap: 16px 20px;
  align-items: flex-start;
  /* Место под крестик, чтобы не наезжал на Итого */
  padding-right: 40px;
  overflow: visible;
  /* Близко к вёрстке: цена чуть шире исходной 1fr, помол фиксирован */
  grid-template-columns: 92px 100px 150px minmax(148px, 1fr) 100px 96px !important;
  background-color: #f2f2f2;
  cursor: default;
}

.checkout-page .product-table-row.new .product-table-cell .product-detail-choose .product-detail-choose-item > .col-ship {
  grid-column: 1;
}

.checkout-page .product-table-row.new .product-table-cell .product-detail-choose .product-detail-choose-item > .col-pack {
  grid-column: 2;
}

.checkout-page .product-table-row.new .product-table-cell .product-detail-choose .product-detail-choose-item > .col-pomol {
  grid-column: 3;
  min-width: 0;
  max-width: 150px;
  /* visible — иначе dropdown Choices кликается, но список не виден */
  overflow: visible;
  position: relative;
  z-index: 1;
}

.checkout-page .product-table-row.new .product-table-cell .product-detail-choose .product-detail-choose-item > .col-pomol:has(.choices.is-open) {
  z-index: 40;
}

.checkout-page .product-table-row.new .product-table-cell .product-detail-choose .product-detail-choose-item > .col-pack.is-empty,
.checkout-page .product-table-row.new .product-table-cell .product-detail-choose .product-detail-choose-item > .col-pomol.is-empty {
  min-height: 1px;
  max-width: none;
  overflow: visible;
}

/* В списке заказа строки не подсвечиваем красным */
.checkout-page .product-detail-choose-item.in-cart,
.checkout-page .product-detail-choose-item:has(.quantity.active) {
  background-color: #f2f2f2 !important;
}

.checkout-page .product-detail-choose-item.in-cart .col .small-text,
.checkout-page .product-detail-choose-item.in-cart .col .text,
.checkout-page .product-detail-choose-item.in-cart .col .price,
.checkout-page .product-detail-choose-item.in-cart .col .price-old,
.checkout-page .product-detail-choose-item.in-cart .col-price .small-text,
.checkout-page .product-detail-choose-item.in-cart .col-price .text,
.checkout-page .product-detail-choose-item.in-cart .col-price .price,
.checkout-page .product-detail-choose-item.in-cart .col-price .price-old,
.checkout-page .product-detail-choose-item.in-cart .price-total .small-text,
.checkout-page .product-detail-choose-item.in-cart .price-total .text,
.checkout-page .product-detail-choose-item.in-cart .price-total .price,
.checkout-page .product-detail-choose-item.in-cart .price-total .price-old,
.checkout-page .product-detail-choose-item:has(.quantity.active) .col .small-text,
.checkout-page .product-detail-choose-item:has(.quantity.active) .col .text,
.checkout-page .product-detail-choose-item:has(.quantity.active) .col-price .small-text,
.checkout-page .product-detail-choose-item:has(.quantity.active) .col-price .price,
.checkout-page .product-detail-choose-item:has(.quantity.active) .col-price .price-old,
.checkout-page .product-detail-choose-item:has(.quantity.active) .price-total .small-text,
.checkout-page .product-detail-choose-item:has(.quantity.active) .price-total .text {
  color: inherit;
}

.checkout-page .product-detail-choose-item.in-cart .col .text.green,
.checkout-page .product-detail-choose-item:has(.quantity.active) .col .text.green {
  color: #0aa250;
}

.checkout-page .product-detail-choose-item.in-cart .col .text.grey,
.checkout-page .product-detail-choose-item:has(.quantity.active) .col .text.grey {
  color: #6a7882;
}

.checkout-page .product-detail-choose-item.in-cart .col-price:has(.price-old) .price,
.checkout-page .product-detail-choose-item:has(.quantity.active) .col-price:has(.price-old) .price {
  color: #d33836;
}

.checkout-page .product-table-row.new .product-table-cell .product-detail-choose .product-detail-choose-item .col {
  height: 100%;
  display: grid;
  grid-template-rows: 14px minmax(32px, auto);
  align-items: center;
  gap: 4px;
  min-width: 0;
}

/* Селект: одна строка текста, как в вёрстке */
.checkout-page .product-table-row.new .product-table-cell .product-detail-choose .product-detail-choose-item .col .select {
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.checkout-page .product-table-row.new .product-table-cell .product-detail-choose .product-detail-choose-item .col .choices {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  border-radius: 4px;
  background-color: #fff;
  overflow: hidden;
  pointer-events: auto;
  position: relative;
  z-index: 2;
}

.checkout-page .product-table-row.new .product-table-cell .product-detail-choose .product-detail-choose-item .col .choices.is-open {
  overflow: visible;
  z-index: 50;
}

.checkout-page .product-table-row.new .product-table-cell .product-detail-choose .product-detail-choose-item .col .choices .choices__inner {
  min-height: 32px !important;
  height: 32px !important;
  padding-top: 0 !important;
  padding-bottom: 0 !important;
  padding-left: 8px !important;
  padding-right: 24px !important;
  display: flex !important;
  align-items: center !important;
  background-color: #fff;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  pointer-events: auto;
  overflow: hidden;
}

.checkout-page .product-table-row.new .product-table-cell .product-detail-choose .product-detail-choose-item .col .choices .choices__list--single {
  padding: 0 !important;
  width: 100%;
  min-width: 0;
}

.checkout-page .product-table-row.new .product-table-cell .product-detail-choose .product-detail-choose-item .col .choices .choices__item,
.checkout-page .product-table-row.new .product-table-cell .product-detail-choose .product-detail-choose-item .col .choices .choices__item.choices__item--selectable {
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  line-height: 32px !important;
  padding: 0 !important;
  width: 100%;
  display: block;
}

.checkout-page .product-table-row.new .product-table-cell .product-detail-choose .product-detail-choose-item .col .choices .choices__list--dropdown {
  z-index: 60;
  width: max-content !important;
  min-width: 100%;
  max-width: 320px;
}

.checkout-page .product-table-row.new .product-table-cell .product-detail-choose .product-detail-choose-item .col-price {
  height: 100%;
  grid-column: 4;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  align-content: center;
  gap: 4px 6px;
  margin-left: 0 !important;
  min-width: 0;
  position: relative;
  z-index: 0;
}

.checkout-page .product-table-row.new .product-table-cell .product-detail-choose .product-detail-choose-item .col-price .small-text {
  flex: 0 0 100%;
  width: 100%;
  margin: 0;
}

.checkout-page .product-table-row.new .product-table-cell .product-detail-choose .product-detail-choose-item .col-price .price,
.checkout-page .product-table-row.new .product-table-cell .product-detail-choose .product-detail-choose-item .col-price .price-old,
.checkout-page .product-table-row.new .product-table-cell .product-detail-choose .product-detail-choose-item .col-price .discount {
  margin: 0;
  flex-shrink: 0;
}

.checkout-page .product-table-row.new .product-table-cell .product-detail-choose .product-detail-choose-item .col-quantity {
  height: 100%;
  display: grid;
  grid-template-rows: 14px 1fr;
  align-items: center;
  gap: 4px;
  grid-column: 5;
}

.checkout-page .product-table-row.new .product-table-cell .product-detail-choose .product-detail-choose-item .col-quantity .quantity {
  cursor: pointer;
  pointer-events: auto;
  background: #fff;
}

.checkout-page .product-table-row.new .product-table-cell .product-detail-choose .product-detail-choose-item .col-quantity .quantity input {
  width: 40px;
}

.checkout-page .product-table-row.new .product-table-cell .product-detail-choose .product-detail-choose-item .price-total {
  grid-column: 6;
  height: 100%;
  display: grid;
  grid-template-rows: 14px 1fr;
  align-items: center;
  gap: 4px;
  opacity: 1 !important;
  padding-right: 0;
  margin-left: 0 !important;
  text-align: left;
  min-width: 0;
  overflow: hidden;
}

.checkout-page .product-table-row.new .product-table-cell .product-detail-choose .product-detail-choose-item .price-total .text {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.checkout-page .product-table-row.new .product-table-cell .product-detail-choose .product-detail-choose-item .col-remove {
  position: absolute;
  top: calc(50% - 12px);
  right: 10px;
  width: 24px;
  height: 24px;
  transition: 0.2s;
  cursor: pointer;
  z-index: 5;
}

.checkout-page .product-table-row.new .product-table-cell .product-detail-choose .product-detail-choose-item .col-remove:hover .icon {
  background-color: #d33836;
}

.checkout-page .product-table.type6 .product-table-header {
  display: none;
}

.checkout-page .product-table.type6 .product-table-body .product-table-row.new .product-table-cell {
  padding: 16px 0;
}

.checkout-page .product-table.type6 .product-table-body .product-table-row.new:nth-child(even) {
  background: #fff !important;
}

@media (max-width: 1200px) {
  .checkout-page .product-table-row.new .product-table-cell {
    grid-template-columns: 1fr !important;
  }

  .checkout-page .product-table-row.new .product-table-cell .product-header .imgholder {
    max-width: 64px !important;
    max-height: 64px !important;
  }

  .checkout-page .product-table-row.new .product-table-cell .product-detail-choose .product-detail-choose-item {
    gap: 12px 32px;
    padding-right: 16px;
    grid-template-columns: max-content 1fr max-content !important;
  }

  .checkout-page .product-table-row.new .product-table-cell .product-detail-choose .product-detail-choose-item > .col-ship,
  .checkout-page .product-table-row.new .product-table-cell .product-detail-choose .product-detail-choose-item > .col-pack,
  .checkout-page .product-table-row.new .product-table-cell .product-detail-choose .product-detail-choose-item > .col-pomol {
    grid-column: auto;
  }

  .checkout-page .product-table-row.new .product-table-cell .product-detail-choose .product-detail-choose-item > .col-pack.is-empty,
  .checkout-page .product-table-row.new .product-table-cell .product-detail-choose .product-detail-choose-item > .col-pomol.is-empty {
    display: none;
  }

  .checkout-page .product-table-row.new .product-table-cell .product-detail-choose .product-detail-choose-item .col .choices {
    height: unset;
  }

  .checkout-page .product-table-row.new .product-table-cell .product-detail-choose .product-detail-choose-item .col:has(.choices) {
    grid-column: 1 / 4;
  }

  .checkout-page .product-table-row.new .product-table-cell .product-detail-choose .product-detail-choose-item .col-price {
    padding-right: 32px;
    grid-area: 1 / 2 / auto / 4;
  }

  .checkout-page .product-table-row.new .product-table-cell .product-detail-choose .product-detail-choose-item .price-total {
    grid-area: 4 / 3;
  }

  .checkout-page .product-table-row.new .product-table-cell .product-detail-choose .product-detail-choose-item .price-total .small-text {
    text-align: right;
  }

  .checkout-page .product-table-row.new .product-table-cell .product-detail-choose .product-detail-choose-item .col-quantity {
    grid-area: 4 / 1 / auto / 3;
  }

  .checkout-page .product-table-row.new .product-table-cell .product-detail-choose .product-detail-choose-item .col-quantity .quantity {
    height: unset;
  }

  .checkout-page .product-table-row.new .product-table-cell .product-detail-choose .product-detail-choose-item .col-remove {
    top: 8px;
    right: 8px;
    opacity: 1;
  }
}
