/* ============================================================
   SANDBOX-MODE.CSS — Mode démo / Simulation (compte-ombre)
   STATUT : STAGED 2026-06-12 — NON DÉPLOYÉ (mode préparation).
   Spec : product/mode_demo.md § 4 (UX). NOUVEAU fichier, 100 % additif :
   aucun style existant modifié, préfixe sbx- partout.
   - Badge « SIMULATION » : coin BAS-GAUCHE, posé JUSTE AU-DESSUS de la
     pill « Mode boîtage » (#boitage-ui, left:12 bottom:12, le seul élément
     permanent de ce coin — DVF/PRO vivent dans le drawer, vérifié map.css
     + captures du staging). L'attribution MapLibre est en bas-droite.
     Coin choisi PAR CAPTURE (consigne Nicolas « l'endroit qui ne gêne
     pas ») : voir captures/sbx_03 (mobile) et sbx_10 (desktop).
     Safe-area iOS respectée. JAMAIS masquable : z-index au-dessus des
     drawers (Flowbite z-40/50) et des panneaux.
   - Teinte AMBRE = signal d'avertissement doux (déjà la teinte du
     bandeau démo prospect) — ne vole aucune couleur mission canonique.
   ============================================================ */

/* ---------- badge permanent ---------- */
#sbx-badge {
  position: fixed;
  left: calc(12px + env(safe-area-inset-left, 0px));
  /* au-dessus de la pill « Mode boîtage » (bottom:12, hauteur ~38px) */
  bottom: calc(58px + env(safe-area-inset-bottom, 0px));
  z-index: 99999; /* au-dessus des drawers/panneaux ; sous rien */
  display: flex;
  align-items: center;
  gap: 7px;
  height: 28px;
  padding: 0 12px 0 10px;
  border-radius: 9999px;
  background: linear-gradient(135deg, #f59e0b 0%, #fbbf24 100%);
  color: #451a03;
  font: 800 11.5px/1 'Montserrat', system-ui, sans-serif;
  letter-spacing: 1.1px;
  box-shadow: 0 4px 12px rgba(180, 83, 9, .35);
  opacity: .9;
  cursor: pointer;
  border: none;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}
#sbx-badge:active { transform: scale(.97); }
#sbx-badge .sbx-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: #b45309; flex: 0 0 auto;
  animation: sbx-pulse 1.6s ease-in-out infinite;
}
@keyframes sbx-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: .35; transform: scale(.78); }
}

/* ---------- tuile menu : états ---------- */
/* prêt = tuile slate standard (markup map.html, rien à surcharger) */
/* préparation : spinner sur l'icône, tuile non cliquable visuellement */
#menu-demo-mode.sbx-pending { opacity: .62; cursor: default; }
#menu-demo-mode.sbx-pending .op8-bicon svg { display: none; }
#menu-demo-mode.sbx-pending .op8-bicon::after {
  content: "";
  width: 16px; height: 16px;
  border: 2.5px solid #cbd5e1;
  border-top-color: #475569;
  border-radius: 50%;
  animation: sbx-spin .9s linear infinite;
}
@keyframes sbx-spin { to { transform: rotate(360deg); } }
/* simulation en cours : teinte ambre, le menu dit l'état vrai */
#menu-demo-mode.sbx-active {
  background: #fef3c7;
  border-color: #fcd34d;
}
#menu-demo-mode.sbx-active .op8-t { color: #92400e; }
#menu-demo-mode.sbx-active .op8-s { color: #b45309; }
#menu-demo-mode.sbx-active .op8-bicon { background: #fde68a; color: #92400e; }

