:root {
  --book-edge-space: 48px;
}

@media (max-width: 1220px) {
  :root {
    --book-edge-space: 40px;
  }
}

@media (max-width: 1024px) {
  :root {
    --book-edge-space: 32px;
  }
}

@media (max-width: 900px) {
  :root {
    --book-edge-space: 24px;
  }
}

@media (max-width: 640px) {
  :root {
    --book-edge-space: 20px;
  }
}

@media (max-width: 480px) {
  :root {
    --book-edge-space: 14px;
  }
}

/* Оболочка контента на странице книги: одинаковый отступ сверху и по бокам */
.book-page .site-content-shell {
  padding-top: 0;
  padding-inline: var(--book-edge-space);
}

.book-product {
  padding: var(--book-edge-space) 0 32px !important;
}

.book-product__stage {
  display: grid;
  max-width: 100%;
  margin: 0;
  grid-template-columns: 520px minmax(0, 1fr);
  gap: 36px;
  align-items: start;
}

.book-product__gallery {
  position: sticky;
  top: 96px;
  align-self: start;
  height: auto;
  width: 100%;
  max-width: 520px;
  min-width: 0;
  border-right: 0;
  margin: 0;
  padding: 0;
}

.book-page__gallery {
  height: auto;
  min-height: 0;
  width: 100%;
  margin: 0;
  padding: 0;
}

.book-product__details {
  min-width: 0;
  padding: 0;
}

.book-product .ds-container {
  max-width: 100%;
  margin: 0;
}

.book-product .ds-breadcrumbs {
  margin-top: 0;
  margin-bottom: 14px;
}

.book-gallery {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  width: 100%;
  max-width: 520px;
  min-width: 0;
  margin: 0;
  padding: 0;
  text-align: center;
}

.book-gallery__main {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 520px;
  aspect-ratio: 3 / 4;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  cursor: zoom-in;
  overflow: visible;
  box-sizing: border-box;
  text-decoration: none;
}

.book-gallery__main img {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: cover;
  border-radius: 6px;
  box-shadow: 0 16px 42px rgba(35, 30, 19, 0.18), 0 3px 10px rgba(35, 30, 19, 0.08);
  transition: transform 0.28s cubic-bezier(0.25, 1, 0.5, 1), box-shadow 0.28s ease;
}

.book-gallery__main:hover img {
  transform: translateY(-4px) scale(1.015);
  box-shadow: 0 22px 50px rgba(35, 30, 19, 0.24), 0 4px 14px rgba(35, 30, 19, 0.1);
}

/* Подложка для разворотов / фрагментов: строго тот же размер 3:4 и скругление */
.book-gallery__main.is-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 520px;
  aspect-ratio: 3 / 4;
  margin: 0;
  padding: clamp(14px, 2.5vw, 22px);
  border: 1px solid rgba(114, 64, 30, 0.18);
  border-radius: 6px;
  background: linear-gradient(145deg, #fffdf8 0%, #fdf5e6 55%, #f9ebd2 100%);
  box-shadow: 0 16px 42px rgba(35, 30, 19, 0.18), 0 3px 10px rgba(35, 30, 19, 0.08);
  box-sizing: border-box;
  cursor: zoom-in;
  transition: transform 0.28s cubic-bezier(0.25, 1, 0.5, 1), box-shadow 0.28s ease;
  overflow: hidden;
}

.book-gallery__main.is-placeholder:hover {
  transform: translateY(-4px) scale(1.015);
  box-shadow: 0 22px 50px rgba(35, 30, 19, 0.24), 0 4px 14px rgba(35, 30, 19, 0.1);
}

.book-gallery__placeholder-inner {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  width: 100%;
  height: 100%;
  box-sizing: border-box;
  padding: clamp(18px, 2.5vw, 24px) clamp(14px, 2vw, 20px);
  border: 1px dashed rgba(114, 64, 30, 0.22);
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.42);
}

.book-gallery__placeholder-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 58px;
  height: 58px;
  margin-bottom: 12px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.85);
  color: var(--color-brown);
  box-shadow: 0 4px 14px rgba(114, 64, 30, 0.1);
}

.book-gallery__placeholder-badge {
  display: inline-block;
  padding: 4px 12px;
  margin-bottom: 10px;
  border-radius: 999px;
  background: var(--color-badge-bg);
  color: var(--color-brown);
  font: var(--ds-font-weight-semibold) var(--ds-font-size-sm) / 1 var(--font-body);
  letter-spacing: 0.03em;
}

.book-gallery__placeholder-title {
  margin: 0 0 8px;
  color: var(--color-brown);
  font: var(--ds-font-weight-bold) clamp(22px, 2.5vw, 28px) / 1.15 var(--font-heading);
  max-width: 20ch;
}

.book-gallery__placeholder-desc {
  margin: 0 0 16px;
  color: var(--ds-color-text-muted);
  font: var(--ds-font-weight-medium) var(--ds-font-size-md) / 1.4 var(--font-body);
  max-width: 26ch;
}

