﻿/* Unified review star colors (summary, list, form) */
.store-product-reviews-wrap,
.mizhan-reviews {
  --store-review-star-filled: #f59e0b;
  --store-review-star-empty: #e5e7eb;
}

body.store-product-page .product-summary-rating .star-rating,
.mizhan-reviews .star-rating,
.mizhan-review-rating-line .star-rating,
.mizhan-review-overview .star-rating {
  float: none;
  margin: 0;
  font-size: 0.95rem;
}

body.store-product-page .product-summary-rating .star-rating::before,
.mizhan-reviews .star-rating::before {
  color: var(--store-review-star-empty) !important;
}

body.store-product-page .product-summary-rating .star-rating span::before,
.mizhan-reviews .star-rating span::before {
  color: var(--store-review-star-filled) !important;
}

/* Comment form: WooCommerce interactive stars (override default link blue) */
.mizhan-reviews #review_form p.stars,
.mizhan-reviews #respond p.stars {
  margin: 0 0 4px;
  line-height: 1;
}

.mizhan-reviews #review_form p.stars a,
.mizhan-reviews #respond p.stars a {
  color: transparent !important;
  text-decoration: none;
}

.mizhan-reviews #review_form p.stars a::before,
.mizhan-reviews #respond p.stars a::before {
  color: var(--store-review-star-empty);
}

.mizhan-reviews #review_form p.stars:hover a::before,
.mizhan-reviews #respond p.stars:hover a::before,
.mizhan-reviews #review_form p.stars.selected a:not(.active)::before,
.mizhan-reviews #respond p.stars.selected a:not(.active)::before,
.mizhan-reviews #review_form p.stars.selected a.active::before,
.mizhan-reviews #respond p.stars.selected a.active::before {
  color: var(--store-review-star-filled);
}

.mizhan-reviews #review_form p.stars.selected a.active ~ a::before,
.mizhan-reviews #respond p.stars.selected a.active ~ a::before,
.mizhan-reviews #review_form p.stars a:hover ~ a::before,
.mizhan-reviews #respond p.stars a:hover ~ a::before {
  color: var(--store-review-star-empty);
}

.mizhan-reviews #review_form p.stars a:focus,
.mizhan-reviews #respond p.stars a:focus {
  outline: none;
}

.mizhan-reviews #review_form p.stars a:focus-visible::before,
.mizhan-reviews #respond p.stars a:focus-visible::before {
  outline: 2px solid #111111;
  outline-offset: 2px;
  border-radius: 2px;
}

/* Legacy unicode stars (fallback) */
.mizhan-review-stars__base {
  color: var(--store-review-star-empty);
}

.mizhan-review-stars__fill {
  color: var(--store-review-star-filled);
}

/* Summary column: stars + review count (English link) */
body.store-product-page .product-summary-rating {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 10px;
  margin: 0 0 12px;
}

body.store-product-page .product-summary-rating .star-rating {
  float: none;
  margin: 0;
}

body.store-product-page .pdp-summary-header .product-summary-rating .mizhan-review-stars,
body.store-product-page .product-summary-rating .mizhan-review-stars {
  width: 102px;
  height: 22px;
}

