/* G2Tech Stage 8.1: professional review UI aligned with light/dark theme */
:root {
    --g2-review-accent: var(--primary-color, #6777ef);
    --g2-review-star: #f5ae32;
}

body.theme-bg-light {
    --g2-review-surface: #ffffff;
    --g2-review-surface-soft: #f7f8fb;
    --g2-review-surface-muted: #f1f4f9;
    --g2-review-border: #e6eaf2;
    --g2-review-text: #232833;
    --g2-review-text-soft: #697588;
    --g2-review-shadow: 0 14px 40px rgba(20, 34, 66, .08);
}

body.theme-bg-dark {
    --g2-review-surface: #232427;
    --g2-review-surface-soft: #2a2d31;
    --g2-review-surface-muted: #2f343b;
    --g2-review-border: #3a3f46;
    --g2-review-text: #f4f5f7;
    --g2-review-text-soft: #b9c0cb;
    --g2-review-shadow: 0 18px 42px rgba(0, 0, 0, .28);
}

.g2-reviews-theme-scope,
.g2-user-reviews-page {
    color: var(--g2-review-text);
}

.g2-review-intro-card,
.g2-review-card,
.g2-review-help-card,
#add-product-review-modal .modal-content,
.g2-user-review-card,
.g2-review-empty-state {
    background: var(--g2-review-surface);
    border: 1px solid var(--g2-review-border);
    box-shadow: var(--g2-review-shadow);
}

.g2-review-intro-card {
    border-radius: 20px;
    padding: 20px 22px;
    margin-bottom: 22px;
}

.g2-review-intro-main {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    flex-wrap: wrap;
}

.g2-review-intro-eyebrow,
.g2-review-modal-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--g2-review-accent);
    font-size: 12px;
    font-weight: 700;
    margin-bottom: 8px;
}

.g2-review-intro-title {
    font-size: 24px;
    line-height: 1.6;
    font-weight: 800;
    margin: 0 0 6px;
    color: var(--g2-review-text);
}

.g2-review-intro-text,
.g2-user-reviews-header p {
    margin: 0;
    color: var(--g2-review-text-soft);
    font-size: 14px;
    line-height: 1.9;
}

.g2-review-intro-actions {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}

.g2-review-score-card {
    min-width: 132px;
    padding: 14px 16px;
    border-radius: 16px;
    background: linear-gradient(135deg, rgba(103, 119, 239, .14), rgba(103, 119, 239, .04));
    border: 1px solid rgba(103, 119, 239, .14);
    text-align: center;
}

.g2-review-score-number {
    font-size: 28px;
    line-height: 1;
    font-weight: 800;
    color: var(--g2-review-text);
    margin-bottom: 6px;
}

.g2-review-score-stars,
.g2-review-rating-summary {
    display: flex;
    align-items: center;
    gap: 3px;
    color: var(--g2-review-star);
}

.g2-review-score-stars {
    justify-content: center;
    margin-bottom: 5px;
}

.g2-review-score-card small,
.g2-review-rating-summary span {
    color: var(--g2-review-text-soft);
    font-size: 12px;
}

.g2-review-trigger-btn,
.g2-review-submit-btn {
    border-radius: 14px !important;
    min-height: 48px;
    box-shadow: 0 10px 24px rgba(103, 119, 239, .16);
}

.g2-review-list-block {
    margin-top: 10px;
}

.g2-review-list-heading {
    margin-bottom: 14px !important;
}

.g2-review-list-heading h2,
.g2-user-reviews-header h2 {
    color: var(--g2-review-text) !important;
    font-weight: 800;
}

.g2-review-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 16px;
}

.g2-review-item {
    margin: 0;
}

.g2-review-card {
    border-radius: 18px;
    padding: 18px 18px 16px;
}

.g2-review-card-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.g2-review-author {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 6px;
    color: var(--g2-review-text-soft);
}

.g2-review-author strong {
    color: var(--g2-review-text);
    font-size: 15px;
}

.g2-review-status-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 12px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
}

