.srw-review-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 10px 0 14px;
  padding: 8px 12px;
  border-radius: 999px;
  background: #f9fafb;
}

.srw-review-count {
  font-size: 12px;
  color: #4b5563;
  white-space: nowrap;
}

.srw-review-pagination-nav .woocommerce-pagination {
  margin: 0;
}

.srw-review-pagination-nav .page-numbers {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 0;
  margin: 0;
}

.srw-review-pagination-nav .page-numbers li {
  list-style: none;
}

.srw-review-pagination-nav .page-numbers a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 28px;
  padding: 0 8px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 12px;
  color: #374151;
  text-decoration: none;
  background: transparent;
  transition: all 0.15s ease;
}

.srw-review-pagination-nav .page-numbers a:hover {
  border-color: #d1d5db;
  background: #f3f4f6;
}

.srw-review-pagination-nav .page-numbers .current {
  border-color: #16a34a;
  background: #16a34a;
  color: #ffffff;
  font-weight: 600;
}

@media (max-width: 480px) {
  .srw-review-toolbar {
    padding: 6px 10px;
    border-radius: 10px;
    flex-wrap: wrap;
  }

  .srw-review-count {
    font-size: 11px;
  }

  .srw-review-pagination-nav .page-numbers a {
    min-width: 24px;
    height: 24px;
    font-size: 11px;
  }
}

/* ===== Lightbox review images ===== */
.srw-lightbox-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.75);
  z-index: 9998;
  display: none;
}

.srw-lightbox-wrapper {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.srw-lightbox-inner {
  position: relative;
  max-width: 90vw;
  max-height: 90vh;
}

.srw-lightbox-img {
  display: block;
  max-width: 100%;
  max-height: 100%;
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(15, 23, 42, 0.6);
}

.srw-lightbox-close {
  position: absolute;
  top: -32px;
  right: -4px;
  background: transparent;
  border: none;
  color: #e5e7eb;
  font-size: 24px;
  cursor: pointer;
}

.srw-lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 999px;
  border: none;
  background: rgba(15, 23, 42, 0.7);
  color: #e5e7eb;
  cursor: pointer;
}

.srw-lightbox-prev {
  left: -48px;
}

.srw-lightbox-next {
  right: -48px;
}

@media (max-width: 640px) {
  .srw-lightbox-wrapper {
    padding: 16px;
  }

  .srw-lightbox-prev {
    left: -32px;
  }

  .srw-lightbox-next {
    right: -32px;
  }
}


.star-rating {
  margin: 0 !important;
}

/* ===== Form đánh giá tùy chỉnh (modal Viết đánh giá) ===== */
/* Nút đóng modal Viết đánh giá */
.srw-review-modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: #f3f4f6;
  color: #6b7280;
  border-radius: 50%;
  cursor: pointer;
  z-index: 1111;
  transition: background 0.2s ease, color 0.2s ease, transform 0.15s ease;
}

.srw-review-modal-close:hover {
  background: #e5e7eb;
  color: #374151;
}

.srw-review-modal-close:active {
  transform: scale(0.95);
}

.srw-review-modal-close .srw-modal-close-icon {
  display: block;
  flex-shrink: 0;
}

.srw-review-modal-inner .srw-review-form-wrapper {
  padding-top: 28px;
}

.srw-review-form-wrapper .srw-review-form-title {
  margin: 0 0 16px;
  font-size: 20px;
  font-weight: 700;
  color: #111827;
  text-align: center;
}

.srw-review-form .srw-recommend-btn.is-active {
  background: #e5e7eb !important;
  color: #111827 !important;
  font-weight: 600 !important;
}

.srw-review-form .srw-star-btn .srw-star-icon {
  display: inline-block;
}

.srw-review-form .srw-star-btn.is-active,
.srw-review-form .srw-star-btn:hover {
  color: #eab308 !important;
}

.srw-review-form .srw-star-btn.is-active {
  min-height: 1em;
}

/* Circle loading khi chọn ảnh */
.srw-images-loading {
  display: flex;
  align-items: center;
  gap: 8px;
}

.srw-images-spinner {
  width: 24px;
  height: 24px;
  border: 2px solid #e5e7eb;
  border-top-color: #f97316;
  border-radius: 50%;
  animation: srw-spin 0.7s linear infinite;
}

@keyframes srw-spin {
  to {
    transform: rotate(360deg);
  }
}

.srw-images-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.srw-image-preview-item {
  width: 64px;
  height: 64px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid #e5e7eb;
  background: #f9fafb;
}

.srw-image-preview-item img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Video: loading + preview (tương tự ảnh) */
.srw-video-loading {
  display: flex;
  align-items: center;
  gap: 8px;
}

.srw-video-spinner {
  width: 24px;
  height: 24px;
  border: 2px solid #e5e7eb;
  border-top-color: #f97316;
  border-radius: 50%;
  animation: srw-spin 0.7s linear infinite;
}

.srw-video-preview-item {
  max-width: 100%;
}

.srw-video-preview-item video {
  display: block;
  width: 64px;
  height: 64px;
  object-fit: cover;
  border-radius: 8px;
  background: #000;
}

/* Ẩn hàng sao cũ do WooCommerce single-product.js inject (p.stars) trước #rating */
.srw-review-form p.stars,
.srw-review-form .comment-form-rating .stars {
  display: none !important;
}

@media (max-width: 640px) {
  .srw-review-form .srw-review-form-row--half {
    grid-template-columns: 1fr !important;
  }

  .srw-review-form .srw-review-form-media-row {
    grid-template-columns: 1fr !important;
  }
}

/* Video trong Magnific Popup - fit giống ảnh (img.mfp-img) */
.mfp-content .srw-review-video-lightbox video {
  backface-visibility: hidden;
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: calc(100vh - 80px);
  padding: 0 0 40px;
  margin: 0 auto;
  object-fit: contain;
}