/* =====================================================================
   PDF Protector — Visor (prefijo pdfs-) · sistema de tokens
   Clases con prefijo propio para no chocar con el tema u otros plugins.
   ===================================================================== */
.pdfs-root{
  /* Marca (configurable desde el admin vía --pdfs-accent) */
  --pdfs-accent:#1f7a3d;                 /* verde institucional (acento) */
  --pdfs-gold:#f2b50a;                   /* dorado del emblema (firma) */
  --pdfs-header:#11241b;                 /* verde muy oscuro institucional */
  --pdfs-scrim:rgba(9,16,12,.93);
  --pdfs-txt:#eaf0ec; --pdfs-txt-dim:#9bb0a4;
  --pdfs-line:rgba(255,255,255,.10);
  /* Radios: escala de 3 — documento / botón / grupo */
  --pdfs-r1:6px; --pdfs-r2:10px; --pdfs-r3:14px;
  /* Espaciado base-4 */
  --pdfs-s1:4px; --pdfs-s2:8px; --pdfs-s3:12px; --pdfs-s4:16px; --pdfs-s6:24px;
  --pdfs-elev:0 10px 30px rgba(0,0,0,.40);
}
.pdfs-overlay{
  position:fixed; inset:0; z-index:2147483000;
  display:flex; flex-direction:column;
  background:var(--pdfs-scrim);
  -webkit-user-select:none; -moz-user-select:none; -ms-user-select:none; user-select:none;
  animation:pdfs-fade .2s ease-out;
}
.pdfs-overlay[hidden]{ display:none; }
@keyframes pdfs-fade{ from{opacity:0} to{opacity:1} }

/* La barra de admin de WordPress usa el z-index máximo; en vez de pelear por
   encima (imposible), reservamos su espacio. Solo afecta a usuarios logueados;
   los visitantes ven el visor a pantalla completa. */
body.admin-bar .pdfs-overlay{ top:32px; }
@media screen and (max-width:782px){ body.admin-bar .pdfs-overlay{ top:46px; } }

/* ---- Header sólido institucional + filete dorado (firma de marca) ---- */
.pdfs-bar{
  flex:0 0 auto; height:58px; display:flex; align-items:center; gap:var(--pdfs-s3);
  padding:0 var(--pdfs-s4); color:var(--pdfs-txt);
  background:var(--pdfs-header); border-bottom:2px solid var(--pdfs-gold);
}
.pdfs-brand{ display:flex; align-items:center; gap:var(--pdfs-s3); min-width:0; }
.pdfs-brand img{ width:34px; height:34px; border-radius:50%; flex:0 0 auto; object-fit:cover; -webkit-user-drag:none; }
.pdfs-titles{ min-width:0; line-height:1.2; }
.pdfs-title{ font-size:15px; font-weight:700; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; max-width:40vw; }
.pdfs-sub{ font-size:12px; color:var(--pdfs-txt-dim); font-weight:500; }
.pdfs-spacer{ flex:1 1 auto; }

.pdfs-group{ display:flex; align-items:center; gap:var(--pdfs-s1); background:rgba(255,255,255,.06); border:1px solid var(--pdfs-line); padding:var(--pdfs-s1); border-radius:var(--pdfs-r3); }
/* Botones endurecidos contra el CSS del tema (mayor especificidad + !important
   en las dimensiones; el tema pisaba el width de los svg dejándolos en 0). */
