/* ==========================================================================
   Trang chi tiết sản phẩm (HomeNfcShop/ProductDetail) - thiết kế lại, dùng
   chung 1 file cho cả PC lẫn mobile (nạp qua @section styles ở cả 2 layout).
   Cùng ngôn ngữ thiết kế với trang Shop cá nhân (shopMember.css): tông teal,
   thẻ bo góc mềm, shadow nhẹ. Không đụng .product-item / _ItemProductPc2 -
   sản phẩm liên quan phải giữ nguyên style như trang chủ.
   ========================================================================== */

.pd-page {
  --pd-primary: #0891b2;
  --pd-primary-dark: #0e7490;
  --pd-ink: #134e4a;
  --pd-muted: #64748b;
  --pd-bg: #f4f8fa;
  --pd-card: #ffffff;
  --pd-border: #e2edf0;
  --pd-danger: #e53935;
  --pd-star: #fbbf24;
  --pd-radius-lg: 20px;
  --pd-radius-md: 14px;
  --pd-radius-sm: 10px;
  --pd-shadow: 0 10px 28px rgba(14, 116, 144, .08);
  background: var(--pd-bg);
  padding-top: 14px;
  padding-bottom: 32px;
  color: #1e293b;
}

.pd-page * {
  box-sizing: border-box;
}

.pd-page a {
  text-decoration: none;
  color: inherit;
}

/* ---------- Thanh tiêu đề mobile (thay breadcrumb khi < 992px) ---------- */

.pd-mobile-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  padding: 10px 14px;
  background: var(--pd-card);
  border-radius: var(--pd-radius-sm);
  box-shadow: var(--pd-shadow);
}

.pd-mobile-bar__back {
  flex: none;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: #ecfeff;
  color: var(--pd-primary-dark);
}

.pd-mobile-bar__title {
  flex: 1;
  min-width: 0;
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  color: var(--pd-ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ---------- Khối chính: gallery + thông tin ---------- */

.pd-main {
  padding: 18px;
  background: var(--pd-card);
  border-radius: var(--pd-radius-lg);
  box-shadow: var(--pd-shadow);
}

.pd-gallery {
  border: 1px solid var(--pd-border);
  border-radius: var(--pd-radius-md);
  overflow: hidden;
  background: #fff;
}

.pd-gallery .product-img-list {
  position: relative;
  border: 0;
}

.pd-gallery .product-img-list > .item:not(:last-child) {
  display: none;
}

.pd-gallery .product-img-list img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: contain;
  background: #fff;
}

.pd-gallery .product-img-list .slick-arrow {
  position: absolute;
  top: 50%;
  z-index: 2;
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, .92);
  color: var(--pd-primary-dark);
  box-shadow: 0 4px 14px rgba(15, 23, 42, .16);
  cursor: pointer;
  opacity: 0;
  transform: translateY(-50%);
  transition: opacity .2s;
}

.pd-gallery .product-img-list:hover .slick-arrow {
  opacity: 1;
}

.pd-gallery .product-img-list .slick-prev {
  left: 10px;
}

.pd-gallery .product-img-list .slick-next {
  right: 10px;
}

.pd-thumbs {
  margin-top: 12px;
}

.pd-thumbs .product-thumb-nav > .item:not(:first-child) {
  display: none;
}

.pd-thumbs .item {
  padding: 0 4px;
  cursor: pointer;
}

.pd-thumbs .img-thumb {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border: 2px solid var(--pd-border);
  border-radius: 10px;
  transition: border-color .2s;
}

.pd-thumbs .slick-current .img-thumb {
  border-color: var(--pd-primary);
}

/* ---------- Thông tin sản phẩm ---------- */

.pd-info__name {
  margin: 0 0 10px;
  font-size: 22px;
  font-weight: 700;
  line-height: 1.35;
  color: var(--pd-ink);
}

/* .quantity-sold giữ nguyên tên vì JS cuối trang chọn ".quantity-sold
   .star-rating" để khởi tạo SimpleStarRating. */
.quantity-sold {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--pd-muted);
}

.quantity-sold .star-rating {
  font-size: 13px;
}

.quantity-sold .star-rating .active {
  color: var(--pd-star);
}

.pd-dot {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: #cbd5e1;
}

.pd-price {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 10px;
  margin: 16px 0;
  padding: 14px 16px;
  background: linear-gradient(135deg, #fff7ed, #fff);
  border: 1px solid #fde7cf;
  border-radius: var(--pd-radius-md);
}

.pd-price .price-new {
  font-size: 26px;
  font-weight: 700;
  color: var(--pd-danger);
}

.pd-price .price-old {
  font-size: 14px;
  color: var(--pd-muted);
  text-decoration: line-through;
}

.pd-price .percent {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--pd-danger);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
}

.pd-facts {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
  font-size: 13.5px;
  color: #334155;
}

.pd-facts b {
  color: var(--pd-ink);
  font-weight: 600;
}

.pd-desc-short {
  margin-bottom: 16px;
  padding-bottom: 16px;
  border-bottom: 1px dashed var(--pd-border);
  font-size: 13.5px;
  line-height: 1.6;
  color: #475569;
}

.pd-quantity {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.pd-quantity > span {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--pd-ink);
}

.pd-quantity .product-count input {
  width: 84px;
  height: 40px;
  padding: 0 10px;
  border: 1px solid var(--pd-border);
  border-radius: 10px;
  text-align: center;
  font-weight: 600;
}

/* ---------- Nút hành động: dùng chung .sm-btn nếu trang shop cá nhân có nạp,
   nhưng trang này độc lập nên khai riêng .pd-btn cùng công thức màu. ---------- */

