/* ==========================================================
   checkout.css — Premium Checkout Page Styles
   Madsen's Outdoor Supply — $15K agency quality
   ========================================================== */

/* ── Layout wrapper ───────────────────────────────────────── */
.co-wrap {
  min-height: 100vh;
  background: #F4F3EE;
}

/* ── Progress bar ─────────────────────────────────────────── */
.co-progress {
  background: #12211A;
  padding: 0;
}
.co-progress-inner {
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: stretch;
  height: 60px;
}
.co-progress-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  font-family: "Oswald", sans-serif;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: .02em;
  text-decoration: none;
  flex-shrink: 0;
  margin-right: 36px;
}
.co-progress-brand .logo-mark {
  width: 28px;
  height: 28px;
  color: #D96C00;
}
.co-progress-steps {
  display: flex;
  align-items: center;
  gap: 0;
  flex: 1;
  list-style: none;
  margin: 0;
  padding: 0;
}
.co-step {
  display: flex;
  align-items: center;
  gap: 8px;
  color: rgba(255,255,255,.45);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: .03em;
  text-transform: uppercase;
  position: relative;
  padding: 0 20px 0 0;
}
.co-step + .co-step::before {
  content: "›";
  margin-right: 20px;
  color: rgba(255,255,255,.25);
  font-size: 16px;
}
.co-step.done { color: rgba(255,255,255,.65); }
.co-step.active { color: #D96C00; }
.co-step-num {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(255,255,255,.12);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  flex-shrink: 0;
  transition: background .2s, color .2s;
}
.co-step.done .co-step-num {
  background: #1F7A44;
  color: #fff;
}
.co-step.active .co-step-num {
  background: #D96C00;
  color: #fff;
}
.co-step-label { white-space: nowrap; }

/* ── Secure badge in header ───────────────────────────────── */
.co-secure-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  color: rgba(255,255,255,.5);
  font-size: 12px;
  margin-left: auto;
  flex-shrink: 0;
}
.co-secure-badge svg { width: 14px; height: 14px; color: #1F7A44; }

/* ── Main two-col layout ──────────────────────────────────── */
.co-main {
  max-width: 1160px;
  margin: 0 auto;
  padding: 36px 24px 72px;
  display: grid;
  grid-template-columns: 1fr 400px;
  gap: 32px;
  align-items: start;
}

/* ── Left column – form panels ────────────────────────────── */
.co-left { display: flex; flex-direction: column; gap: 20px; }

.co-panel {
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 2px 16px rgba(18,33,26,.07), 0 1px 4px rgba(18,33,26,.04);
  overflow: hidden;
}
.co-panel-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 24px 18px;
  border-bottom: 1px solid #EDECEA;
}
.co-panel-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: rgba(217,108,0,.1);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.co-panel-icon svg { width: 18px; height: 18px; color: #D96C00; }
.co-panel-title {
  font-family: "Oswald", sans-serif;
  font-size: 17px;
  font-weight: 600;
  color: #12211A;
  letter-spacing: .02em;
  margin: 0;
}
.co-panel-body { padding: 24px; }

/* ── Form fields ──────────────────────────────────────────── */
.co-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 14px;
}
.co-form-row.full { grid-template-columns: 1fr; }
.co-form-row.three { grid-template-columns: 2fr 1fr 1fr; }