.book-gallery__placeholder-hint {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: auto;
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.7);
  color: var(--color-brown);
  font: var(--ds-font-weight-semibold) var(--ds-font-size-sm) / 1 var(--font-body);
}

.book-gallery__placeholder-hint svg {
  width: 14px;
  height: 14px;
}

.book-gallery__zoom-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 38px;
  margin: 16px auto 0;
  padding: 7px 20px;
  border: 1px solid rgba(114, 64, 30, 0.18);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.75);
  color: var(--color-brown);
  font: var(--ds-font-weight-semibold) var(--ds-font-size-sm) / 1 var(--font-body);
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(35, 30, 19, 0.05);
  transition: background-color 0.2s ease, border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.book-gallery__zoom-btn:hover {
  background: #fff;
  border-color: var(--color-brown);
  transform: translateY(-2px);
  box-shadow: 0 4px 14px rgba(114, 64, 30, 0.15);
}

.book-gallery__zoom-btn[hidden] {
  display: none;
}

.book-gallery__zoom-btn svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.book-gallery__thumbs {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: 16px auto 0;
  width: 100%;
  max-width: 520px;
}

.book-gallery__thumb {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 54px;
  height: 54px;
  aspect-ratio: 1;
  padding: 3px;
  border: 1px solid var(--ds-color-border);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.6);
  color: var(--color-brown);
  cursor: pointer;
  overflow: hidden;
  transition: border-color 0.2s ease, transform 0.2s cubic-bezier(0.25, 1, 0.5, 1), box-shadow 0.2s ease;
}

.book-gallery__thumb:hover {
  border-color: var(--color-brown);
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(114, 64, 30, 0.12);
}

.book-gallery__thumb.is-active {
  border: 2px solid var(--color-brown);
  transform: translateY(-2px);
  box-shadow: 0 4px 14px rgba(114, 64, 30, 0.18);
  background: #fff;
}

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

.book-gallery__thumb span { display: grid; width: 100%; height: 100%; place-items: center; background: linear-gradient(135deg, var(--color-badge-bg), var(--ds-color-surface)); font-family: var(--font-heading); font-size: 28px; }.book-gallery__thumb small { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }
.book-info {
  min-width: 0;
  padding-top: 0;
}

.book-info__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 12px;
}

.book-info__head .book-info__author {
  margin: 0;
}

.book-info__author,
.book-section-label {
  margin: 0 0 10px;
  color: var(--color-brown);
  font-size: 16px;
  font-weight: var(--ds-font-weight-bold);
  letter-spacing: .08em;
  text-transform: uppercase;
}

.book-info h1 {
  margin: 0;
  font: 700 clamp(38px, 4.2vw, 58px) / 1.06 var(--font-heading);
  letter-spacing: -0.01em;
}

.book-info__extra h2,
.book-series h2,
.book-reviews h2,
.book-related h2 {
  margin: 0;
  font: var(--ds-font-weight-medium) clamp(30px, 3.6vw, 48px) / 1.1 var(--font-heading);
}

.book-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
}

.book-badges span {
  padding: 8px 16px;
  border-radius: 999px;
  background: var(--color-badge-bg);
  font-size: 15px;
  font-weight: var(--ds-font-weight-semibold);
  letter-spacing: 0.01em;
}

.book-info__stock {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 26px 0 10px;
  color: var(--color-success);
  font-size: var(--ds-font-size-md);
  font-weight: var(--ds-font-weight-semibold);
}

.book-info__stock span {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: currentColor;
}

.book-info__price {
  margin: 0 0 24px;
  font-size: 44px;
  font-weight: var(--ds-font-weight-bold);
  line-height: 1;
  color: var(--color-text);
}

.book-buy {
  display: flex;
  align-items: flex-end;
  gap: 16px;
  max-width: 580px;
}

.book-buy > .ds-button {
  flex: 1;
  min-height: 54px;
  font-size: var(--ds-font-size-lead);
  font-weight: 700;
  padding: 14px 36px;
  border-radius: 12px;
  box-shadow: 0 6px 20px rgba(255, 82, 0, 0.28);
}

.book-quantity > span {
  display: block;
  margin-bottom: 8px;
  font-size: 15px;
  font-weight: var(--ds-font-weight-medium);
  color: var(--ds-color-text-muted);
}

.book-quantity > div {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 54px;
  overflow: hidden;
  border: 1px solid var(--ds-color-border);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.6);
}

.book-quantity button {
  width: 48px;
  min-height: 52px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  background: transparent;
  color: var(--color-text);
  cursor: pointer;
  font-size: 22px;
  font-weight: 700;
  transition: background-color var(--ds-transition-fast), color var(--ds-transition-fast);
}

.book-quantity button:hover {
  background-color: rgba(114, 64, 30, 0.08);
}

.book-quantity button:active {
  background-color: rgba(114, 64, 30, 0.15);
}

