/* ============================================================
   Sección "Libros Impresos" (clientes) — estilo imprentadelibros.com.ar
   Tapa 3D portada de components/ui/book-mockup2.tsx (Next.js)
   ============================================================ */

.libros-impresos {
  font-family: 'Geist', 'Raleway', Arial, sans-serif;
}

/* --- Buscador --- */
.libros-buscador {
  display: flex;
  gap: 10px;
  margin: 6px 0 26px;
  max-width: 540px;
}
.libros-buscador input[type="search"] {
  flex: 1;
  padding: 11px 16px;
  border: 1px solid #dcdcdc;
  border-radius: 8px;
  font-size: 14px;
  background: #fff;
  color: #333;
}
.libros-buscador input[type="search"]:focus {
  outline: none;
  border-color: #006064;
  box-shadow: 0 0 0 3px rgba(0, 96, 100, 0.12);
}
.libros-buscador button {
  padding: 11px 22px;
  border: 0;
  border-radius: 8px;
  background: #006064;
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background .2s ease;
}
.libros-buscador button:hover {
  background: #004d52;
}
.libros-contador {
  font-size: 13px;
  color: #858585;
  margin-bottom: 22px;
}
.libros-vacio {
  padding: 60px 0;
  text-align: center;
  color: #888;
  font-size: 15px;
}

/* --- Grilla --- */
.libros-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 32px 24px;
}
@media (max-width: 1199px) { .libros-grid { grid-template-columns: repeat(4, 1fr); } }
@media (max-width: 991px)  { .libros-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 767px)  { .libros-grid { grid-template-columns: repeat(2, 1fr); gap: 24px 14px; } }

/* --- Card --- */
.libro-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 0;
  padding: 8px 8px 12px;
}
.libro-card-link {
  display: block;
  width: 100%;
  text-decoration: none;
  color: inherit;
  text-align: center;
}
.libro-card-link:hover,
.libro-card-link:focus {
  text-decoration: none;
  color: inherit;
}

