/* ================================================
   СТРАНИЦА КНИГИ — book.css
================================================ */

/* ── Герой ── */
.book-hero {
  padding-top: calc(var(--nav-h) + 72px);
  padding-bottom: 80px;
  background: var(--bg);
}

.book-hero__inner {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 80px;
  align-items: start;
}

.book-hero__cover img,
.book-gallery {
  width: 100%;
}

/* ── Галерея фотографий книги ── */
.book-gallery {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.book-gallery__main {
  position: relative;
  border-radius: 8px;
  overflow: hidden;
  background: #f0ebe3;
  aspect-ratio: 3/4;
  cursor: zoom-in;
}

.book-gallery__main img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  transition: opacity .18s ease;
}

/* Стрелки */
.book-gallery__arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 36px; height: 36px;
  border-radius: 50%;
  background: rgba(255,255,255,.9);
  border: 1px solid var(--border);
  color: var(--text-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  transition: opacity .2s, border-color .2s, color .2s;
  z-index: 2;
}
.book-gallery__main:hover .book-gallery__arrow { opacity: 1; }
.book-gallery__arrow:hover { border-color: var(--accent); color: var(--accent); }
.book-gallery__arrow svg { width: 16px; height: 16px; display: block; }
.book-gallery__arrow--prev { left: 10px; }
.book-gallery__arrow--next { right: 10px; }

/* Миниатюры */
.book-gallery__thumbs {
  display: flex;
  gap: 8px;
}

.book-gallery__thumb {
  flex: 1;
  aspect-ratio: 1;
  border-radius: 6px;
  overflow: hidden;
  border: 2px solid transparent;
  padding: 0;
  cursor: pointer;
  transition: border-color .2s;
  background: #f0ebe3;
}
.book-gallery__thumb img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .3s;
}
.book-gallery__thumb:hover img { transform: scale(1.06); }
.book-gallery__thumb.is-active { border-color: var(--accent); }


.tp-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: .78rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text-light);
  margin-bottom: 20px;
  transition: color .2s;
  text-decoration: none;
}
.tp-back svg { width: 16px; height: 16px; }
.tp-back:hover { color: var(--accent); }

.book-hero__title {
  font-family: var(--font-h);
  font-size: clamp(1.8rem, 3.5vw, 2.8rem);
  font-weight: 400;
  line-height: 1.15;
  margin: 12px 0 10px;
  color: var(--text-dark);
}

.book-hero__author {
  font-size: .8rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 24px;
}

.book-hero__desc {
  font-size: 1rem;
  line-height: 1.8;
  color: var(--text-mid);
  margin-bottom: 36px;
  max-width: 500px;
}

.book-hero__shops { margin-top: 4px; }

/* Большие кнопки магазинов */
.book-shop-btn--lg {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 26px;
  border: 1px solid var(--border);
  border-radius: 100px;
  font-size: .85rem;
  font-weight: 500;
  color: var(--text-dark);
  transition: border-color .2s, color .2s, background .2s;
  text-decoration: none;
}
.book-shop-btn--lg svg { width: 16px; height: 16px; flex-shrink: 0; }
.book-shop-btn--lg:hover {
  border-color: var(--accent);
  color: #fff;
  background: var(--accent);
}

/* ── О книге ── */
.book-about {
  padding: 80px 0;
  border-top: 1px dashed var(--border);
}

.book-about__inner {
  display: grid;
  grid-template-columns: 1fr 260px;
  gap: 64px;
  align-items: start;
}

.book-about__title {
  font-family: var(--font-h);
  font-size: 1.75rem;
  font-weight: 400;
  margin-bottom: 24px;
  color: var(--text-dark);
}

.book-about__text p {
  font-size: 1rem;
  line-height: 1.8;
  color: var(--text-mid);
  margin-bottom: 16px;
}
.book-about__text p:last-child { margin-bottom: 0; }

.book-about__details-title {
  font-size: .72rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--text-light);
  margin-bottom: 16px;
}

.book-details-list {
  list-style: none;
  padding: 0; margin: 0;
  border-top: 1px dashed var(--border);
}
.book-details-list li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px dashed var(--border);
  font-size: .88rem;
}
.book-details-list li span:first-child { color: var(--text-light); }
.book-details-list li span:last-child  { color: var(--text-dark); font-weight: 500; text-align: right; }

/* ── Цитата ── */
.book-quote {
  padding: 80px 0;
  border-top: 1px dashed var(--border);
  text-align: center;
  background: var(--bg);
}

