/* ===========================
   CHECKOUT.CSS
   Dedicated styles for checkout.html
   =========================== */

/* ===========================
   STEP INDICATOR BAR
   =========================== */
.co-steps-bar {
  background: var(--white);
  border-bottom: 1px solid var(--grey2);
  padding: 18px 12px;
}
.co-steps-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  max-width: 480px;
  margin: 0 auto;
  gap: 0;
}
.co-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  position: relative;
}
.co-step-circle {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--grey2);
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.35s ease;
  border: 2px solid var(--grey2);
}
.co-step.active .co-step-circle {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
  box-shadow: 0 4px 14px rgba(26,26,26,0.25);
}
.co-step.done .co-step-circle {
  background: #22c55e;
  color: #fff;
  border-color: #22c55e;
}
.co-step.done .co-step-circle::before {
  content: '✓';
  font-size: 16px;
}
.co-step.done .co-step-num { display: none; }
.co-step-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  text-transform: uppercase;
  white-space: nowrap;
}
.co-step.active .co-step-label { color: var(--primary); }
.co-step.done .co-step-label { color: #22c55e; }
.co-step-connector {
  flex: 1;
  height: 2px;
  background: var(--grey2);
  margin: 0 10px;
  margin-bottom: 18px;
  min-width: 40px;
  transition: background 0.35s ease;
}
.co-step-connector.done { background: #22c55e; }

/* ===========================
   MAIN LAYOUT
   =========================== */
.co-layout {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 28px;
  max-width: 1300px;
  margin: 0 auto;
  padding: 32px 12px 60px;
  align-items: start;
}

/* ===========================
   CHECKOUT CARD
   =========================== */
.co-card {
  background: var(--white);
  border: 1px solid var(--grey2);
  border-radius: 16px;
  padding: 28px 32px;
  margin-bottom: 20px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}
.co-card-head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 28px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--grey1);
}
.co-card-num {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.co-card-title {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  flex: 1;
  margin: 0;
}
.co-edit-btn {
  background: none;
  border: 1.5px solid var(--grey2);
  border-radius: 8px;
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s;
}
.co-edit-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* ===========================
   FORM GROUPS
   =========================== */
form { display: flex; flex-direction: column; gap: 18px; }
.fg { display: flex; flex-direction: column; gap: 6px; }
.fg-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.fg-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-dark);
}
.req { color: #e91e63; margin-left: 2px; }
.opt { color: var(--text-muted); font-weight: 400; font-size: 11px; }
.fg-input {
  width: 100%;
  padding: 12px 15px;
  border: 1.5px solid #e0e0e0;
  border-radius: 10px;
  font-size: 14px;
  font-family: var(--font-body);
  color: var(--text-dark);
  background: #fff;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
  box-sizing: border-box;
}
.fg-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(26,26,26,0.07);
  background: #fafafa;
}
.fg-input.has-error {
  border-color: #e53935;
  background: #fff5f5;
}
.fg-input[readonly] {
  background: var(--grey1);
  color: var(--text-muted);
  cursor: default;
  border-color: #eee;
}
.fg-select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
  cursor: pointer;
}
.fg-err {
  font-size: 11.5px;
  color: #e53935;
  min-height: 16px;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 4px;
}
.fg-err:not(:empty)::before { content: '⚠ '; }

/* ===========================
   ADDRESS TYPE CHIPS
   =========================== */
.addr-type-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 2px; }
.addr-chip {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 10px 18px;
  border: 1.5px solid var(--grey2);
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s;
  user-select: none;
  background: #fff;
}
.addr-chip input[type="radio"] { display: none; }
.addr-chip.selected {
  border-color: var(--primary);
  background: #f5f5f5;
  color: var(--primary);
}
.addr-chip:hover { border-color: var(--primary); }

/* ===========================
   BUTTONS
   =========================== */
