/*
 * Brucepilot — Avis clients widgets. Mobile first, sizes in em so the
 * widgets follow the theme's type scale.
 *
 * Theme-native by default: text, font and links inherit from the theme;
 * accent and borders read the Blocksy palette (--theme-palette-color-1,
 * --theme-border-color) with warm neutral fallbacks for other themes.
 * The merchant's settings (widget.accent, star_color, font) are written
 * on each widget root as --bp-rv-accent / --bp-rv-star / --bp-rv-font and
 * win over these defaults.
 *
 * Contrast checked on a cream background (#fdf4ec): muted text 6.2:1,
 * labels 5.2:1 or more, stars 3.5:1 (graphics).
 */
.bp-reviews {
    --bp-rv-ink: 78, 56, 40;
    --bp-rv-accent-default: var(--theme-palette-color-1, #7a5236);
    --bp-rv-star-default: #a67c2e;
    --bp-rv-muted: #6b5848;
    --bp-rv-line: var(--theme-border-color, rgba(var(--bp-rv-ink), 0.16));
    --bp-rv-soft: rgba(var(--bp-rv-ink), 0.045);
    --bp-rv-track: rgba(var(--bp-rv-ink), 0.16);
    --bp-rv-star-empty: rgba(var(--bp-rv-ink), 0.24);
    --bp-rv-verified: #476345;
    --bp-rv-incentivized: #7a5a2b;
    --bp-rv-radius: 0.875em;
    font-family: var(--bp-rv-font, inherit);
    color: inherit;
    box-sizing: border-box;
}
.bp-reviews *,
.bp-reviews *::before,
.bp-reviews *::after {
    box-sizing: inherit;
}
.bp-reviews p {
    margin: 0;
}
.bp-reviews ul {
    list-style: none;
    margin: 0;
    padding: 0;
}
.bp-reviews ul > li {
    margin: 0;
}
.bp-reviews svg {
    display: inline-block;
    flex: none;
}
.bp-reviews--list,
.bp-reviews--wall,
.bp-reviews--carousel {
    display: grid;
    gap: 1.25em;
    margin: 0 0 1.5em;
}

/* Stars: an empty row and a filled row cut at the rating (inline SVG). */
.bp-rv-stars {
    position: relative;
    display: inline-block;
    flex: none;
    width: 5.5em;
    height: 1.1em;
    line-height: 1;
    vertical-align: -0.15em;
}
.bp-rv-stars--small {
    font-size: 0.875em;
}
.bp-rv-stars--large {
    font-size: 1.375em;
}
.bp-rv-stars__bg,
.bp-rv-stars__fg {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    overflow: hidden;
    white-space: nowrap;
}
.bp-rv-stars__bg {
    width: 100%;
    color: var(--bp-rv-star-empty);
}
.bp-rv-stars__fg {
    color: var(--bp-rv-star, var(--bp-rv-star-default));
}
.bp-reviews .bp-rv-stars__svg {
    display: block;
    width: 5.5em;
    max-width: none;
    height: 1.1em;
}
[dir="rtl"] .bp-rv-stars__fg {
    left: auto;
    right: 0;
}

/* Inline stars (under the title). */
.bp-rv-inline {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4em;
    margin: 0.25em 0 0.75em;
    font-size: 0.9375em;
    color: inherit;
    text-decoration: none;
}
.bp-rv-inline__average {
    font-weight: 600;
}
.bp-rv-inline__count {
    color: var(--bp-rv-muted);
}
a.bp-rv-inline .bp-rv-inline__count {
    text-decoration: underline;
    text-decoration-color: rgba(var(--bp-rv-ink), 0.3);
    text-underline-offset: 0.2em;
}
a.bp-rv-inline:hover .bp-rv-inline__count,
a.bp-rv-inline:focus-visible .bp-rv-inline__count {
    text-decoration-color: currentColor;
}
a.bp-rv-inline:focus-visible {
    outline: 2px solid var(--bp-rv-accent, var(--bp-rv-accent-default));
    outline-offset: 3px;
    border-radius: 2px;
}

/* Summary. */
.bp-rv-summary {
    display: grid;
    gap: 1.25em;
    padding: 1.25em;
    border: 1px solid var(--bp-rv-line);
    border-radius: var(--bp-rv-radius);
    background: var(--bp-rv-soft);
}
.bp-rv-summary__score {
    display: grid;
    justify-items: start;
    gap: 0.35em;
}
.bp-rv-summary__average {
    font-size: 2.5em;
    font-weight: 600;
    line-height: 1;
    letter-spacing: -0.01em;
}
.bp-rv-summary__max {
    margin-left: 0.1em;
    font-size: 0.4em;
    font-weight: 400;
    color: var(--bp-rv-muted);
}
.bp-rv-summary__count {
    color: var(--bp-rv-muted);
    font-size: 0.875em;
}
.bp-rv-bars {
    display: grid;
    gap: 0.45em;
}
.bp-rv-bars__row {
    display: grid;
    grid-template-columns: 4.75em 1fr 4.5em;
    align-items: center;
    gap: 0.6em;
    font-size: 0.8125em;
}
.bp-rv-bars__stars {
    white-space: nowrap;
}
.bp-rv-bars__track {
    height: 0.5em;
    border-radius: 999px;
    background: var(--bp-rv-track);
    overflow: hidden;
}
.bp-rv-bars__fill {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: var(--bp-rv-star, var(--bp-rv-star-default));
}
.bp-rv-bars__count {
    text-align: right;
    color: var(--bp-rv-muted);
    white-space: nowrap;
}

/* Review card. */
.bp-rv-list {
    display: grid;
    gap: 0.875em;
}
.bp-rv-review__card {
    display: grid;
    /* Carrousel : les cartes ont la hauteur de la plus longue ; le contenu reste en haut. */
    align-content: start;
    gap: 0.6em;
    padding: 1.25em;
    border: 1px solid var(--bp-rv-line);
    border-radius: var(--bp-rv-radius);
    background: transparent;
}
.bp-rv-review--pinned .bp-rv-review__card {
    border-color: var(--bp-rv-accent, var(--bp-rv-accent-default));
}
.bp-rv-review[tabindex="-1"]:focus {
    outline: none;
}
.bp-rv-review[tabindex="-1"]:focus-visible .bp-rv-review__card {
    outline: 2px solid var(--bp-rv-accent, var(--bp-rv-accent-default));
    outline-offset: 2px;
}
.bp-rv-review__head {
    display: grid;
    gap: 0.4em;
}
.bp-rv-review__title {
    font-weight: 600;
    font-size: 1.0625em;
    line-height: 1.35;
}
.bp-rv-review__meta {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    font-size: 0.8125em;
    color: var(--bp-rv-muted);
}
.bp-rv-review__author {
    font-weight: 600;
}
.bp-rv-review__sep {
    margin: 0 0.4em;
}
.bp-rv-review__labels {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4em;
}
/* Legal labels: discreet, always readable (thin outline, soft tint). */
.bp-rv-label {
    display: inline-flex;
    align-items: center;
    gap: 0.3em;
    padding: 0.15em 0.65em;
    border: 1px solid currentColor;
    border-radius: 999px;
    font-size: 0.75em;
    font-weight: 500;
    line-height: 1.6;
    letter-spacing: 0.01em;
}
.bp-reviews .bp-rv-label__icon {
    width: 1em;
    height: 1em;
}
.bp-rv-label--verified {
    color: var(--bp-rv-verified);
    border-color: rgba(71, 99, 69, 0.35);
    background: rgba(71, 99, 69, 0.07);
}
.bp-rv-label--incentivized {
    color: var(--bp-rv-incentivized);
    border-color: rgba(122, 90, 43, 0.35);
    background: rgba(122, 90, 43, 0.07);
    cursor: help;
}
.bp-rv-review__product {
    font-size: 0.8125em;
    color: var(--bp-rv-muted);
    font-style: italic;
}
.bp-rv-review__body {
    line-height: 1.6;
    overflow-wrap: anywhere;
}

/* Photos. */
.bp-rv-photos {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4em;
}
.bp-rv-photo {
    display: block;
    width: 4.5em;
    height: 4.5em;
    border-radius: 0.5em;
    overflow: hidden;
    line-height: 0;
    background: var(--bp-rv-soft);
}
.bp-rv-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.25s ease;
}
.bp-rv-photo:hover img {
    transform: scale(1.04);
}
.bp-rv-photo:focus-visible {
    outline: 2px solid var(--bp-rv-accent, var(--bp-rv-accent-default));
    outline-offset: 2px;
}

