.sfr-reviews {
    --sfr-star-color: #fbbc05;
    --sfr-card-bg: #fff;
    --sfr-card-border: #e2e2e2;
    --sfr-text: #1f1f1f;
    --sfr-muted: #6b6b6b;
    --sfr-accent: #1a73e8;
    position: relative;
    margin: 1em 0;
    color: var(--sfr-text);
}

.sfr-reviews__disclosure {
    font-size: 0.8em;
    color: var(--sfr-muted);
    margin: 0 0 0.75em;
}

.sfr-reviews__empty {
    color: var(--sfr-muted);
    font-style: italic;
}

.sfr-review {
    background: var(--sfr-card-bg);
    border: 1px solid var(--sfr-card-border);
    border-radius: var(--sfr-radius, 8px);
    padding: 1em;
    margin: 0 0 1em;
}

/* Listing header */
.sfr-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1em;
    flex-wrap: wrap;
    padding: 0.9em 1em;
    margin: 0 0 1em;
    background: var(--sfr-card-bg);
    border: 1px solid var(--sfr-card-border);
    border-radius: var(--sfr-radius, 8px);
}

.sfr-header__name {
    display: block;
    font-size: 1.15em;
    font-weight: 700;
}

.sfr-header__rating {
    display: flex;
    align-items: center;
    gap: 0.5em;
    margin-top: 0.2em;
}

.sfr-header__grade {
    font-size: 1.3em;
    font-weight: 700;
}

.sfr-header__stars {
    color: var(--sfr-star-color);
    letter-spacing: 2px;
}

.sfr-header__count {
    color: var(--sfr-muted);
    text-decoration: none;
    font-size: 0.9em;
}

.sfr-header__actions {
    display: flex;
    gap: 0.5em;
    flex-wrap: wrap;
}

.sfr-header__button {
    display: inline-block;
    padding: 0.5em 1.1em;
    border-radius: 999px;
    border: 1px solid var(--sfr-accent);
    color: var(--sfr-accent);
    text-decoration: none;
    font-size: 0.9em;
    white-space: nowrap;
}

.sfr-header__button--rate {
    background: var(--sfr-accent);
    color: #fff;
}

.sfr-review__header {
    display: flex;
    align-items: center;
    gap: 0.6em;
}

.sfr-review__avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    flex: none;
    object-fit: cover;
}

.sfr-review__avatar--placeholder {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--sfr-accent);
    color: #fff;
    font-weight: 700;
}

