/* Изолированный блок формы оценки — не зависит от родительской разметки, кроме ширины */

.rate-form-block {
  box-sizing: border-box;
  position: fixed;
  inset: 0;
  z-index: 3001;
  display: flex;
  align-items: center;
  justify-content: center;
  width: auto;
  max-width: none;
  margin: 0;
  padding: 16px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 14px;
  line-height: 1.4;
  color: #1a1a1a;
  text-align: left;
  background: transparent;
}



.rate-form-block__overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
}

.rate-form-block__dialog {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 520px;
  max-height: calc(100vh - 32px);
  overflow: auto;
}

.rate-form-block *,
.rate-form-block *::before,
.rate-form-block *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

.rate-form-block__card {
  position: relative;
  width: 100%;
  padding: 32px;
  border-radius: 24px;
  background: #fff;
}

.rate-form-block__close {
  position: absolute;
  top: 16px;
  right: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 50%;
  background: #f2f2f2;
  color: #1a1a1a;
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.rate-form-block__close:hover {
  background: #e8e8e8;
}

.rate-form-block__close:focus-visible {
  outline: 2px solid #f5a623;
  outline-offset: 2px;
}

.rate-form-block__close-icon {
  display: block;
  width: 16px;
  height: 16px;
}

/* Товар */
.rate-form-block__product {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 24px;
  padding-right: 40px;
}

.rate-form-block__product-image-wrap {
  flex-shrink: 0;
  width: 56px;
  height: 56px;
  border-radius: 12px;
  overflow: hidden;
  background: #f5f5f5;
}

.rate-form-block__product-image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.rate-form-block__product-title {
  font-size: 16px;
  font-weight: 600;
  line-height: 1.3;
  color: #1a1a1a;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Звёзды */
.rate-form-block__stars {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 28px;
}

.rate-form-block__star {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: none;
  background: transparent;
  color: #d8d8d8;
  cursor: pointer;
  transition: color 0.15s ease, transform 0.1s ease;
}

.rate-form-block__star:hover,
.rate-form-block__star--hover {
  color: #f5a623;
  transform: scale(1.05);
}

.rate-form-block__star--active {
  color: #f5a623;
}

.rate-form-block__star:focus-visible {
  outline: 2px solid #f5a623;
  outline-offset: 2px;
  border-radius: 4px;
}

.rate-form-block__star-icon {
  display: block;
  width: 40px;
  height: 40px;
}

/* Секции */
.rate-form-block__section {
  margin-bottom: 24px;
}

.rate-form-block__section-title {
  margin-bottom: 12px;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.3;
  color: #1a1a1a;
}

/* Загрузка файлов */
.rate-form-block__upload-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.rate-form-block__upload-zone {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 120px;
  min-height: 96px;
  padding: 12px;
  border-radius: 16px;
  background: #f0f4ff;
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.rate-form-block__upload-zone:hover {
  background: #e4ebff;
}

.rate-form-block__upload-zone:focus-within {
  outline: 2px solid #f5a623;
  outline-offset: 2px;
}

.rate-form-block__upload-icon {
  display: block;
  width: 32px;
  height: 32px;
  color: #1a6dcc;
}

.rate-form-block__upload-hint {
  font-size: 12px;
  line-height: 1.3;
  color: #888;
  text-align: center;
}

.rate-form-block__file-input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.rate-form-block__previews {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.rate-form-block__preview {
  position: relative;
  width: 72px;
  height: 96px;
  border-radius: 12px;
  overflow: hidden;
  background: #f5f5f5;
}

.rate-form-block__preview-image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.rate-form-block__preview-remove {
  position: absolute;
  top: 4px;
  right: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border: none;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
}

/* Текст отзыва */
.rate-form-block__field-label {
  display: block;
  margin-bottom: 8px;
  font-size: 14px;
  font-weight: 500;
  color: #1a1a1a;
}

.rate-form-block__textarea {
  display: block;
  width: 100%;
  min-height: 48px;
  padding: 12px 14px;
  border: 1px solid #d8d8d8;
  border-radius: 12px;
  background: #fff;
  font: inherit;
  font-size: 14px;
  line-height: 1.4;
  color: #1a1a1a;
  resize: vertical;
  transition: border-color 0.15s ease;
}

.rate-form-block__textarea::placeholder {
  color: #aaa;
}

.rate-form-block__textarea:focus {
  outline: none;
  border-color: #1a6dcc;
}

/* Чекбокс и ссылка */
.rate-form-block__footer-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 24px;
}

.rate-form-block__checkbox-label {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  color: #1a1a1a;
}

.rate-form-block__checkbox {
    /* Перебиваем глобальные стили */
    position: relative !important;
    display: inline-block !important;
    width: 18px;
    height: 18px;
    accent-color: #1a6dcc;
    cursor: pointer;
}

.rate-form-block__rules-btn {
  padding: 0;
  border: none;
  background: transparent;
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  color: #1a6dcc;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.rate-form-block__rules-btn:hover {
  color: #0f4d94;
}

.rate-form-block__rules-btn:focus-visible {
  outline: 2px solid #f5a623;
  outline-offset: 2px;
  border-radius: 2px;
}

/* Кнопка отправки */
.rate-form-block__submit {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 14px 20px;
  border: none;
  border-radius: 12px;
  background: #1a6dcc;
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.2;
  color: #fff;
  cursor: pointer;
  transition: background-color 0.15s ease, opacity 0.15s ease;
}

.rate-form-block__submit:hover:not(:disabled) {
  background: #1558a8;
}

.rate-form-block__submit:focus-visible {
  outline: 2px solid #f5a623;
  outline-offset: 2px;
}

.rate-form-block__submit:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
