.books-actions { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 16px; }
.books-controls { display: flex; gap: 12px; }
.books-controls[hidden] { display: none; }
.books-controls button {
  width: 52px;
  height: 48px;
  padding: 0;
  border: 1px solid #111;
  background: #fff;
  color: #111;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  transition: color 180ms ease, background 180ms ease;
}
.books-controls button:hover:not(:disabled) { background: #111; color: #fff; }
.books-controls button:disabled { opacity: .3; cursor: default; }
.books-carousel {
  --book-gap: clamp(16px, 1.5vw, 28px);
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  overscroll-behavior-x: contain;
}
.books-carousel::-webkit-scrollbar { display: none; }
.books-carousel.is-resetting { scroll-snap-type: none; scroll-behavior: auto; }
.books-carousel--loop { scroll-snap-type: none; overflow-anchor: none; }
.books-carousel:focus-visible { outline: 2px solid #111; outline-offset: 6px; }
.books-carousel__list {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: calc((100% - 5 * var(--book-gap)) / 6);
  gap: var(--book-gap);
  list-style: none;
  padding: 0;
  margin: 0;
}
.catalog-book { display: flex; flex-direction: column; min-width: 0; scroll-snap-align: start; }
.catalog-book__link { display: flex; flex: 1; flex-direction: column; padding: 12px; border: 1px solid #e6e3dc; color: inherit; text-decoration: none; transition: border-color 180ms ease; }
.catalog-book__link:hover { border-color: #bcb5a9; }
.catalog-book__link:hover h3 { color: var(--muted); }
.catalog-book__link:focus-visible { outline-offset: -3px; }
.catalog-book__cover { display: flex; align-items: center; justify-content: center; width: 100%; height: clamp(190px, 16vw, 280px); padding: 16px 12px; margin-bottom: 18px; background: #f4f2ee; }
.catalog-book__cover img { width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 5px 5px #0002); transition: transform 200ms ease; }
.catalog-book__link:hover img { transform: translateY(-3px); }
.catalog-book h3 { margin: 0 2px 18px; font: 400 clamp(16px, 1.1vw, 19px)/1.45 var(--serif); letter-spacing: normal; }
.catalog-book__price { margin: auto 2px 0; padding-top: 14px; border-top: 1px solid #e6e3dc; font-size: 18px; line-height: 1.5; }
@media (max-width: 1200px) {
  .books-carousel__list { grid-auto-columns: calc((100% - 2 * var(--book-gap)) / 3); }
  .catalog-book__cover { height: 290px; }
  .catalog-book h3 { font-size: 19px; }
}
@media (max-width: 900px) {
  .books-carousel__list { grid-auto-columns: calc((100% - var(--book-gap)) / 2); }
}
@media (max-width: 600px) {
  .books .section-heading { flex-direction: column; align-items: flex-start; gap: 24px; }
  .books-actions { width: 100%; justify-content: space-between; }
  .books-carousel__list { grid-auto-columns: 100%; }
  .catalog-book__cover { height: 320px; }
  .books-controls button { width: 44px; height: 44px; }
}
@media (prefers-reduced-motion: reduce) {
  .catalog-book__link:hover img { transform: none; }
}
