/* ===== Reset ===== */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: "Poppins", sans-serif;
  background: #0f172a;
  color: #e5e7eb;
  line-height: 1.5;
}

/* ===== Header ===== */
.header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px;
  background: rgba(15, 23, 42, 0.9);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(148, 163, 184, 0.2);
}

.logo {
  font-weight: 700;
  font-size: 1.1rem;
}

.nav {
  display: flex;
  gap: 16px;
}

.nav a {
  text-decoration: none;
  color: #cbd5f5;
  font-size: 0.95rem;
}

.nav a:hover {
  color: #facc15;
}

/* ===== Main ===== */
main {
  max-width: 1120px;
  margin: 0 auto;
  padding: 24px 16px 40px;
}

/* ===== Hero ===== */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
  gap: 24px;
  align-items: center;
  padding: 32px 20px;
  margin-top: 12px;
  border-radius: 24px;
  background: radial-gradient(circle at top left, #1d4ed8, #0f172a);
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.7);
}

.hero-texto h1 {
  font-size: 2rem;
  margin-bottom: 10px;
}

.hero-texto p {
  font-size: 0.98rem;
  max-width: 480px;
  margin-bottom: 18px;
  color: #e5e7eb;
}

.hero-card {
  background: rgba(15, 23, 42, 0.9);
  border-radius: 20px;
  padding: 18px 20px;
  border: 1px solid rgba(148, 163, 184, 0.4);
}

.hero-card img {
  width: 100%;
  border-radius: 16px;
}

.precio {
  font-weight: 700;
  color: #facc15;
  font-size: 1rem;
}

/* ===== Botones ===== */
.btn-primario,
.btn-secundario,
.btn-buy {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 9px 16px;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 500;
  transition: 0.15s ease;
}

.btn-primario {
  background: #facc15;
  color: #111827;
}

.btn-primario:hover {
  transform: translateY(-1px);
}

.btn-secundario,
.btn-buy {
  background: transparent;
  color: #facc15;
  border: 1px solid rgba(250, 204, 21, 0.7);
}

.btn-secundario:hover,
.btn-buy:hover {
  background: #facc15;
  color: #111827;
}

/* ===== Catálogo ===== */
.grid-libros {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 18px;
}

.libro-card {
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(148, 163, 184, 0.4);
  border-radius: 18px;
  padding: 16px;
  display: grid;
  grid-template-columns: 100px 1fr;
  gap: 16px;
}

.libro-portada img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 14px;
  box-shadow: 0 5px 18px rgba(0,0,0,0.3);
}

.libro-info h3 {
  font-size: 1rem;
  margin-bottom: 4px;
}

.autor {
  font-size: 0.78rem;
  color: #9ca3af;
  margin-bottom: 6px;
}

.descripcion {
  font-size: 0.86rem;
  color: #e5e7eb;
  margin-bottom: 8px;
}

/* ===== Modal ===== */
.modal-libros {
  position: fixed;
  inset: 0;
  background: rgba(15,23,42,0.8);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 1000;
}

.modal-libros.activo {
  display: flex;
}

.modal-libros-content {
  width: 100%;
  max-width: 420px;
  background: #020617;
  border-radius: 18px;
  padding: 22px;
  border: 1px solid rgba(148,163,184,0.5);
  position: relative;
}

.modal-libros-close {
  position: absolute;
  right: 12px;
  top: 12px;
  cursor: pointer;
  color: #9ca3af;
  font-size: 20px;
}

#pagoLibroQR img {
  width: 250px;
  display: block;
  margin: 10px auto;
}

/* ===== Footer ===== */
.footer {
  text-align: center;
  margin-top: 35px;
  padding-bottom: 20px;
  color: #9ca3af;
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
  .hero {
    grid-template-columns: 1fr;
  }
}
