/* AMPER v19.1 — stable cart/checkout and pricing workspace */

[aria-disabled="true"],
.is-disabled {
  pointer-events: none;
  opacity: .52;
}

/* Cart and checkout */
.cart-page--v191 { background: #f3f4f6; }
.cart-page--v191 .wrap { padding-top: 20px; }
.cart-page--v191 .breadcrumbs { margin-bottom: 12px; }

.vi-cart-title,
.vi-checkout-title {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin: 0 0 18px;
}

.vi-cart-title h1,
.vi-checkout-title h2 {
  margin: 2px 0 0;
  font-size: clamp(30px, 3vw, 42px);
}

.vi-cart-title > a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding-bottom: 5px;
  color: var(--muted);
  font-weight: 750;
  text-decoration: none;
}

.vi-cart-layout,
.vi-checkout-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 24px;
  align-items: start;
}

.vi-cart-main,
.vi-cart-side,
.vi-checkout-main,
.vi-checkout-side {
  display: grid;
  gap: 18px;
  min-width: 0;
}

.vi-cart-card,
.vi-customer-mini,
.vi-cart-summary,
.vi-checkout-section,
.vi-final-summary,
.vi-document-actions {
  border: 0;
  border-radius: 22px;
  box-shadow: 0 8px 30px rgba(23, 27, 32, .045);
}

.vi-cart-card {
  overflow: hidden;
  padding: 24px 26px 0;
}

.vi-cart-card__head,
.vi-cart-card__head > div,
.vi-cart-bulk,
.vi-cart-summary > div,
.vi-final-summary > div {
  display: flex;
  align-items: center;
}

.vi-cart-card__head {
  justify-content: space-between;
  gap: 16px;
}

.vi-cart-card__head > div { gap: 12px; }
.vi-cart-card__head h2 { margin: 0; font-size: 27px; }
.vi-cart-card__head span { color: var(--muted); font-size: 13px; }

.vi-cart-bulk {
  gap: 20px;
  min-height: 54px;
  margin-top: 7px;
  border-bottom: 1px solid var(--line);
}

.vi-cart-bulk label {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 9px;
  font-size: 13px;
  font-weight: 650;
}

.vi-cart-bulk button {
  width: auto;
  min-height: 34px;
  padding: 5px 0;
  color: var(--muted);
  background: none;
  border: 0;
  font-size: 13px;
  cursor: pointer;
}

.vi-cart-bulk button:hover { color: var(--brand); }
.vi-cart-bulk .vi-cart-clear { margin-left: auto; }

.vi-cart-items-wrap {
  overflow: visible;
  border-radius: 0;
}

.vi-cart-items-wrap .table { table-layout: fixed; }

.vi-cart-items-wrap .table th {
  padding: 14px 9px 10px;
  color: var(--muted);
  background: #fff;
  border: 0;
  font-size: 11px;
  font-weight: 750;
  text-transform: uppercase;
  letter-spacing: .035em;
}

.vi-cart-items-wrap .table th:first-child,
.vi-cart-items-wrap .table td:first-child { padding-left: 0; }
.vi-cart-items-wrap .table th:nth-child(2) { width: 125px; }
.vi-cart-items-wrap .table th:nth-child(3) { width: 160px; }
.vi-cart-items-wrap .table th:nth-child(4) { width: 132px; }
.vi-cart-items-wrap .table th:last-child { width: 82px; }

.vi-cart-items-wrap .table td {
  padding: 20px 9px;
  vertical-align: middle;
  border-bottom: 1px solid var(--line);
}

