/* ─────────────────────────────────────────────
   Bottom-sheet réutilisable
   - Sur desktop (>= 760px) : modal classique centré
   - Sur mobile (< 760px)  : feuille collée en bas, swipe-down pour fermer
   À importer après _tokens.css :
       @import url('/static/css/_bottomsheet.css');

   Markup attendu :
       <div class="bs-overlay" id="..." role="dialog" aria-modal="true">
         <div class="bs-sheet" data-bs-sheet>
           <div class="bs-handle"></div>
           <button class="bs-close" data-bs-close>×</button>
           ... contenu ...
         </div>
       </div>
   ───────────────────────────────────────────── */

.bs-overlay {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(0,0,0,0.7); backdrop-filter: blur(4px);
  display: none; align-items: center; justify-content: center;
  padding: 20px;
  opacity: 0; transition: opacity 0.2s ease;
}
.bs-overlay.bs-open { display: flex; opacity: 1; }

.bs-sheet {
  position: relative;
  background: #1a1712;
  border: 1px solid rgba(201,168,124,0.25);
  border-radius: 16px;
  padding: 36px 28px 32px;
  width: 100%;
  max-width: 440px;
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  transform: translateY(0);
  transition: transform 0.25s ease;
}

.bs-handle { display: none; }

.bs-close {
  position: absolute; top: 12px; right: 14px;
  background: none; border: none;
  color: rgba(255,255,255,0.4); font-size: 22px; cursor: pointer;
  width: 32px; height: 32px; line-height: 1;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%; transition: background 0.15s, color 0.15s;
}
.bs-close:hover { background: rgba(255,255,255,0.06); color: #e4e2dc; }

/* ─── Mobile : bottom-sheet ─── */
@media (max-width: 760px) {
  .bs-overlay {
    align-items: flex-end;
    padding: 0;
  }
  .bs-sheet {
    border-radius: 20px 20px 0 0;
    border-left: none; border-right: none; border-bottom: none;
    max-width: 100%;
    width: 100%;
    max-height: 92vh;
    padding: 14px 22px calc(28px + env(safe-area-inset-bottom)) 22px;
    transform: translateY(100%);
    transition: transform 0.28s cubic-bezier(0.32, 0.72, 0, 1);
  }
  .bs-overlay.bs-open .bs-sheet {
    transform: translateY(0);
  }
  .bs-handle {
    display: block;
    width: 44px; height: 4px;
    background: rgba(255,255,255,0.18);
    border-radius: 2px;
    margin: 0 auto 18px;
    cursor: grab;
  }
  .bs-handle:active { cursor: grabbing; background: rgba(255,255,255,0.32); }

  /* Animation de fermeture (slide-down) */
  .bs-overlay.bs-closing .bs-sheet { transform: translateY(100%); }
  .bs-overlay.bs-closing { opacity: 0; }
}

/* Disable scroll body quand bottom-sheet ouvert */
body.bs-locked { overflow: hidden; touch-action: none; }
