/* ═══════════════════════════════════════════════════════════
   CART — стили корзины / checkout, стиль vseinstrumenti
   ═══════════════════════════════════════════════════════════ */

/* ——— Breadcrumbs + steps ——— */
.breadcrumbs-bar {
  background: var(--white);
  border-bottom: 1px solid var(--gray-200);
}
.breadcrumbs-bar__inner {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 20px;
  flex-wrap: wrap;
  gap: 16px;
}
.breadcrumbs {
  display: flex; gap: 8px; align-items: center;
  font-size: 13px;
  color: var(--gray-500);
}
.breadcrumbs a { color: var(--gray-700); transition: color .15s; }
.breadcrumbs a:hover { color: var(--red); }
.breadcrumbs .is-current { color: var(--ink); font-weight: 600; }

.checkout-steps {
  display: flex; gap: 28px;
}
.step {
  display: flex; gap: 8px; align-items: center;
  font-size: 13px;
  color: var(--gray-500);
  position: relative;
  padding-right: 28px;
}
.step:not(:last-child)::after {
  content: '';
  position: absolute;
  right: 6px; top: 50%;
  width: 16px; height: 1.5px;
  background: var(--gray-300);
}
.step:last-child { padding-right: 0; }
.step__dot {
  width: 22px; height: 22px;
  background: var(--gray-100);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: var(--gray-500);
}
.step--done { color: var(--green); }
.step--done .step__dot { background: var(--green); color: var(--white); }
.step--active { color: var(--ink); font-weight: 600; }
.step--active .step__dot { background: var(--red); color: var(--white); }

/* ═══════════ CART HEAD ═══════════ */
.cart-page { padding: 24px 0 48px; }

.cart-head {
  display: flex; justify-content: space-between; align-items: baseline;
  margin-bottom: 20px;
  flex-wrap: wrap; gap: 12px;
}
.cart-head__title {
  font-size: 32px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--ink);
}
.cart-head__num {
  color: var(--gray-500);
  font-weight: 500;
  font-size: 20px;
}
.cart-head__meta {
  display: flex; gap: 14px; align-items: center;
  font-size: 14px;
  color: var(--gray-700);
}
.cart-head__meta strong { color: var(--ink); font-weight: 700; }
.cart-head__sep {
  width: 4px; height: 4px; background: var(--gray-300); border-radius: 50%;
}

/* ═══════════ LAYOUT ═══════════ */
.cart-layout {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 20px;
  align-items: start;
}

.cart-left { display: flex; flex-direction: column; gap: 16px; }
.cart-right {
  position: sticky;
  top: 140px;
  display: flex; flex-direction: column; gap: 12px;
}

/* ═══════════ CARDS ═══════════ */
.card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 24px 24px;
  border: 1px solid var(--gray-200);
}
.card__head {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--gray-100);
}
.card__title {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.015em;
  color: var(--ink);
}
.link-btn {
  color: var(--gray-500);
  font-size: 13px;
  font-weight: 500;
  transition: color .15s;
}
.link-btn:hover { color: var(--red); }

/* ═══════════ CART ITEMS ═══════════ */
.cart-items { display: flex; flex-direction: column; }

.cart-item {
  display: grid;
  grid-template-columns: 24px 110px 1fr 200px;
  gap: 16px;
  padding: 18px 0;
  border-bottom: 1px solid var(--gray-100);
  align-items: flex-start;
}
.cart-item:last-child { border-bottom: none; padding-bottom: 0; }
.cart-item:first-child { padding-top: 0; }