.g2-review-status-pill.is-positive {
    background: rgba(39, 174, 96, .14);
    color: #1c8c4e;
}

.g2-review-status-pill.is-neutral {
    background: rgba(241, 196, 15, .15);
    color: #b68800;
}

.g2-review-status-pill.is-negative {
    background: rgba(231, 76, 60, .14);
    color: #cf4336;
}

body.theme-bg-dark .g2-review-status-pill.is-positive { color: #7fe0ac; }
body.theme-bg-dark .g2-review-status-pill.is-neutral { color: #ffd86a; }
body.theme-bg-dark .g2-review-status-pill.is-negative { color: #ff8f84; }

.g2-review-body-wrap {
    border-radius: 14px;
    padding: 14px 15px;
    background: var(--g2-review-surface-soft);
    border: 1px solid var(--g2-review-border);
}

.g2-review-body,
.g2-user-review-text p {
    white-space: normal;
    overflow-wrap: anywhere;
    color: var(--g2-review-text);
    line-height: 2;
    margin: 0;
    font-size: 14px;
}

.g2-review-admin-reply {
    margin-block: 12px;
    padding: 14px 15px;
    border-inline-start: 3px solid var(--g2-review-accent);
    border-radius: 14px;
    background: linear-gradient(135deg, rgba(103,119,239,.08), rgba(103,119,239,.03));
    color: var(--g2-review-text);
}

.g2-review-admin-reply-title {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: 800;
    color: var(--g2-review-accent);
    margin-bottom: 8px;
}

.g2-review-admin-reply p {
    margin: 0;
    overflow-wrap: anywhere;
    line-height: 1.9;
}

.g2-review-footer,
.g2-user-review-footer {
    margin-top: 14px;
}

.g2-review-actions,
.g2-user-review-stats {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.g2-review-action-btn,
.g2-user-review-stats .count-like {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 38px;
    padding: 0 14px;
    border-radius: 12px;
    border: 1px solid var(--g2-review-border);
    background: var(--g2-review-surface-soft);
    color: var(--g2-review-text-soft);
    transition: .2s ease;
}

.g2-review-action-btn:hover,
.g2-user-review-stats .count-like:hover {
    color: var(--g2-review-accent);
    border-color: rgba(103, 119, 239, .3);
    background: rgba(103, 119, 239, .08);
}

.g2-review-empty-state {
    border-radius: 20px;
    padding: 38px 20px;
    text-align: center;
    margin-top: 16px;
}

.g2-review-empty-state i {
    display: inline-flex;
    width: 64px;
    height: 64px;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 30px;
    margin-bottom: 12px;
    background: rgba(103, 119, 239, .1);
    color: var(--g2-review-accent);
}

.g2-review-empty-state h4 {
    margin: 0 0 8px;
    font-size: 20px;
    font-weight: 800;
    color: var(--g2-review-text);
}

.g2-review-empty-state p {
    margin: 0;
    color: var(--g2-review-text-soft);
    line-height: 1.9;
}

/* Modal */
#add-product-review-modal .modal-content {
    border-radius: 22px;
    color: var(--g2-review-text) !important;
    background: var(--g2-review-surface) !important;
    overflow: hidden;
}

#add-product-review-modal .modal-header {
    padding: 22px 24px 0;
}

#add-product-review-modal .modal-body {
    padding: 20px 24px 24px;
}

#add-product-review-modal .modal-title {
    color: var(--g2-review-text);
    font-size: 24px;
    font-weight: 800;
}

#add-product-review-modal .close {
    color: var(--g2-review-text) !important;
    text-shadow: none;
    opacity: .85;
}

.g2-review-modal-product {
    margin-bottom: 18px;
}

#add-product-review-modal .g2-review-product-name {
    font-weight: 800;
    font-size: 18px;
    margin: 0 0 6px;
    color: var(--g2-review-text);
}

.g2-review-product-subtitle {
    margin: 0;
    color: var(--g2-review-text-soft);
}