/* --- Tapa 3D --- */
.libro-3d-wrap {
  perspective: 800px;
  display: flex;
  justify-content: center;
  padding: 12px 0 10px;
}
.libro-3d {
  position: relative;
  width: 150px;
  height: 200px;
  transform-style: preserve-3d;
  transform: rotateY(-30deg);
  transition: transform 1s ease;
}
.libro-card-link:hover .libro-3d,
.libro-card-link:focus .libro-3d {
  transform: rotateY(-38deg) scale(1.07);
}
.libro-3d-frente {
  position: absolute;
  inset: 0;
  overflow: hidden;
  border-radius: 2px;
  transform: translateZ(21px);
  box-shadow: 3px 3px 10px #bbbbbb;
  background: #808080;
}
.libro-3d-frente img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: fill;
}
.libro-3d-brillo {
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  min-width: 8.2%;
  pointer-events: none;
  opacity: 0.2;
  background:
    linear-gradient(90deg, hsla(0, 0%, 100%, 0), hsla(0, 0%, 100%, 0) 12%, hsla(0, 0%, 100%, .25) 29.25%, hsla(0, 0%, 100%, 0) 50.5%, hsla(0, 0%, 100%, 0) 75.25%, hsla(0, 0%, 100%, .25) 91%, hsla(0, 0%, 100%, 0)),
    linear-gradient(90deg, rgba(0, 0, 0, .03), rgba(0, 0, 0, .1) 12%, transparent 30%, rgba(0, 0, 0, .02) 50%, rgba(0, 0, 0, .2) 73.5%, rgba(0, 0, 0, .5) 75.25%, rgba(0, 0, 0, .15) 85.25%, transparent);
}
.libro-3d-lomo {
  position: absolute;
  left: 0;
  top: 3px;
  bottom: 3px;
  width: 29px;
  transform: translateX(135px) translateZ(6px) rotateY(90deg);
  background: linear-gradient(rgba(0, 0, 0, 0.22), rgba(0, 0, 0, 0.22)), url('/lomo.jpg') center center / cover no-repeat #e6e3da;
}
.libro-3d-contra {
  position: absolute;
  inset: 0;
  border-radius: 2px;
  transform: translateZ(-12.5px);
  box-shadow: -5px 0 24px 5px #bbbbbb;
  background: linear-gradient(to top right, #737373, #8c8c8c);
}

/* --- Placeholder (libro sin tapa) --- */
.libro-3d-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 16px 14px;
  background: linear-gradient(135deg, #0b3e4a 0%, #11535f 100%);
  color: #fff;
}
.libro-3d-placeholder .fa {
  font-size: 26px;
  opacity: 0.75;
  margin-bottom: 12px;
}
.libro-3d-ph-titulo {
  font-size: 12px;
  line-height: 1.35;
  font-weight: 600;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-word;
}
.libro-3d-ph-autor {
  margin-top: 8px;
  font-size: 10.5px;
  line-height: 1.3;
  opacity: 0.78;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-word;
}

/* --- Info de la card --- */
.libro-card-info {
  text-align: center;
  padding: 0 6px;
  width: 100%;
}
.libro-card-titulo {
  font-size: 14px;
  font-weight: 600;
  color: #222;
  margin: 4px 0 3px;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.libro-card-autor {
  font-size: 12.5px;
  color: #6f6f6f;
  margin: 0 0 8px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.libro-card-genero {
  display: inline-block;
  font-size: 10px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #006064;
  border: 1px solid rgba(0, 96, 100, 0.3);
  border-radius: 20px;
  padding: 2px 10px 1px;
  margin-bottom: 6px;
}

/* --- Flotación suave (como imprentadelibros) --- */
@media (prefers-reduced-motion: no-preference) {
  .libros-impresos .libro-3d-wrap {
    animation: libro-float 3.4s ease-in-out infinite;
  }
  .libros-impresos .libro-card:nth-child(2n) .libro-3d-wrap { animation-delay: .7s; }
  .libros-impresos .libro-card:nth-child(3n) .libro-3d-wrap { animation-delay: 1.3s; }
  .libros-impresos .libro-card:hover .libro-3d-wrap { animation-play-state: paused; }
}
@keyframes libro-float {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-5px); }
}

/* --- Paginación --- */
.libros-impresos .pagination {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px;
  margin: 40px 0 10px;
  padding: 0;
}
.libros-impresos .pagination .page-link,
.libros-impresos .pagination li > span,
.libros-impresos .pagination li > a {
  display: block;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  padding: 8px 14px;
  color: #006064;
  font-size: 13px;
  text-decoration: none;
  background: #fff;
}
.libros-impresos .pagination .active .page-link,
.libros-impresos .pagination li.active > span {
  background: #006064;
  border-color: #006064;
  color: #fff;
}
.libros-impresos .pagination .disabled .page-link,
.libros-impresos .pagination li.disabled > span {
  color: #bbb;
  background: #fafafa;
}

/* ============================================================
   Detalle del libro
   ============================================================ */
.libro-detalle {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 48px;
  align-items: start;
}
@media (max-width: 767px) {
  .libro-detalle { grid-template-columns: 1fr; gap: 10px; }
}
.libro-detalle-tapa .libro-3d-wrap { padding: 26px 0; }
.libro-detalle-tapa .libro-3d {
  width: 220px;
  height: 293px;
}
.libro-detalle-tapa .libro-3d-lomo {
  transform: translateX(202px) translateZ(7.5px) rotateY(90deg);
}
.libro-detalle h2.libro-titulo {
  font-size: 26px;
  font-weight: 600;
  color: #1d1d1d;
  margin: 6px 0 6px;
  line-height: 1.25;
}
.libro-detalle .libro-autor {
  font-size: 15px;
  color: #666;
  margin-bottom: 14px;
}
.libro-detalle .libro-genero-chip {
  display: inline-block;
  font-size: 11px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #006064;
  border: 1px solid rgba(0, 96, 100, 0.3);
  border-radius: 20px;
  padding: 3px 12px 2px;
  margin-bottom: 18px;
}
.libro-detalle .libro-resumen {
  font-size: 15px;
  line-height: 1.8;
  color: #4a4a4a;
  margin-bottom: 22px;
}
.libro-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
}
.libro-tags .tag {
  font-size: 12px;
  color: #555;
  background: #f2f2f2;
  border-radius: 20px;
  padding: 4px 12px;
}
.libro-faq {
  margin-top: 10px;
  border-top: 1px solid #ececec;
  padding-top: 18px;
}
.libro-faq h3 {
  font-size: 15px;
  font-weight: 600;
  color: #2f2f2f;
  margin: 16px 0 6px;
}
.libro-faq p {
  font-size: 14px;
  line-height: 1.7;
  color: #666;
  margin: 0;
}
