/* Product Reviews - Customer Reviews Plugin Styles */

/* ============================================
   Rating Widget (under product title)
   ============================================ */
.product-review-rating {
  font-size: 14px;
  line-height: 1.4;
}

.product-review-rating.is-loading {
  opacity: 0.72;
}

.review-stars-inline i {
  font-size: 16px;
  color: #f5a623;
  margin-right: 2px;
  line-height: 1;
}

.review-count {
  font-size: 14px;
  color: #6b7280;
}

.review-view-link {
  color: #fd560f;
  text-decoration: underline;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: color 0.2s;
  white-space: nowrap;
}

.review-view-link:hover {
  color: #d4450a;
  text-decoration: underline;
}

/* ============================================
   Scroll-to highlight animation
   ============================================ */
#product-reviews.rb-scroll-highlight {
  animation: rb-scroll-highlight-anim 2s ease-out;
}

@keyframes rb-scroll-highlight-anim {
  0%   { box-shadow: 0 0 0 0 rgba(253, 86, 15, 0.5); }
  20%  { box-shadow: 0 0 0 6px rgba(253, 86, 15, 0.35); }
  100% { box-shadow: 0 0 0 0 rgba(253, 86, 15, 0); }
}

/* Main container */
.product-reviews-wrap {
  margin-top: 20px;
  padding: 20px 0;
}

/* Summary Card (Left Side) */
.reviews-summary-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 28px 24px;
}

.average-rating {
  display: flex;
  align-items: center;
  gap: 12px;
}

.rating-number {
  font-size: 48px;
  font-weight: 700;
  line-height: 1;
  color: #111;
}

.rating-stars.large i {
  font-size: 22px;
  margin-right: 2px;
}

.total-reviews-text {
  color: #6b7280;
  font-size: 14px;
  margin-top: 4px;
}

/* Rating Distribution */
.rating-distribution .distribution-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.star-label {
  font-size: 13px;
  color: #111;
  min-width: 28px;
  text-align: right;
}

.progress-bar-bg {
  flex: 1;
  height: 10px;
  background: #e5e7eb;
  border-radius: 5px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: #fd560f;
  border-radius: 5px;
  transition: width 0.3s ease;
}

.count-label {
  font-size: 13px;
  color: #6b7280;
  min-width: 36px;
  text-align: left;
}

/* Write Review Button */
.write-review-btn {
  width: 100%;
  border-radius: 8px;
  padding: 8px 16px;
  font-weight: 500;
  border-color: #111;
  color: #111;
  transition: all 0.2s;
}

.write-review-btn:hover {
  background: #111;
  color: #fff;
}

/* Reviews Toolbar */
.reviews-toolbar {
  border-bottom: 1px solid #e5e7eb;
  padding-bottom: 4px;
}

.reviews-tabs .nav-link {
  appearance: none;
  cursor: pointer;
  color: #4b5563;
  padding: 8px 16px;
  font-weight: 500;
  border: none;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  background: transparent;
}

.reviews-tabs .nav-link.active {
  color: #111;
  border-bottom-color: #fd560f;
  background: transparent;
}

.sort-select .form-select-sm {
  border-radius: 8px;
  border-color: #e5e7eb;
  font-size: 13px;
  padding: 4px 28px 4px 12px;
}

/* Review Card */
.review-card {
  padding: 8px 0;
}

.review-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.reviewer-name {
  font-weight: 600;
  font-size: 15px;
  color: #111;
}

.verified-badge {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 4px;
  background-color: #fd560f !important;
  color: #fff !important;
  font-weight: 500;
}

.review-likes {
  cursor: pointer;
  color: #6b7280;
  font-size: 14px;
  display: flex;
  align-items: center;
  padding: 4px 8px;
  border-radius: 6px;
  transition: background 0.2s;
}

.review-likes:hover {
  background: #f3f4f6;
  color: #fd560f;
}

.review-stars i {
  font-size: 16px;
  margin-right: 1px;
}

.review-title {
  font-size: 15px;
  color: #111;
}

.review-content {
  font-size: 14px;
  color: #374151;
  line-height: 1.6;
}

.review-content.collapsed p {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  max-height: 4.8em;
}

.review-content p {
  margin-bottom: 0;
}

.read-more-link {
  appearance: none;
  border: none;
  background: transparent;
  padding: 0;
  cursor: pointer;
  color: #fd560f;
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
}

.read-more-link:hover {
  text-decoration: underline;
}