.pdfs-root .pdfs-btn{
  appearance:none !important; -webkit-appearance:none !important; box-sizing:border-box !important;
  border:0 !important; box-shadow:none !important; outline:0; cursor:pointer;
  color:var(--pdfs-txt); background:transparent;
  width:40px !important; height:40px !important; min-width:0 !important; min-height:0 !important;
  padding:0 !important; margin:0 !important; border-radius:var(--pdfs-r2); flex:0 0 auto;
  display:inline-flex !important; align-items:center !important; justify-content:center !important;
  line-height:1; text-transform:none; letter-spacing:normal;
  transition:background .15s ease;
}
.pdfs-root .pdfs-btn:hover:not(:disabled){ background:rgba(255,255,255,.12); }
.pdfs-root .pdfs-btn:disabled{ opacity:.32; cursor:default; }
.pdfs-root .pdfs-btn:focus-visible{ outline:2px solid var(--pdfs-accent); outline-offset:2px; }
.pdfs-root .pdfs-btn svg{
  width:20px !important; height:20px !important; min-width:20px !important;
  max-width:none !important; max-height:none !important; display:block !important; flex:0 0 auto !important;
}
.pdfs-root .pdfs-btn--close:hover{ background:#c0392b !important; }
.pdfs-pageinfo{ font-size:13.5px; font-variant-numeric:tabular-nums; min-width:62px; text-align:center; padding:0 var(--pdfs-s2); }

/* ---- Zona de scroll con páginas ---- */
.pdfs-scroll{
  flex:1 1 auto; overflow:auto; -webkit-overflow-scrolling:touch;
  display:flex; flex-direction:column; align-items:center;
  padding:var(--pdfs-s6) var(--pdfs-s4) 48px; gap:var(--pdfs-s4); scroll-behavior:smooth;
}
.pdfs-page{
  position:relative; background:#fff; border-radius:var(--pdfs-r1); overflow:hidden;
  box-shadow:var(--pdfs-elev); max-width:100%; flex:0 0 auto;
}
.pdfs-page canvas{ display:block; width:100%; height:auto; -webkit-user-select:none; user-select:none; -webkit-user-drag:none; }
.pdfs-shimmer{ position:absolute; inset:0; background:
    linear-gradient(100deg, #f2f4f3 30%, #e7eae8 50%, #f2f4f3 70%);
    background-size:200% 100%; animation:pdfs-sh 1.2s linear infinite; }
.pdfs-perr{ position:absolute; inset:0; display:flex; align-items:center; justify-content:center; color:#9a3b34; font:13px system-ui, sans-serif; background:#f6f1f0; padding:12px; text-align:center; }
@keyframes pdfs-sh{ from{background-position:200% 0} to{background-position:-200% 0} }

/* ---- Carga / error ---- */
.pdfs-state{ margin:auto; color:var(--pdfs-txt); text-align:center; padding:48px var(--pdfs-s6); }
.pdfs-state .pdfs-ring{ width:40px; height:40px; border:3px solid rgba(255,255,255,.18); border-top-color:var(--pdfs-accent); border-radius:50%; margin:0 auto var(--pdfs-s4); animation:pdfs-spin .8s linear infinite; }
.pdfs-state small{ display:block; color:var(--pdfs-txt-dim); margin-top:var(--pdfs-s2); font-size:12px; }
.pdfs-state--err{ color:#ffd0cb; max-width:420px; }
@keyframes pdfs-spin{ to{ transform:rotate(360deg) } }

/* ---- Marca de agua sutil (presencia de marca) ---- */
.pdfs-wm{ position:fixed; right:var(--pdfs-s4); bottom:var(--pdfs-s3); width:42px; height:42px; border-radius:50%; opacity:.14; pointer-events:none; object-fit:cover; -webkit-user-drag:none; }

/* ---- Responsive ---- */
@media (max-width:640px){
  .pdfs-bar{ height:52px; gap:var(--pdfs-s2); padding:0 var(--pdfs-s2); }
  .pdfs-title{ max-width:46vw; font-size:14px; }
  .pdfs-sub{ display:none; }
  .pdfs-scroll{ padding:var(--pdfs-s3) var(--pdfs-s2) 40px; gap:var(--pdfs-s3); }
}
@media (prefers-reduced-motion: reduce){
  .pdfs-overlay{ animation:none; }
  .pdfs-shimmer{ animation:none; }
}
@media print{ .pdfs-overlay, .pdfs-wm{ display:none !important; } }