/* Merchant reply. */
.bp-rv-reply {
    display: grid;
    gap: 0.3em;
    margin-top: 0.25em;
    padding: 0.75em 0.9em;
    border-left: 2px solid var(--bp-rv-accent, var(--bp-rv-accent-default));
    border-radius: 0 0.5em 0.5em 0;
    background: var(--bp-rv-soft);
    font-size: 0.875em;
}
.bp-rv-reply__head {
    font-weight: 600;
    font-size: 0.9286em;
}
.bp-rv-reply__head time {
    font-weight: 400;
    color: var(--bp-rv-muted);
}
.bp-rv-reply__text {
    line-height: 1.55;
    overflow-wrap: anywhere;
}

/* Show more. */
.bp-rv-more-wrap {
    text-align: center;
}
.bp-rv-more {
    appearance: none;
    padding: 0.7em 1.6em;
    border: 1px solid var(--bp-rv-accent, var(--bp-rv-accent-default));
    border-radius: 999px;
    background: transparent;
    color: var(--bp-rv-accent, var(--bp-rv-accent-default));
    font: inherit;
    font-size: 0.9375em;
    letter-spacing: 0.02em;
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease;
}
.bp-rv-more:hover,
.bp-rv-more:focus-visible {
    background: var(--bp-rv-accent, var(--bp-rv-accent-default));
    color: #fff;
}
.bp-rv-more:focus-visible {
    outline: 2px solid var(--bp-rv-accent, var(--bp-rv-accent-default));
    outline-offset: 2px;
}
.bp-rv-more[disabled] {
    opacity: 0.6;
    cursor: progress;
}
.bp-rv-error {
    margin-top: 0.5em !important;
    color: #9b2c1f;
    font-size: 0.875em;
}
.bp-rv-empty {
    color: var(--bp-rv-muted);
}