/* Review Images */
.review-images {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.review-image-item {
  width: 72px;
  height: 72px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid #e5e7eb;
  cursor: pointer;
  transition: opacity 0.2s;
}

.review-image-item:hover {
  opacity: 0.8;
}

.review-image-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Lazyload - fade in real image when loaded by lazysizes */
.review-image-item .lazyload {
  opacity: 1;
}
.review-image-item .lazyloaded {
  animation: rb-review-fadein 0.35s ease;
}
@keyframes rb-review-fadein {
  0%   { opacity: 0.5; }
  100% { opacity: 1; }
}

/* Admin Reply */
.admin-reply {
  background: #f9fafb;
  border-left: 3px solid #fd560f;
  border-radius: 4px;
  padding: 12px 16px;
}

.reply-badge {
  font-size: 12px;
  font-weight: 600;
  color: #fd560f;
}

.reply-text {
  font-size: 14px;
  color: #374151;
}

/* Review Date */
.review-date {
  font-size: 13px;
  color: #9ca3af;
}

/* Write Review Modal */
#writeReviewModal .modal-content {
  border-radius: 16px;
  border: none;
  box-shadow: 0 8px 32px rgba(0,0,0,0.12);
}

#writeReviewModal .modal-body {
  padding: 20px 28px 28px;
}

.rating-input i {
  cursor: pointer;
  transition: transform 0.1s;
  font-size: 28px;
  margin-right: 4px;
}

.rating-input i:hover {
  transform: scale(1.15);
}

/* Upload Images */
.upload-images-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.uploaded-image-item {
  width: 80px;
  height: 80px;
  border-radius: 8px;
  position: relative;
  border: 1px solid #e5e7eb;
}

.uploaded-image-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 8px;
}

.remove-image-btn {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 24px;
  height: 24px;
  padding: 0;
  border: 2px solid #fff;
  border-radius: 50%;
  background: #fd560f;
  box-shadow: 0 2px 6px rgba(0,0,0,0.25);
  opacity: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s, background 0.15s;
}

.remove-image-btn:hover {
  background: #d4450a;
  transform: scale(1.15);
}

.remove-image-btn::before,
.remove-image-btn::after {
  content: '';
  position: absolute;
  width: 12px;
  height: 2px;
  background: #fff;
  border-radius: 1px;
}

.remove-image-btn::before {
  transform: rotate(45deg);
}

.remove-image-btn::after {
  transform: rotate(-45deg);
}

.upload-image-btn {
  width: 80px;
  height: 80px;
  border: 2px dashed #d1d5db;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #9ca3af;
  transition: all 0.2s;
}

.upload-image-btn:hover:not(.is-disabled) {
  border-color: #fd560f;
  color: #fd560f;
  background: #fff5f0;
}

.upload-image-btn.is-disabled {
  cursor: not-allowed;
  opacity: 0.7;
}

.upload-image-btn i {
  font-size: 24px;
}

/* Responsive */
@media (max-width: 991px) {
  .reviews-summary-card {
    margin-bottom: 20px;
  }
}

/* Modal z-index fix above Bootstrap */
.modal-backdrop.show {
  opacity: 0.5;
}

/* SPinner fix */
[v-cloak] {
  display: none !important;
}

/* ============================================
   Lightbox / Image Viewer
   ============================================ */

/* 遮罩层 fade 过渡 */
.rb-lightbox-fade-enter-active,
.rb-lightbox-fade-leave-active {
  transition: opacity 0.3s ease;
}
.rb-lightbox-fade-enter-from,
.rb-lightbox-fade-leave-to {
  opacity: 0;
}

/* 全屏遮罩容器 */
.rb-lightbox {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0, 0, 0, 0.92);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  -webkit-user-select: none;
  user-select: none;
}

/* 顶部栏 */
.rb-lightbox-topbar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 12px 20px;
  gap: 16px;
}

.rb-lightbox-counter {
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.5px;
}

.rb-lightbox-close {
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: #fff;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 22px;
  transition: background 0.2s;
  line-height: 1;
}

.rb-lightbox-close:hover {
  background: rgba(255, 255, 255, 0.25);
}

/* 左右切换箭头 */
.rb-lightbox-arrow {
  position: absolute;
  top: 50%;
  z-index: 20;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: #fff;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 26px;
  transition: background 0.2s, opacity 0.2s;
  opacity: 0.7;
}

.rb-lightbox-arrow:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.25);
  opacity: 1;
}

.rb-lightbox-arrow:disabled {
  opacity: 0.2;
  cursor: default;
}

.rb-lightbox-prev { left: 16px; }
.rb-lightbox-next { right: 16px; }

/* 主图舞台 */
.rb-lightbox-stage {
  flex: 1;
  width: 100%;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 1;
}

.rb-lightbox-track {
  display: flex;
  height: 100%;
  width: 100%;
  will-change: transform;
}

