/* =============================================================================
   PRODUCT REVIEWS — Phase 1g
   -----------------------------------------------------------------------------
   Reference: Docs/Redesign/Approved/product-detail/Daric Review Flow (standalone).html
   Markup:    Views/Shared/Partials/Products/_ProductComment*.cshtml
   Behaviour: wwwroot/js/product-reviews.js
   Tokens:    the STEP 14 block of tailwind/input.css (plus every STEP 13 token,
              which this reference's :root declares identically)

   Linked from Views/Product/Index.cshtml's own @section Styles, AFTER
   product-detail.css — the panel lives inside .pd-panel__body and a few of its
   rules have to win the specificity tie.

   NAMESPACE. Every class is `pr-`. None of the legacy selectors in shop.css
   (.comment-*, .rate-movie, .btn-add-point) match it, so there is no cascade
   fight to neutralise — the same trick the `pc-` product card used.

   NO BOOTSTRAP UTILITIES anywhere in the markup: they are !important in
   Bootstrap 4 and would be unoverridable here.

   ONE RESPONSIVE TREE. There is exactly one breakpoint, SECTION 8 at 991.98px,
   and it re-lays the SAME nodes — the desktop panel becomes the mobile sheet
   with no element moving and no JavaScript reading a width.

   SECTIONS
     0   Shell, shared primitives (buttons, badges, chips, stars, a11y)
     1   Rating summary                         board ۸
     2   The visitor's own review               board ۶-ث
     3   Entry points: empty state + sort bar   board ۲
     4   Panel shell (head / body / foot)       boards ۳ · ۷
     5   The form                               boards ۳ · ۴ · ۵
     6   States: sign-in, errors, submitting, sent   board ۶
     7   The list and one review card           board ۹
     8   Mobile (<= 991.98px)                   board ۷
     9   [hidden] restatements
   ============================================================================= */


/* =============================================================================
   SECTION 0 — SHELL AND SHARED PRIMITIVES
   ============================================================================= */

.pr {
    display: flex;
    flex-direction: column;
    gap: 22px;
}

/* Preflight is disabled, so <button>, <input>, <ul> and <fieldset> keep their UA
   and Bootstrap defaults inside this tree. :where() keeps the reset at (0,0,1)
   specificity so ANY class below wins automatically — written `.pr button` it
   would be (0,1,1) and would beat every single-class component under it, which
   is exactly the bug home-redesign.css hit on 2026-09-01. */
:where(.pr) button {
    border: 0;
    background: none;
    font: inherit;
    color: inherit;
}

:where(.pr) ul,
:where(.pr) ol {
    list-style: none;
    /* Preflight off means a list keeps the UA's 40px padding-inline-start — the
       trap the home page's trust roadmap hit. Reset all three, not just margin. */
    margin: 0;
    padding: 0;
}

:where(.pr) fieldset {
    border: 0;
    margin: 0;
    padding: 0;
    min-width: 0;
}

:where(.pr) legend {
    padding: 0;
    width: auto;
}

:where(.pr) p {
    margin: 0;
}

/* shop.css:22-27 sets `img[alt] { display: flex }` at (0,1,1). This has to beat
   it, so unlike the resets above it keeps its class. */
.pr img {
    display: block;
    max-width: 100%;
}

.pr-visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
}

/* ── Buttons ───────────────────────────────────────────────────────────────── */

.pr-cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    height: 46px;
    padding: 0 26px;
    border-radius: var(--radius-brand-cta);
    background: linear-gradient(145deg, var(--brand-primary-sun), var(--brand-primary) 46%, var(--brand-primary-sheen));
    color: var(--brand-primary-ink);
    border: 1px solid var(--brand-primary-frame-strong);
    font: 800 13.5px/1 inherit;
    cursor: pointer;
    text-decoration: none;
    box-shadow: var(--brand-shadow-cta-md);
    transition: transform .18s ease, box-shadow .18s ease;
}

.pr-cta:hover {
    transform: translateY(-2px);
    color: var(--brand-primary-ink);
    text-decoration: none;
}

.pr-cta .pd-icon {
    width: 15px;
    height: 15px;
    flex: none;
}

.pr-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    height: 46px;
    padding: 0 22px;
    border-radius: var(--radius-brand-cta);
    font: 700 13px/1 inherit;
    cursor: pointer;
    transition: border-color .2s ease, color .2s ease, background .2s ease;
}

.pr-btn .pd-icon {
    width: 13px;
    height: 13px;
    flex: none;
}

.pr-btn--ghost {
    background: transparent;
    border: 1px solid var(--brand-border);
    color: var(--brand-text-muted);
}

.pr-btn--ghost:hover {
    border-color: var(--brand-text-soft);
    color: var(--brand-text);
}

.pr-btn--gold {
    height: 38px;
    padding: 0 18px;
    border-radius: 11px;
    background: var(--brand-primary-band);
    border: 1px solid var(--brand-primary-edge);
    color: var(--brand-primary-deep);
    font-size: 12px;
}

.pr-btn--gold:hover {
    background: var(--brand-primary-tint);
}

/* ── Badges and chips ──────────────────────────────────────────────────────── */

.pr-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    border-radius: 999px;
    padding: 3px 9px 4px;
    font: 700 10px/1.5 inherit;
    white-space: nowrap;
}

.pr-badge .pd-icon {
    width: 11px;
    height: 11px;
    flex: none;
}

.pr-badge--verified,
.pr-badge--published {
    background: var(--brand-success-wash-badge);
    border: 1px solid var(--brand-success-edge-badge);
    color: var(--brand-success-ink-strong);
}

.pr-badge--pending {
    background: var(--brand-primary-band);
    border: 1px solid var(--brand-primary-edge);
    color: var(--brand-primary-deep);
    padding: 4px 10px 5px;
    font-size: 10.5px;
}

.pr-badge--rejected {
    background: var(--brand-discount-wash-badge);
    border: 1px solid var(--brand-discount-edge-chip);
    color: var(--brand-discount-ink);
    padding: 4px 10px 5px;
    font-size: 10.5px;
}

.pr-badge__pulse {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--brand-primary);
    animation: prPulse 1.8s ease-in-out infinite;
}

@keyframes prPulse {
    0%, 100% { opacity: .45; }
    50% { opacity: 1; }
}

.pr-chip {
    display: inline-flex;
    align-items: center;
    height: 22px;
    padding: 0 8px;
    border-radius: var(--radius-brand-xs);
    font: 600 10px/1 inherit;
}

.pr-chip--quiet {
    background: var(--brand-surface-recess);
    border: 1px solid var(--brand-border);
    color: var(--brand-text-soft);
}

.pr-dot {
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: var(--brand-text-soft);
    flex: none;
}

/* ── Read-only star rows ───────────────────────────────────────────────────── */

.pr-stars {
    display: inline-flex;
    gap: 2px;
    flex: none;
}

.pr-star .pd-icon {
    width: 18px;
    height: 18px;
    display: block;
    color: var(--brand-star-empty-strong);
}

.pr-star.is-on .pd-icon {
    color: var(--brand-primary);
}

.pr-stars--sm .pr-star .pd-icon {
    width: 15px;
    height: 15px;
}


/* =============================================================================
   SECTION 1 — RATING SUMMARY (board ۸)
   -----------------------------------------------------------------------------
   The reference's three columns are 400 / 1fr / 340. `minmax(0, …)` on the middle
   one is load-bearing: a grid track's default `min-width: auto` refuses to shrink
   below its content, and the distribution's own bars would then push the panel
   past its container instead of compressing.
   ============================================================================= */

.pr-summary {
    display: grid;
    grid-template-columns: minmax(0, 400px) minmax(0, 1fr) minmax(0, 340px);
    gap: 30px;
    padding: 26px 28px;
    border-radius: var(--radius-brand-card-lg);
    background: var(--brand-card-face);
    border: 1px solid var(--brand-primary-rule);
    box-shadow: var(--brand-shadow-review-summary);
}

