/**
 * reviews-fix.css — v2 (2026-08-24)
 * New rv-* BEM component styles for the fully-restructured Review Tab.
 * Also retains legacy containment rules for any remaining old-style markup.
 * Load AFTER custom.min.css.
 */

/* =========================================================
   1. CONTAINMENT (prevent horizontal scroll on any page)
   ========================================================= */
#customers-reviews,
#customers-reviews-2,
#customer.tab-pane,
.tabcustomer_target,
.product-all-detail-tab .tab-content,
.product-all-detail-tab .tab-pane {
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
  overflow: visible;
}

#customers-reviews > .row,
#customers-reviews-2 > .row,
#customer.tab-pane > .row,
.tabcustomer_target > .row,
.product-all-detail-tab .tab-pane > .row {
  margin-left: 0 !important;
  margin-right: 0 !important;
  max-width: 100%;
}

/* =========================================================
   2. RV-TAB-ROOT — top-level wrapper
   ========================================================= */
.rv-tab-root {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  padding: 16px 0 8px;
}

/* =========================================================
   3. HEADER: total count + star-filter chips
   ========================================================= */
.rv-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 16px;
  margin-bottom: 16px;
}

.rv-total-heading {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  white-space: nowrap;
  flex: 0 0 auto;
}

/* Chips row */
.rv-chips {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  flex: 1 1 auto;
}

