/**
 * YayReviews - Step-by-step review form (Pro).
 *
 * Every rule is scoped to .yayrev-steps--ready, which review-form-steps.js
 * adds once the steps are built, so without the script the classic form shows.
 */
.yayrev-steps--ready {
    --yayrev-steps-text: var(--yayrev-tone-text, #272829);
    --yayrev-steps-muted: var(--yayrev-tone-text-muted, #5a6d80);
    --yayrev-steps-border: var(--yayrev-tone-border, #e3e3e5);
    --yayrev-steps-surface: var(--yayrev-tone-surface, #ffffff);
    --yayrev-steps-subtle: var(--yayrev-tone-surface-muted, #f3f4f6);
    --yayrev-steps-primary: var(--yayrev-tone-primary, #111111);
    --yayrev-steps-primary-text: var(--yayrev-tone-primary-text, #ffffff);
}

.yayrev-steps--ready > .comment-notes,
.yayrev-steps--ready > .yayrev-form-subtitle {
    display: none;
}

.yayrev-steps--ready .yayrev-steps__panel[hidden],
.yayrev-steps--ready [hidden].yayrev-steps__reaction,
.yayrev-steps--ready [hidden].yayrev-steps__error,
.yayrev-steps--ready .yayrev-steps__nav [hidden] {
    display: none !important;
}

/* Progress */
.yayrev-steps__progress {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.yayrev-steps__bar {
    position: relative;
    flex: 1;
    height: 4px;
    border-radius: 999px;
    background: var(--yayrev-steps-subtle);
    overflow: hidden;
}

.yayrev-steps__bar-fill {
    position: absolute;
    inset: 0 auto 0 0;
    width: 0;
    border-radius: inherit;
    background: var(--yayrev-steps-primary);
    transition: width 180ms ease;
}

[dir="rtl"] .yayrev-steps__bar-fill {
    inset: 0 0 0 auto;
}

.yayrev-steps__count {
    flex: none;
    font-size: 13px;
    color: var(--yayrev-steps-muted);
}

/* Panels */
.yayrev-steps__panel {
    color: var(--yayrev-steps-text);
}

.yayrev-steps__panel.is-entering-forward {
    animation: yayrev-steps-in-forward 180ms ease both;
}

.yayrev-steps__panel.is-entering-back {
    animation: yayrev-steps-in-back 180ms ease both;
}

[dir="rtl"] .yayrev-steps__panel.is-entering-forward {
    animation-name: yayrev-steps-in-back;
}

[dir="rtl"] .yayrev-steps__panel.is-entering-back {
    animation-name: yayrev-steps-in-forward;
}

.yayrev-steps--no-motion .yayrev-steps__panel,
.yayrev-steps--no-motion .yayrev-steps__bar-fill {
    animation: none !important;
    transition: none !important;
}

@media (prefers-reduced-motion: reduce) {
    .yayrev-steps__panel,
    .yayrev-steps__bar-fill {
        animation: none !important;
        transition: none !important;
    }
}

@keyframes yayrev-steps-in-forward {
    from { opacity: 0; transform: translateX(16px); }
    to { opacity: 1; transform: none; }
}

@keyframes yayrev-steps-in-back {
    from { opacity: 0; transform: translateX(-16px); }
    to { opacity: 1; transform: none; }
}

.yayrev-steps__reaction {
    margin: 0 0 4px;
    font-size: 15px;
    font-weight: 600;
    color: var(--yayrev-steps-primary);
}

.yayrev-steps__heading {
    margin: 0 0 16px;
    font-size: 20px;
    line-height: 1.3;
    color: var(--yayrev-steps-text);
    outline: none;
}

.yayrev-steps__heading:focus-visible {
    outline: 2px solid var(--yayrev-steps-primary);
    outline-offset: 4px;
}

/* The fields already carry their own labels; the rating label repeats the heading */
.yayrev-steps__panel--rating .comment-form-rating > label,
.yayrev-steps__panel--rating .yayrev-form-field--rating > label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

.yayrev-steps__error {
    margin: 8px 0 0;
    font-size: 14px;
    color: #dc2626;
}

/* Summary */
.yayrev-steps__summary {
    margin-bottom: 16px;
    border: 1px solid var(--yayrev-steps-border);
    border-radius: 8px;
    background: var(--yayrev-steps-surface);
}

.yayrev-steps__summary[hidden] {
    display: none;
}

.yayrev-steps__summary-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 4px 12px;
    padding: 12px 16px;
}

.yayrev-steps__summary-row + .yayrev-steps__summary-row {
    border-top: 1px solid var(--yayrev-steps-border);
}

.yayrev-steps__summary-label {
    grid-column: 1;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--yayrev-steps-muted);
}

.yayrev-steps__summary-value {
    grid-column: 1;
    min-width: 0;
    font-size: 14px;
    overflow-wrap: anywhere;
}

.yayrev-steps__summary-title {
    display: block;
    margin-bottom: 2px;
}

.yayrev-steps__summary-excerpt {
    display: -webkit-box;
    margin: 0;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    white-space: pre-line;
}

.yayrev-steps__summary-thumbs {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.yayrev-steps__summary-thumbs img {
    width: 44px;
    height: 44px;
    border-radius: 6px;
    object-fit: cover;
}

.yayrev-steps .yayrev-steps__edit {
    grid-column: 2;
    grid-row: 1 / span 2;
    align-self: center;
    min-height: 44px;
    padding: 0 8px;
    border: 0;
    background: none;
    color: var(--yayrev-steps-primary);
    font-size: 14px;
    text-decoration: underline;
    cursor: pointer;
}

/* Navigation */
.yayrev-steps__nav {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 20px;
}

.yayrev-steps .yayrev-steps__back,
.yayrev-steps .yayrev-steps__skip {
    min-height: 44px;
    padding: 0 8px;
    border: 0;
    background: none;
    color: var(--yayrev-steps-muted);
    font-size: 14px;
    cursor: pointer;
}

.yayrev-steps .yayrev-steps__back::before {
    content: "\2190\00a0";
}

[dir="rtl"] .yayrev-steps .yayrev-steps__back::before {
    content: "\2192\00a0";
}

.yayrev-steps .yayrev-steps__skip {
    margin-inline-start: auto;
    text-decoration: underline;
}

.yayrev-steps .yayrev-steps__next {
    min-height: 44px;
    margin-inline-start: auto;
    padding: 0 24px;
    border: 0;
    border-radius: 6px;
    background: var(--yayrev-steps-primary);
    color: var(--yayrev-steps-primary-text);
    font-weight: 600;
    cursor: pointer;
}

.yayrev-steps .yayrev-steps__skip:not([hidden]) + .yayrev-steps__next {
    margin-inline-start: 0;
}

/* The form's own submit button, moved into the nav row on the last step.
   Its theme styles stay; only the full-width layout is undone. */
.yayrev-steps .yayrev-steps__nav .yayrev-steps__submit {
    width: auto !important;
    min-height: 44px;
    margin: 0 0 0 auto;
    padding-inline: 24px;
}

[dir="rtl"] .yayrev-steps .yayrev-steps__nav .yayrev-steps__submit {
    margin: 0 auto 0 0;
}

.yayrev-steps__nav > .yayrev-submit-loading {
    margin-inline-start: auto;
}

.yayrev-steps > .yayrev-form-footnote {
    margin: 8px 0 0;
    font-size: 12px;
    text-align: end;
    color: var(--yayrev-steps-muted);
}

.yayrev-steps > .yayrev-form-footnote[hidden],
.yayrev-steps__nav .yayrev-steps__submit[hidden] {
    display: none !important;
}

/* About you, logged in: the account's details, read-only, laid out like the guest fields */
.yayrev-steps--ready .yayrev-account-fields {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px 12px;
}

.yayrev-steps--ready .yayrev-account-fields__field {
    margin: 0;
    min-width: 0;
}

.yayrev-steps--ready .yayrev-account-fields__note {
    grid-column: 1 / -1;
    margin-top: -6px;
}

.yayrev-steps--ready .yayrev-account-fields input[readonly] {
    background: var(--yayrev-steps-subtle);
    color: var(--yayrev-steps-muted);
    cursor: default;
}

.yayrev-account-fields__note {
    margin: 4px 0 0;
    font-size: 13px;
    color: var(--yayrev-steps-muted, #5a6d80);
}

/* Popup and sidebar: keep the buttons in reach on small screens */
.yayrev-popup .yayrev-steps__nav,
.yayrev-sidebar .yayrev-steps__nav {
    position: sticky;
    bottom: 0;
    padding: 12px 0;
    background: var(--yayrev-steps-surface);
}

@media (max-width: 480px) {
    .yayrev-steps--ready .yayrev-account-fields {
        grid-template-columns: 1fr;
    }

    .yayrev-steps__heading {
        font-size: 18px;
    }
}
