/**
 * Modal «Escribe tu opinión» — productcomments (ficha).
 */

.sm-review-modal .modal-dialog,
.sm-review-success .modal-dialog {
  max-width: 32.5rem;
  margin: var(--space-4) auto;
}

.sm-review-modal__content,
.sm-review-success__content {
  border: 0;
  border-radius: var(--radius-md);
  box-shadow: var(--sm-shadow-lg);
  overflow: hidden;
}

.sm-review-modal__grabber {
  display: none;
  width: 2.5rem;
  height: 0.25rem;
  margin: var(--space-3) auto 0;
  border-radius: var(--radius-pill);
  background: var(--sm-line);
}

.sm-review-modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-5);
  border-bottom: 1px solid var(--sm-line);
}

.sm-review-modal__title {
  margin: 0;
  font-size: var(--sm-fs-lg);
  font-weight: var(--sm-fw-semibold);
  color: var(--sm-ink);
  line-height: var(--lh-h2);
}

/* .sm-review-modal__close → piel global .sm-drawer__close (custom.css) */

.sm-review-modal__body {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
  padding: var(--space-5);
}

.sm-review-modal__product {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3);
  border-radius: var(--radius-md);
  background: var(--sm-panel);
}

.sm-review-modal__thumb {
  flex-shrink: 0;
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  overflow: hidden;
  background: var(--sm-white);
}

.sm-review-modal__thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.sm-review-modal__product-name {
  margin: 0;
  font-size: var(--sm-fs-md);
  font-weight: var(--sm-fw-semibold);
  color: var(--sm-ink);
  line-height: var(--lh-h2);
}

.sm-review-modal__product-meta {
  margin: var(--space-1) 0 0;
  font-size: var(--sm-fs-sm);
  color: var(--sm-muted);
  line-height: var(--lh-h2);
}

.sm-review-modal__label {
  display: block;
  margin: 0 0 var(--space-2);
  padding: 0;
  float: none;
  width: auto;
  font-size: var(--sm-fs-sm);
  font-weight: var(--sm-fw-semibold);
  color: var(--sm-ink);
}

.sm-review-modal__criterion {
  margin: 0;
}

.sm-review-modal__rating {
  margin: 0;
  min-width: 0;
  border: 0;
  padding: 0;
}

.sm-review-modal__stars-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3);
}

.sm-review-modal__stars.stars-selector {
  gap: var(--space-1);
}

.sm-review-modal__star.stars-selector__input-label {
  width: 1.75rem;
  height: 1.75rem;
  background-image: none;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23000' d='M12 2.25l2.79 6.54 7.08.62-5.35 4.66 1.64 6.93L12 17.77l-6.16 3.23 1.64-6.93L2.13 9.41l7.08-.62L12 2.25z'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23000' d='M12 2.25l2.79 6.54 7.08.62-5.35 4.66 1.64 6.93L12 17.77l-6.16 3.23 1.64-6.93L2.13 9.41l7.08-.62L12 2.25z'/%3E%3C/svg%3E") center / contain no-repeat;
  background-color: var(--sm-star);
}

.sm-review-modal__stars.stars-selector:not(:has(.stars-selector__input:checked)) .sm-review-modal__star,
.sm-review-modal__stars .stars-selector__input:checked + .sm-review-modal__star ~ .sm-review-modal__star {
  background-color: var(--sm-swatch-empty);
}

.sm-review-modal__rating-text {
  font-size: var(--sm-fs-sm);
  font-weight: var(--sm-fw-semibold);
  color: var(--sm-ink);
}

.sm-review-modal__tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.sm-review-modal__tag {
  appearance: none;
  margin: 0;
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--sm-line);
  border-radius: var(--radius-pill);
  background: var(--sm-white);
  color: var(--sm-ink);
  font-size: var(--sm-fs-sm);
  font-weight: var(--sm-fw-regular);
  line-height: var(--lh-h2);
  cursor: pointer;
  transition: background-color var(--sm-dur) var(--sm-ease), border-color var(--sm-dur) var(--sm-ease), color var(--sm-dur) var(--sm-ease);
}

