/* =====================================================================
   Book details page
   ===================================================================== */
.page-book main { background: #fff; }

/* Slim breadcrumb instead of the big banner */
.pd-crumbs { background: #faf7f6; border-bottom: 1px solid #f1ecea; }
.pd-crumbs ol { list-style: none; margin: 0; padding: 14px 0; display: flex; flex-wrap: wrap; gap: 6px; font-size: 13px; }
.pd-crumbs li { display: flex; align-items: center; gap: 6px; color: var(--text); }
.pd-crumbs li + li::before { content: "\f105"; font-family: "Font Awesome 6 Pro"; font-size: 11px; color: #b9b9c2; }
.pd-crumbs a { color: var(--text); }
.pd-crumbs a:hover { color: var(--theme); }
.pd-crumbs span[aria-current] { color: var(--header); font-weight: 600; max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.pd-main { padding: 40px 0 56px; }

/* Gallery */
.pd-gallery { position: sticky; top: 110px; }
.pd-stage { position: relative; border-radius: 24px; padding: 44px 30px; display: flex; align-items: center; justify-content: center; min-height: 460px;
  background: radial-gradient(120% 90% at 50% 0%, #fff6f4 0%, #fbe9e6 60%, #f5dedb 100%); overflow: hidden; }
.pd-stage::after { content: ""; position: absolute; left: 50%; bottom: 36px; width: 60%; height: 18px; transform: translateX(-50%); background: radial-gradient(closest-side, rgba(17,17,44,.22), transparent); filter: blur(2px); }
.pd-cover { position: relative; z-index: 1; width: 62%; max-width: 300px; height: auto; aspect-ratio: 2 / 3; object-fit: cover; border-radius: 4px 10px 10px 4px;
  box-shadow: -4px 0 0 rgba(0,0,0,.08) inset, 0 30px 50px -20px rgba(17, 17, 44, .55), 0 10px 18px -10px rgba(17, 17, 44, .35); transition: opacity .2s; }
.pd-badges { position: absolute; top: 18px; left: 18px; z-index: 2; display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.pd-thumbs { display: flex; gap: 10px; margin-top: 14px; flex-wrap: wrap; }
.pd-thumb { width: 70px; height: 92px; border-radius: 12px; padding: 6px; background: #faf5f4; border: 2px solid transparent; display: flex; align-items: center; justify-content: center; transition: border-color .2s; }
.pd-thumb img { max-width: 100%; max-height: 100%; border-radius: 3px; object-fit: cover; }
.pd-thumb.active, .pd-thumb:hover { border-color: var(--theme); }

/* Summary */
.pd-cat { display: inline-block; font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: #c6493a; background: var(--bg); padding: 5px 12px; border-radius: 100px; margin-bottom: 14px; }
.pd-cat:hover { color: #fff; background: var(--theme); }
.pd-title { font-size: clamp(28px, 3.2vw, 42px); line-height: 1.15; font-weight: 800; letter-spacing: -.02em; color: var(--header); margin: 0 0 10px; }
.pd-byline { font-size: 16px; color: var(--text); margin: 0 0 12px; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; }
.pd-byline a { color: var(--header); font-weight: 600; }
.pd-byline a:hover { color: var(--theme); }
.pd-byline .muted { color: var(--text); font-weight: 500; }
.pd-byline .dot { color: #c9c9d1; }
.pd-rating { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; color: var(--text); margin-bottom: 22px; }
.pd-rating strong { color: var(--header); }
.pd-rating span:last-child { text-decoration: underline; text-underline-offset: 3px; }
.pd-rating:hover span:last-child { color: var(--theme); }
.pd-rating .bc-stars i { font-size: 14px; }

.pd-buybox { border: 1px solid #eeeef3; border-radius: 20px; padding: 24px; background: #fff; box-shadow: 0 14px 40px -24px rgba(17, 17, 44, .25); }
.pd-price { display: flex; align-items: baseline; flex-wrap: wrap; gap: 6px 12px; }
.pd-price strong { font-size: 36px; font-weight: 800; color: var(--header); letter-spacing: -.02em; line-height: 1; }
.pd-price del { font-size: 18px; color: #9a9aa6; }
.pd-save { font-size: 13px; font-weight: 700; color: #1d7a45; background: #e5f5ec; padding: 5px 10px; border-radius: 8px; }
.pd-offer { margin: 10px 0 0; font-size: 14px; font-weight: 600; color: #c6493a; }
.pd-tax { font-size: 13px; color: var(--text); margin: 8px 0 14px; }
.pd-stock { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; margin: 0 0 18px; padding: 6px 12px; border-radius: 100px; }
.pd-stock::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.pd-stock.in { color: #1d7a45; background: #e9f7ef; }
.pd-stock.low { color: #9a5b00; background: #fff4de; }
.pd-stock.out { color: #b42323; background: #fdecec; }

.pd-actions { display: flex; flex-wrap: wrap; align-items: stretch; gap: 10px; }
.pd-qty { height: 52px; border-radius: 14px; }
.pd-qty button { height: 50px; width: 42px; font-size: 20px; }
.pd-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 52px; padding: 0 26px; border-radius: 14px; font-size: 15px; font-weight: 700; border: 0; cursor: pointer; transition: background .2s, box-shadow .2s, transform .1s; }
.pd-btn:active { transform: translateY(1px); }
.pd-btn.primary { background: var(--theme); color: #fff; flex: 1 1 180px; box-shadow: 0 10px 22px -10px rgba(255, 123, 107, .9); }
.pd-btn.primary:hover { background: #f4604e; }
.pd-btn.dark { background: var(--header); color: #fff; flex: 1 1 140px; }
.pd-btn.dark:hover { background: #26264a; }
.pd-btn:disabled { opacity: .55; cursor: not-allowed; box-shadow: none; }
.pd-btn.is-loading { opacity: .75; pointer-events: none; }
.pd-wish { width: 52px; height: 52px; border-radius: 14px; border: 1.5px solid #e6e6ee; display: inline-flex; align-items: center; justify-content: center; color: var(--header); font-size: 18px; transition: all .2s; }
.pd-wish:hover { border-color: var(--theme); color: var(--theme); }
.pd-wish.active { background: var(--theme); border-color: var(--theme); color: #fff; }
.pd-wish.active i { color: #fff !important; }
.pd-note { font-size: 13px; color: var(--text); margin: 10px 0 0; }

.pd-perks { list-style: none; padding: 18px 0 0; margin: 20px 0 0; border-top: 1px dashed #e6e6ee; display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.pd-perks li { display: flex; gap: 12px; align-items: flex-start; }
.pd-perks i { width: 38px; height: 38px; flex-shrink: 0; border-radius: 12px; background: var(--bg); color: var(--theme); display: flex; align-items: center; justify-content: center; font-size: 15px; }
.pd-perks strong { display: block; font-size: 14px; color: var(--header); }
.pd-perks span { font-size: 12px; color: var(--text); }

.pd-short { font-size: 16px; line-height: 1.7; color: #4a4a58; margin: 24px 0 0; }
.pd-specs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 22px; }
.pd-spec { border: 1px solid #eeeef3; border-radius: 14px; padding: 12px 14px; display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 10px; align-items: center; }
.pd-spec i { grid-row: span 2; color: var(--theme); font-size: 17px; }
.pd-spec span { font-size: 11px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--text); }
.pd-spec strong { font-size: 14px; color: var(--header); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Tabs */
.pd-info { padding: 10px 0 60px; }
.pd-tabs { display: flex; gap: 6px; border-bottom: 1px solid #ececf2; margin-bottom: 30px; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
.pd-tabs li { list-style: none; }
.pd-tabs a { display: inline-flex; align-items: center; gap: 8px; padding: 14px 18px; font-size: 15px; font-weight: 600; color: var(--text); border-bottom: 3px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.pd-tabs a:hover { color: var(--header); }
.pd-tabs a.active { color: var(--header); border-bottom-color: var(--theme); }
.pd-tabs em { font-style: normal; font-size: 12px; background: #f1f1f5; color: var(--header); padding: 1px 8px; border-radius: 100px; }
.pd-prose { font-size: 16px; line-height: 1.8; color: #4a4a58; max-width: 820px; }
.pd-prose p { margin-bottom: 1em; }
.pd-details { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0 40px; max-width: 900px; margin: 0; }
.pd-details div { display: flex; justify-content: space-between; gap: 16px; padding: 13px 0; border-bottom: 1px solid #f0f0f4; }
.pd-details dt { font-weight: 500; color: var(--text); }
.pd-details dd { margin: 0; font-weight: 600; color: var(--header); text-align: right; }
.pd-details dd a { color: var(--header); text-decoration: underline; text-underline-offset: 3px; }
.pd-author { display: flex; gap: 28px; align-items: flex-start; }
.pd-author-photo img, .pd-author-photo .avatar-initials { width: 120px; height: 120px; border-radius: 50%; object-fit: cover; font-size: 34px; flex-shrink: 0; }
.pd-author h3 { font-size: 22px; margin-bottom: 10px; }
.pd-author h3 a { color: var(--header); }
.pd-link { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; color: var(--theme); }
.pd-link:hover { color: #c6493a; }

/* Reviews */
.pd-rating-summary { background: #faf7f6; border-radius: 20px; padding: 26px; text-align: center; }
.pd-rating-summary .big { font-size: 52px; font-weight: 800; color: var(--header); line-height: 1; }
.pd-rating-summary .bc-stars i { font-size: 16px; }
.pd-rating-summary p { margin: 8px 0 18px; color: var(--text); font-size: 14px; }
.pd-bars { list-style: none; padding: 0; margin: 0; text-align: left; }
.pd-bars li { display: grid; grid-template-columns: 42px 1fr 24px; gap: 10px; align-items: center; font-size: 13px; margin-bottom: 8px; color: var(--header); }
.pd-bars li span i { color: #FFB800; font-size: 11px; }
.pd-bars b { height: 8px; border-radius: 100px; background: #ececf2; overflow: hidden; }
.pd-bars b i { display: block; height: 100%; background: #FFB800; border-radius: 100px; }
.pd-bars em { font-style: normal; color: var(--text); text-align: right; }
.pd-review { border-bottom: 1px solid #f0f0f4; padding: 0 0 20px; margin-bottom: 20px; }
.pd-review header { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.pd-review header .avatar-initials { width: 44px; height: 44px; flex-shrink: 0; }
.pd-review header div { flex: 1; display: flex; flex-wrap: wrap; align-items: center; gap: 2px 10px; }
.pd-review header strong { color: var(--header); }
.pd-review header small { width: 100%; color: var(--text); font-size: 12px; }
.pd-review .verified { font-size: 12px; font-weight: 600; color: #1d7a45; }
.pd-review h4 { font-size: 16px; margin: 0 0 6px; }
.pd-review .pd-prose { font-size: 15px; }
.pd-empty { color: var(--text); }
.pd-review-form { background: #faf7f6; border-radius: 20px; padding: 24px; margin-top: 10px; }
.pd-review-form h3 { font-size: 20px; margin-bottom: 14px; }
.pd-review-form a { color: var(--theme); font-weight: 600; }
.pd-star-row { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; font-weight: 600; color: var(--header); }
.pd-star-row .star button { background: none; border: 0; padding: 0 2px; color: #FFB800; font-size: 22px; }

/* Rails */
.pd-rail { padding: 10px 0 56px; }
.pd-rail + .pd-rail { padding-top: 0; }
.pd-rail-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; }
.pd-rail-head h2 { font-size: clamp(22px, 2.4vw, 30px); margin: 0; }

/* Mobile sticky buy bar */
.pd-sticky { display: none; }
@media (max-width: 991px) {
  .pd-gallery { position: static; }
  .pd-stage { min-height: 360px; padding: 34px 24px; }
  .pd-details { grid-template-columns: 1fr; }
}
@media (max-width: 767px) {
  .pd-main { padding: 20px 0 36px; }
  .pd-specs { grid-template-columns: repeat(2, 1fr); }
  .pd-perks { grid-template-columns: 1fr; }
  .pd-buybox { padding: 18px; }
  .pd-price strong { font-size: 30px; }
  .pd-author { flex-direction: column; gap: 16px; }
  .pd-sticky { display: flex; align-items: center; justify-content: space-between; gap: 12px; position: fixed; left: 0; right: 0; bottom: 0; z-index: 1040; padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); background: #fff; border-top: 1px solid #ececf2; box-shadow: 0 -8px 24px rgba(17,17,44,.08); }
  .pd-sticky strong { font-size: 20px; color: var(--header); }
  .pd-sticky del { font-size: 13px; color: #9a9aa6; }
  .pd-sticky .pd-btn { height: 46px; flex: 0 0 auto; padding: 0 20px; }
  .page-book footer { padding-bottom: 70px; }
  .page-book .back-to-top { bottom: 84px; }
}
