/* ══════════════════════════════════════════
   TEAMTIM — Checkout Page
══════════════════════════════════════════ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --dark:    #231218;
  --border:  #E8D5CB;
  --gray:    #7A6068;
  --primary: #7C3151;
  --primary-hover: #621F40;
  --primary-light: #F8EDF3;
  --font:   'Inter', -apple-system, sans-serif;
}

html { scroll-behavior: smooth; }
body { font-family: var(--font); color: var(--dark); background: #fff; font-size: 14px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }

/* ── Header ──────────────────────────────── */
.co-header {
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; background: #fff; z-index: 100;
}
.co-header-inner {
  max-width: 1100px; margin: 0 auto;
  padding: 16px 24px;
  display: flex; align-items: center; justify-content: space-between;
}
.co-back {
  display: flex; align-items: center; gap: 6px;
  color: var(--gray); font-size: .82rem;
  opacity: .7; transition: opacity .2s;
}
.co-back:hover { opacity: 1; }
.co-brand {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.5rem; font-weight: 600;
  letter-spacing: .1em;
}
.co-brand-icon { color: var(--gray); }

/* ── Layout ──────────────────────────────── */
.co-layout {
  max-width: 1100px; margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 420px;
  gap: 0;
  min-height: calc(100vh - 60px);
}

/* ── Formulaire (gauche) ─────────────────── */
.co-form-col {
  padding: 40px 48px 60px 24px;
  border-right: 1px solid var(--border);
}

/* Mobile summary toggle */
.co-order-summary-toggle {
  display: none;
  align-items: center; justify-content: space-between;
  background: #f9fafb;
  border: 1px solid var(--border);
  padding: 14px 16px;
  cursor: pointer;
  margin-bottom: 24px;
  font-size: .84rem;
}
.co-ost-left { display: flex; align-items: center; gap: 8px; color: var(--primary); }
.co-ost-chevron { transition: transform .2s; }
.co-ost-total { font-weight: 700; }
.co-order-summary-mobile { padding: 0 0 20px; border-bottom: 1px solid var(--border); margin-bottom: 24px; }

/* Sections */
.co-section { margin-bottom: 28px; }
.co-section-title {
  font-size: .82rem; font-weight: 600; color: var(--dark);
  margin-bottom: 14px; letter-spacing: .04em;
}
.co-section-sub { font-size: .78rem; color: var(--gray); margin-bottom: 10px; }

