/* ============================================================
   Відгуки + Q&A на сторінці товару (префікси rvw- / qa-).
   Палітра сайту: акцент var(--g-brand-500, #2c7a5b), кнопка var(--g-action, #01a045), зірки #f5a623.
   ============================================================ */

.rvw-block,
.qa-block {
    max-width: 1200px;
    margin: 40px auto 0;
    padding: 0 20px;
}

.rvw-title,
.qa-title {
    font-size: 26px;
    font-weight: 600;
    color: #222;
    margin: 0;
}

.rvw-head,
.qa-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 18px;
}

/* --- Кнопки --- */

.rvw-write,
.qa-ask,
.rvw-more {
    padding: 10px 22px;
    background: var(--g-action, #01a045);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s;
}

.rvw-write:hover,
.qa-ask:hover {
    background: var(--g-action, #00bc53);
}

.rvw-more {
    display: block;
    margin: 18px auto 0;
    background: #fff;
    color: var(--g-brand-500, #2c7a5b);
    border: 1px solid var(--g-brand-500, #2c7a5b);
}

.rvw-more:hover {
    background: #f2f8f5;
    color: var(--g-brand-500, #2c7a5b);
}

/* --- Зведення + гістограма --- */

.rvw-summary {
    display: flex;
    gap: 28px;
    align-items: center;
    flex-wrap: wrap;
    padding: 18px 20px;
    background: #fafcfb;
    border: 1px solid #e8efeC;
    border-radius: 12px;
    margin-bottom: 16px;
}

.rvw-summary-left {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    min-width: 140px;
}

.rvw-summary-avg {
    font-size: 42px;
    font-weight: 700;
    color: #222;
    line-height: 1;
}

.rvw-summary-count {
    font-size: 13px;
    color: #7c8580;
}

.rvw-hist {
    flex: 1;
    min-width: 240px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.rvw-hist-row {
    display: grid;
    grid-template-columns: 34px 1fr 36px;
    align-items: center;
    gap: 10px;
    padding: 2px 4px;
    background: none;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    color: #5c6270;
}

.rvw-hist-row:hover {
    background: #f0f5f2;
}

.rvw-hist-label {
    text-align: right;
    white-space: nowrap;
}

.rvw-hist-bar {
    display: block;
    height: 8px;
    border-radius: 4px;
    background: #e8ece9;
    overflow: hidden;
}

.rvw-hist-fill {
    display: block;
    height: 100%;
    border-radius: 4px;
    background: #f5a623;
}

.rvw-hist-n {
    color: #7c8580;
}

/* --- Зірки --- */

.rvw-stars {
    display: inline-flex;
    gap: 1px;
    font-size: 16px;
    line-height: 1;
}

.rvw-star {
    color: #d9dedb;
}

.rvw-star.on {
    color: #f5a623;
}

/* --- Панель фільтрів --- */

.rvw-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 14px;
}

.rvw-chips {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.rvw-chip {
    padding: 6px 14px;
    background: #fff;
    border: 1px solid #dfe5e1;
    border-radius: 999px;
    font-size: 13px;
    color: #5c6270;
    cursor: pointer;
    transition: all 0.15s;
}

.rvw-chip:hover {
    border-color: var(--g-brand-500, #2c7a5b);
    color: var(--g-brand-500, #2c7a5b);
}

.rvw-chip.on {
    background: var(--g-brand-500, #2c7a5b);
    border-color: var(--g-brand-500, #2c7a5b);
    color: #fff;
}

.rvw-sort {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #7c8580;
}

.rvw-sort select {
    padding: 6px 10px;
    border: 1px solid #dfe5e1;
    border-radius: 8px;
    font-size: 13px;
    color: #222;
    background: #fff;
}

/* --- Список відгуків --- */

.rvw-list {
    display: flex;
    flex-direction: column;
}

.rvw-item {
    padding: 20px 0;
    border-bottom: 1px solid #edf1ee;
}

.rvw-item-head {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 6px;
}

.rvw-author {
    font-weight: 600;
    color: #222;
    font-size: 15px;
}

.rvw-verified {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 10px;
    background: #e7f6ef;
    color: #0e7a4e;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 500;
}

.rvw-date {
    margin-left: auto;
    font-size: 13px;
    color: #9aa0ac;
}

.rvw-body {
    margin-top: 8px;
    font-size: 15px;
    line-height: 1.6;
    color: #333;
    overflow-wrap: anywhere;
}

.rvw-media {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 10px;
}

.rvw-media-thumb {
    width: 76px;
    height: 76px;
    padding: 0;
    border: 1px solid #e3e8e5;
    border-radius: 8px;
    overflow: hidden;
    cursor: zoom-in;
    background: #f4f6f5;
}

.rvw-media-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.rvw-video-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: #fff;
    border: 1px solid #dfe5e1;
    border-radius: 8px;
    font-size: 13px;
    color: var(--g-brand-500, #2c7a5b);
    text-decoration: none;
}

.rvw-video-chip:hover {
    border-color: var(--g-brand-500, #2c7a5b);
}

.rvw-video-embed {
    width: 100%;
    max-width: 420px;
    aspect-ratio: 16 / 9;
    border-radius: 10px;
    overflow: hidden;
}

.rvw-video-embed iframe {
    width: 100%;
    height: 100%;
    display: block;
}

.rvw-reply {
    margin-top: 12px;
    padding: 12px 14px;
    background: #f2f8f5;
    border-left: 3px solid var(--g-brand-500, #2c7a5b);
    border-radius: 0 8px 8px 0;
}

.rvw-reply-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--g-brand-500, #2c7a5b);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 4px;
}

.rvw-reply-text {
    font-size: 14px;
    line-height: 1.55;
    color: #333;
}

.rvw-reply-date {
    margin-top: 4px;
    font-size: 12px;
    color: #9aa0ac;
}

.rvw-votes {
    display: flex;
    gap: 8px;
    margin-top: 12px;
}

.rvw-vote,
.qa-helpful {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: #fff;
    border: 1px solid #dfe5e1;
    border-radius: 999px;
    font-size: 13px;
    color: #5c6270;
    cursor: pointer;
    transition: all 0.15s;
}

.rvw-vote:hover,
.qa-helpful:hover {
    border-color: var(--g-brand-500, #2c7a5b);
    color: var(--g-brand-500, #2c7a5b);
}

.rvw-vote.active,
.qa-helpful.active {
    background: #e7f6ef;
    border-color: var(--g-brand-500, #2c7a5b);
    color: #0e7a4e;
}

.rvw-vote-cnt,
.qa-helpful-cnt {
    font-weight: 600;
}

.rvw-empty,
.qa-empty {
    padding: 26px 20px;
    background: #fafcfb;
    border: 1px dashed #dfe5e1;
    border-radius: 12px;
    font-size: 15px;
    color: #5c6270;
    text-align: center;
}

/* --- UGC-галерея «Фото покупців» --- */

.rvw-ugc {
    margin-top: 34px;
}

.rvw-ugc-title {
    font-size: 20px;
    font-weight: 600;
    color: #222;
    margin: 0 0 14px;
}

.rvw-ugc-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 10px;
}

.rvw-ugc-thumb {
    position: relative;
    aspect-ratio: 1;
    padding: 0;
    border: 1px solid #e3e8e5;
    border-radius: 10px;
    overflow: hidden;
    cursor: zoom-in;
    background: #f4f6f5;
}

.rvw-ugc-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.2s;
}

.rvw-ugc-thumb:hover img {
    transform: scale(1.05);
}

.rvw-ugc-stars {
    position: absolute;
    right: 6px;
    bottom: 6px;
    padding: 2px 8px;
    background: rgba(0, 0, 0, 0.55);
    color: #fff;
    border-radius: 999px;
    font-size: 11px;
}

/* --- Q&A --- */

.qa-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 16px;
    font-size: 14px;
    color: #5c6270;
}

.qa-msgr {
    padding: 6px 14px;
    border: 1px solid #dfe5e1;
    border-radius: 999px;
    font-size: 13px;
    color: var(--g-brand-500, #2c7a5b);
    text-decoration: none;
    transition: all 0.15s;
}

.qa-msgr:hover {
    border-color: var(--g-brand-500, #2c7a5b);
    background: #f2f8f5;
}

.qa-msgr-telegram { border-color: #2aabee; color: #2aabee; }
.qa-msgr-viber { border-color: #7360f2; color: #7360f2; }
.qa-msgr-whatsapp { border-color: #25d366; color: #1eb856; }

.qa-item {
    padding: 18px 0;
    border-bottom: 1px solid #edf1ee;
}

.qa-q-text {
    font-size: 15px;
    font-weight: 600;
    color: #222;
}

.qa-q-meta {
    margin-top: 4px;
    font-size: 13px;
    color: #9aa0ac;
}

.qa-a {
    margin-top: 10px;
    padding: 12px 14px;
    background: #fafcfb;
    border-radius: 10px;
}

.qa-a-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--g-brand-500, #2c7a5b);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 4px;
}

.qa-a-text {
    font-size: 14px;
    line-height: 1.55;
    color: #333;
}

.qa-a .qa-helpful {
    margin-top: 8px;
}

/* --- Модалки (на базі css/modal.css .modal/.modal-content) --- */

.rvw-modal-content {
    position: relative;
    max-width: 520px;
    max-height: 90vh;
    overflow-y: auto;
    text-align: left;
    padding: 26px 24px;
}

.rvw-modal-close {
    position: absolute;
    top: 10px;
    right: 12px;
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    border-radius: 8px;
    font-size: 24px;
    line-height: 1;
    color: #9aa0ac;
    cursor: pointer;
}

.rvw-modal-close:hover {
    background: #f0f2f1;
    color: #333;
}

.rvw-modal-content h2 {
    text-align: left;
    margin-bottom: 12px;
}

/* Підпис автора під назвою товару в модалці відгуку (кабінет) */
.rvw-modal-author {
    margin: -8px 0 12px;
    font-size: 13px;
    color: var(--g-ink-3, #5c6270);
}

.rvw-note {
    font-size: 14px;
    color: #5c6270;
    line-height: 1.5;
    margin-bottom: 14px;
}

.rvw-btn {
    display: block;
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    text-align: center;
    text-decoration: none;
    box-sizing: border-box;
}

.rvw-btn-green {
    background: var(--g-action, #01a045);
    color: #fff;
    transition: background-color 0.2s;
}

.rvw-btn-green:hover {
    background: var(--g-action, #00bc53);
}

.rvw-btn-green:disabled {
    opacity: 0.5;
    cursor: default;
}

.rvw-btn-outline {
    background: #fff;
    color: var(--g-brand-500, #2c7a5b);
    border: 1px solid var(--g-brand-500, #2c7a5b);
}

.rvw-btn-outline:hover {
    background: #f2f8f5;
}

.rvw-or {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 16px 0;
    font-size: 13px;
    color: #9aa0ac;
    text-transform: lowercase;
}

.rvw-or::before,
.rvw-or::after {
    content: "";
    flex: 1;
    height: 1px;
    background: #e8ece9;
}

.rvw-field {
    display: block;
    margin-bottom: 14px;
    font-size: 14px;
    color: #333;
}

.rvw-field > span {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: #5c6270;
    font-size: 13px;
}

.rvw-field input[type="text"],
.rvw-field input[type="email"],
.rvw-field input[type="tel"],
.rvw-field input[type="url"],
.rvw-field textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #dfe5e1;
    border-radius: 8px;
    font-size: 15px;
    font-family: inherit;
    color: #222;
    box-sizing: border-box;
}

.rvw-field textarea {
    resize: vertical;
}

.rvw-field input:focus,
.rvw-field textarea:focus {
    outline: none;
    border-color: var(--g-brand-500, #2c7a5b);
}

.rvw-formerr {
    margin-bottom: 12px;
    padding: 10px 12px;
    background: #fdf0ef;
    border: 1px solid #f3c6c2;
    border-radius: 8px;
    font-size: 13px;
    color: #b3271e;
}

.rvw-hp {
    position: absolute;
    left: -9999px;
    opacity: 0;
    height: 0;
    width: 0;
}

/* --- Пікер зірок у формі --- */

.rvw-pick {
    display: flex;
    align-items: center;
    gap: 4px;
}

.rvw-pick-star {
    padding: 0;
    border: none;
    background: none;
    font-size: 34px;
    line-height: 1;
    color: #d9dedb;
    cursor: pointer;
    transition: color 0.1s, transform 0.1s;
}

.rvw-pick-star.on {
    color: #f5a623;
}

.rvw-pick-star:hover {
    transform: scale(1.15);
}

.rvw-pick-val {
    margin-left: 8px;
    font-size: 13px;
    color: #7c8580;
}

/* --- Завантажені фото у формі --- */

.rvw-uploads {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 8px;
}

.rvw-uploads:empty {
    margin-bottom: 0;
}

.rvw-up-item {
    position: relative;
    width: 68px;
    height: 68px;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #e3e8e5;
}

.rvw-up-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.rvw-up-item.loading img {
    opacity: 0.4;
}

.rvw-up-item.loading::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 24px;
    height: 24px;
    margin: -12px 0 0 -12px;
    box-sizing: border-box;
    border: 3px solid var(--g-border, #e3e8e5);
    border-top-color: var(--g-action, #01a045);
    border-radius: 50%;
    animation: rvw-spin 0.8s linear infinite;
    pointer-events: none;
}

@keyframes rvw-spin {
    to { transform: rotate(360deg); }
}

.rvw-up-remove {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 20px;
    height: 20px;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    font-size: 12px;
    line-height: 1;
    cursor: pointer;
}

.rvw-upload-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border: 1px dashed #b7c4bd;
    border-radius: 8px;
    font-size: 13px;
    color: #5c6270;
    cursor: pointer;
}

.rvw-upload-btn:hover {
    border-color: var(--g-brand-500, #2c7a5b);
    color: var(--g-brand-500, #2c7a5b);
}

.rvw-up-hint {
    font-size: 12px;
    color: #9aa0ac;
}

/* --- Lightbox --- */

.rvw-lightbox {
    position: fixed;
    inset: 0;
    z-index: 1200;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 30px;
}

.rvw-lightbox[hidden] {
    display: none;
}

.rvw-lightbox img {
    max-width: 100%;
    max-height: 100%;
    border-radius: 8px;
    object-fit: contain;
}

.rvw-lightbox-close {
    position: absolute;
    top: 14px;
    right: 18px;
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    font-size: 26px;
    line-height: 1;
    cursor: pointer;
}

/* --- Сторінка /review (магічний лінок «оцініть замовлення») --- */

.rvw-review-page {
    max-width: 720px;
    margin: 0 auto;
    padding: 40px 20px 60px;
}

.rvw-rp-card {
    background: #fff;
    border: 1px solid #e8efeC;
    border-radius: 14px;
    padding: 28px 26px;
}

.rvw-rp-card h1 {
    font-size: 24px;
    font-weight: 600;
    color: #222;
    margin: 0 0 8px;
}

.rvw-rp-sub {
    font-size: 14px;
    color: #5c6270;
    line-height: 1.55;
    margin: 0 0 18px;
}

.rvw-rp-list {
    display: flex;
    flex-direction: column;
}

.rvw-rp-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 0;
    border-bottom: 1px solid #edf1ee;
}

.rvw-rp-item:last-child {
    border-bottom: none;
}

.rvw-rp-img {
    flex-shrink: 0;
    width: 64px;
    height: 64px;
    border-radius: 10px;
    overflow: hidden;
    background: #f4f6f5;
    border: 1px solid #e3e8e5;
}

.rvw-rp-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.rvw-rp-info {
    flex: 1;
    min-width: 0;
}

.rvw-rp-name {
    display: block;
    font-size: 15px;
    font-weight: 600;
    color: #222;
    text-decoration: none;
    line-height: 1.35;
}

.rvw-rp-name:hover {
    color: var(--g-brand-500, #2c7a5b);
}

.rvw-rp-state {
    display: inline-block;
    margin-top: 6px;
    font-size: 13px;
    color: #7c8580;
}

.rvw-rp-done { color: #0e7a4e; }
.rvw-rp-pending { color: #b7791f; }
.rvw-rp-rejected { color: #b3271e; }

.rvw-rp-go {
    width: auto;
    flex-shrink: 0;
    padding: 10px 18px;
}

.rvw-rp-hidden {
    opacity: 0.55;
}

/* --- Адаптив --- */

@media (max-width: 640px) {
    .rvw-block,
    .qa-block {
        margin-top: 28px;
        padding: 0 14px;
    }

    .rvw-title,
    .qa-title {
        font-size: 22px;
    }

    .rvw-summary {
        gap: 16px;
        padding: 14px;
    }

    .rvw-summary-left {
        min-width: 110px;
    }

    .rvw-summary-avg {
        font-size: 34px;
    }

    .rvw-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .rvw-sort {
        justify-content: space-between;
    }

    .rvw-date {
        margin-left: 0;
        width: 100%;
    }

    .rvw-modal-content {
        padding: 22px 16px;
    }
}

/* Фрагмент, прихований модератором зірочками (0057): підказка при наведенні */
.rvw-masked {
    cursor: help;
    border-bottom: 1px dotted currentColor;
}

/* Той самий пояснювальний текст для сенсорних екранів: дрібний курсив під відгуком */
.rvw-masked-note {
    display: block;
    margin-top: 6px;
    font-size: 12px;
    font-style: italic;
    opacity: .65;
}

@media (hover: hover) {
    .rvw-masked-note { display: none; }
}
