/* ===== CHECKOUT 2-STEP — Twicsy-inspired ===== */
:root {
  --co-orange: #f97316;
  --co-orange-dark: #ea580c;
  --co-green: #22c55e;
  --co-bg: #f8f9fa;
  --co-card: #fff;
  --co-border: #e5e7eb;
  --co-text: #1f2937;
  --co-muted: #6b7280;
  --co-radius: 12px;
}

.checkout-wrapper {
  max-width: 1100px;
  margin: 0 auto;
  padding: 32px 20px 60px;
}

/* Progress Bar */
.progress-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  margin-bottom: 40px;
}
.progress-step {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: .95rem;
  font-weight: 600;
  color: var(--co-muted);
}
.progress-step.active { color: var(--co-orange); }
.progress-step.completed { color: var(--co-green); }
.step-circle {
  width: 32px; height: 32px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: .85rem;
  background: var(--co-border);
  color: var(--co-muted);
  transition: all .3s;
}
.progress-step.active .step-circle {
  background: var(--co-orange);
  color: #fff;
}
.progress-step.completed .step-circle {
  background: var(--co-green);
  color: #fff;
}
.progress-line {
  width: 80px; height: 3px;
  background: var(--co-border);
  margin: 0 12px;
  border-radius: 2px;
}
.progress-line.active { background: var(--co-orange); }

/* Layout */
.checkout-layout {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 40px;
  align-items: start;
}

/* Cards */
.co-card {
  background: var(--co-card);
  border-radius: var(--co-radius);
  box-shadow: 0 1px 3px rgba(0,0,0,.08), 0 4px 12px rgba(0,0,0,.04);
  padding: 32px;
}

/* Step 1 */
.co-title { font-size: 1.5rem; font-weight: 700; margin-bottom: 4px; }
.co-live-users {
  font-size: .85rem; color: var(--co-muted); margin-bottom: 24px;
}
.co-live-dot {
  display: inline-block; width: 8px; height: 8px;
  background: var(--co-green); border-radius: 50%;
  margin-right: 4px; animation: pulse-dot 2s infinite;
}
@keyframes pulse-dot { 0%,100%{opacity:1} 50%{opacity:.4} }

/* Form fields */
.co-field {
  margin-bottom: 16px;
}
.co-field label {
  display: block; font-size: .85rem; font-weight: 600;
  margin-bottom: 6px; color: var(--co-text);
}
.co-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.co-input-wrap .co-icon {
  position: absolute; left: 14px;
  font-size: 1.1rem; color: var(--co-muted);
  pointer-events: none; display: flex; align-items: center;
}
.co-input-wrap .co-icon img {
  width: 20px; height: 20px; border-radius: 4px;
}
.co-input-wrap input,
.co-input-wrap textarea {
  width: 100%;
  padding: 12px 14px 12px 44px;
  border: 1.5px solid var(--co-border);
  border-radius: 8px;
  font-size: .95rem;
  font-family: inherit;
  outline: none;
  transition: border-color .2s;
}
.co-input-wrap input:focus,
.co-input-wrap textarea:focus {
  border-color: var(--co-orange);
}
.co-input-wrap.no-icon input {
  padding-left: 14px;
}

.co-checkbox {
  display: flex; align-items: center; gap: 8px;
  font-size: .85rem; color: var(--co-muted);
  margin: 16px 0 24px;
  cursor: pointer;
}
.co-checkbox input { width: 18px; height: 18px; accent-color: var(--co-orange); cursor: pointer; }

/* Buttons */
.co-btn {
  width: 100%;
  padding: 14px 24px;
  background: linear-gradient(135deg, var(--co-orange), var(--co-orange-dark));
  color: #fff;
  border: none; border-radius: 8px;
  font-size: 1.05rem; font-weight: 700;
  cursor: pointer;
  transition: transform .15s, box-shadow .15s;
}
.co-btn:hover { transform: translateY(-1px); box-shadow: 0 4px 16px rgba(249,115,22,.35); }
.co-btn:active { transform: translateY(0); }
.co-btn:disabled { opacity: .6; cursor: not-allowed; transform: none; box-shadow: none; }

