/* Baseline viewer */
.pdfjs-viewer .pf-stage { position: relative; width:100%; max-width:100%; margin:0 auto; overflow:hidden; height:calc(100vh - 260px); display:flex; align-items:center; justify-content:center; gap:6px; }
.pf-page{position:relative; display:inline-block;} .pf-page canvas{display:block; box-shadow:0 2px 8px rgba(0,0,0,.12);}
.pf-arrow{position:absolute; top:50%; transform:translateY(-50%); z-index:5; background:rgba(0,0,0,.35); color:#fff; border:none; border-radius:999px; width:40px; height:40px; line-height:40px; text-align:center; font-size:24px; cursor:pointer; opacity:.9}
.pf-arrow:hover{opacity:1} .pf-left{left:8px} .pf-right{right:8px}
.pdfjs-viewer .pf-toolbar.pf-bottom{display:flex; gap:10px; align-items:center; justify-content:center; margin:10px 0 0 0; padding:0; background:transparent; border:none; color:inherit; white-space:nowrap}
.pdfjs-viewer .pf-toolbar.pf-bottom button{background:#fff; border:1px solid #000; color:#000; padding:6px 10px; cursor:pointer}
.pdfjs-viewer .pf-toolbar.pf-bottom #pf-status{margin:0 8px}
.pdfjs-viewer:fullscreen .pf-stage{max-width:none; width:100%; height:calc(100vh - 120px)}

/* Fullscreen fallback (CSS) */
.pdfjs-viewer.pf-fs{
  position: fixed;
  left: 0; top: 0;
  width: 100vw; height: 100vh;
  background: #fff;
  z-index: 9999;
  padding: 24px 8px 56px;
}
.pdfjs-viewer.pf-fs .pf-stage{
  height: calc(100vh - 120px); /* adapter si besoin */
}
.pdfjs-viewer.pf-fs .pf-toolbar.pf-bottom{
  position: fixed;
  left: 0; right: 0; bottom: 10px;
  display: flex; gap: 12px; justify-content: center;
}

/* Style du titre de page (module Catalogue PDF) */
.bys-cataloguepdf h1{
  padding-bottom: 3px;
  margin: 0 0 15px;
  text-transform: uppercase;
  font: 900 20px/30px "Red Hat Text","Helvetica Neue",Verdana,Arial,sans-serif;
  color: #000;
}
.bys-cataloguepdf h1:after{
  content: "";
  width: 148px;
  height: 10px;
  background: #fadce6;
  display: block;
  margin-top: 0;
}

/* Bande de miniatures */
.pf-thumbs{
  display:flex;
  overflow-x:auto;
  overflow-y:hidden;
  padding:10px 8px;
  gap:8px;
  border-top:1px solid #eee;
  scroll-behavior:smooth;
  -webkit-overflow-scrolling:touch;
  margin-top: 15px;
}
.pf-thumbs-track{
  display:flex;
  gap:8px;
  align-items:center;
}
.pf-thumb{
  position:relative;
  flex:0 0 auto;
  height:90px;               /* ajustable */
  border:1px solid #ddd;
  background:#fff;
  border-radius:4px;
  box-shadow:0 1px 2px rgba(0,0,0,.06);
  cursor:pointer;
  padding:0;
}
.pf-thumb canvas,
.pf-thumb img{
  display:block;
  height:100%;
}
.pf-thumb .pf-thumb-num{
  position:absolute;
  left:6px; bottom:6px;
  font: 600 11px/1.1 system-ui,-apple-system,Segoe UI,Roboto,Helvetica,Arial,sans-serif;
  color:#fff;
  background:rgba(0,0,0,.55);
  padding:2px 5px;
  border-radius:3px;
}
.pf-thumb.-active{
  border-color:#000;
  box-shadow:0 0 0 2px #000 inset;
}

/* Option : cacher les miniatures sur tout petit écran */
@media (max-width: 640px){
  .pf-thumbs{ display:none; }
}

/* >>> MODIF : miniatures à droite en FS, on réserve la place via padding-right */
.pdfjs-viewer.pf-fs.pf-fs-thumbs-right {
  padding-right: 190px; /* largeur colonne (170px) + marge ; ajuste 170–220px */
}
.pdfjs-viewer.pf-fs.pf-fs-thumbs-right .pf-stage{
  margin-right: 0; /* on ne rétrécit plus le stage par marge */
}

/* Colonne de vignettes à droite, scroll vertical */
.pdfjs-viewer.pf-fs.pf-fs-thumbs-right .pf-thumbs{
  display: block !important;           /* visible en FS */
  position: absolute;
  right: 0; top: 24px;                 /* marge sous le header FS, ajuste si besoin */
  bottom: 66px;                        /* marge au-dessus de la toolbar du bas */
  width: 170px;                        /* largeur de la colonne */
  overflow-y: auto; overflow-x: hidden;
  border-left: 1px solid #eee;
  padding: 8px;
  background: #fff;
  z-index: 4;                          /* sous les flèches (z-index:5) */
}

/* Piste en colonne */
.pdfjs-viewer.pf-fs.pf-fs-thumbs-right .pf-thumbs-track{
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Vignettes un peu plus hautes en colonne */
.pdfjs-viewer.pf-fs.pf-fs-thumbs-right .pf-thumb{
  height: 120px;       /* ajuste */
  width: auto;
}

/* Overlay de chargement */
.pdfjs-viewer .pf-loader{
  position: absolute;
  left: 0; right: 0;
  /* couvrir la zone visible du PDF (entre le titre et la toolbar) */
  top: 0;
  bottom: 66px;                 /* marge au-dessus de la barre du bas */
  display: none;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  background: linear-gradient(to bottom, rgba(255,255,255,.85), rgba(255,255,255,.65));
  z-index: 20;
}
.pdfjs-viewer.pf-loading .pf-loader{ display: flex; }

/* Spinner */
.pf-spinner{
  width: 42px; height: 42px;
  border-radius: 50%;
  border: 3px solid rgba(0,0,0,.15);
  border-top-color: #000;
  animation: pfspin 0.9s linear infinite;
}
@keyframes pfspin { to { transform: rotate(360deg); } }

/* accessibilité : texte lecteur d’écran uniquement */
.pf-sr{
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(1px,1px,1px,1px); white-space: nowrap;
}

/* Overlay de chargement (version transition/opacity – prend le dessus sur le bloc plus haut) */
.pdfjs-viewer .pf-loader{
  position:absolute; inset:0; display:flex;
  align-items:center; justify-content:center;
  background:rgba(255,255,255,.85);
  opacity:0; pointer-events:none; transition:opacity .15s ease;
  z-index:20;
}
.pdfjs-viewer.pf-loading .pf-loader{ opacity:1; pointer-events:auto; }

/* Spinner (version transition) */
.pf-spinner{
  width:44px; height:44px; border-radius:50%;
  border:3px solid #e5e5e5; border-top-color:#111;
  animation:pf-spin .9s linear infinite;
}
@keyframes pf-spin { to { transform:rotate(360deg); } }

/* (optionnel) défilement doux de la piste miniatures */
.pdfjs-viewer .pf-thumbs{ scroll-behavior:smooth; }