.co-btn-primary {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 15px 24px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.07em;
  cursor: pointer;
  transition: all 0.25s ease;
  text-decoration: none;
  margin-top: 4px;
}
.co-btn-primary:hover {
  background: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(194,24,91,0.3);
}
.co-btn-place {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 16px 24px;
  background: linear-gradient(135deg, #c2185b 0%, #7b1fa2 100%);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.07em;
  cursor: pointer;
  transition: all 0.25s;
  margin-top: 8px;
}
.co-btn-place:hover {
  opacity: 0.92;
  transform: translateY(-2px);
  box-shadow: 0 10px 28px rgba(194,24,91,0.4);
}
.co-btn-place:active { transform: translateY(0); }
.co-btn-ghost {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 14px 24px;
  background: transparent;
  color: var(--primary);
  border: 2px solid var(--primary);
  border-radius: 10px;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.06em;
  cursor: pointer;
  transition: all 0.25s;
  text-decoration: none;
}
.co-btn-ghost:hover {
  background: var(--primary);
  color: #fff;
}

/* ===========================
   REVIEW STEP CONTENT
   =========================== */
.review-addr-card {
  background: #f9f9f9;
  border: 1.5px solid #e0e0e0;
  border-left: 4px solid var(--primary);
  border-radius: 10px;
  padding: 18px 20px;
  margin-bottom: 22px;
}
.review-addr-top {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}
.review-addr-type {
  background: var(--primary);
  color: #fff;
  border-radius: 100px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  padding: 3px 10px;
}
.review-addr-name { font-size: 15px; font-weight: 700; }
.review-addr-phone { font-size: 13px; color: var(--text-muted); }
.review-addr-line { font-size: 13px; color: var(--text-muted); line-height: 1.6; margin: 0; }

.review-items-title {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 14px;
}
.review-item-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 13px 0;
  border-bottom: 1px solid var(--grey1);
}
.review-item-row:last-of-type { border-bottom: none; }
.review-item-emoji {
  font-size: 26px;
  width: 54px;
  height: 54px;
  background: var(--grey1);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border: 1px solid var(--grey2);
}
.review-item-info { flex: 1; }
.review-item-name { font-size: 13px; font-weight: 600; margin-bottom: 3px; }
.review-item-qty { font-size: 12px; color: var(--text-muted); }
.review-item-price { font-size: 15px; font-weight: 700; }
.review-total-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--grey1);
  border-radius: 10px;
  padding: 14px 18px;
  margin-top: 16px;
  font-weight: 700;
  font-size: 16px;
}
.review-total-row strong { font-size: 18px; color: var(--accent); }

/* ===========================
   PAYMENT OPTIONS
   =========================== */
.pm-list { display: flex; flex-direction: column; gap: 0; margin-bottom: 20px; }
.pm-opt {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  border: 1.5px solid var(--grey2);
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s;
  margin-bottom: 8px;
  background: #fff;
  position: relative;
}
.pm-opt:hover { border-color: var(--primary); background: #fafafa; }
.pm-opt.pm-selected { border-color: var(--primary); background: #f8f4ff; }
.pm-opt input[type="radio"] { display: none; }
.pm-icon { font-size: 26px; flex-shrink: 0; width: 36px; text-align: center; }
.pm-text { flex: 1; }
.pm-text strong { display: block; font-size: 14px; font-weight: 700; margin-bottom: 2px; color: var(--text-dark); }
.pm-text span { font-size: 12px; color: var(--text-muted); }
.pm-radio-dot {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid var(--grey3);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}
.pm-opt.pm-selected .pm-radio-dot {
  border-color: var(--primary);
  background: var(--primary);
}
.pm-opt.pm-selected .pm-radio-dot::after {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #fff;
}

.pm-sub-panel {
  background: #f8f9fa;
  border: 1.5px solid #e9e9e9;
  border-radius: 10px;
  padding: 20px;
  margin: -2px 0 10px 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.ssl-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-muted);
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  padding: 12px 16px;
  border-radius: 8px;
  margin-bottom: 16px;
}

/* ===========================
   RIGHT: ORDER SUMMARY CARD
   =========================== */
.co-right {}
.co-summary-card {
  background: var(--white);
  border: 1px solid var(--grey2);
  border-radius: 16px;
  padding: 24px;
  position: sticky;
  top: calc(var(--header-height) + 20px);
  box-shadow: 0 4px 16px rgba(0,0,0,0.05);
}
.co-summary-title {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 18px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--grey1);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.co-summary-count {
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 600;
  background: var(--primary);
  color: #fff;
  border-radius: 100px;
  padding: 2px 10px;
}

/* Summary items */
.co-summary-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--grey1);
}
.co-summary-item-emoji {
  width: 46px;
  height: 46px;
  background: var(--grey1);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
  border: 1px solid var(--grey2);
}
.co-summary-item-info { flex: 1; min-width: 0; }
.co-summary-item-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-dark);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 3px;
}
.co-summary-item-qty { font-size: 11px; color: var(--text-muted); }
.co-summary-item-price { font-size: 14px; font-weight: 700; flex-shrink: 0; }
.co-empty-msg {
  text-align: center;
  padding: 24px 0;
  color: var(--text-muted);
  font-size: 14px;
}
.co-empty-msg a { color: var(--accent); font-weight: 600; }