/* Checkbox */
.cart-item__check {
  padding-top: 4px;
  cursor: pointer;
  display: inline-block;
  position: relative;
}
.cart-item__check input { position: absolute; opacity: 0; pointer-events: none; }
.cart-item__check span {
  display: block;
  width: 20px; height: 20px;
  border: 2px solid var(--gray-300);
  border-radius: 4px;
  background: var(--white);
  transition: all .15s;
  position: relative;
}
.cart-item__check input:checked + span {
  background: var(--red);
  border-color: var(--red);
}
.cart-item__check input:checked + span::after {
  content: '';
  position: absolute;
  left: 5px; top: 1px;
  width: 6px; height: 11px;
  border: solid var(--white);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.cart-item__media {
  display: block;
  aspect-ratio: 1;
  background: var(--gray-50);
  border-radius: var(--radius-sm);
  padding: 10px;
  border: 1px solid var(--gray-100);
}
.cart-item__media svg {
  width: 100%; height: 100%;
}

.cart-item__info { display: flex; flex-direction: column; gap: 6px; padding-top: 2px; }
.cart-item__art {
  font-size: 11px;
  color: var(--gray-500);
  font-family: ui-monospace, 'SF Mono', monospace;
}
.cart-item__title {
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.35;
  margin-bottom: 4px;
}
.cart-item__title:hover { color: var(--red); }

.cart-item__props {
  display: flex; flex-direction: column;
  gap: 3px;
  margin-top: 4px;
}
.cart-item__prop {
  display: flex; gap: 8px;
  font-size: 13px;
  color: var(--gray-700);
}
.cart-item__prop span { color: var(--gray-500); min-width: 110px; }
.cart-item__prop strong { color: var(--ink); font-weight: 500; }
.cart-item__prop .is-stock { color: var(--green); font-weight: 600; }

/* Actions */
.cart-item__actions {
  display: flex; flex-direction: column;
  gap: 10px;
  align-items: flex-end;
}

.cart-item__price-box {
  display: flex; flex-direction: column; align-items: flex-end;
  gap: 2px;
}
.cart-item__price-now {
  font-size: 22px;
  font-weight: 800;
  color: var(--ink);
  letter-spacing: -0.02em;
}
.cart-item__price-old {
  font-size: 14px;
  color: var(--gray-500);
  text-decoration: line-through;
}
.cart-item__save {
  font-size: 12px;
  color: var(--white);
  background: var(--orange);
  padding: 2px 8px;
  border-radius: 3px;
  font-weight: 700;
}

/* Qty */
.qty {
  display: flex;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-sm);
  background: var(--white);
  overflow: hidden;
}
.qty__btn {
  width: 36px; height: 36px;
  font-size: 18px;
  font-weight: 700;
  color: var(--ink);
  background: var(--gray-50);
  transition: all .15s;
}
.qty__btn:hover { background: var(--red); color: var(--white); }
.qty__input {
  width: 44px;
  border: none;
  border-left: 1px solid var(--gray-200);
  border-right: 1px solid var(--gray-200);
  text-align: center;
  background: var(--white);
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  outline: none;
}

.cart-item__tools { display: flex; gap: 6px; }
.icon-btn {
  width: 32px; height: 32px;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-sm);
  background: var(--white);
  color: var(--gray-500);
  display: flex; align-items: center; justify-content: center;
  transition: all .15s;
}
.icon-btn:hover { color: var(--red); border-color: var(--red); }
.icon-btn:last-child:hover { color: var(--red); }

/* ═══════════ ADDONS ═══════════ */
.addons {
  margin-top: 20px;
  padding: 18px;
  background: var(--yellow-bg);
  border-radius: var(--radius);
  border: 1px dashed var(--yellow);
}
.addons__head {
  display: flex; gap: 8px; align-items: center;
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 14px;
}
.addons__head svg { color: var(--orange); }

.addons__list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}
.addon {
  display: grid;
  grid-template-columns: 60px 1fr auto auto;
  gap: 12px;
  align-items: center;
  padding: 10px 14px;
  background: var(--white);
  border-radius: var(--radius-sm);
  border: 1px solid var(--gray-100);
}
.addon__media {
  width: 60px; height: 60px;
  background: var(--gray-50);
  border-radius: 4px;
  padding: 6px;
}
.addon__title {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 2px;
}
.addon__art {
  font-size: 11px;
  color: var(--gray-500);
  font-family: ui-monospace, monospace;
}
.addon__price {
  font-size: 16px;
  font-weight: 800;
  color: var(--ink);
}
.addon__add {
  width: 32px; height: 32px;
  background: var(--red);
  color: var(--white);
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  transition: all .15s;
}
.addon__add:hover { background: var(--red-dark); transform: rotate(90deg); }

/* ═══════════ CLIENT TYPE ═══════════ */
.client-type {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 18px;
}
.ctype {
  display: flex; gap: 12px; align-items: center;
  padding: 14px 16px;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all .15s;
  background: var(--white);
  position: relative;
}
.ctype input { position: absolute; opacity: 0; pointer-events: none; }
.ctype:hover { border-color: var(--red); }
.ctype.is-checked { border-color: var(--red); background: var(--red-50); }

.ctype__mark {
  width: 18px; height: 18px;
  border: 2px solid var(--gray-300);
  border-radius: 50%;
  flex-shrink: 0;
  transition: all .15s;
  position: relative;
}
.ctype.is-checked .ctype__mark { border-color: var(--red); }
.ctype.is-checked .ctype__mark::after {
  content: '';
  position: absolute;
  inset: 3px;
  background: var(--red);
  border-radius: 50%;
}
.ctype__label { display: flex; flex-direction: column; line-height: 1.3; }
.ctype__label strong { font-size: 14px; font-weight: 700; color: var(--ink); }
.ctype__label em { font-size: 12px; color: var(--gray-500); font-style: normal; margin-top: 2px; }