.g2-review-modal-grid {
    align-items: stretch;
}

.g2-review-form-card,
.g2-review-help-card {
    border-radius: 18px;
    padding: 18px 18px 16px;
    height: 100%;
    background: var(--g2-review-surface-soft);
    border: 1px solid var(--g2-review-border);
}

.g2-review-help-card h3 {
    color: var(--g2-review-text);
    font-size: 18px;
    font-weight: 800;
    margin-bottom: 14px;
}

.g2-review-help-card,
.g2-review-help-card * {
    color: var(--g2-review-text-soft) !important;
}

.g2-review-help-list {
    padding: 0 18px 0 0;
    margin: 0;
}

.g2-review-help-list li {
    margin-bottom: 8px;
    line-height: 1.9;
}

#add-product-review-modal .form-row-title {
    color: var(--g2-review-text);
    font-weight: 700;
}

#add-product-review-modal .g2-review-stars-wrap {
    border-radius: 16px;
    background: var(--g2-review-surface);
    border: 1px solid var(--g2-review-border);
    padding: 16px 16px 10px;
}

#add-product-review-modal .g2-review-stars {
    display: inline-flex;
    flex-direction: row-reverse;
    justify-content: flex-end;
    align-items: center;
    gap: 4px;
    direction: ltr;
    max-width: 100%;
}

#add-product-review-modal .g2-review-stars input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
}

#add-product-review-modal .g2-review-stars label {
    font-size: 34px;
    line-height: 1;
    cursor: pointer;
    padding: 5px 3px;
    margin: 0;
    color: #a1a6ac;
    transition: color .15s ease, transform .15s ease;
}

#add-product-review-modal .g2-review-stars label:hover,
#add-product-review-modal .g2-review-stars label:hover ~ label,
#add-product-review-modal .g2-review-stars input:checked ~ label {
    color: var(--g2-review-star);
}

#add-product-review-modal .g2-review-stars input:focus-visible + label {
    outline: 2px solid var(--g2-review-accent);
    outline-offset: 3px;
    border-radius: 4px;
}

#add-product-review-modal .g2-review-stars label:hover {
    transform: scale(1.07);
}

#add-product-review-modal .g2-review-rating-help {
    display: block;
    color: var(--g2-review-text-soft);
    padding: 8px 0 0;
}

#add-product-review-modal .comments-add-col--content textarea,
#add-product-review-modal .comments-add-col--content .input-ui {
    color: var(--g2-review-text) !important;
    border-radius: 14px;
    background: var(--g2-review-surface) !important;
    border: 1px solid var(--g2-review-border) !important;
}

#add-product-review-modal .g2-review-textarea {
    min-height: 180px;
}

#add-product-review-modal .product-review-suggest {
    gap: 10px;
}

#add-product-review-modal .review-suggest-item {
    border-radius: 14px;
    overflow: hidden;
}

#add-product-review-modal .review-suggest-item label {
    min-height: 64px;
    background: var(--g2-review-surface);
    border: 1px solid var(--g2-review-border);
    border-radius: 14px;
    padding: 12px 10px;
}

#add-product-review-modal .product-review-suggest input:checked + .review-suggest-item label {
    border-color: rgba(103, 119, 239, .35);
    background: rgba(103, 119, 239, .08);
}

/* User reviews */
.g2-user-reviews-page {
    background: transparent;
}

.g2-user-reviews-header {
    margin-bottom: 14px !important;
}

.g2-user-reviews-list .row {
    margin-bottom: -4px;
}

.g2-user-review-card {
    border-radius: 18px;
    padding: 14px;
    height: 100%;
    display: flex;
    gap: 14px;
    align-items: stretch;
}

