/* ========== CONFIRM ORDER FORM ========== */
.popup-confirm-address .page-content {
  padding: 12px 14px 24px !important;
}
#fromConfirm {
  display: block;
}
.confirm-form-section {
  margin-bottom: 24px;
  padding: 20px;
  border-radius: 16px;
  background: #ffffff;
  border: 1px solid rgba(0,0,0,.06);
  box-shadow: 0 8px 20px rgba(0,0,0,.04);
}
.confirm-form-section:first-of-type {
  margin-top: 0;
}
.confirm-form-title {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 18px;
  color: #1a1a1a;
  display: flex;
  align-items:center;
  gap: 10px;
}
.confirm-form-title:before {
  content: '';
  width: 4px;
  height: 24px;
  background: #2ca652;
  border-radius: 2px;
}
.confirm-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}
@media (max-width: 600px) {
  .confirm-form-grid {
    grid-template-columns: 1fr;
  }
}
.confirm-form-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.confirm-form-field label {
  font-size: 14px;
  font-weight: 600;
  color: #2a2a2a;
}
.confirm-form-full {
  grid-column: 1 / -1;
}
.confirm-form-input {
  padding: 12px 14px;
  border: 1.5px solid #e0e4e8;
  border-radius: 12px;
  font-size: 15px;
  font-family: inherit;
  transition: border-color .2s ease, box-shadow .2s ease;
  background: #ffffff;
}
.confirm-form-input:focus {
  outline: none;
  border-color: #2ca652;
  box-shadow: 0 0 0 3px rgba(44, 166, 82, 0.08);
}
.confirm-form-textarea {
  resize: vertical;
  max-height: 200px;
}
.signature-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
#traderSignature {
  background: #ffffff;
  border-radius: 12px;
}
.signature-clear-link {
  text-align: center;
  color: #d02f2f;
  font-size: 14px;
  font-weight: 600;
  padding: 8px 12px;
  border-radius: 8px;
  transition: background .2s ease;
  text-decoration: none;
}
.signature-clear-link:hover {
  background: rgba(208, 47, 47, 0.08);
}
.confirm-form-actions {
  margin-top: 24px;
  display: grid;
  gap: 12px;
}
.confirm-form-actions .button {
  border-radius: 12px;
  font-size: 16px;
  font-weight: 700;
  padding: 16px 20px;
}

/* ========== ORDER SUMMARY CARD ========== */
.order-summary-card {
  margin: 16px 14px;
  padding: 0;
  border-radius: 18px;
  background: #ffffff;
  border: 1px solid rgba(0,0,0,.06);
  box-shadow: 0 10px 24px rgba(0,0,0,.06);
  overflow: hidden;
}
.summary-header {
  padding: 18px 20px;
  background: linear-gradient(135deg, #2ca652 0%, #208c40 100%);
  color: #ffffff;
}
.summary-header h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
}
.summary-body {
  padding: 16px 20px;
  display: grid;
  gap: 12px;
}
.summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid rgba(0,0,0,.05);
}
.summary-row:last-child {
  border-bottom: none;
}
.summary-label {
  font-size: 14px;
  color: #5f6b75;
  font-weight: 500;
}
.summary-value {
  font-size: 16px;
  font-weight: 700;
  color: #1a1a1a;
}
.summary-value.discount {
  color: #d02f2f;
}
.summary-total {
  padding: 16px 0;
  background: #f8fbfa;
  padding: 16px;
  border-radius: 12px;
  border-bottom: none !important;
  margin: 0 -20px -16px;
  padding: 16px 20px;
}
.summary-total .summary-label {
  font-size: 16px;
  font-weight: 700;
  color: #1a1a1a;
}
.summary-total .summary-value {
  font-size: 20px;
  color: #2ca652;
}


