/* ========== MD REVIEWS (FRONTEND) ========== */
.md-review-card{
  display: flex;
  gap: 18px;
  padding: 16px 18px;
  border: 1px solid rgba(244,136,4,.25);
  border-radius: 12px;
  background: #fff;
  align-items: flex-start;
}

/* Left block */
.md-review-left{
  flex: 1;
  min-width: 0;
}

.md-review-head{
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

/* Avatar */
.md-review-avatar{
  width: 42px;
  height: 42px;
  border-radius: 999px;
  overflow: hidden;
  flex: 0 0 42px;
  border: 1px solid rgba(244,136,4,.25);
  background: #fff7e1;
  display: grid;
  place-items: center;
  font-weight: 800;
  color: #f48804;
}
.md-review-avatar img{
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.md-review-user{
  min-width: 0;
}

.md-review-name{
  font-weight: 800;
  font-size: 15px;
  color: #111827;
  line-height: 1.2;
}

/* Stars */
.md-review-stars{
  margin-top: 2px;
  display: flex;
  gap: 2px;
  font-size: 14px;
  line-height: 1;
}
.md-star{ opacity: .25; }
.md-star.is-on{
  opacity: 1;
  color: #f48804;
}

/* Meta line */
.md-review-meta{
  margin-top: 6px;
  font-size: 12px;
  color: #6b7280;
}

/* Content */
.md-review-content{
  margin-top: 10px;
  font-size: 14px;
  line-height: 1.6;
  color: #374151;
}

/* Right media block */
.md-review-media{
  width: 330px;
  flex: 0 0 330px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Gallery phải có wrapper riêng mới grid ổn định */
.md-review-gallery{
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

/* Media items */
.md-media-item{
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid rgba(244,136,4,.25);
  background: #fff;
  display: block;
  box-sizing: border-box;
  text-decoration: none;
}

/* Ảnh vuông */
.md-media-img{
  aspect-ratio: 1 / 1;
}

.md-media-img img{
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Video dưới gallery */
.md-media-video{
  min-height: 92px;
  display: grid;
  place-items: center;
  position: relative;
  background: linear-gradient(135deg, #fceb8c, #f48804);
  color: #fff !important;
  text-decoration: none !important;
  text-align: center;
  padding: 14px;
}

.md-media-video .md-play{
  font-size: 20px;
  width: 38px;
  height: 38px;
  border-radius: 999px;
  display: inline-grid;
  place-items: center;
  background: rgba(255,255,255,.2);
  border: 1px solid rgba(255,255,255,.35);
}
.md-media-video .md-video-text{
  font-size: 12px;
  margin-top: 6px;
  display: block;
  opacity: .95;
}

/* Tablet */
@media (max-width: 768px){
  .md-review-card{
    flex-direction: column;
  }

  .md-review-media{
    width: 100%;
    flex: none;
  }

  .md-review-gallery{
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* Mobile */
@media (max-width: 480px){
  .md-review-gallery{
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* ========== REVIEW COLLAPSE / EXPAND ========== */
.md-reviews__body{
  position: relative;
}

.md-reviews__inner{
  max-height: 700px;
  overflow: hidden;
  transition: max-height .3s ease;
}

.md-reviews__body.is-collapsible:not(.is-expanded) .md-reviews__inner{
  max-height: 700px;
  overflow: hidden;
}

.md-reviews__body.is-expanded .md-reviews__inner{
  max-height: none;
  overflow: visible;
}

/* fade mờ phía dưới khi chưa mở */
.md-reviews__body.is-collapsible:not(.is-expanded)::after{
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 72px;
  height: 120px;
  pointer-events: none;
  background: linear-gradient(to bottom, rgba(255,255,255,0), #fff 75%);
}

/* vùng nút */
.md-reviews__actions{
  display: flex;
  justify-content: center;
  margin-top: 16px;
  position: relative;
  z-index: 2;
}

/* nút xem thêm */
.md-reviews__toggle{
  appearance: none;
  border: 1px solid rgba(244,136,4,.45);
  background: #fff;
  color: #f48804;
  border-radius: 999px;
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  transition: all .2s ease;
  box-shadow: 0 4px 14px rgba(0,0,0,.04);
}

.md-reviews__toggle:hover{
  background: #fff7e1;
  border-color: #f48804;
}

.md-reviews__toggle:focus{
  outline: none;
  box-shadow: 0 0 0 3px rgba(244,136,4,.18);
}

/* cho card cách nhau đẹp hơn nếu theme chưa có */
.md-reviews__grid{
  display: flex;
  flex-direction: column;
  gap: 16px;
}


.md-product-rating-summary {
  margin: 8px 0 14px;
}

.md-product-rating-stars {
  position: relative;
  display: inline-block;
  font-size: 18px;
  line-height: 1;
  letter-spacing: 2px;
  margin-bottom: 6px;
}

.md-product-rating-stars__base {
  color: #d9d9d9;
}

.md-product-rating-stars__fill {
  position: absolute;
  top: 0;
  left: 0;
  overflow: hidden;
  white-space: nowrap;
  color: #f5a623;
}

.md-product-rating-text {
  display: inline-block;
  font-size: 16px;
  line-height: 1.2;
  padding: 0;
  background: transparent;
}

.md-product-rating-summary--empty {
  font-size: 14px;
  color: #666;
}