.co-btn-secondary {
  background: #000;
  border-radius: 8px;
  padding: 14px;
  color: #fff;
  font-size: 1rem;
  font-weight: 600;
  border: none;
  width: 100%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

/* Trust */
.co-trust {
  margin-top: 20px;
  font-size: .85rem;
  color: var(--co-muted);
}
.co-trust-check {
  display: flex; align-items: center; gap: 6px; margin-bottom: 8px;
}
.co-rating {
  display: flex; align-items: center; gap: 6px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--co-border);
}
.co-stars { color: #facc15; font-size: 1.1rem; letter-spacing: 1px; }
.co-rating-score { font-weight: 700; color: var(--co-text); }
.co-rating-count { color: var(--co-muted); font-size: .8rem; }

/* Order summary sidebar */
.co-sidebar { position: sticky; top: 20px; }
.co-summary-title {
  font-size: 1.1rem; font-weight: 700; margin-bottom: 20px;
  display: flex; align-items: center; gap: 8px;
}
.co-summary-item {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--co-border);
}
.co-summary-item:last-of-type { border-bottom: none; }
.co-item-info { display: flex; align-items: center; gap: 10px; }
.co-item-icon {
  width: 40px; height: 40px;
  background: #f3f4f6; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem;
}
.co-item-icon img { width: 24px; height: 24px; border-radius: 4px; }
.co-item-name { font-weight: 600; font-size: .9rem; }
.co-item-qty { font-size: .8rem; color: var(--co-muted); }
.co-item-price { font-weight: 700; }

.co-summary-totals {
  margin-top: 16px; padding-top: 16px;
  border-top: 2px solid var(--co-border);
}
.co-summary-row {
  display: flex; justify-content: space-between;
  margin-bottom: 8px; font-size: .95rem;
}
.co-summary-row.total {
  font-size: 1.15rem; font-weight: 800;
  margin-top: 8px; padding-top: 8px;
  border-top: 1px solid var(--co-border);
}
.co-total-badge {
  background: linear-gradient(135deg, var(--co-orange), var(--co-orange-dark));
  color: #fff; padding: 2px 8px; border-radius: 4px; font-size: .8rem;
  margin-left: 4px; font-weight: 600;
}

.co-trust-badges {
  margin-top: 20px;
  display: flex; flex-direction: column; gap: 10px;
}
.co-badge {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 14px;
  background: #f8fdf8;
  border: 1px solid #d1fae5;
  border-radius: 8px;
  font-size: .85rem; font-weight: 500;
  color: #166534;
}
.co-badge-icon { font-size: 1.2rem; }

/* Step 2 - Payment */
.co-divider {
  display: flex; align-items: center; gap: 12px;
  margin: 24px 0;
  color: var(--co-muted); font-size: .85rem;
}
.co-divider::before, .co-divider::after {
  content: ''; flex: 1; height: 1px; background: var(--co-border);
}

.co-tabs {
  display: flex; gap: 0; margin-bottom: 24px;
  border: 1.5px solid var(--co-border);
  border-radius: 8px;
  overflow: hidden;
}
.co-tab {
  flex: 1; padding: 12px;
  text-align: center; font-size: .9rem; font-weight: 600;
  background: #fff; border: none; cursor: pointer;
  color: var(--co-muted);
  transition: all .2s;
}
.co-tab.active {
  background: var(--co-orange);
  color: #fff;
}

.co-card-icons {
  display: flex; gap: 6px; margin-bottom: 16px;
}
.co-card-icons img { height: 28px; border-radius: 4px; }

#card-element, #card-number, #card-expiry, #card-cvc {
  padding: 12px 14px;
  border: 1.5px solid var(--co-border);
  border-radius: 8px;
  transition: border-color .2s;
}
#card-element.StripeElement--focus,
.stripe-field.focused {
  border-color: var(--co-orange);
}

.co-card-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.co-error {
  color: #ef4444;
  font-size: .85rem;
  margin-top: 8px;
  min-height: 20px;
}