.rv-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border: 1.5px solid var(--color-border-default, #e0e0e0);
  border-radius: 20px;
  background: var(--color-bg-surface, #fff);
  color: var(--color-text-secondary, #555);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.18s, border-color 0.18s, color 0.18s, box-shadow 0.18s;
  white-space: nowrap;
  line-height: 1.3;
  /* Remove browser default button styling that causes the black border/outline */
  outline: none;
  -webkit-appearance: none;
  appearance: none;
  box-shadow: none;
}

.rv-chip:hover {
  border-color: var(--color-info, #2196f3);
  color: var(--color-info, #2196f3);
  background: color-mix(in srgb, var(--color-info, #2196f3) 8%, transparent);
  outline: none;
  box-shadow: none;
}

/* Focus-visible: accessible keyboard ring in brand color, not browser black */
.rv-chip:focus,
.rv-chip:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--color-info, #2196f3) 40%, transparent);
}

.rv-chip:active {
  outline: none;
  box-shadow: none;
}

.rv-chip--active,
.rv-chip--active:focus,
.rv-chip--active:focus-visible,
.rv-chip--active:active {
  border-color: var(--color-info, #2196f3);
  background: color-mix(in srgb, var(--color-info, #2196f3) 12%, transparent);
  color: var(--color-info, #2196f3);
  font-weight: 600;
  outline: none;
  box-shadow: none;
}

.rv-chip-count {
  font-size: 14px;
  opacity: 0.8;
}

/* =========================================================
   4. RATING BREAKDOWN BARS
   ========================================================= */
.rv-bars {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-width: 420px;
  margin-bottom: 20px;
}

.rv-bar-row {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  border-radius: 6px;
  padding: 2px 4px;
  transition: background 0.15s;
}

.rv-bar-row:hover {
  background: color-mix(in srgb, var(--color-brand-primary, #ff6b35) 6%, transparent);
}

.rv-bar-label {
  flex: 0 0 28px;
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text-secondary, #555);
  text-align: right;
}

.rv-bar-track {
  flex: 1 1 auto;
  min-width: 0;
}

.rv-bar-track .MuiLinearProgress-root {
  border-radius: 4px;
  height: 8px;
  background-color: var(--color-border-default, #e8e8e8);
}

.rv-bar-track .MuiLinearProgress-bar {
  background-color: var(--color-star-active, #f5a623);
  border-radius: 4px;
}

.rv-bar-pct {
  flex: 0 0 36px;
  font-size: 12px;
  color: var(--color-text-secondary, #777);
  text-align: right;
}

.rv-bar-cnt {
  flex: 0 0 32px;
  font-size: 12px;
  color: var(--color-text-tertiary, #999);
  text-align: left;
}

/* =========================================================
   5. REVIEW CARDS LIST
   ========================================================= */
.rv-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.rv-card {
  padding: 16px 0;
  border-bottom: 1px solid var(--color-border-default, #ebebeb);
}

.rv-card:last-child {
  border-bottom: none;
}

/* Card header: avatar + meta + seller actions */
.rv-card-header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 8px;
}

/* Avatar */
.rv-avatar {
  position: relative;
  flex: 0 0 42px;
  width: 42px;
  height: 42px;
}

.rv-avatar img {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
}

.rv-avatar--sm {
  flex: 0 0 32px;
  width: 32px;
  height: 32px;
}

.rv-avatar--sm img {
  width: 32px;
  height: 32px;
}

/* Meta: name, date, stars */
.rv-card-meta {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.rv-author-name {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text-primary, #111);
  line-height: 1.3;
}

.rv-date {
  font-size: 12px;
  color: var(--color-text-tertiary, #999);
}

.rv-star-row {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 2px;
}

/* Seller action buttons */
.rv-seller-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  flex: 0 0 auto;
}

.rv-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: var(--color-text-link, #007bff);
  cursor: pointer;
  white-space: nowrap;
  text-decoration: none;
}

.rv-action-btn:hover {
  color: var(--color-brand-primary, #ff6b35);
}

/* Review text */
.rv-card-text {
  margin: 4px 0 0 54px; /* indent past avatar */
  font-size: 14px;
  line-height: 1.6;
  color: var(--color-text-primary, #222);
  word-break: break-word;
  overflow-wrap: anywhere;
}

/* =========================================================
   6. REPLY THREADS
   ========================================================= */
.rv-reply {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 10px;
  margin-left: 42px;
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--color-bg-subtle, #f7f7f7);
}

.rv-reply-body {
  flex: 1 1 auto;
  min-width: 0;
}

.rv-reply-text {
  margin: 4px 0 0;
  font-size: 13px;
  color: var(--color-text-secondary, #444);
  word-break: break-word;
  overflow-wrap: anywhere;
}

/* Reply-as-seller form */
.rv-reply-form {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 10px;
  margin-left: 42px;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--color-border-default, #e0e0e0);
  background: var(--color-bg-surface, #fff);
}

.rv-reply-form-body {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* =========================================================
   7. SHARED TEXTAREA
   ========================================================= */
.rv-textarea {
  width: 100%;
  box-sizing: border-box;
  min-height: 60px;
  padding: 8px 12px;
  border: 1px solid var(--color-border-default, #ddd);
  border-radius: 8px;
  font-size: 14px;
  line-height: 1.5;
  resize: vertical;
  background: var(--color-bg-surface, #fff);
  color: var(--color-text-primary, #111);
  transition: border-color 0.18s;
}

.rv-textarea:focus {
  outline: none;
  border-color: var(--color-brand-primary, #ff6b35);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--color-brand-primary, #ff6b35) 15%, transparent);
}

.rv-reply-submit {
  align-self: flex-end;
}

/* =========================================================
   8. SEE ALL LINK
   ========================================================= */
.rv-see-all {
  text-align: right;
  padding: 12px 0 4px;
}

/* =========================================================
   9. LEAVE-A-REVIEW FORM
   ========================================================= */
.rv-leave-review {
  margin-top: 20px;
  padding: 16px;
  border-radius: 10px;
  border: 1px solid var(--color-border-default, #e0e0e0);
  background: var(--color-bg-subtle, #fafafa);
}

.rv-leave-heading {
  margin: 0 0 12px;
  font-size: 15px;
  font-weight: 700;
}

.rv-leave-inner {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.rv-leave-body {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.rv-leave-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text-primary, #111);
}

.rv-leave-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}

.rv-char-count {
  font-size: 12px;
  color: var(--color-text-tertiary, #aaa);
}

.rv-leave-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

/* =========================================================
   10. RESPONSIVE BREAKPOINTS
   ========================================================= */

/* Tablet (≤768px) */
@media screen and (max-width: 768px) {
  .rv-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .rv-chips {
    width: 100%;
  }

  .rv-bars {
    max-width: 100%;
  }

  .rv-card-text {
    margin-left: 0;
  }

  .rv-reply,
  .rv-reply-form {
    margin-left: 0;
  }

  .rv-seller-actions {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
  }

  .rv-leave-footer {
    flex-direction: column;
    align-items: flex-start;
  }

  .rv-leave-actions {
    width: 100%;
    justify-content: space-between;
  }
}

/* Small mobile (≤480px) */
@media screen and (max-width: 480px) {
  .rv-tab-root {
    padding: 12px 0 4px;
  }

  .rv-total-heading {
    font-size: 15px;
  }

  .rv-chip {
    padding: 3px 8px;
    font-size: 12px;
  }

  .rv-avatar {
    flex: 0 0 36px;
    width: 36px;
    height: 36px;
  }

  .rv-avatar img {
    width: 36px;
    height: 36px;
  }

  .rv-avatar--sm {
    flex: 0 0 28px;
    width: 28px;
    height: 28px;
  }

  .rv-avatar--sm img {
    width: 28px;
    height: 28px;
  }

  .rv-author-name {
    font-size: 13px;
  }

  .rv-card-text {
    font-size: 13px;
  }

  .rv-leave-inner {
    flex-direction: column;
  }

  .rv-leave-inner .rv-avatar {
    flex: 0 0 36px;
  }
}

/* =========================================================
   11. LEGACY CONTAINMENT (old star-filter / rating-row markup)
   Keep these for any older components not yet migrated.
   ========================================================= */
.customer-review-bx,
.customer-review-bx-mobile {
  white-space: normal !important;
}

.rating_section,
.product-all-detail-tab .rating_section,
.customer-review-bx .rating_section,
.rating_box {
  display: flex !important;
  flex-wrap: wrap !important;
  align-items: center !important;
  gap: 4px 8px !important;
  white-space: normal !important;
  overflow-x: visible !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
}

.rating_section .star,
.rating_section .star-filter,
.rating_section .star.col,
.rating_section .star.col.d-content,
.rating_box .star,
.rating_box .star-filter {
  display: inline-flex !important;
  align-items: center !important;
  flex: 0 0 auto !important;
  width: auto !important;
  max-width: none !important;
  padding: 0 !important;
  margin: 0 !important;
  gap: 2px;
  white-space: nowrap !important;
}

.col-xl-4 > .customer-review-bx {
  display: flex !important;
  flex-direction: column !important;
  gap: 8px !important;
  width: 100% !important;
  max-width: 420px;
}

.col-xl-4 > .customer-review-bx .rating-row,
.col-xl-4 .rating-row {
  display: flex !important;
  flex-wrap: nowrap !important;
  align-items: center !important;
  gap: 8px !important;
  width: 100% !important;
  margin: 0 !important;
}

.col-xl-4 .rating-row .star-txt { flex: 0 0 58px; white-space: nowrap; }
.col-xl-4 .rating-row .rating-view { flex: 1 1 auto !important; min-width: 0 !important; padding: 0 6px !important; }
.col-xl-4 .rating-row .rating-text { flex: 0 0 40px; text-align: right; padding: 0 !important; }
.col-xl-4 .rating-row .rating-text h4 { margin: 0 !important; font-size: 14px !important; }
.col-xl-4 .rating-row .star.col { flex: 0 0 auto !important; width: auto !important; padding: 0 !important; }

.customer-review-profile_block,
.review_block,
.review_mess,
.review_reply,
.rated-customer-bx-inner,
.customer_review_track {
  max-width: 100%;
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.this_subManage_Listings {
  max-width: 100%;
  overflow: visible;
}

/* Livestream rating_row_main_box */
.rating_row_main_box {
  display: flex !important;
  flex-direction: column !important;
  align-items: stretch !important;
  gap: 8px !important;
  width: 100% !important;
  max-width: 100% !important;
}

.rating_row_main_box .rating-row {
  display: flex !important;
  flex-wrap: wrap !important;
  align-items: center !important;
  gap: 6px 10px !important;
  width: 100% !important;
  margin: 0 !important;
}

@media screen and (max-width: 991.98px) {
  .product-all-detail-tab .tab-content {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }

  .customer-review-bx.d-flex.justify-content-between,
  .customer-review-bx-mobile.d-flex {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 8px;
  }

  .customer-review-profile_block {
    margin-inline: 0 !important;
  }
}
