.checkout-page {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 3rem 2rem;
  box-sizing: border-box;
}

.checkout-page-inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: start;
}

.checkout-section-title {
  font-size: 1rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin: 0 0 1.2rem;
  color: #333;
}

/* ── Items ─────────────────────────────────────────────────────────────────── */
.checkout-items {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.co-item {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.co-item-img-wrap {
  position: relative;
  flex-shrink: 0;
}

.co-item-img {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid #eee;
}

.co-item-qty {
  position: absolute;
  top: -8px;
  right: -8px;
  background: #333;
  color: #fff;
  font-size: 0.75rem;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.co-item-info {
  flex: 1;
}

.co-item-title {
  font-size: 0.95rem;
  font-weight: 500;
  margin: 0 0 0.2rem;
}

.co-item-color {
  font-size: 0.85rem;
  color: #888;
  margin: 0;
}

.co-item-price {
  font-weight: 600;
  font-size: 0.95rem;
  margin: 0;
}

/* ── Totaux ─────────────────────────────────────────────────────────────────── */
.checkout-totals {
  border-top: 1px solid #eee;
  padding-top: 1rem;
}

.checkout-total-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.95rem;
  padding: 0.35rem 0;
  color: #555;
}

.checkout-grand-total {
  font-weight: 700;
  font-size: 1.05rem;
  color: #111;
  border-top: 1px solid #eee;
  margin-top: 0.4rem;
  padding-top: 0.6rem;
}

.checkout-tax-info {
  display: block;
  font-size: 0.78rem;
  color: #aaa;
  margin-top: 0.5rem;
}

/* ── Livraison ──────────────────────────────────────────────────────────────── */
.delivery-options {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin-bottom: 1.2rem;
}

.delivery-opt {
  display: block;
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 0.85rem 1rem;
  cursor: pointer;
  transition: border-color 0.2s;
}

.delivery-opt input[type="radio"] { display: none; }

.delivery-opt.active {
  border-color: #222;
  background: #fafafa;
}

.delivery-opt-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.delivery-opt-left {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.delivery-opt-name   { font-weight: 600; font-size: 0.95rem; }
.delivery-opt-carrier { font-size: 0.8rem; color: #888; }
.delivery-opt-price  { font-weight: 600; font-size: 0.95rem; }

.delivery-opt--disabled {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
}

/* ── Relay picker ───────────────────────────────────────────────────────────── */
.relay-map {
  height: 280px;
  border-radius: 8px;
  border: 1px solid #eee;
  margin-bottom: 0.6rem;
  z-index: 0;
}

.map-select-btn {
  margin-top: 6px;
  padding: 4px 10px;
  background: #222;
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 0.8rem;
  cursor: pointer;
  font-family: inherit;
}

.relay-search-row {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.6rem;
}

.relay-cp-input {
  flex: 1;
  padding: 0.75rem 1rem;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 0.95rem;
  font-family: inherit;
  box-sizing: border-box;
  width: auto;
  margin-bottom: 0;
}

/* Override .checkout-form input (specificity 0,1,1) for the relay row */
.relay-search-row .relay-cp-input {
  width: auto;
  margin: 0;
  line-height: 1;
}

.relay-cp-input:focus { outline: none; border-color: #888; }

.relay-locate-btn {
  padding: 0.75rem 0.75rem;
  background: #fff;
  color: #333;
  border: 1px solid #ddd;
  border-radius: 8px;
  cursor: pointer;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
  box-sizing: border-box;
  line-height: 1;
  -webkit-appearance: none;
  appearance: none;
}

.relay-locate-btn:hover    { background: #f5f5f5; }
.relay-locate-btn.locating { opacity: 0.5; cursor: not-allowed; }

.relay-search-btn {
  padding: 0.75rem 1rem;
  background: #222;
  color: #fff;
  border: 1px solid transparent;
  border-radius: 8px;
  font-size: 0.95rem;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  line-height: 1;
  -webkit-appearance: none;
  appearance: none;
}

.relay-search-btn:hover { background: #444; }

.relay-results {
  max-height: 260px;
  overflow-y: auto;
  border: 1px solid #eee;
  border-radius: 8px;
  margin-bottom: 0.5rem;
}

.relay-point-item {
  display: flex;
  flex-direction: column;
  width: 100%;
  padding: 0.65rem 0.9rem;
  text-align: left;
  background: none;
  border: none;
  border-bottom: 1px solid #f0f0f0;
  cursor: pointer;
  font-family: inherit;
  gap: 0.15rem;
  box-sizing: border-box;
}

.relay-point-item:last-child { border-bottom: none; }
.relay-point-item:hover      { background: #f8f8f8; }

.relay-point-item.selected {
  background: #f0f8f0;
  border-left: 3px solid #4caf50;
}

.relay-point-item strong   { font-size: 0.88rem; color: #222; }
.relay-point-item span     { font-size: 0.8rem;  color: #888; }
.relay-point-item .relay-dist {
  font-size: 0.75rem;
  color: #4285f4;
  font-weight: 600;
  margin-top: 0.1rem;
}

.relay-msg {
  padding: 1rem;
  text-align: center;
  color: #888;
  font-size: 0.88rem;
}

.mr-relay-selected {
  padding: 0.65rem 0.9rem;
  background: #f6fbf6;
  border: 1.5px solid #4caf50;
  border-radius: 8px;
  font-size: 0.88rem;
  line-height: 1.5;
  margin-top: 0.4rem;
}

.relay-sel-badge {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.72rem;
  font-weight: 700;
  color: #4caf50;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 0.4rem;
}

/* ── Formulaire ─────────────────────────────────────────────────────────────── */
.checkout-form input {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 0.95rem;
  margin-bottom: 0.6rem;
  box-sizing: border-box;
  font-family: inherit;
  transition: border-color 0.2s;
}

.checkout-form input:focus {
  outline: none;
  border-color: #888;
}

.co-pays-select {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 0.95rem;
  margin-bottom: 0.6rem;
  box-sizing: border-box;
  font-family: inherit;
  background: #fff;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23666' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
}

.card-element-box {
  padding: 0.75rem 1rem;
  border: 1px solid #ddd;
  border-radius: 8px;
  background: #fff;
  margin-bottom: 0.4rem;
}

.card-errors {
  color: #e53935;
  font-size: 0.85rem;
  margin-bottom: 0.8rem;
  min-height: 1.2em;
}

.cgv-row {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  margin-top: 1rem;
  font-size: 0.9rem;
  color: #555;
  cursor: pointer;
}

.cgv-row input[type="checkbox"] {
  margin-top: 2px;
  flex-shrink: 0;
  width: auto;
  padding: 0;
  border: none;
  cursor: pointer;
}

.cgv-row a { color: #222; text-decoration: underline; }

.checkout-notice {
  padding: 0.7rem 1rem;
  border-left: 3px solid #c0392b;
  background: #fdf5f5;
  color: #c0392b;
  font-size: 0.88rem;
  border-radius: 0 6px 6px 0;
  margin-bottom: 0.8rem;
  line-height: 1.5;
}

.checkout-submit-btn {
  width: 100%;
  padding: 0.9rem;
  background: #222;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 0.8rem;
  transition: background 0.2s;
  font-family: inherit;
}

.checkout-submit-btn:hover    { background: #444; }
.checkout-submit-btn:disabled { background: #aaa; cursor: not-allowed; }

/* ── Succès ─────────────────────────────────────────────────────────────────── */
.checkout-success {
  text-align: center;
  padding: 3rem 1rem;
}

.checkout-success h3 {
  font-size: 1.4rem;
  margin: 1rem 0 0.5rem;
}

.checkout-success p {
  color: #666;
  line-height: 1.6;
}

.success-recap {
  width: 100%;
  margin: 1.5rem 0;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  text-align: left;
}

.recap-block {
  background: #f8f8f8;
  border-radius: 8px;
  padding: 0.9rem 1rem;
  font-size: 0.9rem;
  color: #444;
}

.recap-label {
  font-weight: 600;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #999;
  margin: 0 0 0.5rem;
}

.recap-block p { margin: 0.2rem 0; }

.recap-row {
  display: flex;
  justify-content: space-between;
  padding: 0.2rem 0;
}

.recap-total-row {
  font-weight: 700;
  border-top: 1px solid #eee;
  margin-top: 0.4rem;
  padding-top: 0.5rem;
}

.btn-retour {
  display: inline-block;
  margin-top: 1.5rem;
  padding: 0.7rem 1.5rem;
  background: #222;
  color: #fff !important;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
  transition: background 0.2s;
}

.btn-retour:hover { background: #444; color: #fff !important; }

/* ── Horaires relay ─────────────────────────────────────────────────────────── */
.relay-today-hours {
  font-size: 0.75rem;
  color: #4285f4;
  font-weight: 500;
}

.relay-sel-addr {
  display: block;
  font-size: 0.85rem;
  color: #666;
  margin: 0.2rem 0 0.5rem;
}

.relay-schedule {
  margin-top: 0.4rem;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.relay-hours-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.78rem;
  color: #888;
  padding: 0.12rem 0;
}

.relay-hours-row.today {
  font-weight: 700;
  color: #222;
}

/* ── Mobile ─────────────────────────────────────────────────────────────────── */
@media (max-width: 1024px) {
  .checkout-page {
    padding: 1.5rem 1rem;
  }

  .checkout-page-inner {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .checkout-left {
    order: 2;
  }

  .checkout-right {
    order: 1;
  }
}