/* Fields */
.co-field {
  position: relative; margin-bottom: 10px;
}
.co-field-row {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
}
.co-input, .co-select {
  width: 100%;
  padding: 14px 12px 6px;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: .88rem;
  font-family: var(--font);
  background: #fff;
  outline: none;
  transition: border-color .2s;
  appearance: none;
}
.co-input:focus, .co-select:focus { border-color: #9ca3af; }
.co-input::placeholder { color: transparent; }

.co-label {
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  font-size: .82rem; color: var(--gray); pointer-events: none;
  transition: all .15s;
}
.co-input:focus + .co-label,
.co-input:not(:placeholder-shown) + .co-label {
  top: 8px; transform: none; font-size: .68rem; color: #9ca3af;
}
.co-field-select { position: relative; margin-bottom: 10px; }
.co-field-select::after {
  content: '▾'; position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
  pointer-events: none; color: var(--gray);
}
.co-label-inside {
  position: absolute; left: 12px; top: 8px;
  font-size: .68rem; color: #9ca3af;
  pointer-events: none;
}
.co-select { padding-top: 18px; }

.co-checkbox-row {
  display: flex; align-items: flex-start; gap: 10px;
  font-size: .82rem; color: var(--gray); cursor: pointer; margin-top: 10px;
}
.co-checkbox-row input { margin-top: 2px; accent-color: var(--dark); }

/* Radio cards */
.co-radio-group { border: 1px solid var(--border); border-radius: 6px; overflow: hidden; }
.co-radio-card {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px; cursor: pointer;
  border-bottom: 1px solid var(--border);
  transition: background .15s;
}
.co-radio-card:last-of-type { border-bottom: none; }
.co-radio-card input[type="radio"] { accent-color: var(--primary); flex-shrink: 0; }
.co-radio-label { display: flex; align-items: center; gap: 8px; font-size: .85rem; }
.co-radio-active { background: var(--primary-light); }

/* Payment detail */
.co-payment-detail {
  background: #f9fafb; border: 1px solid var(--border);
  border-top: none; padding: 14px 16px;
  font-size: .82rem; color: var(--gray);
  display: none;
}
.co-payment-group .co-radio-active + .co-payment-detail { display: block; }

/* Shipping list */
.co-shipping-list { border: 1px solid var(--border); border-radius: 6px; overflow: hidden; }
.co-ship-option {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 14px 16px; cursor: pointer;
  border-bottom: 1px solid var(--border);
  transition: background .15s;
}
.co-ship-option:last-child { border-bottom: none; }
.co-ship-option input { margin-top: 3px; accent-color: var(--primary); flex-shrink: 0; }
.co-ship-active { background: var(--primary-light); }
.co-ship-info { flex: 1; display: flex; flex-direction: column; gap: 3px; }
.co-ship-name { font-size: .84rem; }
.co-ship-desc { font-size: .76rem; color: var(--gray); }
.co-ship-price { font-size: .84rem; font-weight: 600; white-space: nowrap; flex-shrink: 0; }
.co-ship-price.free { color: var(--gray); font-weight: 400; }

/* Submit */
.co-submit-wrap { margin-top: 28px; }
.co-btn-pay {
  width: 100%; padding: 16px;
  background: var(--primary); color: #fff;
  border: none; border-radius: 6px;
  font-size: .9rem; font-weight: 600;
  cursor: pointer; transition: background .2s;
  font-family: var(--font);
}
.co-btn-pay:hover { background: var(--primary-hover); }
.co-btn-pay:disabled { background: #C4926A; cursor: not-allowed; }
.co-privacy { font-size: .72rem; color: var(--gray); text-align: center; margin-top: 14px; }
.co-privacy a { color: var(--primary); text-decoration: underline; }

/* ── Récapitulatif (droite) ──────────────── */
.co-summary-col {
  background: #f9fafb;
  border-left: 1px solid var(--border);
}
.co-summary-inner {
  padding: 40px 32px;
  position: sticky; top: 60px;
}

/* Items */
.co-order-item {
  display: flex; gap: 14px;
  margin-bottom: 18px;
  align-items: flex-start;
}
.co-item-img-wrap { position: relative; flex-shrink: 0; }
.co-item-img {
  width: 64px; height: 80px;
  object-fit: cover;
  border: 1px solid #e5e7eb;
  border-radius: 4px;
}
.co-item-qty-badge {
  position: absolute; top: -8px; right: -8px;
  background: #6b7280; color: #fff;
  width: 20px; height: 20px; border-radius: 50%;
  font-size: .68rem; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.co-item-info { flex: 1; }
.co-item-name { font-size: .84rem; font-weight: 500; }
.co-item-price { font-size: .82rem; color: var(--gray); margin-top: 2px; }
.co-item-total { font-size: .84rem; font-weight: 600; white-space: nowrap; }

/* Promo */
.co-promo-wrap {
  display: flex; gap: 8px;
  margin: 18px 0 4px;
}
.co-promo-field {
  flex: 1; padding: 11px 12px;
  border: 1px solid var(--border); border-radius: 4px;
  font-size: .84rem; font-family: var(--font); outline: none;
}
.co-promo-field:focus { border-color: #9ca3af; }
.co-promo-btn {
  padding: 11px 16px; background: var(--dark); color: #fff;
  border: none; border-radius: 4px; cursor: pointer;
  font-size: .78rem; font-family: var(--font); letter-spacing: .06em;
}
.co-promo-msg { font-size: .75rem; margin-bottom: 14px; min-height: 16px; }
.co-promo-msg.ok  { color: #10b981; }
.co-promo-msg.err { color: #ef4444; }

/* Totaux */
.co-totals { border-top: 1px solid var(--border); padding-top: 16px; }
.co-total-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 7px 0; font-size: .84rem;
}
.co-total-grand {
  border-top: 1px solid var(--border);
  padding-top: 14px; margin-top: 8px;
  font-size: 1rem;
}
.co-total-grand small { font-size: .72rem; color: var(--gray); }
.co-total-grand strong { font-size: 1.1rem; }

/* ── Confirmation ────────────────────────── */
.co-confirm-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.5);
  display: flex; align-items: center; justify-content: center;
  z-index: 9999;
}
.co-confirm-box {
  background: #fff; border-radius: 12px;
  padding: 48px 40px; max-width: 440px; width: 90%;
  text-align: center;
}
.co-confirm-icon {
  width: 64px; height: 64px;
  background: #ecfdf5; color: #10b981;
  border-radius: 50%; font-size: 2rem; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 20px;
}
.co-confirm-box h2 { font-size: 1.3rem; margin-bottom: 10px; }
.co-confirm-box p { font-size: .88rem; color: var(--gray); margin-bottom: 8px; }
.co-confirm-back {
  display: inline-block; margin-top: 24px;
  padding: 12px 28px; background: var(--dark); color: #fff;
  font-size: .82rem; letter-spacing: .08em;
  border-radius: 4px;
}

/* ── Responsive ──────────────────────────── */
@media (max-width: 800px) {
  .co-layout { grid-template-columns: 1fr; }
  .co-summary-col { order: -1; border-left: none; border-bottom: 1px solid var(--border); display: none; }
  .co-order-summary-toggle { display: flex; }
  .co-form-col { padding: 20px 16px 40px; border-right: none; }
  .co-field-row { grid-template-columns: 1fr; }
  .co-summary-inner { position: static; padding: 20px 16px; }
}
