﻿/* HPFY product reviews + questions & answers (replacement for ResellerRatings).
   Loaded from _Layout.cshtml when appSettings HpfyReviews.Enabled = true. The same file on every store;
   a store's colours come from hpfy-reviews-theme.css, linked after this file (HPFY has none: these defaults are HPFY's). Every class starts with "hpfy-".
   The site's Bootstrap / theme styles legend, label, h3, h4, p, button and lists globally, so the parts below reset
   those inside .hpfy-rv / .hpfy-rv-dialog. Hidden things use the class "is-off" (not the hidden attribute, which the
   theme overrides). */

:root {
    --hpfy-green: #4F8324;
    --hpfy-green-dark: #3F6B1C;
    --hpfy-green-soft: #EDF4E6;
    --hpfy-blue: #025685;
    --hpfy-blue-soft: #E8F1F7;
    --hpfy-amber: #FF9B29;
    --hpfy-ink: #2F353B;
    --hpfy-slate: #3E454C;
    --hpfy-muted: #69727B;
    --hpfy-line: #E1E6DE;
    --hpfy-surface: #F4F7F1;
    --hpfy-red: #C42B1C;
    /* tints that follow the brand colours (a store theme file, hpfy-reviews-theme.css, can override any of these) */
    --hpfy-green-ink: #2E5214;
    --hpfy-green-ring: rgba(79, 131, 36, .15);
    --hpfy-blue-ring: rgba(2, 86, 133, .15);
    --hpfy-quiet-line: #C9D6BE;
    --hpfy-badge-line: #BCD3E2;
    --hpfy-field-line: #CBD3C6;
    --hpfy-chip-line: #D3DACE;
    --hpfy-track: #DDE3D8;
    --hpfy-star-off: #D9DDD6;
    --hpfy-placeholder: #9AA29A;
    --hpfy-tone0-bg: #E3EED9;
    --hpfy-tone0-ink: #3F6B1C;
    --hpfy-tone1-bg: #DCEAF3;
    --hpfy-tone1-ink: #024A73;
    /* "done / verified" marks: the brand colour, unless it reads as a warning (Rehab Store's red) */
    --hpfy-ok: var(--hpfy-green);
    --hpfy-ok-ink: var(--hpfy-green-dark);
    --hpfy-ok-soft: var(--hpfy-green-soft);
}

/* ---------------------------------------------------------------- stars (pure CSS, used everywhere) */
.hpfy-stars { position: relative; display: inline-block; vertical-align: middle; line-height: 1; white-space: nowrap;
    font-family: Arial, "Segoe UI Symbol", sans-serif; font-size: 16px; letter-spacing: 1px; color: var(--hpfy-star-off); }
.hpfy-stars::before { content: "\2605\2605\2605\2605\2605"; }
.hpfy-stars__fill { position: absolute; top: 0; left: 0; overflow: hidden; color: var(--hpfy-amber); }
.hpfy-stars__fill::before { content: "\2605\2605\2605\2605\2605"; }
.hpfy-stars--sm { font-size: 14px; }
.hpfy-stars--md { font-size: 18px; }
.hpfy-stars--lg { font-size: 24px; letter-spacing: 2px; }

/* listing / product boxes / quick view */
.hpfy-stars-badge { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; color: var(--hpfy-slate); }
.hpfy-stars-badge__count { color: var(--hpfy-muted); }
.hpfy-stars-badge--none { visibility: hidden; }

/* ---------------------------------------------------------------- summary under the product title */
.hpfy-top { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; font-size: 14px; line-height: 1.4; color: var(--hpfy-slate); }
.hpfy-top a { text-decoration: none; }
.hpfy-top__score { display: inline-flex; align-items: center; gap: 6px; color: inherit; }
.hpfy-top__avg { font-weight: 600; color: var(--hpfy-ink); }
.hpfy-top__link { color: var(--hpfy-blue); }
.hpfy-top a:hover .hpfy-top__link, a.hpfy-top__link:hover { text-decoration: underline; }
.hpfy-top__sep { width: 1px; height: 14px; background: var(--hpfy-line); }

/* ---------------------------------------------------------------- scoped resets */
.hpfy-rv, .hpfy-rv-dialog { color: var(--hpfy-slate); font-size: 15px; line-height: 1.55; text-align: left; }
.hpfy-rv *, .hpfy-rv-dialog * { box-sizing: border-box; }
.hpfy-rv p, .hpfy-rv-dialog p { margin: 0; }
.hpfy-rv h3, .hpfy-rv h4, .hpfy-rv-dialog h3 { margin: 0; padding: 0; font-family: inherit; color: var(--hpfy-ink); text-transform: none; letter-spacing: 0; }
.hpfy-rv ol, .hpfy-rv ul { list-style: none; margin: 0; padding: 0; }
.hpfy-rv li { margin: 0; }
.hpfy-rv button, .hpfy-rv-dialog button { font-family: inherit; text-transform: none; letter-spacing: 0; box-shadow: none; }
.hpfy-rv-dialog fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
.hpfy-rv-dialog legend, .hpfy-rv label, .hpfy-rv-dialog label { float: none; width: auto; margin: 0; padding: 0; border: 0;
    font-family: inherit; font-size: 14px; font-weight: 600; line-height: 1.4; color: var(--hpfy-ink); text-transform: none; }