.book-quantity button:focus-visible {
  outline: 2px solid var(--ds-color-focus, #ff5400);
  outline-offset: -2px;
}

.book-quantity output {
  min-width: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-family: inherit;
  font-size: 20px;
  font-weight: var(--ds-font-weight-bold);
  line-height: 1;
  user-select: none;
}

.book-quantity input {
  width: 36px;
  min-height: 52px;
  border: 0;
  background: transparent;
  padding: 0;
  margin: 0;
  font-family: inherit;
  font-size: 20px;
  font-weight: var(--ds-font-weight-bold);
  color: var(--color-text);
  text-align: center;
  -moz-appearance: textfield;
  appearance: textfield;
}

.book-quantity input::-webkit-outer-spin-button,
.book-quantity input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.book-quantity input:focus-visible {
  outline: 2px solid var(--ds-color-focus, #ff5400);
  outline-offset: -2px;
}

.book-cart-status {
  min-height: 22px;
  margin: 12px 0 0;
  color: var(--color-success);
  font-size: var(--ds-font-size-md);
  font-weight: var(--ds-font-weight-medium);
}

.book-share button {
  min-height: 30px;
}

.book-description {
  margin-top: 34px;
  padding: 26px 32px;
  border-left: 4px solid var(--primary);
  border-radius: var(--ds-radius-lg);
  background: rgba(255, 255, 255, 0.5);
  box-shadow: 0 4px 16px rgba(114, 64, 30, 0.05);
}

.book-description h2 {
  margin: 0 0 12px;
  font: var(--ds-font-weight-medium) 26px var(--font-heading);
  color: var(--color-brown);
}

.book-description p {
  margin: 0;
  font-size: 20px;
  font-weight: var(--ds-font-weight-bold);
  line-height: 1.65;
  color: var(--color-text);
}

.book-info__extra {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: 24px;
  margin-top: 34px;
  padding-top: 34px;
  border-top: 1px solid rgba(114, 64, 30, 0.12);
}

.book-info__extra h2 {
  font-size: 24px;
  margin: 0 0 16px;
  color: var(--color-brown);
}

.book-specs,
.book-delivery {
  padding: 24px 26px;
  border-radius: var(--ds-radius-lg);
  background: rgba(255, 255, 255, 0.5);
  box-shadow: 0 4px 16px rgba(114, 64, 30, 0.04);
}

.book-specs dl {
  display: grid;
  grid-template-columns: minmax(90px, auto) 1fr;
  gap: 11px 20px;
  margin: 16px 0 0;
  font-size: 15px;
}

.book-specs dt {
  color: var(--ds-color-text-muted);
}

.book-specs dd {
  margin: 0;
  font-weight: var(--ds-font-weight-semibold);
}

.book-delivery {
  color: var(--color-text);
}

.book-delivery ul {
  display: grid;
  gap: 16px;
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
}

.book-delivery li {
  display: grid;
  gap: 3px;
}

.book-delivery li strong {
  font-size: 15px;
}

.book-delivery li span {
  color: var(--ds-color-text-muted);
  font-size: 14px;
  line-height: 1.45;
}

.book-payment-logos {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 8px;
  min-width: 0;
  margin-top: 6px;
}

.book-payment-logos img {
  display: block;
  flex: 0 1 auto;
  min-width: 0;
  width: auto;
  max-width: 64px;
  height: 22px;
  max-height: 22px;
  object-fit: contain;
}
/* ── Секция серии («Больше историй / Соберите всю серию») ── */
.book-series {
  padding-top: 28px;
  padding-bottom: 28px;
  padding-inline: 0;
}

.book-series__inner {
  position: relative;
  display: grid;
  grid-template-columns: 1.15fr 1.1fr auto;
  align-items: center;
  gap: 28px;
  padding: clamp(24px, 4vw, 40px);
  overflow: hidden;
  border-radius: var(--ds-radius-lg);
  color: var(--color-text);
  background-color: var(--color-bg);
  background-image:
    radial-gradient(55% 80% at 4% 8%, rgba(255, 138, 0, 0.20), transparent 68%),
    radial-gradient(48% 72% at 96% 18%, rgba(255, 82, 0, 0.16), transparent 70%),
    radial-gradient(42% 64% at 76% 108%, rgba(255, 162, 32, 0.18), transparent 72%),
    linear-gradient(135deg, var(--color-bg) 0%, rgba(255, 255, 255, 0.74) 52%, var(--color-badge-bg) 100%);
}

.book-series__inner > * {
  position: relative;
  z-index: 1;
}

.book-series .book-section-label {
  color: var(--primary);
}

.book-series h2 {
  font-size: 34px;
  color: var(--color-brown);
}

.book-series__inner p:not(.book-section-label) {
  max-width: 42ch;
  margin-top: 10px;
  color: rgba(35, 30, 19, 0.78);
  line-height: 1.55;
}

/* Веер книг в баннере: крупный, чёткий, выразительный */
.book-series__covers {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  min-height: 204px;
  padding: 6px 0;
}

.book-series__covers img {
  width: 140px;
  height: 196px;
  margin-left: -32px;
  border-radius: 6px;
  box-shadow: 0 10px 24px rgba(35, 30, 19, 0.22);
  object-fit: cover;
  background: #fff;
  transition: transform var(--ds-transition-fast), box-shadow var(--ds-transition-fast);
}

.book-series__covers img:first-child {
  margin-left: 0;
  transform: rotate(-7deg);
  z-index: 1;
}

.book-series__covers img:nth-child(2) {
  position: relative;
  z-index: 2;
  transform: translateY(-8px);
}

.book-series__covers img:last-child {
  position: relative;
  z-index: 1;
  transform: rotate(7deg);
}

.book-series__covers img:hover {
  transform: translateY(-12px);
  box-shadow: 0 16px 32px rgba(35, 30, 19, 0.28);
}

.book-series__placeholder {
  padding: 36px 18px;
  border: 1px dashed rgba(198, 1, 0, 0.7);
  color: var(--primary);
}

.book-series__action {
  display: grid;
  gap: 12px;
  min-width: 180px;
  color: var(--color-text);
  font-size: var(--ds-font-size-md);
  font-weight: var(--ds-font-weight-semibold);
  text-align: center;
}

/* ── Секция отзывов («Впечатления читателей») ── */
.book-reviews {
  padding-top: 52px;
  padding-bottom: 0;
  padding-inline: 0;
}

.book-section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
}

.book-section-head h2,
.book-related__title {
  font-size: var(--ds-font-size-h2);
}

.book-reviews__grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 20px;
  margin-top: 28px;
}