.sfr-review__meta {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.sfr-review__author {
    font-weight: 600;
    text-decoration: none;
    color: inherit;
}

.sfr-review__date {
    font-size: 0.8em;
    color: var(--sfr-muted);
}

.sfr-review__stars {
    margin-left: auto;
    color: var(--sfr-star-color);
    letter-spacing: 2px;
    white-space: nowrap;
}

.sfr-review__text {
    margin-top: 0.75em;
    line-height: 1.55;
}

.sfr-review__text--clamp:not(.is-expanded) {
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.sfr-review__readmore,
.sfr-reviews__more {
    background: none;
    border: none;
    color: var(--sfr-accent);
    cursor: pointer;
    padding: 0.25em 0;
    font: inherit;
    font-size: 0.9em;
}

.sfr-reviews__more {
    display: block;
    margin: 0.5em auto;
    padding: 0.5em 1.25em;
    border: 1px solid var(--sfr-accent);
    border-radius: 999px;
}

.sfr-review__reply {
    margin: 0.75em 0 0 1.25em;
    padding: 0.6em 0.9em;
    border-left: 3px solid var(--sfr-card-border);
    background: rgba(0, 0, 0, 0.03);
    font-size: 0.92em;
}

.sfr-review__reply-label {
    font-weight: 600;
    display: block;
    margin-bottom: 0.25em;
}

.sfr-review__original summary {
    cursor: pointer;
    font-size: 0.85em;
    color: var(--sfr-muted);
}

.sfr-review__footer {
    display: flex;
    align-items: center;
    gap: 0.4em;
    margin-top: 0.75em;
    font-size: 0.82em;
}

.sfr-review__source {
    color: var(--sfr-muted);
    text-decoration: none;
}

/* Grid */
.sfr-reviews--grid .sfr-reviews__track {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1em;
}

.sfr-reviews--grid .sfr-review {
    margin: 0;
}

@media (min-width: 782px) {
    .sfr-reviews--grid.sfr-cols-1 .sfr-reviews__track { grid-template-columns: 1fr; }
    .sfr-reviews--grid.sfr-cols-2 .sfr-reviews__track { grid-template-columns: repeat(2, 1fr); }
    .sfr-reviews--grid.sfr-cols-3 .sfr-reviews__track { grid-template-columns: repeat(3, 1fr); }
    .sfr-reviews--grid.sfr-cols-4 .sfr-reviews__track { grid-template-columns: repeat(4, 1fr); }
}

/* Style variants */
.sfr-style--minimal .sfr-review,
.sfr-style--minimal .sfr-header {
    background: transparent;
    border: none;
    padding-left: 0;
    padding-right: 0;
}

.sfr-style--compact .sfr-review {
    padding: 0.6em 0.8em;
    font-size: 0.9em;
    margin-bottom: 0.6em;
}

.sfr-style--compact .sfr-review__avatar {
    width: 28px;
    height: 28px;
}

.sfr-style--compact .sfr-review__text {
    margin-top: 0.4em;
}

.sfr-style--testimonial .sfr-review {
    border: none;
    background: transparent;
    text-align: center;
    max-width: 640px;
    margin-left: auto;
    margin-right: auto;
}

.sfr-style--testimonial .sfr-review__header {
    flex-direction: column;
    gap: 0.35em;
}

.sfr-style--testimonial .sfr-review__stars {
    margin-left: 0;
}

.sfr-style--testimonial .sfr-review__text {
    font-size: 1.1em;
    font-style: italic;
}

.sfr-style--testimonial .sfr-review__footer {
    justify-content: center;
}

.sfr-style--dark .sfr-review,
.sfr-style--dark .sfr-header {
    --sfr-card-bg: #1e1e1e;
    --sfr-card-border: #3a3a3a;
    --sfr-text: #ececec;
    --sfr-muted: #a5a5a5;
    color: var(--sfr-text);
}

/* Slider dots */
.sfr-reviews__dots {
    display: flex;
    justify-content: center;
    gap: 0.4em;
    margin-top: 0.6em;
}

.sfr-reviews__dot {
    width: 9px;
    height: 9px;
    padding: 0;
    border-radius: 50%;
    border: 1px solid var(--sfr-accent);
    background: transparent;
    cursor: pointer;
}

.sfr-reviews__dot.is-active {
    background: var(--sfr-accent);
}

/* Slider */
.sfr-reviews--slider .sfr-reviews__track {
    display: flex;
    gap: 1em;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    padding-bottom: 0.25em;
}

.sfr-reviews--slider .sfr-reviews__track::-webkit-scrollbar {
    display: none;
}

.sfr-reviews--slider .sfr-review {
    flex: 0 0 min(320px, 85%);
    scroll-snap-align: start;
    margin: 0;
}

.sfr-reviews__nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 2;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid var(--sfr-card-border);
    background: var(--sfr-card-bg);
    cursor: pointer;
    font-size: 1.2em;
    line-height: 1;
}

.sfr-reviews__nav--prev { left: -12px; }
.sfr-reviews__nav--next { right: -12px; }

/* Badge */
.sfr-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.45em;
    padding: 0.4em 0.8em;
    border: 1px solid #e2e2e2;
    border-radius: 999px;
    text-decoration: none;
    color: inherit;
    font-size: 0.95em;
    background: #fff;
}

.sfr-badge__g {
    font-weight: 700;
    color: #4285f4;
}

.sfr-badge__avg {
    font-weight: 700;
}

.sfr-badge__stars {
    color: #fbbc05;
    letter-spacing: 1px;
}

.sfr-badge__count {
    color: #6b6b6b;
}

@media (prefers-reduced-motion: reduce) {
    .sfr-reviews--slider .sfr-reviews__track {
        scroll-behavior: auto;
    }
}

.sfr-reviews__body {
    position: relative;
}

/* Showcase: rating summary panel beside soft cards with relative dates */
.sfr-style--showcase {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1.5em 2em;
}

.sfr-style--showcase .sfr-reviews__body {
    flex: 999 1 420px;
    min-width: 0;
}

.sfr-summary {
    flex: 1 1 200px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.35em;
    text-align: center;
}

