/*
 * checkout.css — KIRA Collection
 * Shopify-style checkout — blanc, propre, professionnel
 */

*, *::before, *::after { box-sizing: border-box; }

/* ── Supprime le header global sur checkout ── */
#site-header { display: none !important; }
body[data-page="checkout"] { padding-top: 0 !important; }
body[data-page="checkout"] .kira-toast { z-index: 9999; }

/* ════════════════════════════════════
   LAYOUT — deux colonnes
   ════════════════════════════════════ */
.kira-checkout-page {
  display: flex;
  min-height: 100vh;
  width: 100%;
  align-items: stretch;
  background: #fff;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  font-size: 14px;
  color: #1a1a1a;
  -webkit-font-smoothing: antialiased;
}

/* Colonne gauche — formulaire */
.checkout-form-panel {
  flex: 0 0 52%;
  width: 52%;
  padding: 44px 56px 80px;
  background: #fff;
  display: flex;
  justify-content: flex-end;
}

.checkout-form-inner {
  width: 100%;
  max-width: 520px;
}

/* Colonne droite — résumé */
.checkout-summary-panel {
  flex: 0 0 48%;
  width: 48%;
  background: #f6f6f6;
  border-left: 1px solid #e1e1e1;
  padding: 44px 52px 80px;
  display: flex;
  justify-content: flex-start;
}

.checkout-summary-inner {
  width: 100%;
  max-width: 460px;
  position: sticky;
  top: 24px;
}

/* ════════════════════════════════════
   LOGO + BREADCRUMB
   ════════════════════════════════════ */
.checkout-logo {
  display: block;
  margin-bottom: 22px;
  line-height: 0;
}
.checkout-logo img {
  height: 42px;
  width: auto;
  mix-blend-mode: multiply;
  display: block;
}

.checkout-breadcrumb {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 8px;
  margin-bottom: 36px;
  font-size: 12px;
  color: #999;
}
.checkout-breadcrumb a {
  color: #111;
  text-decoration: none;
  transition: opacity 0.15s;
}
.checkout-breadcrumb a:hover { opacity: 0.6; }
.checkout-breadcrumb .bc-sep {
  color: #ccc;
  font-size: 10px;
}
.checkout-breadcrumb .bc-active {
  color: #1a1a1a;
  font-weight: 500;
}

/* ════════════════════════════════════
   SECTIONS FORMULAIRE
   ════════════════════════════════════ */
.checkout-section {
  margin-bottom: 28px;
}

.checkout-section-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 16px;
}

.checkout-section-title {
  font-size: 16px;
  font-weight: 600;
  color: #1a1a1a;
  letter-spacing: 0;
  line-height: 1.3;
}

.checkout-section-link {
  font-size: 12px;
  color: #1268db;
  text-decoration: none;
  transition: opacity 0.15s;
}
.checkout-section-link:hover { opacity: 0.7; }

/* ════════════════════════════════════
   CHAMPS
   ════════════════════════════════════ */
.checkout-field {
  position: relative;
  margin-bottom: 12px;
}
.checkout-field:last-child { margin-bottom: 0; }

.checkout-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 12px;
}
.checkout-row:last-child { margin-bottom: 0; }
.checkout-row .checkout-field { margin-bottom: 0; }

/* Wrapper pour select (flèche custom) */
.checkout-select-wrap {
  position: relative;
}
.checkout-select-wrap::after {
  content: '';
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 5px solid #666;
  pointer-events: none;
}

.checkout-input,
.checkout-select {
  display: block;
  width: 100%;
  height: 50px;
  padding: 0 14px;
  font-family: inherit;
  font-size: 14px;
  color: #1a1a1a;
  background: #fff;
  border: 1px solid #d9d9d9;
  border-radius: 6px;
  outline: none;
  transition: border-color 0.18s, box-shadow 0.18s;
  appearance: none;
  -webkit-appearance: none;
}

