/* ============================================================
   Noolio Checkout — Redesign Premium
   Drop-in remplaçant style.css — aucune modif HTML/JS requise
   ============================================================ */

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

:root {
  /* Brand Noolio */
  --noolio-green: #3f7d67;
  --noolio-green-deep: #2d5a4a;
  --noolio-green-soft: #ecf5f0;
  --noolio-cream: #faf7f2;
  --noolio-cream-warm: #f5efe7;

  /* Text */
  --text: #0f0f0f;
  --text-soft: #4a4a4a;
  --muted: #8a8a8a;
  --muted-strong: #2b2b2b;

  /* Surfaces */
  --bg: #ffffff;
  --border: #e5e5e5;
  --border-strong: #1a1a1a;
  --border-input: #d4d4d4;

  /* Status */
  --success: #16a34a;
  --success-soft: #ecfdf5;
  --error: #c2410c;
  --error-soft: #fef2f2;

  /* Components */
  --pay: var(--noolio-green);
  --pay-hover: var(--noolio-green-deep);
  --link: var(--noolio-green);
  --accent-soft: var(--noolio-green-soft);
  --radius: 8px;
  --radius-lg: 12px;
}

html, body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--text);
  background: var(--bg);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: var(--link); text-decoration: none; transition: opacity 0.15s; }
a:hover { opacity: 0.7; text-decoration: none; }

/* ============================================================
   LAYOUT
   ============================================================ */
.checkout-wrap {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  min-height: 100vh;
  max-width: 1280px;
  margin: 0 auto;
  background: var(--bg);
}

/* ─── LEFT (form) ─── */
.left {
  padding: 48px 64px 64px;
}

/* ─── BRAND ─── */
.brand {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 40px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border);
}
.brand .logo {
  display: flex;
  align-items: center;
  gap: 10px;
}
.logo-text {
  font-family: 'Playfair Display', 'Times New Roman', Georgia, serif;
  font-weight: 700;
  font-size: 38px;
  color: var(--text);
  letter-spacing: 0.01em;
  line-height: 1;
}
.logo-text em {
  font-style: normal;
  color: var(--noolio-green);
}
/* Mini badge sécurité à côté du logo (utilise un ::after sur .brand) */
.brand::after {
  content: '🔒  Paiement sécurisé';
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 600;
  color: var(--noolio-green);
  background: var(--noolio-green-soft);
  padding: 6px 11px;
  border-radius: 999px;
  letter-spacing: 0.01em;
}

/* ============================================================
   SECTIONS — numérotées
   ============================================================ */
form { counter-reset: section; }
.block {
  margin-bottom: 36px;
  counter-increment: section;
}
.block h2 {
  font-size: 17px;
  font-weight: 700;
  margin-bottom: 16px;
  letter-spacing: -0.01em;
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text);
}
.block h2::before {
  content: counter(section);
  width: 26px;
  height: 26px;
  background: var(--noolio-green);
  color: white;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  flex-shrink: 0;
}
.block-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 16px;
}
.block-head h2 { margin: 0; }
.link {
  font-size: 13px;
  color: var(--noolio-green);
  font-weight: 500;
}

.muted { color: var(--muted); font-size: 13px; margin-bottom: 14px; line-height: 1.6; }
.muted-strong { color: var(--muted-strong); font-weight: 600; }

/* ============================================================
   FIELDS — floating labels
   ============================================================ */
