body {
  margin: 0;
  font-family: 'Segoe UI', sans-serif;
  background: url('fondo-libros.jpg') no-repeat center center fixed;
  background-size: cover;
  color: #fff;
}

header {
  text-align: center;
  padding: 2rem;
  background: rgba(0, 0, 0, 0.6);
}

.hero {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0 1rem;
}

.hero-logo {
  max-width: 96px;
  width: 12%;
  min-width: 64px;
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.4));
}

.hero-center {
  flex: 1 1 60%;
  text-align: center;
  color: #fff;
}

.hero-center h1 {
  margin: 0 0 0.25rem 0;
  font-size: 2.4rem;       /* tamaño mayor */
  line-height: 1.05;
  font-weight: 700;        /* más grueso */
  letter-spacing: -0.5px;
  color: #fff;
}

.hero-desc {
  margin: 0 0 0.6rem 0;
  font-size: 0.95rem;
  opacity: 0.95;
}

/* Ajuste del formulario dentro del hero */
.hero-form input,
.hero-form select,
.hero-form button {
  padding: 0.45rem 0.6rem;
  margin: 0 0.25rem;
  border-radius: 6px;
  border: none;
  font-size: 0.95rem;
}

.hero-form input {
  width: 36%;
  max-width: 320px;
}

.hero-form select {
  width: 110px;
}

.hero-form button {
  background-color: #ff6f61;
  color: #fff;
  cursor: pointer;
}

/* Responsive: apilar logos y centrar en pantallas pequeñas */
@media (max-width: 760px) {
  .hero {
    flex-direction: column;
    gap: 0.5rem;
    text-align: center;
  }
  .hero-logo {
    width: 18%;
    max-width: 90px;
  }
  .hero-form input { width: 60%; max-width: 240px; }
  .hero-center h1 {
    font-size: 1.6rem;     /* tamaño más pequeño en móviles */
  }
}

form {
  margin-top: 1rem;
}

form input, form select, form button {
  padding: 0.5rem;
  margin: 0.2rem;
  border-radius: 5px;
  border: none;
}

form button {
  background-color: #ff6f61;
  color: white;
  cursor: pointer;
}

main {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  padding: 1rem;
}

/* 
.card {
  background: rgba(255, 255, 255, 0.9);
  color: #333;
  border-radius: 10px;
  overflow: hidden;
  text-align: center;
  transition: transform 0.3s;
}

.card:hover {
  transform: scale(1.05);
}

.card img {
  width: 100%;
  height: 300px;
  object-fit: cover;
} */

/* ...existing code... */
#contenedor-libros {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 250px)); /* ancho mínimo por caja */
  gap: 36px;                  /* más espacio entre cards */
  align-items: start;
  padding: 24px;
  justify-items: center;      /* centra cada card dentro de su celda */
  justify-content: center;    /* centra la grid cuando no ocupa todo el ancho */
}

.card {
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  width: auto; 
  /* width: 100% !important; */
  max-width: 300px !important;           /* reduce el ancho máximo de la caja */
  height: 420px;                     /* altura fija para uniformidad */
  padding: 8px;
  background: #fff;
  color: #222;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  text-align: center;
  font-size: 0.82rem;         /* texto más pequeño */
  line-height: 1.1;
  overflow: hidden;
  margin: 0;                 /* auto;*/
}

.card img {
  display: block;
  width: 100% !important;
  height: 300px !important;              /* controla la altura del cover */
  object-fit: cover;
  border-radius: 4px;
  margin-bottom: 8px;
}

.card h3 {
  font-size: 0.85rem;
  margin: 6px 0;
  color: #111; 
  white-space: normal;                /*nowrap;*/
  overflow: hidden;
  text-overflow: ellipsis;
}

.card p {
  font-size: 0.72rem;
  margin: 0;
  color: #666;
}

/* Ajustes responsive: cajas aún más pequeñas en pantallas pequeñas */
@media (max-width: 480px) {
  #contenedor-libros { gap: 18px; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); }
  .card { max-width: 110px; padding: 6px; }
  .card img { height: 120px; }
  .card h3 { font-size: 0.78rem; }
}
/* ...existing code... */

footer {
  text-align: center;
  font-size: 0.6rem;
  padding: 1rem;
  background: rgba(0, 0, 0, 0.6);
}