/* ---------- voile + feuilles/modales ---------- */
#sbx-overlay {
  position: fixed; inset: 0;
  z-index: 100000; /* au-dessus du badge */
  background: rgba(15, 23, 42, .55);
  display: flex; align-items: flex-end; justify-content: center;
}
@media (min-width: 640px) { #sbx-overlay { align-items: center; } }

.sbx-card {
  width: 100%; max-width: 420px;
  background: #fff;
  border-radius: 18px 18px 0 0;
  padding: 18px 18px calc(16px + env(safe-area-inset-bottom, 0px));
  box-shadow: 0 -8px 30px rgba(15, 23, 42, .25);
}
@media (min-width: 640px) { .sbx-card { border-radius: 18px; padding-bottom: 18px; } }

.sbx-title {
  font: 800 17px/1.3 'Montserrat', system-ui, sans-serif;
  color: #0f172a; margin: 0 0 12px;
  display: flex; align-items: center; gap: 8px;
}
.sbx-title .sbx-i {
  margin-left: auto;
  width: 22px; height: 22px; border-radius: 50%;
  border: 1.5px solid #cbd5e1; background: #fff; color: #64748b;
  font: 700 12px/1 serif; cursor: pointer; flex: 0 0 auto;
}
.sbx-infobox {
  background: #f1f5f9; border-radius: 10px;
  padding: 10px 12px; margin: 0 0 12px;
  font-size: 12.5px; line-height: 1.5; color: #334155;
}
.sbx-infobox[hidden] { display: none; }

/* 3 puces pictos (zéro phrase posée : picto + libellé court) */
.sbx-points { display: flex; flex-direction: column; gap: 10px; margin: 0 0 16px; }
.sbx-point { display: flex; align-items: center; gap: 11px; }
.sbx-point .sbx-pic {
  width: 34px; height: 34px; border-radius: 10px; flex: 0 0 auto;
  display: grid; place-items: center;
  background: #fef3c7; color: #92400e;
}
.sbx-point .sbx-pic svg { width: 18px; height: 18px; }
.sbx-point span { font-size: 13.5px; font-weight: 600; color: #1f2937; }

/* corps avertissement (sortie) */
.sbx-warn {
  background: #fef3c7; border: 1px solid #fcd34d; border-radius: 10px;
  padding: 11px 13px; margin: 0 0 16px;
  font-size: 13.5px; line-height: 1.5; color: #78350f;
}
.sbx-warn strong { color: #92400e; }

/* boutons */
.sbx-actions { display: flex; flex-direction: column; gap: 9px; }
.sbx-btn {
  width: 100%; border-radius: 11px; border: none; cursor: pointer;
  padding: 12px 14px;
  font: 700 14px/1.2 'Montserrat', system-ui, sans-serif;
  -webkit-tap-highlight-color: transparent;
}
.sbx-btn--primary { background: #f59e0b; color: #451a03; }
.sbx-btn--primary:active { background: #d97706; }
.sbx-btn--real { background: #0f172a; color: #fff; }
.sbx-btn--real:active { background: #1e293b; }
.sbx-btn--ghost { background: #f1f5f9; color: #334155; }
.sbx-btn--ghost:active { background: #e2e8f0; }
.sbx-btn--danger-ghost { background: #fff; color: #b91c1c; border: 1.5px solid #fecaca; }
.sbx-btn--danger-ghost:active { background: #fef2f2; }
.sbx-btn[disabled] { opacity: .55; cursor: default; }

/* état préparation dans une feuille (reset en cours) */
.sbx-prep { display: flex; align-items: center; gap: 10px; padding: 6px 2px 2px; }
.sbx-prep .sbx-spin {
  width: 18px; height: 18px; flex: 0 0 auto;
  border: 2.5px solid #fde68a; border-top-color: #b45309;
  border-radius: 50%; animation: sbx-spin .9s linear infinite;
}
.sbx-prep span { font-size: 13.5px; font-weight: 700; color: #92400e; }

/* ---------- toast ---------- */
#sbx-toast {
  position: fixed; left: 50%; transform: translateX(-50%);
  bottom: calc(100px + env(safe-area-inset-bottom, 0px)); /* au-dessus du badge */
  z-index: 100001;
  background: #0f172a; color: #fff;
  font: 600 13px/1.3 system-ui, sans-serif;
  padding: 10px 16px; border-radius: 10px;
  box-shadow: 0 6px 18px rgba(15, 23, 42, .35);
  max-width: 86vw; text-align: center;
  animation: sbx-toast-in .18s ease-out;
}
@keyframes sbx-toast-in { from { opacity: 0; transform: translate(-50%, 8px); } }

/* ---------- GAM-D2 : action « valider l'annonce » grisée en simulation ---------- */
.sbx-gamd2-off {
  opacity: .45 !important;       /* override ponctuel d'un composant existant (lv-btn) */
  pointer-events: none !important;
  filter: grayscale(.6);
}
.sbx-gamd2-chip {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  margin-top: 6px;
  font-size: 11.5px; font-weight: 700; color: #92400e;
  background: #fef3c7; border-radius: 8px; padding: 6px 10px;
  cursor: pointer;
}
.sbx-gamd2-chip .sbx-chip-i {
  width: 15px; height: 15px; border-radius: 50%;
  border: 1.2px solid #d97706; color: #92400e;
  font: 700 10px/13px serif; text-align: center; flex: 0 0 auto;
}
.sbx-gamd2-note {
  margin-top: 6px; font-size: 11.5px; line-height: 1.45; color: #78350f;
  background: #fffbeb; border: 1px solid #fde68a; border-radius: 8px; padding: 7px 10px;
}
.sbx-gamd2-note[hidden] { display: none; }