.field {
  position: relative;
  margin-bottom: 12px;
}
.field input,
.field select {
  width: 100%;
  height: 56px;
  padding: 22px 14px 8px;
  border: 1px solid var(--border-input);
  border-radius: var(--radius);
  background: #fff;
  font-size: 15px;
  color: var(--text);
  outline: none;
  transition: border-color 0.18s, box-shadow 0.18s;
  font-family: inherit;
}
.field select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='none' stroke='%238a8a8a' stroke-width='1.5' stroke-linecap='round' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 18px center;
}
.field input:hover,
.field select:hover { border-color: #b8b8b8; }
.field input:focus,
.field select:focus {
  border-color: var(--noolio-green);
  box-shadow: 0 0 0 3px rgba(63, 125, 103, 0.12);
}

.field label {
  position: absolute;
  left: 14px;
  top: 18px;
  color: var(--muted);
  pointer-events: none;
  transition: all 0.14s ease-out;
  background: transparent;
  font-size: 15px;
}
.field input:focus + label,
.field input:not(:placeholder-shown) + label,
.field select + label,
.field select:focus + label {
  top: 9px;
  font-size: 11px;
  color: var(--muted);
  font-weight: 500;
  letter-spacing: 0.01em;
}

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

/* Checkbox */
.checkbox {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13.5px;
  color: var(--text-soft);
  cursor: pointer;
  margin-top: 12px;
  user-select: none;
}
.checkbox input {
  width: 17px;
  height: 17px;
  accent-color: var(--noolio-green);
  cursor: pointer;
  flex-shrink: 0;
}

/* ============================================================
   SHIPPING OPTIONS
   ============================================================ */
.ship-option {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 18px;
  border: 1.5px solid var(--border-input);
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 15px;
  transition: all 0.18s;
  background: white;
}
.ship-option:hover { border-color: #a0a0a0; }
.ship-option.selected {
  border-color: var(--noolio-green);
  background: var(--noolio-green-soft);
}
.ship-option input { accent-color: var(--noolio-green); flex-shrink: 0; }
.ship-name {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 3px;
  line-height: 1.3;
  font-weight: 600;
  letter-spacing: 0.01em;
}
.ship-name em {
  font-style: normal;
  font-size: 12px;
  color: var(--text-soft);
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
}
.ship-price {
  font-weight: 700;
  color: var(--success);
  font-size: 14px;
  letter-spacing: 0.02em;
}

/* ============================================================
   PAYMENT BLOCK — wallets + card
   ============================================================ */

/* "Sécurisé et chiffré" passe en bandeau trust signal */
.block:has(.rev-wallets) > .muted {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  background: var(--noolio-green-soft);
  color: var(--noolio-green-deep);
  padding: 8px 12px;
  border-radius: 999px;
  font-weight: 600;
  margin-bottom: 18px;
}
.block:has(.rev-wallets) > .muted::before {
  content: '🔒';
  font-size: 11px;
}

/* WALLETS — Apple Pay + Google Pay côte à côte, Revolut Pay dessous */
.rev-wallets {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 18px;
}
.rev-wallets > .rev-wallet:empty { display: none; }
.rev-wallets > .rev-wallet > * {
  width: 100% !important;
  height: 50px !important;
  border-radius: var(--radius) !important;
}
/* Le 3e wallet (Revolut Pay) prend toute la largeur */
.rev-wallets > .rev-wallet:nth-child(3) {
  grid-column: span 2;
}
@media (max-width: 480px) {
  .rev-wallets { grid-template-columns: 1fr; }
  .rev-wallets > .rev-wallet:nth-child(3) { grid-column: auto; }
}

/* Séparateur "ou par carte" */
.rev-separator {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 22px 0 18px;
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  font-weight: 600;
  letter-spacing: 0.08em;
}
.rev-separator::before,
.rev-separator::after {
  content: '';
  flex: 1;
  border-top: 1px solid var(--border);
}

/* Bloc paiement carte — design plus premium */
.pay-method {
  border: 1px solid var(--border-input);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: white;
  transition: all 0.2s;
}
.pay-method:hover { border-color: #a0a0a0; }
.pay-method.selected {
  border-color: var(--noolio-green);
  background: white;
}
.pay-radio {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 18px;
  background: white;
  cursor: pointer;
  font-size: 14.5px;
  border-bottom: 1px solid transparent;
}
.pay-method.selected .pay-radio {
  background: var(--noolio-green-soft);
  border-bottom-color: rgba(63, 125, 103, 0.2);
}
.pay-radio input { accent-color: var(--noolio-green); flex-shrink: 0; }
.pay-name { flex: 1; font-weight: 600; }

.pay-logos {
  display: flex;
  gap: 5px;
  align-items: center;
}
.pay-logo {
  display: block;
  filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.04));
}

/* Card body */
.card-body {
  padding: 18px 18px 20px;
  background: white;
}
.card-section { margin-bottom: 0; }
.card-section-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--muted);
  text-transform: uppercase;
  margin-bottom: 10px;
}

/* Card field iframe */
.card-field {
  width: 100%;
  height: 56px;
  border: 1px solid var(--border-input);
  border-radius: var(--radius);
  background: #fff;
  overflow: hidden;
  transition: border-color 0.18s, box-shadow 0.18s;
}
.card-field:hover { border-color: #a0a0a0; }
.card-field:focus-within {
  border-color: var(--noolio-green);
  box-shadow: 0 0 0 3px rgba(63, 125, 103, 0.12);
}
.card-field iframe {
  width: 100% !important;
  height: 100% !important;
  border: 0 !important;
  display: block;
}

.card-error {
  margin-top: 10px;
  padding: 10px 12px;
  background: var(--error-soft);
  color: var(--error);
  font-size: 13px;
  border-radius: var(--radius);
  font-weight: 500;
}

/* Bandeau trust badges — apparaît APRÈS le card-body via le HTML existant
   (pas besoin de modif HTML — on utilise le before sur .pay-btn) */
.pay-btn::before {
  content: '🔒';
  font-size: 14px;
  margin-right: 4px;
}

/* ============================================================
   PAY BUTTON — vert Noolio, prominence max
   ============================================================ */
.pay-btn {
  width: 100%;
  margin-top: 18px;
  padding: 18px;
  border: 0;
  border-radius: var(--radius);
  background: linear-gradient(180deg, var(--noolio-green), var(--noolio-green-deep));
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: transform 0.05s, box-shadow 0.18s;
  font-family: inherit;
  letter-spacing: 0.01em;
  box-shadow: 0 4px 14px rgba(63, 125, 103, 0.28);
}
.pay-btn:hover {
  background: linear-gradient(180deg, var(--noolio-green-deep), #1f4435);
  box-shadow: 0 6px 20px rgba(63, 125, 103, 0.4);
}
.pay-btn:active { transform: scale(0.99); }
.pay-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  background: var(--muted);
  box-shadow: none;
}

.spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ============================================================
   TRUSTPILOT — mieux intégré, plus pro
   ============================================================ */
.trustpilot {
  margin-top: 22px;
  padding: 14px 16px;
  background: var(--noolio-cream);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--text);
  flex-wrap: wrap;
}
.tp-logo {
  color: #00b67a;
  font-weight: 800;
  letter-spacing: -0.01em;
  font-size: 14px;
}
.tp-stars {
  color: #00b67a;
  letter-spacing: 1.5px;
  font-size: 14px;
}
.tp-rating { font-weight: 700; }
.tp-count { color: var(--muted); }

