/* Bibliothèque PWA — catalogue + fiche livre + achat/vente Tsiky */
.biblio-body { background: var(--bg); color: var(--text); }
.biblio-root { max-width: var(--max-w); margin: 0 auto; padding: 12px 12px 40px; }

.biblio-toolbar { display: flex; gap: 8px; align-items: center; margin: 8px 0 14px; }
.biblio-toolbar input[type="search"] {
  flex: 1; min-width: 0; padding: 11px 14px; border-radius: var(--r-lg);
  border: 1.5px solid var(--border-strong); background: var(--card-bg); color: var(--text); font: inherit;
}
.biblio-toolbar .btn { flex-shrink: 0; white-space: nowrap; }

.biblio-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
@media (min-width: 640px) { .biblio-grid { grid-template-columns: repeat(3, 1fr); } }

.biblio-card {
  background: var(--card-bg); border-radius: var(--r-lg); overflow: hidden;
  box-shadow: var(--shadow-card); cursor: pointer; display: flex; flex-direction: column;
  transition: transform var(--t-fast), box-shadow var(--t-base);
}
.biblio-card:active { transform: scale(0.97); }
.biblio-cover {
  aspect-ratio: 3/4; background: linear-gradient(135deg, #6750A4, #9A85D6);
  display: flex; align-items: center; justify-content: center; color: #fff; position: relative;
}
.biblio-cover img { width: 100%; height: 100%; object-fit: cover; }
.biblio-cover .ph { font-size: 34px; opacity: .85; }
.biblio-price {
  position: absolute; top: 8px; right: 8px; padding: 3px 9px; border-radius: var(--r-pill);
  font-size: 11.5px; font-weight: 800; background: #10B981; color: #fff;
}
.biblio-price.free { background: rgba(0,0,0,.5); }
.biblio-boosted {
  position: absolute; top: 8px; left: 8px; padding: 3px 8px; border-radius: var(--r-pill);
  font-size: 10.5px; font-weight: 800; background: #F5B027; color: #1C1C2E;
  display: inline-flex; align-items: center; gap: 4px;
}
.biblio-meta { padding: 9px 10px 12px; }
.biblio-title { font-weight: 800; font-size: 13.5px; line-height: 1.25; margin: 0 0 2px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.biblio-author { font-size: 12px; color: var(--text-muted); }
.biblio-stats { font-size: 11px; color: var(--text-faint); margin-top: 4px; }

/* Overlay modal (fiche + lecteur + vente) */
.biblio-ov {
  position: fixed; inset: 0; z-index: var(--z-modal); background: rgba(0,0,0,.55);
  display: flex; align-items: flex-end; justify-content: center; opacity: 0;
  transition: opacity var(--t-base);
}
.biblio-ov.show { opacity: 1; }
@media (min-width: 640px) { .biblio-ov { align-items: center; } }
.biblio-sheet {
  background: var(--card-bg); color: var(--text); width: 100%; max-width: 520px;
  max-height: 92vh; overflow-y: auto; border-radius: var(--r-2xl) var(--r-2xl) 0 0;
  padding: 18px 18px calc(18px + var(--safe-bottom)); transform: translateY(12px);
  transition: transform var(--t-slow);
}
.biblio-ov.show .biblio-sheet { transform: translateY(0); }
@media (min-width: 640px) { .biblio-sheet { border-radius: var(--r-2xl); } }
.biblio-sheet-close {
  position: absolute; top: 12px; right: 14px; background: var(--skeleton); border: none;
  width: 34px; height: 34px; border-radius: 50%; color: var(--text); cursor: pointer; font-size: 15px;
}
.biblio-sheet h2 { margin: 4px 0 2px; font-size: 19px; }
.biblio-sheet .sub { color: var(--text-muted); font-size: 13.5px; margin: 0 0 12px; }
.biblio-sheet .desc { font-size: 14px; line-height: 1.5; color: var(--text-soft); white-space: pre-wrap; }
.biblio-field { display: block; margin: 12px 0; }
.biblio-field span { display: block; font-size: 12px; font-weight: 700; color: var(--text-muted); margin-bottom: 5px; }
.biblio-field input, .biblio-field textarea, .biblio-field select {
  width: 100%; padding: 11px 13px; border-radius: var(--r-md); border: 1.5px solid var(--border-strong);
  background: var(--bg-soft); color: var(--text); font: inherit;
}
.biblio-field textarea { min-height: 72px; resize: vertical; }
.biblio-err { color: var(--red-dark); font-size: 13px; min-height: 18px; margin: 4px 0; }
.biblio-cta { width: 100%; padding: 13px; font-size: 15px; margin-top: 6px; }

/* Lecteur simple */
.biblio-reader { position: fixed; inset: 0; z-index: calc(var(--z-modal) + 1); background: var(--bg); display: flex; flex-direction: column; }
.biblio-reader-bar { display: flex; align-items: center; gap: 10px; padding: 10px 14px; background: var(--card-bg); box-shadow: var(--shadow-header); }
.biblio-reader-bar button { background: none; border: none; color: var(--text); font-size: 18px; cursor: pointer; }
.biblio-reader-body { flex: 1; overflow: auto; }
.biblio-reader-body pre { white-space: pre-wrap; word-wrap: break-word; padding: 18px; font: 16px/1.6 var(--font); margin: 0; }
.biblio-reader-body iframe, .biblio-reader-body object { width: 100%; height: 100%; border: 0; }
