/* ===== Biblioteca Preventiva — extiende los tokens de styles.css ===== */

.bib-hero {
  background: linear-gradient(160deg, var(--navy-950) 0%, var(--navy-800) 100%);
  color: var(--white);
  padding: 76px 0 64px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.bib-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle at 85% 20%, rgba(201,162,39,0.18), transparent 45%),
                     radial-gradient(circle at 10% 90%, rgba(201,162,39,0.10), transparent 40%);
}
.bib-hero .container { position: relative; }
.bib-hero .breadcrumb { justify-content: center; display: flex; }
.bib-hero h1 { color: var(--white); font-size: clamp(2rem, 3.6vw, 2.9rem); margin-bottom: 16px; }
.bib-hero p.lead { color: rgba(255,255,255,0.8); max-width: 56ch; margin: 0 auto 36px; font-size: 1.05rem; }

.bib-search {
  max-width: 620px;
  margin: 0 auto;
  display: flex;
  gap: 10px;
  background: rgba(255,255,255,0.08);
  border: 1.5px solid rgba(255,255,255,0.18);
  border-radius: 999px;
  padding: 8px 8px 8px 22px;
  backdrop-filter: blur(6px);
}
.bib-search input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--white);
  font-family: inherit;
  font-size: 0.98rem;
}
.bib-search input::placeholder { color: rgba(255,255,255,0.55); }
.bib-search button {
  background: var(--gold-500);
  color: var(--navy-950);
  border: none;
  border-radius: 999px;
  padding: 12px 24px;
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  transition: background 0.2s ease;
}
.bib-search button:hover { background: var(--gold-400); }

.bib-stats {
  display: flex;
  gap: 32px;
  justify-content: center;
  margin-top: 34px;
  flex-wrap: wrap;
}
.bib-stats div { text-align: center; }
.bib-stats strong { display: block; font-family: 'Playfair Display', serif; font-size: 1.6rem; color: var(--gold-400); }
.bib-stats span { font-size: 0.78rem; color: rgba(255,255,255,0.6); letter-spacing: 0.04em; text-transform: uppercase; }

/* Category chips */
.bib-categorias {
  padding: 40px 0 8px;
}
.bib-chip-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
}
.bib-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 999px;
  border: 1.5px solid var(--gray-300);
  background: var(--white);
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--navy-800);
  cursor: pointer;
  transition: all 0.18s ease;
}
.bib-chip:hover { border-color: var(--gold-500); }
.bib-chip.active { background: var(--navy-950); border-color: var(--navy-950); color: var(--white); }

/* Section headers with emoji */
.bib-section { padding: 52px 0; }
.bib-section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 28px;
  flex-wrap: wrap;
  gap: 10px;
}
.bib-section-head h2 { font-size: 1.5rem; display: flex; align-items: center; gap: 10px; }
.bib-section-head .bib-count { font-size: 0.85rem; color: var(--gray-600); font-family: 'Inter', sans-serif; font-weight: 600; }

