/* Product detail — Edubooks-inspired layout for Chihongoi.vn */
.pd-page {
  --pd-primary: #0b57a4;
  --pd-primary-dark: #084680;
  --pd-buy: #16a34a;
  --pd-buy-dark: #15803d;
  --pd-bg: #f5f7fb;
  --pd-surface: #ffffff;
  --pd-border: #e6ebf2;
  --pd-text: #1f2937;
  --pd-muted: #64748b;
  --pd-radius: 12px;
  background: var(--pd-bg);
  padding: 20px 0 56px;
  color: var(--pd-text);
}

.pd-breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  font-size: 14px;
  color: var(--pd-muted);
}

.pd-breadcrumb a {
  color: var(--pd-primary);
  text-decoration: none;
  font-weight: 600;
}

.pd-breadcrumb__current {
  color: var(--pd-text);
  font-weight: 600;
}

.pd-topcard {
  background: var(--pd-surface);
  border: 1px solid var(--pd-border);
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.04);
}

.pd-gallery__main {
  position: relative;
  background: #f8fafc;
  border: 1px solid var(--pd-border);
  border-radius: 14px;
  overflow: hidden;
  min-height: 360px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pd-gallery__main img,
.pd-gallery__main video {
  width: 100%;
  max-height: 520px;
  object-fit: contain;
  display: block;
}

.pd-gallery__main audio {
  width: 90%;
  margin: 40px auto;
}

.pd-preview-btn {
  position: absolute;
  right: 14px;
  bottom: 14px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 14px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.78);
  color: #fff !important;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none !important;
}

.pd-preview-btn:hover {
  background: rgba(15, 23, 42, 0.92);
  color: #fff !important;
}

.pd-thumbs {
  display: flex;
  gap: 10px;
  margin-top: 12px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.pd-thumb {
  flex: 0 0 72px;
  width: 72px;
  height: 72px;
  border: 2px solid transparent;
  border-radius: 10px;
  overflow: hidden;
  background: #f8fafc;
  padding: 0;
  cursor: pointer;
}

.pd-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.pd-thumb.is-active,
.pd-thumb:hover {
  border-color: var(--pd-primary);
}

.pd-hero__placeholder {
  min-height: 320px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: #94a3b8;
}

.pd-hero__placeholder .material-symbols-outlined {
  font-size: 64px;
}

.pd-info {
  padding-left: 8px;
}

.pd-title {
  margin: 0 0 14px;
  font-size: 28px;
  line-height: 1.35;
  font-weight: 800;
  color: #0f172a;
  text-transform: none !important;
}

.pd-author-box {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  padding: 10px 14px;
  background: #f1f5f9;
  border-left: 4px solid var(--pd-primary);
  border-radius: 0 10px 10px 0;
  font-size: 15px;
  color: #334155;
}

.pd-author-box a,
.pd-author-box strong {
  color: var(--pd-primary);
  font-weight: 800;
  text-decoration: none;
}

.pd-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.pd-tag {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  background: #eef2f7;
  color: #475569;
  font-size: 13px;
  font-weight: 600;
}

.pd-rating-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
  color: var(--pd-muted);
  font-size: 14px;
}

.pd-price-block {
  margin-bottom: 14px;
}

.pd-price {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.pd-price strong {
  font-size: 34px;
  line-height: 1;
  font-weight: 800;
  color: var(--pd-primary);
}

.pd-price del {
  font-size: 18px;
  color: #94a3b8;
}

.pd-free-badge {
  display: inline-block;
  padding: 6px 14px;
  border-radius: 999px;
  background: #dcfce7;
  color: #166534 !important;
  font-size: 20px !important;
}

.pd-price-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid #eef2f7;
  cursor: pointer;
}

.pd-price-option__name {
  flex: 1;
  font-weight: 600;
  color: #334155;
}

.pd-price-option__value strong {
  color: var(--pd-primary);
  font-size: 18px;
}

.pd-price-option__value del {
  color: #94a3b8;
  margin-right: 6px;
}

.pd-trust {
  list-style: none;
  margin: 0 0 18px;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
}

.pd-trust li {
  position: relative;
  padding-left: 18px;
  font-size: 14px;
  font-weight: 600;
  color: #166534;
}

.pd-trust li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 7px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #22c55e;
}

.pd-cta-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 10px;
}