.pr-summary__averages {
    display: flex;
    gap: 18px;
    /* LOGICAL, not `border-left`. The reference is drawn RTL, where the first
       column sits on the right and its divider is on its inline-END edge. Written
       physically this rule would put the divider on the wrong side the moment the
       storefront is read LTR. */
    border-inline-end: 1px solid var(--brand-border);
    padding-inline-end: 24px;
}

.pr-avg {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
}

.pr-avg__label {
    display: flex;
    align-items: center;
    gap: 5px;
    font: 600 11.5px/1.5 inherit;
    color: var(--brand-text-muted);
}

.pr-avg__label .pd-icon {
    width: 12px;
    height: 12px;
}

.pr-avg__value {
    display: flex;
    align-items: baseline;
    gap: 6px;
}

.pr-avg__value b {
    font: 800 42px/1 inherit;
    letter-spacing: -.03em;
    color: var(--brand-text);
}

.pr-avg__value span {
    font: 600 13px/1 inherit;
    color: var(--brand-text-soft);
}

.pr-avg__count {
    font: 500 11px/1.6 inherit;
    color: var(--brand-text-soft);
}

/* «میانگین خریداران» — the gold panel that makes rule 5's second average
   visually distinct from the overall one rather than a second identical number. */
.pr-avg--buyers {
    gap: 8px;
    padding: 12px 14px;
    border-radius: var(--radius-brand-lg);
    background: var(--brand-primary-band);
    border: 1px solid var(--brand-primary-rule);
}

.pr-avg--buyers .pr-avg__label {
    font-weight: 700;
    color: var(--brand-primary-deep);
}

.pr-avg--buyers .pr-avg__value b {
    color: var(--brand-primary-deep);
}

.pr-avg--buyers .pr-avg__count {
    color: var(--brand-text-muted);
}

/* ── Distribution ──────────────────────────────────────────────────────────── */

.pr-dist {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
}

.pr-dist__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 2px;
    flex-wrap: wrap;
}

.pr-dist__title {
    font: 600 11.5px/1.5 inherit;
    color: var(--brand-text-muted);
}

.pr-dist__legend {
    display: flex;
    align-items: center;
    gap: 12px;
    font: 500 10.5px/1.5 inherit;
    color: var(--brand-text-soft);
}

.pr-dist__legend span {
    display: flex;
    align-items: center;
    gap: 5px;
}

.pr-dist__key {
    width: 14px;
    height: 6px;
    border-radius: 3px;
    display: block;
}

.pr-dist__key--buyers { background: var(--brand-primary-deep); }
.pr-dist__key--others { background: var(--brand-primary-pale); }

.pr-dist__row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.pr-dist__stars {
    width: 26px;
    flex: none;
    font: 600 11px/1.5 inherit;
    color: var(--brand-text-muted);
}

.pr-dist__track {
    flex: 1;
    height: 8px;
    border-radius: 4px;
    background: var(--brand-surface-recess);
    border: 1px solid var(--brand-border);
    overflow: hidden;
    display: flex;
    min-width: 0;
}

.pr-dist__fill { height: 100%; }
.pr-dist__fill--buyers { background: var(--brand-primary-deep); }
.pr-dist__fill--others { background: var(--brand-primary-pale); }

.pr-dist__num {
    width: 30px;
    flex: none;
    font: 500 10.5px/1.5 inherit;
    color: var(--brand-text-soft);
    text-align: end;
}

.pr-dist__reco {
    margin-top: 6px;
    display: flex;
    align-items: center;
    gap: 7px;
    font: 500 11px/1.6 inherit;
    color: var(--brand-text-muted);
}

.pr-dist__reco .pd-icon {
    width: 13px;
    height: 13px;
    flex: none;
    color: var(--brand-success-ink);
}

/* ── Per-criterion averages ────────────────────────────────────────────────── */

.pr-dimavg {
    display: flex;
    flex-direction: column;
    gap: 11px;
    padding: 16px 18px;
    border-radius: var(--radius-brand-lg);
    background: var(--brand-primary-band);
    border: 1px solid var(--brand-primary-rule);
    min-width: 0;
}

.pr-dimavg__head {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.pr-dimavg__title {
    font: 700 11.5px/1.5 inherit;
    color: var(--brand-primary-deep);
}

/* Rule 5's labelling requirement, and the reason this note is not optional: the
   criterion vote count differs from the review count by design, and an unexplained
   mismatch reads as a bug. */
.pr-dimavg__note,
.pr-dimavg__foot {
    font: 500 10px/1.7 inherit;
    color: var(--brand-text-muted);
}

.pr-dimavg__foot {
    color: var(--brand-text-soft);
    padding-top: 11px;
    border-top: 1px solid var(--brand-primary-rule);
}

.pr-dimavg__row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.pr-dimavg__label {
    font: 500 11.5px/1.6 inherit;
    color: var(--brand-text-muted);
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pr-dimavg__meter {
    display: flex;
    align-items: center;
    gap: 9px;
    flex: none;
}

.pr-dimavg__track {
    width: 82px;
    height: 6px;
    border-radius: 3px;
    background: rgba(255, 255, 255, .75);
    overflow: hidden;
}

.pr-dimavg__fill {
    display: block;
    height: 100%;
    background: var(--brand-primary-deep);
}

.pr-dimavg__value {
    font: 700 11.5px/1.5 inherit;
    width: 22px;
    text-align: end;
    color: var(--brand-text);
}


/* =============================================================================
   SECTION 2 — THE VISITOR'S OWN REVIEW (board ۶-ث)
   ============================================================================= */

.pr-mine {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.pr-mine__label {
    font: 800 13.5px/1.5 inherit;
    color: var(--brand-text);
}

.pr-mine__foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
}

.pr-mine__note {
    display: flex;
    align-items: center;
    gap: 6px;
    font: 500 11px/1.8 inherit;
    color: var(--brand-text-soft);
    max-width: 340px;
    text-wrap: pretty;
}

.pr-mine__actions {
    display: flex;
    align-items: center;
    gap: 9px;
    flex: none;
}

.pr-mine__delete {
    margin: 0;
    display: inline-flex;
}

.pr-mine__delete .pr-btn {
    height: 38px;
    padding: 0 16px;
    border-radius: 11px;
    font-size: 12px;
}


/* =============================================================================
   SECTION 3 — ENTRY POINTS (board ۲)
   ============================================================================= */

.pr-empty {
    position: relative;
    border-radius: var(--radius-brand-card-lg);
    border: 1px dashed var(--brand-primary-edge);
    background: linear-gradient(140deg, var(--brand-primary-band), var(--brand-surface-cream) 62%);
    padding: 40px 34px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    overflow: hidden;
    text-align: center;
}

.pr-empty__dots {
    position: absolute;
    inset: 0;
    background-image: radial-gradient(var(--brand-primary-veil) 1px, transparent 1.1px);
    background-size: 20px 20px;
    opacity: .5;
    pointer-events: none;
}

.pr-empty > *:not(.pr-empty__dots) { position: relative; }

.pr-empty__icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--brand-card-face);
    border: 1px solid var(--brand-primary-rule);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--brand-primary);
    box-shadow: var(--brand-shadow-review-empty-icon);
}

.pr-empty__icon .pd-icon {
    width: 26px;
    height: 26px;
}

.pr-empty__title { font: 800 16px/1.6 inherit; }

.pr-empty__note {
    font: 500 12.5px/1.95 inherit;
    color: var(--brand-text-muted);
    max-width: 440px;
    text-wrap: pretty;
}

.pr-empty__cta {
    margin-top: 8px;
    height: 50px;
    padding: 0 26px;
    border-radius: var(--radius-brand-lg);
    font-size: 14px;
}

.pr-empty__foot {
    font: 500 11px/1.6 inherit;
    color: var(--brand-text-soft);
}

/* ── The sort bar (board ۲-پ) ──────────────────────────────────────────────── */

.pr-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 14px 18px;
    border-radius: var(--radius-brand-card-lg);
    background: var(--brand-card-face);
    border: 1px solid var(--brand-border);
    flex-wrap: wrap;
}

.pr-bar__sorts {
    display: flex;
    align-items: center;
    gap: 9px;
    flex-wrap: wrap;
}

