/* Модуль отзывов: список, форма, лайтбокс фото */

/* Старые WebKit/iOS без полного <dialog>: закрытие через removeAttribute('open') + display (см. reviews-module.js) */
dialog.rv-dlg:not([open]),
dialog#rv-photo-fs:not([open]) {
  display: none !important;
}
#rv-form-dlg.rv-dlg[open],
#rv-report-dlg.rv-dlg[open],
#rv-list-dlg.rv-dlg--list[open] {
  z-index: 100000;
}
#rv-photo-fs[open] {
  z-index: 100001;
}

/* Пока открыт список отзывов — не прокручивать страницу под модалкой */
html.rv-reviews-modal-open,
html.rv-reviews-modal-open body {
  overflow: hidden;
  overscroll-behavior: none;
}

.pd-rating-row {
  display: flex;
  justify-content: center;
  margin: 0;
}
.pd-img-wrap .pd-rating-row {
  position: static;
  top: auto;
  left: auto;
  z-index: auto;
  justify-content: flex-start;
  pointer-events: auto;
}
.pd-rating-row[hidden] {
  display: none !important;
}
.pd-rating-row__btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 9px;
  border: 1px solid var(--border, #ddd);
  border-radius: 14px;
  background: var(--card, #fff);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  font-size: 0.72rem;
  color: var(--text, #555);
  cursor: pointer;
  font-family: inherit;
  white-space: nowrap;
}
[data-theme="dark"] .pd-img-wrap .pd-rating-row__btn {
  background: var(--bg-secondary, #1e293b);
  border-color: var(--border, #404040);
  color: var(--text-secondary, #cbd5e1);
}
.pd-rating-row__btn:hover {
  background: var(--primary-light, #e8f1ff);
  border-color: rgba(0, 91, 255, 0.35);
}
.pd-rating-row__btn--empty {
  color: var(--text-muted, #888);
}
.pd-rating-row__btn--empty:hover {
  color: var(--text, #555);
  background: var(--card, #fff);
}
[data-theme="dark"] .pd-rating-row__btn--empty:hover {
  color: var(--text-secondary, #cbd5e1);
  background: var(--bg-secondary, #1e293b);
}
.pd-rating-stars {
  color: #ffb300;
  letter-spacing: 1px;
}

.rv-dlg {
  border: none;
  border-radius: var(--radius-lg, 12px);
  padding: 0;
  max-width: 96vw;
  max-height: 92vh;
  box-shadow: var(--shadow-lg, 0 8px 24px rgba(0,0,0,.12));
  background: var(--card, #fff);
  color: var(--text, #1a1a1a);
}
/* Форма отзыва — по центру */
#rv-form-dlg.rv-dlg {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  margin: 0;
}

/* Жалоба на отзыв — по центру окна, компактная панель */
#rv-report-dlg.rv-dlg {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  margin: 0;
}
#rv-report-dlg .rv-dlg__panel--report {
  min-width: 0;
  width: min(440px, 96vw);
  max-width: 96vw;
  max-height: min(88dvh, 520px);
  padding: 16px 18px 14px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  border-radius: var(--radius-lg, 12px);
}
@media (max-width: 500px) {
  #rv-report-dlg .rv-dlg__panel--report {
    width: 96vw;
    max-width: 96vw;
    border-radius: 12px;
  }
}
#rv-report-dlg .rv-dlg__title {
  text-align: center;
  margin-bottom: 4px;
  padding: 0 40px;
  box-sizing: border-box;
}
#rv-report-dlg .rv-dlg__report-hint {
  text-align: center;
  margin: 0 0 10px;
  padding: 0 40px;
  box-sizing: border-box;
}
#rv-report-dlg .rv-field--report-text {
  margin-bottom: 0;
  flex: 0 0 auto;
  min-height: 0;
}
#rv-report-dlg .rv-report-textarea-wrap {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  flex: 0 0 auto;
  /* Жёсткая «коробка» под 3 строки — иначе WebKit/Safari растягивает textarea на свободное место в модалке */
  height: calc(1.45em * 3 + 16px);
  max-height: calc(1.45em * 3 + 16px);
  overflow: hidden;
}
#rv-report-dlg .rv-report-textarea-wrap textarea {
  width: 100%;
  min-width: 0;
  display: block;
  box-sizing: border-box;
  resize: none !important;
  overflow-y: auto;
  line-height: 1.45;
  padding: 8px 10px;
  margin: 0;
  vertical-align: top;
  field-sizing: fixed;
  /* Ровно 3 строки; !important — перебивает UA / iOS и любые min-height от rows */
  min-height: calc(1.45em * 3 + 16px) !important;
  height: calc(1.45em * 3 + 16px) !important;
  max-height: calc(1.45em * 3 + 16px) !important;
}
#rv-report-dlg .rv-msg {
  margin: 6px 0 0;
  min-height: 0;
}
#rv-report-dlg .rv-report-actions {
  margin-top: 10px;
  display: flex;
  flex-wrap: nowrap;
  justify-content: center;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
#rv-report-dlg .rv-report-actions #rv-report-submit {
  flex: 1 1 auto;
  min-width: 0;
  text-align: center;
  line-height: 1.25;
  white-space: nowrap;
}
#rv-report-dlg .rv-report-actions #rv-report-cancel {
  flex: 0 0 auto;
  text-align: center;
  line-height: 1.25;
  white-space: nowrap;
}
@media (max-width: 380px) {
  #rv-report-dlg .rv-report-actions #rv-report-submit {
    font-size: 0.8rem;
    padding-left: 8px;
    padding-right: 8px;
  }
  #rv-report-dlg .rv-report-actions #rv-report-cancel {
    font-size: 0.8rem;
  }
}

