/* ============================================================
   Product Review Section
   ============================================================ */

.product-review {
  padding: 3rem 2rem;
  padding-top: 100px;
}

.review__inner {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 33px;
  align-items: flex-start;
}

/* ── Summary (left column) ── */
.review__title {
  margin-bottom: 44px;
  color: #000;
  font-family: Montserrat;
  font-size: 36px;
  font-style: normal;
  font-weight: 600;
  line-height: normal;
}

.review__score {
  display: flex;
  align-items: center;
  gap: 28px;
  margin-bottom: 31px;
}

.review__score-number {
  font-size: 3.5rem;
  font-weight: 800;
  line-height: 1;
  color: #111;
}

.review__score-right {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.review__score-count {
  color: #000;
  font-family: Montserrat;
  font-size: 16px;
  font-style: normal;
  font-weight: 400;
  line-height: normal;
}

/* Stars */
.review__stars {
  display: flex;
  gap: 2px;
}

.star {
  font-size: 20px;
  color: #ddd;
  line-height: 1;
}

.star--filled {
  color: #00bcd4;
}

/* Partial star rating (điểm trung bình theo %) */
.stars-partial {
  position: relative;
  display: inline-flex;
}

.stars-partial__bg,
.stars-partial__fill {
  display: flex;
  gap: 2px;
}

.stars-partial__fill {
  position: absolute;
  top: 0;
  left: 0;
  overflow: hidden;
  white-space: nowrap;
}

/* Rating bars */
.review__bars {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.review__bar-row {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8rem;
}

.review__bar-label {
  text-align: center;
  width: 16px;
  color: #000;
  font-family: Montserrat;
  font-size: 16px;
  font-style: normal;
  font-weight: 700;
  line-height: normal;
}

.review__bar-row .star {
  font-size: 16px;
}

.review__bar-track {
  flex: 1;
  height: 6px;
  background: #e5e5e5;
  border-radius: 99px;
  overflow: hidden;
}

.review__bar-fill {
  height: 100%;
  background: #111;
  border-radius: 99px;
  transition: width 0.4s ease;
}

.review__bar-count {
  width: 2rem;
  text-align: right;
  color: #000;
  font-family: Montserrat;
  font-size: 16px;
  font-style: normal;
  font-weight: 400;
  line-height: normal;
}

/* ── Main (right column) ── */
.review__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 40px;
  border-bottom: 2px solid #d7d7d7;
}

.review__tab {
  font-size: 1rem;
  font-weight: 700;
  color: #111;
  display: flex;
  align-items: center;
  gap: 0.3rem;
  padding-bottom: 10px;
  position: relative;
}
.review__tab::before {
  position: absolute;
  content: "";
  left: 0;
  bottom: -4px;
  right: 0;
  border-radius: 10px;
  background: #000;
  width: 100%;
  height: 8px;
}

.review__tab-count {
  font-weight: 400;
  color: #555;
}

.review__actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 40px;
}
.review__actions_left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}
/* Search */
.review__search-wrap {
  width: 314px;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  border-radius: 4px;
  border: 1px solid #bfbfbf;
  padding: 10px;
  background: #fff;
}

.review__search-wrap svg {
  color: #aaa;
  flex-shrink: 0;
}

.review__search {
  border: none;
  outline: none;
  width: 160px;
  background: transparent;
  color: #000;
  font-family: Montserrat;
  font-size: 16px;
  font-style: normal;
  font-weight: 400;
  line-height: normal;
}

/* Filter */
.review__filter-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.review__filter {
  appearance: none;
  border: 1px solid #ddd;
  border-radius: 6px;
  padding: 10px;
  padding-right: 40px;
  background: #fff;
  color: #333;
  cursor: pointer;
  outline: none;
  color: #000;
  text-align: right;
  font-family: Montserrat;
  font-size: 16px;
  font-style: normal;
  font-weight: 400;
  line-height: normal;
}

.review__filter-arrow {
  position: absolute;
  right: 12px;
  pointer-events: none;
  color: #888;
}

/* Write button */
.review__write-btn {
  background: #00bcd4;
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 10px;
  font-family: Montserrat;
  font-size: 16px;
  font-style: normal;
  font-weight: 700;
  line-height: normal;
  cursor: pointer;
  transition: background 0.2s;
  white-space: nowrap;
}

.review__write-btn:hover {
  background: #c62828;
}

/* ── Review Form ── */
.review__form-wrap {
  background: #f9f9f9;
  border: 1px solid #e8e8e8;
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  animation: reviewFadeIn 0.25s ease;
}

@keyframes reviewFadeIn {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.review__form-grid {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 1.5rem;
}

.review__form-group {
  margin-bottom: 1rem;
}

.review__form-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: #333;
  margin-bottom: 0.4rem;
}

/* Star picker */
.review__star-picker {
  display: flex;
  gap: 4px;
  margin-bottom: 0.75rem;
}

.star-pick {
  font-size: 1.8rem;
  color: #ccc;
  cursor: pointer;
  transition:
    color 0.15s,
    transform 0.1s;
  line-height: 1;
}

.star-pick:hover,
.star-pick.hovered,
.star-pick.selected {
  color: #00bcd4;
  transform: scale(1.1);
}

/* Media upload */
.review__media-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: flex-start;
}

.review__media-add {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  width: 90px;
  height: 90px;
  border: 2px dashed #ccc;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.7rem;
  color: #888;
  transition:
    border-color 0.2s,
    color 0.2s;
  background: #fff;
}

.review__media-add:hover {
  border-color: #00bcd4;
  color: #00bcd4;
}

.review__media-preview {
  position: relative;
  width: 90px;
  height: 90px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid #e0e0e0;
}