/* ========== ขั้นตอนที่อยู่จัดส่ง (popup-shipping-address · api/user/order.php getAddress) ========== */
.popup-shipping-address .page-content { background: #f4f6f4 !important; }
.ckx { max-width: 760px; margin: 0 auto; padding: 14px 14px 24px; box-sizing: border-box; font-family: var(--sh-font, inherit); color: #0f172a; }
.ckx *, .ckx *::before { box-sizing: border-box; }
.ckx-steps { display: flex; align-items: center; justify-content: center; gap: 0; list-style: none; margin: 4px 0 14px; padding: 0; }
.ckx-steps li { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: #8492a6; white-space: nowrap; }
.ckx-steps li span { width: 26px; height: 26px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 800; background: #e3e8e4; color: #64748b; }
.ckx-steps li + li::before { content: ''; width: 34px; height: 2px; background: #dbe3dd; margin: 0 10px; }
.ckx-steps li.done span { background: #dcfce7; color: #15803d; }
.ckx-steps li.done { color: #15803d; }
.ckx-steps li.on { color: #0f172a; }
.ckx-steps li.on span { background: linear-gradient(135deg, #14532d, #2ca652); color: #fff; box-shadow: 0 4px 10px rgba(44, 166, 82, .3); }
.ckx-note { margin: 0 0 12px; padding: 10px 14px; border-radius: 10px; background: #fffbeb; border: 1px solid #fde68a; color: #92400e; font-size: 13px; line-height: 1.5; }
.ckx-note.ok { background: #ecfdf3; border-color: #bbf7d0; color: #166534; }
.ckx-note a { color: #1d7a46; font-weight: 700; text-decoration: none; }
.ckx-card { background: #fff; border: 1px solid #e3e8e4; border-radius: 14px; box-shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 4px 14px rgba(15, 23, 42, .04); margin-bottom: 14px; overflow: hidden; }
.ckx-head { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-bottom: 1px solid #eef2ef; background: #fafcfa; }
.ckx-head i { flex: none; width: 38px; height: 38px; border-radius: 10px; background: #ecfdf3; display: flex; align-items: center; justify-content: center; font-size: 18px; font-style: normal; }
.ckx-head h3 { margin: 0; font-size: 15px; font-weight: 700; color: #0f172a; }
.ckx-head p { margin: 1px 0 0; font-size: 12px; color: #8492a6; }
.ckx-body { padding: 14px 16px 6px; }
.ckx-field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; min-width: 0; }
.ckx-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.ckx .checkout-label { font-size: 13px; font-weight: 600; color: #334155; margin: 0; }
.ckx-req { color: #dc2626; margin-left: 2px; }
.ckx-opt { color: #94a3b8; font-weight: 500; font-size: 12px; }
.ckx-help { font-size: 11.5px; color: #94a3b8; line-height: 1.4; }
.ckx .checkout-input, .ckx .checkout-select { width: 100%; height: 46px; padding: 0 14px; border: 1px solid #d5dedb; border-radius: 10px; background: #fff; font: inherit; font-size: 15px; color: #0f172a; box-shadow: none; -webkit-appearance: none; appearance: none; transition: border-color .15s, box-shadow .15s; }
.ckx .checkout-input::placeholder { color: #a3b0bd; }
.ckx .checkout-input:focus, .ckx .checkout-select:focus { outline: none; border-color: #2ca652; box-shadow: 0 0 0 3px rgba(44, 166, 82, .14); }
.ckx .checkout-select { padding-right: 38px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; cursor: pointer; }
.ckx .checkout-input[type="date"] { padding-right: 10px; }
.ckx-actions { position: sticky; bottom: 0; display: flex; align-items: center; gap: 10px; margin: 6px -14px 0; padding: 12px 14px calc(12px + env(safe-area-inset-bottom)); background: rgba(244, 246, 244, .92); backdrop-filter: blur(6px); border-top: 1px solid #e3e8e4; }
.ckx-sum { flex: 1; min-width: 0; display: flex; flex-direction: column; font-size: 12px; color: #64748b; }
.ckx-sum b { font-size: 16px; color: #0f172a; }
.ckx-btn { display: inline-flex; align-items: center; justify-content: center; height: 48px; padding: 0 18px; border-radius: 12px; font-size: 15px; font-weight: 700; text-decoration: none; white-space: nowrap; }
.ckx-btn-ghost { background: #fff; color: #334155; border: 1px solid #d5dedb; }
.ckx .checkout-submit-btn.ckx-btn-primary { display: inline-flex; width: auto; margin: 0; padding: 0 22px; height: 48px; line-height: 1; font-size: 15px; color: #fff; box-shadow: 0 6px 16px rgba(29, 122, 70, .28); }
.ckx-trust { margin: 12px 0 0; text-align: center; font-size: 12px; color: #94a3b8; }
.ckx-trust a { color: #1d7a46; font-weight: 700; text-decoration: none; }
@media (max-width: 560px) {
    .ckx { padding: 10px 10px 20px; }
    .ckx-row { grid-template-columns: 1fr; gap: 0; }
    .ckx-steps li { font-size: 12px; }
    .ckx-steps li + li::before { width: 18px; margin: 0 6px; }
    .ckx-actions { margin: 6px -10px 0; padding: 10px 10px calc(10px + env(safe-area-inset-bottom)); flex-wrap: wrap; }
    .ckx-sum { flex-basis: 100%; flex-direction: row; justify-content: space-between; align-items: baseline; }
    .ckx-btn-ghost { flex: 0 0 auto; }
    .ckx .checkout-submit-btn.ckx-btn-primary { flex: 1 1 auto; }
}
/* navbar inside the popup is fixed (56px) but a global rule sets .popup .page-content padding to 12px, hiding the first rows under it */
.popup-shipping-address .page-content { padding-top: 66px !important; padding-left: 0 !important; padding-right: 0 !important; }