.rb-lightbox-slide {
  flex: 0 0 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 70px 60px 20px;
}

.rb-lightbox-slide img {
  max-width: 100%;
  max-height: 70vh;
  object-fit: contain;
  cursor: pointer;
  border-radius: 2px;
  transition: opacity 0.2s;
}

/* 底部缩略图导航 */
.rb-lightbox-thumbs {
  display: flex;
  gap: 8px;
  padding: 12px 20px 20px;
  overflow-x: auto;
  max-width: 100%;
  justify-content: center;
  flex-shrink: 0;
  scrollbar-width: none;
  position: relative;
  z-index: 1;
}

.rb-lightbox-thumbs::-webkit-scrollbar {
  display: none;
}

.rb-lightbox-thumb {
  width: 56px;
  height: 56px;
  border-radius: 6px;
  overflow: hidden;
  border: 2px solid transparent;
  cursor: pointer;
  flex-shrink: 0;
  transition: border-color 0.2s, opacity 0.2s;
  opacity: 0.5;
}

.rb-lightbox-thumb.active {
  border-color: #fd560f;
  opacity: 1;
}

.rb-lightbox-thumb:hover {
  opacity: 0.8;
}

.rb-lightbox-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ============================================
   Mobile responsive
   ============================================ */
@media (max-width: 767px) {
  .rb-lightbox-arrow {
    width: 38px;
    height: 38px;
    font-size: 20px;
  }

  .rb-lightbox-prev { left: 6px; }
  .rb-lightbox-next { right: 6px; }

  .rb-lightbox-slide {
    padding: 60px 8px 16px;
  }

  .rb-lightbox-slide img {
    max-height: 60vh;
  }

  .rb-lightbox-topbar {
    padding: 10px 14px;
  }

  .rb-lightbox-counter {
    font-size: 13px;
  }

  .rb-lightbox-thumb {
    width: 46px;
    height: 46px;
  }
}
.review-view-link {
  appearance: none;
  border: none;
  background: transparent;
  padding: 0;
  cursor: pointer;
}

.review-view-link:disabled {
  cursor: default;
}

/* ===== 评论视频：缩略图 + 居中播放按钮 ===== */
.review-videos .review-video-item {
  width: 96px;
  height: 96px;
  flex: 0 0 auto;
}

.review-video-thumb {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  overflow: hidden;
  background: #111;
  cursor: pointer;
  line-height: 0;
  transition: opacity 0.2s;
}

.review-video-thumb:hover {
  opacity: 0.88;
}

.review-video-thumb:focus-visible {
  outline: 2px solid #fd560f;
  outline-offset: 2px;
}

.review-video-poster {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* 播放按钮：深色半透明圆 + 白色三角 */
.review-video-play {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  transition: background 0.2s;
}

.review-video-play-icon {
  width: 18px;
  height: 18px;
  display: block;
  /* 三角形视觉重心略偏左，右移 1px 更居中 */
  margin-left: 2px;
}

.review-video-thumb:hover .review-video-play {
  background: rgba(0, 0, 0, 0.72);
}

/* ===== 视频播放弹窗 ===== */
.rb-video-lightbox .rb-lightbox-stage {
  display: flex;
  align-items: center;
  justify-content: center;
}

.rb-video-stage {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: min(1100px, 92vw);
}

.rb-video-player {
  width: 100%;
  max-width: min(1100px, 92vw);
  max-height: 80vh;
  border-radius: 8px;
  background: #000;
  display: block;
  outline: none;
}

/* 写评论弹窗里的视频预览 */
.uploaded-video-item {
  position: relative;
  width: 180px;
  max-width: 100%;
  line-height: 0;
}

.uploaded-video-item video {
  width: 100%;
  height: auto;
  max-height: 240px;
  border-radius: 8px;
  background: #000;
}

.uploaded-video-item .remove-image-btn {
  position: absolute;
  top: 4px;
  right: 4px;
  background-color: #fff;
  opacity: 0.9;
  border-radius: 50%;
  padding: 0.35rem;
}

@media (max-width: 575px) {
  .review-videos .review-video-item {
    width: 80px;
    height: 80px;
  }

  .review-video-play {
    width: 28px;
    height: 28px;
  }

  .review-video-play-icon {
    width: 15px;
    height: 15px;
  }

  .uploaded-video-item {
    width: 100%;
  }
}

/* 写评论弹窗：视频上传图标（内联 SVG） */
.upload-image-btn .upload-video-icon {
  width: 22px;
  height: 22px;
  display: block;
  margin: 0 auto 2px;
  color: #6b7280;
}

.upload-image-btn:hover .upload-video-icon {
  color: #fd560f;
}
