/* ============================================================================
   MaxiLED datasheet flipbook — drawer + PDF page-flip viewer
   ============================================================================ */

/* Backdrop veil (left 40% of viewport, dims the underlying page) */
.fb-veil {
  position: fixed;
  inset: 0;
  background: rgba(15, 15, 15, 0.62);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  z-index: 9998;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.32s ease;
}
.fb-veil.open { opacity: 1; pointer-events: auto; }

/* Drawer — slides in from right */
.fb-drawer {
  position: fixed;
  top: 0;
  right: 0;
  height: 100vh;
  width: 60vw;
  min-width: 720px;
  max-width: 1280px;
  background: linear-gradient(180deg, #F6F4F0 0%, #EEEBE3 100%);
  box-shadow: -24px 0 80px rgba(0, 0, 0, 0.35);
  z-index: 9999;
  transform: translateX(100%);
  transition: transform 0.42s cubic-bezier(0.32, 0.72, 0.24, 1);
  display: flex;
  flex-direction: column;
}
.fb-drawer.open { transform: translateX(0); }

@media (max-width: 900px) {
  .fb-drawer { width: 100vw; min-width: 0; }
}

/* Toolbar */
.fb-toolbar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 26px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  background: rgba(255, 255, 255, 0.4);
  backdrop-filter: blur(8px);
  flex-shrink: 0;
}
.fb-title-block { margin-right: auto; min-width: 0; overflow: hidden; }
.fb-title {
  font-family: 'Playfair Display', serif;
  font-size: 16pt;
  font-weight: 400;
  color: #0F0F0F;
  line-height: 1.1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.fb-title em { font-style: italic; color: #1A7A8A; }
.fb-title-tag {
  display: block;
  font-family: 'JetBrains Mono', monospace;
  font-size: 8.5pt;
  letter-spacing: 0.22em;
  color: #1A7A8A;
  text-transform: uppercase;
  margin-bottom: 4px;
  font-weight: 500;
}
.fb-counter {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10.5pt;
  letter-spacing: 0.14em;
  color: #666;
  min-width: 68px;
  text-align: center;
}
.fb-counter .fb-current { color: #1A7A8A; font-weight: 600; }
.fb-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: transparent;
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 3px;
  color: #1A1A1A;
  cursor: pointer;
  transition: all 0.18s ease;
  padding: 0;
}
.fb-btn:hover:not(:disabled) { background: rgba(26, 122, 138, 0.08); border-color: #1A7A8A; color: #1A7A8A; }
.fb-btn:disabled { opacity: 0.35; cursor: not-allowed; }
.fb-btn svg { width: 20px; height: 20px; }
.fb-btn-download {
  width: auto;
  padding: 0 18px;
  background: #1A7A8A;
  color: #FFF;
  border-color: #1A7A8A;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10pt;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  gap: 8px;
}
.fb-btn-download:hover:not(:disabled) { background: #14626F !important; color: #FFF !important; }
.fb-btn-close {
  margin-left: 8px;
  background: rgba(0, 0, 0, 0.06);
  border-color: transparent;
}
.fb-btn-close:hover:not(:disabled) { background: rgba(0, 0, 0, 0.14); color: #1A1A1A; border-color: transparent; }

/* Stage — where the flipbook renders */
.fb-stage {
  flex: 1;
  min-height: 0;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 26px 22px;
  position: relative;
}

.fb-book {
  display: block;
  filter: drop-shadow(0 12px 32px rgba(0, 0, 0, 0.22));
  /* Kill any child overflow scroll — StPageFlip positions absolutely */
  overflow: visible !important;
}
.fb-book * { touch-action: none; }
.fb-book .stf__parent { position: relative !important; }

/* Loading state */
.fb-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10pt;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #666;
}
.fb-loading-spinner {
  width: 36px;
  height: 36px;
  border: 2px solid rgba(26, 122, 138, 0.18);
  border-top-color: #1A7A8A;
  border-radius: 50%;
  animation: fb-spin 0.9s linear infinite;
}
@keyframes fb-spin {
  to { transform: rotate(360deg); }
}

/* Pages inside the flipbook — background image of a rendered PDF page */
.fb-page {
  background: #FFF;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.05);
}
.fb-page-hard { background: #EEEBE3; }

/* Body scroll lock helper */
body.fb-open { overflow: hidden; }
