.product-reviews-section {
  margin: 1.15rem 0 0.35rem;
  padding: 1.25rem 1.1rem 1.1rem;
  border-radius: 20px;
  border: 1px solid rgba(232, 228, 217, 0.12);
  background: #0b1d33;
  box-shadow: 0 18px 40px -28px rgba(0, 0, 0, 0.85);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  scroll-margin-top: 5.5rem;
}

.product-reviews-section--flash {
  animation: product-reviews-flash 1.1s ease;
}

@keyframes product-reviews-flash {
  0%,
  100% {
    border-color: rgba(232, 228, 217, 0.1);
    box-shadow: none;
  }
  35% {
    border-color: rgba(255, 133, 52, 0.55);
    box-shadow: 0 0 0 1px rgba(255, 107, 0, 0.18);
  }
}

.product-reviews-section--checkout {
  margin-top: 0.9rem;
  margin-bottom: 0;
}

.product-reviews-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  margin-bottom: 0.6rem;
  padding: 0 0.1rem;
}

.product-reviews-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.2rem 0.5rem;
  min-width: 0;
}

.product-reviews-nav {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  flex-shrink: 0;
}

.product-reviews-nav-btn {
  width: 1.85rem;
  height: 1.85rem;
  border-radius: 8px;
  border: 1px solid rgba(232, 228, 217, 0.16);
  background: rgba(0, 0, 0, 0.28);
  color: #e8e4d9;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  font: inherit;
  line-height: 1;
  transition: border-color 0.15s ease, background 0.15s ease, opacity 0.15s ease;
}

.product-reviews-nav-btn svg {
  width: 0.9rem;
  height: 0.9rem;
  display: block;
}

.product-reviews-nav-btn:hover:not(:disabled) {
  border-color: rgba(255, 107, 0, 0.5);
  background: rgba(255, 107, 0, 0.12);
  color: #ff8534;
}

.product-reviews-nav-btn:disabled {
  opacity: 0.35;
  cursor: default;
}

.product-reviews-title {
  font-size: 0.98rem;
  font-weight: 700;
  color: #e8e4d9;
}

.product-reviews-title::before {
  content: '';
  display: inline-block;
  width: 0.32rem;
  height: 0.98rem;
  margin-left: 0.5rem;
  vertical-align: -0.14rem;
  border-radius: 999px;
  background: linear-gradient(180deg, #ff8534, #ff6b00);
}

.product-reviews-summary {
  font-size: 0.75rem;
  color: rgba(232, 228, 217, 0.55);
  margin: 0;
  line-height: 1.3;
}

.product-reviews-track {
  /* auto (not hidden): buttons need a real scroll container; scrollbar stays visually hidden */
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  padding-bottom: 0.05rem;
  margin: 0;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.product-reviews-track::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}

.product-reviews-list {
  display: flex;
  flex-direction: row;
  gap: 0.55rem;
  width: max-content;
  min-width: 100%;
  padding: 0.1rem 0.02rem 0.2rem;
}

.product-review-item {
  --review-delay: 0ms;
  position: relative;
  flex: 0 0 auto;
  width: min(248px, 74vw);
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  padding: 0.7rem 0.75rem 0.65rem;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.16);
  background: rgba(120, 136, 158, 0.14);
  box-shadow: none;
  scroll-snap-align: start;
  overflow: hidden;
  isolation: isolate;
  animation: product-review-in 0.45s cubic-bezier(0.22, 1, 0.36, 1) both;
  animation-delay: var(--review-delay);
  transition: border-color 0.18s ease, background 0.18s ease;
}

.product-review-item:hover {
  border-color: rgba(148, 163, 184, 0.28);
  background: rgba(120, 136, 158, 0.2);
}

.product-review-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem;
}

.product-review-stars {
  display: inline-flex;
  align-items: center;
  gap: 0.05rem;
  line-height: 1;
  padding: 0.15rem 0.35rem;
  border-radius: 999px;
  background: rgba(100, 116, 139, 0.22);
}

.product-review-star {
  display: inline-flex;
  font-size: 0.78rem;
  color: rgba(148, 163, 184, 0.35);
  transition: color 0.2s ease;
}

.product-review-star.is-on {
  color: #ffb347;
  animation: product-review-star-pop 0.4s ease both;
  animation-delay: calc(var(--review-delay) + 60ms);
}

