/* =========================
   CATALOG PAGE
========================= */

.catalog-page {
  background: var(--bg);
  color: var(--text);
}

.catalog-main {
  padding: 40px 0 60px;
}

/* ===== LAYOUT ===== */

.catalog-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 32px;
  align-items: start;
}

/* ===== FILTERS ===== */

.catalog-filters {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.catalog-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
}

.catalog-input {
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  font-size: 14px;
  background: var(--card);
  color: var(--text);
}

.catalog-input:focus {
  border-color: #e67e22;
}

.catalog-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.chip {
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--card);
  font-size: 14px;
  cursor: pointer;
}

.chip.active {
  background: #e67e22;
  border-color: #e67e22;
  color: #fff;
}

/* =========================
   BOOK GRID
========================= */

.books-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 24px;
}

/* ===== BOOK CARD ===== */

.book-card {
  background: var(--card);
  border-radius: 18px;
  padding: 16px;
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: transform .15s ease, box-shadow .15s ease;
}

.book-card:hover {
  transform: scale(1.02);
  box-shadow: var(--shadow);
}

.book-cover {
  width: 100%;
  height: 260px;
  border-radius: 14px;
  overflow: hidden;
}

.book-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.book-title {
  font-size: 15px;
  font-weight: 700;
  line-height: 1.3;
}

.book-author {
  font-size: 13px;
  color: var(--muted);
}

/* ===== META (rating + available) ===== */

.book-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: auto;
}

.book-rating {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
}

.book-rating .star {
  color: #e67e22;
}

.catalog-error {
   grid-column: 1 / -1;
  background: #ffffff;
  border: 2px dashed #e5d6cc;
  border-radius: 28px;
  padding: 60px 20px;
  text-align: center;
  color: #8f4824;
  width: 100%;
  margin: 40px auto;
}

.book-badge {
  padding: 6px 12px;
  font-size: 13px;
  font-weight: 700;
  border-radius: 999px;
  border: 1px solid #86efac;
  background: #dcfce7;
  color: #166534;
  white-space: nowrap;
}

.book-badge--off {
  border: 1px solid #fdba74;
  background: #ffedd5;
  color: #9a3412;
}

/* =========================
   RESPONSIVE
========================= */

/* ===== TABLET LARGE ===== */

@media (max-width:1024px) {
  .books-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* ===== TABLET ===== */

@media (min-width:481px) and (max-width:768px) {

  .catalog-layout {
    grid-template-columns: 1fr;
  }

  .books-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .book-cover {
    height: 240px;
  }
}

/* ===== MOBILE (⭐ הכי חשוב) ===== */

@media (max-width:480px) {

  .catalog-main {
    padding: 28px 0 44px;
  }

  .catalog-layout {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .catalog-filters {
    padding: 14px;
    gap: 14px;
  }

  /* ✅ שני ספרים בשורה */
  .books-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
  }

  .book-card {
    padding: 12px;
  }

  .book-cover {
    height: 220px;
  }

  .book-title {
    font-size: 14px;
  }

  .book-author {
    font-size: 12px;
  }

  /* ✅ META קומפקטי */
  .book-meta {
    gap: 6px;
  }

  .book-rating {
    font-size: 14px;
    gap: 4px;
  }

  /* ✅ Available קטן ליד הדירוג */
  .book-badge,
  .book-badge--off {
    padding: 4px 10px;
    font-size: 11px;
  }
}