.pr-bar__label {
    font: 500 12px/1.5 inherit;
    color: var(--brand-text-soft);
}

.pr-sort {
    display: inline-flex;
    align-items: center;
    height: 34px;
    padding: 0 14px;
    border-radius: 17px;
    background: transparent;
    border: 1px solid var(--brand-border);
    color: var(--brand-text-muted);
    font: 600 12px/1 inherit;
    cursor: pointer;
    text-decoration: none;
    transition: border-color .2s ease, color .2s ease;
}

.pr-sort:hover {
    border-color: var(--brand-primary-edge);
    color: var(--brand-primary-deep);
    text-decoration: none;
}

.pr-sort.is-on {
    background: var(--brand-primary-band);
    border-color: var(--brand-primary-edge);
    color: var(--brand-primary-deep);
    font-weight: 700;
}

.pr-bar__cta {
    height: 44px;
    padding: 0 20px;
    font-size: 13px;
    font-weight: 700;
}

.pr-bar__cta .pd-icon {
    width: 16px;
    height: 16px;
}


/* =============================================================================
   SECTION 4 — PANEL SHELL (boards ۳ · ۷)
   ============================================================================= */

.pr-panel {
    display: block;
}

.pr-panel__card {
    position: relative;
    max-width: 920px;
    border-radius: 22px;
    background: var(--brand-card-face);
    border: 1px solid var(--brand-primary-rule);
    overflow: hidden;
    box-shadow: var(--brand-shadow-review-panel);
    display: flex;
    flex-direction: column;
}

.pr-panel__rule {
    display: block;
    height: 3px;
    flex: none;
    background: linear-gradient(90deg,
        transparent,
        var(--brand-primary) 20%,
        var(--brand-primary-crest) 50%,
        var(--brand-primary) 80%,
        transparent);
}

.pr-panel__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    padding: 22px 28px 20px;
    border-bottom: 1px solid var(--brand-border);
    flex: none;
}

.pr-panel__head--gold {
    background: linear-gradient(150deg, var(--brand-primary-band), var(--brand-card-face) 70%);
}

.pr-panel__who {
    display: flex;
    align-items: center;
    gap: 13px;
    min-width: 0;
}

.pr-panel__avatar {
    width: 46px;
    height: 46px;
    flex: none;
    border-radius: var(--radius-brand-lg);
    background: var(--brand-card-face);
    border: 1px solid var(--brand-primary-rule);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--brand-primary-deep);
}

.pr-panel__avatar .pd-icon {
    width: 20px;
    height: 20px;
}

.pr-panel__ident {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

.pr-panel__title { font: 800 16px/1.5 inherit; }

.pr-panel__sub {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.pr-panel__sub-text {
    font: 500 11.5px/1.5 inherit;
    color: var(--brand-text-muted);
}

/* Orientation for the mobile sheet, where the page behind it is not visible.
   Redundant on desktop, where the product is right there — SECTION 8 shows it. */
.pr-panel__product { display: none; }

.pr-panel__close {
    width: 36px;
    height: 36px;
    flex: none;
    border-radius: 11px;
    background: var(--brand-card-face);
    border: 1px solid var(--brand-border);
    color: var(--brand-text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: border-color .2s ease, color .2s ease;
}

.pr-panel__close:hover {
    border-color: var(--brand-primary-edge);
    color: var(--brand-primary-deep);
}

.pr-panel__close .pd-icon {
    width: 15px;
    height: 15px;
}

.pr-form {
    display: flex;
    flex-direction: column;
    min-height: 0;
    margin: 0;
}

.pr-form__body {
    display: flex;
    flex-direction: column;
    gap: 30px;
    padding: 28px 28px 26px;
}

.pr-panel__foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 18px 28px;
    background: var(--brand-surface-recess);
    border-top: 1px solid var(--brand-border);
    flex: none;
    flex-wrap: wrap;
}

.pr-panel__notice {
    display: flex;
    align-items: center;
    gap: 8px;
    font: 500 11.5px/1.6 inherit;
    color: var(--brand-text-muted);
    max-width: 420px;
    text-wrap: pretty;
}

.pr-panel__notice .pd-icon {
    width: 15px;
    height: 15px;
    flex: none;
    color: var(--brand-primary-deep);
}

.pr-panel__notice-short { display: none; }

.pr-panel__actions {
    display: flex;
    align-items: center;
    gap: 11px;
    flex: none;
}


/* =============================================================================
   SECTION 5 — THE FORM (boards ۳ · ۴ · ۵)
   ============================================================================= */

.pr-step {
    display: flex;
    gap: 16px;
}

.pr-step__rail {
    flex: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding-top: 2px;
}

.pr-step__num {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--brand-primary);
    color: var(--brand-primary-ink);
    display: flex;
    align-items: center;
    justify-content: center;
    font: 800 12px/1 inherit;
    flex: none;
}

.pr-step__num--quiet {
    background: var(--brand-card-face);
    border: 1px solid var(--brand-primary-edge);
    color: var(--brand-primary-deep);
}

.pr-step__line {
    flex: 1;
    width: 1px;
    background: var(--brand-border);
}

.pr-step__body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Board ۴'s reduced form is a plain stack, not a numbered sequence: two steps do not
   need numbering, and the rail would make the short form read as a truncated version
   of the long one rather than a complete form of its own — which is the reference's
   own stated intent for it. */
.pr-form--short .pr-step__rail { display: none; }
.pr-form--short .pr-step { gap: 0; }
.pr-form--short .pr-form__body { gap: 22px; }

.pr-step__head {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.pr-step__title {
    display: flex;
    align-items: center;
    gap: 9px;
    font: 800 14px/1.5 inherit;
}

.pr-step__note {
    font: 500 11.5px/1.6 inherit;
    color: var(--brand-text-soft);
}

/* ── The overall rating radiogroup ─────────────────────────────────────────── */

.pr-rate {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 18px 22px;
    border-radius: var(--radius-brand-price);
    background: linear-gradient(150deg, var(--brand-primary-band), var(--brand-surface-cream));
    border: 1px solid var(--brand-primary-rule);
    flex-wrap: wrap;
}

.pr-rate__legend {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: none;
    float: none;
}

.pr-rate__label-main { font: 800 13.5px/1.4 inherit; }

.pr-rate__label-sub {
    font: 500 11px/1.4 inherit;
    color: var(--brand-text-muted);
}

/* ⚠ THE DOM ORDER IS 5 → 1 AND THE ROW IS REVERSED. Both halves are load-bearing.
   `row-reverse` inside an RTL container puts the LAST child at the start edge, so
   star ۱ still renders rightmost exactly as the reference draws it. And because
   the checked input's lower-numbered siblings FOLLOW it in the DOM, plain
   `:checked ~ label` fills precisely the stars below the chosen one. Written 1 → 5
   the sibling combinator fills the wrong direction and needs :has() to correct —
   which also makes hover preview impossible without JavaScript. */
.pr-rate__stars {
    display: flex;
    flex-direction: row-reverse;
    justify-content: flex-end;
    gap: 6px;
    flex: none;
}

.pr-rate__input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    margin: 0;
    pointer-events: none;
}

.pr-rate__star {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 11px;
    cursor: pointer;
    margin: 0;
    transition: background .18s ease;
}

.pr-rate__star .pd-icon {
    width: 32px;
    height: 32px;
    color: var(--brand-star-empty-strong);
    transition: color .12s ease;
    pointer-events: none;
}

.pr-rate__star:hover { background: rgba(255, 255, 255, .7); }

/* Filled: the chosen star and every star below it. */
.pr-rate__input:checked + .pr-rate__star .pd-icon,
.pr-rate__input:checked ~ .pr-rate__star .pd-icon {
    color: var(--brand-primary);
}

/* Hover preview, same shape. It comes SECOND so it wins over the checked state
   while the pointer is down the row — which is what makes changing a rating feel
   like a choice rather than a fight. */
.pr-rate__stars:hover .pr-rate__star .pd-icon { color: var(--brand-star-empty-strong); }
.pr-rate__stars .pr-rate__star:hover .pd-icon,
.pr-rate__stars .pr-rate__star:hover ~ .pr-rate__star .pd-icon { color: var(--brand-primary); }

/* Keyboard focus. `:focus-visible` on the INPUT paints a ring on its LABEL, which
   is the thing actually on screen — without this the whole radiogroup is operable
   and completely invisible to a keyboard user. */
.pr-rate__input:focus-visible + .pr-rate__star {
    outline: 2px solid var(--brand-primary-deep);
    outline-offset: 2px;
}

.pr-rate__word {
    display: inline-flex;
    align-items: center;
    height: 32px;
    padding: 0 14px;
    border-radius: 16px;
    background: var(--brand-card-face);
    border: 1px solid var(--brand-primary-edge);
    color: var(--brand-primary-deep);
    font: 700 12.5px/1 inherit;
    flex: none;
}

/* Board ۴'s reduced form centres a larger row: it is a complete, deliberate form,
   not a truncated version of the long one. */
.pr-rate--solo {
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 22px;
    text-align: center;
}

.pr-rate--solo .pr-rate__legend { align-items: center; }
.pr-rate--solo .pr-rate__stars { gap: 8px; }
.pr-rate--solo .pr-rate__star { width: 48px; height: 48px; border-radius: 12px; }
.pr-rate--solo .pr-rate__star .pd-icon { width: 36px; height: 36px; }

/* ── Criteria (board ۵ · 0, 1, 3 and 5) ────────────────────────────────────── */

.pr-dims {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 18px 20px;
    border-radius: var(--radius-brand-price);
    background: var(--brand-surface-recess);
    border: 1px solid var(--brand-border);
    /* THE LAYOUT MUST NOT SHIFT between 0, 1, 3 and 5 criteria. The heading and this
       floor keep the block the same shape whatever the shop has configured, so a
       category with none does not make the panel visibly shorter than one with five. */
    min-height: 150px;
}

.pr-dims__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
}

