.book-detail-layout {
  --book-cover-width: clamp(180px, 45vw, 260px);
}

.book-detail-layout__aside {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.book-detail-layout__main {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.book-detail-actions {
  width: 100%;
}

.book-detail-actions .book-detail-shelf-form {
  min-width: min(100%, 24rem);
}

.book-detail-shelf-form .form-select,
.book-detail-shelf-form .form-control {
  width: 100%;
}

.book-detail-shelf-form__extras textarea {
  min-height: 5rem;
}

.book-detail-layout__ratings {
  width: 100%;
}

.book-detail-header {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.book-detail-header__genres {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.book-detail-reviews {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.book-detail-cover {
  max-width: var(--book-cover-width);
  margin: 0 auto;
}

.book-detail-cover__image {
  width: 100%;
  aspect-ratio: 2 / 3;
  object-fit: contain;
  background-color: rgba(0, 0, 0, 0.04);
}

.book-detail-cover__placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  aspect-ratio: 2 / 3;
  border-radius: 0.75rem;
  background-color: rgba(0, 0, 0, 0.04);
  color: var(--bs-secondary-color);
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.book-detail-thumbnails {
  width: 100%;
}

.book-detail-quick-facts__list {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  margin: 0;
  padding: 0;
}

.book-detail-quick-facts__item {
  background: var(--bs-light);
  border-radius: 0.75rem;
  padding: 0.75rem 1rem;
  display: grid;
  gap: 0.35rem;
}

.book-detail-quick-facts__label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--bs-secondary-color);
  margin: 0;
}

.book-detail-quick-facts__value {
  margin: 0;
  font-weight: 600;
  font-size: 1.1rem;
  color: var(--bs-body-color);
}

.book-detail-meta {
  display: grid;
  gap: 0.75rem 1.5rem;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  margin: 0;
  padding: 0;
  list-style: none;
}

.book-detail-meta__item {
  border-radius: 0.5rem;
  padding: 0.25rem 0;
}

.book-detail-meta__item dt {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--bs-secondary-color);
  margin-bottom: 0.25rem;
}

.book-detail-meta__item dd {
  margin: 0;
  font-weight: 600;
  color: var(--bs-body-color);
}

@media (max-width: 991.98px) {
  .book-detail-layout {
    --book-cover-width: clamp(180px, 50vw, 240px);
  }
}

@media (max-width: 575.98px) {
  .book-detail-layout__aside {
    align-items: center;
  }

  .book-detail-cover {
    max-width: clamp(160px, 70vw, 240px);
  }

  .book-detail-meta {
    grid-template-columns: 1fr;
  }

  .book-detail-quick-facts__list {
    gap: 0.75rem;
    grid-template-columns: 1fr;
  }

  .book-detail-header {
    align-items: center;
    text-align: center;
  }

  .book-detail-header__genres {
    justify-content: center;
  }

  .book-cover-thumbnails {
    max-width: none;
    width: 100%;
  }

  .book-cover-thumbnails__viewport {
    overflow-x: auto;
    padding-bottom: 0.25rem;
  }

  .book-cover-thumbnails__page {
    min-width: max-content;
  }
}