/* Окно списка отзывов: полноэкранный dialog, панель 80%×80%, клик по затемнению закрывает */
#rv-list-dlg.rv-dlg--list {
  position: fixed;
  inset: 0;
  width: 100%;
  max-width: none;
  min-height: 100vh;
  min-height: 100dvh;
  height: 100%;
  max-height: none;
  margin: 0;
  padding: 0;
  border: none;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  overflow: hidden;
  color: var(--text, #1a1a1a);
}
#rv-list-dlg.rv-dlg--list::backdrop {
  background: rgba(0, 0, 0, 0.45);
}
.rv-dlg__close-hit {
  position: absolute;
  inset: 0;
  z-index: 0;
  cursor: pointer;
}
.rv-dlg__sheet--list {
  position: absolute;
  left: 50%;
  top: max(env(safe-area-inset-top, 0px), 1vh);
  width: 98vw;
  height: calc(100dvh - max(env(safe-area-inset-top, 0px), 1vh) - max(env(safe-area-inset-bottom, 0px), 1vh));
  max-width: 98vw;
  max-height: calc(100dvh - max(env(safe-area-inset-top, 0px), 1vh) - max(env(safe-area-inset-bottom, 0px), 1vh));
  transform: translateX(-50%);
  z-index: 1;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  background: var(--card, #fff);
  border-radius: var(--radius-lg, 12px);
  box-shadow: var(--shadow-lg, 0 8px 24px rgba(0, 0, 0, 0.18));
  overflow: hidden;
  pointer-events: auto;
}
@media (max-width: 899px) {
  .rv-dlg__sheet--list {
    width: 96vw;
    max-width: 96vw;
    top: max(env(safe-area-inset-top, 0px), 8px);
    /* Без JS: ступенька vh → dvh; JS (visualViewport / innerHeight) перебивает инлайном */
    height: 98vh;
    max-height: 98vh;
    height: 98dvh;
    max-height: 98dvh;
    min-height: 45vh;
  }
}
/* Узкие экраны + движки с svh: не выше «малого» viewport — меньше залезания под панели браузера */
@supports (height: 98svh) {
  @media (max-width: 899px) {
    .rv-dlg__sheet--list {
      height: min(98dvh, 98svh);
      max-height: min(98dvh, 98svh);
    }
  }
}
@media (min-width: 900px) {
  .rv-dlg__sheet--list {
    width: min(1200px, 98vw);
  }
}
.rv-dlg__list-head {
  flex-shrink: 0;
  position: relative;
  z-index: 2;
  padding: 12px 6px 10px 12px;
  border-bottom: 1px solid var(--border-light, #eee);
  background: var(--card, #fff);
}
@media (min-width: 900px) {
  .rv-dlg__list-head {
    padding: 14px 8px 12px 16px;
  }
  .rv-list-head-title-row .rv-list-sort__select--head {
    width: auto;
    max-width: min(280px, 42%);
  }
}
.rv-list-head-title-row {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  justify-content: flex-start;
  gap: 12px;
  flex-shrink: 0;
  box-sizing: border-box;
}
.rv-list-head-title-row .rv-list-header {
  order: 1;
  flex: 1 1 auto;
  min-width: 0;
  margin: 0;
  text-align: left;
}
.rv-list-head-title-row .rv-list-sort__select--head {
  order: 2;
  flex: 0 1 auto;
  width: auto;
  max-width: min(260px, 38vw);
  margin-left: 0;
  box-sizing: border-box;
}
.rv-dlg__sheet--list .rv-dlg__x--list-head {
  order: 3;
  position: static;
  top: auto;
  right: auto;
  flex-shrink: 0;
  align-self: flex-start;
  margin: -2px -4px 0 auto;
  z-index: 1;
  width: 36px;
  height: 36px;
  box-sizing: border-box;
}
@media (max-width: 500px) {
  .rv-list-head-title-row {
    flex-wrap: wrap;
    row-gap: 8px;
    column-gap: 10px;
  }
  .rv-list-head-title-row .rv-list-sort__select--head {
    order: 3;
    flex: 1 1 100%;
    width: 100%;
    max-width: 100%;
  }
  .rv-dlg__sheet--list .rv-dlg__x--list-head {
    order: 2;
    margin-left: auto;
  }
}
.rv-list-head-title-row .rv-list-header__title {
  margin: 0;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.35;
  display: block;
}
.rv-dlg__list-head .rv-list-header {
  margin-bottom: 0;
}
.rv-list-sort__select--head {
  flex: 0 0 auto;
  max-width: min(220px, 46vw);
  margin-left: 0;
}
@media (max-width: 639px) {
  .rv-list-sort__select--head {
    max-width: 100%;
    width: 100%;
  }
}
.rv-list-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-start;
  gap: 8px 12px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border-light, #eee);
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}
.rv-list-star-summary {
  flex: 1 1 auto;
  min-width: 0;
}
.rv-list-rating-chips__row {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  width: 100%;
}
.rv-list-rating-chips__stars {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 6px 8px;
  width: 100%;
}
.rv-list-rating-chips__all {
  width: 100%;
  box-sizing: border-box;
}
.rv-list-rating-chips__all .rv-list-rating-chip--all {
  display: flex;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
}
@media (max-width: 639px) {
  .rv-list-rating-chips__stars {
    flex-wrap: nowrap;
    justify-content: space-between;
    align-items: stretch;
    gap: 4px;
    width: 100%;
    box-sizing: border-box;
  }
  .rv-list-rating-chips__stars .rv-list-rating-chip {
    flex: 1 1 0;
    min-width: 0;
    padding: 5px 2px;
    font-size: 0.72rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
  }
}
@media (min-width: 640px) {
  .rv-list-rating-chips__row {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 10px 12px;
  }
  .rv-list-rating-chips__stars {
    flex: 0 1 auto;
    min-width: 0;
    justify-content: center;
    width: auto;
  }
  .rv-list-rating-chips__all {
    flex: 0 0 auto;
    width: auto;
  }
  .rv-list-rating-chips__all .rv-list-rating-chip--all {
    display: inline-flex;
    width: auto;
    max-width: none;
  }
}
.rv-list-rating-chip {
  font: inherit;
  font-size: 0.78rem;
  font-variant-numeric: tabular-nums;
  padding: 4px 9px;
  margin: 0;
  border-radius: var(--radius-sm, 6px);
  border: 1px solid var(--border, #ddd);
  background: var(--bg-secondary, #fafafa);
  color: var(--text, #1a1a1a);
  cursor: pointer;
  line-height: 1.3;
  white-space: nowrap;
}
.rv-list-rating-chip:hover {
  border-color: rgba(0, 91, 255, 0.35);
  background: var(--primary-light, rgba(0, 91, 255, 0.08));
}
.rv-list-rating-chip.is-active {
  border-color: var(--primary, #005BFF);
  background: var(--primary-light, rgba(0, 91, 255, 0.12));
  color: var(--primary, #005BFF);
}
@media (min-width: 900px) {
  .rv-list-rating-chip {
    font-size: 0.92rem;
    padding: 7px 14px;
  }
  .rv-list-rating-chips__row {
    gap: 12px 16px;
  }
}
.rv-list-sort {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}
.rv-list-sort__select {
  font: inherit;
  font-size: 0.82rem;
  padding: 6px 10px;
  border-radius: var(--radius-sm, 6px);
  border: 1px solid var(--border, #ddd);
  background: var(--card, #fff);
  color: var(--text, #1a1a1a);
  max-width: min(280px, 100%);
  box-sizing: border-box;
}
[data-theme='dark'] .rv-list-toolbar {
  border-top-color: var(--border, #404040);
}
[data-theme='dark'] .rv-list-rating-chip {
  background: var(--bg-secondary, #1e1e1e);
  color: var(--text, #f5f5f5);
  border-color: var(--border, #404040);
}
[data-theme='dark'] .rv-list-rating-chip:hover {
  border-color: rgba(100, 160, 255, 0.45);
  background: rgba(100, 160, 255, 0.1);
}
[data-theme='dark'] .rv-list-rating-chip.is-active {
  border-color: var(--primary, #4d9aff);
  background: rgba(77, 154, 255, 0.15);
  color: #93c5fd;
}
[data-theme='dark'] .rv-list-sort__select {
  background: var(--bg-secondary, #1e1e1e);
  color: var(--text, #f5f5f5);
  border-color: var(--border, #404040);
}
[data-theme='dark'] .rv-card {
  background: var(--card, #252525);
  border-color: var(--border, #404040);
}
[data-theme='dark'] .rv-card__engage {
  border-top-color: var(--border, #404040);
}
[data-theme='dark'] .rv-react {
  background: var(--bg-secondary, #1e1e1e);
  border-color: var(--border, #404040);
  color: var(--text-secondary, #ccc);
}
[data-theme='dark'] .rv-react.is-on {
  background: var(--bg-secondary, #1e1e1e);
  border-color: var(--border, #404040);
  color: var(--text-secondary, #ccc);
}
[data-theme='dark'] .rv-react[data-kind='like'].is-on i,
[data-theme='dark'] .rv-react[data-kind='like'].is-on i::before {
  color: #fbbf24;
}
[data-theme='dark'] .rv-react[data-kind='heart'].is-on i,
[data-theme='dark'] .rv-react[data-kind='heart'].is-on i::before {
  color: #f87171;
}
[data-theme='dark'] .rv-react[data-kind='clap'].is-on i,
[data-theme='dark'] .rv-react[data-kind='clap'].is-on i::before {
  color: #fbbf24;
}
[data-theme='dark'] .rv-card__icon-btn,
[data-theme='dark'] .rv-card__comment-badge {
  background: var(--bg-secondary, #1e1e1e);
  border-color: var(--border, #404040);
  color: var(--text-muted, #aaa);
}
[data-theme='dark'] .rv-card__comment-field {
  background: var(--bg-secondary, #1e1e1e);
  border-color: var(--border, #404040);
  color: var(--text, #f5f5f5);
}
[data-theme='dark'] .rv-card__comment-field::placeholder {
  color: var(--text-muted, #888);
}
[data-theme='dark'] .rv-card__comment-send {
  background: var(--primary);
  color: #fff;
}
[data-theme='dark'] .rv-card__comment-send:hover {
  background: var(--primary-hover);
}

.rv-dlg__sheet--list .rv-dlg__title {
  margin: 0;
}
.rv-dlg__sheet--list .rv-list-header__title {
  margin-right: 0;
}
.rv-dlg__list-body {
  flex: 1 1 0;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding: 12px 16px 16px;
  box-sizing: border-box;
}
@media (max-width: 899px) {
  .rv-dlg__list-body {
    /* Запас снизу: safe-area + чуть выше нижнего UI Safari при прокрутке */
    padding: 10px 12px calc(18px + env(safe-area-inset-bottom, 0px));
  }
  .rv-list {
    align-items: stretch;
    width: 100%;
  }
  .rv-list > .rv-card {
    width: 100%;
    max-width: 100%;
    margin-left: 0;
    margin-right: 0;
  }
}

.rv-dlg::backdrop {
  background: rgba(0, 0, 0, 0.45);
}
.rv-dlg__panel {
  padding: 18px 20px 20px;
  min-width: min(420px, 92vw);
  max-width: 520px;
  max-height: 85vh;
  overflow: auto;
  position: relative;
  background: var(--card, #fff);
}
.rv-dlg__panel--form {
  max-width: 440px;
  max-height: min(88vh, 640px);
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.rv-dlg__title {
  margin: 0 0 14px;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text, #1a1a1a);
}
.rv-list-header {
  margin-bottom: 0;
}
.rv-list-header__title {
  margin: 0 36px 0 0;
  font-size: 1.02rem;
  font-weight: 700;
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text, #1a1a1a);
  min-height: 1.35em;
}
.rv-dlg__x {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 36px;
  height: 36px;
  border: none;
  background: transparent;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  color: var(--text-muted, #999);
  border-radius: var(--radius-sm, 4px);
}
.rv-dlg__x:hover {
  background: var(--bg, #F5F5F5);
  color: var(--text, #1A1A1A);
}
.rv-dlg__x:focus,
.rv-dlg__x:focus-visible,
.rv-fs__close:focus,
.rv-fs__close:focus-visible {
  outline: none;
  box-shadow: none;
}

.rv-report-reasons {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.rv-report-check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.92rem;
  cursor: pointer;
  line-height: 1.35;
}
.rv-report-check input {
  margin-top: 3px;
  flex-shrink: 0;
}
#rv-report-dlg .rv-report-reasons {
  margin-bottom: 8px;
  align-items: stretch;
}
#rv-report-dlg .rv-report-check {
  display: flex;
  align-items: center;
  gap: 10px;
  line-height: 1.35;
}
#rv-report-dlg .rv-report-check__txt {
  flex: 1 1 auto;
  min-width: 0;
  line-height: 1.35;
  white-space: nowrap;
}
#rv-report-dlg .rv-report-check input[type='radio'] {
  margin: 0;
  flex-shrink: 0;
  width: 1.125rem;
  height: 1.125rem;
  align-self: center;
  vertical-align: middle;
  accent-color: var(--primary, #005bff);
}
@media (min-width: 768px) {
  #rv-report-dlg .rv-report-reasons {
    flex-direction: row;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px 14px;
  }
  #rv-report-dlg .rv-report-check {
    flex: 1 1 auto;
    min-width: max-content;
  }
}

.rv-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: flex-start;
}
.rv-list > .rv-list-loading-msg,
.rv-list > .rv-list-empty,
.rv-list > .rv-list-error {
  align-self: stretch;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}
@media (min-width: 900px) {
  .rv-list {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    align-items: start;
    max-width: none;
    margin: 0;
    width: 100%;
  }
  .rv-list > .rv-card {
    display: flex;
    width: 100%;
    max-width: 100%;
    margin: 0;
    min-width: 0;
  }
  .rv-list > .rv-list-loading-msg,
  .rv-list > .rv-list-empty,
  .rv-list > .rv-list-error {
    grid-column: 1 / -1;
  }
}
/* Не задаём min-height при загрузке — иначе окно сначала растягивается, потом схлопывается */
.rv-list.rv-list--loading {
  box-sizing: border-box;
}
.rv-list-loading-msg {
  margin: 0;
  font-size: 0.88rem;
  color: var(--text-muted, #888);
  text-align: center;
}
.rv-list-empty {
  margin: 0;
  color: var(--text-muted, #888);
  text-align: center;
}
.rv-list-error {
  margin: 0;
  text-align: center;
  color: #e53935;
}
[data-theme="dark"] .rv-list-error {
  color: #ef9a9a;
}
.rv-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  max-width: 320px;
  margin-left: 0;
  margin-right: auto;
  box-sizing: border-box;
  padding: 14px 16px;
  background: var(--card, #fff);
  border-radius: 12px;
  border: 1px solid var(--border-light, #eee);
  text-align: left;
}
.rv-card--highlight {
  outline: 2px solid rgba(0, 91, 255, 0.45);
  outline-offset: 2px;
  transition: outline-color 0.3s ease;
}
.rv-card__headline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.rv-card__stars-inline {
  color: #ffb300;
  letter-spacing: 1px;
  font-size: 0.95rem;
  line-height: 1;
}
.rv-card__date {
  font-size: 0.8rem;
  color: var(--text-muted, #999);
  flex-shrink: 0;
}
.rv-card__user-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.rv-card__avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 1px solid var(--border-light, #e8e8e8);
  background: var(--bg-secondary, #f5f5f5);
}
.rv-card__avatar--placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-secondary, #666);
}
.rv-card__user-name {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text, #1a1a1a);
  line-height: 1.25;
}
.rv-card__variant {
  font-size: 0.82rem;
  line-height: 1.45;
  color: var(--text-secondary, #666);
}
.rv-card__variant-label {
  color: var(--text-muted, #888);
  margin-right: 4px;
}
.rv-card__variant-link {
  color: var(--primary, #005bff);
  text-decoration: none;
  word-break: break-word;
}
.rv-card__variant-link:hover {
  text-decoration: underline;
}
.rv-card__variant-text {
  color: var(--text, #333);
}
.rv-card__comments-heading {
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--text, #1a1a1a);
  margin-top: 2px;
}
.rv-card__photos {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.rv-card__photos--grid img {
  width: 96px;
  height: 96px;
}
.rv-card__photos img,
.rv-card__photos--grid img {
  object-fit: cover;
  border-radius: 10px;
  cursor: pointer;
  border: 1px solid var(--border, #e0e0e0);
}
.rv-card__text {
  color: var(--text, #333);
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.5;
  font-size: 0.88rem;
  max-height: none;
  overflow: visible;
}
.rv-card__text--empty {
  color: var(--text-muted, #aaa);
  font-style: italic;
}
.rv-card__staff-reply {
  margin-top: 12px;
  padding: 12px 14px;
  background: var(--primary-light, rgba(0, 91, 255, 0.06));
  border-left: 3px solid var(--primary, #005bff);
  border-radius: 0 8px 8px 0;
}
.rv-card__staff-reply-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--primary, #005bff);
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.rv-card__staff-reply-text {
  font-size: 0.86rem;
  color: var(--text, #333);
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
}
[data-theme='dark'] .rv-card__staff-reply {
  background: rgba(77, 154, 255, 0.12);
  border-left-color: var(--primary, #4d9aff);
}
[data-theme='dark'] .rv-card__staff-reply-label {
  color: var(--primary, #4d9aff);
}
[data-theme='dark'] .rv-card__staff-reply-text {
  color: var(--text, #f5f5f5);
}
.rv-card__engage {
  margin-top: 4px;
  padding-top: 10px;
  border-top: 1px solid var(--border-light, #eee);
}
.rv-card__engage-label {
  font-size: 0.78rem;
  color: var(--text-muted, #999);
  margin-bottom: 8px;
}
.rv-card__engage-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}
.rv-card__reactions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.rv-react {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 20px;
  border: 1px solid var(--border, #ddd);
  background: var(--bg-secondary, #f7f7f7);
  font-size: 0.8rem;
  color: var(--text-secondary, #555);
  cursor: pointer;
  font-family: inherit;
  line-height: 1;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.rv-react:hover {
  border-color: rgba(0, 91, 255, 0.35);
  background: var(--primary-light, rgba(0, 91, 255, 0.06));
}
/* Только иконки (FA рисует в ::before — на Windows задаём явно) */
.rv-react.is-on {
  border-color: var(--border, #ddd);
  background: var(--bg-secondary, #f7f7f7);
  color: var(--text-secondary, #555);
}
.rv-react[data-kind='like'].is-on i,
.rv-react[data-kind='like'].is-on i::before {
  color: #f59e0b;
}
.rv-react[data-kind='heart'].is-on i,
.rv-react[data-kind='heart'].is-on i::before {
  color: #ef4444;
}
.rv-react[data-kind='clap'].is-on i,
.rv-react[data-kind='clap'].is-on i::before {
  color: #f59e0b;
}
@media (forced-colors: active) {
  .rv-react.is-on i,
  .rv-react.is-on i::before {
    forced-color-adjust: none;
  }
}
.rv-react__cnt {
  font-variant-numeric: tabular-nums;
  min-width: 1ch;
}
.rv-card__engage-tools {
  display: flex;
  gap: 6px;
  align-items: center;
  margin-left: auto;
  flex-shrink: 0;
}
.rv-card__engage-tools .rv-card__comment-badge {
  min-height: 34px;
  height: 34px;
  padding: 0 8px;
  font-size: 0.72rem;
}
/* Очень узкий экран: одна строка — уменьшенные реакции и кнопки справа */
@media (max-width: 350px) {
  #rv-list-dlg .rv-card__engage-row {
    flex-wrap: nowrap;
    align-items: center;
    gap: 5px;
    min-width: 0;
  }
  #rv-list-dlg .rv-card__reactions {
    flex-wrap: nowrap;
    gap: 3px;
    flex: 1 1 auto;
    min-width: 0;
    align-items: center;
  }
  #rv-list-dlg .rv-card__engage-tools {
    gap: 3px;
    flex-shrink: 0;
    margin-left: auto;
  }
  #rv-list-dlg .rv-card__engage-tools .rv-card__comment-badge {
    min-height: 28px;
    height: 28px;
    padding: 0 4px;
    font-size: 0.62rem;
  }
  #rv-list-dlg .rv-card__icon-btn {
    width: 28px;
    height: 28px;
    font-size: 0.72rem;
    border-radius: 8px;
  }
  #rv-list-dlg .rv-react {
    padding: 2px 5px;
    gap: 2px;
    font-size: clamp(0.58rem, 3.2vw, 0.7rem);
    border-radius: 12px;
  }
  #rv-list-dlg .rv-react i {
    font-size: 0.88em;
  }
}
.rv-card__icon-btn {
  width: 34px;
  height: 34px;
  padding: 0;
  border-radius: 10px;
  border: 1px solid var(--border, #ddd);
  background: var(--bg-secondary, #f7f7f7);
  color: var(--text-muted, #888);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
}
.rv-card__icon-btn:hover {
  color: var(--text, #333);
  border-color: #ccc;
}
.rv-card__comments-list {
  margin: 8px 0;
  padding: 10px 12px;
  background: var(--bg-secondary, #f7f7f7);
  border-radius: 8px;
  font-size: 0.85rem;
}
.rv-card__comments-loading,
.rv-card__comments-empty {
  color: var(--text-muted, #999);
  font-size: 0.82rem;
}
.rv-card__comment-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 6px 0;
  border-bottom: 1px solid var(--border-light, #eee);
}
.rv-card__comments-items .rv-card__comment-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}
.rv-card__comments-items .rv-card__comment-item:first-child {
  padding-top: 0;
}
.rv-card__comment-author {
  font-weight: 600;
  font-size: 0.8rem;
  color: var(--text, #333);
}
.rv-card__comment-text {
  color: var(--text-secondary, #555);
  line-height: 1.4;
}
.rv-card__comment-item--staff {
  background: var(--primary-light, rgba(0, 91, 255, 0.06));
  border-left: 2px solid var(--primary, #005bff);
  padding-left: 10px;
  margin-left: -10px;
  border-radius: 0 4px 4px 0;
}
.rv-card__comment-item--reply {
  margin-left: 16px;
  padding-left: 10px;
  border-left: 2px solid var(--border, #ddd);
}
.rv-card__comment-item--staff.rv-card__comment-item--reply {
  border-left-color: var(--primary, #005bff);
}
.rv-card__comment-author--staff {
  color: var(--primary, #005bff);
}
.rv-card__comment-reply-badge {
  font-size: 0.7rem;
  color: var(--text-muted, #999);
  font-weight: 400;
  margin-left: 6px;
}
[data-theme='dark'] .rv-card__comment-item--staff {
  background: rgba(77, 154, 255, 0.12);
  border-left-color: var(--primary, #4d9aff);
}
[data-theme='dark'] .rv-card__comment-item--reply {
  border-left-color: var(--border, #404040);
}
[data-theme='dark'] .rv-card__comment-item--staff.rv-card__comment-item--reply {
  border-left-color: var(--primary, #4d9aff);
}
[data-theme='dark'] .rv-card__comment-author--staff {
  color: var(--primary, #4d9aff);
}
[data-theme='dark'] .rv-card__comments-list {
  background: var(--bg, #121212);
}
[data-theme='dark'] .rv-card__comment-item {
  border-bottom-color: var(--border, #404040);
}
[data-theme='dark'] .rv-card__comment-author {
  color: var(--text, #f5f5f5);
}
[data-theme='dark'] .rv-card__comment-text {
  color: var(--text-secondary, #ccc);
}
.rv-card__comments-items {
  min-width: 0;
}
.rv-card__comments-collapse-wrap {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border-light, #eee);
}
.rv-card__comments-collapse {
  padding: 2px 6px;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--primary, #005bff);
  background: transparent;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: color var(--transition, 0.2s ease), background var(--transition, 0.2s ease);
}
.rv-card__comments-collapse:hover {
  color: var(--primary-hover, #0050e0);
  background: transparent;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.rv-card__comments-collapse:focus-visible {
  outline: 2px solid var(--primary, #005bff);
  outline-offset: 2px;
}
[data-theme='dark'] .rv-card__comments-collapse-wrap {
  border-top-color: var(--border, #404040);
}
[data-theme='dark'] .rv-card__comments-collapse {
  color: var(--primary);
}
[data-theme='dark'] .rv-card__comments-collapse:hover {
  color: var(--primary-hover);
  background: transparent;
}
.rv-card__comment-bar {
  margin-top: 6px;
  width: 100%;
}
.rv-card__comments-slot {
  min-height: 0;
}
.rv-card__comment-composer {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  box-sizing: border-box;
}
.rv-card__comment-field {
  flex: 1 1 auto;
  min-width: 0;
  box-sizing: border-box;
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid var(--border, #ddd);
  background: var(--bg-secondary, #f7f7f7);
  font-family: inherit;
  font-size: 0.82rem;
  color: var(--text, #1a1a1a);
}
.rv-card__comment-field::placeholder {
  color: var(--text-muted, #999);
}
.rv-card__comment-side {
  flex: 0 0 auto;
  width: 40px;
  height: 36px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}
.rv-card__comment-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 36px;
  padding: 0 10px;
  border-radius: 10px;
  border: 1px solid var(--border, #ddd);
  background: var(--bg-secondary, #f7f7f7);
  font-size: 0.75rem;
  color: var(--text-muted, #777);
  box-sizing: border-box;
  cursor: pointer;
  font: inherit;
  line-height: 1.2;
}
.rv-card__comment-badge[hidden] {
  display: none !important;
}
.rv-card__comment-count {
  font-variant-numeric: tabular-nums;
}
.rv-card__comment-send {
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 2px solid transparent;
  border-radius: 50%;
  background: var(--primary, #005bff);
  color: #fff;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  box-sizing: border-box;
  transition: background var(--transition, 0.2s ease), box-shadow var(--transition, 0.2s ease);
}
.rv-card__comment-send:hover {
  background: var(--primary-hover, #0050e0);
}
.rv-card__comment-send:focus-visible {
  outline: 2px solid var(--primary, #005bff);
  outline-offset: 2px;
}
.rv-card__comment-send[hidden] {
  display: none !important;
}

.rv-field {
  margin-bottom: 12px;
}
.rv-field label,
.rv-field-label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary, #666);
  margin-bottom: 6px;
}
.rv-order-chips {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 220px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 2px 0;
}
.rv-order-chip {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  box-sizing: border-box;
  text-align: left;
  padding: 10px 12px;
  border: 1px solid var(--border, #E0E0E0);
  border-radius: var(--radius-md, 8px);
  background: var(--bg-secondary, #FAFAFA);
  font-size: 0.82rem;
  color: var(--text, #1A1A1A);
  cursor: pointer;
  font-family: inherit;
  line-height: 1.35;
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}
.rv-order-chip:hover {
  border-color: rgba(0,91,255,.3);
  background: var(--primary-light, rgba(0,91,255,.1));
}
.rv-order-chip.is-active {
  border-color: var(--primary, #005BFF);
  background: var(--primary-light, rgba(0,91,255,.1));
  box-shadow: 0 0 0 1px rgba(0, 91, 255, 0.12);
}
.rv-order-chip--done {
  opacity: 0.95;
}
.rv-order-chip__txt {
  flex: 1;
  min-width: 0;
  word-break: break-word;
}
.rv-order-chip__badge {
  flex-shrink: 0;
  font-size: 0.65rem;
  font-weight: 600;
  color: #2e7d32;
  background: var(--success-bg, rgba(76,175,80,.1));
  padding: 2px 8px;
  border-radius: var(--radius-sm, 4px);
  white-space: nowrap;
  margin-top: 1px;
}
.rv-field input[type='text'],
.rv-field select,
.rv-field textarea {
  width: 100%;
  box-sizing: border-box;
  padding: 8px 10px;
  border: 1px solid var(--border, #E0E0E0);
  border-radius: var(--radius-sm, 4px);
  font-size: 0.88rem;
  font-family: inherit;
}
.rv-field--2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.rv-stars {
  display: flex;
  gap: 4px;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.rv-field-hint {
  font-size: 0.72rem;
  color: var(--text-muted, #999);
  margin: 0 0 6px;
  line-height: 1.35;
}
.rv-star {
  border: none;
  background: none;
  font-size: 1.6rem;
  color: var(--border, #E0E0E0);
  cursor: pointer;
  padding: 0 2px;
  line-height: 1;
}
.rv-star.is-on {
  color: #ffb300;
}
.rv-check label {
  font-weight: 500;
  font-size: 0.85rem;
  color: var(--text, #1A1A1A);
}
.rv-msg {
  min-height: 1.2em;
  font-size: 0.82rem;
  margin: 8px 0;
}
.rv-msg.err {
  color: var(--danger, #F44336);
}
.rv-msg.ok {
  color: #2e7d32;
}
.rv-form-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 8px;
}
.rv-form-actions__main {
  display: flex;
  gap: 8px;
  margin-left: auto;
}
.rv-btn-del {
  color: var(--danger, #F44336) !important;
  border-color: rgba(244,67,54,.25) !important;
}
.rv-name-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}
.rv-name-row__label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary, #666);
  margin: 0;
}
.rv-name-row__anon {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-secondary, #666);
  cursor: pointer;
  margin: 0;
}
.rv-name-row__anon input {
  margin: 0;
  flex-shrink: 0;
}
.rv-name-row__hint {
  color: var(--text-muted, #999);
  font-weight: 400;
}
.rv-ph-thumb-wrap {
  position: relative;
  flex-shrink: 0;
}
.rv-ph-remove {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 22px;
  height: 22px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.65);
  color: #fff;
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
}
.rv-ph-remove:hover {
  background: var(--danger, #F44336);
}
.rv-ph-thumb-wrap img {
  cursor: pointer;
  vertical-align: middle;
}
.rv-ph-label {
  font-size: 0.78rem;
  color: var(--text-secondary, #666);
  display: block;
  margin-bottom: 6px;
}
.rv-ph-thumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.rv-ph-thumbs .rv-ph-thumb-wrap img {
  width: 48px;
  height: 48px;
  object-fit: cover;
  border-radius: var(--radius-sm, 4px);
  border: 1px solid var(--border, #E0E0E0);
  display: block;
}
.rv-ph-warn {
  color: var(--danger, #F44336);
  font-size: 0.82rem;
}
.rv-photo-preview {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  margin-top: 6px;
  font-size: 0.78rem;
  color: var(--text-muted, #999);
  width: 100%;
}

/* Просмотр фото — второй modal dialog, поверх списка/формы отзыва */
#rv-photo-fs.rv-photo-fs {
  position: fixed;
  inset: 0;
  max-width: 100vw;
  max-height: 100vh;
  width: 100vw;
  height: 100vh;
  margin: 0;
  padding: 0;
  border: none;
  background: rgba(0, 0, 0, 0.92);
  box-sizing: border-box;
}
#rv-photo-fs.rv-photo-fs::backdrop {
  background: rgba(0, 0, 0, 0.35);
}
#rv-photo-fs.rv-photo-fs[open] {
  display: flex;
  align-items: center;
  justify-content: center;
}
.rv-fs__img {
  display: block;
  max-width: 100vw;
  max-height: 100vh;
  width: auto;
  height: auto;
  margin: auto;
  object-fit: contain;
  position: relative;
  z-index: 1;
}
.rv-fs__close {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 2147483001;
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  font-size: 1.5rem;
  cursor: pointer;
}
.rv-fs__nav {
  position: fixed;
  top: 0;
  bottom: 0;
  width: 28vw;
  max-width: 200px;
  border: none;
  background: transparent;
  cursor: pointer;
  z-index: 2147483001;
}
.rv-fs__nav--l {
  left: 0;
}
.rv-fs__nav--r {
  right: 0;
}

.od-review-bar {
  padding: 10px 16px;
  background: linear-gradient(180deg, var(--bg-secondary, #FAFAFA) 0%, var(--card, #fff) 100%);
  border-bottom: 1px solid var(--border-light, #EEE);
  text-align: center;
}
.od-review-bar__link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 1rem;
  font-weight: 700;
  color: var(--primary, #005BFF);
  text-decoration: none;
  cursor: pointer;
  border: none;
  background: none;
  font-family: inherit;
  padding: 4px 8px;
}
.od-review-bar__link:hover {
  text-decoration: underline;
}
.orders-table .order-review-cell {
  width: 44px;
  text-align: center;
  vertical-align: middle;
}
@media (max-width: 768px) {
  .orders-table .order-review-cell {
    width: 100% !important;
    max-width: none;
    box-sizing: border-box;
  }
}
.order-review-ic {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
}
.order-review-ic--none {
  color: var(--text-muted, #999);
}
.order-review-ic--none .fa-star {
  color: var(--text-muted, #999);
}
.order-review-ic--full {
  color: #ffb300;
}
.order-review-ic--full .fa-star {
  color: #ffb300;
}
.order-review-star-split {
  position: relative;
  display: inline-block;
  line-height: 1;
  width: 1em;
  height: 1em;
}
.order-review-star-split__bg {
  color: var(--text-muted, #999);
}
.order-review-star-split__fg {
  position: absolute;
  left: 0;
  top: 0;
  color: #ffb300;
  clip-path: inset(50% 0 0 0);
}

/* Тост «нет отзывов» (список пуст; модалка не открывается) */
.rv-toast.rv-toast--empty {
  position: fixed;
  left: 50%;
  top: 50%;
  z-index: 100001;
  max-width: min(360px, calc(100vw - 32px));
  padding: 16px 20px;
  background: var(--card, #fff);
  color: var(--text, #1a1a1a);
  border-radius: var(--radius-lg, 12px);
  box-shadow: var(--shadow-lg, 0 8px 24px rgba(0, 0, 0, 0.18));
  border: 1px solid var(--border-light, #eee);
  font-size: 0.95rem;
  line-height: 1.45;
  text-align: center;
  white-space: pre-line;
  opacity: 0;
  -webkit-transform: translate(-50%, -50%) scale(0.96);
  transform: translate(-50%, -50%) scale(0.96);
  pointer-events: none;
  -webkit-transition: opacity 0.25s ease, -webkit-transform 0.25s ease;
  transition: opacity 0.25s ease, transform 0.25s ease;
}
.rv-toast.rv-toast--empty.rv-toast--visible,
.rv-toast.rv-toast--empty:popover-open {
  opacity: 1;
  -webkit-transform: translate(-50%, -50%) scale(1);
  transform: translate(-50%, -50%) scale(1);
}
@media (max-width: 768px) {
  .rv-toast.rv-toast--empty {
    width: 70vw;
    max-width: 70vw;
    box-sizing: border-box;
  }
}
/* Тост внутри модалки товара (поверх контента скролла) */
dialog.pd-dlg .rv-toast.rv-toast--empty {
  z-index: 100001;
}