.book-quote__text {
  font-family: var(--font-h);
  font-style: italic;
  font-size: clamp(1.2rem, 2.5vw, 1.75rem);
  line-height: 1.6;
  color: var(--text-dark);
  max-width: 720px;
  margin: 0 auto 20px;
}

.book-quote__author {
  font-size: .78rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--text-light);
}

/* ── Купить ── */
.book-buy {
  padding: 80px 0 96px;
  border-top: 1px dashed var(--border);
}

.book-buy__title {
  font-family: var(--font-h);
  font-size: 1.75rem;
  font-weight: 400;
  margin-bottom: 40px;
  color: var(--text-dark);
}

.book-buy__cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.book-buy-card {
  display: flex;
  flex-direction: column;
  padding: 28px 32px;
  border: 1px dashed var(--border);
  border-radius: 12px;
  text-decoration: none;
  transition: border-color .2s, box-shadow .2s;
  position: relative;
}
.book-buy-card:hover {
  border-color: var(--accent);
  box-shadow: 0 8px 32px rgba(181,136,74,.12);
}

.book-buy-card__name {
  font-family: var(--font-h);
  font-size: 1.2rem;
  color: var(--text-dark);
  margin-bottom: 8px;
  transition: color .2s;
}
.book-buy-card:hover .book-buy-card__name { color: var(--accent); }

.book-buy-card__note {
  font-size: .82rem;
  color: var(--text-light);
  line-height: 1.4;
}

.book-buy-card__arrow {
  position: absolute;
  top: 28px; right: 28px;
  font-size: 1.2rem;
  color: var(--border);
  transition: color .2s, transform .2s;
}
.book-buy-card:hover .book-buy-card__arrow {
  color: var(--accent);
  transform: translate(3px, -3px);
}

/* ── Адаптив ── */
@media (max-width: 1023px) {
  .book-hero__inner { grid-template-columns: 240px 1fr; gap: 48px; }
  .book-about__inner { grid-template-columns: 1fr; gap: 40px; }
  .book-buy__cards { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 767px) {
  .book-hero__inner {
    grid-template-columns: 1fr;
    gap: 32px;
    text-align: center;
  }
  .book-hero__cover { max-width: 200px; margin: 0 auto; }
  .book-gallery { max-width: 70%; margin: 0 auto; }
  .book-hero__desc  { margin: 0 auto 32px; }
  .book-hero__shops { display: flex; flex-direction: column; align-items: center; }
  .book-section__shops-list { justify-content: center; }
  .book-buy__cards { grid-template-columns: 1fr; }
  .book-hero { padding-top: calc(var(--nav-h) + 40px); padding-bottom: 56px; }
  .book-about, .book-quote, .book-buy { padding: 56px 0; }
}

/* ── Отзывы ── */
.book-reviews {
  padding: 80px 0;
  border-top: 1px dashed var(--border);
}

.book-reviews__header {
  margin-bottom: 48px;
}

.book-reviews__title {
  font-family: var(--font-h);
  font-size: 1.75rem;
  font-weight: 400;
  color: var(--text-dark);
  margin-bottom: 16px;
}

.book-reviews__rating {
  display: flex;
  align-items: center;
  gap: 12px;
}

.book-reviews__score {
  font-family: var(--font-h);
  font-size: 2rem;
  font-weight: 400;
  color: var(--text-dark);
  line-height: 1;
}

.book-reviews__stars {
  display: flex;
  gap: 3px;
}
.book-reviews__stars svg,
.review-card__stars svg {
  width: 16px;
  height: 16px;
  color: var(--accent);
}

.book-reviews__count {
  font-size: .78rem;
  color: var(--text-light);
  letter-spacing: .02em;
}

/* Сетка отзывов */
.book-reviews__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-bottom: 40px;
}

/* Карточка отзыва */
.review-card {
  padding: 28px;
  border: 1px dashed var(--border);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: border-color .2s, box-shadow .2s;
}
.review-card:hover {
  border-color: var(--accent);
  box-shadow: 0 6px 24px rgba(181,136,74,.08);
}

.review-card__head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
}

.review-card__author {
  font-weight: 500;
  font-size: .9rem;
  color: var(--text-dark);
}

.review-card__date {
  font-size: .72rem;
  color: var(--text-light);
  white-space: nowrap;
}

.review-card__stars {
  display: flex;
  gap: 3px;
}

.review-card__text {
  font-size: .9rem;
  line-height: 1.75;
  color: var(--text-mid);
  flex: 1;
}

/* Подпись источника */
.book-reviews__source {
  text-align: center;
  font-size: .75rem;
  color: var(--text-light);
}
.book-reviews__source a {
  color: var(--accent);
  border-bottom: 1px solid rgba(181,136,74,.3);
  transition: border-color .2s;
}
.book-reviews__source a:hover {
  border-color: var(--accent);
}

