.gsr-box {
    margin-top: 32px;
    padding: 26px;
    border: 1px solid #e5e7eb;
    border-radius: 18px;
    background: linear-gradient(180deg, #ffffff 0%, #fbfbfd 100%);
    box-shadow: 0 10px 32px rgba(15, 23, 42, 0.06);
}

.gsr-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 24px;
    flex-wrap: wrap;
    margin-bottom: 18px;
}

.gsr-head-main {
    flex: 1 1 360px;
}

.gsr-title {
    margin: 0 0 6px;
    font-size: 26px;
    line-height: 1.15;
    color: #111827;
}

.gsr-subtitle {
    margin: 0;
    color: #667085;
    font-size: 14px;
}

.gsr-summary {
    min-width: 220px;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
}

.gsr-average-stars {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    line-height: 1;
}

.gsr-star-icon,
.gsr-mini-star {
    font-size: 20px;
    color: #d0d5dd;
}

.gsr-star-icon.is-full,
.gsr-mini-star.is-active {
    color: #f5b301;
}

.gsr-star-icon.is-half {
    position: relative;
    color: #d0d5dd;
}

.gsr-star-icon.is-half::before {
    content: '★';
    position: absolute;
    top: 0;
    left: 0;
    width: 50%;
    overflow: hidden;
    color: #f5b301;
}

.gsr-star-icon.is-empty {
    color: #d0d5dd;
}

.gsr-average {
    font-weight: 800;
    font-size: 24px;
    color: #111827;
}

.gsr-count,
.gsr-reviews-count {
    font-size: 14px;
    color: #667085;
}

.gsr-form-card,
.gsr-login-card {
    padding: 18px;
    border-radius: 16px;
    background: #ffffff;
    border: 1px solid #eef2f7;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.7);
}

.gsr-login-note,
.gsr-config-warning {
    margin: 0;
    color: #475467;
    font-size: 15px;
}

.gsr-stars {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}

.gsr-star {
    border: 0;
    background: transparent;
    font-size: 38px;
    line-height: 1;
    cursor: pointer;
    color: #c9c9c9;
    padding: 0;
    transition: transform 0.15s ease, color 0.15s ease;
}

.gsr-star:hover,
.gsr-star:focus {
    color: #f5b301;
    transform: translateY(-1px) scale(1.04);
    outline: none;
}

.gsr-star.is-active {
    color: #f5b301;
}

.gsr-user-row {
    margin-bottom: 14px;
}

.gsr-user-note,
.gsr-message,
.gsr-label {
    margin: 0;
    font-size: 15px;
}

.gsr-user-note,
.gsr-label {
    color: #475467;
}

.gsr-label {
    display: inline-block;
    margin-bottom: 8px;
    font-weight: 600;
}

.gsr-review-text {
    width: 100%;
    min-height: 120px;
    border: 1px solid #d0d5dd;
    border-radius: 14px;
    padding: 14px 16px;
    font-size: 15px;
    line-height: 1.6;
    background: #fff;
    color: #111827;
    resize: vertical;
    box-sizing: border-box;
}

.gsr-review-text:focus {
    outline: none;
    border-color: #98a2b3;
    box-shadow: 0 0 0 4px rgba(152, 162, 179, 0.12);
}

.gsr-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 14px;
}