.g2-user-review-thumb {
    min-width: 116px;
    width: 116px;
    border-radius: 16px;
    background: var(--g2-review-surface-soft);
    border: 1px solid var(--g2-review-border);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.g2-user-review-thumb img {
    width: 100%;
    height: 116px;
    object-fit: contain;
    background: transparent;
}

.g2-user-review-content {
    padding: 0 !important;
    width: 100%;
}

.g2-user-review-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

.label-status-comment {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    padding: 0 12px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
}

.label-status-comment.is-accepted,
.label-status-comment:not(.is-pending):not(.is-rejected) {
    background: rgba(39, 174, 96, .14);
    color: #1c8c4e;
}

.label-status-comment.is-pending {
    background: rgba(241, 196, 15, .14);
    color: #b68800;
}

.label-status-comment.is-rejected {
    background: rgba(231, 76, 60, .14);
    color: #cf4336;
}

.g2-user-review-title h3 {
    font-size: 16px;
    line-height: 1.8;
    font-weight: 800;
    color: var(--g2-review-text);
    margin-bottom: 10px;
}

.g2-user-review-footer {
    margin-top: 12px;
}

/* Light/Dark overrides for legacy theme widgets */
body.theme-bg-light #add-product-review-modal .input-ui,
body.theme-bg-dark #add-product-review-modal .input-ui,
body.theme-bg-dark #add-product-review-modal .g2-review-help,
body.theme-bg-light #add-product-review-modal .g2-review-help {
    color: inherit !important;
}

@media (max-width: 991px) {
    .g2-user-review-card {
        flex-direction: column;
    }

    .g2-user-review-thumb {
        width: 100%;
        min-width: 100%;
        flex-direction: row;
        padding: 12px;
    }

    .g2-user-review-thumb img {
        width: 88px;
        height: 88px;
    }
}

@media (max-width: 767px) {
    #add-product-review-modal .modal-dialog {
        margin: 12px;
    }

    #add-product-review-modal .modal-header,
    #add-product-review-modal .modal-body {
        padding-inline: 16px;
    }

    #add-product-review-modal .g2-review-stars label {
        font-size: 30px;
    }

    .g2-review-intro-card,
    .g2-review-card,
    .g2-review-help-card,
    .g2-user-review-card,
    .g2-review-empty-state {
        border-radius: 16px;
    }

    .g2-review-intro-title,
    #add-product-review-modal .modal-title {
        font-size: 20px;
    }

    .g2-review-card-head,
    .g2-user-review-topbar {
        align-items: flex-start;
    }

    .g2-review-score-card {
        width: 100%;
    }
}

/* Stage 8.2: isolate the review UI from the legacy comments-area CSS.
   The default theme sets fixed white backgrounds, absolute footers and
   gray text on these same nested HTML elements. Keep this scoped. */
body.theme-bg-light .g2-reviews-theme-scope,
body.theme-bg-light .g2-user-reviews-page,
body.theme-bg-light #add-product-review-modal {
    --g2-review-surface: #fff;
    --g2-review-surface-soft: #f8f9fb;
    --g2-review-surface-muted: #f0f3f7;
    --g2-review-border: #e5e9ef;
    --g2-review-text: #252a35;
    --g2-review-text-soft: #687384;
    --g2-review-shadow: 0 8px 28px rgba(20, 32, 54, .06);
}
body.theme-bg-dark .g2-reviews-theme-scope,
body.theme-bg-dark .g2-user-reviews-page,
body.theme-bg-dark #add-product-review-modal {
    --g2-review-surface: #242629;
    --g2-review-surface-soft: #2c2f33;
    --g2-review-surface-muted: #34383e;
    --g2-review-border: #41464f;
    --g2-review-text: #f3f4f6;
    --g2-review-text-soft: #b4bfca;
    --g2-review-shadow: 0 12px 34px rgba(0, 0, 0, .20);
}

