:root {
  --bg-dark: #070b15;
  --bg-card: rgba(10, 16, 32, 0.92);
  --text: #e8eeff;
  --muted: #aab6db;
  --line: rgba(122, 162, 255, 0.25);
  --blue: #2563eb;
  --red: #dc2626;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  color: var(--text);
  background-color: var(--bg-dark);
}

.page-home {
  background-image: linear-gradient(150deg, rgba(4, 8, 18, 0.82), rgba(10, 4, 16, 0.82)), url('assets/panel-principal.jpg');
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
}

.page-catalog {
  background-image: linear-gradient(150deg, rgba(4, 8, 18, 0.82), rgba(10, 4, 16, 0.82)), url('assets/catalogo.jpg');
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
}

.top-bar {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  justify-content: flex-end;
  padding: 0.75rem 1rem;
  backdrop-filter: blur(8px);
  background: rgba(7, 11, 21, 0.72);
  border-bottom: 1px solid var(--line);
}

.btn-catalog {
  text-decoration: none;
  color: #fff;
  font-weight: 700;
  font-size: 0.95rem;
  padding: 0.55rem 0.95rem;
  border-radius: 0.7rem;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: linear-gradient(90deg, var(--blue), var(--red));
}

.btn-catalog:hover { filter: brightness(1.08); }

.home-layout,
.catalog-layout {
  max-width: 1240px;
  margin: 0 auto;
  padding: 1rem;
}

.hero-card {
  max-width: 980px;
  margin: 0 auto 1rem;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 1rem;
  padding: 1.1rem;
  text-align: center;
  box-shadow: 0 18px 36px rgba(0, 0, 0, 0.35);
}

.hero-card h1 { margin: 0.3rem 0; font-size: clamp(1.4rem, 3vw, 2rem); }
.hero-card p { margin: 0.2rem 0; color: var(--muted); }
.kicker {
  display: inline-block;
  margin: 0;
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  font-size: 0.75rem;
  border: 1px solid rgba(220, 38, 38, 0.6);
  background: rgba(220, 38, 38, 0.2);
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  margin-bottom: 0.75rem;
}

.section-head h2 { margin: 0; }
.section-head span { color: var(--muted); }

.filters {
  display: grid;
  grid-template-columns: 1fr 240px;
  gap: 0.65rem;
  margin-bottom: 0.75rem;
}

input, select {
  width: 100%;
  padding: 0.7rem 0.85rem;
  border-radius: 0.7rem;
  border: 1px solid rgba(96, 165, 250, 0.48);
  background: rgba(7, 12, 24, 0.94);
  color: var(--text);
}

.books-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  justify-items: center;
  gap: 1rem;
}

.book-card {
  width: 100%;
  max-width: 260px;
  background: rgba(8, 13, 27, 0.95);
  border: 1px solid var(--line);
  border-radius: 0.95rem;
  overflow: hidden;
  display: grid;
  grid-template-rows: 170px 1fr;
}

.book-cover {
  width: 100%;
  height: 170px;
  object-fit: cover;
  display: block;
  background: #0d1429;
}

.book-info { padding: 0.85rem; }
.book-info h3 { margin: 0 0 0.45rem; }
.book-info p { margin: 0.35rem 0; line-height: 1.35; color: #dce5ff; }
.book-genre {
  display: inline-block;
  margin-bottom: 0.45rem;
  font-size: 0.75rem;
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
  background: rgba(37, 99, 235, 0.28);
  border: 1px solid rgba(96, 165, 250, 0.35);
}

.btn-read {
  margin-top: 0.4rem;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  text-decoration: none;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(90deg, #b91c1c, #ef4444);
  padding: 0.62rem;
  border-radius: 0.7rem;
}

.comments-section {
  margin-top: 1rem;
}

.comments-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.8rem;
}

.comment-card {
  background: rgba(8, 13, 27, 0.95);
  border: 1px solid var(--line);
  border-radius: 0.85rem;
  padding: 0.85rem;
}

.comment-card p { margin: 0 0 0.5rem; color: #dce5ff; }
.comment-card span { color: var(--muted); font-size: 0.9rem; }

.results { color: var(--muted); }

.site-footer {
  text-align: center;
  padding: 1.15rem 0.8rem 1.4rem;
  color: #d4defc;
  font-weight: 600;
  letter-spacing: 0.4px;
}

.page-reader {
  min-height: 100vh;
  background: #080d18;
  display: grid;
  grid-template-rows: auto 1fr;
}

.reader-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  padding: 0.6rem 0.9rem;
  border-bottom: 1px solid var(--line);
  background: rgba(8, 13, 27, 0.95);
}

.reader-bar h1 { margin: 0; font-size: 1rem; }
.reader-main { min-height: 0; }
#pdf-frame {
  width: 100%;
  height: calc(100vh - 62px);
  border: 0;
  display: block;
  background: #0a1222;
}

@media (max-width: 760px) {
  .filters { grid-template-columns: 1fr; }
  .book-card { max-width: 100%; grid-template-rows: 165px 1fr; }
  .book-cover { height: 165px; }
  .reader-bar h1 { font-size: 0.9rem; }
  #pdf-frame { height: calc(100vh - 58px); }
}