.gsr-submit-button,
.gsr-delete-button {
    border: 0;
    border-radius: 999px;
    padding: 12px 18px;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.2;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.gsr-submit-button {
    background: #111827;
    color: #fff;
    box-shadow: 0 8px 18px rgba(17, 24, 39, 0.14);
}

.gsr-submit-button:hover,
.gsr-submit-button:focus {
    transform: translateY(-1px);
    outline: none;
    box-shadow: 0 10px 22px rgba(17, 24, 39, 0.18);
}

.gsr-delete-button {
    background: #f8fafc;
    color: #344054;
    border: 1px solid #d0d5dd;
}

.gsr-delete-button:hover,
.gsr-delete-button:focus {
    background: #f1f5f9;
    transform: translateY(-1px);
    outline: none;
}

.gsr-delete-button.is-hidden {
    display: none;
}

.gsr-google-button {
    margin-top: 14px;
}

.gsr-google-button > div {
    max-width: 100%;
}

.gsr-message {
    margin-top: 14px;
    min-height: 20px;
    font-weight: 600;
}

.gsr-message.is-error {
    color: #b42318;
}

.gsr-message.is-success {
    color: #027a48;
}

.gsr-reviews {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid #edf2f7;
}

.gsr-reviews-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
    margin-bottom: 14px;
}

.gsr-reviews-title {
    margin: 0;
    font-size: 20px;
    color: #111827;
}

.gsr-review-list {
    display: grid;
    gap: 14px;
}

.gsr-review-item {
    padding: 16px;
    border-radius: 16px;
    border: 1px solid #edf2f7;
    background: #ffffff;
}

.gsr-review-top {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    align-items: flex-start;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.gsr-reviewer {
    display: flex;
    align-items: center;
    gap: 12px;
}

.gsr-reviewer-avatar {
    width: 40px;
    height: 40px;
    border-radius: 999px;
    background: #111827;
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 15px;
}

.gsr-reviewer-meta {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.gsr-reviewer-name {
    font-weight: 700;
    color: #111827;
}

.gsr-review-date {
    color: #667085;
    font-size: 13px;
}

.gsr-review-rating {
    display: inline-flex;
    gap: 2px;
}

.gsr-review-text-display {
    margin: 0;
    color: #344054;
    font-size: 15px;
    line-height: 1.7;
}

.gsr-empty-reviews {
    margin: 0;
    color: #667085;
    font-size: 15px;
}

@media (max-width: 640px) {
    .gsr-box {
        padding: 20px;
    }

    .gsr-title {
        font-size: 22px;
    }

    .gsr-summary {
        align-items: flex-start;
    }

    .gsr-star {
        font-size: 34px;
    }

    .gsr-actions {
        flex-direction: column;
    }

    .gsr-submit-button,
    .gsr-delete-button {
        width: 100%;
        justify-content: center;
    }
}


/* Avada-friendly compact trust badge above featured image, with graceful fallback */
.gsr-thumbnail-badge-wrap {
    display: block;
    width: 100%;
}

.gsr-content-badge-fallback {
    margin: 0 0 16px;
}

.gsr-content-badge-fallback:empty {
    display: none;
}

.gsr-top-badge {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    margin: 0 0 16px;
    padding: 10px 14px;
    border: 1px solid #e5e7eb;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.08);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    max-width: 100%;
}

.gsr-top-badge--thumbnail {
    margin-bottom: 14px;
}

.gsr-top-badge--content-fallback {
    display: inline-flex;
}

.gsr-top-stars {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    line-height: 1;
    flex-shrink: 0;
}

.gsr-top-meta {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.gsr-top-score {
    font-weight: 800;
    font-size: 16px;
    color: #111827;
    line-height: 1.2;
}

.gsr-top-count {
    font-size: 13px;
    color: #667085;
    line-height: 1.3;
    word-break: break-word;
}

/* Better spacing with Avada blog/single layouts */
.single .fusion-post-content .gsr-content-badge-fallback,
.single-post .fusion-post-content .gsr-content-badge-fallback,
.single .post .gsr-content-badge-fallback {
    margin-top: 0;
    margin-bottom: 16px;
}

/* If the badge is successfully injected with the featured image, hide the content fallback to avoid duplicates */
body.gsr-has-thumbnail-badge .gsr-content-badge-fallback {
    display: none !important;
}

@media (max-width: 640px) {
    .gsr-top-badge {
        width: 100%;
        border-radius: 18px;
        align-items: flex-start;
    }

    .gsr-top-meta {
        flex: 1 1 auto;
    }
}