/* ═══════════ FORM ═══════════ */
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}
.form-grid--mt { margin-top: 16px; }
.form-grid .field--full { grid-column: 1 / -1; }

.field { display: flex; flex-direction: column; gap: 6px; }
.field__label {
  font-size: 12px;
  color: var(--gray-500);
  font-weight: 500;
}
.field__input {
  padding: 11px 14px;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-sm);
  background: var(--white);
  font-size: 14px;
  color: var(--ink);
  outline: none;
  font-family: inherit;
  transition: border-color .15s, box-shadow .15s;
}
.field__input:focus {
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(214, 0, 0, 0.08);
}
textarea.field__input { resize: vertical; min-height: 52px; }

/* ═══════════ DELIVERY TABS ═══════════ */
.deliv-tabs {
  display: flex; gap: 4px;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--gray-200);
}
.deliv-tab {
  padding: 10px 16px;
  background: transparent;
  font-size: 14px;
  font-weight: 500;
  color: var(--gray-700);
  border-bottom: 2px solid transparent;
  transition: all .15s;
  display: inline-flex; gap: 8px; align-items: center;
  margin-bottom: -1px;
}
.deliv-tab:hover { color: var(--red); }
.deliv-tab.is-active {
  color: var(--red);
  border-bottom-color: var(--red);
  font-weight: 700;
}

/* Delivery options */
.deliv-options { display: flex; flex-direction: column; gap: 8px; }

.deliv-opt {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 14px 16px;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all .15s;
  background: var(--white);
  position: relative;
}
.deliv-opt input { position: absolute; opacity: 0; pointer-events: none; }
.deliv-opt:hover { border-color: var(--red); }
.deliv-opt.is-checked { border-color: var(--red); background: var(--red-50); }

.deliv-opt__mark {
  width: 18px; height: 18px;
  border: 2px solid var(--gray-300);
  border-radius: 50%;
  flex-shrink: 0;
  transition: all .15s;
  position: relative;
  margin-top: 2px;
}
.deliv-opt.is-checked .deliv-opt__mark { border-color: var(--red); }
.deliv-opt.is-checked .deliv-opt__mark::after {
  content: '';
  position: absolute;
  inset: 3px;
  background: var(--red);
  border-radius: 50%;
}

.deliv-opt__main { flex: 1; }
.deliv-opt__row {
  display: flex; justify-content: space-between; align-items: baseline;
  gap: 12px;
}
.deliv-opt__row strong {
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
}
.deliv-opt__price {
  font-size: 16px;
  font-weight: 800;
  color: var(--ink);
  white-space: nowrap;
}
.deliv-opt__sub {
  display: flex; gap: 8px; align-items: center;
  margin-top: 4px;
  font-size: 13px;
  color: var(--gray-700);
  flex-wrap: wrap;
}