/* Coupon */
.co-coupon-row {
  display: flex;
  gap: 8px;
  margin-top: 18px;
}
.co-coupon-input-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  border: 1.5px solid var(--grey2);
  border-radius: 10px;
  transition: border-color 0.2s;
  background: #fff;
}
.co-coupon-input-wrap:focus-within { border-color: var(--primary); }
.co-coupon-input-wrap svg { color: var(--text-muted); flex-shrink: 0; }
.co-coupon-input {
  border: none;
  outline: none;
  font-size: 13px;
  font-family: var(--font-body);
  width: 100%;
  padding: 11px 0;
  text-transform: uppercase;
  background: transparent;
  letter-spacing: 0.04em;
}
.co-coupon-btn {
  padding: 11px 16px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  cursor: pointer;
  transition: background 0.2s;
  white-space: nowrap;
}
.co-coupon-btn:hover { background: var(--accent); }
.co-coupon-msg {
  font-size: 12px;
  min-height: 20px;
  margin-top: 8px;
  padding: 0 2px;
}
.co-coupon-msg.success { color: #16a34a; font-weight: 600; }
.co-coupon-msg.error { color: #dc2626; }

/* Totals */
.co-totals { margin-top: 18px; }
.co-tot-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  color: var(--text-muted);
  padding: 8px 0;
}
.co-discount-row { color: #16a34a; }
.green-val { color: #16a34a; font-weight: 600; }
.co-tot-divider { height: 1px; background: var(--grey2); margin: 8px 0; }
.co-grand-row {
  font-size: 16px;
  color: var(--text-dark);
  padding: 12px 0 4px;
}
.co-grand-row strong { font-size: 20px; }
.co-savings-note {
  text-align: center;
  font-size: 12px;
  color: #16a34a;
  font-weight: 600;
  background: #f0fdf4;
  border-radius: 8px;
  padding: 8px;
  margin-top: 8px;
  min-height: 0;
}

/* Trust */
.co-trust {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--grey1);
}
.co-trust-item {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--grey1);
  border-radius: 8px;
  padding: 8px 10px;
  text-align: center;
}

/* Coupon hints */
.co-coupon-hints {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--grey1);
}
.co-coupon-hints > p {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 10px;
}
.co-hint-chips { display: flex; flex-direction: column; gap: 6px; }
.co-hint-chip {
  display: block;
  background: #fff8e1;
  border: 1px dashed #f59e0b;
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 11px;
  font-weight: 600;
  color: #92400e;
  cursor: pointer;
  transition: background 0.2s;
  text-align: center;
}
.co-hint-chip:hover { background: #fef3c7; }

/* ===========================
   SUCCESS OVERLAY
   =========================== */
.co-success-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
  z-index: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.co-success-box {
  background: #fff;
  border-radius: 20px;
  padding: 48px 40px;
  text-align: center;
  max-width: 460px;
  width: 100%;
  box-shadow: 0 24px 64px rgba(0,0,0,0.18);
  animation: popUp 0.4s cubic-bezier(0.175,0.885,0.32,1.275);
}
@keyframes popUp {
  from { opacity: 0; transform: scale(0.75); }
  to   { opacity: 1; transform: scale(1); }
}
.co-success-icon {
  font-size: 72px;
  display: block;
  margin-bottom: 18px;
  animation: bounceIcon 1s ease infinite;
}
@keyframes bounceIcon {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-8px); }
}
.co-success-box h2 {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 12px;
}
.co-success-box > p {
  font-size: 15px;
  color: var(--text-muted);
  margin-bottom: 16px;
  line-height: 1.6;
}
.co-order-id {
  display: inline-block;
  background: var(--grey1);
  border: 1.5px dashed var(--grey3);
  border-radius: 10px;
  padding: 12px 24px;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--primary);
  margin: 4px 0 16px;
}
.co-success-note {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 28px;
}
.co-success-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* ===========================
   RESPONSIVE
   =========================== */
@media (max-width: 900px) {
  .co-layout {
    grid-template-columns: 1fr;
    padding: 20px 16px 40px;
    gap: 20px;
  }
  .co-right { order: -1; }
  .co-summary-card { position: static; }
}
@media (max-width: 560px) {
  .fg-row { grid-template-columns: 1fr; }
  .co-card { padding: 20px 16px; }
  .co-success-box { padding: 32px 22px; }
  .co-success-box h2 { font-size: 22px; }
  .co-steps-inner { max-width: 100%; }
  .co-step-connector { min-width: 20px; }
}
