/* === КАТАЛОГ КНИГ === */

/* общий контейнер для фильтров и списка */
.catalog-container {
  display: flex;
  flex-wrap: wrap;
  gap: 30px;
  margin-top: 20px;
}

/* ====== левая панель фильтров ====== */
.filters {
  flex: 1 1 240px;
  max-width: 280px;
  background-color: #fffaf0;
  border: 1px solid #e5d3a3;
  border-radius: 8px;
  padding: 15px 20px;
  box-shadow: 0 0 6px rgba(0,0,0,0.1);
  height: fit-content;
}

.filters p {
  font-weight: bold;
  color: #3a3a3a;
}

.filters ul {
  list-style: none;
  padding-left: 15px;
}

.filters li {
  margin-bottom: 5px;
}

.filters strong {
  color: #4a2f00;
}

.filters a {
  text-decoration: none;
  color: #333;
}

.filters a:hover {
  color: #a35b00;
  text-decoration: underline;
}

/* ====== правая часть (список книг) ====== */
.catalog-list {
  flex: 3 1 600px;
  background-color: #ffffff;
  border: 1px solid #e5d3a3;
  border-radius: 8px;
  padding: 15px 20px;
  box-shadow: 0 0 6px rgba(0,0,0,0.1);
}

.catalog-list h2 {
  color: #4a2f00;
  border-bottom: 2px solid #dcb37a;
  padding-bottom: 5px;
}

/* таблица книг */
.catalog-list table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 10px;
}

.catalog-list td {
  width: 50%;
  text-align: center;
  padding: 15px;
}

.catalog-list td a {
  text-decoration: none;
  color: #222;
}

.catalog-list td a:hover strong {
  color: #a35b00;
}

.catalog-list td img {
  border-radius: 6px;
  width: 150px;
  height: 200px;
  object-fit: cover;
  transition: transform 0.3s;
}

.catalog-list td img:hover {
  transform: scale(1.05);
}

.catalog-list td p {
  margin: 4px 0;
}

/* ====== нумерация ====== */
.page-nav {
  text-align: center;
  margin: 25px 0;
  font-size: 18px;
}

.page-nav a {
  text-decoration: none;
  margin: 0 6px;
  color: #333;
  font-weight: bold;
  padding: 4px 10px;
  border-radius: 4px;
  transition: background 0.3s;
}

.page-nav a:hover {
  background-color: #e7be77;
}

/* ====== описание каталога ====== */
.catalog-description {
  background-color: #fffaf0;
  border: 1px solid #e5d3a3;
  border-radius: 8px;
  padding: 15px 20px;
  box-shadow: 0 0 5px rgba(0,0,0,0.05);
  margin-top: 20px;
}

.catalog-description h2 {
  color: #4a2f00;
}

.filters { width: 250px; background:#fffaf0; padding:15px; border-radius:8px; }
.filter { margin-bottom: 12px; }
.filter-title {
  font-weight:bold; padding:6px; background:#e7be77; cursor:pointer; border-radius:5px;
}
.filter-content { display:none; margin: 8px 0 0 10px; }
.filter-content li { margin-bottom: 6px; }

.book-card {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.add-to-cart {
  margin-top: 8px;
  padding: 6px 12px;
  background-color: #a35b00;
  color: white;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  transition: background 0.3s;
}

.add-to-cart:hover {
  background-color: #7a4300;
}



.search-wrapper {
  position: relative;
  display: inline-block;
}

.search-results {
  position: absolute;
  top: 40px;
  left: 0;
  width: 250px;
  background: white;
  border: 1px solid #ccc;
  border-radius: 6px;
  display: none;
  z-index: 1000;
  max-height: 200px;
  overflow-y: auto;
}

.search-item {
  padding: 8px;
  cursor: pointer;
}

.search-item:hover {
  background-color: #f3e0c0;
}

.search-error {
  border: 2px solid red !important;
}



.modal {
  display: none;
  position: fixed;
  z-index: 2000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0,0,0,0.5);
}

.modal-content {
  background: white;
  margin: 10% auto;
  padding: 20px;
  width: 400px;
  border-radius: 8px;
  text-align: center;
  position: relative;
}

.close-modal {
  position: absolute;
  right: 15px;
  top: 10px;
  font-size: 22px;
  cursor: pointer;
}

.modal-content img {
  width: 150px;
  height: 200px;
  object-fit: cover;
  margin-bottom: 10px;
}

/* Сетка книг */
.books-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

/* Карточка книги */
.book-card {
    border: 1px solid #ddd;
    padding: 15px;
    border-radius: 8px;
    text-align: center;
    transition: box-shadow 0.2s;
}
.book-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}
.book-card img {
    width: 150px;
    height: 200px;
    object-fit: cover;
}

/* Результаты поиска */
.search-results {
    position: absolute;
    background: white;
    border: 1px solid #ccc;
    border-top: none;
    width: 100%;
    z-index: 100;
    max-height: 200px;
    overflow-y: auto;
    display: none;
}
.search-item {
    padding: 8px 12px;
    cursor: pointer;
    border-bottom: 1px solid #eee;
}
.search-item:hover {
    background: #f5f5f5;
}
.search-wrapper {
    position: relative;
}
.search-error {
    border: 2px solid red !important;
}

/* Активная страница пагинации */
.active-page {
    font-weight: bold;
    background: #333;
    color: white;
    padding: 5px 10px;
    border-radius: 4px;
}

/* Уведомление корзины */
.cart-notification {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: #4CAF50;
    color: white;
    padding: 12px 20px;
    border-radius: 8px;
    opacity: 0;
    transition: opacity 0.3s;
    z-index: 999;
}
.cart-notification.visible {
    opacity: 1;
}

/* Анимация счётчика корзины */
@keyframes bump {
    0% { transform: scale(1); }
    50% { transform: scale(1.4); }
    100% { transform: scale(1); }
}
.cart-bump {
    animation: bump 0.3s ease;
    display: inline-block;
}