.badge {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 3px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.badge--green { background: var(--green-bg); color: var(--green); }
.badge--orange { background: #FFF0E5; color: var(--orange); }

/* ═══════════ PAY ═══════════ */
.pay-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.pay {
  display: flex; gap: 12px; align-items: center;
  padding: 14px 14px;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all .15s;
  background: var(--white);
  position: relative;
}
.pay input { position: absolute; opacity: 0; pointer-events: none; }
.pay:hover { border-color: var(--red); }
.pay.is-checked { border-color: var(--red); background: var(--red-50); }

.pay__mark {
  width: 16px; height: 16px;
  border: 2px solid var(--gray-300);
  border-radius: 50%;
  flex-shrink: 0;
  transition: all .15s;
  position: relative;
}
.pay.is-checked .pay__mark { border-color: var(--red); }
.pay.is-checked .pay__mark::after {
  content: '';
  position: absolute;
  inset: 2px;
  background: var(--red);
  border-radius: 50%;
}

.pay__icon {
  width: 40px; height: 40px;
  background: var(--gray-50);
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  color: var(--ink);
  flex-shrink: 0;
}
.pay.is-checked .pay__icon { background: var(--red); color: var(--white); }

.pay__text { display: flex; flex-direction: column; line-height: 1.2; }
.pay__text strong { font-size: 14px; font-weight: 700; color: var(--ink); }
.pay__text em { font-size: 11px; color: var(--gray-500); font-style: normal; margin-top: 2px; }

/* ═══════════ SUMMARY ═══════════ */
.summary {
  background: var(--white);
  border-radius: var(--radius);
  padding: 22px 22px;
  border: 1px solid var(--gray-200);
}
.summary__title {
  font-size: 20px;
  font-weight: 800;
  margin-bottom: 16px;
  color: var(--ink);
}

.promo-code {
  display: flex;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-sm);
  overflow: hidden;
  margin-bottom: 18px;
}
.promo-code__input {
  flex: 1;
  padding: 10px 12px;
  border: none;
  outline: none;
  font-size: 13px;
  color: var(--ink);
  background: var(--white);
}
.promo-code__btn {
  padding: 0 14px;
  background: var(--gray-100);
  color: var(--ink);
  font-size: 12px;
  font-weight: 700;
  transition: all .15s;
}
.promo-code__btn:hover { background: var(--red); color: var(--white); }

.summary-rows { display: flex; flex-direction: column; }
.summary-row {
  display: flex; justify-content: space-between;
  padding: 8px 0;
  font-size: 14px;
  border-bottom: 1px dashed var(--gray-200);
}
.summary-row:last-child { border-bottom: none; }
.summary-row dt { color: var(--gray-700); }
.summary-row dt span { color: var(--gray-500); }
.summary-row dd { color: var(--ink); font-weight: 700; }
.summary-row--discount dd { color: var(--red); }
.summary-row .is-free { color: var(--green); font-weight: 600; }

.total {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 2px solid var(--ink);
}
.total__row {
  display: flex; justify-content: space-between; align-items: baseline;
}
.total__row > span:first-child {
  font-size: 15px;
  color: var(--gray-700);
  font-weight: 600;
}
.total__sum {
  font-size: 28px;
  font-weight: 800;
  color: var(--ink);
  letter-spacing: -0.02em;
}
.total__bonus {
  margin-top: 6px;
  font-size: 12px;
  color: var(--gray-700);
}
.total__bonus strong { color: var(--orange); font-weight: 800; }

.btn-order {
  width: 100%;
  margin-top: 16px;
  height: 52px;
  background: var(--red);
  color: var(--white);
  border-radius: var(--radius);
  font-size: 15px;
  font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  gap: 8px;
  transition: background .15s;
}
.btn-order:hover { background: var(--red-dark); }

.summary__legal {
  margin-top: 12px;
  font-size: 11px;
  color: var(--gray-500);
  line-height: 1.5;
  text-align: center;
}
.summary__legal a { color: var(--gray-700); text-decoration: underline; }

/* Perks */
.perks {
  background: var(--white);
  border-radius: var(--radius);
  padding: 14px 18px;
  border: 1px solid var(--gray-200);
  display: flex; flex-direction: column; gap: 12px;
}
.perk {
  display: flex; gap: 10px; align-items: center;
  font-size: 13px;
}
.perk__icon {
  width: 32px; height: 32px;
  background: var(--red-50);
  color: var(--red);
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.perk strong { display: block; color: var(--ink); font-weight: 700; font-size: 13px; }
.perk span { color: var(--gray-500); font-size: 12px; }

/* Help card */
.help-card {
  background: var(--ink);
  color: var(--white);
  border-radius: var(--radius);
  padding: 18px;
  display: flex; flex-direction: column; gap: 4px;
}
.help-card__top {
  display: flex; gap: 12px; align-items: center;
  margin-bottom: 8px;
}
.help-card__avatar {
  width: 40px; height: 40px;
  background: var(--red);
  color: var(--white);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800;
  font-size: 18px;
}
.help-card__name { font-size: 14px; font-weight: 700; }
.help-card__desc { font-size: 12px; color: var(--gray-500); margin-top: 2px; }
.help-card__phone {
  font-size: 22px;
  font-weight: 800;
  color: var(--white);
  letter-spacing: -0.01em;
  margin-top: 4px;
  transition: color .15s;
}
.help-card__phone:hover { color: var(--yellow); }
.help-card__hours { font-size: 11px; color: var(--gray-500); }

/* ═══════════ RESPONSIVE ═══════════ */
@media (max-width: 1100px) {
  .cart-layout { grid-template-columns: 1fr; }
  .cart-right { position: static; }
  .pay-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 720px) {
  .cart-item {
    grid-template-columns: 24px 80px 1fr;
    gap: 12px;
  }
  .cart-item__actions {
    grid-column: 1 / -1;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    padding-top: 10px;
    border-top: 1px dashed var(--gray-200);
  }
  .form-grid { grid-template-columns: 1fr; }
  .pay-grid { grid-template-columns: 1fr; }
  .client-type { grid-template-columns: 1fr; }
  .cart-head__title { font-size: 24px; }
  .cart-head__num { font-size: 16px; }
  .deliv-tabs { overflow-x: auto; scrollbar-width: none; white-space: nowrap; }
  .deliv-tabs::-webkit-scrollbar { display: none; }
  .checkout-steps { flex-wrap: wrap; gap: 14px; }
  .step { padding-right: 0; }
  .step:not(:last-child)::after { display: none; }
  .addon { grid-template-columns: 50px 1fr auto; }
  .addon__add { grid-row: 1; grid-column: 3; }
  .addon__price { grid-column: 2; font-size: 14px; }
}
