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

.pd-rating-row {
  display: flex;
  justify-content: center;
  margin: 0;
}
.pd-price-row .pd-rating-row {
  align-self: center;
}
.pd-rating-row[hidden] {
  display: none !important;
}
.pd-rating-row__btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border: 1px solid var(--border, #E0E0E0);
  border-radius: 20px;
  background: var(--bg-secondary, #FAFAFA);
  font-size: 0.82rem;
  color: var(--text, #1A1A1A);
  cursor: pointer;
  font-family: inherit;
}
.pd-rating-row__btn:hover {
  background: var(--primary-light, rgba(0,91,255,.1));
  border-color: rgba(0,91,255,.3);
}
.pd-rating-row__btn--empty {
  opacity: 0.65;
}
.pd-rating-row__btn--empty:hover {
  opacity: 1;
}
.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;
}

/* Окно списка отзывов: полноэкранный 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: 10vw;
  top: 10vh;
  width: 80vw;
  height: 80vh;
  max-width: 96vw;
  max-height: 92vh;
  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;
}
.rv-dlg__sheet--list .rv-dlg__x {
  z-index: 4;
}
.rv-dlg__list-head {
  flex-shrink: 0;
  position: relative;
  z-index: 2;
  padding: 14px 44px 12px 20px;
  border-bottom: 1px solid var(--border-light, #eee);
  background: var(--card, #fff);
}
.rv-dlg__list-head .rv-list-header {
  margin-bottom: 0;
}
.rv-dlg__sheet--list .rv-dlg__title {
  margin: 0 36px 0 0;
}
.rv-dlg__list-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  padding: 12px 16px 16px;
  box-sizing: border-box;
}

.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: 12px;
}
.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-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
/* Не задаём 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);
}
.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: 8px;
  width: 100%;
  box-sizing: border-box;
  padding: 12px;
  background: var(--bg-secondary, #FAFAFA);
  border-radius: var(--radius-md, 8px);
  border: 1px solid var(--border-light, #EEE);
  text-align: left;
}
.rv-card__row {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}
.rv-card__photos {
  flex: 0 0 72px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.rv-card__photos img,
.rv-card__photos-below img {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: var(--radius-md, 8px);
  cursor: pointer;
  border: 1px solid var(--border, #E0E0E0);
}
.rv-card__photos-below {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  width: 100%;
}
.rv-card__body {
  flex: 1;
  min-width: 0;
  font-size: 0.85rem;
  line-height: 1.45;
}
.rv-card__product {
  font-weight: 600;
  color: var(--text, #1A1A1A);
  margin-bottom: 4px;
}
.rv-card__meta {
  font-size: 0.75rem;
  color: var(--text-muted, #999);
  margin-bottom: 6px;
}
.rv-card__stars {
  color: #ffb300;
  letter-spacing: 1px;
  margin-bottom: 4px;
}
.rv-card__text {
  color: var(--text-secondary, #666);
  white-space: pre-wrap;
  word-break: break-word;
}

.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;
}
.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;
  transform: translate(-50%, -50%) scale(0.96);
  pointer-events: none;
  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;
  transform: translate(-50%, -50%) scale(1);
}
/* Fallback: тост внутри модалки товара (без Popover API) */
dialog.pd-dlg .rv-toast.rv-toast--empty {
  z-index: 50;
}