.book-reviews blockquote {
  margin: 0;
  padding: 26px;
  border-radius: var(--ds-radius-lg);
  background: rgba(255, 255, 255, 0.48);
  box-shadow: var(--ds-shadow-card);
}

.book-reviews blockquote p {
  font-family: var(--font-body);
  font-size: var(--ds-font-size-lead);
  font-weight: var(--ds-font-weight-bold);
  line-height: 1.3;
  text-transform: none;
}

.book-reviews blockquote footer {
  margin-top: 18px;
  color: var(--ds-color-text-muted);
  font-size: var(--ds-font-size-md);
}

.book-review-status {
  min-height: 22px;
  margin-top: 12px;
  color: var(--color-success);
  font-size: var(--ds-font-size-md);
}

/* ── Секция карусели сопутствующих («С этой книгой также покупают») ── */
.book-page .bestsellers {
  padding-top: 56px;
  padding-bottom: 64px;
  padding-inline: 0;
}
.book-buy > .ds-button, .book-buy > .ds-button:hover, .book-buy > .ds-button:focus-visible { color: var(--ds-color-text-inverse); }
.book-buy > .ds-button { background: var(--gradient-cta); color: #fff; }
.book-buy > .ds-button:hover { background: var(--gradient-cta-hover); color: #fff; }

/* ── Блокировка скролла страницы при открытом лайтбоксе ── */
html.lightbox-open,
body.lightbox-open {
  overflow: hidden !important;
  touch-action: none;
}

/* ── Lightbox: полноэкранный просмотр книги с зумом ── */
.book-lightbox {
  position: fixed;
  inset: 0;
  box-sizing: border-box;
  width: 100vw;
  height: 100vh;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: clamp(10px, 2.5vw, 24px);
  border: 0;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  z-index: 1000;
  scrollbar-width: none;
}

.book-lightbox::-webkit-scrollbar {
  display: none;
}

.book-lightbox:not([open]) {
  display: none;
}

.book-lightbox::backdrop {
  background: rgba(20, 18, 14, 0.82);
  backdrop-filter: blur(4px);
  animation: bookBackdropFadeIn 0.28s ease forwards;
}

@keyframes bookBackdropFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.book-lightbox.is-closing::backdrop {
  animation: bookBackdropFadeOut 0.22s ease forwards;
}

@keyframes bookBackdropFadeOut {
  from { opacity: 1; }
  to { opacity: 0; }
}

.book-lightbox__window {
  position: relative;
  display: flex;
  flex-direction: column;
  width: min(1040px, 100%);
  height: min(92vh, 880px);
  max-height: calc(100vh - 24px);
  background: var(--color-bg);
  border: 1px solid rgba(114, 64, 30, 0.18);
  border-radius: var(--ds-radius-lg);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.4);
  overflow: hidden;
  animation: bookWindowEnter 0.28s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes bookWindowEnter {
  from {
    opacity: 0;
    transform: scale(0.95) translateY(12px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.book-lightbox.is-closing .book-lightbox__window {
  animation: bookWindowExit 0.22s ease forwards;
}

@keyframes bookWindowExit {
  from {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
  to {
    opacity: 0;
    transform: scale(0.96) translateY(8px);
  }
}

.book-lightbox__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 20px;
  border-bottom: 1px solid rgba(114, 64, 30, 0.12);
  background: rgba(255, 255, 255, 0.5);
  flex-shrink: 0;
}

.book-lightbox__title-wrap {
  display: flex;
  align-items: baseline;
  gap: 12px;
  min-width: 0;
  overflow: hidden;
}

.book-lightbox__title {
  margin: 0;
  font: var(--ds-font-weight-bold) var(--ds-font-size-title) / 1.2 var(--font-heading);
  color: var(--color-brown);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.book-lightbox__counter {
  flex-shrink: 0;
  font-size: var(--ds-font-size-sm);
  color: var(--ds-color-text-muted);
  font-weight: var(--ds-font-weight-semibold);
}

.book-lightbox__actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.book-lightbox__zoom-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 38px;
  padding: 6px 14px;
  border: 1px solid rgba(114, 64, 30, 0.2);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.75);
  color: var(--color-brown);
  font: var(--ds-font-weight-semibold) var(--ds-font-size-sm) var(--font-body);
  cursor: pointer;
  transition: background-color 0.25s ease, border-color 0.25s ease, transform 0.2s ease;
}

.book-lightbox__zoom-btn:hover {
  background: #fff;
  border-color: var(--color-brown);
  transform: translateY(-1px);
}

.book-lightbox__zoom-btn[hidden] {
  display: none;
}

.book-lightbox__close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--color-dark);
  color: #fff;
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.book-lightbox__close:hover {
  opacity: 0.85;
  transform: scale(1.05);
}

.book-lightbox__stage {
  position: relative;
  display: flex;
  align-items: center;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  background: radial-gradient(circle at center, rgba(255, 255, 255, 0.4) 0%, rgba(249, 231, 185, 0.2) 100%);
}

.book-lightbox__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: 1px solid rgba(114, 64, 30, 0.18);
  border-radius: 50%;
  background: rgba(254, 251, 212, 0.9);
  color: var(--color-brown);
  cursor: pointer;
  transition: background-color 0.25s ease, transform 0.25s cubic-bezier(0.25, 1, 0.5, 1), opacity 0.25s ease, box-shadow 0.25s ease;
  backdrop-filter: blur(4px);
}

.book-lightbox__nav:hover:not(:disabled) {
  background: #fff;
  transform: translateY(-50%) scale(1.08);
  box-shadow: 0 4px 14px rgba(114, 64, 30, 0.2);
}

.book-lightbox__nav:disabled {
  opacity: 0.25;
  cursor: default;
  pointer-events: none;
}

.book-lightbox__nav--prev {
  left: 14px;
}

.book-lightbox__nav--next {
  right: 14px;
}

.book-lightbox__body {
  width: 100%;
  height: 100%;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.book-lightbox__canvas {
  width: 100%;
  height: 100%;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 16px;
  touch-action: none;
  scrollbar-width: none;
  transition: opacity 0.25s ease;
}

.book-lightbox__canvas::-webkit-scrollbar {
  display: none;
}

/* ── Плавные анимации переключения слайдов ── */
@keyframes bookSlideFadeNext {
  from {
    opacity: 0;
    transform: translateX(24px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
}

@keyframes bookSlideFadePrev {
  from {
    opacity: 0;
    transform: translateX(-24px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
}

@keyframes bookSlideFadeIn {
  from {
    opacity: 0;
    transform: scale(0.97);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.book-lightbox__canvas.is-entering-next {
  animation: bookSlideFadeNext 0.28s cubic-bezier(0.25, 1, 0.5, 1) forwards;
}

.book-lightbox__canvas.is-entering-prev {
  animation: bookSlideFadePrev 0.28s cubic-bezier(0.25, 1, 0.5, 1) forwards;
}

.book-lightbox__canvas.is-entering {
  animation: bookSlideFadeIn 0.28s cubic-bezier(0.25, 1, 0.5, 1) forwards;
}

#book-lightbox-content {
  display: flex;
  align-items: center;
  justify-content: center;
  max-width: 100%;
  max-height: 100%;
  width: 100%;
  height: 100%;
}

.book-lightbox__img {
  display: block;
  max-width: calc(100% - 24px);
  max-height: calc(100% - 24px);
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 6px;
  box-shadow: 0 12px 32px rgba(35, 30, 19, 0.2);
  cursor: zoom-in;
  transform-origin: center center;
  transition: transform 0.35s cubic-bezier(0.25, 1, 0.5, 1), transform-origin 0.14s ease-out, box-shadow 0.35s ease;
  user-select: none;
  -webkit-user-drag: none;
}

/* Режим Зума: плавное интерактивное масштабирование без обрезки краёв */
.book-lightbox__canvas.is-zoomed {
  cursor: zoom-out;
}

.book-lightbox__canvas.is-zoomed .book-lightbox__img {
  transform: scale(1.48);
  cursor: zoom-out;
  box-shadow: 0 24px 70px rgba(35, 30, 19, 0.35);
  will-change: transform, transform-origin;
}

.book-lightbox__placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: min(520px, calc(100% - 32px));
  aspect-ratio: 3 / 4;
  padding: clamp(24px, 4vw, 40px);
  text-align: center;
  box-sizing: border-box;
  background: linear-gradient(145deg, #fffdf8 0%, #fdf5e6 55%, #f9ebd2 100%);
  border: 1px solid rgba(114, 64, 30, 0.2);
  border-radius: 8px;
  box-shadow: 0 16px 42px rgba(35, 30, 19, 0.2);
  gap: 12px;
}

.book-lightbox__placeholder-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  margin-bottom: 8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.85);
  color: var(--color-brown);
  box-shadow: 0 4px 14px rgba(114, 64, 30, 0.1);
}

.book-lightbox__placeholder-title {
  margin: 0;
  color: var(--color-brown);
  font: var(--ds-font-weight-bold) clamp(24px, 3.2vw, 34px) / 1.15 var(--font-heading);
  max-width: 22ch;
}

.book-lightbox__placeholder small {
  display: block;
  max-width: 32ch;
  color: var(--ds-color-text-muted);
  font: var(--ds-font-weight-semibold) var(--ds-font-size-md) / 1.5 var(--font-body);
}

.book-lightbox__footer {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px 16px;
  background: rgba(255, 255, 255, 0.4);
  border-top: 1px solid rgba(114, 64, 30, 0.1);
  flex-shrink: 0;
}

.book-lightbox__thumbs {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.book-lightbox__thumb {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  padding: 3px;
  border: 1px solid var(--ds-color-border);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.6);
  color: var(--color-brown);
  cursor: pointer;
  overflow: hidden;
  transition: border-color 0.25s ease, transform 0.25s cubic-bezier(0.25, 1, 0.5, 1), box-shadow 0.25s ease;
}

.book-lightbox__thumb:hover {
  border-color: var(--color-brown);
  transform: translateY(-2px);
}

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

.book-lightbox__thumb span {
  font-family: var(--font-heading);
  font-size: 18px;
  font-weight: var(--ds-font-weight-bold);
}

.book-lightbox__thumb.is-active {
  border: 2px solid var(--color-brown);
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(114, 64, 30, 0.18);
}

@media (max-width: 640px) {
  .book-lightbox {
    padding: 8px;
  }
  .book-lightbox__window {
    height: 96vh;
    max-height: none;
    border-radius: var(--ds-radius-md);
  }
  .book-lightbox__header {
    padding: 10px 14px;
  }
  .book-lightbox__title {
    font-size: var(--ds-font-size-md);
  }
  .book-lightbox__nav {
    width: 38px;
    height: 38px;
  }
  .book-lightbox__nav--prev {
    left: 8px;
  }
  .book-lightbox__nav--next {
    right: 8px;
  }
  .book-lightbox__thumb {
    width: 40px;
    height: 40px;
  }
}

@media (max-width: 480px) {
  .book-lightbox__zoom-btn .book-lightbox__zoom-text {
    display: none;
  }
  .book-lightbox__zoom-btn {
    padding: 6px 10px;
  }
}
.book-page :focus-visible { outline: 3px solid var(--ds-color-focus); outline-offset: 3px; }
.book-share { position: relative; flex-shrink: 0; }.book-share__trigger, .book-share__copy { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 36px; border: 1px solid var(--ds-color-border); border-radius: 8px; background: rgba(255,255,255,.42); color: var(--color-brown); cursor: pointer; font: var(--ds-font-weight-semibold) var(--ds-font-size-md) var(--font-body); }.book-share__trigger { width: 40px; min-height: 40px; padding: 0; justify-content: center; border-color: transparent; background: transparent; border-radius: 999px; }.book-share__trigger svg { width: 18px; height: 18px; }.book-share__menu { position: absolute; z-index: 10; top: calc(100% + 8px); right: 0; display: grid; min-width: min(224px, calc(100vw - (var(--ds-page-gutter) * 2))); gap: 4px; padding: 8px; border: 1px solid rgba(114,64,30,.14); border-radius: 12px; background: var(--color-bg); box-shadow: var(--ds-shadow-floating); }.book-share__menu[hidden] { display: none; }.book-share__social { display: flex; align-items: center; gap: 10px; min-height: 34px; padding: 5px 7px; color: var(--color-text); font-size: var(--ds-font-size-md); }.book-share__social img { width: 20px; height: 20px; object-fit: contain; }.book-share__social { border-radius: 8px; text-decoration: none; }.book-share__social:hover { background: rgba(114,64,30,.08); }.book-share__copy { width: 100%; padding: 8px 10px; border-radius: 8px; background: transparent; }.book-share__trigger:hover, .book-share__copy:hover { background: rgba(114,64,30,.08); }.book-share__trigger[aria-expanded="true"] { background: rgba(114,64,30,.1); }
@media (max-width: 1220px) {
  .book-product__stage {
    grid-template-columns: 460px minmax(0, 1fr);
    gap: 32px;
  }
  .book-gallery,
  .book-gallery__main,
  .book-gallery__main.is-placeholder,
  .book-gallery__thumbs {
    max-width: 460px;
  }
}

@media (max-width: 1080px) {
  .book-info__extra {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 1024px) {
  .book-product__stage {
    grid-template-columns: 400px minmax(0, 1fr);
    gap: 28px;
  }
  .book-gallery,
  .book-gallery__main,
  .book-gallery__main.is-placeholder,
  .book-gallery__thumbs {
    max-width: 400px;
  }
  .book-series__covers img {
    width: 124px;
    height: 174px;
    margin-left: -28px;
  }
  .book-series__covers {
    min-height: 182px;
  }
  .book-reviews__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    margin-top: 20px;
  }
}

@media (max-width: 900px) {
  .book-product {
    padding-top: var(--book-edge-space) !important;
    padding-bottom: 22px !important;
    padding-inline: 0 !important;
  }

  .book-product__stage {
    display: block;
  }

  .book-product__gallery {
    position: static;
    height: auto;
    max-width: 100%;
    border-right: 0;
  }

  .book-page__gallery {
    height: auto;
    padding: 0 0 20px;
  }

  .book-product__details {
    padding: 0;
  }

  .book-gallery {
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 440px;
    margin-inline: auto;
    height: auto;
  }

  .book-gallery__main,
  .book-gallery__main.is-placeholder {
    width: 100%;
    max-width: 400px;
    aspect-ratio: 3 / 4;
    height: auto;
  }

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

  .book-gallery__thumbs {
    max-width: 400px;
  }

  .book-series {
    padding-top: 22px;
    padding-bottom: 22px;
  }

  .book-series__inner {
    grid-template-columns: 1fr 1fr;
    gap: 22px;
  }

  .book-series__covers img {
    width: 120px;
    height: 168px;
    margin-left: -26px;
  }

  .book-series__covers {
    min-height: 176px;
  }

  .book-series__action {
    grid-column: 1 / -1;
    justify-self: start;
    text-align: left;
  }

  .book-series__action .ds-button {
    width: auto;
  }

  .book-reviews {
    padding-top: 36px;
  }

  .book-page .bestsellers {
    padding-top: 40px;
    padding-bottom: 48px;
  }

  .book-related__grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 768px) {
  .book-product {
    padding-bottom: 18px !important;
  }

  .book-buy {
    align-items: stretch;
    flex-direction: column;
    gap: 14px;
    max-width: 100%;
  }

  .book-quantity {
    width: 100%;
  }

  .book-quantity > span {
    text-align: center;
    margin-bottom: 8px;
  }

  .book-quantity > div {
    width: 100%;
    justify-content: center;
  }

  .book-quantity button {
    width: 60px;
    min-height: 52px;
  }

  .book-quantity output {
    min-width: 48px;
    font-size: 22px;
  }

  .book-buy > .ds-button {
    width: 100%;
  }

  .book-description {
    margin-top: 24px;
    padding: 20px 24px;
  }

  .book-info__extra {
    margin-top: 24px;
    padding-top: 24px;
    gap: 18px;
  }

  .book-series {
    padding-top: 18px;
    padding-bottom: 20px;
  }

  .book-series__covers img {
    width: 114px;
    height: 160px;
    margin-left: -24px;
  }

  .book-series__covers {
    min-height: 168px;
    justify-content: center;
  }

  .book-reviews {
    padding-top: 30px;
  }

  .book-section-head {
    align-items: stretch;
    flex-direction: column;
    gap: 16px;
  }

  .book-section-head .ds-button,
  #review-button {
    width: 100%;
  }

  .book-reviews__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    margin-top: 20px;
  }

  .book-page .bestsellers {
    padding-top: 32px;
    padding-bottom: 40px;
  }
}

@media (max-width: 640px) {
  .book-product {
    padding-top: var(--book-edge-space) !important;
    padding-bottom: 16px !important;
  }
  .book-page__gallery {
    padding: 0 0 16px;
  }
  .book-gallery,
  .book-gallery__main,
  .book-gallery__main.is-placeholder,
  .book-gallery__thumbs {
    max-width: 360px;
  }
  .book-info__price {
    font-size: 36px;
  }
  .book-buy {
    align-items: stretch;
    flex-direction: column;
    gap: 12px;
  }
  .book-quantity {
    width: 100%;
  }
  .book-quantity > span {
    text-align: center;
  }
  .book-quantity > div {
    width: 100%;
    justify-content: center;
  }
  .book-quantity button {
    width: 60px;
  }
  .book-quantity output {
    min-width: 48px;
  }
  .book-buy > .ds-button {
    width: 100%;
  }
  .book-description {
    margin-top: 20px;
    padding: 18px 20px;
  }
  .book-description p {
    font-size: 17px;
  }
  .book-info__extra {
    margin-top: 20px;
    padding-top: 20px;
    gap: 16px;
  }
  .book-specs,
  .book-delivery {
    padding: 18px 20px;
  }
  .book-series {
    padding-top: 16px;
    padding-bottom: 18px;
  }
  .book-series__inner {
    grid-template-columns: 1fr;
    gap: 18px;
    padding: 24px 20px;
  }
  .book-series h2 {
    font-size: 26px;
  }
  .book-series__covers {
    justify-content: center;
    min-height: 156px;
    margin: 8px 0;
  }
  .book-series__covers img {
    width: 108px;
    height: 150px;
    margin-left: -22px;
  }
  .book-series__action {
    justify-self: stretch;
    text-align: center;
  }
  .book-series__action .ds-button {
    width: 100%;
  }
  .book-reviews {
    padding-top: 24px;
  }
  .book-reviews__grid {
    grid-template-columns: 1fr;
    gap: 14px;
    margin-top: 16px;
  }
  .book-reviews blockquote {
    padding: 20px;
  }
  .book-section-head {
    align-items: stretch;
    flex-direction: column;
    gap: 14px;
  }
  .book-section-head .ds-button,
  #review-button {
    width: 100%;
  }
  .book-page .bestsellers {
    padding-top: 24px;
    padding-bottom: 32px;
  }
  .book-related__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .book-related__cover {
    height: 200px;
  }
}

@media (max-width: 480px) {
  .book-product {
    padding-bottom: 12px !important;
  }
  .book-page__gallery {
    padding: 0 0 12px;
  }
  .book-gallery,
  .book-gallery__main,
  .book-gallery__main.is-placeholder,
  .book-gallery__thumbs {
    max-width: 320px;
  }
  .book-gallery__zoom-btn {
    margin-top: 12px;
    padding: 6px 15px;
    font-size: var(--ds-font-size-sm);
  }
  .book-gallery__thumbs {
    gap: 8px;
    margin-top: 14px;
  }
  .book-gallery__thumb {
    width: 44px;
    height: 44px;
  }
  .book-description {
    margin-top: 16px;
    padding: 16px 16px;
  }
  .book-info__extra {
    margin-top: 16px;
    padding-top: 16px;
    gap: 12px;
  }
  .book-specs,
  .book-delivery {
    padding: 16px 16px;
  }
  .book-series {
    padding-top: 14px;
    padding-bottom: 16px;
  }
  .book-series__inner {
    padding: 18px 14px;
    gap: 14px;
  }
  .book-series h2 {
    font-size: 22px;
  }
  .book-series__covers {
    min-height: 140px;
    margin: 6px 0;
  }
  .book-series__covers img {
    width: 96px;
    height: 134px;
    margin-left: -18px;
  }
  .book-reviews {
    padding-top: 18px;
  }
  .book-section-head {
    align-items: stretch;
    flex-direction: column;
    gap: 12px;
  }
  .book-section-head .ds-button,
  #review-button {
    width: 100%;
  }
  .book-reviews__grid {
    gap: 12px;
    margin-top: 12px;
  }
  .book-reviews blockquote {
    padding: 16px;
  }
  .book-page .bestsellers {
    padding-top: 18px;
    padding-bottom: 24px;
  }
}
@media (prefers-reduced-motion: reduce) { .book-related__cover { transition: none; }.book-share__menu { scroll-behavior: auto; } }

/* ── Аудиоплеер для книги ── */
.book-audio-box {
  margin-top: 28px;
}

.book-audio-box .book-section-label {
  margin-bottom: 12px;
}

.audio-player {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 20px;
  background-color: var(--color-dark);
  color: var(--ds-color-text-inverse);
  border-radius: var(--ds-radius-lg);
}

.audio-player__play {
  width: 52px;
  height: 52px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 50%;
  background-color: var(--ds-color-text-inverse);
  color: var(--color-dark);
  cursor: pointer;
  transition: transform 0.2s ease, background-color 0.25s ease;
}

.audio-player__play:hover {
  transform: scale(1.06);
  background-color: #ffffff;
}

.audio-player__play:focus-visible {
  outline: 3px solid var(--ds-color-focus);
  outline-offset: 3px;
}

.audio-player__icon-pause { display: none; }

.audio-player__play.is-playing .audio-player__icon-play { display: none; }
.audio-player__play.is-playing .audio-player__icon-pause { display: block; }

.audio-player__track {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.audio-player__range {
  --range-progress: 0%;
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 24px;
  margin: 0;
  padding: 5px 0;
  box-sizing: border-box;
  border-radius: 999px;
  background: transparent !important;
  cursor: pointer;
  overflow: visible;
}

.audio-player__range::-webkit-slider-container {
  display: flex;
  align-items: center;
  height: 100%;
}

.audio-player__range::-webkit-slider-runnable-track {
  height: 6px;
  margin: auto 0;
  border-radius: 999px;
  background: linear-gradient(
    to right,
    var(--ds-color-text-inverse) var(--range-progress, 0%),
    rgba(247, 239, 222, 0.28) var(--range-progress, 0%)
  );
}

.audio-player__range::-moz-range-track {
  height: 6px;
  border-radius: 999px;
  background: rgba(247, 239, 222, 0.28);
}

.audio-player__range::-moz-range-progress {
  height: 6px;
  border-radius: 999px;
  background: var(--ds-color-text-inverse);
}

.audio-player__range::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 14px;
  height: 14px;
  margin-top: -4px;
  border: none;
  border-radius: 50%;
  background-color: var(--ds-color-text-inverse);
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
  transition: transform 0.2s ease;
}

.audio-player__range::-webkit-slider-thumb:hover { transform: scale(1.15); }

.audio-player__range::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border: none;
  border-radius: 50%;
  background-color: var(--ds-color-text-inverse);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
  cursor: pointer;
}

.audio-player__range:focus-visible {
  outline: 3px solid var(--ds-color-focus);
  outline-offset: 4px;
}

.audio-player__times {
  display: flex;
  justify-content: space-between;
  font-size: var(--ds-font-size-md);
  font-weight: var(--ds-font-weight-medium);
  font-variant-numeric: tabular-nums;
  color: var(--ds-color-text-inverse);
}