.pr-dims__title { font: 800 13px/1.5 inherit; }

.pr-dims__count {
    font: 500 11px/1.5 inherit;
    color: var(--brand-text-soft);
}

.pr-dims__empty {
    font: 500 11.5px/1.9 inherit;
    color: var(--brand-text-muted);
}

.pr-dims__foot {
    font: 500 10.5px/1.6 inherit;
    color: var(--brand-text-soft);
}

.pr-dims__list {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.pr-dim {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 9px 0;
    border-bottom: 1px solid var(--brand-border);
}

.pr-dim:last-child { border-bottom: 0; }

.pr-dim__label {
    font: 700 12.5px/1.5 inherit;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Same 5→1 + row-reverse construction as the overall row. */
.pr-dim__stars {
    display: flex;
    flex-direction: row-reverse;
    justify-content: flex-end;
    gap: 3px;
    flex: none;
}

.pr-dim__star {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 9px;
    cursor: pointer;
    margin: 0;
    transition: background .18s ease;
}

.pr-dim__star .pd-icon {
    width: 23px;
    height: 23px;
    color: var(--brand-star-empty-strong);
    transition: color .12s ease;
    pointer-events: none;
}

.pr-dim__star:hover { background: var(--brand-primary-band); }

.pr-rate__input:checked + .pr-dim__star .pd-icon,
.pr-rate__input:checked ~ .pr-dim__star .pd-icon { color: var(--brand-primary); }

.pr-dim__stars:hover .pr-dim__star .pd-icon { color: var(--brand-star-empty-strong); }
.pr-dim__stars .pr-dim__star:hover .pd-icon,
.pr-dim__stars .pr-dim__star:hover ~ .pr-dim__star .pd-icon { color: var(--brand-primary); }

.pr-rate__input:focus-visible + .pr-dim__star {
    outline: 2px solid var(--brand-primary-deep);
    outline-offset: 2px;
}

/* Board ۴'s invitation, in the space the criteria would occupy. */
.pr-unlock {
    display: flex;
    gap: 12px;
    padding: 15px 17px;
    border-radius: var(--radius-brand-lg);
    background: var(--brand-primary-band);
    border: 1px solid var(--brand-primary-rule);
}

.pr-unlock__icon {
    flex: none;
    width: 32px;
    height: 32px;
    border-radius: 10px;
    background: var(--brand-card-face);
    border: 1px solid var(--brand-primary-rule);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--brand-primary-deep);
}

.pr-unlock__icon .pd-icon { width: 16px; height: 16px; }

.pr-unlock__text {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.pr-unlock__title {
    font: 800 12px/1.6 inherit;
    color: var(--brand-primary-deep);
}

.pr-unlock__note {
    font: 500 11px/1.85 inherit;
    color: var(--brand-text-muted);
    text-wrap: pretty;
}

/* ── Text fields ───────────────────────────────────────────────────────────── */

.pr-field {
    display: flex;
    flex-direction: column;
    gap: 7px;
    margin: 0;
}

.pr-field__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.pr-field__label {
    font: 700 12px/1.5 inherit;
    color: var(--brand-text-muted);
}

.pr-field__count {
    font: 500 11px/1.5 inherit;
    color: var(--brand-text-soft);
}

.pr-field__count.is-over,
.pr-field__count.is-short {
    color: var(--brand-discount-ink);
    font-weight: 600;
}

.pr-input,
.pr-textarea {
    border-radius: var(--radius-brand-cta);
    background: var(--brand-surface-recess);
    border: 1px solid var(--brand-border);
    color: var(--brand-text);
    outline: 0;
    box-sizing: border-box;
    width: 100%;
    transition: border-color .18s ease, background .18s ease;
}

.pr-input {
    height: 46px;
    padding: 0 15px;
    font: 600 13px/1 inherit;
}

.pr-textarea {
    padding: 14px 15px;
    font: 500 12.5px/2.05 inherit;
    resize: vertical;
    min-height: 120px;
}

.pr-input:focus,
.pr-textarea:focus {
    border-color: var(--brand-primary-edge);
    background: var(--brand-card-face);
}

.pr-field__hint {
    display: flex;
    align-items: center;
    gap: 6px;
    font: 500 10.5px/1.6 inherit;
    color: var(--brand-text-soft);
}

.pr-field__hint .pd-icon { width: 12px; height: 12px; flex: none; }

.pr-field__error {
    display: flex;
    align-items: center;
    gap: 6px;
    font: 600 11px/1.6 inherit;
    color: var(--brand-discount-ink);
}

/* The invalid state, applied to the FIELD wrapper so the label, the counter and the
   control all shift together — a red border with a grey label reads as decoration. */
.pr-field.is-invalid .pr-input,
.pr-field.is-invalid .pr-textarea {
    background: #FFFFFF;
    border: 1.5px solid var(--brand-discount-edge-field);
}

.pr-rate.is-invalid {
    background: var(--brand-discount-wash-faint);
    border: 1.5px solid var(--brand-discount-edge-strong);
}

/* ── Strengths and weaknesses ──────────────────────────────────────────────── */

.pr-pointgrid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.pr-points-edit {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 15px 16px;
    border-radius: var(--radius-brand-lg);
    min-width: 0;
}

.pr-points-edit--power {
    background: var(--brand-success-wash-faint);
    border: 1px solid var(--brand-success-edge);
}

.pr-points-edit--weak {
    background: var(--brand-discount-wash-soft);
    border: 1px solid var(--brand-discount-edge-faint);
}

.pr-points-edit__title {
    display: flex;
    align-items: center;
    gap: 7px;
    font: 800 12px/1.5 inherit;
}

.pr-points-edit__title .pd-icon { width: 14px; height: 14px; flex: none; }

.pr-points-edit--power .pr-points-edit__title { color: var(--brand-success-ink-strong); }
.pr-points-edit--weak .pr-points-edit__title { color: var(--brand-discount-ink-strong); }

.pr-points-edit__chips {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
}

.pr-points-edit__chips:empty { display: none; }

.pr-point-chip {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    height: 32px;
    padding: 0 8px 0 12px;
    border-radius: 9px;
    background: #FFFFFF;
    font: 600 11.5px/1 inherit;
    color: var(--brand-text);
    max-width: 100%;
}

.pr-points-edit--power .pr-point-chip { border: 1px solid var(--brand-success-edge-chip); }
.pr-points-edit--weak .pr-point-chip { border: 1px solid var(--brand-discount-edge); }

.pr-point-chip__x {
    width: 18px;
    height: 18px;
    flex: none;
    border-radius: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
}

.pr-point-chip__x .pd-icon { width: 9px; height: 9px; }

.pr-points-edit--power .pr-point-chip__x {
    background: var(--brand-success-wash-badge);
    color: var(--brand-success-ink);
}

.pr-points-edit--weak .pr-point-chip__x {
    background: var(--brand-discount-wash-chip);
    color: var(--brand-discount-ink);
}

.pr-points-edit__add {
    display: flex;
    align-items: center;
    gap: 8px;
    height: 38px;
    padding: 0 12px;
    border-radius: 10px;
    background: #FFFFFF;
    margin: 0;
}

.pr-points-edit--power .pr-points-edit__add { border: 1px dashed var(--brand-success-edge-dash); }
.pr-points-edit--weak .pr-points-edit__add { border: 1px dashed var(--brand-discount-edge-chip); }

.pr-points-edit__add .pd-icon { width: 13px; height: 13px; flex: none; }
.pr-points-edit--power .pr-points-edit__add .pd-icon { color: var(--brand-success-glyph); }
.pr-points-edit--weak .pr-points-edit__add .pd-icon { color: var(--brand-discount-glyph); }

.pr-points-edit__add input {
    flex: 1;
    min-width: 0;
    border: 0;
    outline: 0;
    background: transparent;
    font: 500 11.5px/1 inherit;
    color: var(--brand-text);
}

/* ── Recommend ─────────────────────────────────────────────────────────────── */

.pr-reco {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 16px 18px;
    border-radius: var(--radius-brand-lg);
    background: var(--brand-surface-recess);
    border: 1px solid var(--brand-border);
}

.pr-reco__title {
    font: 800 12.5px/1.5 inherit;
    float: none;
}

.pr-reco__options {
    display: flex;
    gap: 10px;
}

.pr-reco__input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    margin: 0;
    pointer-events: none;
}

.pr-reco__option {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 46px;
    border-radius: 12px;
    background: var(--brand-card-face);
    border: 1px solid var(--brand-border);
    color: var(--brand-text-muted);
    font: 600 12.5px/1 inherit;
    cursor: pointer;
    margin: 0;
    text-align: center;
    transition: border-color .2s ease, color .2s ease, background .2s ease;
}

.pr-reco__option .pd-icon { width: 16px; height: 16px; flex: none; }

.pr-reco__option--yes:hover,
.pr-reco__input:checked + .pr-reco__option--yes {
    background: var(--brand-success-wash-chip);
    border: 1.5px solid var(--brand-success-edge-strong);
    color: var(--brand-success-ink-strong);
    font-weight: 700;
}

.pr-reco__option--notsure:hover,
.pr-reco__input:checked + .pr-reco__option--notsure {
    border-color: var(--brand-primary-edge);
    color: var(--brand-primary-deep);
    font-weight: 700;
}

.pr-reco__option--no:hover,
.pr-reco__input:checked + .pr-reco__option--no {
    border-color: var(--brand-discount-edge-strong);
    color: var(--brand-discount-ink);
    font-weight: 700;
}

.pr-reco__input:focus-visible + .pr-reco__option {
    outline: 2px solid var(--brand-primary-deep);
    outline-offset: 2px;
}

/* ── Photos ────────────────────────────────────────────────────────────────── */

.pr-photos {
    display: flex;
    flex-direction: column;
    gap: 11px;
}

.pr-photos__head {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.pr-photos__title { font: 800 12.5px/1.5 inherit; }

.pr-photos__count,
.pr-photos__note,
.pr-photos__foot {
    font: 500 10.5px/1.6 inherit;
    color: var(--brand-text-soft);
}

.pr-photos__note { margin-inline-start: auto; }

.pr-photos__grid {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.pr-photo {
    position: relative;
    width: 88px;
    height: 88px;
    border-radius: var(--radius-brand-cta);
    overflow: hidden;
    border: 1px solid var(--brand-primary-rule);
    background: linear-gradient(150deg, var(--brand-hatch-a), var(--brand-hatch-b));
    flex: none;
}

.pr-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.pr-photo__x {
    position: absolute;
    top: 6px;
    inset-inline-start: 6px;
    width: 22px;
    height: 22px;
    border-radius: 7px;
    background: rgba(42, 42, 40, .62);
    color: #FFFFFF;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
    backdrop-filter: blur(4px);
}

.pr-photo__x .pd-icon { width: 10px; height: 10px; }

.pr-photos__add {
    width: 88px;
    height: 88px;
    flex: none;
    border-radius: var(--radius-brand-cta);
    border: 1px dashed var(--brand-primary-edge);
    background: var(--brand-primary-band);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    cursor: pointer;
    color: var(--brand-primary-deep);
    font: 700 10.5px/1.3 inherit;
    text-align: center;
    margin: 0;
    transition: background .2s ease;
}

.pr-photos__add:hover { background: var(--brand-primary-tint); }
.pr-photos__add .pd-icon { width: 20px; height: 20px; }

.pr-photos__add:focus-within {
    outline: 2px solid var(--brand-primary-deep);
    outline-offset: 2px;
}

/* ── The anonymity toggle ──────────────────────────────────────────────────── */

.pr-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 16px;
    border-radius: var(--radius-brand-lg);
    background: var(--brand-card-face);
    border: 1px solid var(--brand-border);
    cursor: pointer;
    margin: 0;
}

.pr-toggle__text {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.pr-toggle__title { font: 700 12.5px/1.5 inherit; }

.pr-toggle__note {
    font: 500 11px/1.6 inherit;
    color: var(--brand-text-muted);
    text-wrap: pretty;
}

.pr-toggle__switch {
    flex: none;
    position: relative;
    display: block;
}

.pr-toggle__switch input[type="checkbox"] {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    margin: 0;
    cursor: pointer;
    z-index: 1;
}

.pr-toggle__switch input[type="hidden"] { display: none; }

.pr-toggle__track {
    width: 46px;
    height: 27px;
    border-radius: var(--radius-brand-lg);
    background: var(--brand-surface-recess);
    border: 1px solid var(--brand-border);
    display: flex;
    align-items: center;
    padding: 0 3px;
    transition: background .2s ease, border-color .2s ease;
}

.pr-toggle__knob {
    width: 21px;
    height: 21px;
    border-radius: 50%;
    background: #FFFFFF;
    border: 1px solid var(--brand-border);
    box-shadow: var(--brand-shadow-review-thumb);
    transition: transform .2s ease;
}

.pr-toggle__switch input[type="checkbox"]:checked ~ .pr-toggle__track {
    background: var(--brand-primary-band);
    border-color: var(--brand-primary-edge);
}

/* Logical direction: under RTL the knob travels toward the inline START, which is
   the LEFT of the screen — so a fixed `translateX(19px)` would push it out of the
   track. The negative value is correct for RTL and mirrors itself for LTR because
   the whole track is laid out by the same direction. */
.pr-toggle__switch input[type="checkbox"]:checked ~ .pr-toggle__track .pr-toggle__knob {
    transform: translateX(-19px);
}

.pr-toggle__switch input[type="checkbox"]:focus-visible ~ .pr-toggle__track {
    outline: 2px solid var(--brand-primary-deep);
    outline-offset: 2px;
}


/* =============================================================================
   SECTION 6 — STATES (board ۶)
   ============================================================================= */

/* ── ۶-الف · not signed in ─────────────────────────────────────────────────── */

.pr-signin {
    display: flex;
    align-items: center;
    gap: 22px;
    padding: 26px 28px;
    background: linear-gradient(150deg, var(--brand-primary-band), var(--brand-card-face) 68%);
    flex-wrap: wrap;
}

.pr-signin__icon {
    flex: none;
    width: 64px;
    height: 64px;
    border-radius: 19px;
    background: var(--brand-card-face);
    border: 1px solid var(--brand-primary-rule);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--brand-primary-deep);
    box-shadow: var(--brand-shadow-review-empty-icon);
}

.pr-signin__icon .pd-icon { width: 28px; height: 28px; }

.pr-signin__text {
    flex: 1;
    min-width: 200px;
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.pr-signin__title { font: 800 15px/1.5 inherit; }

.pr-signin__note {
    font: 500 12px/1.95 inherit;
    color: var(--brand-text-muted);
    text-wrap: pretty;
}

.pr-signin__actions {
    flex: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: stretch;
}

.pr-signin__hint {
    font: 500 10.5px/1.5 inherit;
    color: var(--brand-text-soft);
    text-align: center;
}

/* «بعداً» belongs to the mobile short sheet (board ۷-ت); the desktop panel already
   has a ✕ and does not need a second dismissal. */
.pr-signin__later { display: none; }

/* ── ۶-پ · validation ──────────────────────────────────────────────────────── */

.pr-errors {
    display: flex;
    gap: 12px;
    padding: 16px 22px;
    background: var(--brand-discount-wash-tint);
    border-bottom: 1px solid var(--brand-discount-edge-soft);
}

.pr-errors__icon {
    flex: none;
    width: 26px;
    height: 26px;
    border-radius: var(--radius-brand-chip);
    background: var(--brand-discount-wash-badge);
    color: var(--brand-discount-ink-strong);
    display: flex;
    align-items: center;
    justify-content: center;
}

.pr-errors__icon .pd-icon { width: 14px; height: 14px; }

.pr-errors__text {
    display: flex;
    flex-direction: column;
    gap: 5px;
    min-width: 0;
}

.pr-errors__title {
    font: 800 12.5px/1.6 inherit;
    color: var(--brand-discount-ink-strong);
}

.pr-errors__list {
    display: flex;
    flex-direction: column;
    gap: 3px;
    font: 500 11.5px/1.8 inherit;
    color: var(--brand-text-muted);
}

.pr-errors__list a {
    color: var(--brand-discount-ink);
    text-decoration: none;
}

.pr-errors__list a:hover { text-decoration: underline; }

/* The whole card takes the error frame, so the state is visible even when the
   summary has scrolled out of the sheet's viewport. */
.pr-panel__card.is-invalid {
    border-color: var(--brand-discount-edge-chip);
    box-shadow: var(--brand-shadow-review-error);
}

/* ── ۶-ب · submitting ──────────────────────────────────────────────────────── */

/* `pointer-events: none` on the body, NOT `disabled` on every control: a disabled
   control loses its value in some browsers' form serialisation, and this form is
   mid-submit — the values are exactly what must not change. */
.pr-form.is-busy .pr-form__body {
    opacity: .5;
    pointer-events: none;
}

.pr-form.is-busy .pr-btn--ghost {
    color: var(--brand-disabled-ink-soft);
    cursor: not-allowed;
}

.pr-form.is-busy .pr-cta,
.pr-cta:disabled {
    background: var(--brand-disabled-face);
    color: var(--brand-disabled-ink);
    border-color: var(--brand-border);
    box-shadow: none;
    cursor: not-allowed;
    transform: none;
}

.pr-cta__spinner { display: none; }

.pr-form.is-busy .pr-cta__spinner {
    display: block;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 2px solid var(--brand-disabled-edge);
    border-top-color: var(--brand-disabled-ink);
    animation: prSpin .8s linear infinite;
    flex: none;
}

.pr-form.is-busy .pr-cta .pd-icon { display: none; }

@keyframes prSpin {
    to { transform: rotate(360deg); }
}

/* ── ۶-ت · received, awaiting review ───────────────────────────────────────── */

.pr-sent {
    position: relative;
    border-radius: var(--radius-brand-sheet);
    background: linear-gradient(155deg, var(--brand-caption-on-dark), var(--brand-primary-band));
    border: 1px solid var(--brand-primary-rule);
    padding: 34px 30px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    overflow: hidden;
    text-align: center;
    box-shadow: var(--brand-shadow-review-success);
}

.pr-sent__dots {
    position: absolute;
    inset: 0;
    background-image: radial-gradient(var(--brand-primary-veil) 1px, transparent 1.1px);
    background-size: 20px 20px;
    opacity: .45;
    pointer-events: none;
}

.pr-sent > *:not(.pr-sent__dots) { position: relative; }

.pr-sent__medal {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: linear-gradient(145deg, var(--brand-coin-1), var(--brand-primary) 48%, var(--brand-primary-sheen));
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--brand-primary-ink);
    box-shadow: var(--brand-shadow-review-medal);
}

.pr-sent__medal .pd-icon { width: 32px; height: 32px; }

.pr-sent__title { font: 800 18px/1.5 inherit; }

.pr-sent__note {
    font: 500 12.5px/1.95 inherit;
    color: var(--brand-text-muted);
    max-width: 460px;
    text-wrap: pretty;
}

.pr-sent__sms {
    font: 500 10.5px/1.6 inherit;
    color: var(--brand-text-soft);
}

.pr-track {
    display: flex;
    align-items: center;
    margin-top: 6px;
    padding: 14px 18px;
    border-radius: 15px;
    background: var(--brand-card-face);
    border: 1px solid var(--brand-primary-rule);
}

.pr-track__step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 7px;
    width: 120px;
    position: relative;
}

/* The connector is drawn between steps rather than as a separate element, so the
   track has one node per step and nothing to keep in sync. */
.pr-track__step + .pr-track__step::before {
    content: "";
    position: absolute;
    top: 10px;
    width: 44px;
    height: 2px;
    inset-inline-start: -22px;
    background: var(--brand-border);
}

.pr-track__step.is-current::before {
    background: linear-gradient(90deg, var(--brand-primary), var(--brand-border));
}

.pr-track__dot {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--brand-surface-recess);
    border: 1.5px solid var(--brand-border);
    display: flex;
    align-items: center;
    justify-content: center;
    flex: none;
    z-index: 1;
}

