/**
 * MDS Modern Checkout Stylesheet (mds-firm.ru)
 * Дизайн 2026 года: Адаптивность, Sticky-сайдбар, CSS-переменные темы, мобильный UX
 * Версия: 1.01
 */

/* ═══ Базовые переменные и сброс ═══ */
.mds-checkout-page-wrapper {
  font-family: var(--font-family, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif) !important;
  color: var(--text-color, #1f2937);
  background-color: var(--bg-light, #f8fafc);
  padding: 20px 0 60px 0;
  min-height: 80vh;
}

.mds-checkout-page-wrapper *,
.mds-checkout-page-wrapper *::before,
.mds-checkout-page-wrapper *::after {
  box-sizing: border-box;
}

/* Защита иконок FontAwesome */
.mds-checkout-page-wrapper .fa,
.mds-checkout-page-wrapper .fas,
.mds-checkout-page-wrapper .far,
.mds-checkout-page-wrapper [class*=" fa-"] {
  font-family: "FontAwesome", "Font Awesome 6 Free" !important;
}

/* Хлебные крошки */
.mds-checkout-breadcrumb {
  background: transparent !important;
  padding: 8px 0 16px 0 !important;
  margin: 0 !important;
  font-size: 13px !important;
  list-style: none !important;
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 8px !important;
}

.mds-checkout-breadcrumb li a {
  color: #6b7280 !important;
  text-decoration: none !important;
  transition: color 0.15s ease;
}

.mds-checkout-breadcrumb li a:hover {
  color: var(--primary-color, #10b981) !important;
}

.mds-checkout-breadcrumb li + li::before {
  content: "/" !important;
  color: #d1d5db !important;
  padding-right: 8px !important;
}

/* Заголовок страницы */
.mds-checkout-header-block {
  margin-bottom: 24px;
}

.mds-checkout-title {
  font-size: 28px !important;
  font-weight: 700 !important;
  color: var(--text-color, #111827) !important;
  margin: 0 0 6px 0 !important;
  letter-spacing: -0.02em !important;
}

.mds-checkout-subtitle {
  font-size: 15px !important;
  color: #6b7280 !important;
  margin: 0 !important;
}

/* ═══ Основная сетка: Двухколоночный макет ═══ */
.mds-checkout-grid {
  display: grid;
  grid-template-columns: 1fr 390px;
  gap: 28px;
  align-items: flex-start;
}

.mds-checkout-main-col {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* Карточки шагов */
.mds-co-card {
  background: #ffffff;
  border-radius: 14px;
  border: 1px solid var(--border-color, #e5e7eb);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.03);
  overflow: hidden;
  transition: box-shadow 0.2s ease;
}

.mds-co-card:hover {
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.05);
}

.mds-co-card-header {
  padding: 18px 24px;
  border-bottom: 1px solid #f3f4f6;
  display: flex;
  align-items: center;
  gap: 14px;
  background-color: #fafbfc;
}

.mds-co-step-badge {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background-color: #0f172a;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  flex-shrink: 0;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.15);
}

.mds-co-card-title {
  font-size: 18px !important;
  font-weight: 700 !important;
  color: #111827 !important;
  margin: 0 !important;
  line-height: 1.2 !important;
}

.mds-co-card-desc {
  font-size: 13px;
  color: #6b7280;
  margin-top: 2px;
  display: block;
}

.mds-co-card-body {
  padding: 24px;
}

/* ═══ СТИЛИ КОРЗИНЫ (ШАГ 1) ═══ */
.mds-co-cart-body {
  padding: 16px 24px 20px 24px;
}

.mds-co-products-list {
  display: flex;
  flex-direction: column;
}

.mds-co-item-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 0;
  border-bottom: 1px solid #f3f4f6;
  transition: background-color 0.2s ease, opacity 0.2s ease;
}

.mds-co-item-row:last-child {
  border-bottom: none;
}

.mds-co-item-row.is-updating {
  opacity: 0.6;
}

.mds-co-item-img-wrap {
  width: 72px;
  height: 72px;
  flex-shrink: 0;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid #f3f4f6;
  background: #fafafa;
  display: flex;
  align-items: center;
  justify-content: center;
}

.mds-co-item-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.mds-co-item-info {
  flex: 1;
  min-width: 0;
}

.mds-co-item-name {
  font-size: 15px;
  font-weight: 600;
  color: #111827;
  text-decoration: none;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.35;
  transition: color 0.15s ease;
}

.mds-co-item-name:hover {
  color: var(--primary-color, #10b981);
}

.mds-co-item-meta {
  font-size: 12px;
  color: #6b7280;
  margin-top: 3px;
}

.mds-co-item-options {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}

.mds-co-opt-pill {
  font-size: 11px;
  background: #f3f4f6;
  padding: 2px 8px;
  border-radius: 4px;
  color: #4b5563;
}

.mds-co-item-unit-price {
  font-size: 13px;
  color: #9ca3af;
  margin-top: 4px;
  white-space: nowrap !important;
}

/* Степпер количества */
.mds-co-stepper {
  display: inline-flex;
  align-items: center;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  background: #ffffff;
  overflow: hidden;
  height: 38px;
}

.mds-co-stepper-btn {
  width: 30px;
  height: 100%;
  background: #f9fafb;
  border: none;
  font-size: 16px;
  font-weight: 600;
  color: #374151;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease, color 0.15s ease;
  user-select: none;
}

.mds-co-stepper-btn:hover {
  background: #f3f4f6;
  color: var(--primary-color, #10b981);
}

.mds-co-stepper-val {
  min-width: 66px;
  width: 68px;
  padding: 0 4px;
  height: 100%;
  border: none;
  text-align: center;
  font-size: 14px;
  font-weight: 600;
  color: #111827;
  outline: none;
  padding: 0;
  -moz-appearance: textfield;
}

.mds-co-stepper-val::-webkit-inner-spin-button,
.mds-co-stepper-val::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.mds-co-item-total-wrap {
  width: 110px;
  text-align: right;
  flex-shrink: 0;
}

.mds-co-item-total {
  font-size: 16px;
  font-weight: 700;
  color: #111827;
  white-space: nowrap !important;
}

.mds-co-item-del-wrap {
  flex-shrink: 0;
}

.mds-co-item-del-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: #9ca3af;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.mds-co-item-del-btn:hover {
  background: #fee2e2;
  color: #ef4444;
}

/* Статус наличия у каждого товара */
.mds-co-item-stock-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  font-weight: 500;
  padding: 3px 8px;
  border-radius: 4px;
  margin: 4px 0 6px 0;
  width: fit-content;
  white-space: nowrap !important;
}

.mds-co-item-stock-badge.is-stock {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  color: #166534;
}

.mds-co-item-stock-badge.is-order {
  background: #fffbeb;
  border: 1px solid #fde68a;
  color: #92400e;
}

.mds-stock-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #16a34a;
  display: inline-block;
  flex-shrink: 0;
}

.mds-stock-dot.orange {
  background: #f59e0b;
}

.mds-co-cart-footer-bar {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px dashed #e5e7eb;
}

/* Сводный баннер наличия в подвале корзины */
.mds-co-stock-banner {
  border-radius: 10px;
  padding: 12px 16px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.mds-co-stock-banner.is-full-stock {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
}

.mds-co-stock-banner.is-full-stock .mds-co-stock-banner-icon {
  background: #dcfce7;
  color: #16a34a;
}

.mds-co-stock-banner.is-full-stock .mds-co-stock-banner-title {
  color: #15803d;
}

.mds-co-stock-banner.is-mixed-stock {
  background: #f8fafc;
  border: 1px solid #cbd5e1;
}

.mds-co-stock-banner.is-mixed-stock .mds-co-stock-banner-icon {
  background: #e2e8f0;
  color: #475569;
}

.mds-co-stock-banner.is-mixed-stock .mds-co-stock-banner-title {
  color: #0f172a;
}

.mds-co-stock-banner.is-order-stock {
  background: #fffbeb;
  border: 1px solid #fde68a;
}

.mds-co-stock-banner.is-order-stock .mds-co-stock-banner-icon {
  background: #fef3c7;
  color: #d97706;
}

.mds-co-stock-banner.is-order-stock .mds-co-stock-banner-title {
  color: #92400e;
}

.mds-co-stock-banner-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
  margin-top: 2px;
}

.mds-co-stock-banner-body {
  flex: 1;
  min-width: 0;
}

.mds-co-stock-banner-title {
  font-size: 13.5px;
  font-weight: 700;
  margin-bottom: 3px;
}

.mds-co-stock-banner-desc {
  font-size: 12.5px;
  line-height: 1.45;
  color: #475569;
}

.mds-co-stock-banner-desc .mds-co-stock-row {
  margin-bottom: 3px;
  display: block;
}

.mds-co-stock-banner-desc .mds-co-stock-subtext {
  margin-top: 5px;
  color: #64748b;
  font-size: 12px;
}

.mds-co-stock-banner-desc .stock-part {
  color: #166534;
  font-weight: 500;
}

.mds-co-stock-banner-desc .order-part {
  color: #92400e;
  font-weight: 500;
}

.mds-co-notice-box {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: 8px;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: #166534;
}

.mds-co-notice-box i {
  font-size: 16px;
  color: #16a34a;
  flex-shrink: 0;
}

/* ═══ ШАГ 2: КЛИЕНТ И ПОЛЯ ВВОДА ═══ */
.mds-co-type-switcher {
  display: flex;
  background: #f1f5f9;
  padding: 5px;
  border-radius: 12px;
  gap: 6px;
  margin-bottom: 24px;
  border: 1px solid #e2e8f0;
}

.mds-co-type-radio {
  flex: 1;
  cursor: pointer;
  margin: 0;
  position: relative;
}

.mds-co-type-radio input {
  display: none;
}

.mds-co-type-pill {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 11px 18px;
  border-radius: 8px;
  border: 1px solid transparent;
  background: transparent;
  font-size: 14.5px;
  font-weight: 500;
  color: #64748b;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  user-select: none;
}

.mds-co-type-pill i {
  font-size: 15px;
  color: #94a3b8;
  transition: color 0.2s ease;
}

.mds-co-type-radio:hover .mds-co-type-pill {
  color: #0f172a;
  background: rgba(255, 255, 255, 0.6);
}

.mds-co-type-radio:hover .mds-co-type-pill i {
  color: #475569;
}

.mds-co-type-radio.is-active .mds-co-type-pill {
  background: #ffffff !important;
  color: #0f172a !important;
  font-weight: 600 !important;
  border-color: rgba(0, 0, 0, 0.04) !important;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.08), 0 1px 1px rgba(15, 23, 42, 0.04) !important;
}

.mds-co-type-radio.is-active .mds-co-type-pill i {
  color: var(--primary-color, #044135) !important;
}

.mds-co-form-row {
  margin-bottom: 16px;
}

.mds-co-row-2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.mds-co-field-wrap {
  display: flex;
  flex-direction: column;
}

.mds-co-label {
  font-size: 13px;
  font-weight: 600;
  color: #374151;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.mds-co-label .req {
  color: #ef4444;
}

.mds-co-label .opt {
  font-weight: 400;
  color: #9ca3af;
  font-size: 12px;
}

.mds-co-input,
.mds-co-textarea {
  width: 100% !important;
  height: 44px;
  padding: 10px 14px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-size: 15px;
  color: #111827;
  background: #ffffff;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  font-family: inherit;
}

.mds-co-textarea {
  height: auto;
  min-height: 80px;
  resize: vertical;
}

.mds-co-input:focus,
.mds-co-textarea:focus {
  border-color: #0f172a;
  box-shadow: 0 0 0 3px rgba(15, 23, 42, 0.08);
}

.mds-co-input.is-invalid,
.mds-co-textarea.is-invalid {
  border-color: #ef4444 !important;
  background-color: #fffaf0 !important;
}

.mds-co-field-err {
  font-size: 12px;
  color: #ef4444;
  margin-top: 4px;
  min-height: 16px;
}

/* Чекбоксы */
.mds-co-sub-checkbox {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  cursor: pointer;
  user-select: none;
}

.mds-co-sub-checkbox input {
  display: none;
}

.mds-co-checkbox-label {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  user-select: none;
  margin: 0;
}

.mds-co-checkbox-label input {
  display: none;
}

.mds-co-custom-check {
  width: 20px;
  height: 20px;
  border: 2px solid #d1d5db;
  border-radius: 5px;
  background: #ffffff;
  position: relative;
  flex-shrink: 0;
  transition: all 0.15s ease;
}

.mds-co-custom-check.mds-check-sm {
  width: 18px;
  height: 18px;
  border-radius: 4px;
}

input:checked + .mds-co-custom-check {
  background-color: var(--primary-color, #10b981);
  border-color: var(--primary-color, #10b981);
}

input:checked + .mds-co-custom-check::after {
  content: "";
  position: absolute;
  left: 6px;
  top: 2px;
  width: 5px;
  height: 10px;
  border: solid #ffffff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.mds-co-custom-check.mds-check-sm::after {
  left: 5px;
  top: 1px;
}

.mds-co-check-text {
  font-size: 14px;
  color: #374151;
}

.mds-co-check-text a {
  color: var(--primary-color, #10b981);
  text-decoration: underline;
}

.text-success {
  color: #25D366 !important;
}

/* Блок загрузки реквизитов */
.mds-co-yorik-extras {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 16px;
  margin-bottom: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.mds-co-upload-wrapper {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.mds-co-btn-upload {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  border-radius: 8px;
  border: 1px dashed #94a3b8;
  background: #ffffff;
  font-size: 13px;
  font-weight: 600;
  color: #475569;
  cursor: pointer;
  transition: all 0.15s ease;
}

.mds-co-btn-upload:hover {
  border-color: var(--primary-color, #10b981);
  color: var(--primary-color, #10b981);
  background: #f0fdf4;
}

.mds-co-upload-hint {
  font-size: 12px;
  color: #94a3b8;
}

.mds-co-file-attached {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #e0f2fe;
  border: 1px solid #bae6fd;
  border-radius: 6px;
  padding: 6px 12px;
  font-size: 13px;
  color: #0369a1;
}

.mds-co-file-size {
  font-size: 11px;
  color: #0284c7;
}

.mds-co-file-remove-btn {
  background: transparent;
  border: none;
  color: #ef4444;
  cursor: pointer;
  padding: 2px 4px;
  font-size: 14px;
}

/* ═══ ШАГ 3: ДОСТАВКА И САМОВЫВОЗ ═══ */
.mds-co-shipping-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 20px;
}

.mds-co-ship-card {
  cursor: pointer;
  margin: 0;
  display: flex;
  height: 100%;
}

.mds-co-ship-card input {
  display: none;
}

.mds-co-ship-card-inner {
  border: 1.5px solid #e2e8f0;
  border-radius: 12px;
  padding: 18px 20px;
  background: #ffffff !important;
  width: 100%;
  height: 100%;
  display: flex;
  gap: 14px;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.03);
}

.mds-co-ship-card:hover .mds-co-ship-card-inner {
  border-color: #cbd5e1;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.05);
}

.mds-co-ship-card.is-active .mds-co-ship-card-inner {
  border-color: var(--primary-color, #0f172a) !important;
  background: #ffffff !important;
  box-shadow: 0 0 0 1px var(--primary-color, #0f172a), 0 4px 16px rgba(15, 23, 42, 0.06) !important;
}

.mds-co-ship-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  color: #64748b;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
  transition: all 0.2s ease;
}

.mds-co-ship-card:hover .mds-co-ship-icon {
  color: #0f172a;
  border-color: #cbd5e1;
}

.mds-co-ship-card.is-active .mds-co-ship-icon {
  background: #f1f5f9;
  border-color: #cbd5e1;
  color: var(--primary-color, #0f172a) !important;
}

.mds-co-ship-content {
  flex: 1;
  min-width: 0;
}

.mds-co-ship-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.mds-co-ship-title {
  font-size: 15.5px;
  font-weight: 700;
  color: #0f172a;
  display: flex;
  align-items: center;
  gap: 8px;
}

.mds-co-ship-title::before {
  content: "";
  display: inline-block;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid #cbd5e1;
  background: #ffffff;
  flex-shrink: 0;
  transition: all 0.2s ease;
  box-sizing: border-box;
}

.mds-co-ship-card.is-active .mds-co-ship-title::before {
  border-color: var(--primary-color, #0f172a);
  border-width: 5px;
}

.mds-co-ship-price {
  font-size: 12.5px;
  font-weight: 600;
  color: #64748b;
  white-space: nowrap !important;
}

.mds-co-ship-price.is-free {
  color: #047857 !important;
  background: #ecfdf5 !important;
  border: 1px solid #a7f3d0 !important;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.2px;
}

.mds-co-ship-price.is-neutral {
  color: #475569 !important;
  background: #f1f5f9 !important;
  border: 1px solid #e2e8f0 !important;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.2px;
}

.mds-co-ship-address {
  font-size: 13px;
  font-weight: 600;
  color: #334155;
  margin-bottom: 5px;
  display: flex;
  align-items: flex-start;
  gap: 6px;
  line-height: 1.4;
}

.mds-co-ship-address i {
  color: #e11d48;
  margin-top: 3px;
  font-size: 13px;
  flex-shrink: 0;
}

.mds-co-ship-schedule {
  font-size: 12px;
  color: #64748b;
  line-height: 1.45;
}

/* Яркое окно-предупреждение при выборе Транспортной компании (как на старом сайте) */
.mds-co-tk-alert-box {
  background: #fffde7;
  border: 1.5px solid #fde047;
  border-radius: 12px;
  padding: 18px 22px;
  margin-top: 18px;
  box-shadow: 0 4px 16px rgba(234, 179, 8, 0.08);
  animation: mdsFadeSlide 0.22s ease-out;
}

@keyframes mdsFadeSlide {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.mds-co-tk-alert-inner {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.mds-co-tk-alert-icon {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  background: #fef08a;
  color: #a16207;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
  margin-top: 2px;
}

.mds-co-tk-alert-text {
  flex: 1;
}

.mds-co-tk-alert-main {
  font-size: 14.5px;
  color: #1f2937;
  line-height: 1.55;
  margin: 0 0 8px 0 !important;
}

.mds-co-tk-alert-main a {
  color: #0284c7;
  text-decoration: underline;
  font-weight: 600;
  transition: color 0.15s ease;
}

.mds-co-tk-alert-main a:hover {
  color: #0369a1;
}

.mds-co-tk-alert-note {
  font-size: 14.5px;
  font-weight: 700;
  color: #000000;
  line-height: 1.5;
  margin: 0 !important;
}

/* ═══ ПРАВАЯ КОЛОНКА (STICKY САЙДБАР) ═══ */
.mds-checkout-side-col {
  position: relative;
  align-self: flex-start;
}

.mds-co-summary-sticky {
  position: sticky;
  top: 90px;
  z-index: 20;
}

.mds-co-summary-card {
  background: #ffffff;
  border: 1px solid var(--border-color, #e5e7eb);
  border-radius: 14px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
  padding: 24px;
}

.mds-co-summary-title {
  font-size: 20px !important;
  font-weight: 700 !important;
  color: #111827 !important;
  margin: 0 0 18px 0 !important;
  padding-bottom: 14px;
  border-bottom: 1px solid #f3f4f6;
}

.mds-co-summary-rows {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 20px;
}

.mds-co-sum-row {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
  color: #4b5563;
}

.mds-co-sum-row .val {
  font-weight: 600;
  color: #111827;
  white-space: nowrap !important;
}

.mds-co-sum-divider {
  height: 1px;
  background: #e5e7eb;
  margin: 6px 0;
}

.mds-co-sum-total-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 16px;
  font-weight: 700;
  color: #111827;
  padding-top: 4px;
}

.mds-co-sum-total-row .val {
  font-size: 22px;
  font-weight: 800;
  color: #0f172a;
  white-space: nowrap !important;
}

/* Большая кнопка отправки */
.mds-co-btn-submit {
  width: 100%;
  height: 52px;
  border: none;
  border-radius: 10px;
  background: #0f172a;
  color: #ffffff;
  font-size: 16px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.2);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  user-select: none;
  letter-spacing: 0.2px;
}

.mds-co-btn-submit:hover:not(:disabled) {
  background: #1e293b;
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(15, 23, 42, 0.28);
}

.mds-co-btn-submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.mds-co-summary-safe-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
  font-size: 12px;
  color: #6b7280;
  line-height: 1.35;
}

.mds-co-summary-safe-badge i {
  color: #10b981;
  font-size: 14px;
  flex-shrink: 0;
}

/* Блок доверия */
.mds-co-trust-list {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid #f3f4f6;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.mds-co-trust-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: #4b5563;
}

.mds-co-trust-item i {
  color: #10b981;
  font-size: 15px;
  flex-shrink: 0;
}

/* Пустой экран */
.mds-co-empty-box {
  background: #ffffff;
  border-radius: 16px;
  border: 1px solid #e5e7eb;
  padding: 60px 24px;
  text-align: center;
  max-width: 600px;
  margin: 40px auto;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
}

.mds-co-empty-icon {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: #f3f4f6;
  color: #9ca3af;
  font-size: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px auto;
}

.mds-co-empty-title {
  font-size: 22px !important;
  font-weight: 700 !important;
  color: #111827 !important;
  margin-bottom: 10px !important;
}

.mds-co-empty-desc {
  font-size: 15px;
  color: #6b7280;
  max-width: 440px;
  margin: 0 auto 24px auto;
}

.mds-co-btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: 8px;
  background: var(--primary-color, #10b981);
  color: #ffffff;
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.15s ease;
}

.mds-co-btn-primary:hover {
  background: var(--primary-hover, #059669);
  color: #ffffff;
}

/* ═══ МОБИЛЬНЫЙ ПЛАВАЮЩИЙ БАР (<= 768px) ═══ */
.mds-co-mobile-bottom-bar {
  display: none;
}

/* ═══ АДАПТИВНОСТЬ (MEDIA QUERIES) ═══ */
@media (max-width: 991px) {
  .mds-checkout-grid {
    grid-template-columns: 1fr;
  }

  .mds-co-summary-sticky {
    position: static;
  }
}

@media (max-width: 768px) {
  .mds-checkout-page-wrapper {
    padding-bottom: 90px; /* Отступ под нижнюю панель */
  }

  .mds-checkout-title {
    font-size: 22px !important;
  }

  .mds-co-card-body {
    padding: 14px 12px;
  }

  .mds-co-cart-body {
    padding: 12px 14px 16px 14px;
  }

  .mds-co-card-header {
    padding: 14px 16px;
  }

  /* Сетка карточки товара на мобильном: Инфо на всю ширину, степпер и сумма внизу */
  .mds-co-item-row {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    position: relative;
    padding: 14px 0;
    gap: 0;
  }

  .mds-co-item-img-wrap {
    width: 68px;
    height: 68px;
    flex-shrink: 0;
    margin-right: 14px;
    margin-bottom: 12px;
  }

  .mds-co-item-info {
    flex: 1 1 calc(100% - 82px);
    min-width: 0;
    padding-right: 28px; /* Место под кнопку удаления справа */
    margin-bottom: 10px;
  }

  .mds-co-item-name {
    font-size: 14.5px;
    line-height: 1.35;
    -webkit-line-clamp: 3;
    margin-bottom: 4px;
  }

  .mds-co-item-meta {
    font-size: 12px;
    color: #64748b;
    margin-bottom: 4px;
  }

  .mds-co-item-unit-price {
    font-size: 12.5px;
    color: #94a3af;
    margin-top: 3px;
  }

  .mds-co-item-del-wrap {
    position: absolute;
    right: 0;
    top: 10px;
  }

  .mds-co-item-del-btn {
    width: 28px;
    height: 28px;
    font-size: 15px;
    color: #94a3b8;
  }

  .mds-co-item-del-btn:hover {
    color: #ef4444;
  }

  /* Нижняя строка карточки: Степпер количества + Итоговая сумма */
  .mds-co-item-qty-wrap {
    margin-left: 82px;
    display: flex;
    align-items: center;
  }

  .mds-co-stepper {
    height: 34px;
  }

  .mds-co-stepper-btn {
    width: 28px;
  }

  .mds-co-stepper-val {
    min-width: 58px;
    width: 58px;
    font-size: 13.5px;
    padding: 0 2px;
  }

  .mds-co-item-total-wrap {
    margin-left: auto;
    width: auto;
    text-align: right;
    display: flex;
    align-items: center;
  }

  .mds-co-item-total {
    font-size: 16px;
    font-weight: 700;
  }

  @media (max-width: 360px) {
    .mds-co-item-qty-wrap {
      margin-left: 0;
    }
  }

  .mds-co-row-2col {
    grid-template-columns: 1fr;
  }

  .mds-co-shipping-cards {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .mds-co-ship-card-inner {
    padding: 14px !important;
    gap: 12px !important;
  }

  .mds-co-ship-icon {
    width: 36px !important;
    height: 36px !important;
    font-size: 16px !important;
    border-radius: 8px !important;
    margin-top: 2px !important;
  }

  .mds-co-ship-top {
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 6px !important;
    margin-bottom: 8px !important;
  }

  .mds-co-ship-title {
    font-size: 14.5px !important;
    line-height: 1.35 !important;
    display: flex !important;
    align-items: flex-start !important;
    gap: 8px !important;
  }

  .mds-co-ship-title::before {
    margin-top: 2px !important;
    flex-shrink: 0 !important;
  }

  .mds-co-ship-price {
    font-size: 11.5px !important;
    padding: 2px 8px !important;
    border-radius: 12px !important;
    display: inline-block !important;
  }

  .mds-co-ship-address {
    font-size: 12.5px !important;
    line-height: 1.4 !important;
    word-break: break-word !important;
  }

  .mds-co-ship-schedule {
    font-size: 11.5px !important;
    line-height: 1.45 !important;
    word-break: break-word !important;
  }

  .mds-co-tk-alert-box {
    padding: 14px 16px;
    margin-top: 14px;
  }

  .mds-co-tk-alert-icon {
    width: 32px;
    height: 32px;
    font-size: 15px;
  }

  .mds-co-tk-alert-main,
  .mds-co-tk-alert-note {
    font-size: 13.5px;
    line-height: 1.5;
  }

  .mds-co-type-switcher {
    flex-direction: column;
  }

  /* Показываем нижнюю плашку */
  .mds-co-mobile-bottom-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: #ffffff;
    border-top: 1px solid #e5e7eb;
    box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.08);
    padding: 12px 16px;
  }

  .mds-co-mob-total-wrap {
    display: flex;
    flex-direction: column;
  }

  .mds-co-mob-total-wrap .lbl {
    font-size: 11px;
    color: #6b7280;
  }

  .mds-co-mob-total-wrap .val {
    font-size: 18px;
    font-weight: 800;
    color: #0f172a;
    white-space: nowrap !important;
  }

  .mds-co-mob-btn-submit {
    height: 44px;
    padding: 0 20px;
    border-radius: 8px;
    background: #0f172a;
    color: #ffffff;
    border: none;
    font-size: 15px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.2);
  }
}