.pd-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 16px;
  border-radius: 10px;
  border: 1px solid transparent;
  font-size: 15px;
  font-weight: 700;
  text-decoration: none !important;
  cursor: pointer;
  transition: background-color 0.2s, border-color 0.2s, color 0.2s;
}

.pd-cta--wish {
  background: #fff;
  border-color: #e2e8f0;
  color: #334155;
}

.pd-cta--wish .fa-heart {
  color: #94a3b8;
}

.pd-cta--wish.is-liked,
.pd-cta--wish:has(.fa-heart.active) {
  background: #eff6ff;
  border-color: #93c5fd;
  color: var(--pd-primary);
}

.pd-cta--wish.is-liked .fa-heart,
.pd-cta--wish .fa-heart.active {
  color: var(--pd-primary);
}

.pd-cta--cart {
  background: #fff7ed;
  border-color: #fed7aa;
  color: #c2410c;
}

.pd-cta--buy {
  width: 100%;
  min-height: 54px;
  margin-bottom: 10px;
  background: var(--pd-buy);
  color: #fff !important;
  font-size: 16px;
  letter-spacing: 0.2px;
}

.pd-cta--buy:hover {
  background: var(--pd-buy-dark);
  color: #fff !important;
}

.pd-support-note {
  margin: 0 0 14px;
  padding: 12px 14px;
  border-radius: 10px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #1e3a5f;
  font-size: 13.5px;
  font-weight: 500;
  line-height: 1.55;
}

.pd-support-note strong {
  color: #0068ff;
  font-weight: 800;
}

.pd-cta--preview {
  width: 100%;
  background: #f8fafc;
  border-color: var(--pd-border);
  color: #334155;
  margin-bottom: 14px;
}

.pd-promo {
  background: #f8fafc;
  border: 1px solid var(--pd-border);
  border-radius: 12px;
  padding: 16px 18px;
}

.pd-promo h3 {
  margin: 0 0 10px;
  font-size: 16px;
  font-weight: 800;
  color: #0f172a;
  text-transform: none !important;
}

.pd-promo ul {
  margin: 0;
  padding-left: 18px;
}

.pd-promo li {
  margin-bottom: 6px;
  font-size: 14px;
  line-height: 1.55;
  color: #475569;
}

.pd-card {
  background: var(--pd-surface);
  border: 1px solid var(--pd-border);
  border-radius: var(--pd-radius);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.04);
  overflow: hidden;
}

/* ===== Edubooks bottom detail ===== */
.pd-edu-detail {
  margin-top: 36px;
  background: #fff;
  padding: 12px 48px 32px;
}

.pd-edu-detail,
.pd-edu-detail h1,
.pd-edu-detail h2,
.pd-edu-detail h3,
.pd-edu-detail h4,
.pd-edu-detail p,
.pd-edu-detail a,
.pd-edu-detail button,
.pd-edu-detail span,
.pd-edu-detail li {
  text-transform: none !important;
}

.pd-edu-tabs-wrap {
  border-bottom: 1px solid #e5e7eb;
}

.pd-edu-tabs {
  display: flex !important;
  flex-wrap: wrap;
  gap: 0;
  border: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  min-height: 0 !important;
  max-width: none !important;
  justify-content: flex-start !important;
  align-items: flex-end !important;
}

.pd-edu-tabs .nav-item {
  margin: 0;
}

.pd-edu-tabs .nav-link {
  position: relative;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  color: #6b7280 !important;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.3;
  padding: 14px 22px 14px 0;
  margin-right: 28px;
}

.pd-edu-tabs .nav-link.active {
  color: #0a2540 !important;
  font-weight: 700;
}

.pd-edu-tabs .nav-link:hover {
  color: #0a2540 !important;
}

.pd-edu-body {
  padding: 22px 0 8px;
}

.pd-edu-author {
  margin: 0 0 14px;
  font-size: 16px;
  font-weight: 700;
  color: #111827;
  line-height: 1.5;
}

.pd-edu-author a,
.pd-edu-author span {
  color: #111827;
  font-weight: 700;
  text-decoration: none;
}

.pd-edu-author a:hover {
  color: #0b57a4;
  text-decoration: underline;
}

.pd-edu-desc,
.pd-edu-desc p,
.pd-edu-desc li {
  font-size: 15px;
  line-height: 1.75;
  color: #374151;
}

.pd-edu-desc p {
  margin: 0 0 8px;
}