.pr-track__dot .pd-icon { width: 12px; height: 12px; }

.pr-track__step.is-done .pr-track__dot {
    background: var(--brand-primary);
    border-color: var(--brand-primary);
    color: var(--brand-primary-ink);
}

.pr-track__step.is-current .pr-track__dot {
    background: var(--brand-primary-band);
    border-color: var(--brand-primary);
    animation: prPulse 1.8s ease-in-out infinite;
}

.pr-track__label {
    font: 600 11px/1.5 inherit;
    color: var(--brand-text-soft);
}

.pr-track__step.is-done .pr-track__label { font-weight: 700; color: var(--brand-text); }
.pr-track__step.is-current .pr-track__label { font-weight: 700; color: var(--brand-primary-deep); }


/* =============================================================================
   SECTION 7 — THE LIST AND ONE REVIEW CARD (board ۹)
   ============================================================================= */

.pr-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.pr-list.is-loading { opacity: .55; }

.pr-list__none {
    padding: 24px;
    text-align: center;
    font: 500 12.5px/1.9 inherit;
    color: var(--brand-text-muted);
    background: var(--brand-surface-recess);
    border: 1px dashed var(--brand-border);
    border-radius: var(--radius-brand-lg);
}

.pr-list__more {
    align-self: center;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 40px;
    padding: 0 20px;
    border-radius: 20px;
    background: transparent;
    border: 1px solid var(--brand-border);
    color: var(--brand-text-muted);
    font: 600 12px/1 inherit;
    cursor: pointer;
    transition: border-color .2s ease, color .2s ease;
}

