/* ══════════════════════════════════════════════════════════════════════════════
   LE PACK — l'habillage.

   Deux pièces : une bulle qui suit le visiteur, et un tiroir qui monte du bas au
   doigt / se pose en panneau à droite en desktop. Le vocabulaire est celui du site :
   verre sombre, liseré néon, la couleur `--vif` qui vient de la pochette en cours.

   ⚠️ LE BAS DE L'ÉCRAN EST DÉJÀ OCCUPÉ : le lecteur y est fixé, et le dock aussi
      au doigt. La bulle se cale donc AU-DESSUS des deux, jamais par-dessus — c'est
      la même arithmétique que celle du lecteur dans `vivant.css`.
   ══════════════════════════════════════════════════════════════════════════════ */

.pack-bulle {
  position: fixed; right: 16px; z-index: 70;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 92px);
  width: 56px; height: 56px; border-radius: 50%; border: 0; cursor: pointer;
  background: linear-gradient(135deg, var(--violet) 0%, #ff7ab0 100%);
  color: #fff; display: grid; place-items: center;
  box-shadow: 0 14px 34px -10px var(--glow), 0 0 0 1px rgba(255, 255, 255, .07) inset;
  /* tant que le pack est vide, la bulle n'a rien à dire : elle disparaît */
  opacity: 0; transform: scale(.7) translateY(10px); pointer-events: none;
  transition: opacity .28s, transform .28s cubic-bezier(.2, .9, .2, 1);
}
.pack-bulle.vu { opacity: 1; transform: none; pointer-events: auto; }
.pack-bulle svg { width: 23px; height: 23px; fill: none; stroke: currentColor; stroke-width: 1.7; }
.pack-n {
  position: absolute; top: -3px; right: -3px; min-width: 21px; height: 21px; padding: 0 5px;
  border-radius: 999px; background: #fff; color: #14142a;
  font-size: 12px; font-weight: 800; display: grid; place-items: center;
  box-shadow: 0 3px 10px -2px rgba(0, 0, 0, .5);
}
@media (max-width: 1024px) {
  /* au doigt le dock ET le lecteur sont là : la bulle monte au-dessus des deux */
  .pack-bulle { bottom: calc(var(--dock-h) + env(safe-area-inset-bottom, 0px) + 108px); }
}

/* ── le tiroir ───────────────────────────────────────────────────────────── */
.pack-tiroir { position: fixed; inset: 0; z-index: 90; visibility: hidden; }
.pack-tiroir.on { visibility: visible; }
.pack-fond {
  position: absolute; inset: 0; background: rgba(4, 4, 10, .6);
  backdrop-filter: blur(3px); opacity: 0; transition: opacity .3s;
}
.pack-tiroir.on .pack-fond { opacity: 1; }

.pack-boite {
  position: absolute; left: 0; right: 0; bottom: 0;
  max-height: 86vh; display: flex; flex-direction: column;
  background: rgba(16, 16, 28, .97); backdrop-filter: blur(24px);
  border-top: 1px solid var(--vif-doux); border-radius: 22px 22px 0 0;
  box-shadow: 0 -24px 60px -20px rgba(0, 0, 0, .9);
  transform: translateY(101%); transition: transform .38s cubic-bezier(.2, .9, .2, 1);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
.pack-tiroir.on .pack-boite { transform: none; }

/* en desktop ce n'est pas un tiroir mobile agrandi : c'est un panneau latéral */
@media (min-width: 1024px) {
  .pack-boite {
    left: auto; top: 0; right: 0; bottom: 0; width: min(420px, 92vw);
    max-height: none; border-radius: 0; border-top: 0; border-left: 1px solid var(--vif-doux);
    transform: translateX(101%);
    box-shadow: -24px 0 60px -20px rgba(0, 0, 0, .9);
  }
}

.pack-tete {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 20px 14px; border-bottom: 1px solid var(--ligne); flex: 0 0 auto;
}
.pack-tete strong { font-size: 17px; letter-spacing: -.01em; }
.pack-x {
  width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--ligne);
  background: transparent; color: var(--txt2); font-size: 21px; line-height: 1;
  cursor: pointer; display: grid; place-items: center; transition: color .2s, border-color .2s;
}
.pack-x:hover { color: var(--txt); border-color: var(--vif); }

.pack-liste { overflow-y: auto; padding: 14px 20px; flex: 1 1 auto; min-height: 0; }
.pack-vide { color: var(--txt3); font-size: 14.5px; text-align: center; padding: 34px 0; line-height: 1.7; }

.pack-item {
  display: flex; align-items: center; gap: 13px; padding: 11px 0;
  border-bottom: 1px solid var(--ligne);
}
.pack-item:last-child { border-bottom: 0; }
.pack-item img { width: 56px; height: 56px; border-radius: 11px; object-fit: cover; flex: 0 0 auto; }
.pack-item-txt { min-width: 0; flex: 1; }
.pack-item-t { font-weight: 650; font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pack-item-m { font-size: 11.5px; color: var(--txt3); margin: 2px 0 7px; }
.pack-lic {
  width: 100%; padding: 7px 9px; border-radius: 8px; font: inherit; font-size: 12.5px;
  background: #0e0e18; color: var(--txt); border: 1px solid var(--ligne); cursor: pointer;
}
.pack-del {
  width: 30px; height: 30px; flex: 0 0 auto; border-radius: 50%; cursor: pointer;
  border: 1px solid var(--ligne); background: transparent; color: var(--txt3);
  font-size: 18px; line-height: 1; display: grid; place-items: center;
  transition: color .2s, border-color .2s;
}
.pack-del:hover { color: #ff6b8a; border-color: #ff6b8a; }

.pack-pied { padding: 16px 20px 20px; border-top: 1px solid var(--ligne); flex: 0 0 auto; }
.pack-total {
  display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 14px;
}
.pack-total span { font-size: 13px; color: var(--txt2); }
.pack-total b { font-size: 24px; letter-spacing: -.02em; }
.pack-pied .cta { width: 100%; justify-content: center; margin-bottom: 9px; }
.pack-note { font-size: 11.5px; color: var(--txt3); text-align: center; margin-top: 6px; line-height: 1.6; }

body.pack-ouvert { overflow: hidden; }

/* ── le retour du formulaire, à la place du JSON brut ─────────────────────── */
.form-retour {
  margin-top: 14px; padding: 12px 14px; border-radius: 10px;
  font-size: 14px; line-height: 1.55;
}
.form-retour.ok { background: rgba(52, 199, 123, .12); border: 1px solid rgba(52, 199, 123, .35); color: #7ee2ac; }
.form-retour.ko { background: rgba(255, 107, 138, .12); border: 1px solid rgba(255, 107, 138, .35); color: #ff9db2; }

@media (prefers-reduced-motion: reduce) {
  .pack-bulle, .pack-boite, .pack-fond { transition: none; }
}
