/* ==========================================================================
   Coursier / « HOP! Express » (Genie / Buy Anything) — panneau formulaire
   ========================================================================== */
.cs { min-height: calc(100dvh - var(--hdr-h)); background: var(--bg); padding-bottom: clamp(40px, 6vw, 80px); }

/* Lockup « HOP! Express » en haut du panneau */
.cs__brand { display: flex; align-items: center; gap: 9px; padding-bottom: 14px; margin-bottom: 18px; border-bottom: 1px solid var(--line); }
.cs__brand img { height: 26px; width: auto; display: block; }
.cs__brand span { font-weight: 800; font-size: 1.3rem; color: var(--ink); letter-spacing: -.01em; }

/* Titre + sous-titre */
.cs__title { font-size: clamp(1.6rem, 2.6vw, 2.1rem); font-weight: 800; letter-spacing: -.02em; color: var(--ink); text-align: left; white-space: normal; margin: 0 0 6px; }
.cs__sub { margin: 0 0 20px; color: var(--muted); line-height: 1.45; font-size: .98rem; }

/* Cartes d'étape */
.cs__card { background: var(--surface, #fff); border: 1px solid var(--line); border-radius: 18px; padding: 18px; margin-bottom: 16px; box-shadow: 0 1px 2px rgba(20,16,17,.04); }
.cs__h2 { display: flex; align-items: center; font-size: 1.2rem; font-weight: 800; color: var(--ink); margin: 0 0 14px; }
.cs__h2 > span:not(.cs__stepNo) { min-width: 0; }
/* Badge d'étape : carré rouge arrondi */
.cs__stepNo { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; background: var(--brand); color: #fff; font-size: .95rem; font-weight: 800; margin-right: 11px; flex: 0 0 auto; }
.cs__cardHint { margin: -8px 0 14px; color: var(--muted); font-size: .9rem; }

/* Champs */
.field { display: flex; flex-direction: column; gap: 7px; margin-bottom: 14px; position: relative; }
.field:last-child { margin-bottom: 0; }
.field > span { font-size: .92rem; font-weight: 700; color: var(--ink); }
.field input, .cs__select { height: 50px; border: 1px solid var(--line); border-radius: 12px; padding: 0 14px; font: inherit; color: var(--ink); background: var(--soft); outline: 0; width: 100%; }
.field input::placeholder { color: var(--muted); }
.field input:focus, .cs__select:focus { border-color: var(--brand); background: var(--surface); }

/* Articles : chaque article = bloc empilé (Article / champ / Quantité) */
.cs__items { display: flex; flex-direction: column; }
.cs__item { display: block; }
.cs__item + .cs__item { border-top: 1px solid var(--line); margin-top: 14px; padding-top: 14px; }
.cs__itemHead { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.cs__itemLbl { font-size: .92rem; font-weight: 700; color: var(--ink); }
.cs__itemName { width: 100%; height: 50px; border: 1px solid var(--line); border-radius: 12px; padding: 0 14px; font: inherit; color: var(--ink); background: var(--soft); outline: 0; margin-bottom: 14px; }
.cs__itemName::placeholder { color: var(--muted); }
.cs__itemName:focus { border-color: var(--brand); background: var(--surface); }
.cs__itemQtyRow { display: flex; align-items: center; justify-content: space-between; }
.cs__qty { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.cs__qtyBtn { width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); font-size: 1.15rem; cursor: pointer; color: var(--ink); line-height: 1; display: grid; place-items: center; }
.cs__qtyBtn:hover { border-color: var(--brand); color: var(--brand); }
.cs__qtyVal { min-width: 22px; text-align: center; font-weight: 700; font-size: 1rem; }
.cs__itemDel { width: 32px; height: 32px; border: 0; background: none; font-size: 1.4rem; color: var(--muted); cursor: pointer; flex-shrink: 0; line-height: 1; }
.cs__itemDel:hover { color: #b42318; }

/* Bouton « Ajouter un article » : contour rouge */
.cs__addItem { margin-top: 16px; background: var(--surface); border: 1.5px solid var(--brand); border-radius: 12px; width: 100%; height: 52px; color: var(--brand); font-weight: 700; font-size: 1rem; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.cs__addItem:hover { background: #fff6f5; }
.cs__hint { margin-top: 10px; color: var(--muted); font-size: .84rem; }

/* Lien « Ajouter une adresse » */
.cs__linkBtn { margin-top: 12px; background: none; border: 0; color: var(--brand); font-weight: 700; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; font-size: .95rem; padding: 0; }

/* Autocomplétion */
.cs__ac-field { position: relative; }
.cs__ac-field input { padding-right: 46px; }
.cs__ac-field .cs__mapbtn { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); width: 36px; height: 36px; display: grid; place-items: center;
  border: 0; border-radius: 50%; background: transparent; color: var(--muted); cursor: pointer; }
.cs__ac-field .cs__mapbtn svg { width: 20px; height: 20px; }
.cs__ac-field .cs__mapbtn:hover { color: var(--brand); background: var(--surface); }
.cs__ac-field .cs__mapbtn.is-active { color: #fff; background: var(--brand); }
#map.is-picking { cursor: crosshair; }
.cs__ac { position: absolute; top: calc(100% + 4px); left: 0; right: 0; z-index: 20; list-style: none; margin: 0; padding: 6px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 16px 40px rgba(0,0,0,.14); max-height: 260px; overflow: auto; }
.cs__ac li { padding: 10px 12px; border-radius: 9px; cursor: pointer; }
.cs__ac li:hover { background: var(--soft, #f7f2f0); }
.cs__ac strong { display: block; color: var(--ink); font-size: .95rem; }
.cs__ac small { color: var(--muted); font-size: .82rem; }

/* Paiement : réutilise .bk__pays / .bk__pay (booking.css) */

.cs__msg { color: #b42318; font-weight: 600; margin: 4px 0 12px; }
.cs__msg.is-ok { color: #147a3a; }
.cs__next { width: 100%; height: 54px; font-size: 1.05rem; border-radius: 14px; }

/* Récap / devis */
.cs__billBody { display: flex; flex-direction: column; gap: 10px; }
.cs__recap { display: flex; justify-content: space-between; gap: 12px; align-items: center; }
.cs__recap > span { color: var(--muted); font-size: .9rem; }
.cs__recap > b { color: var(--ink); text-align: right; }
.cs__itemsRecap { display: flex; flex-direction: column; gap: 6px; padding: 10px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.cs__ir { display: flex; gap: 10px; color: var(--ink); font-size: .92rem; }
.cs__irq { font-weight: 700; color: var(--brand); min-width: 28px; }
.cs__bill { display: flex; flex-direction: column; gap: 6px; }
.cs__bl { display: flex; justify-content: space-between; gap: 12px; font-size: .92rem; color: var(--text); }
.cs__bl--total { margin-top: 4px; padding-top: 10px; border-top: 1px solid var(--line); font-size: 1.1rem; font-weight: 800; color: var(--ink); }
.cs__itemNote { font-size: .84rem; color: var(--muted); background: var(--soft); border-radius: 10px; padding: 10px 12px; }

/* ===== Coursier : mise en page carte (2 colonnes, comme /booking) ===== */
.cs-body { overflow: hidden; }
.cs--map { display: grid; grid-template-columns: clamp(360px, 34vw, 480px) 1fr; height: calc(100dvh - var(--hdr-h)); min-height: 0; padding: 0; background: var(--soft); }
@media (min-width: 1024px) {
  .cs--map { position: fixed; inset: var(--hdr-h) 0 0 0; height: auto; }
  .cs-body { overflow: visible; }
}
.cs__panel { display: flex; flex-direction: column; min-height: 0; overflow: hidden; background: var(--surface); box-shadow: 8px 0 30px rgb(22 18 19 / .06); z-index: 2; }
.cs__scroll { flex: 1; min-height: 0; overflow-y: auto; padding: 24px 24px 8px; scroll-behavior: smooth; }
.cs__footer { padding: 16px 24px calc(16px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: var(--surface); }
.cs__footer .cs__next { width: 100%; margin: 0; }
.cs__map { position: relative; }
.cs--map #map { width: 100%; height: 100%; background: var(--soft); }
.cs__mapmsg { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); max-width: 420px; padding: 16px 20px; text-align: center; background: var(--surface); border-radius: 14px; box-shadow: 0 10px 30px rgba(0,0,0,.12); font-size: .9rem; }
.cs__card { scroll-margin-top: 10px; transition: box-shadow .2s; }
.cs__card.is-current { box-shadow: 0 0 0 2px var(--brand); }
@media (max-width: 860px) {
  .cs-body { overflow: hidden; }
  .cs--map { position: fixed; inset: var(--hdr-h) 0 0 0;
    grid-template-columns: 1fr; grid-template-rows: 40dvh 1fr; height: auto; min-height: 0; }
  .cs__map { order: -1; min-height: 0; }
  .cs__panel { border-radius: 20px 20px 0 0; margin-top: -20px; box-shadow: 0 -8px 30px rgb(22 18 19 / .12); }
  .cs__scroll { padding: 20px 16px 8px; }
  .cs__footer { padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); }
}

/* Focus carte : masque le panneau gauche pendant la manipulation (comme /booking) */
.cs--map { transition: grid-template-columns .3s ease; }
.cs__panel { transition: opacity .25s; }
.cs--map.is-mapfocus { grid-template-columns: 0px 1fr; }
.cs--map.is-mapfocus .cs__panel { opacity: 0; pointer-events: none; }
@media (max-width: 860px) {
  .cs--map { transition: grid-template-rows .3s ease; }
  .cs--map.is-mapfocus { grid-template-columns: 1fr; grid-template-rows: 1fr 0; }
}

/* Ticket d'information flottant (sur la carte, auto-fermé) */
.csTicket { position: absolute; top: 16px; right: 16px; z-index: 6; width: min(340px, calc(100% - 32px));
  background: var(--surface); border-radius: 16px; box-shadow: 0 18px 44px rgba(20,16,17,.22); padding: 15px 18px;
  opacity: 0; transform: translateY(-12px); transition: opacity .3s ease, transform .3s ease; }
.csTicket.is-show { opacity: 1; transform: none; }
.csTicket__x { position: absolute; top: 8px; right: 8px; width: 30px; height: 30px; border: 0; border-radius: 50%; background: var(--soft); color: #5a5560; font-size: 1.2rem; line-height: 1; cursor: pointer; }
.csTicket__x:hover { background: #e7dedb; }
.csTicket__h { font-weight: 800; color: var(--brand); margin-bottom: 8px; padding-right: 28px; }
.csTicket__b { color: #3a3540; font-size: .92rem; line-height: 1.5; }
.csTicket__b p { margin: 0 0 6px; padding-left: 20px; position: relative; }
.csTicket__b p:last-child { margin-bottom: 0; }
.csTicket__b p::before { content: '✓'; position: absolute; left: 0; color: #1e9e5a; font-weight: 800; }

/* Bouton « i » (réaffiche le ticket d'info) */
.csInfoBtn { position: absolute; top: 16px; right: 16px; z-index: 6; width: 42px; height: 42px; border: 0; border-radius: 50%;
  background: var(--brand); color: #fff; font-size: 1.1rem; cursor: pointer; box-shadow: 0 8px 22px rgba(156,3,6,.35);
  display: grid; place-items: center; transition: transform .15s; }
.csInfoBtn:hover { transform: scale(1.08); }
.csInfoBtn[hidden] { display: none; }

/* ---- Mobile : panneau compacté ---- */
@media (max-width: 640px) {
  .cs__brand img { height: 23px; }
  .cs__brand span { font-size: 1.15rem; }
  .cs__title { font-size: 1.5rem; }
  .cs__sub { font-size: .9rem; margin-bottom: 16px; }
  .cs__card { padding: 15px; margin-bottom: 14px; }
  .cs__h2 { font-size: 1.05rem; margin: 0 0 12px; }
  .cs__stepNo { width: 27px; height: 27px; font-size: .88rem; margin-right: 10px; }
  .cs__cardHint { font-size: .84rem; }
  .field > span, .cs__itemLbl { font-size: .86rem; }
  .field input, .cs__select, .cs__itemName { height: 46px; font-size: .92rem; padding: 0 12px; }
  .cs__qtyBtn { width: 34px; height: 34px; font-size: 1.1rem; }
  .cs__itemDel { width: 30px; height: 30px; font-size: 1.3rem; }
  .cs__addItem { height: 48px; font-size: .92rem; margin-top: 14px; }
  .cs__hint { font-size: .76rem; }
  .cs__next { height: 50px; font-size: .98rem; }
  .cs__itemNote { font-size: .78rem; padding: 9px 11px; }
}