/* No review yet. */
.bp-rv-empty-state {
    display: grid;
    justify-items: center;
    gap: 0.4em;
    max-width: 32em;
    margin: 0 auto;
    padding: 1.75em 1.25em;
    border: 1px dashed var(--bp-rv-line);
    border-radius: var(--bp-rv-radius);
    text-align: center;
}
.bp-rv-empty-state__icon {
    color: var(--bp-rv-star, var(--bp-rv-star-default));
}
.bp-reviews .bp-rv-empty-state__icon svg {
    width: 1.6em;
    height: 1.6em;
}
.bp-rv-empty-state__title {
    font-weight: 600;
    font-size: 1.0625em;
}
.bp-rv-empty-state__text {
    color: var(--bp-rv-muted);
    font-size: 0.875em;
    line-height: 1.55;
}

/* Control policy (legal disclosure). */
.bp-rv-policy {
    font-size: 0.8125em;
    color: var(--bp-rv-muted);
}
.bp-rv-policy__summary {
    cursor: pointer;
    text-decoration: underline;
    text-decoration-color: rgba(var(--bp-rv-ink), 0.35);
    text-underline-offset: 0.2em;
}
.bp-rv-policy__summary:hover {
    text-decoration-color: currentColor;
}
.bp-rv-policy__text {
    margin-top: 0.6em;
    padding: 0.9em 1em;
    border-radius: 0.5em;
    background: var(--bp-rv-soft);
    line-height: 1.55;
    color: inherit;
}

/* Wall: columns, cards keep together. */
.bp-rv-wall {
    columns: 1;
    column-gap: 0.875em;
}
.bp-reviews .bp-rv-wall > li {
    break-inside: avoid;
    margin-bottom: 0.875em;
}

