/* Shared review surface --------------------------------------------------- */
.pdp-review-surface {
    width: 100%;
    padding: 0 0 80px;
    box-sizing: border-box;
}

body.pdp-unified-product-detail #pdp-reviews.pdp-review-surface {
    --pdp-type-section-size: var(--bj-type-section, 28px);
    --pdp-type-section-line: calc(var(--bj-type-section, 28px) * 1.35);
    --pdp-type-section-weight: var(--bj-type-section-weight, 600);
    --pdp-type-body-size: var(--bj-type-body, 16px);
    --pdp-type-body-line: calc(var(--bj-type-body, 16px) * 1.6);
    padding-bottom: 0;
}

body #pdp-reviews.pdp-review-surface > :is(
    .pdp-review-heading-row,
    .prd_review_gallery,
    .after_list_write_group,
    .pdp-global-review-preview
) {
    width: min(var(--pdp-rail-wide, 1000px), 100%) !important;
    max-width: none !important;
    margin-right: auto !important;
    margin-left: auto !important;
    box-sizing: border-box;
}

.pdp-review-heading-row {
    display: grid;
    padding: 72px 0 24px;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
    gap: 24px;
    border-bottom: 1px solid var(--pdp-lower-line, #ddd9d2);
}

.pdp-review-heading-row__copy {
    display: grid;
    width: 100% !important;
    max-width: none !important;
    min-width: 0;
    justify-self: stretch;
    text-align: left;
    box-sizing: border-box;
}

.pdp-review-heading-row .pdp-section-heading {
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 0;
    justify-self: stretch;
    border: 0;
    color: var(--pdp-lower-ink, #181817);
    text-align: left;
    font-size: var(--pdp-type-section-size, 24px);
    font-weight: var(--pdp-type-section-weight, 650);
    line-height: var(--pdp-type-section-line, 34px);
    letter-spacing: -.025em;
}

.pdp-review-heading-row__description {
    margin: 8px 0 0;
    color: var(--pdp-lower-muted, #686f78);
    font-size: var(--pdp-type-body-size, 15px);
    font-weight: 400;
    line-height: var(--pdp-type-body-line, 24px);
    letter-spacing: -.015em;
}

.pdp-review-heading-row__summary {
    display: flex;
    min-width: 0;
    margin: 18px 0 0;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px 20px;
    color: var(--pdp-lower-muted, #686f78);
    font-size: var(--pdp-type-body-size, 15px);
    line-height: var(--pdp-type-body-line, 24px);
}

.pdp-review-heading-row__summary > strong {
    color: var(--pdp-lower-ink, #181817);
    font-size: inherit;
    font-weight: 600;
    line-height: inherit;
}

.pdp-review-heading-row__rating,
.pdp-review-heading-row__all-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.pdp-review-heading-row__rating {
    color: var(--pdp-lower-ink, #181817);
    font-weight: 650;
}

.pdp-review-heading-row__rating svg {
    width: 14px;
    height: 14px;
    fill: var(--pdp-lower-accent, #745a7a);
}

.pdp-review-heading-row__all-link {
    color: var(--pdp-lower-muted, #686f78);
    font-weight: 500;
    text-decoration: none;
}

.pdp-review-heading-row__all-link strong {
    color: var(--pdp-lower-ink, #181817);
    font-weight: 650;
}

.pdp-review-heading-row__all-link:hover {
    color: var(--pdp-lower-ink, #181817);
    text-decoration: underline;
    text-underline-offset: 3px;
}

/* Block surface focus: the full-width text link underlines like hover; no box. */
.pdp-review-heading-row__all-link:focus-visible {
    color: var(--pdp-lower-ink, #181817);
    outline: none;
    text-decoration: underline;
    text-decoration-thickness: 2px;
    text-underline-offset: 4px;
}

.pdp-review-overview__actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 16px;
}

.pdp-review-overview__benefit {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: var(--pdp-lower-muted, #686f78);
    font-size: var(--pdp-type-body-size, 15px);
    font-weight: 500;
    line-height: var(--pdp-type-body-line, 24px);
    text-decoration: none;
    white-space: nowrap;
}

.pdp-review-overview__benefit svg {
    width: 17px;
    height: 17px;
    flex: 0 0 auto;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.6;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.pdp-review-overview__action {
    display: inline-flex;
    min-width: 96px;
    min-height: 42px;
    padding: 0 16px;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--pdp-lower-ink, #181817);
    border-radius: 6px;
    color: var(--pdp-lower-ink, #181817);
    background: #fff;
    font-size: var(--pdp-type-action-size, 15px);
    font-weight: var(--pdp-type-action-weight, 650);
    line-height: var(--pdp-type-action-line, 24px);
    text-decoration: none;
    box-sizing: border-box;
}

.pdp-review-surface > .prd_review_gallery {
    margin-top: 28px;
}

.pdp-review-surface > .after_list_write_group {
    display: block;
    margin-top: 20px;
}

.pdp-review-surface #after_iframe {
    display: block;
    width: 100%;
    border: 0;
}

.pdp-review-surface > .pdp-global-review-preview {
    margin-top: 32px;
}

@media (max-width: 1023px) {
    body.pdp-unified-product-detail #pdp-reviews.pdp-review-surface {
        --pdp-type-section-size: var(--bj-type-product-name, 24px);
        --pdp-type-section-line: calc(var(--bj-type-product-name, 24px) * 1.4);
    }
}

@media (max-width: 767px) {
    .pdp-review-surface {
        padding-bottom: 56px;
    }

    body #pdp-reviews.pdp-review-surface > :is(
        .pdp-review-heading-row,
        .prd_review_gallery,
        .after_list_write_group,
        .pdp-global-review-preview
    ) {
        width: calc(100% - 32px) !important;
    }

    .pdp-review-heading-row {
        padding: 48px 0 20px;
        grid-template-columns: minmax(0, 1fr);
        align-items: start;
        gap: 16px;
    }

    .pdp-review-heading-row__summary {
        margin-top: 16px;
        gap: 6px 14px;
    }

    .pdp-review-heading-row__all-link {
        flex-basis: 100%;
    }

    .pdp-review-overview__actions {
        width: 100%;
        min-height: 52px;
        padding: 0 14px;
        justify-content: space-between;
        border: 1px solid var(--pdp-lower-line, #ddd9d2);
        border-radius: 8px;
        box-sizing: border-box;
    }

    .pdp-review-surface[data-review-cap-reward="0"] .pdp-review-heading-row.is-empty .pdp-review-overview__actions {
        width: auto;
        min-height: 0;
        padding: 0;
        border: 0;
    }

    .pdp-review-overview__benefit {
        min-width: 0;
        white-space: normal;
    }

    .pdp-review-overview__action {
        min-width: 84px;
        min-height: 40px;
        flex: 0 0 auto;
    }

    .pdp-review-surface > .pdp-global-review-preview {
        margin-top: 28px;
    }
}