.co-terms {
  font-size: .8rem;
  color: var(--co-muted);
  text-align: center;
  margin-top: 12px;
  line-height: 1.4;
}
.co-terms a { color: var(--co-orange); text-decoration: underline; }

/* Payment request (Apple/Google Pay) */
#payment-request-button {
  margin-bottom: 16px;
}
.co-pr-hidden { display: none; }

/* Back button */
.co-back {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: .9rem; color: var(--co-muted);
  cursor: pointer; border: none; background: none;
  margin-bottom: 16px; padding: 0;
  font-family: inherit;
}
.co-back:hover { color: var(--co-text); }

/* Spinner */
.co-spinner {
  display: inline-block;
  width: 18px; height: 18px;
  border: 2.5px solid rgba(255,255,255,.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: co-spin .6s linear infinite;
  margin-right: 8px;
  vertical-align: middle;
}
@keyframes co-spin { to { transform: rotate(360deg); } }

/* Success page */
.co-success {
  text-align: center;
  padding: 60px 20px;
  max-width: 600px;
  margin: 0 auto;
}
.co-success-icon { font-size: 4rem; margin-bottom: 16px; }
.co-success h1 { font-size: 2rem; margin-bottom: 8px; }
.co-success p { color: var(--co-muted); font-size: 1.05rem; margin-bottom: 24px; }
.co-success-id { font-family: monospace; background: #f3f4f6; padding: 8px 16px; border-radius: 6px; display: inline-block; margin-bottom: 24px; }

/* Mobile */
@media (max-width: 820px) {
  .checkout-layout {
    grid-template-columns: 1fr;
  }
  .co-sidebar { position: static; }
  .co-card { padding: 24px; }
  .progress-line { width: 40px; }
}
@media (max-width: 480px) {
  .co-card { padding: 20px 16px; }
  .checkout-wrapper { padding: 16px 12px 40px; }
  .co-card-row { grid-template-columns: 1fr; }
}

/* PayPal tab content */
#paypal-button-container {
  min-height: 55px;
  margin: 16px 0 8px;
}
.co-tab-content-card, .co-tab-content-paypal { transition: opacity .2s; }
.co-tab-content-card.hidden, .co-tab-content-paypal.hidden { display: none; }
.co-tab img.paypal-tab-icon { height: 18px; vertical-align: middle; margin-right: 4px; }
/* PayPal top section */
.co-paypal-top {
  margin-bottom: 8px;
}
#paypal-button-container {
  min-height: 50px;
}

/* Lock icon in labels */
.co-lock {
  font-size: .85rem;
  margin-right: 2px;
}

/* Stripe separate fields */
.co-stripe-field {
  padding: 12px 14px;
  border: 1.5px solid var(--co-border);
  border-radius: 8px;
  background: #fff;
  transition: border-color .2s;
}
.co-stripe-field.focused,
.co-stripe-field:focus-within {
  border-color: var(--co-orange);
}

/* Card row (expiry + cvc side by side) */
.co-card-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

/* Card section spacing */
.co-card-section {
  margin-top: 4px;
}

/* Remove old tab styles that are no longer needed */
.co-tabs { display: none; }
.co-tab-content-card, .co-tab-content-paypal { display: block; }
.co-tab-content-card.hidden, .co-tab-content-paypal.hidden { display: none; }

/* Payment method tabs */
.co-payment-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 20px;
  background: #f3f4f6;
  border-radius: 12px;
  padding: 4px;
}

.co-payment-tab {
  flex: 1;
  padding: 12px 20px;
  border: none;
  background: transparent;
  font-weight: 600;
  font-size: .95rem;
  cursor: pointer;
  border-radius: 10px;
  transition: all .2s;
  color: #6b7280;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.co-payment-tab.active {
  background: #fff;
  color: #1a1a2e;
  box-shadow: 0 2px 8px rgba(0,0,0,.08);
}

.co-payment-tab:hover {
  color: #1a1a2e;
}

#hipay-card-section {
  margin-top: 16px;
}

#hipay-hostedfields-form {
  margin-bottom: 20px;
}