/* The theme's comment-list CSS and mobile media queries otherwise win. */
.g2-reviews-theme-scope .comments-area.g2-review-list-block {
    background: transparent !important;
    color: var(--g2-review-text) !important;
    padding: 0 !important;
    margin: 16px 0 0 !important;
    float: none !important;
    width: 100% !important;
    border: 0 !important;
    box-shadow: none !important;
}
.g2-reviews-theme-scope .comments-area ol.comment-list.g2-review-list {
    display: grid !important;
    gap: 14px !important;
    list-style: none !important;
    float: none !important;
    width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
}
.g2-reviews-theme-scope .comments-area ol.comment-list.g2-review-list > li.g2-review-item {
    padding: 0 !important;
    margin: 0 !important;
    list-style: none !important;
    width: 100%;
}
.g2-reviews-theme-scope .comments-area ol.comment-list.g2-review-list > li.g2-review-item > .comment-body.g2-review-card {
    position: relative !important;
    display: block !important;
    width: 100%;
    margin: 0 !important;
    padding: 20px 22px 16px !important;
    border: 1px solid var(--g2-review-border) !important;
    border-radius: 18px !important;
    background: var(--g2-review-surface) !important;
    color: var(--g2-review-text) !important;
    line-height: 1.85 !important;
    box-shadow: var(--g2-review-shadow) !important;
    overflow: hidden;
    transition: border-color .18s ease, box-shadow .18s ease;
}
.g2-reviews-theme-scope .comments-area ol.comment-list.g2-review-list > li.g2-review-item > .comment-body.g2-review-card:hover {
    border-color: color-mix(in srgb, var(--g2-review-accent) 28%, var(--g2-review-border)) !important;
    box-shadow: 0 10px 32px rgba(0, 0, 0, .09) !important;
}
.g2-reviews-theme-scope .comments-area .g2-review-card-head {
    align-items: center;
    margin-bottom: 14px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--g2-review-border);
}
.g2-reviews-theme-scope .comments-area .g2-review-identity {
    display: flex;
    align-items: center;
    gap: 11px;
    min-width: 0;
}
.g2-reviews-theme-scope .comments-area .g2-review-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 43px;
    height: 43px;
    width: 43px;
    border-radius: 13px;
    color: var(--g2-review-accent);
    background: var(--g2-review-surface-muted);
    font-size: 23px;
}
.g2-reviews-theme-scope .comments-area ol.comment-list .g2-review-card .comment-author.g2-review-author {
    display: flex !important;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    background: transparent !important;
    font-size: 12px !important;
    line-height: 1.75 !important;
    color: var(--g2-review-text-soft) !important;
    text-align: start;
}
.g2-reviews-theme-scope .comments-area .g2-review-author strong {
    color: var(--g2-review-text) !important;
    font-size: 14px !important;
    font-weight: 800;
}
.g2-reviews-theme-scope .comments-area .g2-review-author span {
    color: var(--g2-review-text-soft) !important;
    font-size: 12px;
}
.g2-reviews-theme-scope .comments-area .g2-review-card .g2-review-rating-summary {
    margin: 0 !important;
    font-size: 17px;
}
.g2-reviews-theme-scope .comments-area .g2-review-card .g2-review-rating-summary i,
.g2-reviews-theme-scope .comments-area .g2-review-card .g2-review-rating-summary .mdi {
    color: var(--g2-review-star) !important;
}
.g2-reviews-theme-scope .comments-area .g2-review-card .g2-review-rating-summary span {
    color: var(--g2-review-text-soft) !important;
    margin-inline-start: 7px;
}
.g2-reviews-theme-scope .comments-area .g2-review-body-wrap {
    margin: 0;
    border: 0 !important;
    padding: 0 !important;
    background: transparent !important;
}
.g2-reviews-theme-scope .comments-area ol.comment-list li .comment-body.g2-review-card p.g2-review-body {
    font-size: 14px !important;
    line-height: 2.05 !important;
    text-align: start !important;
    margin: 0 !important;
    padding: 0 !important;
    color: var(--g2-review-text) !important;
    word-break: break-word;
    overflow-wrap: anywhere;
}
.g2-reviews-theme-scope .comments-area .g2-review-admin-reply {
    margin: 16px 0 0 !important;
    padding: 14px 16px !important;
    background: var(--g2-review-surface-soft) !important;
    border: 1px solid var(--g2-review-border) !important;
    border-inline-start: 3px solid var(--g2-review-accent) !important;
    color: var(--g2-review-text) !important;
    border-radius: 12px;
}
.g2-reviews-theme-scope .comments-area .g2-review-admin-reply-title {
    color: var(--g2-review-accent) !important;
    font-size: 13px;
    margin: 0 0 5px;
}
.g2-reviews-theme-scope .comments-area ol.comment-list li .comment-body.g2-review-card .g2-review-admin-reply p {
    margin: 0 !important;
    color: var(--g2-review-text) !important;
    font-size: 13px !important;
    line-height: 1.95 !important;
    text-align: start;
}
.g2-reviews-theme-scope .comments-area ol.comment-list .footer.g2-review-footer {
    position: static !important;
    inset: auto !important;
    float: none !important;
    width: 100% !important;
    margin: 16px 0 0 !important;
    padding: 13px 0 0 !important;
    border-top: 1px solid var(--g2-review-border);
}
.g2-reviews-theme-scope .comments-area .g2-review-actions {
    display: flex !important;
    gap: 8px;
    width: auto !important;
    text-align: start !important;
}
.g2-reviews-theme-scope .comments-area .g2-review-action-btn {
    position: static !important;
    display: inline-flex !important;
    justify-content: center;
    min-width: 57px;
    height: 34px;
    padding: 0 11px !important;
    margin: 0 !important;
    border: 1px solid var(--g2-review-border) !important;
    background: var(--g2-review-surface-soft) !important;
    color: var(--g2-review-text-soft) !important;
    border-radius: 10px;
    font-size: 13px;
}
.g2-reviews-theme-scope .comments-area .g2-review-action-btn:hover,
.g2-reviews-theme-scope .comments-area .g2-review-action-btn:focus-visible {
    border-color: var(--g2-review-accent) !important;
    color: var(--g2-review-accent) !important;
}
.g2-reviews-theme-scope .comments-area .g2-review-list-heading {
    padding: 0 1px 12px;
    border-bottom: 1px solid var(--g2-review-border);
    background: transparent !important;
}
.g2-reviews-theme-scope .comments-area .g2-review-list-heading h2 {
    color: var(--g2-review-text) !important;
    font-size: 19px;
    font-weight: 800;
}
.g2-reviews-theme-scope .comments-area .g2-review-list-heading .count-comment,
.g2-reviews-theme-scope .comments-area .g2-review-list-heading .rate-product {
    color: var(--g2-review-text-soft) !important;
    font-size: 12px !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* Bootstrap's dark/forced modal rules override normal button styles. */
body.theme-bg-light #add-product-review-modal,
body.theme-bg-dark #add-product-review-modal {
    color: var(--g2-review-text);
}
#add-product-review-modal .modal-header {
    display: flex !important;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    padding: 20px 24px 8px;
}
#add-product-review-modal .modal-header > div { min-width: 0; }
#add-product-review-modal .modal-header .close.g2-review-modal-close,
#add-product-review-modal .modal-header button.g2-review-modal-close {
    float: none !important;
    position: relative !important;
    inset: auto !important;
    top: auto !important;
    left: auto !important;
    right: auto !important;
    bottom: auto !important;
    margin: 0 !important;
    padding: 0 !important;
    flex: 0 0 40px;
    width: 40px !important;
    height: 40px !important;
    line-height: 1 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 22px !important;
    border: 1px solid var(--g2-review-border) !important;
    border-radius: 12px !important;
    background: var(--g2-review-surface-soft) !important;
    color: var(--g2-review-text) !important;
    opacity: 1 !important;
    text-shadow: none !important;
    transition: color .18s ease, background-color .18s ease, border-color .18s ease;
}
#add-product-review-modal .modal-header .close.g2-review-modal-close:hover,
#add-product-review-modal .modal-header .close.g2-review-modal-close:focus-visible {
    background: var(--g2-review-surface-muted) !important;
    color: var(--g2-review-accent) !important;
    border-color: var(--g2-review-accent) !important;
}
#add-product-review-modal .modal-header .g2-review-modal-close .mdi {
    color: inherit !important;
    font-size: 22px;
}
#add-product-review-modal .modal-content,
#add-product-review-modal .modal-header,
#add-product-review-modal .modal-body {
    color: var(--g2-review-text) !important;
}
#add-product-review-modal .modal-content {
    background: var(--g2-review-surface) !important;
    border: 1px solid var(--g2-review-border) !important;
    box-shadow: var(--g2-review-shadow) !important;
}
#add-product-review-modal .modal-title,
#add-product-review-modal .g2-review-product-name {
    color: var(--g2-review-text) !important;
}
#add-product-review-modal .g2-review-product-subtitle,
#add-product-review-modal .g2-review-rating-help {
    color: var(--g2-review-text-soft) !important;
}
#add-product-review-modal .g2-review-help-card h3 {
    color: var(--g2-review-text) !important;
}
#add-product-review-modal .g2-review-help-card,
#add-product-review-modal .g2-review-form-card {
    background: var(--g2-review-surface-soft) !important;
    border-color: var(--g2-review-border) !important;
    color: var(--g2-review-text) !important;
}
#add-product-review-modal .g2-review-help-card p,
#add-product-review-modal .g2-review-help-card li {
    color: var(--g2-review-text-soft) !important;
}
#add-product-review-modal textarea.g2-review-textarea::placeholder {
    color: var(--g2-review-text-soft) !important;
    opacity: .85;
}
#add-product-review-modal textarea.g2-review-textarea:focus-visible {
    outline: 2px solid var(--g2-review-accent) !important;
    outline-offset: 2px;
}