.pd-edu-desc ul {
  margin: 0 0 8px;
  padding-left: 0;
  list-style: none;
}

.pd-edu-desc ul li {
  position: relative;
  padding-left: 14px;
  margin: 4px 0;
}

.pd-edu-desc ul li::before {
  content: "-";
  position: absolute;
  left: 0;
  color: #374151;
}

.pd-edu-desc img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
}

.pd-description--clamp {
  max-height: 168px;
  overflow: hidden;
  position: relative;
}

.pd-description--clamp::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 56px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0), #fff 85%);
  pointer-events: none;
}

.pd-edu-more {
  display: flex;
  justify-content: center;
  margin: 18px 0 8px;
}

.pd-edu-more-btn {
  min-width: 118px;
  min-height: 38px;
  padding: 0 28px;
  border-radius: 999px;
  border: 1px solid #d1d5db;
  background: #fff;
  color: #111827;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  box-shadow: none;
}

.pd-edu-more-btn:hover {
  border-color: #9ca3af;
  color: #0a2540;
}

.pd-edu-specs {
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
}

.pd-edu-specs li {
  margin: 4px 0;
  font-size: 15px;
  line-height: 1.7;
  color: #374151;
}

.pd-edu-preview {
  margin-top: 28px;
  padding-top: 4px;
}

.pd-edu-preview__title {
  margin: 0 0 16px;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 0.4px;
  color: #0a2540;
  text-transform: uppercase !important;
}

.pd-edu-preview__row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 12px;
}

.pd-edu-thumb {
  display: block;
  width: auto;
  height: 148px;
  padding: 0;
  border: 0;
  background: transparent;
  border-radius: 6px;
  overflow: hidden;
  cursor: zoom-in;
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.08);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.pd-edu-thumb img {
  display: block;
  width: auto;
  height: 148px;
  max-width: 110px;
  object-fit: cover;
  margin: 0 !important;
  border-radius: 6px;
}

.pd-edu-thumb:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.12);
}

.pd-edu-empty {
  margin: 0;
  color: #6b7280;
  font-size: 14px;
}

.pd-empty {
  margin: 0;
  color: var(--pd-muted);
}

.pd-filter {
  margin-bottom: 16px;
}

.pd-comment-form textarea {
  border-radius: 12px;
  border: 1px solid var(--pd-border);
  font-size: 15px;
}

.pd-related {
  margin-top: 28px;
}

.pd-related__head h2 {
  margin: 0 0 6px;
  font-size: 26px;
  font-weight: 800;
  color: #0f172a;
  text-transform: none !important;
}

.pd-related__head p {
  margin: 0 0 16px;
  color: var(--pd-muted);
}

.pd-related__scroller {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  padding: 2px 2px 12px;
  scrollbar-width: thin;
}

.pd-related__scroller::-webkit-scrollbar {
  height: 6px;
}

.pd-related__scroller::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 999px;
}

.pd-related-card {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  flex: 0 0 calc(50% - 6px);
  min-width: 260px;
  max-width: 420px;
  scroll-snap-align: start;
  background: var(--pd-surface);
  border: 1px solid var(--pd-border);
  border-radius: var(--pd-radius);
  overflow: hidden;
  text-decoration: none !important;
  color: inherit;
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.pd-related-card:hover {
  border-color: #bfdbfe;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
}

.pd-related-card__thumb {
  flex: 0 0 110px;
  width: 110px;
  min-height: 132px;
  background: #eef3f9;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-right: 1px solid var(--pd-border);
}

.pd-related-card__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
}

.pd-related-card__thumb .material-symbols-outlined {
  font-size: 40px;
  color: #94a3b8;
}