.product-review-text {
  margin: 0;
  font-size: 0.8125rem;
  line-height: 1.55;
  color: rgba(232, 228, 217, 0.9);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.product-review-date {
  display: inline-block;
  font-size: 0.68rem;
  color: rgba(232, 228, 217, 0.48);
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}

.product-review-reply {
  margin-top: 0.15rem;
  padding: 0.45rem 0.5rem 0.4rem 0.55rem;
  border-right: 2px solid rgba(255, 133, 52, 0.75);
  border-radius: 0 8px 8px 0;
  background: rgba(255, 107, 0, 0.06);
}

.product-review-reply-label {
  margin: 0 0 0.2rem;
  font-size: 0.68rem;
  font-weight: 700;
  color: #ff8534;
  line-height: 1.2;
}

.product-review-reply-text {
  margin: 0;
  font-size: 0.75rem;
  line-height: 1.5;
  color: rgba(232, 228, 217, 0.85);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.product-review-reply-date {
  display: block;
  margin-top: 0.22rem;
  font-size: 0.62rem;
  color: rgba(232, 228, 217, 0.42);
  font-variant-numeric: tabular-nums;
}

@keyframes product-review-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes product-review-star-pop {
  0% {
    transform: scale(0.75);
    opacity: 0.4;
  }
  70% {
    transform: scale(1.08);
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  .product-review-item,
  .product-review-star.is-on {
    animation: none;
  }
}

@media (max-width: 480px) {
  .product-reviews-section {
    margin-top: 1rem;
    padding: 1rem 0.85rem 0.9rem;
    border-radius: 18px;
  }

  .product-review-item {
    width: min(220px, 78vw);
    padding: 0.6rem 0.65rem 0.55rem;
    gap: 0.32rem;
  }

  .product-review-text {
    font-size: 0.78rem;
    line-height: 1.5;
  }
}

.product-reviews-empty {
  font-size: 0.8125rem;
  color: rgba(232, 228, 217, 0.5);
  text-align: center;
  padding: 0.55rem 0.4rem 0.15rem;
}

.post-purchase-review {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(232, 228, 217, 0.12);
  text-align: right;
}

.post-purchase-review-title {
  font-size: 1rem;
  font-weight: 700;
  color: #e8e4d9;
  margin-bottom: 0.25rem;
}

.post-purchase-review-desc {
  font-size: 0.8125rem;
  color: rgba(232, 228, 217, 0.62);
  margin-bottom: 0.75rem;
  line-height: 1.5;
}

.post-purchase-review-stars {
  display: flex;
  gap: 0.35rem;
  margin-bottom: 0.65rem;
}

.post-purchase-review-star {
  width: 2.1rem;
  height: 2.1rem;
  border-radius: 8px;
  border: 1px solid rgba(232, 228, 217, 0.16);
  background: rgba(0, 0, 0, 0.2);
  color: rgba(232, 228, 217, 0.45);
  font: inherit;
  font-size: 1rem;
  cursor: pointer;
}

.post-purchase-review-star.is-active,
.post-purchase-review-star:hover {
  color: #ffb347;
  border-color: rgba(255, 179, 71, 0.45);
  background: rgba(255, 179, 71, 0.08);
}

.post-purchase-review-textarea {
  width: 100%;
  min-height: 5.5rem;
  resize: vertical;
  border-radius: 10px;
  border: 1px solid rgba(232, 228, 217, 0.14);
  background: rgba(0, 0, 0, 0.22);
  color: #e8e4d9;
  padding: 0.7rem 0.8rem;
  font: inherit;
  font-size: 0.9375rem;
  line-height: 1.55;
}

.post-purchase-review-textarea:focus {
  outline: none;
  border-color: rgba(255, 107, 0, 0.45);
}

.post-purchase-review-actions {
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
  margin-top: 0.65rem;
}

.post-purchase-review-btn {
  border: 0;
  border-radius: 8px;
  padding: 0.55rem 0.9rem;
  font: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
}

.post-purchase-review-btn--primary {
  background: #ff6b00;
  color: #fff;
}

.post-purchase-review-btn--ghost {
  background: transparent;
  color: rgba(232, 228, 217, 0.75);
  border: 1px solid rgba(232, 228, 217, 0.14);
}

.post-purchase-review-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.post-purchase-review-msg {
  margin-top: 0.55rem;
  font-size: 0.8125rem;
  color: rgba(232, 228, 217, 0.62);
}

.post-purchase-review-msg.is-error {
  color: #ff9a9a;
}

.post-purchase-review-msg.is-success {
  color: #8ef0c0;
}

.post-purchase-review-done {
  padding: 0.75rem 0.85rem;
  border-radius: 10px;
  background: rgba(62, 207, 142, 0.08);
  border: 1px solid rgba(62, 207, 142, 0.2);
  color: #8ef0c0;
  font-size: 0.875rem;
  line-height: 1.55;
}

.post-purchase-review-linkbox {
  display: grid;
  gap: 0.55rem;
  margin-bottom: 0.75rem;
}

.post-purchase-review-link {
  display: block;
  padding: 0.65rem 0.75rem;
  border-radius: 10px;
  border: 1px solid rgba(232, 228, 217, 0.14);
  background: rgba(0, 0, 0, 0.22);
  color: #8ec8ff;
  font-size: 0.78rem;
  line-height: 1.5;
  word-break: break-all;
  text-decoration: none;
  direction: ltr;
  text-align: left;
  unicode-bidi: isolate;
}

.post-purchase-review-copy {
  width: 100%;
}

.post-purchase-review-open {
  display: none;
}

.final-success #post-purchase-review-wrap {
  /* Match hero-divider width: cancel final-success side padding */
  margin: 1.2rem -1rem 0;
  padding: 1.2rem 0 0;
  width: auto;
  max-width: none;
  border-top: 1px solid rgba(232, 228, 217, 0.1);
  text-align: right;
  scroll-margin-top: 1.25rem;
  scroll-margin-bottom: 1.25rem;
}

.final-success .post-purchase-review {
  margin: 0;
  width: 100%;
  max-width: none;
  box-sizing: border-box;
  padding: 1.25rem 1.1rem 1.1rem;
  border-radius: 20px;
  border: 1px solid rgba(232, 228, 217, 0.12);
  background: #0b1d33;
  box-shadow: 0 18px 40px -28px rgba(0, 0, 0, 0.85);
}

.final-success .post-purchase-review-heading {
  font-size: 0.95rem;
  font-weight: 700;
  color: #e8e4d9;
  margin: 0 0 0.85rem;
  line-height: 1.55;
}

.final-success .post-purchase-review-heading::before {
  content: '';
  display: inline-block;
  width: 0.32rem;
  height: 0.98rem;
  margin-left: 0.5rem;
  vertical-align: -0.14rem;
  border-radius: 999px;
  background: linear-gradient(180deg, #ff8534, #ff6b00);
}

.final-success .post-purchase-review .review-form {
  gap: 0.95rem;
}

.final-success .post-purchase-review .review-form-done {
  margin: 0;
}

/* ── Standalone review page ── */
.review-page-body {
  background: #060f1a;
  color: #e8e4d9;
  min-height: 100dvh;
  font-family: 'Vazirmatn', Tahoma, system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.review-page-body,
.review-page-body *,
.review-page-body *::before,
.review-page-body *::after {
  box-sizing: border-box;
}

.review-page-body button,
.review-page-body textarea,
.review-page-body input {
  font-family: inherit;
}

.review-page-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  background: radial-gradient(ellipse 80% 60% at 50% 0%, rgba(255, 107, 0, 0.08) 0%, transparent 55%),
    linear-gradient(180deg, #0c1f35 0%, #060f1a 100%);
}

.review-page-app {
  position: relative;
  z-index: 1;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: calc(2rem + env(safe-area-inset-top, 0px)) 1rem calc(2.5rem + env(safe-area-inset-bottom, 0px));
}

.review-page-card {
  width: 100%;
  max-width: 400px;
  padding: 1.75rem 1.35rem 1.5rem;
  border-radius: 20px;
  background: rgba(12, 28, 48, 0.92);
  border: 1px solid rgba(232, 228, 217, 0.08);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4);
  overflow: hidden;
}

.review-page-header {
  text-align: center;
  margin-bottom: 1.5rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid rgba(232, 228, 217, 0.06);
}

.review-page-title {
  font-size: 1.1rem;
  font-weight: 800;
  margin: 0;
  color: #e8e4d9;
  line-height: 1.55;
}

.review-page-subtitle {
  margin: 0.55rem 0 0;
  font-size: 0.875rem;
  font-weight: 500;
  color: rgba(232, 228, 217, 0.62);
  line-height: 1.45;
}

.review-page-product {
  display: inline-block;
  margin-top: 0.75rem;
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  background: rgba(255, 107, 0, 0.1);
  color: #ff9a4d;
  font-size: 0.8125rem;
  font-weight: 600;
}

.review-page-mount {
  display: grid;
  gap: 0;
  width: 100%;
  min-width: 0;
}

.review-page-loading {
  text-align: center;
  color: rgba(232, 228, 217, 0.5);
  padding: 1rem 0;
  font-size: 0.875rem;
}

.review-page-error {
  padding: 0.85rem 1rem;
  border-radius: 12px;
  background: rgba(255, 107, 107, 0.08);
  border: 1px solid rgba(255, 107, 107, 0.2);
  color: #ff9a9a;
  font-size: 0.875rem;
  line-height: 1.6;
}

.review-page-back {
  display: block;
  margin-top: 1.25rem;
  text-align: center;
  font-size: 0.8125rem;
  color: rgba(232, 228, 217, 0.45);
  text-decoration: none;
}

.review-page-back:hover {
  color: rgba(232, 228, 217, 0.75);
}

.review-form {
  display: grid;
  gap: 1rem;
  width: 100%;
  min-width: 0;
}

.review-form-details {
  display: grid;
  gap: 1rem;
  width: 100%;
  min-width: 0;
  overflow: hidden;
  opacity: 0;
  transform: translateY(-0.35rem);
  max-height: 0;
  transition:
    opacity 0.22s ease,
    transform 0.22s ease,
    max-height 0.28s ease;
}

.review-form-details[hidden] {
  display: none;
}

.review-form-details.is-open {
  opacity: 1;
  transform: translateY(0);
  max-height: 28rem;
}

.review-form-field {
  display: grid;
  gap: 0.5rem;
  width: 100%;
  min-width: 0;
}

.review-form-label {
  font-size: 0.8125rem;
  font-weight: 600;
  color: rgba(232, 228, 217, 0.7);
}

.review-form-rating {
  display: grid;
  gap: 0.45rem;
  padding: 0.85rem 0.65rem 0.75rem;
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid rgba(232, 228, 217, 0.06);
  direction: ltr;
}

.review-form-scale-hints {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  padding: 0 0.15rem;
  font-size: 0.75rem;
  font-weight: 600;
}

.review-form-scale-hint--bad {
  color: #ff8a8a;
}

.review-form-scale-hint--good {
  color: #7ee8b0;
}

.review-form-stars {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.15rem;
  direction: ltr;
  padding: 0 0.1rem;
}

.review-form-star-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
  min-width: 0;
}

.review-form-star-col.is-selected .review-form-star-num {
  color: #ffb347;
  font-weight: 800;
}

.review-form-star-num {
  display: none;
}

.review-form-star {
  width: 100%;
  max-width: 2.75rem;
  height: 2.75rem;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: rgba(232, 228, 217, 0.22);
  font: inherit;
  font-size: 1.55rem;
  line-height: 1;
  cursor: pointer;
  transition: color 0.12s ease, transform 0.12s ease, border-color 0.12s ease, background 0.12s ease;
}

.review-form-star.is-active {
  color: #ffb347;
}

.review-form-star.is-picked,
.review-form-star-col.is-selected .review-form-star {
  color: #ffb347;
  border-color: rgba(255, 179, 71, 0.35);
  background: rgba(255, 179, 71, 0.08);
  transform: scale(1.06);
}

.review-form-star:hover {
  color: #ffc76a;
}

.review-form-rating-pick {
  margin: 0.15rem 0 0;
  text-align: center;
  font-size: 0.8125rem;
  font-weight: 600;
  color: #ffb347;
}

.review-form-textarea {
  display: block;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  min-height: 5.5rem;
  resize: vertical;
  border-radius: 12px;
  border: 1px solid rgba(232, 228, 217, 0.1);
  background: rgba(0, 0, 0, 0.3);
  color: #e8e4d9;
  padding: 0.75rem 0.85rem;
  font: inherit;
  font-size: 0.9375rem;
  line-height: 1.55;
  margin: 0;
}

.review-form-textarea:focus {
  outline: none;
  border-color: rgba(255, 107, 0, 0.4);
}

.review-form-textarea::placeholder {
  color: rgba(232, 228, 217, 0.3);
}

.review-form-submit {
  width: 100%;
  margin-top: 0.15rem;
  padding: 0.85rem 1rem;
  border: 0;
  border-radius: 12px;
  font: inherit;
  font-size: 0.9375rem;
  font-weight: 700;
  cursor: pointer;
  background: #ff6b00;
  color: #fff;
  box-shadow: 0 4px 16px rgba(255, 107, 0, 0.25);
  transition: background 0.15s ease;
}

.review-form-submit:hover:not(:disabled) {
  background: #ff8534;
}

.review-form-submit:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.review-form-msg {
  margin: 0;
  font-size: 0.8125rem;
  text-align: center;
  color: rgba(232, 228, 217, 0.55);
}

.review-form-msg.is-error {
  color: #ff9a9a;
}

.review-form-done {
  padding: 1rem;
  border-radius: 12px;
  background: rgba(46, 213, 115, 0.1);
  border: 1px solid rgba(46, 213, 115, 0.2);
  color: #7ee8b0;
  font-size: 0.9375rem;
  text-align: center;
}

.post-purchase-review-link {
  cursor: text;
  user-select: all;
}