@media (max-width: 767px) {
    .g2-reviews-theme-scope .comments-area ol.comment-list.g2-review-list > li.g2-review-item > .comment-body.g2-review-card {
        padding: 15px 15px 14px !important;
    }
    .g2-reviews-theme-scope .comments-area .g2-review-card-head {
        gap: 10px;
    }
    .g2-reviews-theme-scope .comments-area .g2-review-identity {
        gap: 8px;
    }
    .g2-reviews-theme-scope .comments-area .g2-review-avatar {
        flex-basis: 36px;
        height: 36px;
        width: 36px;
        font-size: 20px;
    }
    #add-product-review-modal .modal-header {
        padding: 16px 16px 6px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .g2-reviews-theme-scope .g2-review-card,
    #add-product-review-modal .g2-review-modal-close { transition: none !important; }
}

/* Theme-colored entry CTA: old .btn-primary-cm was transparent on some pages. */
.g2-reviews-theme-scope .g2-review-trigger-btn {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 18px !important;
    min-height: 45px;
    border: 1px solid var(--g2-review-accent) !important;
    border-radius: 12px !important;
    background: var(--g2-review-accent) !important;
    color: #fff !important;
    text-decoration: none !important;
    line-height: 1.5;
    font-weight: 700;
    box-shadow: none !important;
}
.g2-reviews-theme-scope .g2-review-trigger-btn span,
.g2-reviews-theme-scope .g2-review-trigger-btn i {
    color: #fff !important;
}
.g2-reviews-theme-scope .g2-review-trigger-btn::before {
    display: none !important;
}
.g2-reviews-theme-scope .g2-review-trigger-btn:hover,
.g2-reviews-theme-scope .g2-review-trigger-btn:focus-visible {
    filter: brightness(.92);
    transform: translateY(-1px);
}
#add-product-review-modal .review-suggest-item label,
#add-product-review-modal .review-suggest-item label p.theme-text {
    color: var(--g2-review-text) !important;
}