.vi-cart-product-row {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.vi-cart-select { width: 19px; height: 19px; }

.vi-cart-items-wrap .cart-product {
  min-width: 0;
  gap: 16px;
}

.vi-cart-items-wrap .cart-product img {
  flex: 0 0 92px;
  width: 92px;
  height: 92px;
  padding: 4px;
  border: 0;
}

.vi-cart-items-wrap .cart-product > div {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.vi-cart-items-wrap .cart-product b { font-size: 14px; font-weight: 720; }
.vi-cart-items-wrap .cart-product span { margin: 0; }
.vi-cart-code { color: #9a9fa5; font-size: 11px !important; }
.vi-cart-unit-price { white-space: nowrap; }

.vi-cart-row-actions {
  display: flex;
  justify-content: flex-end;
  gap: 4px;
}

.vi-cart-row-actions .iconbtn {
  color: #848a91;
  background: transparent;
  border: 0;
  box-shadow: none;
}

.vi-cart-row-actions .iconbtn:hover {
  color: var(--brand);
  background: var(--brand-soft);
}

.vi-cart-verified {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 55px;
  color: var(--muted);
  font-size: 12px;
}

.vi-cart-verified i { color: var(--success); }

.vi-cart-side,
.vi-checkout-side {
  position: sticky;
  top: 16px;
}

.vi-customer-mini,
.vi-cart-summary,
.vi-final-summary,
.vi-document-actions { padding: 22px; }

.vi-customer-mini {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 13px;
}

.vi-customer-mini > div {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
}

.vi-customer-mini > div > i { color: var(--muted); font-size: 24px; }

.vi-customer-mini span {
  display: grid;
  min-width: 0;
}

.vi-customer-mini small {
  overflow: hidden;
  color: var(--muted);
  text-overflow: ellipsis;
}

.vi-customer-mini > span {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  padding-top: 12px;
  color: var(--muted);
  border-top: 1px solid var(--line);
  font-size: 12px;
}

.vi-cart-summary,
.vi-final-summary {
  display: grid;
  gap: 13px;
}

.vi-cart-summary > div,
.vi-final-summary > div {
  justify-content: space-between;
  gap: 12px;
}

.vi-cart-summary > div > span,
.vi-final-summary > div > span { color: var(--muted); }

.vi-cart-summary > div > strong,
.vi-final-summary > div > strong {
  max-width: 175px;
  font-size: 12px;
  text-align: right;
}

.vi-cart-summary hr,
.vi-final-summary hr { margin: 2px 0; }
.vi-cart-summary__total b { font-size: 22px; }

.vi-cart-summary__total strong {
  max-width: none !important;
  font-size: 25px !important;
  white-space: nowrap;
}

.vi-cart-summary > p,
.vi-final-consent {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}

.vi-red-button {
  min-height: 56px;
  border-radius: 14px;
  font-size: 15px;
}

.vi-cart-trust { margin: 0; }

.vi-checkout-title {
  display: block;
  margin-top: 46px;
}

.vi-checkout-title p { margin: 7px 0 0; color: var(--muted); }
.vi-checkout-section { padding: 27px; }

.vi-section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.vi-section-head > div {
  display: flex;
  align-items: center;
  gap: 11px;
}

.vi-section-head > div > span {
  display: grid;
  place-items: center;
  width: 31px;
  height: 31px;
  flex: 0 0 31px;
  color: #fff;
  background: var(--ink);
  border-radius: 50%;
  font-weight: 850;
}

.vi-section-head h2 { margin: 0; font-size: 24px; }

.vi-buyer-type {
  grid-template-columns: repeat(2, minmax(0, 250px));
  margin-bottom: 20px;
}

.vi-profile-card { margin-top: 4px; }

.vi-delivery-options {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 18px;
}

.vi-delivery-options label { position: relative; }
.vi-delivery-options input { position: absolute; opacity: 0; }

.vi-delivery-options label > span {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  grid-template-rows: auto auto;
  align-items: center;
  gap: 2px 8px;
  min-height: 84px;
  padding: 13px;
  background: #f4f5f6;
  border: 2px solid transparent;
  border-radius: 13px;
  cursor: pointer;
}

.vi-delivery-options label > span > i {
  grid-row: 1 / 3;
  font-size: 19px;
  text-align: center;
}

.vi-delivery-options label > span small {
  color: var(--muted);
  font-weight: 500;
  line-height: 1.3;
}

.vi-delivery-options input:checked + span {
  background: #fff;
  border-color: var(--ink);
}

.vi-payment-methods {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 0;
  padding: 0;
  border: 0;
}

.vi-payment-methods .checkout-payment-method { min-height: 78px; }
.vi-comment-section textarea { min-height: 90px; }
.vi-final-summary .notice { margin: 0; }

.vi-document-actions {
  display: grid;
  gap: 9px;
}

.vi-document-actions h3 { margin-bottom: 4px; }

/* Fulfilment cards stay functional but visually join the new cart. */
.cart-page--v191 .cart-fulfillment__title { align-items: center; }

.cart-page--v191 .fulfillment-card {
  border: 0;
  border-radius: 18px;
  box-shadow: 0 8px 30px rgba(23, 27, 32, .045);
}

/* Pricing administration */
.pricing-head > div:first-child { max-width: 850px; }
.pricing-stats { margin-bottom: 18px; }

.pricing-filters {
  display: grid;
  grid-template-columns: minmax(210px, 1.2fr) minmax(190px, 1fr) minmax(170px, .8fr) minmax(170px, .8fr) auto;
  align-items: end;
  gap: 10px;
}

.pricing-filters > div { display: grid; }
.pricing-filters > div small { color: var(--muted); }
.pricing-comparison .table-wrap { max-height: 720px; }
.pricing-table { min-width: 1380px; }

.pricing-table th {
  position: sticky;
  z-index: 2;
  top: 0;
}

.pricing-table td { vertical-align: top; }
.pricing-table td:first-child { min-width: 285px; }
.compare-price { color: var(--success); font-size: 16px; }
.pricing-lock { color: var(--warning); }

.pricing-inline-apply {
  display: grid;
  grid-template-columns: minmax(118px, 1fr) 74px 38px;
  gap: 5px;
  align-items: center;
  min-width: 250px;
}

.pricing-inline-apply select,
.pricing-inline-apply input {
  min-height: 36px;
  padding: 6px 8px;
  font-size: 11px;
}

.pricing-inline-apply > span { position: relative; }

.pricing-inline-apply > span small {
  position: absolute;
  right: 6px;
  bottom: -15px;
  color: var(--muted);
  font-size: 9px;
}

.pricing-inline-apply button,
.pricing-apply-rule button { min-height: 36px; }
.pricing-apply-rule { margin-top: 7px; }

.pricing-rules-layout,
.pricing-bottom-grid { margin-top: 18px; }

.pricing-competitor-list {
  display: grid;
  gap: 8px;
  margin-top: 18px;
}

.pricing-competitor-list > div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: #f5f6f7;
  border-radius: 10px;
}

.pricing-competitor-list span { display: grid; min-width: 0; }

.pricing-competitor-list small {
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 1180px) {
  .vi-cart-layout,
  .vi-checkout-layout { grid-template-columns: minmax(0, 1fr) 320px; }
  .vi-cart-items-wrap .table th:nth-child(2) { width: 110px; }
  .vi-cart-items-wrap .table th:nth-child(3) { width: 145px; }
  .vi-cart-items-wrap .table th:nth-child(4) { width: 118px; }

  .vi-cart-items-wrap .cart-product img {
    flex-basis: 76px;
    width: 76px;
    height: 76px;
  }

  .pricing-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 980px) {
  .vi-cart-layout,
  .vi-checkout-layout { grid-template-columns: 1fr; }

  .vi-cart-side,
  .vi-checkout-side { position: static; }

  .vi-cart-side { grid-template-columns: minmax(0, .8fr) minmax(320px, 1.2fr); }
  .vi-checkout-side { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 700px) {
  .vi-cart-title { display: block; }
  .vi-cart-title > a { margin-top: 8px; }

  .vi-cart-card {
    overflow: visible;
    padding: 18px;
  }

  .vi-cart-bulk {
    flex-wrap: wrap;
    gap: 6px 14px;
    padding: 10px 0;
  }

  .vi-cart-bulk .vi-cart-clear { margin-left: 0; }

  .vi-cart-items-wrap .table,
  .vi-cart-items-wrap tbody { display: block; }

  .vi-cart-items-wrap tbody {
    display: grid;
    gap: 12px;
  }

  .vi-cart-items-wrap .table tr {
    position: relative;
    display: grid;
    padding: 14px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 14px;
    box-shadow: none;
  }

  .vi-cart-items-wrap .table td,
  .vi-cart-items-wrap .table td:first-child {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 9px 0;
    border: 0;
    border-top: 1px solid var(--line);
  }

  .vi-cart-items-wrap .table td:first-child {
    padding: 0 48px 14px 0;
    border-top: 0;
  }

  .vi-cart-items-wrap .table td:nth-child(2)::before { content: "Цена"; }
  .vi-cart-items-wrap .table td:nth-child(3)::before { content: "Количество"; }
  .vi-cart-items-wrap .table td:nth-child(4)::before { content: "Сумма"; }

  .vi-cart-items-wrap .table td:nth-child(n+2):nth-child(-n+4)::before {
    color: var(--muted);
    font-size: 11px;
    font-weight: 750;
  }

  .vi-cart-items-wrap .table td:last-child {
    position: absolute;
    top: 9px;
    right: 8px;
    display: block;
    padding: 0;
    border: 0;
  }

  .vi-cart-product-row {
    grid-template-columns: 18px minmax(0, 1fr);
    align-items: start;
    width: 100%;
    gap: 9px;
  }

  .vi-cart-items-wrap .cart-product img {
    flex: 0 0 72px;
    width: 72px;
    height: 72px;
  }

  .vi-cart-side,
  .vi-checkout-side,
  .vi-delivery-options,
  .vi-payment-methods { grid-template-columns: 1fr; }

  .vi-checkout-section { padding: 20px 17px; }
  .vi-buyer-type { grid-template-columns: 1fr 1fr; }
  .pricing-filters { grid-template-columns: 1fr; }
}

@media (max-width: 460px) {
  .vi-cart-card__head h2,
  .vi-section-head h2 { font-size: 21px; }

  .vi-cart-items-wrap .cart-product {
    align-items: flex-start;
    gap: 9px;
  }

  .vi-cart-items-wrap .cart-product img {
    flex-basis: 58px;
    width: 58px;
    height: 58px;
  }

  .vi-cart-items-wrap .cart-product b { font-size: 12px; }
  .vi-cart-row-actions { display: grid; }
  .vi-cart-summary__total strong { font-size: 21px !important; }
  .vi-buyer-type { grid-template-columns: 1fr; }
}