/* Адаптив отзывов */
@media (max-width: 1023px) {
  .book-reviews__grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 599px) {
  .book-reviews__grid { grid-template-columns: 1fr; }
  .book-reviews { padding: 56px 0; }
}

/* Форматы книги */
.book-formats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 24px;
}
.book-format-badge {
  display: inline-block;
  padding: 5px 14px;
  border: 1px dashed var(--border);
  border-radius: 100px;
  font-size: .75rem;
  color: var(--text-mid);
}

/* Акцентная кнопка Ozon */
.book-shop-btn--accent {
  border-color: var(--accent);
  color: var(--accent);
  font-weight: 600;
}
.book-shop-btn--accent:hover {
  background: var(--accent);
  color: #fff;
}

/* Акцентная карточка Ozon */
.book-buy-card--accent {
  border-color: var(--accent);
}
.book-buy-card--accent .book-buy-card__name { color: var(--accent); }

/* Метка источника отзыва */
.review-card__source {
  display: inline-block;
  font-size: .65rem;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--accent);
  border: 1px solid rgba(181,136,74,.3);
  border-radius: 4px;
  padding: 2px 8px;
  align-self: flex-start;
}

/* Тип книги и атрибуты в отзывах Ozon */
.review-card__type {
  font-size: .68rem;
  font-weight: 500;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--text-light);
}
.review-card__attrs {
  font-size: .72rem;
  color: var(--text-light);
  line-height: 1.5;
  font-style: italic;
}

/* ================================================
   ЧИТАТЬ ОТРЫВОК
================================================ */
.book-excerpt {
  padding: 80px 0;
  border-top: 1px dashed var(--border);
  background: var(--bg);
}

.book-excerpt__header {
  text-align: center;
  margin-bottom: 40px;
}

.book-excerpt__title {
  font-family: var(--font-h);
  font-size: 1.75rem;
  font-weight: 400;
  color: var(--text-dark);
  margin-bottom: 10px;
}

.book-excerpt__sub {
  font-size: .9rem;
  color: var(--text-light);
}

/* Вьювер страниц */
.excerpt-viewer {
  max-width: 640px;
  margin: 0 auto;
}

.excerpt-viewer__main {
  position: relative;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: #fff;
  box-shadow: 0 12px 40px rgba(0,0,0,.08);
}

.excerpt-viewer__main img {
  width: 100%;
  display: block;
  transition: opacity .18s ease;
}

.excerpt-viewer__arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 40px; height: 40px;
  border-radius: 50%;
  background: rgba(255,255,255,.92);
  border: 1px solid var(--border);
  color: var(--text-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  transition: opacity .2s, border-color .2s, color .2s;
  z-index: 2;
}
.excerpt-viewer__main:hover .excerpt-viewer__arrow { opacity: 1; }
.excerpt-viewer__arrow:hover { border-color: var(--accent); color: var(--accent); }
.excerpt-viewer__arrow svg { width: 18px; height: 18px; display: block; }
.excerpt-viewer__arrow--prev { left: 12px; }
.excerpt-viewer__arrow--next { right: 12px; }

.excerpt-viewer__counter {
  position: absolute;
  bottom: 12px;
  right: 12px;
  background: rgba(40,32,24,.75);
  color: #fff;
  font-size: .72rem;
  letter-spacing: .04em;
  padding: 4px 10px;
  border-radius: 100px;
  z-index: 2;
}

/* Миниатюры страниц — горизонтальный скролл */
.excerpt-viewer__thumbs {
  display: flex;
  gap: 8px;
  margin-top: 16px;
  overflow-x: auto;
  padding-bottom: 6px;
  scrollbar-width: thin;
}
.excerpt-viewer__thumbs::-webkit-scrollbar { height: 4px; }
.excerpt-viewer__thumbs::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

.excerpt-thumb {
  flex: 0 0 44px;
  aspect-ratio: 3/4;
  border-radius: 4px;
  overflow: hidden;
  border: 2px solid transparent;
  padding: 0;
  cursor: pointer;
  transition: border-color .2s;
  background: #f0ebe3;
}
.excerpt-thumb img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}
.excerpt-thumb.is-active { border-color: var(--accent); }

/* Адаптив */
@media (max-width: 767px) {
  .book-excerpt { padding: 56px 0; }
  .excerpt-viewer__arrow { opacity: 1; width: 34px; height: 34px; }
  .excerpt-thumb { flex-basis: 36px; }
}