/* Doc grid + cards */
.bib-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
}
.bib-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 26px;
  box-shadow: var(--shadow-card);
  border-top: 3px solid var(--gold-500);
  display: flex;
  flex-direction: column;
  transition: transform 0.22s ease, box-shadow 0.22s ease;
  position: relative;
}
.bib-card:hover { transform: translateY(-5px); box-shadow: 0 18px 40px -16px rgba(15,36,64,0.28); }
.bib-card-top { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 16px; }
.bib-card-icon {
  width: 46px; height: 46px; border-radius: 12px;
  background: var(--navy-950); color: var(--gold-400);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.3rem;
}
.bib-badges { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.bib-badge {
  font-size: 0.66rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase;
  padding: 4px 9px; border-radius: 999px;
}
.bib-badge--nuevo { background: rgba(30,122,63,0.12); color: #1e7a3f; }
.bib-badge--top { background: rgba(201,162,39,0.16); color: #96781a; }
.bib-badge--reco { background: rgba(30,66,102,0.10); color: var(--navy-700); }
.bib-card h3 { font-size: 1.08rem; margin-bottom: 8px; line-height: 1.3; }
.bib-card p.bib-card-desc { color: var(--gray-600); font-size: 0.88rem; margin-bottom: 20px; flex-grow: 1; }
.bib-card-meta { font-size: 0.72rem; color: var(--gray-600); margin-bottom: 16px; text-transform: uppercase; letter-spacing: 0.03em; }
.bib-card-actions { display: flex; gap: 10px; }
.bib-card-actions .btn { flex: 1; justify-content: center; padding: 11px 14px; font-size: 0.85rem; }

.bib-empty { text-align: center; padding: 60px 20px; color: var(--gray-600); }
.bib-empty strong { display: block; font-size: 1.1rem; color: var(--navy-900); margin-bottom: 8px; }

/* Kit card */
.bib-kit {
  background: linear-gradient(135deg, var(--navy-900), var(--navy-700));
  border-radius: 20px;
  padding: 40px;
  color: var(--white);
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 30px;
  align-items: center;
}
.bib-kit h3 { color: var(--white); font-size: 1.5rem; margin-bottom: 10px; }
.bib-kit p { color: rgba(255,255,255,0.78); margin-bottom: 20px; }
.bib-kit-list { display: flex; flex-direction: column; gap: 8px; }
.bib-kit-list span {
  display: flex; align-items: center; gap: 10px;
  background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.14);
  border-radius: 10px; padding: 10px 14px; font-size: 0.88rem;
}

/* Disclaimer bar */
.bib-disclaimer {
  background: var(--cream-100);
  border-top: 1px solid rgba(15,36,64,0.08);
  padding: 22px 0;
  font-size: 0.78rem;
  color: var(--gray-600);
  text-align: center;
}
.bib-disclaimer .container { max-width: 900px; }

/* ===== Modal ===== */
.bib-modal-overlay {
  position: fixed; inset: 0; background: rgba(8,20,31,0.6);
  display: none; align-items: center; justify-content: center;
  padding: 24px; z-index: 500;
}
.bib-modal-overlay.open { display: flex; }
.bib-modal {
  background: var(--white); border-radius: 18px;
  max-width: 720px; width: 100%; max-height: 88vh; overflow-y: auto;
  box-shadow: var(--shadow-soft);
  position: relative;
}
.bib-modal-close {
  position: absolute; top: 16px; right: 16px;
  width: 34px; height: 34px; border-radius: 50%;
  border: none; background: var(--cream-100); cursor: pointer;
  font-size: 1.1rem; color: var(--navy-800);
}
.bib-modal-body { padding: 40px; }
.bib-modal-body h3 { margin-bottom: 6px; }
.bib-modal-sub { color: var(--gray-600); font-size: 0.9rem; margin-bottom: 26px; }

/* Preview modal specifics */
.bib-preview-frame {
  position: relative;
  border: 1px solid var(--gray-300);
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
}
.bib-preview-frame::after {
  content: 'VISTA PREVIA';
  position: absolute; top: 50%; left: 50%;
  transform: translate(-50%,-50%) rotate(-28deg);
  font-size: 3rem; font-weight: 800; letter-spacing: 0.05em;
  color: rgba(15,36,64,0.08); pointer-events: none; white-space: nowrap;
}
.bib-preview-scroll { max-height: 50vh; overflow: hidden; padding: 18px; pointer-events: none; user-select: none; }
.bib-preview-scale { transform: scale(0.82); transform-origin: top left; }
.bib-montaje { max-height: 50vh; overflow: auto; border: 1px solid var(--gray-300); border-radius: 10px; }

/* Personalize form */
.bib-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.bib-form-field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.bib-form-field.full { grid-column: 1 / -1; }
.bib-form-field label { font-size: 0.82rem; font-weight: 600; color: var(--navy-800); }
.bib-form-field input, .bib-form-field select {
  font-family: inherit; padding: 11px 14px; border: 1.5px solid var(--gray-300);
  border-radius: 9px; font-size: 0.92rem; color: var(--navy-950); background: var(--cream-50);
}
.bib-form-field input:focus { outline: none; border-color: var(--gold-500); }
.bib-logo-drop {
  display: flex; align-items: center; gap: 14px;
  border: 1.5px dashed var(--gray-300); border-radius: 10px; padding: 12px 14px; cursor: pointer;
}
.bib-logo-drop img { width: 44px; height: 44px; object-fit: contain; border-radius: 8px; background: var(--cream-100); }
.bib-logo-drop span { font-size: 0.85rem; color: var(--gray-600); }
.bib-remember { display: flex; align-items: center; gap: 8px; font-size: 0.82rem; color: var(--gray-600); margin: 4px 0 18px; }
.bib-form-actions { display: flex; gap: 12px; margin-top: 8px; }
.bib-saved-profile {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  background: var(--cream-100); border-radius: 12px; padding: 18px 20px; margin-bottom: 22px;
}
.bib-saved-profile div strong { display: block; }
.bib-saved-profile div span { font-size: 0.82rem; color: var(--gray-600); }
.bib-saved-profile button { background: none; border: none; color: var(--navy-700); font-weight: 600; font-size: 0.82rem; cursor: pointer; text-decoration: underline; }
.bib-perfil-oculto { display: none; }

/* Post-download CTA */
.bib-postdownload { text-align: center; padding: 8px 4px 4px; }
.bib-postdownload .icon-ok {
  width: 56px; height: 56px; border-radius: 50%; background: rgba(30,122,63,0.12); color: #1e7a3f;
  display: flex; align-items: center; justify-content: center; font-size: 1.6rem; margin: 0 auto 18px;
}
.bib-postdownload h3 { margin-bottom: 8px; }
.bib-postdownload p { color: var(--gray-600); margin-bottom: 24px; max-width: 44ch; margin-left: auto; margin-right: auto; }
.bib-cta-box {
  background: var(--cream-100); border-radius: 14px; padding: 24px; margin-top: 18px; text-align: left;
}
.bib-cta-box p { color: var(--navy-800); font-size: 0.92rem; margin-bottom: 16px; max-width: none; }
.bib-cta-box .cta-actions { justify-content: flex-start; }

/* ===== Documento sheet (usado en preview y export a PDF) ===== */
.doc-sheet {
  background: #fff; color: #16324f; font-family: 'Inter', sans-serif;
  padding: 36px; width: 780px; box-sizing: border-box;
}
.doc-sheet-header { display: flex; align-items: center; gap: 18px; border-bottom: 3px solid #c9a227; padding-bottom: 18px; margin-bottom: 20px; }
.doc-sheet-logo img { height: 56px; max-width: 120px; object-fit: contain; }
.doc-sheet-logo:empty::before,
.doc-sheet-logo img:not([src]) { content: ''; }
.doc-sheet-eyebrow { font-size: 0.68rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: #c9a227; display: block; margin-bottom: 4px; }
.doc-sheet-title h2 { font-family: 'Playfair Display', serif; font-size: 1.35rem; color: #08141f; margin: 0; }
.doc-sheet-meta { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px 20px; margin-bottom: 20px; padding: 16px 18px; background: #faf8f3; border-radius: 10px; }
.doc-sheet-meta div strong { display: block; font-size: 0.66rem; text-transform: uppercase; letter-spacing: 0.04em; color: #5a6472; margin-bottom: 2px; }
.doc-sheet-meta div span { font-size: 0.88rem; font-weight: 600; color: #0f2440; }
.doc-sheet-intro { font-size: 0.86rem; color: #16324f; margin-bottom: 16px; }
.doc-sheet-table { width: 100%; border-collapse: collapse; margin-bottom: 20px; font-size: 0.78rem; }
.doc-sheet-table th, .doc-sheet-table td { border: 1px solid #d7dbe0; padding: 8px 10px; text-align: left; }
.doc-sheet-table th { background: #0f2440; color: #fff; font-weight: 600; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.02em; }
.doc-sheet-table tbody tr:nth-child(even) { background: #faf8f3; }
.doc-sheet-table--check td { text-align: center; }
.doc-sheet-table--check td:first-child { text-align: left; }
.doc-sheet-notes { font-size: 0.8rem; color: #16324f; margin-bottom: 20px; }
.doc-sheet-notes ul { padding-left: 18px; list-style: disc; margin-top: 8px; }
.doc-sheet-notes li { margin-bottom: 6px; }
.doc-sheet-fields { display: flex; flex-direction: column; gap: 12px; margin-bottom: 20px; }
.doc-sheet-fields strong { display: block; font-size: 0.76rem; color: #5a6472; margin-bottom: 4px; }
.doc-sheet-blank { border: 1px solid #d7dbe0; border-radius: 6px; min-height: 30px; background: #faf8f3; }
.doc-sheet-blank--tall { min-height: 60px; }
.doc-sheet-section { margin-bottom: 22px; }
.doc-sheet-section h3 { font-size: 0.95rem; color: #08141f; margin-bottom: 10px; font-family: 'Playfair Display', serif; }
.doc-sheet-hint { font-size: 0.76rem; color: #5a6472; margin-bottom: 8px; font-style: italic; }
.doc-sheet-signatures { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; margin-top: 40px; margin-bottom: 20px; }
.doc-sheet-signatures div { border-top: 1px solid #16324f; padding-top: 8px; text-align: center; font-size: 0.76rem; color: #5a6472; }
.doc-sheet-footer { text-align: center; font-size: 0.68rem; color: #5a6472; border-top: 1px solid #d7dbe0; padding-top: 12px; }

@media (max-width: 960px) {
  .bib-kit { grid-template-columns: 1fr; }
  .bib-form-grid { grid-template-columns: 1fr; }
  .doc-sheet { width: 100%; }
}