.checkout-input::placeholder { color: #aaa; font-size: 14px; }
.checkout-select { cursor: pointer; color: #1a1a1a; }

.checkout-input:focus,
.checkout-select:focus {
  border-color: #111;
  box-shadow: 0 0 0 3px rgba(17,17,17,0.07);
}

.checkout-input.has-error { border-color: #c00; }
.checkout-input.has-error:focus { box-shadow: 0 0 0 3px rgba(192,0,0,0.07); }

/* Icône aide (phone) */
.checkout-field-hint {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: #bbb;
  cursor: default;
  pointer-events: none;
}

/* Texte option label dans les selects */
.checkout-select option { color: #1a1a1a; }

/* ── Checkbox ── */
.checkout-checkbox {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 16px;
  font-size: 13px;
  color: #555;
  cursor: pointer;
  user-select: none;
}
.checkout-checkbox input[type="checkbox"] {
  width: 16px;
  height: 16px;
  border-radius: 3px;
  cursor: pointer;
  accent-color: #111;
  flex-shrink: 0;
}

/* ════════════════════════════════════
   ACTIONS
   ════════════════════════════════════ */
.checkout-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 28px;
  gap: 16px;
  flex-wrap: wrap;
}

.checkout-return {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: #1268db;
  text-decoration: none;
  transition: opacity 0.15s;
}
.checkout-return:hover { opacity: 0.7; }

.checkout-primary-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 52px;
  padding: 0 32px;
  background: #111;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: background 0.18s;
  white-space: nowrap;
}
.checkout-primary-btn:hover { background: #333; }
.checkout-primary-btn:disabled { opacity: 0.55; cursor: not-allowed; }

/* ── Footer checkout ── */
.checkout-form-footer {
  margin-top: 40px;
  padding-top: 20px;
  border-top: 1px solid #ebebeb;
}
.checkout-form-footer a {
  font-size: 12px;
  color: #1268db;
  text-decoration: none;
}
.checkout-form-footer a:hover { text-decoration: underline; }

/* ════════════════════════════════════
   RÉSUMÉ — colonne droite
   ════════════════════════════════════ */
.checkout-items {
  margin-bottom: 16px;
  border-bottom: 1px solid #e0e0e0;
  padding-bottom: 4px;
}

/* Item individuel */
.checkout-item {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 14px 0;
  border-bottom: 1px solid #ebebeb;
}
.checkout-item:last-child { border-bottom: none; }

.checkout-item-image {
  position: relative;
  flex-shrink: 0;
  width: 60px;
  height: 60px;
}
.checkout-item-image img {
  width: 60px;
  height: 60px;
  object-fit: cover;
  display: block;
  border-radius: 8px;
  border: 1px solid rgba(0,0,0,0.10);
  background: #ede9e3;
}
.checkout-item-qty {
  position: absolute;
  top: -8px;
  right: -8px;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border-radius: 10px;
  background: #7a7a7a;
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: inherit;
  line-height: 1;
}

.checkout-item-info {
  flex: 1;
  min-width: 0;
}
.checkout-item-title {
  font-size: 13.5px;
  font-weight: 500;
  color: #1a1a1a;
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.checkout-item-variant {
  font-size: 12px;
  color: #767676;
  margin-top: 3px;
}

.checkout-item-price {
  font-size: 13px;
  font-weight: 500;
  color: #1a1a1a;
  white-space: nowrap;
  flex-shrink: 0;
  padding-top: 2px;
}

/* Totaux */
.checkout-totals {
  padding-top: 12px;
}

.checkout-total-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 7px 0;
  font-size: 13px;
  color: #555;
}
.checkout-total-row span:last-child {
  color: #1a1a1a;
}

.checkout-total-row.final {
  padding-top: 14px;
  margin-top: 8px;
  border-top: 1px solid #d8d8d8;
  font-size: 14px;
  font-weight: 600;
  color: #1a1a1a;
}
.checkout-total-row.final span { color: #1a1a1a; }
.checkout-total-row.final .total-amount {
  font-size: 17px;
  font-weight: 600;
}

/* Panier vide dans résumé */
.checkout-empty {
  padding: 28px 0;
  text-align: center;
  color: #999;
  font-size: 13px;
}
.checkout-empty a {
  display: inline-block;
  margin-top: 12px;
  font-size: 12px;
  color: #1268db;
  text-decoration: none;
}
.checkout-empty a:hover { text-decoration: underline; }

/* ════════════════════════════════════
   RESPONSIVE
   ════════════════════════════════════ */
@media (max-width: 860px) {
  .kira-checkout-page {
    flex-direction: column;
  }

  /* Résumé passe en haut */
  .checkout-summary-panel {
    flex: none;
    width: 100%;
    border-left: none;
    border-bottom: 1px solid #e0e0e0;
    padding: 20px 20px 24px;
    justify-content: center;
    order: 1;
  }
  .checkout-summary-inner {
    position: static;
    max-width: 100%;
  }

  /* Formulaire sous le résumé */
  .checkout-form-panel {
    flex: none;
    width: 100%;
    padding: 28px 20px 60px;
    justify-content: flex-start;
    order: 2;
  }
  .checkout-form-inner {
    max-width: 100%;
  }
}

@media (max-width: 480px) {
  .checkout-row {
    grid-template-columns: 1fr;
    gap: 0;
  }
  .checkout-row .checkout-field {
    margin-bottom: 12px;
  }
  .checkout-row .checkout-field:last-child {
    margin-bottom: 0;
  }
  .checkout-actions {
    flex-direction: column-reverse;
    gap: 14px;
  }
  .checkout-primary-btn {
    width: 100%;
    order: 1;
  }
  .checkout-return {
    align-self: flex-start;
    order: 2;
  }
}
