/* ===== SEARCH ===== */
.search-wrap {
  position: relative;
  max-width: 36rem;
  margin-bottom: 3rem;
}
.search-input {
  width: 100%;
  padding: 0.875rem 1rem 0.875rem 3rem;
  background: var(--bg-card);
  border: 1px solid var(--bg-border);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-size: 0.9375rem;
  font-family: inherit;
  transition: border-color var(--transition);
}
.search-input::placeholder { color: var(--text-muted); }
.search-input:focus {
  outline: 2px solid var(--accent-purple);
  outline-offset: 2px;
  border-color: var(--accent-purple);
}
.search-icon {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
  font-size: 1rem;
}

/* ===== BOOK GRID ===== */
.book-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
}
@media (min-width: 36rem) {
  .book-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 64rem) {
  .book-grid { grid-template-columns: repeat(4, 1fr); }
}

/* ===== BOOK CARD ===== */
.book-card {
  background: var(--bg-card);
  border: 1px solid var(--bg-border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color var(--transition), transform var(--transition);
  display: flex;
  flex-direction: column;
}
.book-card:hover {
  border-color: var(--accent-purple);
  transform: translateY(-4px);
}
.book-cover-wrap {
  aspect-ratio: 2/3;
  background: var(--bg-deep);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.book-cover {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.book-cover-fallback {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--bg-card), var(--bg-border));
  font-size: 0.6875rem;
  color: var(--text-muted);
  text-align: center;
  padding: 0.5rem;
}
.book-info { padding: 0.875rem; flex: 1; }
.book-title {
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.book-author { font-size: 0.75rem; color: var(--text-secondary); }
.book-year {
  font-size: 0.6875rem;
  color: var(--accent-purple);
  margin-top: 0.375rem;
  font-weight: 600;
}

/* ===== STATES ===== */
.loading-msg, .error-msg, .empty-msg {
  grid-column: 1 / -1;
  text-align: center;
  padding: 3rem;
  color: var(--text-muted);
}
.error-msg { color: var(--accent-coral); }
.spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--bg-border);
  border-top-color: var(--accent-purple);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  margin: 0 auto 1rem;
}
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  .spinner { animation: none; opacity: 0.5; }
}

/* ===== SECTION DIVIDER ===== */
.shelf-section-title {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.shelf-section-title::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--bg-border);
}
