.ebook-section { max-width: 1400px; margin: 0 auto; padding: 28px 16px 44px; }
.ebook-heading { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 22px; }
.ebook-back { display: inline-flex; gap: 8px; align-items: center; color: var(--brand-700); font-size: 12px; font-weight: 600; margin-bottom: 12px; }
.storefront-ui main .ebook-heading h1 { font-size: clamp(20px, 2.2vw, 28px); max-width: 48ch; }
.ebook-heading p { color: #64748b; font-size: 13px; margin-top: 6px !important; }
.ebook-open-pdf { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; padding: 10px 14px; border: 1px solid var(--brand-100); border-radius: 9px; background: #fff; color: var(--brand-700); font-size: 12px; font-weight: 600; }
.ebook-reader { position: relative; border: 1px solid #dce3ea; border-radius: 16px; overflow: hidden; background: #e8edf2; box-shadow: 0 8px 28px rgba(15,23,42,.06); }
.ebook-reader [hidden] { display: none !important; }
.ebook-toolbar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 16px; background: #fff; border-bottom: 1px solid #dce3ea; }
.ebook-control-group { display: flex; align-items: center; gap: 8px; min-width: 0; font-size: 12px; color: #526276; }
.ebook-toolbar button { display: inline-flex; align-items: center; justify-content: center; min-width: 38px; min-height: 38px; padding: 7px; border: 1px solid #dce3ea; border-radius: 8px; background: #fff; color: #334155; font-size: 14px; line-height: 1; cursor: pointer; }
.ebook-toolbar button:hover:not(:disabled) { background: var(--brand-50); border-color: var(--brand-100); color: var(--brand-700); }
.ebook-toolbar button:disabled { cursor: default; opacity: .4; }
.ebook-toolbar button:focus-visible, .ebook-reader a:focus-visible { outline: 2px solid var(--brand-700); outline-offset: 2px; }
.ebook-page-label { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }
.ebook-page-label input { width: 58px; min-width: 0; height: 38px; border: 1px solid #dce3ea; border-radius: 7px; text-align: center; background: #f8fafc; color: #253348; font: inherit; }
.ebook-status { padding: 12px 16px; font-size: 13px; line-height: 1.7; text-align: center; color: #475569; background: #f8fafc; }
.ebook-status.is-error { color: #9f1239; background: #fff1f2; }
.ebook-stage { display: flex; align-items: flex-start; min-width: 0; height: clamp(340px, 68vh, 800px); overflow: auto; padding: 24px; background: radial-gradient(ellipse at center, #f2f4f7, #dfe6ed); touch-action: pan-y pinch-zoom; }
.ebook-spread { display: flex; align-items: flex-start; justify-content: center; gap: 4px; flex-shrink: 0; margin: auto; perspective: 1600px; }
.ebook-paper { flex-shrink: 0; position: relative; background: white; box-shadow: 0 5px 20px rgba(15,23,42,.18); backface-visibility: hidden; }
.ebook-spread.is-double .ebook-paper:first-child::after { content: ''; position: absolute; inset: 0 0 0 auto; width: 14px; pointer-events: none; background: linear-gradient(90deg, transparent, rgba(15,23,42,.08)); }
.ebook-spread.is-double .ebook-paper:last-child::after { content: ''; position: absolute; inset: 0 auto 0 0; width: 14px; pointer-events: none; background: linear-gradient(90deg, rgba(15,23,42,.08), transparent); }
.ebook-paper canvas { display: block; max-width: none; }
.ebook-bottom { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px; padding: 12px 16px; background: #fff; color: #64748b; font-size: 11px; line-height: 1.6; border-top: 1px solid #dce3ea; }
.ebook-reader:is(:fullscreen, .is-expanded) { display: flex; flex-direction: column; width: 100%; height: 100%; border: 0; border-radius: 0; }
.ebook-reader.is-expanded { position: fixed; inset: 0; z-index: 2001; height: 100vh; height: 100dvh; }
body.ebook-expanded { overflow: hidden; }
.ebook-reader:is(:fullscreen, .is-expanded) .ebook-stage { flex: 1; height: auto; min-height: 0; }
.ebook-reader:is(:fullscreen, .is-expanded) .ebook-status { position: absolute; left: 0; right: 0; bottom: 44px; z-index: 2; }
@media (max-width: 639px) {
  .ebook-section { padding: 20px 12px 32px; }
  .ebook-toolbar { gap: 8px; padding: 10px; }
  .ebook-control-group { gap: 6px; }
  .ebook-stage { padding: 12px; height: max(340px, 62vh); }
  .ebook-bottom { padding: 10px 12px; }
}
