/* Single Product Reviews Styles */

.woocommerce-Reviews-summary {
  margin-bottom: 32px;
  padding: 32px;
  border-radius: 16px;
  border: 1px solid var(--primary-grey-200, #eeeeee);
}

.reviews-summary-container {
  display: flex;
  gap: 48px;
  justify-content: space-between;
}

/* Phần đánh giá trung bình */
.reviews-average-section {
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.reviews-average-score {
  font-weight: 800;
  font-size: 64px;
  line-height: 122%;
  letter-spacing: 2%;
  text-align: center;
}

.reviews-average-stars {
  font-size: 24px;
}

.reviews-average-count {
  color: #999;
  font-weight: 400;
  font-size: 12px;
  line-height: 146%;
  letter-spacing: 1%;
}

/* Phần biểu đồ phân bố sao */
.reviews-distribution {
  display: flex;
  gap: 8px;
  flex-direction: column;
  width: 100%;
  max-width: 528px;
}

.rating-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.rating-row-star {
  font-weight: 600;
  font-size: 16px;
  line-height: 150%;
  letter-spacing: 1%;
  color: #616161;
}

.rating-row-bar {
  width: 100%;
  height: 8px;
  background: #e0e0e0;
  border-radius: 4px;
  overflow: hidden;
}

.rating-row-bar-fill {
  height: 100%;
  background: #93d500;
  border-radius: 4px;
  transition: width 0.3s ease;
}

.rating-row-percentage {
  text-align: right;
  min-width: 65px;
}

/* Nút đánh giá */
.reviews-button-section {
  align-content: center;
}

.review-button {
  background: linear-gradient(90deg, #4f8c08 0%, #93d500 100%);
  color: #ffffff;
  border: none;
  padding: 12px 20px;
  border-radius: 24px;
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
  line-height: 146%;
  letter-spacing: 2%;
  vertical-align: middle;
  width: 100%;
  transition: background 0.3s ease;
}

.review-button:hover {
  background: #93d500;
}

.review-button:active {
  transform: scale(0.98);
}

.woocommerce-Reviews #comments {
  margin-top: 48px;
}

.woocommerce-Reviews-title {
  margin: 0 0 48px;
  font-weight: 600;
  font-size: 24px;
  line-height: 135%;
  letter-spacing: 1%;
  text-align: center;
  color: #212121;
  text-align: center;
}

.commentlist {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.commentlist > .review-item {
  margin: 0;
}

.review-item {
  padding: 32px;
  border-radius: 30px;
  color: #fff;
}

.review-item__body {
  display: flex;
  gap: 12px;
}

.review-item__avatar {
  width: 32px;
}

.review-item__avatar-image,
.review-item__avatar img {
  width: 32px;
  height: 32px;
  display: block;
  border-radius: 50%;
  object-fit: cover;
}

.review-item__main {
  width: 100%;
}

.review-item__header {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: flex-start;
}

.review-item__identity {
  min-width: 0;
}

.review-item__author-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  align-items: center;
}

.review-item__author {
  margin: 0;
  font-weight: 700;
  font-size: 18px;
  line-height: 146%;
  letter-spacing: 1%;
  color: #212121;
}

.review-item__badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 14px;
  line-height: 1.2;
  font-weight: 700;
  white-space: nowrap;
}

.review-item__badge::before {
  content: "";
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
}

.review-item__badge--verified {
  color: #8fda19;
  background: rgba(143, 218, 25, 0.08);
}

.review-item__badge--verified::before {
  content: "✓";
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: #8fda19;
  color: #101010;
  font-size: 12px;
  font-weight: 900;
}

.review-item__badge--staff {
  color: #fff;
  background: linear-gradient(90deg, #629e10 0%, #8bca20 100%);
}

.review-item__badge--staff::before {
  display: none;
}

.review-item__date {
  flex: 0 0 auto;
  font-weight: 400;
  font-size: 14px;
  line-height: 145%;
  letter-spacing: 1%;
  color: #9e9e9e;
  white-space: nowrap;
}

.review-item__stars {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 8px;
}

.review-item__star {
  font-size: 26px;
  line-height: 1;
  color: rgba(255, 207, 58, 0.34);
}

.review-item__star.is-active {
  color: #ffd33d;
}

.review-item__content {
  margin-top: 8px;
  font-weight: 400;
  font-size: 16px;
  line-height: 150%;
  letter-spacing: 1%;
  color: #616161;
}

.review-item__content p {
  margin: 0;
}

.review-item__content p + p {
  margin-top: 16px;
}

.review-item__pending {
  margin-bottom: 16px;
  color: #ffdd7a;
}

.review-item__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  margin-top: 16px;
}

.review-item__action {
  border: 0;
  padding: 0;
  background: transparent;
  font-weight: 600;
  font-size: 14px;
  line-height: 146%;
  letter-spacing: 2%;
  color: #9e9e9e;
  cursor: pointer;
  transition:
    opacity 0.2s ease,
    color 0.2s ease;
}

.review-item__action:hover {
  opacity: 0.82;
}

.review-item__toggle-button {
  color: #8fda19;
}

.review-item__toggle-button[aria-expanded="true"] {
  color: #b5f84d;
}

.review-item > .children {
  display: none;
  list-style: none;
  margin: 22px 0 0 26px;
  padding: 0 0 0 28px;
  border-left: 1px solid rgba(143, 218, 25, 0.26);
}

.review-item.is-replies-open > .children {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.review-item > .children > .review-item {
  padding: 24px 0 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.review-item--reply .review-item__body {
  grid-template-columns: 52px minmax(0, 1fr);
  gap: 16px;
}

.review-item--reply .review-item__avatar,
.review-item--reply .review-item__avatar-image,
.review-item--reply .review-item__avatar img {
  width: 52px;
  height: 52px;
}

.review-item--reply .review-item__author {
  font-size: clamp(20px, 1.7vw, 28px);
}

.review-item--reply .review-item__content {
  margin-top: 14px;
}

/* Modal Popup */
body.review-modal-open {
  overflow: hidden;
}

.review-modal-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(18, 24, 16, 0.52);
  backdrop-filter: blur(6px);
  z-index: 9999;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition:
    opacity 0.28s ease,
    visibility 0.28s ease;
}

.review-modal-overlay.show {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.review-modal-content {
  position: relative;
  width: min(636px, 100%);
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  background: #fff;
  border-radius: 12px;
  padding: 32px;
  transform: translateY(30px) scale(0.98);
  transition: transform 0.28s ease;
}

.review-modal-overlay.show .review-modal-content {
  transform: translateY(0) scale(1);
}

.review-modal-close {
  position: absolute;
  top: 16px;
  right: 18px;
  width: 48px;
  height: 48px;
  border: 0;
  padding: 0;
  background: transparent;
  color: #adadad;
  font-size: 46px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition:
    color 0.2s ease,
    transform 0.2s ease;
}

.review-modal-close:hover {
  color: #606060;
  transform: scale(1.04);
}

.review-modal-title {
  margin: 0;
  text-align: center;
  font-weight: 600;
  font-size: 24px;
  line-height: 135%;
  letter-spacing: 1%;
  text-align: center;
  color: #212121;
}

.review-modal-subtitle {
  max-width: 572px;
  margin: 8px auto 0;
  text-align: center;
  font-weight: 400;
  font-size: 16px;
  line-height: 150%;
  letter-spacing: 1%;
  text-align: center;
  color: #616161;
}

#review_form {
  margin-top: 44px;
}

.review-modal-form {
  margin: 0;
}

.review-modal-form p {
  margin: 0;
}

.review-rating-fieldset {
  margin: 0 0 44px;
  padding: 0;
  border: 0;
}

.review-reply-state {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 24px;
  padding: 16px 22px;
  border-radius: 20px;
  background: #f5faeb;
  border: 1px solid rgba(134, 194, 32, 0.18);
}

.review-reply-state__label {
  font-size: 18px;
  line-height: 1.4;
  font-weight: 600;
  color: #4f7d06;
}

.review-reply-state__cancel {
  border: 0;
  padding: 0;
  background: transparent;
  color: #699f12;
  font-size: 16px;
  line-height: 1.2;
  font-weight: 700;
  cursor: pointer;
}

.review-rating-scale {
  display: flex;
  justify-content: center;
  gap: 12px;
  align-items: start;
  text-align: center;
}

.review-rating-option {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  user-select: none;
  transition: transform 0.2s ease;
  min-width: 88px;
}

.review-rating-option:hover {
  transform: translateY(-2px);
}

.review-rating-input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.review-rating-icon {
  font-size: 32px;
  line-height: 1;
  color: transparent;
  -webkit-text-stroke: 1.8px #f4c430;
  transition:
    color 0.2s ease,
    transform 0.2s ease;
}

.review-rating-option.is-filled .review-rating-icon {
  color: #f8cb33;
}

.review-rating-text {
  font-weight: 400;
  font-size: 14px;
  line-height: 145%;
  letter-spacing: 1%;
  text-align: center;

  color: #b7b7b7;
  transition: color 0.2s ease;
}

.review-rating-option.is-active .review-rating-text {
  color: #f4c430;
}

.review-modal-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px 12px;
  margin-bottom: 24px;
}

.review-modal-field--full {
  grid-column: 1 / -1;
}

.review-modal-field label,
.review-upload-title {
  display: block;
  margin-bottom: 8px;
  font-weight: 400;
  font-size: 16px;
  line-height: 150%;
  letter-spacing: 1%;
  color: #232323;
}

.review-modal-field .required {
  color: #ff5b4e;
}

.review-modal-form input[type="text"],
.review-modal-form input[type="email"],
.review-modal-form input[type="tel"],
.review-modal-form textarea {
  width: 100%;
  border: 1px solid var(--primary-grey-200, #eeeeee);
  border-radius: 12px;
  padding: 12px 16px;
  font-weight: 400;
  font-size: 16px;
  line-height: 150%;
  letter-spacing: 1%;
  color: #bdbdbd;
  background: #fff;
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease;
}

.review-modal-form input::placeholder,
.review-modal-form textarea::placeholder {
  color: #cccccc;
}

.review-modal-form textarea {
  min-height: 96px;
  resize: vertical;
}

.review-modal-form input:focus,
.review-modal-form textarea:focus {
  outline: none;
  border-color: #86c220;
  box-shadow: 0 0 0 4px rgba(134, 194, 32, 0.12);
}

.review-modal-error {
  display: block;
  margin: 0 0 24px;
  padding: 14px 18px;
  border-radius: 18px;
  background: #fff3f1;
  color: #d44639;
  font-size: 16px;
  line-height: 1.45;
}

.review-upload-section {
  margin-top: 8px;
}

.review-upload-list {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: flex-start;
}

.review-upload-tile {
  position: relative;
  width: 56px;
  aspect-ratio: 1 / 1;
  flex: 0 0 auto;
  border-radius: 12px;
  overflow: hidden;
}

.review-upload-tile--trigger {
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, #fff 0%, #fafafa 100%);
  border: 1.5px dashed #e3e3e3;
  cursor: pointer;
  transition:
    transform 0.2s ease,
    border-color 0.2s ease,
    box-shadow 0.2s ease;
}

.review-upload-tile--trigger:hover {
  border-color: #86c220;
  box-shadow: 0 14px 28px rgba(72, 92, 41, 0.12);
  transform: translateY(-2px);
}

.review-upload-plus {
  font-size: 14px;
  line-height: 1;
  color: #bdbdbd;
}

.review-upload-tile--preview {
  background: #f7f7f7;
  border: 1px solid #ededed;
  box-shadow: 0 10px 24px rgba(30, 30, 30, 0.08);
}

.review-upload-tile--preview img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.review-upload-remove {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 50%;
  padding: 0;
  background: rgba(255, 255, 255, 0.94);
  color: #232323;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.14);
}

.review-modal-actions {
  margin-top: 24px;
}

.review-modal-submit {
  width: 100%;
  min-height: 44px;
  border: 0;
  border-radius: 24px;
  background: linear-gradient(90deg, #4f8c08 0%, #93d500 100%);
  color: #fff;
  cursor: pointer;
  padding: 12px 20px;
  font-weight: 600;
  font-size: 14px;
  line-height: 146%;
  letter-spacing: 2%;
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease,
    filter 0.2s ease;
}

.review-modal-submit:hover {
  filter: brightness(1.03);
  transform: translateY(-1px);
}

.review-modal-submit:active {
  transform: translateY(0);
}

.review-modal-privacy {
  max-width: 920px;
  margin: 24px auto 0;
  text-align: center;
  font-weight: 400;
  font-size: 14px;
  line-height: 145%;
  letter-spacing: 1%;
  text-align: center;
  color: #313131;
}

.review-modal-privacy a {
  color: var(--primary-700, #4f8c08);
  text-decoration: underline;
  text-underline-offset: 4px;
}

.must-log-in,
.woocommerce-verification-required {
  margin: 0;
  padding: 22px 26px;
  border-radius: 20px;
  background: #fff9e9;
  border: 1px solid #f3de92;
  color: #6f5918;
  font-size: 18px;
  line-height: 1.5;
}

.must-log-in a {
  color: #659f00;
  font-weight: 600;
  text-decoration: none;
}

.must-log-in a:hover {
  text-decoration: underline;
}

.review-comment-gallery {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 18px;
}

.review-comment-gallery__link {
  display: block;
  width: 50px;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border-radius: 4px;
}

.review-comment-gallery__link img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

/* Responsive */
@media (max-width: 1024px) {
  .reviews-summary-container {
    flex-direction: column;
    gap: 20px;
  }

  .review-item {
    padding: 24px;
  }

  .review-item__header {
    flex-direction: column;
    gap: 14px;
  }

  .review-item__date {
    white-space: normal;
  }

  .review-modal-overlay {
    padding: 16px;
  }

  .review-modal-content {
    padding: 40px 28px 32px;
    max-height: calc(100vh - 32px);
  }

  .review-rating-icon {
    font-size: 52px;
  }

  .review-modal-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .review-modal-field--full {
    grid-column: auto;
  }
}

@media (max-width: 768px) {
  .rating-row-bar {
    width: 150px;
  }

  .commentlist {
    gap: 18px;
  }

  .review-item {
    border-radius: 24px;
  }

  .review-item__body {
    grid-template-columns: 52px minmax(0, 1fr);
    gap: 16px;
  }

  .review-item__avatar,
  .review-item__avatar-image,
  .review-item__avatar img {
    width: 52px;
    height: 52px;
  }

  .review-item__badge {
    min-height: 30px;
    padding: 5px 12px;
    font-size: 13px;
  }

  .review-item__badge::before {
    width: 14px;
    height: 14px;
  }

  .review-item__stars {
    margin-top: 12px;
  }

  .review-item__star {
    font-size: 20px;
  }

  .review-item__content {
    margin-top: 14px;
    font-size: 16px;
    line-height: 1.7;
  }

  .review-item__actions {
    gap: 14px;
    margin-top: 16px;
  }

  .review-item__action {
    font-size: 16px;
  }

  .review-item > .children {
    margin: 18px 0 0 12px;
    padding-left: 16px;
  }

  .review-modal-content {
    border-radius: 26px;
    padding: 32px 20px 24px;
  }

  .review-modal-close {
    top: 12px;
    right: 14px;
    width: 40px;
    height: 40px;
    font-size: 38px;
  }

  .review-modal-title {
    padding: 0 24px;
  }

  .review-modal-subtitle {
    margin-top: 16px;
    font-size: 20px;
  }

  #review_form {
    margin-top: 36px;
  }

  .review-rating-scale {
    gap: 6px;
  }

  .review-reply-state {
    flex-direction: column;
    align-items: flex-start;
    padding: 14px 16px;
    margin-bottom: 18px;
  }

  .review-rating-option {
    gap: 10px;
  }

  .review-rating-icon {
    font-size: 38px;
    -webkit-text-stroke: 1.4px #f4c430;
  }

  .review-rating-text {
    font-size: 14px;
  }

  .review-modal-field label,
  .review-upload-title {
    margin-bottom: 10px;
    font-size: 18px;
  }

  .review-modal-form input[type="text"],
  .review-modal-form input[type="email"],
  .review-modal-form input[type="tel"],
  .review-modal-form textarea {
    padding: 16px 18px;
    border-radius: 18px;
    font-size: 18px;
  }

  .review-modal-form textarea {
    min-height: 140px;
  }

  .review-upload-tile {
    width: 84px;
    border-radius: 18px;
  }

  .review-upload-plus {
    font-size: 44px;
  }

  .review-modal-actions {
    margin-top: 36px;
  }

  .review-modal-submit {
    min-height: 60px;
    font-size: 22px;
  }

  .review-modal-privacy {
    margin-top: 18px;
    font-size: 15px;
  }
}

@media (max-width: 540px) {
  .review-modal-overlay {
    padding: 10px;
  }

  .review-modal-content {
    width: 100%;
    max-height: calc(100vh - 20px);
  }

  .review-rating-scale {
    gap: 4px;
  }

  .review-rating-option {
    gap: 8px;
  }

  .review-rating-text {
    font-size: 12px;
  }
}
