/* styles.css */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  height: 100%;
  font-family: 'Segoe UI', sans-serif;
  background: #fff8e7; /* ← nuevo color crema */
  color: #333;
  padding-top: 70px; /* ← espacio superior fijo para en main */
  padding-bottom: 80px; /* ← espacio para el footer fijo */
}

header {
  background: 
    linear-gradient(to bottom, rgba(0,0,0,0.5), rgba(0,0,0,0.7)),
    url('https://images.unsplash.com/photo-1512820790803-83ca734da794?auto=compress&cs=tinysrgb&h=600');
  background-size: cover;
  background-position: center;
  color: white;
  padding: 2rem;
  text-align: center;
  box-shadow: 0 4px 6px rgba(0,0,0,0.1);

  /* NUEVO: fijar arriba */
  position: fixed;
  top: 0;
  width: 100%;
  z-index: 1000;
}

footer {
  background: #333;
  color: white;
  text-align: center;
  padding: 1rem;
  box-shadow: 0 -4px 6px rgba(0,0,0,0.1);
  bottom: 0;
  width: 100%;
  z-index: 1000;
}

h1 {
  font-size: 3rem;
}

p {
  font-size: 1.2rem;
  margin-top: 0.5rem;
}

.galeria {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); /* columnas flexibles */
  gap: 1rem;
  padding: 2rem;
  flex: 1;
}

.galeria img {
  width: 100%;       /* que ocupe todo el ancho del contenedor */
  height: auto;      /* altura automática para mantener proporción */
  max-width: 200px;  /* opcional, para no crecer demasiado en pantallas grandes */
  object-fit: contain;
  background: #fff;
  padding: 0.5rem;
  border-radius: 10px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.1);
  transition: transform 0.3s ease;
}

.galeria img:hover {
  transform: scale(1.05);
}

.galeria p {
  background: rgba(255, 255, 255, 0.8);
  padding: 0.5rem 1rem;
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
  max-width: 90%;
}

.galeria p:hover {
  background: rgba(255, 255, 255, 1);
  box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.icono-h1 {
  width: 32px;
  height: 32px;
  vertical-align: middle;
  margin-right: 0.5rem;
}

header {
  position: fixed; /* ← ya aplicado arriba */
}

.favicon-header {
  position: absolute;
  top: 1rem;
  left: 1rem;
  display: flex;
  align-items: center;
  font-size: 1.5rem;
  color: white;
}

.favicon-img {
  width: 32px;
  height: 32px;
  margin-right: 0.5rem;
}

a:hover h2 {
  text-decoration: none;
  color: inherit;
}

.campo-busqueda {
  padding: 0.5rem;
  font-size: 1rem;
  border-radius: 5px;
  border: none;
  width: 250px;
}

.btn-buscar {
  padding: 0.5rem 1rem;
  margin-left: 0.5rem;
  border: none;
  border-radius: 5px;
  background: #333;
  color: white;
  font-size: 1rem;
  cursor: pointer;
  transition: background 0.3s ease;
}

.btn-buscar:hover {
  background: #555;
}

.btn-detalles {
  padding: 0.5rem 1rem;
  margin-left: 0.5rem;
  border: none;
  border-radius: 5px;
  background: orange;
  color: black;
  font-size: 1rem;
  cursor: pointer;
  transition: background 0.3s ease;
}

.btn-detalles:hover {
  background: darkorange;
}

.modal {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0,0,0,0.5);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000;
}

.modal-contenido {
  background: white;
  padding: 2rem;
  border-radius: 10px;
  text-align: center;
}

.modal-contenido input {
  display: block;
  width: 100%;
  margin: 0.5rem 0;
  padding: 0.5rem;
}

.botones button {
  margin: 0.5rem;
}

.paginacion-top {
  display: flex;
  justify-content: center; /* Centra horizontalmente */
  align-items: center;
  margin: 1rem 2rem 0.5rem 2rem;
  gap: 1rem; /* Opcional: añade espacio entre botones */
}

.galeria-libros {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem;
  margin: 0 auto;
  /*max-width: 1200px;*/
  padding: 0 1rem;
}

/* Elimina el espacio extra superior entre el header y la galería */
main, .contenido-principal {
  margin-top: 0.5rem !important;
  padding-top: 0 !important;
}

button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}