.pr-list__more:hover {
    border-color: var(--brand-primary-edge);
    color: var(--brand-primary-deep);
}

.pr-list__more .pd-icon { width: 14px; height: 14px; }

.pr-item {
    position: relative;
    padding: 24px 26px;
    border-radius: var(--radius-brand-card-lg);
    background: var(--brand-card-face);
    border: 1px solid var(--brand-border);
}

/* The gold frame is one of board ۹'s three signals for a verified purchase — with
   the green badge and the criteria block. All three are derived from one fact. */
.pr-item--verified {
    border-color: var(--brand-primary-rule);
    box-shadow: var(--brand-shadow-review-card);
}

.pr-item__accent {
    position: absolute;
    top: 22px;
    inset-inline-end: 0;
    width: 3px;
    height: 34px;
    border-radius: 0 2px 2px 0;
    background: linear-gradient(180deg, var(--brand-primary), transparent);
}

.pr-item__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
}

.pr-item__who {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.pr-item__avatar {
    width: 44px;
    height: 44px;
    flex: none;
    border-radius: var(--radius-brand-cta);
    background: var(--brand-surface-recess);
    border: 1px solid var(--brand-border);
    display: flex;
    align-items: center;
    justify-content: center;
    font: 800 16px/1 inherit;
    color: var(--brand-text-muted);
}

.pr-item--verified .pr-item__avatar {
    background: var(--brand-primary-band);
    border-color: var(--brand-primary-rule);
    color: var(--brand-primary-deep);
}

.pr-item__avatar--anon {
    background: var(--brand-surface-recess);
    border: 1px dashed var(--brand-border);
    color: var(--brand-text-soft);
}

.pr-item__avatar--anon .pd-icon { width: 18px; height: 18px; }

.pr-item__ident {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

.pr-item__names {
    display: flex;
    align-items: center;
    gap: 9px;
    flex-wrap: wrap;
}

.pr-item__name { font: 700 13.5px/1.5 inherit; }
.pr-item__name--anon { color: var(--brand-text-muted); }

.pr-item__meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font: 500 11px/1.5 inherit;
    color: var(--brand-text-soft);
    flex-wrap: wrap;
}

.pr-item__score {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    flex: none;
}

.pr-item__reco {
    display: flex;
    align-items: center;
    gap: 6px;
    font: 700 11px/1.5 inherit;
    color: var(--brand-text-muted);
}

.pr-item__reco .pd-icon { width: 13px; height: 13px; flex: none; }
.pr-item__reco--yes { color: var(--brand-success-ink-strong); }
.pr-item__reco--no { color: var(--brand-discount-ink); }

.pr-item__title {
    display: block;
    margin: 16px 0 0;
    font: 700 14px/1.6 inherit;
}

.pr-item__body {
    margin: 8px 0 0;
    font: 500 12.5px/2.05 inherit;
    color: var(--brand-text-muted);
    text-wrap: pretty;
    white-space: pre-line;
}

.pr-item__photos {
    margin-top: 14px;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.pr-item__photo {
    position: relative;
    width: 74px;
    height: 74px;
    border-radius: var(--radius-brand-md);
    border: 1px solid var(--brand-border);
    background: linear-gradient(150deg, var(--brand-hatch-a), var(--brand-hatch-b));
    overflow: hidden;
    cursor: zoom-in;
    display: block;
    flex: none;
}

.pr-item--verified .pr-item__photo { border-color: var(--brand-primary-rule); }

.pr-item__photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.pr-item__photo-more {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(42, 42, 40, .55);
    color: #FFFFFF;
    font: 800 13px/1 inherit;
}

.pr-item__points {
    margin-top: 14px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.pr-points {
    flex: 1;
    min-width: 200px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 11px 13px;
    border-radius: 11px;
}

.pr-points--power {
    background: var(--brand-success-wash-soft);
    border: 1px solid var(--brand-success-edge);
}

.pr-points--weak {
    background: var(--brand-discount-wash);
    border: 1px solid var(--brand-discount-edge-faint);
}

.pr-points__title { font: 700 10.5px/1.5 inherit; }
.pr-points--power .pr-points__title { color: var(--brand-success-ink-strong); }
.pr-points--weak .pr-points__title { color: var(--brand-discount-ink-strong); }

.pr-points__list {
    font: 500 11.5px/1.8 inherit;
    color: var(--brand-text-muted);
}

.pr-item__dims {
    margin-top: 14px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 12px 14px;
    border-radius: var(--radius-brand-md);
    background: var(--brand-primary-band);
    border: 1px solid var(--brand-primary-rule);
}

.pr-item__dims-title {
    width: 100%;
    font: 700 10.5px/1.5 inherit;
    color: var(--brand-primary-deep);
}

.pr-dim-chip {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    height: 28px;
    padding: 0 11px;
    border-radius: var(--radius-brand-chip);
    background: var(--brand-card-face);
    border: 1px solid var(--brand-primary-rule);
    font: 600 11px/1 inherit;
    color: var(--brand-text-muted);
}

.pr-dim-chip__value {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font: 800 11px/1 inherit;
    color: var(--brand-primary-deep);
}

.pr-dim-chip__value .pd-icon { width: 11px; height: 11px; }

/* The rejected explanation, which the reference has no artboard for. */
.pr-item__rejection {
    margin-top: 14px;
    display: flex;
    gap: 10px;
    padding: 12px 14px;
    border-radius: var(--radius-brand-md);
    background: var(--brand-discount-wash);
    border: 1px solid var(--brand-discount-edge-faint);
}

.pr-item__rejection .pd-icon {
    width: 14px;
    height: 14px;
    flex: none;
    color: var(--brand-discount-ink);
    margin-top: 3px;
}

.pr-item__rejection-text {
    font: 500 11.5px/1.9 inherit;
    color: var(--brand-text-muted);
}

.pr-item__rejection-text b { color: var(--brand-discount-ink-strong); }

.pr-item__rejection-note {
    display: block;
    margin-top: 4px;
    font-size: 10.5px;
    color: var(--brand-text-soft);
}


/* =============================================================================
   SECTION 8 — MOBILE (<= 991.98px) · board ۷
   -----------------------------------------------------------------------------
   The SAME NODES become the full-screen sheet. Nothing moves in the DOM and there
   is not a single width read in product-reviews.js.

   `position: fixed` works here because .page-frame masks its corners with
   `overflow: clip`, which does NOT clip fixed descendants — the property the
   product page's own action bar already relies on. Do not add `transform`,
   `filter`, `contain` or `will-change` to .page-frame or any ancestor of this
   panel: each of them creates a containing block for fixed descendants and would
   trap the sheet inside the frame.
   ============================================================================= */

@media (max-width: 991.98px) {

    .pr { gap: 16px; }

    /* ── Summary: three columns become one ─────────────────────────────────── */
    .pr-summary {
        grid-template-columns: minmax(0, 1fr);
        gap: 18px;
        padding: 18px 16px;
        border-radius: var(--radius-brand-card);
    }

    .pr-summary__averages {
        border-inline-end: 0;
        padding-inline-end: 0;
        padding-bottom: 16px;
        border-bottom: 1px solid var(--brand-border);
    }

    .pr-avg__value b { font-size: 34px; }

    /* ── Entry ─────────────────────────────────────────────────────────────── */
    .pr-empty { padding: 28px 18px; border-radius: var(--radius-brand-card); }
    .pr-empty__cta { width: 100%; }

    .pr-bar {
        padding: 12px 14px;
        border-radius: var(--radius-brand-card);
        gap: 12px;
    }

    .pr-bar__cta { width: 100%; height: 48px; }

    /* ── THE SHEET ─────────────────────────────────────────────────────────── */
    /* Declared in the rule that also sets `display`, never in the base rule.
       `animation-fill-mode: both` fills BACKWARDS too, so an entrance declared on
       an element that is `display: none` pins it at its `from` frame forever —
       which is how the mini-cart sheet ended up permanently 102% below the fold
       (2026-08-31). Here the panel is hidden with the `hidden` ATTRIBUTE, and this
       rule only ever applies while it is visible. */
    .pr-panel {
        position: fixed;
        inset: 0;
        z-index: 1200;
        background: var(--brand-scrim-strong);
        display: flex;
        align-items: stretch;
        justify-content: center;
    }

    .pr-panel__card {
        max-width: none;
        width: 100%;
        border-radius: 0;
        border: 0;
        box-shadow: none;
        background: var(--brand-surface);
        /* The three-part sheet: a fixed head, a scrolling body and a fixed foot.
           `min-height: 0` on the middle is what actually lets it scroll — a flex
           item's default `min-height: auto` refuses to shrink below its content and
           the foot would be pushed off the bottom of the screen instead. */
        max-height: 100dvh;
        /* Declared in the rule that also flips the layout, never in the base rule —
           the 2026-08-31 mini-cart lesson.
           NO `animation-fill-mode` either, deliberately. `both` fills BACKWARDS as
           well as forwards, so an animation that never STARTS pins the element at
           its `from` frame; that is what left the mini-cart sheet 102% off-screen.
           This one does start, so `both` would also have resolved correctly here —
           dropping it is defensive, not a bug fix, and it costs nothing: with the
           default fill-mode the worst case is a single frame at the resting
           position, which for a 2% slide is imperceptible.
           ⚠ Measuring this in a THROTTLED tab is misleading. The animation reports
           playState "running" with currentTime frozen at 0, so getComputedStyle
           returns the `from` frame and the sheet appears 2% (≈16px) low with its
           footer past the fold. Call `el.getAnimations().forEach(a => a.finish())`
           before measuring, or the geometry is a reading of the first frame. */
        animation: prSheetIn .22s ease;
    }

    @keyframes prSheetIn {
        from { transform: translateY(2%); opacity: 0; }
        to { transform: none; opacity: 1; }
    }

    .pr-panel__head {
        padding: 14px 16px;
        align-items: center;
    }

    .pr-panel__avatar { width: 38px; height: 38px; border-radius: var(--radius-brand-md); }

    .pr-panel__title { font-size: 14px; }

    /* The product name earns its place here: the page behind the sheet is not
       visible, so this is the only thing saying what is being reviewed. */
    .pr-panel__product {
        display: block;
        font: 500 10px/1.4 inherit;
        color: var(--brand-text-muted);
        max-width: 200px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .pr-form {
        flex: 1;
        min-height: 0;
    }

    .pr-form__body {
        flex: 1;
        min-height: 0;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        gap: 22px;
        padding: 16px 14px;
    }

    /* The numbered rail is desktop rhythm. At 390px it costs 42px of a 350px column
       and the steps are already sequential by being stacked. */
    .pr-step__rail { display: none; }
    .pr-step { gap: 0; }

    .pr-rate {
        flex-direction: column;
        align-items: center;
        gap: 11px;
        padding: 18px 14px;
        text-align: center;
    }

    .pr-rate__legend { align-items: center; }
    .pr-rate__stars { gap: 4px; }
    .pr-rate__star { width: 46px; height: 46px; }
    .pr-rate__star .pd-icon { width: 34px; height: 34px; }

    .pr-dims {
        padding: 15px;
        min-height: 0;
        background: var(--brand-card-face);
    }

    .pr-dim { gap: 10px; padding: 7px 0; }
    .pr-dim__label { font-size: 12px; }
    .pr-dim__stars { gap: 1px; }
    .pr-dim__star { width: 30px; height: 30px; }
    .pr-dim__star .pd-icon { width: 21px; height: 21px; }

    .pr-input, .pr-textarea { background: var(--brand-card-face); }
    .pr-input { height: 48px; }
    .pr-textarea { min-height: 104px; }

    /* Two 175px columns cannot hold a chip list plus an add field. */
    .pr-pointgrid { grid-template-columns: minmax(0, 1fr); }

    .pr-reco { background: var(--brand-card-face); }
    .pr-reco__options { gap: 7px; }
    .pr-reco__option { font-size: 11.5px; gap: 5px; padding: 0 4px; }
    .pr-reco__option .pd-icon { display: none; }

    .pr-photo, .pr-photos__add { width: 74px; height: 74px; }
    .pr-photos__add .pd-icon { width: 18px; height: 18px; }
    .pr-photos__note { margin-inline-start: 0; width: 100%; }

    .pr-toggle { background: var(--brand-card-face); }
    .pr-toggle__note { display: none; }

    /* The sticky foot: one clear action, always reachable. */
    .pr-panel__foot {
        flex-direction: column;
        gap: 8px;
        padding: 12px 14px calc(16px + env(safe-area-inset-bottom));
        background: var(--brand-card-face);
        box-shadow: var(--brand-shadow-review-sheet-foot);
    }

    .pr-panel__notice { max-width: none; justify-content: center; }
    .pr-panel__notice .pd-icon,
    .pr-panel__notice-long { display: none; }
    .pr-panel__notice-short { display: block; font-size: 10.5px; color: var(--brand-text-soft); }

    .pr-panel__actions { width: 100%; }

    .pr-panel__actions .pr-cta {
        flex: 1;
        height: 52px;
        border-radius: 15px;
        font-size: 14.5px;
    }

    /* «انصراف» is redundant beside a ✕ in a full-screen sheet, and it halves the
       width of the one action that matters. */
    .pr-panel__actions .pr-btn--ghost { display: none; }

    /* ── The short sign-in sheet (board ۷-ت) ────────────────────────────────── */
    /* It does NOT fill the screen: the design deliberately leaves the product page
       visible behind it, because a signed-out visitor has typed nothing and should
       be able to see they are giving up nothing by dismissing it. */
    .pr-panel:has(.pr-signin) { align-items: flex-end; }

    .pr-panel:has(.pr-signin) .pr-panel__card {
        max-height: none;
        border-radius: var(--radius-brand-sheet-lg) var(--radius-brand-sheet-lg) 0 0;
        background: linear-gradient(160deg, var(--brand-primary-band), var(--brand-card-face) 70%);
        border-top: 1px solid var(--brand-primary-rule);
    }

    .pr-signin {
        flex-direction: column;
        text-align: center;
        gap: 13px;
        padding: 16px 18px calc(22px + env(safe-area-inset-bottom));
        background: none;
    }

    .pr-signin__icon { width: 58px; height: 58px; border-radius: var(--radius-brand-card-lg); }
    .pr-signin__text { align-items: center; min-width: 0; }
    .pr-signin__actions { width: 100%; }
    .pr-signin__actions .pr-cta { height: 52px; border-radius: 15px; font-size: 14.5px; }
    .pr-signin__later { display: inline-flex; height: 46px; border-radius: var(--radius-brand-lg); }

    /* ── States and list ───────────────────────────────────────────────────── */
    .pr-sent { padding: 26px 18px; border-radius: var(--radius-brand-card); }
    .pr-sent__title { font-size: 16px; }

    /* The track turns vertical: three 120px steps do not fit a 350px column, and
       shrinking them makes the labels illegible. */
    .pr-track {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
        width: 100%;
        padding: 16px;
    }

    .pr-track__step {
        flex-direction: row;
        align-items: center;
        gap: 9px;
        width: auto;
    }

    .pr-track__step + .pr-track__step::before {
        top: -10px;
        inset-inline-start: 10px;
        width: 1px;
        height: 12px;
    }

    .pr-item { padding: 18px 16px; border-radius: var(--radius-brand-card); }
    .pr-item__head { gap: 12px; }
    .pr-item__score { align-items: flex-start; }
    .pr-item__points { flex-direction: column; }
    .pr-points { min-width: 0; }

    .pr-mine__foot { flex-direction: column; align-items: stretch; }
    .pr-mine__note { max-width: none; }
    .pr-mine__actions { justify-content: flex-end; }
}

/* Scroll lock while the sheet is open. Written on <body> by product-reviews.js and
   only ever meaningful below the breakpoint, where the panel is fixed — on desktop
   the panel is in flow and the page must stay scrollable. */
@media (max-width: 991.98px) {
    body.pr-sheet-open {
        overflow: hidden;
    }
}


/* =============================================================================
   SECTION 9 — [hidden] RESTATEMENTS
   -----------------------------------------------------------------------------
   Preflight is disabled, so the ONLY [hidden] rule in play is the UA stylesheet's,
   and ANY author `display` declaration beats it regardless of specificity. Every
   element this feature toggles with `.hidden = true` and which also carries a
   display rule above has to be restated here or it simply never hides.
   product-detail.css and footer-redesign.css both document the same trap; it is
   easy to hit and completely silent when you do.
   ============================================================================= */

.pr-panel[hidden],
.pr-errors[hidden],
.pr-field__error[hidden],
.pr-rate__word[hidden],
.pr-list__more[hidden],
.pr-photos__add[hidden],
.pr-sent[hidden] {
    display: none !important;
}
