/* ============================
   Checkout
============================ */
.co-wrap {
  max-width: 1160px; margin: 0 auto; padding: 34px 24px 60px;
  display: grid; grid-template-columns: 1.5fr 1fr; gap: 34px; align-items: start;
}
.co-card { background: var(--white); border: 1px solid var(--gray-100); border-radius: var(--radius); padding: 22px; margin-bottom: 20px; }
.co-section-title { font-size: 1rem; font-weight: 800; margin-bottom: 16px; display: flex; align-items: center; gap: 8px; }
.co-section-title i { color: var(--red); }

.co-field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 14px; }
.co-field { margin-bottom: 14px; }
.co-field.co-field-sm { }
.co-field label { display: block; font-size: .76rem; font-weight: 700; margin-bottom: 6px; color: var(--gray-700); }
.co-field input, .co-field select, .co-select-wrap select {
  width: 100%; padding: 11px 13px; border-radius: 7px; border: 1px solid var(--gray-300);
  font-family: inherit; font-size: .86rem;
}
.co-field input.error { border-color: var(--red); }
.co-select-wrap { position: relative; }
.co-select-wrap i { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); pointer-events: none; color: var(--gray-500); }

.co-shipping-options { display: flex; flex-direction: column; gap: 10px; }
.co-shipping-opt {
  display: flex; align-items: center; justify-content: space-between;
  border: 1.5px solid var(--gray-300); border-radius: 8px; padding: 12px 14px; cursor: pointer;
}
.co-shipping-opt.selected { border-color: var(--red); background: #fff8f7; }
.co-shipping-opt input { margin-right: 10px; }
.co-shipping-info { display: flex; flex-direction: column; }
.co-shipping-name { font-size: .86rem; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.co-shipping-name i { color: var(--red); }
.co-shipping-desc { font-size: .74rem; color: var(--gray-500); }
.co-shipping-price { font-weight: 800; font-size: .88rem; }
.co-shipping-price.free { color: #1e8449; }

.co-pay-info { display: flex; gap: 14px; align-items: flex-start; }
.co-pay-icon {
  width: 44px; height: 44px; border-radius: 50%; background: #fff2f0; color: var(--red);
  display: flex; align-items: center; justify-content: center; font-size: 1.1rem; flex-shrink: 0;
}
.co-pay-info h4 { font-size: .92rem; font-weight: 800; margin-bottom: 6px; }
.co-pay-info p { font-size: .82rem; color: var(--gray-700); line-height: 1.5; }

.co-btn-confirm {
  width: 100%; background: var(--red); color: var(--white); border: none;
  padding: 15px; border-radius: 8px; font-weight: 800; font-size: .92rem;
  display: flex; align-items: center; justify-content: center; gap: 8px;
}
.co-btn-confirm:disabled { opacity: .6; }
.co-terms { text-align: center; font-size: .74rem; color: var(--gray-500); margin-top: 12px; }
.co-terms a { color: var(--red); text-decoration: underline; }

.co-summary-card { background: var(--white); border: 1px solid var(--gray-100); border-radius: var(--radius); padding: 22px; position: sticky; top: 20px; }
.co-summary-title { font-size: 1rem; font-weight: 800; margin-bottom: 14px; }
.co-summary-items { display: flex; flex-direction: column; gap: 12px; margin-bottom: 16px; }
.co-sum-item { display: flex; gap: 10px; align-items: center; }
.co-sum-img { width: 50px; height: 50px; border-radius: 6px; overflow: hidden; background: var(--gray-50); flex-shrink: 0; position: relative; }
.co-sum-img img { width: 100%; height: 100%; object-fit: cover; }
.co-sum-qty { position: absolute; top: -6px; right: -6px; background: var(--black); color: var(--white); font-size: .62rem; font-weight: 700; width: 17px; height: 17px; border-radius: 50%; display: flex; align-items: center; justify-content: center; }
.co-sum-info { flex: 1; }
.co-sum-info h5 { font-size: .8rem; font-weight: 700; margin-bottom: 2px; }
.co-sum-info span { font-size: .7rem; color: var(--gray-500); }
.co-sum-price { font-size: .82rem; font-weight: 800; }

.co-discount-row { display: flex; gap: 8px; margin-bottom: 4px; }
.co-discount-row input { flex: 1; padding: 9px 11px; border-radius: 6px; border: 1px solid var(--gray-300); font-size: .8rem; }
.co-discount-row button { background: var(--black); color: var(--white); border: none; padding: 9px 14px; border-radius: 6px; font-size: .78rem; font-weight: 700; }
.co-discount-msg { font-size: .74rem; margin: 4px 0 12px; }
.co-discount-msg.ok { color: #1e8449; }
.co-discount-msg.err { color: var(--red); }

.co-totals { border-top: 1px solid var(--gray-100); padding-top: 14px; display: flex; flex-direction: column; gap: 8px; }
.co-total-row { display: flex; justify-content: space-between; font-size: .86rem; }
.co-total-row:last-child { font-size: 1.05rem; font-weight: 800; border-top: 1px solid var(--gray-100); padding-top: 10px; margin-top: 4px; }
.discount-val { color: #1e8449; font-weight: 700; }
.free-val { color: #1e8449; font-weight: 700; }
.co-promo4x1-line { color: var(--red-dark); font-weight: 700; }

/* Auth / success overlays */
.co-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.6); z-index: 3000; display: none; align-items: center; justify-content: center; padding: 20px; }
.co-overlay.show { display: flex; }
.co-modal { background: var(--white); border-radius: var(--radius); padding: 28px; max-width: 400px; width: 100%; position: relative; }
.co-modal button.close-x { position: absolute; top: 14px; right: 14px; background: none; border: none; font-size: 1.1rem; color: var(--gray-500); }
.co-modal h3 { font-size: 1.1rem; font-weight: 800; margin-bottom: 6px; }
.co-modal p { font-size: .84rem; color: var(--gray-700); margin-bottom: 16px; }
.co-modal input { width: 100%; padding: 11px 13px; border-radius: 7px; border: 1px solid var(--gray-300); margin-bottom: 10px; font-family: inherit; font-size: .86rem; }
.co-modal button.primary { width: 100%; background: var(--red); color: var(--white); border: none; padding: 12px; border-radius: 7px; font-weight: 700; margin-top: 6px; }
.co-modal .switch-link { text-align: center; font-size: .8rem; margin-top: 12px; }
.co-modal .switch-link a { color: var(--red); font-weight: 700; }
.co-auth-error { color: var(--red); font-size: .78rem; margin-top: 6px; min-height: 1em; }

.co-success-icon { width: 64px; height: 64px; border-radius: 50%; background: #eafaf0; color: #1e8449; font-size: 1.8rem; display: flex; align-items: center; justify-content: center; margin: 0 auto 16px; }
.co-modal.success { text-align: center; }

@media (max-width: 860px) {
  .co-wrap { grid-template-columns: 1fr; }
  .co-field-row { grid-template-columns: 1fr; }
}
