/* Сетка книг */
/*.book-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 16px;
  padding: 16px;
}

.book {
  cursor: pointer;
  text-align: center;
}

.book img {
  width: 100%;
  height: auto;
  border-radius: 4px;
  transition: transform 0.2s;
}

.book img:hover {
  transform: scale(1.05);
}

.book-title {
  margin-top: 8px;
  font-size: 14px;
}*/

/* Модальное окно */
/*.modal {
  display: none; 
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0,0,0,0.8); 
  justify-content: center;
  align-items: center;
}

.modal-content {
  max-width: 90%;
  max-height: 90%;
  border-radius: 4px;
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 24px;
  color: #fff;
  font-size: 36px;
  font-weight: bold;
  cursor: pointer;
}*/

.book-grid {
  display: grid;
  gap: 16px;
  padding: 16px;

  /* Максимум 5 колонок на больших экранах */
  grid-template-columns: repeat(5, 1fr);
}

/* Адаптивность для планшетов и телефонов */
@media (max-width: 1200px) {
  .book-grid {
    grid-template-columns: repeat(4, 1fr); /* 4 в ряд */
  }
}

@media (max-width: 992px) {
  .book-grid {
    grid-template-columns: repeat(3, 1fr); /* 3 в ряд */
  }
}

@media (max-width: 768px) {
  .book-grid {
    grid-template-columns: repeat(2, 1fr); /* 2 в ряд */
  }
}

@media (max-width: 480px) {
  .book-grid {
    grid-template-columns: 1fr; /* 1 в ряд на очень маленьких экранах */
  }
}

.book {
  cursor: pointer;
  text-align: center;
  padding: 10px 0;
  
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  
  min-height: 250px;
}

.book img {
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: 300px;
  border-radius: 4px;
  transition: transform 0.2s;
}

.book img:hover {
  transform: scale(1.05);
}

.book-title {
  margin-top: 8px;
  font-size: 14px;
}

/* Модальное окно */
.modal {
  display: none; /* скрыто по умолчанию */
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0,0,0,0.8);
  justify-content: center;
  align-items: center;
}

.modal-content {
  max-width: 90%;
  max-height: 90%;
  border-radius: 4px;
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 24px;
  color: #fff;
  font-size: 36px;
  font-weight: bold;
  cursor: pointer;
}

/* Спиннер */
.spinner {
  border: 4px solid rgba(0,0,0,0.1);
  border-top: 4px solid #555;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  animation: spin 1s linear infinite;
  /*margin: 20px auto;*/
  margin: 30px 30px;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

@media (max-width: 480px) {
    .book img {
		width: 100%;
		max-width: 100%;
		height: auto;
		max-height: max-content;
		border-radius: 4px;
		transition: transform 0.2s;
	}
}