.co-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.co-field label {
  font-size: 12px;
  font-weight: 600;
  color: #6B7280;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.co-field input,
.co-field select {
  height: 50px;
  border: 1.5px solid #E5E3DD;
  border-radius: 10px;
  padding: 0 14px;
  font-family: "Inter", sans-serif;
  font-size: 15px;
  color: #12211A;
  background: #FAFAF8;
  outline: none;
  transition: border-color .2s, box-shadow .2s, background .2s;
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  box-sizing: border-box;
}
.co-select-wrap {
  position: relative;
  display: block;
}
.co-select-wrap::after {
  content: '';
  position: absolute;
  right: 13px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 6l4 4 4-4' fill='none' stroke='%2312211A' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-size: 16px;
  pointer-events: none;
}
.co-field select {
  background-image: none;
  padding-right: 36px;
  cursor: pointer;
  /* Suppress native OS chevron in all browsers */
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
}
.co-field input:focus,
.co-field select:focus {
  border-color: #D96C00;
  box-shadow: 0 0 0 3px rgba(217,108,0,.12);
  background: #fff;
}
.co-field input::placeholder { color: #B0ADA6; }
.co-field input.error { border-color: #EF4444; }
.co-field .field-err {
  font-size: 11.5px;
  color: #EF4444;
  margin-top: -2px;
  display: none;
}
.co-field input.error + .field-err,
.co-field input.error ~ .field-err { display: block; }

/* ── Shipping method ──────────────────────────────────────── */
.co-ship-option {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  border: 2px solid #D96C00;
  border-radius: 12px;
  background: rgba(217,108,0,.04);
  cursor: default;
}
.co-ship-radio {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid #D96C00;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.co-ship-radio::after {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #D96C00;
}
.co-ship-info { flex: 1; }
.co-ship-name {
  font-weight: 600;
  font-size: 15px;
  color: #12211A;
}
.co-ship-desc {
  font-size: 13px;
  color: #6B7280;
  margin-top: 2px;
}
.co-ship-price {
  font-family: "Oswald", sans-serif;
  font-size: 20px;
  font-weight: 600;
  color: #1F7A44;
  letter-spacing: .01em;
}

/* ── Coupon code ──────────────────────────────────────────── */
.co-coupon-wrap {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}
.co-coupon-wrap .co-field { flex: 1; margin-bottom: 0; }
.co-coupon-wrap .co-field input { text-transform: uppercase; letter-spacing: .08em; }
#co-coupon-apply {
  height: 50px;
  padding: 0 20px;
  background: #12211A;
  color: #fff;
  border: none;
  border-radius: 10px;
  font-family: "Inter", sans-serif;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: background .2s, transform .15s;
  margin-top: 24px;
}
#co-coupon-apply:hover { background: #1B3327; transform: translateY(-1px); }
#co-coupon-apply:active { transform: translateY(0); }
.co-coupon-msg {
  margin-top: 10px;
  font-size: 13.5px;
  font-weight: 500;
  display: none;
}
.co-coupon-msg.success { color: #1F7A44; display: block; }
.co-coupon-msg.error { color: #EF4444; display: block; }

/* ── Payment note ─────────────────────────────────────────── */
.co-pay-note {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 16px 18px;
  background: #F4F3EE;
  border-radius: 12px;
  border: 1px solid #E5E3DD;
  margin-bottom: 20px;
}
.co-pay-note svg { width: 20px; height: 20px; color: #1F7A44; flex-shrink: 0; margin-top: 2px; }
.co-pay-note-text { font-size: 13.5px; color: #374151; line-height: 1.55; }
.co-pay-note-text strong { color: #12211A; }
.co-pay-icons {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 10px;
}
.co-pay-icon {
  height: 26px;
  border-radius: 5px;
  background: #fff;
  border: 1px solid #E5E3DD;
  padding: 3px 7px;
  font-size: 11px;
  font-weight: 700;
  color: #374151;
  display: flex;
  align-items: center;
  letter-spacing: .02em;
}

/* ── Place Order button ───────────────────────────────────── */
#co-place-order {
  width: 100%;
  height: 60px;
  background: linear-gradient(135deg, #D96C00 0%, #E8820A 100%);
  color: #fff;
  border: none;
  border-radius: 14px;
  font-family: "Oswald", sans-serif;
  font-size: 20px;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  box-shadow: 0 6px 24px rgba(217,108,0,.35), 0 2px 8px rgba(217,108,0,.2);
  transition: transform .2s, box-shadow .2s;
  margin-bottom: 14px;
  position: relative;
  overflow: hidden;
}
#co-place-order::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,.12), transparent);
  pointer-events: none;
}
#co-place-order:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 32px rgba(217,108,0,.45), 0 4px 12px rgba(217,108,0,.25);
}
#co-place-order:active { transform: translateY(0); }
#co-place-order svg { width: 20px; height: 20px; }
.co-order-note {
  text-align: center;
  font-size: 12.5px;
  color: #9CA3AF;
  line-height: 1.6;
}
.co-order-note svg { width: 12px; height: 12px; vertical-align: middle; margin-right: 3px; }

/* ── Trust strip below form ───────────────────────────────── */
.co-trust-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-top: 4px;
}
.co-trust-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 16px 12px;
  background: #fff;
  border-radius: 12px;
  text-align: center;
  box-shadow: 0 1px 6px rgba(18,33,26,.06);
}
.co-trust-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(217,108,0,.1);
  display: flex;
  align-items: center;
  justify-content: center;
}
.co-trust-icon svg { width: 20px; height: 20px; color: #D96C00; }
.co-trust-title {
  font-size: 12px;
  font-weight: 700;
  color: #12211A;
  letter-spacing: .02em;
}
.co-trust-desc {
  font-size: 11px;
  color: #9CA3AF;
  line-height: 1.4;
}

/* ── Right column – order summary ─────────────────────────── */
.co-summary {
  position: sticky;
  top: 20px;
  background: #12211A;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 8px 40px rgba(18,33,26,.25);
}
.co-summary-head {
  padding: 22px 24px 18px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.co-summary-title {
  font-family: "Oswald", sans-serif;
  font-size: 18px;
  font-weight: 600;
  color: #fff;
  letter-spacing: .03em;
  margin: 0 0 2px;
}
.co-summary-count {
  font-size: 12.5px;
  color: rgba(255,255,255,.45);
}

/* Items list */
.co-summary-items {
  padding: 16px 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-height: 340px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,.15) transparent;
}
.co-summary-items::-webkit-scrollbar { width: 4px; }
.co-summary-items::-webkit-scrollbar-track { background: transparent; }
.co-summary-items::-webkit-scrollbar-thumb { background: rgba(255,255,255,.18); border-radius: 4px; }

.co-line {
  display: flex;
  gap: 12px;
  align-items: center;
}
.co-line-img-wrap {
  position: relative;
  flex-shrink: 0;
}
/* Fallback when thumbnail image fails to load */
.co-line-img-wrap.co-line-img-ph {
  width: 56px;
  height: 56px;
  border-radius: 10px;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.1);
  display: flex;
  align-items: center;
  justify-content: center;
}
.co-line-img-wrap.co-line-img-ph::before {
  content: '🛒';
  font-size: 22px;
  opacity: 0.7;
}
.co-line-img {
  width: 56px;
  height: 56px;
  border-radius: 10px;
  object-fit: cover;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.1);
}
.co-line-qty-badge {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 20px;
  height: 20px;
  background: #D96C00;
  border-radius: 50%;
  font-size: 10px;
  font-weight: 700;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #12211A;
}
.co-line-info { flex: 1; min-width: 0; }
.co-line-title {
  font-size: 13.5px;
  font-weight: 600;
  color: #fff;
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.co-line-variant {
  font-size: 12px;
  color: rgba(255,255,255,.45);
  margin-top: 2px;
}
.co-line-price {
  font-family: "Oswald", sans-serif;
  font-size: 15px;
  font-weight: 600;
  color: #fff;
  flex-shrink: 0;
  letter-spacing: .01em;
}

/* Totals section */
.co-summary-totals {
  padding: 0 24px 20px;
  border-top: 1px solid rgba(255,255,255,.08);
  margin-top: 4px;
}
.co-tot-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 11px 0;
  font-size: 14px;
  color: rgba(255,255,255,.65);
  border-bottom: 1px solid rgba(255,255,255,.05);
}
.co-tot-row:last-child { border-bottom: none; }
.co-tot-row span:last-child { font-weight: 600; color: rgba(255,255,255,.85); }
.co-tot-row.discount span:last-child { color: #4ADE80; }
.co-tot-row.shipping span:last-child { color: #4ADE80; }
.co-tot-row.total {
  font-size: 17px;
  font-weight: 700;
  color: #fff;
  padding-top: 14px;
  margin-top: 4px;
  border-top: 2px solid rgba(255,255,255,.12);
  border-bottom: none;
}
.co-tot-row.total span:last-child { font-family: "Oswald", sans-serif; font-size: 24px; color: #fff; }

#co-discount-row { display: none; }
#co-discount-row.visible { display: flex; }

/* Summary trust badges */
.co-summary-badges {
  padding: 16px 24px 24px;
  border-top: 1px solid rgba(255,255,255,.07);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.co-sum-badge {
  display: flex;
  align-items: center;
  gap: 10px;
  color: rgba(255,255,255,.55);
  font-size: 12.5px;
}
.co-sum-badge svg { width: 16px; height: 16px; color: #4ADE80; flex-shrink: 0; }

/* Summary payment icons */
.co-sum-pay-icons {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 4px;
  padding: 0 24px 20px;
}
.co-sum-pay-chip {
  height: 24px;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 5px;
  padding: 0 8px;
  font-size: 10.5px;
  font-weight: 700;
  color: rgba(255,255,255,.65);
  display: flex;
  align-items: center;
  letter-spacing: .03em;
}

/* ── Empty cart state ─────────────────────────────────────── */
.co-empty {
  text-align: center;
  padding: 60px 24px;
}
.co-empty svg { width: 56px; height: 56px; color: #E5E3DD; margin: 0 auto 20px; display: block; }
.co-empty h2 { font-family: "Oswald", sans-serif; font-size: 26px; color: #12211A; margin-bottom: 10px; }
.co-empty p { color: #9CA3AF; font-size: 15px; margin-bottom: 24px; }
.co-empty a {
  display: inline-block;
  padding: 14px 32px;
  background: #D96C00;
  color: #fff;
  border-radius: 10px;
  font-weight: 700;
  font-size: 15px;
  text-decoration: none;
  transition: background .2s;
}
.co-empty a:hover { background: #bf5f00; }

/* ── Mobile styles ────────────────────────────────────────── */
@media (max-width: 900px) {
  .co-main {
    grid-template-columns: 1fr;
    padding: 20px 16px 56px;
    gap: 20px;
  }
  .co-summary {
    position: static;
    order: -1; /* summary first on mobile */
  }
  .co-trust-strip {
    grid-template-columns: repeat(2, 1fr);
  }
  .co-form-row.three { grid-template-columns: 1fr 1fr; }
  .co-progress-steps { gap: 0; }
  .co-step { font-size: 11px; padding-right: 12px; }
  .co-step + .co-step::before { margin-right: 12px; }
  .co-step-label { display: none; }
  .co-step.active .co-step-label { display: block; }
  .co-secure-badge { display: none; }
  .co-summary-items { max-height: 220px; }
}

@media (max-width: 540px) {
  .co-form-row { grid-template-columns: 1fr; }
  .co-form-row.three { grid-template-columns: 1fr; }
  .co-trust-strip { grid-template-columns: 1fr 1fr; gap: 8px; }
  .co-panel-body { padding: 18px 16px; }
  .co-progress-inner { padding: 0 14px; }
  .co-progress-brand span { display: none; }
  .co-progress-brand { margin-right: 12px; }
  .co-progress-brand .logo-mark { width: 24px; height: 24px; }
  .co-coupon-wrap { flex-direction: column; }
  #co-coupon-apply { width: 100%; margin-top: 0; }
}

/* ── Shimmer skeleton for loading ─────────────────────────── */
.co-skeleton {
  background: linear-gradient(90deg, #f0f0ea 25%, #e4e3dc 50%, #f0f0ea 75%);
  background-size: 200% 100%;
  animation: coShimmer 1.4s infinite;
  border-radius: 8px;
  height: 56px;
  width: 100%;
}
@keyframes coShimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ── Validation shake ─────────────────────────────────────── */
@keyframes coShake {
  0%,100% { transform: translateX(0); }
  20%,60% { transform: translateX(-5px); }
  40%,80% { transform: translateX(5px); }
}
.co-shake { animation: coShake .4s ease; }

/* ── Coupon applied chip in summary ───────────────────────── */
.co-coupon-chip {
  display: none;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: rgba(74,222,128,.12);
  border: 1px solid rgba(74,222,128,.25);
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  color: #4ADE80;
  margin: 0 24px 12px;
}
.co-coupon-chip.visible { display: flex; }
.co-coupon-chip svg { width: 13px; height: 13px; }