.sfr-summary__verdict {
    font-size: 1.6em;
    font-weight: 800;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.sfr-summary__stars {
    color: var(--sfr-star-color);
    font-size: 2.2em;
    line-height: 1;
    letter-spacing: 2px;
}

.sfr-summary__count {
    font-size: 1.05em;
}

.sfr-summary__count strong {
    font-weight: 700;
}

.sfr-summary__logo {
    font-size: 2.6em;
    font-weight: 500;
    line-height: 1.1;
    letter-spacing: -0.04em;
    text-decoration: none;
}

.sfr-g1 { color: #4285f4; }
.sfr-g2 { color: #ea4335; }
.sfr-g3 { color: #fbbc05; }
.sfr-g4 { color: #34a853; }

.sfr-summary .sfr-reviews__disclosure {
    margin: 0.4em 0 0;
}

.sfr-style--showcase .sfr-review {
    position: relative;
    isolation: isolate;
    box-sizing: border-box;
    border: none;
    border-radius: var(--sfr-radius, 14px);
    padding: 1.4em 1.4em 1.2em;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 6px 20px rgba(0, 0, 0, 0.06);
    font-size: 1.05em;
}

/* Faint dot pattern fading in from the right edge */
.sfr-style--showcase .sfr-review::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    border-radius: inherit;
    background-image: radial-gradient(rgba(0, 0, 0, 0.09) 1px, transparent 1.5px);
    background-size: 14px 14px;
    -webkit-mask-image: linear-gradient(to left, #000, transparent 70%);
    mask-image: linear-gradient(to left, #000, transparent 70%);
    pointer-events: none;
}

.sfr-style--showcase .sfr-review__header {
    flex-wrap: wrap;
    gap: 0 0.9em;
}

.sfr-style--showcase .sfr-review__header::after {
    content: "";
    flex-basis: 100%;
    order: 4;
}

.sfr-style--showcase .sfr-review__avatar { order: 1; width: 48px; height: 48px; font-size: 1.35em; font-weight: 500; }
.sfr-style--showcase .sfr-review__avatar--placeholder { background: var(--sfr-avatar-bg, var(--sfr-accent)); }
.sfr-style--showcase .sfr-review__meta { order: 2; flex: 1; }
.sfr-style--showcase .sfr-review__author { font-size: 1.05em; font-weight: 700; line-height: 1.3; }
.sfr-style--showcase .sfr-review__date { font-size: 0.92em; }

.sfr-style--showcase .sfr-review__corner {
    order: 3;
    align-self: flex-start;
    line-height: 0;
}

.sfr-style--showcase .sfr-review__corner .sfr-review__gmark {
    width: 26px;
    height: 26px;
}

.sfr-style--showcase .sfr-review__stars {
    order: 5;
    margin: 0.6em 0 0;
    font-size: 1.35em;
    line-height: 1;
    letter-spacing: 1px;
}

.sfr-style--showcase .sfr-review__check {
    order: 6;
    width: 20px;
    height: 20px;
    margin: 0.6em 0 0 -0.4em;
    align-self: center;
}

.sfr-style--showcase .sfr-review__text {
    margin-top: 0.6em;
    line-height: 1.5;
}

.sfr-style--showcase .sfr-review__readmore {
    color: var(--sfr-muted);
    margin-top: 0.6em;
}

.sfr-style--showcase .sfr-review__readmore[hidden] {
    display: none;
}

.sfr-style--showcase.sfr-reviews--slider .sfr-reviews__track {
    gap: 1em;
    padding: 0.5em 0.25em 1em;
}

.sfr-style--showcase.sfr-reviews--slider .sfr-review {
    flex: 0 0 calc((100% - 2em) / 3);
}

/* Viewport breakpoints, not container queries: inline-size containment gives
   the body zero intrinsic width, which collapses the whole widget inside
   shrink-to-fit parents such as centered Elementor flex containers. */
@media (max-width: 1024px) {
    .sfr-style--showcase.sfr-reviews--slider .sfr-review { flex-basis: calc((100% - 1em) / 2); }
}

@media (max-width: 640px) {
    .sfr-style--showcase.sfr-reviews--slider .sfr-review { flex-basis: 100%; }
    /* Edge arrows would sit off-screen on phones; swipe + dots remain. */
    .sfr-style--showcase .sfr-reviews__nav { display: none; }
}

.sfr-style--showcase .sfr-reviews__nav {
    width: 44px;
    height: 44px;
    background: #fff;
    border-color: #d5d5d5;
    color: #555;
    font-size: 1.6em;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

.sfr-style--showcase .sfr-reviews__nav--prev { left: -22px; }
.sfr-style--showcase .sfr-reviews__nav--next { right: -22px; }