.hpfy-rv .is-off, .hpfy-rv-dialog .is-off, .hpfy-rv-pane.is-off, .hpfy-rv-chip.is-off, .hpfy-rv-note.is-off { display: none !important; }
.hpfy-rv-sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.hpfy-rv-trap { position: absolute !important; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.hpfy-rv-muted { color: var(--hpfy-muted); font-weight: 400; }
.hpfy-rv-small { font-size: 13px; }
.hpfy-rv :focus-visible, .hpfy-rv-dialog :focus-visible { outline: 2px solid var(--hpfy-blue); outline-offset: 2px; }

/* ---------------------------------------------------------------- buttons */
.hpfy-rv-btn { display: inline-flex; align-items: center; justify-content: center; min-height: 42px; padding: 0 20px; margin: 0;
    border: 1px solid var(--hpfy-green); border-radius: 8px; background: var(--hpfy-green); color: #fff;
    font-size: 15px; font-weight: 600; line-height: 1.2; cursor: pointer; white-space: nowrap; transition: background-color .15s, border-color .15s; }
.hpfy-rv-btn:hover { background: var(--hpfy-green-dark); border-color: var(--hpfy-green-dark); color: #fff; }
.hpfy-rv-btn[disabled] { opacity: .6; cursor: default; }
.hpfy-rv-btn--quiet { background: #fff; color: var(--hpfy-green-dark); border-color: var(--hpfy-quiet-line); }
.hpfy-rv-btn--quiet:hover { background: var(--hpfy-green-soft); color: var(--hpfy-green-dark); border-color: var(--hpfy-green); }
.hpfy-rv-btn--wide { width: 100%; }
.hpfy-rv-link { padding: 0; margin: 0; border: 0; background: none; color: var(--hpfy-blue); font-size: 14px; font-weight: 600; cursor: pointer; }
.hpfy-rv-link:hover { text-decoration: underline; }

/* ---------------------------------------------------------------- inner tabs */
.hpfy-rv { margin: 4px 0 28px; }
.hpfy-rv-tabs { display: flex; gap: 28px; border-bottom: 1px solid var(--hpfy-line); margin-bottom: 24px; overflow-x: auto; scrollbar-width: none; }
.hpfy-rv-tab { position: relative; display: inline-flex; align-items: center; gap: 8px; padding: 12px 0 14px; margin: 0; border: 0; background: none;
    color: var(--hpfy-muted); font-size: 16px; font-weight: 500; white-space: nowrap; cursor: pointer; }
.hpfy-rv-tab::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 3px; border-radius: 3px 3px 0 0; background: transparent; }
.hpfy-rv-tab:hover { color: var(--hpfy-ink); }
.hpfy-rv-tab.is-on { color: var(--hpfy-ink); font-weight: 600; }
.hpfy-rv-tab.is-on::after { background: var(--hpfy-green); }
.hpfy-rv-tab__n { min-width: 26px; padding: 1px 8px; border-radius: 999px; background: var(--hpfy-surface); color: var(--hpfy-slate);
    font-size: 13px; font-weight: 600; text-align: center; }
.hpfy-rv-tab.is-on .hpfy-rv-tab__n { background: var(--hpfy-green-soft); color: var(--hpfy-green-dark); }

/* ---------------------------------------------------------------- review overview: score | bars | action */
.hpfy-rv-overview { display: grid; grid-template-columns: minmax(200px, 240px) minmax(260px, 1fr) minmax(200px, 240px); gap: 24px 40px;
    align-items: center; padding: 24px 28px; border-radius: 14px; background: var(--hpfy-surface); }
.hpfy-rv-overview--empty { grid-template-columns: 1fr minmax(200px, 240px); }
.hpfy-rv-score { display: flex; align-items: center; gap: 14px; }
.hpfy-rv-score__num { font-size: 52px; font-weight: 600; line-height: 1; color: var(--hpfy-ink); letter-spacing: -1px; }
.hpfy-rv-score__based { margin-top: 6px; font-size: 14px; color: var(--hpfy-muted); }
.hpfy-rv-score__emptytitle { font-size: 20px; font-weight: 600; color: var(--hpfy-ink); margin-bottom: 4px; }

.hpfy-rv-bars { display: flex; flex-direction: column; gap: 2px; }
.hpfy-rv-bar { display: grid; grid-template-columns: 34px 1fr 42px 44px; align-items: center; gap: 10px; width: 100%; padding: 4px 8px; margin: 0;
    border: 0; border-radius: 6px; background: none; color: inherit; font-size: 14px; cursor: pointer; text-align: left; }
.hpfy-rv-bar:hover:not([disabled]) { background: rgba(255, 255, 255, .8); }
.hpfy-rv-bar[disabled] { cursor: default; opacity: .5; }
.hpfy-rv-bar__label { display: inline-flex; align-items: center; gap: 3px; font-weight: 600; color: var(--hpfy-ink); }
.hpfy-rv-bar__star::before { content: "\2605"; color: var(--hpfy-amber); font-family: Arial, sans-serif; font-size: 13px; }
.hpfy-rv-bar__track { height: 8px; border-radius: 8px; background: var(--hpfy-track); overflow: hidden; }
.hpfy-rv-bar__fill { display: block; height: 100%; border-radius: 8px; background: var(--hpfy-amber); }
.hpfy-rv-bar__pct { font-weight: 600; color: var(--hpfy-ink); text-align: right; }
.hpfy-rv-bar__n { color: var(--hpfy-muted); text-align: right; font-size: 13px; }
.hpfy-rv-bars.has-filter .hpfy-rv-bar:not(.is-on) { opacity: .5; }
.hpfy-rv-bar.is-on { background: #fff; box-shadow: inset 0 0 0 1.5px var(--hpfy-green); }

.hpfy-rv-cta { display: flex; flex-direction: column; gap: 14px; }
.hpfy-rv-facts { display: flex; flex-direction: column; gap: 6px; font-size: 14px; }
.hpfy-rv-facts li { display: flex; align-items: center; gap: 8px; }
.hpfy-rv-facts strong { color: var(--hpfy-ink); }

/* check mark (drawn, so it matches whatever font the site uses) */
.hpfy-rv-check { flex: none; display: inline-block; width: 16px; height: 16px; border-radius: 50%; background: var(--hpfy-ok); position: relative; vertical-align: -3px; }
.hpfy-rv-check::after { content: ""; position: absolute; left: 5.5px; top: 3px; width: 4px; height: 7.5px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg); }

/* status line after sending a review / question */
.hpfy-rv-note { display: flex; gap: 10px; align-items: flex-start; margin: 16px 0 0; padding: 12px 16px; border-radius: 10px;
    background: var(--hpfy-green-soft); color: var(--hpfy-green-ink); font-size: 14px; font-weight: 500; outline: none; }
.hpfy-rv-note--warn { background: #FFF4E5; color: #7A4A00; }

/* ---------------------------------------------------------------- toolbar */
.hpfy-rv-toolbar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px 16px; padding: 22px 0 14px;
    border-bottom: 1px solid var(--hpfy-line); }
.hpfy-rv-toolbar__left { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.hpfy-rv-showing { font-size: 14px; color: var(--hpfy-muted); }
.hpfy-rv-chip { display: inline-flex; align-items: center; gap: 4px; padding: 3px 4px 3px 12px; border-radius: 999px; background: var(--hpfy-green-soft);
    color: var(--hpfy-green-dark); font-size: 13px; font-weight: 600; }
.hpfy-rv-chip__x { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; padding: 0; margin: 0; border: 0;
    border-radius: 50%; background: transparent; color: inherit; font-size: 17px; line-height: 1; cursor: pointer; }
.hpfy-rv-chip__x:hover { background: var(--hpfy-green-ring); }
.hpfy-rv-sort { display: inline-flex !important; align-items: center; gap: 8px; font-weight: 400 !important; color: var(--hpfy-muted) !important; }
.hpfy-rv-select { height: 38px; min-width: 170px; padding: 0 34px 0 12px; margin: 0; border: 1px solid var(--hpfy-field-line); border-radius: 8px; color: var(--hpfy-ink);
    font-family: inherit; font-size: 14px; cursor: pointer; -webkit-appearance: none; appearance: none;
    background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%233E454C' stroke-width='1.6'/%3E%3C/svg%3E") no-repeat right 12px center; }

/* ---------------------------------------------------------------- review list */
.hpfy-rv-list.is-loading, .hpfy-qa-list.is-loading { opacity: .45; pointer-events: none; transition: opacity .15s; }
.hpfy-rv .hpfy-rv-item { display: grid; grid-template-columns: 44px 1fr; gap: 16px; padding: 24px 0; border-bottom: 1px solid var(--hpfy-line); }
.hpfy-rv-avatar { display: flex; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: 50%; font-size: 17px; font-weight: 600; }
.hpfy-rv-avatar--t0 { background: var(--hpfy-tone0-bg); color: var(--hpfy-tone0-ink); }
.hpfy-rv-avatar--t1 { background: var(--hpfy-tone1-bg); color: var(--hpfy-tone1-ink); }
.hpfy-rv-avatar--t2 { background: #FDEBD3; color: #8A4B00; }
.hpfy-rv-avatar--t3 { background: #E7E9EC; color: #3E454C; }
.hpfy-rv-item__main { min-width: 0; }
.hpfy-rv-item__who { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; font-size: 14px; }
.hpfy-rv-item__name { font-weight: 600; color: var(--hpfy-ink); }
.hpfy-rv-item__loc { color: var(--hpfy-muted); }
.hpfy-rv-verified { display: inline-flex; align-items: center; gap: 5px; color: var(--hpfy-ok-ink); font-size: 13px; font-weight: 600; }
.hpfy-rv-verified .hpfy-rv-check { width: 14px; height: 14px; }
.hpfy-rv-verified .hpfy-rv-check::after { left: 4.8px; top: 2.5px; width: 3.5px; height: 6.5px; }
.hpfy-rv-item__rating { display: flex; align-items: center; gap: 10px; margin-top: 6px; }
.hpfy-rv-item__date { font-size: 13px; color: var(--hpfy-muted); }
.hpfy-rv .hpfy-rv-item__title { margin-top: 8px; font-size: 16px; font-weight: 600; line-height: 1.4; }
.hpfy-rv-item__body { margin-top: 6px; max-width: 72ch; overflow-wrap: anywhere; color: var(--hpfy-slate); }
.hpfy-rv-item__option { margin-top: 8px; font-size: 13px; color: var(--hpfy-muted); }
.hpfy-rv-item__rec { display: flex; align-items: center; gap: 6px; margin-top: 10px; font-size: 13px; font-weight: 600; color: var(--hpfy-ok-ink); }
.hpfy-rv-item__rec .hpfy-rv-check { width: 14px; height: 14px; }
.hpfy-rv-item__rec .hpfy-rv-check::after { left: 4.8px; top: 2.5px; width: 3.5px; height: 6.5px; }

.hpfy-rv-photos { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.hpfy-rv-photo { width: 72px; height: 72px; padding: 0; margin: 0; border: 1px solid var(--hpfy-line); border-radius: 8px; overflow: hidden; background: #fff; cursor: zoom-in; }
.hpfy-rv-photo img { display: block; width: 100%; height: 100%; object-fit: cover; }

.hpfy-rv-reply { margin-top: 14px; padding: 12px 16px; max-width: 72ch; border-left: 3px solid var(--hpfy-blue); border-radius: 0 10px 10px 0; background: var(--hpfy-blue-soft); font-size: 14px; }
.hpfy-rv-reply__who { display: flex; flex-wrap: wrap; gap: 4px 10px; margin-bottom: 4px; font-size: 13px; }
.hpfy-rv-store { font-weight: 600; color: var(--hpfy-blue); }

/* helpful / report row (reviews and answers) */
.hpfy-rv-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 14px; font-size: 13px; color: var(--hpfy-muted); }
.hpfy-rv-actions__q { margin-right: 2px; }
.hpfy-rv-vote { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px; margin: 0; border: 1px solid var(--hpfy-chip-line); border-radius: 999px;
    background: #fff; color: var(--hpfy-slate); font-size: 13px; font-weight: 600; cursor: pointer; transition: border-color .15s, background-color .15s; }
.hpfy-rv-vote:hover:not([disabled]) { border-color: var(--hpfy-green); color: var(--hpfy-green-dark); }
.hpfy-rv-vote.is-on { border-color: var(--hpfy-green); background: var(--hpfy-green-soft); color: var(--hpfy-green-dark); }
.hpfy-rv-thumb { display: inline-block; width: 15px; height: 15px; background: currentColor;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M2 21h3V9H2v12zm20-11a2 2 0 0 0-2-2h-6.3l1-4.6v-.3c0-.4-.2-.8-.4-1.1L13.2 1 6.6 7.6C6.2 7.9 6 8.4 6 9v10a2 2 0 0 0 2 2h9c.8 0 1.5-.5 1.8-1.2l3-7.1c.1-.2.2-.5.2-.7v-2z'/%3E%3C/svg%3E") center / contain no-repeat;
            mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M2 21h3V9H2v12zm20-11a2 2 0 0 0-2-2h-6.3l1-4.6v-.3c0-.4-.2-.8-.4-1.1L13.2 1 6.6 7.6C6.2 7.9 6 8.4 6 9v10a2 2 0 0 0 2 2h9c.8 0 1.5-.5 1.8-1.2l3-7.1c.1-.2.2-.5.2-.7v-2z'/%3E%3C/svg%3E") center / contain no-repeat; }
.hpfy-rv-vote--down .hpfy-rv-thumb { transform: rotate(180deg); }
.hpfy-rv-report { padding: 4px 6px; margin: 0 0 0 4px; border: 0; background: none; color: var(--hpfy-muted); font-size: 13px; cursor: pointer; }
.hpfy-rv-report:hover { color: var(--hpfy-red); text-decoration: underline; }
.hpfy-rv-flash { color: var(--hpfy-ok-ink); font-weight: 500; }

.hpfy-rv-reportbox { margin-top: 10px; padding: 12px 14px; border: 1px solid var(--hpfy-line); border-radius: 10px; background: #fff; font-size: 13px; max-width: 560px; }
.hpfy-rv-reportbox__title { font-weight: 600; color: var(--hpfy-ink); margin-bottom: 8px; }
.hpfy-rv-reportbox__opts { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.hpfy-rv-pill { padding: 5px 12px; margin: 0; border: 1px solid var(--hpfy-chip-line); border-radius: 999px; background: #fff; color: var(--hpfy-slate); font-size: 13px; cursor: pointer; }
.hpfy-rv-pill:hover { border-color: var(--hpfy-red); color: var(--hpfy-red); }
.hpfy-rv-reportbox__done { color: var(--hpfy-ok-ink); font-weight: 500; }

.hpfy-rv-empty { padding: 32px 0; text-align: center; color: var(--hpfy-muted); }
.hpfy-rv-empty p { margin-bottom: 12px; }

/* ---------------------------------------------------------------- pager */
.hpfy-rv-pager { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px; padding: 24px 0 4px; }
.hpfy-rv-pager__num, .hpfy-rv-pager__step { display: inline-flex; align-items: center; justify-content: center; min-width: 38px; height: 38px; padding: 0 8px; margin: 0;
    border: 1px solid transparent; border-radius: 8px; background: none; color: var(--hpfy-slate); font-size: 14px; font-weight: 500; cursor: pointer; }
.hpfy-rv-pager__step { border-color: var(--hpfy-chip-line); font-size: 20px; line-height: 1; }
button.hpfy-rv-pager__num:hover, .hpfy-rv-pager__step:hover:not([disabled]) { border-color: var(--hpfy-green); color: var(--hpfy-green-dark); }
.hpfy-rv-pager__num.is-on { background: var(--hpfy-green); color: #fff; font-weight: 600; cursor: default; }
.hpfy-rv-pager__step[disabled] { opacity: .4; cursor: default; }
.hpfy-rv-pager__gap { min-width: 20px; text-align: center; color: var(--hpfy-muted); }

/* ---------------------------------------------------------------- questions & answers */
.hpfy-qa-head { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.hpfy-qa-search { position: relative; flex: 1 1 320px; display: flex; max-width: 560px; margin: 0; }
.hpfy-qa-search__icon { position: absolute; left: 14px; top: 50%; width: 16px; height: 16px; margin-top: -8px; border: 2px solid var(--hpfy-muted); border-radius: 50%; pointer-events: none; }
.hpfy-qa-search__icon::after { content: ""; position: absolute; right: -6px; bottom: -5px; width: 7px; height: 2px; background: var(--hpfy-muted); transform: rotate(45deg); }
/* the theme styles input[type=search] site-wide (header search), hence !important here */
.hpfy-rv .hpfy-qa-search input[type=search] { flex: 1 1 auto !important; width: auto !important; min-width: 0 !important; height: 42px !important;
    padding: 0 12px 0 40px !important; margin: 0 !important; border: 1px solid var(--hpfy-field-line) !important; border-right: 0 !important;
    border-radius: 8px 0 0 8px !important; background: #fff !important; color: var(--hpfy-ink) !important; font-family: inherit; font-size: 15px !important;
    line-height: normal !important; box-shadow: none !important; -webkit-appearance: none; appearance: none; }
.hpfy-rv .hpfy-qa-search { flex-wrap: nowrap !important; }
.hpfy-rv .hpfy-qa-search input[type=search]:focus { border-color: var(--hpfy-blue) !important; box-shadow: inset 0 0 0 1px var(--hpfy-blue) !important; }
.hpfy-rv .hpfy-qa-search__go { flex: none; height: 42px; padding: 0 16px; margin: 0; border: 1px solid var(--hpfy-field-line); border-radius: 0 8px 8px 0; background: var(--hpfy-surface);
    color: var(--hpfy-ink); font-size: 14px; font-weight: 600; cursor: pointer; }
.hpfy-qa-search__go:hover { background: var(--hpfy-green-soft); }
.hpfy-qa-count { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; padding: 20px 0 6px; font-size: 14px; color: var(--hpfy-muted); }
.hpfy-qa-count:empty { display: none; }

.hpfy-rv .hpfy-qa-item { padding: 22px 0; border-bottom: 1px solid var(--hpfy-line); }
.hpfy-qa-q, .hpfy-qa-a { display: grid; grid-template-columns: 32px 1fr; gap: 14px; }
.hpfy-qa-mark { display: flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 8px;
    background: var(--hpfy-slate); color: #fff; font-size: 15px; font-weight: 700; }
.hpfy-qa-mark--a { background: var(--hpfy-surface); color: var(--hpfy-slate); border: 1px solid var(--hpfy-line); }
.hpfy-qa-q__text { font-size: 16px; font-weight: 600; line-height: 1.45; color: var(--hpfy-ink); overflow-wrap: anywhere; padding-top: 4px; }
.hpfy-qa-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin-top: 4px; font-size: 13px; color: var(--hpfy-muted); }
.hpfy-qa-meta .hpfy-rv-report { margin-left: 0; }
.hpfy-qa-answers { margin-top: 14px !important; display: flex; flex-direction: column; gap: 12px; }
.hpfy-rv .hpfy-qa-a { padding-left: 46px; }
.hpfy-qa-a__main { min-width: 0; }
.hpfy-qa-a__text { padding-top: 4px; max-width: 72ch; overflow-wrap: anywhere; }
.hpfy-qa-a--store .hpfy-qa-mark--a { background: var(--hpfy-blue); border-color: var(--hpfy-blue); color: #fff; }
.hpfy-qa-a--store .hpfy-qa-a__main { max-width: 760px; padding: 12px 16px; border-radius: 10px; background: var(--hpfy-blue-soft); }
.hpfy-qa-a--store .hpfy-qa-a__text { padding-top: 0; }
.hpfy-qa-a .hpfy-rv-actions { margin-top: 8px; }
.hpfy-qa-badge { padding: 1px 8px; border-radius: 999px; background: #fff; color: var(--hpfy-blue); font-size: 12px; font-weight: 600; border: 1px solid var(--hpfy-badge-line); }
.hpfy-qa-none { margin-top: 10px !important; padding-left: 46px; font-size: 14px; color: var(--hpfy-muted); }
.hpfy-qa-more { margin: 10px 0 0 92px; }
.hpfy-qa-showmore { display: flex; margin: 20px auto 0; }
.hpfy-qa-a__text a, .hpfy-rv-reply__body a { color: var(--hpfy-blue); text-decoration: underline; overflow-wrap: anywhere; }
.hpfy-qa-q__text { outline: none; }
.hpfy-qa-reply { margin-top: 14px; padding-left: 46px; }
.hpfy-qa-answerform { margin-top: 4px; padding: 16px; max-width: 640px; border: 1px solid var(--hpfy-line); border-radius: 12px; background: #fff; }
.hpfy-qa-answerform__foot { display: flex; justify-content: flex-end; gap: 10px; margin-top: 12px; }
.hpfy-qa-reply .hpfy-rv-note { margin-top: 0; }

/* ---------------------------------------------------------------- forms (dialogs + inline answer) */
.hpfy-rv-field { display: flex; flex-direction: column; gap: 6px; margin-top: 18px; min-width: 0; }
.hpfy-rv-dialog__body > .hpfy-rv-field:first-child, .hpfy-qa-answerform > .hpfy-rv-field:first-child { margin-top: 0; }
.hpfy-rv-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.hpfy-rv-form input[type=text], .hpfy-rv-form input[type=email], .hpfy-rv-form textarea {
    display: block; width: 100%; min-height: 44px; padding: 10px 12px; margin: 0; border: 1px solid var(--hpfy-field-line); border-radius: 8px; background: #fff;
    color: var(--hpfy-ink); font-family: inherit; font-size: 15px; line-height: 1.4; box-shadow: none; }
.hpfy-rv-form textarea { resize: vertical; min-height: 110px; }
.hpfy-rv-form input:focus, .hpfy-rv-form textarea:focus { border-color: var(--hpfy-blue); outline: none; box-shadow: 0 0 0 3px var(--hpfy-blue-ring); }
.hpfy-rv-form [aria-invalid=true] { border-color: var(--hpfy-red); }
.hpfy-rv-form ::placeholder { color: var(--hpfy-placeholder); }
.hpfy-rv-hint [data-hpfy-counter] { flex: none; white-space: nowrap; }
.hpfy-rv-hint { display: flex; justify-content: space-between; gap: 10px; font-size: 12.5px; color: var(--hpfy-muted); }
.hpfy-rv-req { color: var(--hpfy-red); }
.hpfy-rv-err { color: var(--hpfy-red); font-size: 13px; font-weight: 500; }
.hpfy-rv-err:empty { display: none; }
.hpfy-rv-field .hpfy-rv-hint + .hpfy-rv-err { margin-top: -2px; }

/* star picker: inputs are listed 5..1 and shown reversed so hovering a star lights it and the ones before it */
.hpfy-rv-rate { display: inline-flex; flex-direction: row-reverse; justify-content: flex-end; align-items: center; }
.hpfy-rv-rate input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; }
.hpfy-rv-dialog .hpfy-rv-rate label { padding: 0 3px; color: var(--hpfy-star-off); font-family: Arial, sans-serif; font-size: 34px; font-weight: 400; line-height: 1; cursor: pointer; transition: color .1s; }
.hpfy-rv-rate label::before { content: "\2605"; }
.hpfy-rv-dialog .hpfy-rv-rate input:checked ~ label, .hpfy-rv-dialog .hpfy-rv-rate label:hover, .hpfy-rv-dialog .hpfy-rv-rate label:hover ~ label { color: var(--hpfy-amber); }
.hpfy-rv-rate input:focus-visible + label { outline: 2px solid var(--hpfy-blue); border-radius: 4px; }
.hpfy-rv-rate__word { order: -1; margin-left: 12px; font-size: 14px; font-weight: 600; color: var(--hpfy-ink); }

/* yes / no segmented choice */
.hpfy-rv-seg { display: inline-flex; border: 1px solid var(--hpfy-field-line); border-radius: 8px; overflow: hidden; align-self: flex-start; }
.hpfy-rv-seg input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; }
.hpfy-rv-dialog .hpfy-rv-seg label { min-width: 80px; padding: 9px 18px; font-weight: 500; text-align: center; cursor: pointer; background: #fff; }
.hpfy-rv-dialog .hpfy-rv-seg label + input + label { border-left: 1px solid var(--hpfy-field-line); }
.hpfy-rv-dialog .hpfy-rv-seg input:checked + label { background: var(--hpfy-green-soft); color: var(--hpfy-green-dark); font-weight: 600; }
.hpfy-rv-seg input:focus-visible + label { outline: 2px solid var(--hpfy-blue); outline-offset: -2px; }

/* ---------------------------------------------------------------- dialogs */
.hpfy-rv-dialog { width: min(640px, calc(100vw - 32px)); max-width: none; max-height: calc(100vh - 48px); padding: 0; margin: auto; border: 0; border-radius: 16px;
    background: #fff; box-shadow: 0 24px 64px rgba(25, 35, 25, .28); overflow: hidden; }
.hpfy-rv-dialog[open] { display: flex; flex-direction: column; }
.hpfy-rv-dialog::backdrop { background: rgba(28, 36, 28, .55); }
.hpfy-rv-dialog .hpfy-rv-form { display: flex; flex-direction: column; min-height: 0; max-height: calc(100vh - 48px); margin: 0; }
.hpfy-rv-dialog__head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; padding: 20px 24px 16px; border-bottom: 1px solid var(--hpfy-line); }
.hpfy-rv-dialog .hpfy-rv-dialog__title { font-size: 20px; font-weight: 600; line-height: 1.3; }
.hpfy-rv-dialog__product { margin-top: 2px; font-size: 13.5px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.hpfy-rv-dialog__body { flex: 1 1 auto; overflow-y: auto; padding: 20px 24px 8px; overscroll-behavior: contain; }
.hpfy-rv-dialog__body > p { margin-top: 18px; }
.hpfy-rv-dialog__foot { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 24px; border-top: 1px solid var(--hpfy-line); background: #fff; }
.hpfy-rv-close { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; padding: 0; margin: -4px -8px 0 0;
    border: 0; border-radius: 50%; background: none; color: var(--hpfy-muted); font-size: 26px; line-height: 1; cursor: pointer; }
.hpfy-rv-close:hover { background: var(--hpfy-surface); color: var(--hpfy-ink); }
.hpfy-rv-dialog.is-fallback-open { position: fixed; z-index: 100000; inset: 0; }   /* browsers without <dialog> support */

.hpfy-rv-dialog--photo { width: auto; max-width: calc(100vw - 32px); background: #111; border-radius: 12px; }
.hpfy-rv-dialog--photo[open] { display: block; }
.hpfy-rv-dialog--photo img { display: block; max-width: calc(100vw - 32px); max-height: calc(100vh - 64px); margin: 0 auto; }
.hpfy-rv-dialog--photo .hpfy-rv-close { position: absolute; top: 8px; right: 8px; margin: 0; background: rgba(255, 255, 255, .9); color: #222; }

html.hpfy-rv-lock { overflow: hidden; }

/* ---------------------------------------------------------------- store-rating popup (order-complete page) */
.hpfy-rv-dialog.hpfy-sr-dialog { width: min(460px, calc(100vw - 32px)); padding: 32px 28px 26px; text-align: center; }
.hpfy-rv-dialog.hpfy-sr-dialog[open] { display: block; }
.hpfy-sr-dialog .hpfy-rv-close { position: absolute; top: 10px; right: 10px; margin: 0; }
.hpfy-sr-dialog .hpfy-sr-title { margin: 0 0 8px; padding: 0 22px; font-size: 21px; font-weight: 600; line-height: 1.3; color: var(--hpfy-ink); }
.hpfy-sr-dialog .hpfy-sr-sub { margin: 0 auto; max-width: 34ch; font-size: 14.5px; color: var(--hpfy-muted); }
.hpfy-sr-stars { display: flex; justify-content: center; gap: 6px; margin: 22px 0 6px; }
.hpfy-sr-star { width: 48px; height: 48px; padding: 0; margin: 0; border: 0; border-radius: 8px; background: none; cursor: pointer;
    color: var(--hpfy-star-off); font-family: Arial, sans-serif; font-size: 44px; line-height: 1; transition: color .1s, transform .1s; }
.hpfy-sr-star::before { content: "\2605"; }
.hpfy-sr-star.is-hover, .hpfy-sr-star.is-on { color: var(--hpfy-amber); }
.hpfy-sr-star:hover { transform: scale(1.08); }
.hpfy-sr-star:focus-visible { outline: 2px solid var(--hpfy-blue); outline-offset: 1px; }
.hpfy-sr-scale { display: flex; justify-content: space-between; width: 270px; max-width: 100%; margin: 0 auto; font-size: 12.5px; color: var(--hpfy-muted); }
.hpfy-sr-picked { pointer-events: none; }
.hpfy-sr-picked .hpfy-sr-stars { margin: 4px 0 14px; gap: 2px; }
.hpfy-sr-picked .hpfy-sr-star { width: 28px; height: 28px; font-size: 26px; }
.hpfy-sr-dialog textarea { display: block; width: 100%; min-height: 96px; padding: 10px 12px; margin: 0; border: 1px solid var(--hpfy-field-line); border-radius: 8px;
    background: #fff; color: var(--hpfy-ink); font-family: inherit; font-size: 15px; line-height: 1.4; text-align: left; resize: vertical; box-shadow: none; }
.hpfy-sr-dialog textarea:focus { border-color: var(--hpfy-blue); outline: none; box-shadow: 0 0 0 3px var(--hpfy-blue-ring); }
.hpfy-sr-dialog .hpfy-rv-err { margin-top: 6px; text-align: left; }
.hpfy-sr-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 14px; }
.hpfy-sr-done-mark { position: relative; width: 56px; height: 56px; margin: 0 auto 14px; border-radius: 50%; background: var(--hpfy-ok-soft); }
.hpfy-sr-done-mark::after { content: ""; position: absolute; left: 21px; top: 13px; width: 12px; height: 22px; border: solid var(--hpfy-ok); border-width: 0 4px 4px 0; transform: rotate(45deg); }
.hpfy-sr-dialog .is-off { display: none !important; }
@media (max-width: 600px) {
    .hpfy-rv-dialog.hpfy-sr-dialog { width: calc(100vw - 24px); height: -webkit-fit-content; height: fit-content; max-height: calc(100% - 24px); margin: auto auto 12px; border-radius: 16px; padding: 28px 18px 20px; }
    .hpfy-sr-star { width: 44px; height: 44px; font-size: 40px; }
    .hpfy-sr-actions .hpfy-rv-btn { flex: 1; }
}

/* ---------------------------------------------------------------- tablet */
@media (max-width: 991px) {
    .hpfy-rv-overview { grid-template-columns: minmax(170px, 210px) 1fr; padding: 22px; }
    .hpfy-rv-cta { grid-column: 1 / -1; flex-direction: row; flex-wrap: wrap; align-items: center; justify-content: space-between; }
    .hpfy-rv-facts { flex-direction: row; flex-wrap: wrap; gap: 6px 20px; }
    .hpfy-rv-btn--wide { width: auto; }
    .hpfy-rv-overview--empty { grid-template-columns: 1fr; }
}

/* ---------------------------------------------------------------- phone */
@media (max-width: 600px) {
    .hpfy-rv-tabs { gap: 22px; margin-bottom: 16px; }
    .hpfy-rv-tab { font-size: 15px; }
    .hpfy-rv-overview { grid-template-columns: 1fr; gap: 18px; padding: 18px 16px; border-radius: 12px; }
    .hpfy-rv-score__num { font-size: 44px; }
    .hpfy-rv-bar { grid-template-columns: 30px 1fr 38px 36px; gap: 8px; padding: 4px 2px; }
    .hpfy-rv-cta { flex-direction: column; align-items: stretch; }
    .hpfy-rv-facts { flex-direction: column; }
    .hpfy-rv-btn--wide { width: 100%; }
    .hpfy-rv-toolbar { padding-top: 16px; }
    .hpfy-rv-sort { width: 100%; }
    .hpfy-rv-select { flex: 1; }
    .hpfy-rv .hpfy-rv-item { grid-template-columns: 36px 1fr; gap: 12px; padding: 20px 0; }
    .hpfy-rv-avatar { width: 36px; height: 36px; font-size: 15px; }
    .hpfy-qa-head { flex-direction: column; align-items: stretch; }
    .hpfy-qa-search { flex: none; max-width: none; }
    .hpfy-qa-q, .hpfy-qa-a { grid-template-columns: 28px 1fr; gap: 10px; }
    .hpfy-qa-mark { width: 28px; height: 28px; font-size: 14px; }
    .hpfy-rv .hpfy-qa-a, .hpfy-qa-none, .hpfy-qa-reply { padding-left: 0; }
    .hpfy-qa-more { margin-left: 38px; }
    .hpfy-rv-row { grid-template-columns: 1fr; }
    .hpfy-rv-pager { gap: 2px; }
    .hpfy-rv-pager__num, .hpfy-rv-pager__step { min-width: 32px; height: 34px; padding: 0 4px; }
    .hpfy-rv-pager__gap { min-width: 14px; }

    /* dialogs become a full-height sheet */
    .hpfy-rv-dialog { width: 100vw; max-height: 100%; height: 100%; margin: 0; border-radius: 0; }
    .hpfy-rv-dialog .hpfy-rv-form { max-height: 100%; height: 100%; }
    .hpfy-rv-dialog__head { padding: 16px; }
    .hpfy-rv-dialog__body { padding: 16px 16px 8px; }
    .hpfy-rv-dialog__foot { padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); }
    .hpfy-rv-dialog__foot .hpfy-rv-btn { flex: 1; }
    .hpfy-rv-dialog--photo { height: auto; width: auto; margin: auto; border-radius: 12px; }
}

@media (prefers-reduced-motion: reduce) {
    .hpfy-rv *, .hpfy-rv-dialog * { transition: none !important; }
}