/* Stage 8 V4 – dedicated successful-review confirmation dialog.
   Scoped selectors override generic SweetAlert and legacy light/dark CSS. */
body.theme-bg-light .swal2-popup.g2-review-success-popup,
body.theme-bg-dark .swal2-popup.g2-review-success-popup {
    width: min(440px, calc(100vw - 28px)) !important;
    max-width: calc(100vw - 28px) !important;
    border: 1px solid var(--g2-review-border) !important;
    border-radius: 24px !important;
    background: var(--g2-review-surface) !important;
    color: var(--g2-review-text) !important;
    box-shadow: 0 24px 70px rgba(0, 0, 0, .20) !important;
    padding: 28px 26px 24px !important;
    direction: rtl;
    font-family: inherit;
}
.swal2-popup.g2-review-success-popup .swal2-html-container,
.swal2-popup.g2-review-success-popup .swal2-content {
    color: var(--g2-review-text) !important;
    margin: 0 !important;
    padding: 0 !important;
    font-size: 14px !important;
    line-height: 1.95 !important;
    text-align: center;
}
.swal2-popup.g2-review-success-popup .g2-review-success-icon {
    width: 78px;
    height: 78px;
    margin: 2px auto 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 24px;
    background: rgba(39, 174, 96, .12);
    border: 1px solid rgba(39, 174, 96, .23);
    color: #22a567 !important;
    font-size: 42px;
}
body.theme-bg-dark .swal2-popup.g2-review-success-popup .g2-review-success-icon {
    background: rgba(66, 205, 137, .14);
    border-color: rgba(66, 205, 137, .22);
    color: #64d89e !important;
}
.swal2-popup.g2-review-success-popup .g2-review-success-eyebrow {
    display: inline-block;
    padding: 3px 12px;
    border-radius: 100px;
    font-weight: 700;
    font-size: 12px;
    background: var(--g2-review-surface-soft);
    border: 1px solid var(--g2-review-border);
    color: var(--g2-review-text-soft) !important;
    margin-bottom: 12px;
}
.swal2-popup.g2-review-success-popup .g2-review-success-title {
    color: var(--g2-review-text) !important;
    margin: 0 0 10px;
    font-size: 21px !important;
    font-weight: 800;
    line-height: 1.7;
}
.swal2-popup.g2-review-success-popup .g2-review-success-text {
    color: var(--g2-review-text-soft) !important;
    margin: 0 auto 16px;
    max-width: 345px;
    font-size: 13px !important;
    line-height: 2;
}
.swal2-popup.g2-review-success-popup .g2-review-success-status {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 8px 13px;
    border-radius: 10px;
    background: var(--g2-review-surface-soft);
    color: var(--g2-review-text-soft) !important;
    border: 1px solid var(--g2-review-border);
    font-size: 12px;
    font-weight: 600;
}
.swal2-popup.g2-review-success-popup .swal2-actions {
    margin: 22px auto 0 !important;
    width: 100%;
    padding: 0 !important;
}
.swal2-popup.g2-review-success-popup button.g2-review-success-confirm {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    width: 100%;
    margin: 0 !important;
    border: none !important;
    border-radius: 12px !important;
    background: var(--g2-review-accent, #6777ef) !important;
    color: #fff !important;
    font-size: 14px !important;
    font-weight: 800;
    cursor: pointer;
    transition: filter .15s ease, transform .15s ease;
    box-shadow: 0 8px 20px rgba(55, 68, 155, .17);
}
.swal2-popup.g2-review-success-popup button.g2-review-success-confirm:hover {
    filter: brightness(.93);
    transform: translateY(-1px);
}
.swal2-popup.g2-review-success-popup button.g2-review-success-confirm:focus-visible {
    outline: 3px solid var(--g2-review-accent, #6777ef);
    outline-offset: 3px;
}
@media (max-width: 480px) {
    body.theme-bg-light .swal2-popup.g2-review-success-popup,
    body.theme-bg-dark .swal2-popup.g2-review-success-popup { padding: 22px 18px 20px !important; border-radius: 18px !important; }
    .swal2-popup.g2-review-success-popup .g2-review-success-title { font-size: 18px !important; }
}
@media (prefers-reduced-motion: reduce) {
    .swal2-popup.g2-review-success-popup button.g2-review-success-confirm { transition: none !important; }
}