body.store-product-page .pdp-summary-header .product-summary-rating .mizhan-review-stars__base,
body.store-product-page .product-summary-rating .mizhan-review-stars__base {
  color: var(--store-review-star-empty, #e5e7eb);
}

body.store-product-page .pdp-summary-header .product-summary-rating .mizhan-review-stars__fill,
body.store-product-page .product-summary-rating .mizhan-review-stars__fill {
  color: var(--store-review-star-filled, #f59e0b);
}

body.store-product-page .product-summary-rating .woocommerce-review-link {
  font-size: 13px;
  color: #6b7280;
  text-decoration: underline;
  text-underline-offset: 2px;
}

body.store-product-page .product-summary-rating .woocommerce-review-link:hover {
  color: #111111;
}

.store-product-reviews-wrap {
  width: min(100%, 1440px);
  margin: var(--store-related-gap-mobile, 3rem) auto 0;
  padding: 0 clamp(12px, 3vw, 24px);
}

@media (min-width: 992px) {
  .store-product-reviews-wrap {
    margin-top: var(--store-related-gap-desktop, 4rem);
  }
}

.mizhan-reviews {
  width: 100%;
  margin: 0 auto;
  color: #111111;
  background: #ffffff;
}

.mizhan-reviews *,
.mizhan-reviews *::before,
.mizhan-reviews *::after {
  box-sizing: border-box;
}

.mizhan-review-overview {
  display: grid;
  grid-template-columns: minmax(220px, 0.8fr) minmax(320px, 1.4fr) auto;
  gap: 32px;
  align-items: center;
  margin: 0 0 26px;
  padding: 28px;
  border: 1px solid #e6e8ec;
  border-radius: 5px;
  background: #ffffff;
}

.mizhan-review-eyebrow,
.mizhan-review-count,
.mizhan-review-bar-row,
.mizhan-review-head time,
.mizhan-review-helpful,
.comment-form-review-images span {
  color: #667085;
}

.mizhan-review-eyebrow {
  margin: 0 0 12px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0;
}

.mizhan-review-average {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 10px;
}

.mizhan-review-average strong {
  font-size: 44px;
  line-height: 1;
}

.mizhan-review-average span {
  font-size: 14px;
}

.mizhan-review-stars {
  position: relative;
  display: inline-block;
  width: 102px;
  height: 22px;
  overflow: hidden;
  color: #d0d5dd;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 21px;
  line-height: 1;
  letter-spacing: 1px;
  vertical-align: middle;
}

.mizhan-review-stars__base,
.mizhan-review-stars__fill {
  position: absolute;
  top: 0;
  left: 0;
  display: block;
  white-space: nowrap;
}

.mizhan-review-stars__base {
  color: var(--store-review-star-empty, #e5e7eb);
}

.mizhan-review-stars__fill {
  overflow: hidden;
  color: var(--store-review-star-filled, #f59e0b);
}

.mizhan-review-count {
  margin: 10px 0 0;
  font-size: 14px;
}

.mizhan-review-bars {
  display: grid;
  gap: 10px;
}

.mizhan-review-bar-row {
  display: grid;
  grid-template-columns: 58px minmax(120px, 1fr) 42px;
  gap: 12px;
  align-items: center;
  font-size: 13px;
}

.mizhan-review-bar-row em {
  color: #475467;
  font-style: normal;
  text-align: right;
}

.mizhan-review-bar {
  height: 7px;
  overflow: hidden;
  border-radius: 5px;
  background: #eef0f3;
}

.mizhan-review-bar i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: #f59e0b;
}

.mizhan-review-actions {
  display: grid;
  gap: 10px;
  min-width: 170px;
}

.mizhan-review-button,
.mizhan-review-filters a,
.mizhan-review-helpful button {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  border: 1px solid #d0d5dd;
  border-radius: 5px;
  background: #ffffff;
  color: #111111;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}

.mizhan-review-button {
  padding: 0 16px;
}

.mizhan-review-button--primary,
.mizhan-review-submit {
  border-color: #111111;
  background: #111111;
  color: #ffffff;
}

.mizhan-review-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 20px;
}

.mizhan-review-filters a {
  min-height: 34px;
  padding: 0 12px;
  color: #344054;
  font-size: 13px;
}

.mizhan-review-filters a.is-active {
  border-color: #111111;
  color: #ffffff;
  background: #111111;
}

.mizhan-review-list {
  display: grid;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

.mizhan-review-card {
  margin: 0;
  padding: 0;
}

.mizhan-review-card.is-hidden {
  display: none;
}

.mizhan-review-card__inner {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 14px;
  padding: 24px 0;
  border-top: 1px solid #e6e8ec;
}

.mizhan-review-avatar {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: 999px;
  background: #111111;
  color: #ffffff;
  font-size: 14px;
  font-weight: 800;
}

.mizhan-review-head {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  align-items: center;
  justify-content: flex-start;
  margin-bottom: 7px;
}

.mizhan-review-author {
  display: inline-flex;
  margin-right: 6px;
  color: #111111;
  font-size: 15px;
  line-height: 1.25;
}

.mizhan-verified-badge {
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  padding: 0 7px;
  border-radius: 5px;
  background: #f2f4f7;
  color: #344054;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
}

.mizhan-verified-badge::before {
  content: "\2713";
  margin-right: 5px;
  color: #16a34a;
}

.mizhan-review-rating-line {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 8px;
}

.mizhan-verified-badge::before {
  content: "\2713";
}

.mizhan-review-rating-line time {
  color: #667085;
  font-size: 13px;
  line-height: 1.3;
}

.mizhan-review-body h3 {
  margin: 0 0 5px;
  color: #111111;
  font-size: 16px;
  line-height: 1.35;
}

.mizhan-review-content {
  color: #344054;
  font-size: 14px;
  line-height: 1.55;
}

.mizhan-review-content p {
  margin: 0 0 8px;
}

.mizhan-review-images {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin: 12px 0 0;
}

.mizhan-review-images img {
  width: 96px;
  height: 96px;
  flex: 0 0 96px;
  border: 1px solid #e6e8ec;
  border-radius: 5px;
  background: #f8fafc;
  object-fit: cover;
}

.mizhan-review-video {
  width: min(100%, 360px);
  aspect-ratio: 16 / 9;
  flex: 0 1 360px;
  border: 1px solid #e6e8ec;
  border-radius: 5px;
  background: #000000;
  object-fit: contain;
}

.mizhan-review-helpful {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 10px;
  align-items: center;
  margin-top: 13px;
  font-size: 13px;
}

.mizhan-review-helpful button {
  min-height: 32px;
  padding: 0 12px;
  color: #344054;
  font-size: 12px;
  font-weight: 700;
}

.mizhan-review-helpful button.is-selected {
  border-color: #111111;
  color: #ffffff;
  background: #111111;
}

.mizhan-review-helpful a {
  color: #667085;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.mizhan-review-empty {
  padding: 30px;
  border: 1px solid #e6e8ec;
  border-radius: 5px;
  text-align: center;
}

.mizhan-review-empty h3 {
  margin: 0 0 8px;
  font-size: 22px;
}

.mizhan-review-empty p {
  margin: 0 0 6px;
  color: #667085;
}

.mizhan-review-empty .mizhan-review-button {
  margin-top: 14px;
}

.mizhan-review-form-wrapper {
  margin-top: 34px;
  padding: 28px;
  border: 1px solid #e6e8ec;
  border-radius: 5px;
  background: #ffffff;
}

.mizhan-review-verification-required {
  margin-top: 34px;
  padding: 28px;
  border: 1px solid #e6e8ec;
  border-radius: 5px;
  background: #f8f9fb;
  color: #344054;
}

.mizhan-review-form-anchor {
  height: 0;
  overflow: hidden;
}

.mizhan-review-login-modal[hidden] {
  display: none;
}

.mizhan-review-login-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: grid;
  place-items: center;
  padding: 18px;
}

.mizhan-review-login-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(17, 17, 17, .48);
}

.mizhan-review-login-modal__dialog {
  position: relative;
  z-index: 1;
  width: min(100%, 430px);
  padding: 28px;
  border: 1px solid #e6e8ec;
  border-radius: 5px;
  background: #ffffff;
}

.mizhan-review-login-modal__close {
  position: absolute;
  top: 12px;
  right: 12px;
  display: inline-grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid #d0d5dd;
  border-radius: 5px;
  background: #ffffff;
  color: #111111;
  font-size: 20px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
}

.mizhan-review-login-modal h3 {
  margin: 0 0 8px;
  padding-right: 36px;
  color: #111111;
  font-size: 20px;
  font-weight: 800;
}

.mizhan-review-login-modal p {
  max-width: 560px;
  margin: 0 0 16px;
  color: #667085;
  font-size: 14px;
  line-height: 1.55;
}

.mizhan-review-modal-open {
  overflow: hidden;
}

.mizhan-review-form .comment-reply-title {
  display: block;
  margin: 0 0 20px;
  color: #111111;
  font-size: 22px;
  font-weight: 800;
}

.mizhan-review-form form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.mizhan-review-form .comment-form-rating,
.mizhan-review-form .comment-form-review-title,
.mizhan-review-form .comment-form-comment,
.mizhan-review-form .comment-form-review-images,
.mizhan-review-form .form-submit,
.mizhan-review-form .comment-notes,
.mizhan-review-form .must-log-in {
  grid-column: 1 / -1;
}

.mizhan-review-form p,
.mizhan-review-form .comment-form-rating {
  margin: 0;
}

.mizhan-review-form label {
  display: block;
  margin: 0 0 7px;
  color: #344054;
  font-size: 13px;
  font-weight: 700;
}

.mizhan-review-form input[type="text"],
.mizhan-review-form input[type="email"],
.mizhan-review-form input[type="file"],
.mizhan-review-form select,
.mizhan-review-form textarea {
  width: 100%;
  min-height: 44px;
  border: 1px solid #d0d5dd;
  border-radius: 5px;
  background: #ffffff;
  color: #111111;
  font-size: 14px;
}

.mizhan-review-form input[type="text"],
.mizhan-review-form input[type="email"],
.mizhan-review-form select,
.mizhan-review-form textarea {
  padding: 10px 12px;
}

.mizhan-review-form textarea {
  min-height: 150px;
  resize: vertical;
}

.mizhan-review-form input:focus,
.mizhan-review-form select:focus,
.mizhan-review-form textarea:focus {
  border-color: #111111;
  outline: none;
}

.mizhan-review-upload {
  position: relative;
}

.mizhan-review-upload input[type="file"] {
  position: absolute;
  inset: 0;
  z-index: 2;
  width: 100%;
  height: 100%;
  cursor: pointer;
  opacity: 0;
}

.mizhan-review-upload__drop {
  display: grid;
  min-height: 128px;
  place-items: center;
  padding: 22px;
  border: 1px dashed #b9c3d0;
  border-radius: 5px;
  background: #f8fafc;
  text-align: center;
  transition: border-color 0.18s ease, background-color 0.18s ease;
}

.mizhan-review-upload__drop::before {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  margin-bottom: 10px;
  border: 1px solid #d0d5dd;
  border-radius: 999px;
  background: #ffffff;
  color: #111111;
  content: "+";
  font-size: 26px;
  line-height: 1;
}

.mizhan-review-upload__drop strong {
  display: block;
  color: #111111;
  font-size: 15px;
}

.mizhan-review-upload__drop span {
  display: block;
  max-width: 420px;
  margin-top: 6px;
  color: #667085;
  font-size: 12px;
  line-height: 1.45;
}

.mizhan-review-upload.is-dragging .mizhan-review-upload__drop {
  border-color: #111111;
  background: #f2f4f7;
}

.mizhan-review-upload__preview {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}

.mizhan-review-upload__item {
  position: relative;
  width: 84px;
  min-width: 84px;
}

.mizhan-review-upload__thumb {
  display: grid;
  width: 84px;
  height: 84px;
  place-items: center;
  overflow: hidden;
  border: 1px solid #e6e8ec;
  border-radius: 5px;
  background: #f2f4f7;
  color: #344054;
  font-size: 12px;
  font-weight: 800;
}

.mizhan-review-upload__thumb img,
.mizhan-review-upload__thumb video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.mizhan-review-upload__name {
  display: block;
  margin-top: 5px;
  overflow: hidden;
  color: #667085;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mizhan-review-submit {
  min-height: 46px;
  padding: 0 22px;
  border: 1px solid #111111 !important;
  border-radius: 5px;
  background: #111111 !important;
  color: #ffffff !important;
  font-size: 14px;
  font-weight: 800;
}

.mizhan-review-submit:hover,
.mizhan-review-submit:focus {
  border-color: #000000 !important;
  background: #000000 !important;
  color: #ffffff !important;
  outline: none;
}

.mizhan-review-pagination {
  margin-top: 22px;
}

@media (max-width: 900px) {
  .mizhan-review-overview {
    grid-template-columns: 1fr;
    gap: 22px;
    padding: 22px;
  }

  .mizhan-review-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .mizhan-review-card__inner {
    grid-template-columns: 40px minmax(0, 1fr);
    gap: 12px;
  }

  .mizhan-review-avatar {
    width: 40px;
    height: 40px;
  }

  .mizhan-review-head {
    display: grid;
    gap: 8px;
  }

  .mizhan-review-images {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 4px;
  }

  .mizhan-review-video {
    width: 280px;
    flex-basis: 280px;
  }

  .mizhan-review-form-wrapper,
  .mizhan-review-empty {
    padding: 20px;
  }

  .mizhan-review-form form,
  .mizhan-review-actions {
    grid-template-columns: 1fr;
  }

  .mizhan-review-bar-row {
    grid-template-columns: 54px minmax(80px, 1fr) 38px;
    gap: 8px;
  }
}

/* PDP reviews: collapse + gradient expand (aligned with mizhan-shop) */
.store-product-reviews-wrap .store-reviews-collapse {
  position: relative;
}

.store-product-reviews-wrap .store-reviews-collapse__viewport {
  max-height: var(--store-reviews-collapse-max, 520px);
  overflow: hidden;
  transition: max-height 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

.store-product-reviews-wrap .store-reviews-collapse.is-expanded .store-reviews-collapse__viewport {
  max-height: none;
  overflow: visible;
}

.store-product-reviews-wrap .store-reviews-collapse__overlay {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  min-height: 168px;
  padding: 0 0 6px;
  pointer-events: none;
  transition: opacity 0.28s ease, visibility 0.28s ease;
}

.store-product-reviews-wrap .store-reviews-collapse__fade {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 100%;
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, 0.72) 42%,
    rgba(255, 255, 255, 0.96) 78%,
    #ffffff 100%
  );
  pointer-events: none;
}

.store-product-reviews-wrap .store-reviews-collapse__toggle {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  margin-top: auto;
  padding: 0 22px;
  border: 1px solid #d1d5db;
  border-radius: 999px;
  color: #111111;
  font-size: 14px;
  font-weight: 600;
  line-height: 1;
  background: #ffffff;
  cursor: pointer;
  pointer-events: auto;
  transition: border-color 0.2s ease, background-color 0.2s ease, transform 0.2s ease;
}

.store-product-reviews-wrap .store-reviews-collapse__toggle:hover,
.store-product-reviews-wrap .store-reviews-collapse__toggle:focus-visible {
  border-color: #111111;
  background: #fafafa;
  transform: translateY(-1px);
  outline: none;
}

.store-product-reviews-wrap .store-reviews-collapse__toggle-icon {
  width: 8px;
  height: 8px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg) translateY(-2px);
  transition: transform 0.25s ease;
}

.store-product-reviews-wrap .store-reviews-collapse.is-expanded .store-reviews-collapse__overlay,
.store-product-reviews-wrap .store-reviews-collapse.is-short .store-reviews-collapse__overlay {
  opacity: 0;
  visibility: hidden;
}

.store-product-reviews-wrap .store-reviews-collapse.is-short .store-reviews-collapse__viewport {
  max-height: none;
  overflow: visible;
}