/* Carousel: scroll-snap track. */
.bp-rv-carousel__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75em;
}
.bp-rv-carousel__score {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4em;
    font-size: 0.9375em;
}
.bp-rv-carousel__score > span:last-child {
    color: var(--bp-rv-muted);
}
.bp-rv-carousel__nav {
    display: flex;
    gap: 0.4em;
}
.bp-rv-carousel__btn {
    appearance: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.5em;
    height: 2.5em;
    padding: 0;
    border: 1px solid var(--bp-rv-line);
    border-radius: 50%;
    background: transparent;
    color: inherit;
    line-height: 1;
    cursor: pointer;
    transition: border-color 0.2s ease, color 0.2s ease;
}
.bp-reviews .bp-rv-carousel__btn svg {
    width: 1em;
    height: 1em;
}
.bp-rv-carousel__btn:hover:not([disabled]),
.bp-rv-carousel__btn:focus-visible {
    border-color: var(--bp-rv-accent, var(--bp-rv-accent-default));
    color: var(--bp-rv-accent, var(--bp-rv-accent-default));
}
.bp-rv-carousel__btn[disabled] {
    opacity: 0.35;
    cursor: default;
}
.bp-rv-track {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: 85%;
    gap: 0.875em;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    scrollbar-width: thin;
    padding-bottom: 0.4em;
}
.bp-rv-track > li {
    scroll-snap-align: start;
}
.bp-rv-track > li > .bp-rv-review__card {
    height: 100%;
}
.bp-rv-track:focus-visible {
    outline: 2px solid var(--bp-rv-accent, var(--bp-rv-accent-default));
    outline-offset: 2px;
}

/* Badge. */
.bp-reviews--badge {
    display: inline-grid;
    gap: 0.5em;
}
.bp-rv-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.9em;
    padding: 0.85em 1.1em;
    border: 1px solid var(--bp-rv-line);
    border-radius: var(--bp-rv-radius);
    background: var(--bp-rv-soft);
    color: inherit;
    text-decoration: none;
}
.bp-rv-badge--link {
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.bp-rv-badge--link:hover,
.bp-rv-badge--link:focus-visible {
    border-color: var(--bp-rv-accent, var(--bp-rv-accent-default));
    box-shadow: 0 0.25em 1em rgba(var(--bp-rv-ink), 0.08);
    color: inherit;
}
.bp-rv-badge--link:focus-visible {
    outline: 2px solid var(--bp-rv-accent, var(--bp-rv-accent-default));
    outline-offset: 2px;
}
.bp-rv-badge__average {
    font-size: 2em;
    font-weight: 600;
    line-height: 1;
    letter-spacing: -0.01em;
}
.bp-rv-badge__max {
    margin-left: 0.1em;
    font-size: 0.45em;
    font-weight: 400;
    color: var(--bp-rv-muted);
}
.bp-rv-badge__side {
    display: grid;
    gap: 0.2em;
}
.bp-rv-badge__count {
    font-size: 0.875em;
    font-weight: 600;
}
.bp-rv-badge__note {
    font-size: 0.75em;
    color: var(--bp-rv-muted);
}
.bp-rv-badge__arrow {
    color: var(--bp-rv-muted);
}
.bp-reviews .bp-rv-badge__arrow svg {
    width: 1em;
    height: 1em;
}

/* Lightbox (created by reviews.js, kept by WP Rocket's safelist). */
.bp-rv-lightbox {
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1em;
    background: rgba(30, 22, 16, 0.88);
}
.bp-rv-lightbox img {
    max-width: 100%;
    max-height: 90vh;
    border-radius: 0.5em;
    object-fit: contain;
}
.bp-rv-lightbox__close {
    position: absolute;
    top: 0.75em;
    right: 0.75em;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.75em;
    height: 2.75em;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.16);
    color: #fff;
    line-height: 1;
    cursor: pointer;
}
.bp-rv-lightbox__close:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 2px;
}

@media (min-width: 600px) {
    .bp-rv-summary {
        grid-template-columns: auto 1fr;
        align-items: center;
        gap: 2em;
        padding: 1.5em 1.75em;
    }
    .bp-rv-wall {
        columns: 2;
    }
    .bp-rv-track {
        grid-auto-columns: calc((100% - 0.875em) / 2);
    }
}
@media (min-width: 960px) {
    .bp-rv-wall {
        columns: 3;
    }
    .bp-rv-track {
        grid-auto-columns: calc((100% - 1.75em) / 3);
    }
}
@media (prefers-reduced-motion: reduce) {
    .bp-rv-track {
        scroll-behavior: auto;
    }
    .bp-rv-photo img,
    .bp-rv-more,
    .bp-rv-badge--link,
    .bp-rv-carousel__btn {
        transition: none;
    }
    .bp-rv-photo:hover img {
        transform: none;
    }
}