.review__media-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.review__media-remove {
  position: absolute;
  top: 3px;
  right: 3px;
  width: 20px;
  height: 20px;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  border: none;
  border-radius: 50%;
  font-size: 0.7rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  padding: 0;
}

/* Textarea */
.review__textarea-wrap {
  position: relative;
}

.review__textarea {
  width: 100%;
  min-height: 120px;
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 0.75rem;
  font-size: 0.85rem;
  resize: vertical;
  outline: none;
  transition: border-color 0.2s;
  font-family: inherit;
  color: #333;
  background: #fff;
}

.review__textarea:focus {
  border-color: #00bcd4;
}

.review__char-count {
  position: absolute;
  bottom: 0.5rem;
  right: 0.75rem;
  font-size: 0.72rem;
  color: #aaa;
}

/* Inputs */
.review__input {
  width: 100%;
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 0.6rem 0.75rem;
  font-size: 0.85rem;
  outline: none;
  transition: border-color 0.2s;
  font-family: inherit;
  color: #333;
  background: #fff;
}

.review__input:focus {
  border-color: #00bcd4;
}

/* Form footer */
.review__form-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  padding-top: 1rem;
  border-top: 1px solid #e8e8e8;
  margin-top: 0.5rem;
}

.review__form-msg {
  font-size: 0.85rem;
  flex: 1;
}

.review__form-msg.success {
  color: #2e7d32;
}
.review__form-msg.error {
  color: #c62828;
}

.review__form-btns {
  display: flex;
  gap: 0.75rem;
}

.review__submit-btn {
  background: #1a1a2e;
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 0.6rem 1.4rem;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition:
    background 0.2s,
    opacity 0.2s;
}

.review__submit-btn:hover {
  background: #16213e;
}
.review__submit-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.review__cancel-btn {
  background: #fff;
  color: #333;
  border: 1px solid #ccc;
  border-radius: 8px;
  padding: 0.6rem 1.2rem;
  font-size: 0.9rem;
  cursor: pointer;
  transition: border-color 0.2s;
}

.review__cancel-btn:hover {
  border-color: #999;
}

/* ── Review List ── */
.review__list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.review__empty {
  text-align: center;
  color: #aaa;
  padding: 2rem 0;
  font-size: 0.9rem;
}

.review__item {
  background: #fff;
  border: 1px solid #ebebeb;
  border-radius: 12px;
  padding: 28px 25px;
  transition: box-shadow 0.2s;
}

.review__item:hover {
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.07);
}

.review__item-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.review__item-author {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.review__item-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #e0e0e0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.9rem;
  color: #555;
  text-transform: uppercase;
  flex-shrink: 0;
}

.review__item-name {
  color: #000;
  font-family: Montserrat;
  font-size: 16px;
  font-style: normal;
  font-weight: 600;
  line-height: normal;
}

.review__verified-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  background: #e8f5e9;
  color: #2e7d32;
  font-size: 0.68rem;
  font-weight: 600;
  padding: 2px 7px 2px 5px;
  border-radius: 20px;
  white-space: nowrap;
  vertical-align: middle;
}

.review__item-stars {
  display: flex;
  gap: 2px;
}

.review__item-stars .star {
  font-size: 0.9rem;
}

.review__item-content {
  color: #000;
  font-family: Montserrat;
  font-size: 14px;
  font-style: normal;
  font-weight: 300;
  line-height: normal;
  margin-bottom: 24px;
}

/* Review images */
.review__item-images {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.review__item-img-link {
  display: block;
  width: 72px;
  height: 72px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid #e0e0e0;
  flex-shrink: 0;
}

.review__item-img-link img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.2s;
}

.review__item-img-link:hover img {
  transform: scale(1.05);
}

/* Footer: date + votes */
.review__item-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 0.25rem;
}

.review__item-date {
  font-size: 0.75rem;
  color: #aaa;
}

.review__item-votes {
  display: flex;
  gap: 0.5rem;
}

.review__vote-btn {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  background: none;
  border: 1px solid #e0e0e0;
  border-radius: 20px;
  padding: 0.3rem 0.65rem;
  font-size: 0.78rem;
  color: #888;
  cursor: pointer;
  transition: all 0.2s;
}

.review__vote-btn:hover {
  border-color: #bbb;
  color: #555;
}

.review__vote-btn--like.active {
  border-color: #00bcd4;
  color: #00bcd4;
  background: #e0f7fa;
}

.review__vote-btn--dislike.active {
  border-color: #e53935;
  color: #e53935;
  background: #ffebee;
}

.review__vote-count {
  font-size: 0.78rem;
}

/* Load more */
.review__load-more-wrap {
  text-align: center;
  margin-top: 1.25rem;
}

.review__load-more {
  background: #fff;
  border: 1px solid #ccc;
  border-radius: 8px;
  padding: 0.6rem 2rem;
  font-size: 0.85rem;
  color: #333;
  cursor: pointer;
  transition:
    border-color 0.2s,
    background 0.2s;
}

.review__load-more:hover {
  border-color: #999;
  background: #f5f5f5;
}

.review__load-more:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ── Responsive ── */
@media (max-width: 900px) {
  .review__inner {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .review__summary {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 1.5rem;
    align-items: start;
  }

  .review__title {
    grid-column: 1 / -1;
  }
}

@media (max-width: 640px) {
  .product-review {
    padding: 2rem 1rem;
  }

  .review__form-grid {
    grid-template-columns: 1fr;
  }

  .review__header {
    flex-direction: column;
    align-items: flex-start;
  }

  .review__actions {
    width: 100%;
  }

  .review__search {
    width: 120px;
  }

  .review__summary {
    grid-template-columns: 1fr;
  }
}