.sm-review-modal__tag:hover,
.sm-review-modal__tag:focus-visible {
  border-color: var(--sm-teal-soft);
  color: var(--sm-teal-dark);
  outline: none;
}

.sm-review-modal__tag[aria-pressed="true"] {
  background: var(--sm-teal-light);
  border-color: var(--sm-teal);
  color: var(--sm-teal-dark);
  font-weight: var(--sm-fw-semibold);
}

.sm-review-modal__field .sm-form-floating {
  margin: 0;
}

.sm-review-modal__textarea.sm-form-floating__control {
  min-height: 7.5rem;
  resize: vertical;
}

.sm-review-modal__hint {
  margin: var(--space-2) 0 0;
  font-size: var(--sm-fs-xs);
  color: var(--sm-muted);
  line-height: var(--lh-body);
}

.sm-review-modal__footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-4);
  padding: var(--space-4) var(--space-5);
  border-top: 1px solid var(--sm-line);
  background: var(--sm-white);
}

.sm-review-modal__cancel {
  appearance: none;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--sm-teal-dark);
  font-size: var(--sm-fs-sm);
  font-weight: var(--sm-fw-semibold);
  cursor: pointer;
}

.sm-review-modal__cancel:hover,
.sm-review-modal__cancel:focus-visible {
  text-decoration: underline;
  outline: none;
}

.sm-review-modal__submit {
  min-width: 10.5rem;
}

/* Éxito */
.sm-review-success__body {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-7) var(--space-5) var(--space-5);
  text-align: center;
}

.sm-review-success__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3.5rem;
  height: 3.5rem;
  margin-bottom: var(--space-2);
  border-radius: 50%;
  background: var(--sm-teal-light);
  color: var(--sm-teal);
}

.sm-review-success__check {
  width: 1.75rem;
  height: 1.75rem;
  stroke-width: 2;
}

.sm-review-success__title {
  margin: 0;
  font-size: var(--sm-fs-xl);
  font-weight: var(--sm-fw-semibold);
  color: var(--sm-ink);
  line-height: var(--lh-h2);
}

.sm-review-success__message {
  margin: 0;
  max-width: 22rem;
  font-size: var(--sm-fs-md);
  color: var(--sm-muted);
  line-height: var(--lh-body);
}

.sm-review-success__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: var(--space-4) var(--space-5);
  margin-top: var(--space-4);
}

.sm-review-success__secondary {
  color: var(--sm-teal-dark);
  font-size: var(--sm-fs-sm);
  font-weight: var(--sm-fw-semibold);
  text-decoration: none;
}

.sm-review-success__secondary:hover,
.sm-review-success__secondary:focus-visible {
  text-decoration: underline;
  outline: none;
}

.sm-review-success__primary {
  min-width: 6.5rem;
}

@media (max-width: 575.98px) {
  .sm-review-modal .modal-dialog {
    align-items: flex-end;
    max-width: 100%;
    margin: 0;
    min-height: 100%;
  }

  .sm-review-modal__content {
    border-radius: var(--radius-md) var(--radius-md) 0 0;
    max-height: min(92vh, 100%);
  }

  .sm-review-modal__grabber {
    display: block;
  }

  .sm-review-modal__footer {
    flex-direction: column-reverse;
    align-items: stretch;
  }

  .sm-review-modal__submit {
    width: 100%;
  }

  .sm-review-modal__cancel {
    width: 100%;
    text-align: center;
    padding: var(--space-1) 0;
  }

  .sm-review-success__actions {
    flex-direction: column-reverse;
    width: 100%;
  }

  .sm-review-success__primary,
  .sm-review-success__secondary {
    width: 100%;
    text-align: center;
  }
}