/* ============================================================
   FOOTER LEGAL + TRUST BAND
   ============================================================ */
.legal {
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  font-size: 12px;
  position: relative;
}
.legal::before {
  content: '🔒 SSL 256-bit · ✓ 3D Secure · ↩ Retours 30 jours · 🇪🇺 Livraison France/Europe';
  display: block;
  width: 100%;
  text-align: center;
  font-size: 12px;
  color: var(--text-soft);
  font-weight: 500;
  margin-bottom: 8px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}
.legal a {
  color: var(--text-soft);
  font-size: 12px;
}
.legal a:hover { color: var(--noolio-green); opacity: 1; }

/* ============================================================
   RIGHT (summary) — fond cream warm
   ============================================================ */
.right {
  background: var(--noolio-cream);
  padding: 48px 60px 60px;
  position: relative;
}
.right::before {
  content: '';
  position: absolute;
  inset: 0 0 0 0;
  background: linear-gradient(135deg, transparent 0%, rgba(63, 125, 103, 0.03) 100%);
  pointer-events: none;
}
.summary {
  max-width: 480px;
  position: relative;
  z-index: 1;
}

/* Bandeau "Livraison gratuite" en haut de la summary */
.summary::before {
  content: '✓  Livraison offerte sur ta commande';
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--success);
  color: white;
  padding: 10px 14px;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 24px;
  letter-spacing: 0.01em;
  box-shadow: 0 2px 8px rgba(22, 163, 74, 0.2);
}

.line-item {
  display: grid;
  grid-template-columns: 64px 1fr auto;
  gap: 14px;
  align-items: center;
  margin-bottom: 18px;
}
.thumb {
  position: relative;
  width: 64px;
  height: 64px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: #fff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.qty {
  position: absolute;
  top: -7px;
  right: -7px;
  background: var(--text);
  color: #fff;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  border: 2px solid var(--noolio-cream);
}
.li-info { min-width: 0; }
.li-name {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  line-height: 1.4;
}
.li-price {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.totals {
  padding: 18px 0;
  border-top: 1px solid var(--border);
  margin-top: 8px;
}
.t-row {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  font-size: 14px;
  color: var(--text-soft);
}

.grand {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding-top: 18px;
  border-top: 1px solid var(--border);
  font-weight: 700;
  font-size: 17px;
  color: var(--text);
}
.grand-amount {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--noolio-green-deep);
}

/* Bandeau garantie en bas de la summary */
.summary::after {
  content: '🛡  Garantie satisfait ou remboursé · 30 jours';
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: white;
  border: 1px solid var(--border);
  padding: 14px;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 600;
  margin-top: 24px;
  color: var(--text);
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 900px) {
  .checkout-wrap { grid-template-columns: 1fr; }
  .right {
    order: -1;
    padding: 24px;
    border-bottom: 1px solid var(--border);
  }
  .left {
    padding: 28px 24px;
  }
  .summary { max-width: none; }
  .brand {
    flex-wrap: wrap;
    gap: 12px;
  }
  .logo-text { font-size: 32px; }
}

@media (max-width: 480px) {
  .row.two { grid-template-columns: 1fr; }
  .left { padding: 24px 20px; }
  .right { padding: 20px; }
  .legal::before {
    font-size: 11px;
    line-height: 1.6;
  }
  .grand-amount { font-size: 22px; }
}

/* ============================================================
   POLISH — micro-interactions
   ============================================================ */
.pay-method,
.ship-option,
.field input,
.field select,
.card-field {
  will-change: border-color, box-shadow;
}

/* Hide elements flagged via JS (preserve original behavior) */
[data-noolio-hidden="true"] { display: none !important; }