.pd-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 16px;
}

.pd-btn {
  flex: 1;
  min-width: 140px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 46px;
  padding: 0 18px;
  border-radius: 12px;
  border: 1px solid transparent;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: box-shadow .2s, background .2s, color .2s, border-color .2s, opacity .2s;
}

.pd-btn--ghost {
  background: #fff;
  border-color: var(--pd-border);
  color: var(--pd-ink);
}

.pd-btn--ghost:hover {
  border-color: var(--pd-primary);
  color: var(--pd-primary-dark);
}

.pd-btn--cart {
  background: #ecfeff;
  border-color: #a5f3fc;
  color: var(--pd-primary-dark);
}

.pd-btn--cart:hover {
  box-shadow: 0 8px 20px rgba(8, 145, 178, .18);
}

.pd-btn--buy {
  background: linear-gradient(135deg, #f97316, var(--pd-danger));
  color: #fff;
}

.pd-btn--buy:hover {
  box-shadow: 0 8px 20px rgba(229, 57, 53, .3);
}

.pd-btn.disabled {
  opacity: .55;
  pointer-events: none;
}

.pd-share {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-top: 14px;
  border-top: 1px solid var(--pd-border);
  font-size: 13px;
  color: var(--pd-muted);
}

.pd-share button,
.pd-share img {
  border: 0;
  background: none;
  padding: 0;
  cursor: pointer;
}

.pd-share img {
  width: 26px;
  height: 26px;
  border-radius: 50%;
}

/* ---------- Section chung (shop info / sản phẩm tương tự / mô tả) ---------- */

.pd-section {
  margin-top: 18px;
  padding: 18px;
  background: var(--pd-card);
  border-radius: var(--pd-radius-lg);
  box-shadow: var(--pd-shadow);
}

.pd-section__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 14px;
}

.pd-section__head h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  color: var(--pd-ink);
}

.pd-section__head a {
  font-size: 13px;
  font-weight: 600;
  color: var(--pd-primary-dark);
}

/* ---------- Gian hàng bán ---------- */

.pd-seller {
  display: grid;
  grid-template-columns: 1.1fr 1fr 1fr;
  gap: 16px;
}

.pd-seller .avatar {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  overflow: hidden;
  flex: none;
  border: 1px solid var(--pd-border);
}

.pd-seller .avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.pd-seller .summary .name {
  font-weight: 700;
  color: var(--pd-ink);
}

.pd-seller .reputable {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 4px;
  padding: 2px 8px;
  border-radius: 999px;
  background: #ecfeff;
  color: var(--pd-primary-dark);
  font-size: 11px;
  font-weight: 700;
}

.pd-seller .btn-contact {
  display: inline-flex;
  align-items: center;
  height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  background: #f1f5f9;
  color: var(--pd-ink);
  font-size: 12px;
  font-weight: 600;
}

.pd-seller .btn-contact:hover {
  background: #ecfeff;
  color: var(--pd-primary-dark);
}

.pd-stat {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 10px 12px;
  background: var(--pd-bg);
  border-radius: var(--pd-radius-sm);
}

.pd-stat .label {
  font-size: 12px;
  color: var(--pd-muted);
}

.pd-stat .value {
  font-size: 15px;
  font-weight: 700;
  color: var(--pd-danger);
}

.pd-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.pd-contact-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 13px;
  color: #334155;
}

/* ---------- Mô tả dài + banner ---------- */

/* Dùng nguyên class .product-content-detail/.content-detail/.see-more vì
   JS cuối trang thao tác trực tiếp trên các class này (toggle .active,
   đổi chữ). Chỉ đổi giao diện, không đổi tên. */
.product-content-detail .content-detail {
  position: relative;
  max-height: 420px;
  overflow: hidden;
  font-size: 14px;
  line-height: 1.7;
  color: #334155;
}

.product-content-detail.active .content-detail {
  max-height: none;
}

.product-content-detail:not(.active) .content-detail::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 90px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0), #fff);
}

.product-content-detail .see-more {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 14px;
  padding: 8px 16px;
  border: 1px solid var(--pd-border);
  border-radius: 999px;
  background: #fff;
  color: var(--pd-primary-dark);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.product-content-detail .see-more:hover {
  border-color: var(--pd-primary);
}

.pd-banner-side img {
  width: 100%;
  border-radius: var(--pd-radius-md);
  margin-bottom: 12px;
}

/* ---------- Thanh mua cố định (mobile) ---------- */

.pd-buybar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: #fff;
  box-shadow: 0 -6px 20px rgba(15, 23, 42, .12);
}

.pd-buybar__price {
  flex: 1;
  min-width: 0;
  font-size: 17px;
  font-weight: 700;
  color: var(--pd-danger);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pd-buybar .pd-btn {
  flex: none;
  min-width: 0;
  height: 42px;
  padding: 0 14px;
  font-size: 13px;
}

@media (min-width: 992px) {
  .pd-buybar {
    display: none;
  }
}

/* ---------- Responsive ---------- */

@media (max-width: 991.98px) {
  .pd-main {
    padding: 14px;
  }

  .pd-section {
    padding: 14px;
  }

  .pd-seller {
    grid-template-columns: 1fr;
  }

  /* Chừa chỗ cho thanh mua cố định khỏi che phần đánh giá ở cuối trang. */
  .pd-page {
    padding-bottom: 90px;
  }
}

@media (max-width: 767px) {
  .pd-info__name {
    font-size: 18px;
  }

  .pd-price .price-new {
    font-size: 21px;
  }
}