.pd-related-card__body {
  flex: 1;
  min-width: 0;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.pd-related-card__body h3 {
  margin: 0;
  font-size: 15px;
  line-height: 1.35;
  font-weight: 700;
  color: #0f172a;
  text-transform: none !important;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.pd-related-card__body p {
  margin: 0;
  font-size: 13px;
  color: var(--pd-muted);
}

.pd-related-card__price {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: auto;
  color: var(--pd-primary);
  font-size: 15px;
}

.pd-related-card__price del {
  color: #94a3b8;
  font-size: 13px;
}

@media (max-width: 991px) {
  .pd-info {
    padding-left: 0;
  }

  .pd-title {
    font-size: 24px;
  }

  .pd-gallery__main {
    min-height: 280px;
  }

  .pd-edu-detail {
    padding: 10px 28px 28px;
  }

  .pd-edu-tabs .nav-link {
    margin-right: 18px;
    padding-right: 8px;
    font-size: 15px;
  }

  .pd-edu-thumb,
  .pd-edu-thumb img {
    height: 128px;
  }

  .pd-edu-thumb img {
    max-width: 96px;
  }
}

@media (max-width: 575px) {
  .pd-edu-detail {
    padding: 8px 16px 24px;
  }

  .pd-topcard {
    padding: 16px;
  }

  .pd-title {
    font-size: 22px;
  }

  .pd-price strong {
    font-size: 28px;
  }

  .pd-cta-row {
    grid-template-columns: 1fr;
  }

  .pd-cta--buy {
    font-size: 15px;
    text-align: center;
    padding: 12px;
    min-height: 56px;
  }

  .pd-edu-tabs .nav-link {
    font-size: 14px;
    margin-right: 14px;
    padding: 12px 4px 12px 0;
  }

  .pd-edu-preview__title {
    font-size: 16px;
  }

  .pd-related-card {
    flex: 0 0 calc(50% - 6px);
    min-width: 0;
    max-width: none;
  }

  .pd-related-card__thumb {
    flex: 0 0 88px;
    width: 88px;
    min-height: 110px;
  }

  .pd-related-card__body {
    padding: 10px;
    gap: 4px;
  }

  .pd-related-card__body h3 {
    font-size: 13px;
    -webkit-line-clamp: 3;
  }

  .pd-related-card__body p {
    font-size: 11px;
  }

  .pd-related-card__price {
    font-size: 13px;
  }

  .pd-edu-thumb,
  .pd-edu-thumb img {
    height: 112px;
  }

  .pd-edu-thumb img {
    max-width: 84px;
  }
}

/* Preview lightbox (Edubooks-style) */
body.pd-lightbox-open {
  overflow: hidden;
}

.pd-main-clickable {
  cursor: zoom-in;
}

.pd-edu-thumb,
.pd-preview-item {
  cursor: zoom-in;
}

.pd-lightbox {
  position: fixed;
  inset: 0;
  z-index: 10050;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px 16px 20px;
}

.pd-lightbox[hidden] {
  display: none !important;
}

.pd-lightbox__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.82);
}

.pd-lightbox__close,
.pd-lightbox__nav {
  position: absolute;
  z-index: 2;
  width: 46px;
  height: 46px;
  border: 0;
  border-radius: 50%;
  background: #fff;
  color: #111827;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

.pd-lightbox__close {
  top: 18px;
  right: 18px;
  font-size: 32px;
}

.pd-lightbox__nav--prev {
  left: 18px;
  top: 50%;
  transform: translateY(-50%);
}

.pd-lightbox__nav--next {
  right: 18px;
  top: 50%;
  transform: translateY(-50%);
}

.pd-lightbox__stage {
  position: relative;
  z-index: 1;
  width: min(720px, calc(100vw - 120px));
  max-height: calc(100vh - 160px);
  background: #fff;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.pd-lightbox__counter {
  position: absolute;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  min-width: 64px;
  padding: 4px 12px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.7);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  text-align: center;
}

.pd-lightbox__stage img {
  display: block;
  width: 100%;
  max-height: calc(100vh - 160px);
  object-fit: contain;
  background: #fff;
}

.pd-lightbox__thumbs {
  position: relative;
  z-index: 1;
  display: flex;
  gap: 10px;
  margin-top: 16px;
  max-width: min(720px, calc(100vw - 40px));
  overflow-x: auto;
  padding: 4px;
}

.pd-lightbox__thumb {
  flex: 0 0 64px;
  width: 64px;
  height: 64px;
  padding: 0;
  border: 2px solid transparent;
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
  cursor: pointer;
}

.pd-lightbox__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.pd-lightbox__thumb.is-active,
.pd-lightbox__thumb:hover {
  border-color: #fff;
  box-shadow: 0 0 0 2px var(--pd-primary, #0b57a4);
}

@media (max-width: 767px) {
  .pd-lightbox__nav--prev {
    left: 8px;
  }

  .pd-lightbox__nav--next {
    right: 8px;
  }

  .pd-lightbox__stage {
    width: calc(100vw - 24px);
    max-height: calc(100vh - 180px);
  }

  .pd-lightbox__close {
    top: 10px;
    right: 10px;
  }
}
