/* Отзывы гостей: звезда в шапке, страница /{город}/reviews. Палитра «Вкусных историй». */
/* ── Звезда с оценкой справа от логотипа ── */
.header-rating {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 11px 5px 9px;
    border-radius: 999px;
    border: 1px solid rgba(242, 140, 40, .34);
    background: rgba(242, 140, 40, .12);
    color: var(--gold);
    text-decoration: none;
    flex: 0 0 auto;
    transition: border-color .18s ease, background .18s ease, transform .18s ease;
}
.header-rating:hover { border-color: var(--ember); background: rgba(242, 140, 40, .2); }
.header-rating:active { transform: scale(.96); }
.header-rating-star { width: 17px; height: 17px; color: var(--gold); flex: 0 0 auto; }
.header-rating-value { font-size: .9rem; font-weight: 800; font-variant-numeric: tabular-nums; }

/* На мобильной шапке логотип слева, кнопки справа — оценка стоит ровно по
   центру. Абсолютное позиционирование, а не auto-отступы: иначе центр «плыл»
   бы от ширины соседей. Бейдж режима работы на этой ширине уступает ей место —
   он и задумывался как десктопный (время работы на мобильном видно в чате
   поддержки). */
@media (max-width: 768px) {
    .header-left { position: relative; }
    .header-rating { position: absolute; left: 50%; transform: translateX(-50%); }
    .header-rating:active { transform: translateX(-50%) scale(.96); }
}

/* ── Сводка на странице отзывов ── */
.rv-summary {
    display: flex;
    align-items: center;
    gap: 18px;
    flex-wrap: wrap;
    padding: 18px;
    border-radius: 20px;
    border: 1px solid var(--line);
    background: var(--surface);
    box-shadow: 0 12px 30px rgba(0, 0, 0, .25);
}
.rv-summary-score { text-align: center; min-width: 120px; }
.rv-summary-value {
    font-family: "Inter", Arial, sans-serif;
    font-size: 2.6rem; font-weight: 800; line-height: 1; color: var(--ink);
    font-variant-numeric: tabular-nums;
}
.rv-summary-stars { margin: 6px 0 2px; }
.rv-summary-count { font-size: .8rem; color: var(--muted2); }
.rv-summary-cta { flex: 1 1 240px; display: flex; flex-direction: column; gap: 10px; }
.rv-summary-hint { font-size: .86rem; color: var(--muted); margin: 0; }
.rv-summary-hint strong { color: var(--gold); }

.rv-leave-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 13px 18px; border-radius: 16px; border: 1px solid rgba(242, 140, 40, .5);
    background: linear-gradient(180deg, var(--ember), var(--ember2));
    color: #fff; font-weight: 800; font-size: .98rem; cursor: pointer;
    box-shadow: 0 12px 28px rgba(242, 140, 40, .22);
    transition: transform .16s ease, box-shadow .18s ease;
}
.rv-leave-btn svg { width: 19px; height: 19px; }
.rv-leave-btn:active { transform: scale(.98); }

/* ── Фильтры ── */
.rv-filters {
    display: flex; gap: 8px; margin: 18px 0 14px;
    overflow-x: auto; scrollbar-width: none; padding-bottom: 2px;
}
.rv-filters::-webkit-scrollbar { display: none; }
.rv-filter {
    flex: 0 0 auto; padding: 8px 14px; border-radius: 999px;
    border: 1px solid var(--line); background: var(--surface);
    color: var(--muted); font-size: .84rem; font-weight: 700; cursor: pointer;
    transition: color .18s ease, border-color .18s ease, background .18s ease;
}
.rv-filter:hover { color: var(--ink); }
.rv-filter.is-active {
    color: var(--gold); border-color: rgba(242, 140, 40, .5); background: rgba(242, 140, 40, .10);
}

/* ── Лента ── */
.rv-list { display: flex; flex-direction: column; gap: 12px; }
.rv-state { padding: 40px 10px; text-align: center; color: var(--muted2); font-size: .92rem; }
.rv-state.is-error { color: #fca5a5; }

.rv-card {
    padding: 16px; border-radius: 18px;
    border: 1px solid var(--line); background: var(--surface);
}
.rv-card-head { display: flex; align-items: center; gap: 12px; }
.rv-avatar {
    width: 42px; height: 42px; border-radius: 50%; flex: 0 0 auto;
    display: flex; align-items: center; justify-content: center;
    background: rgba(242, 140, 40, .12); color: var(--gold);
    font-weight: 800; font-size: 1.05rem;
}
.rv-who { flex: 1 1 auto; min-width: 0; }
.rv-name { font-weight: 800; color: var(--ink); font-size: .96rem; }
.rv-date { font-size: .76rem; color: var(--muted2); }
.rv-more-count { color: var(--gold); font-weight: 700; }

.rv-toggle {
    width: 34px; height: 34px; border-radius: 12px; flex: 0 0 auto;
    display: flex; align-items: center; justify-content: center;
    border: 1px solid var(--line); background: var(--surface2); color: var(--muted);
    cursor: pointer; transition: transform .2s ease, border-color .18s ease;
}
.rv-toggle svg { width: 18px; height: 18px; }
.rv-card.is-open .rv-toggle { transform: rotate(180deg); border-color: rgba(242, 140, 40, .45); }

.rv-body { margin-top: 10px; }
.rv-stars-static { display: flex; gap: 2px; font-size: 1.05rem; line-height: 1; }
.rv-star-on { color: var(--gold); }
.rv-star-off { color: rgba(246, 239, 232, .18); }

.rv-text {
    margin: 8px 0 0; color: var(--ink); font-size: .92rem; line-height: 1.55;
    white-space: pre-wrap; overflow-wrap: anywhere;
}
.rv-text.is-clamped {
    display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden;
}

.rv-photo-grid { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.rv-photo-thumb {
    width: 86px; height: 86px; object-fit: cover; border-radius: 12px; cursor: zoom-in;
    border: 1px solid var(--line); background: var(--surface2);
}

.rv-extra {
    margin-top: 14px; padding-top: 12px; border-top: 1px dashed var(--line);
    display: flex; flex-direction: column; gap: 14px;
}
/* Без этого правила display:flex перебивает атрибут hidden, и предыдущие
   отзывы гостя видны всегда — «крышечка» перестаёт что-либо скрывать. */
.rv-extra[hidden] { display: none; }
.rv-extra-date { font-size: .74rem; color: var(--muted2); }

/* ── Состав заказа, к которому написан отзыв ── */
.rv-order {
    margin-top: 12px; padding: 12px; border-radius: 14px;
    background: var(--bg2); border: 1px solid var(--line);
    display: flex; flex-direction: column; gap: 10px;
}
/* Без этого правила display:flex перебивает hidden — как и у .rv-extra. */
.rv-order[hidden] { display: none; }
.rv-order-title { font-size: .8rem; font-weight: 800; color: var(--ink); }
.rv-order-item { display: flex; align-items: center; gap: 10px; }
.rv-order-item-img {
    width: 48px; height: 48px; border-radius: 10px; object-fit: cover; flex: 0 0 auto;
    background: var(--surface2);
}
.rv-order-item-info { flex: 1; min-width: 0; }
.rv-order-item-name { font-size: .84rem; font-weight: 700; color: var(--ink); }
.rv-order-item-qty { font-size: .72rem; color: var(--muted2); margin-top: 1px; }
.rv-order-item-gone { font-size: .74rem; font-style: italic; color: var(--muted2); margin-top: 2px; }
.rv-order-item-price {
    display: inline-flex; align-items: center; gap: 3px;
    font-size: .84rem; font-weight: 800; color: var(--gold); margin-top: 2px;
}
.rv-order-item-add {
    flex: 0 0 auto; width: 34px; height: 34px; border-radius: 50%; border: none; cursor: pointer;
    display: flex; align-items: center; justify-content: center; color: #fff;
    background: var(--ember); transition: transform .15s ease, background .15s ease;
}
.rv-order-item-add svg { width: 18px; height: 18px; }
.rv-order-item-add:active { transform: scale(.9); }
.rv-order-item-add.is-added { background: var(--ember2); }

/* ── Обсуждение под отзывом ── */
.rv-thread { margin-top: 12px; }
.rv-comment-list { display: flex; flex-direction: column; gap: 8px; }
.rv-comment {
    padding: 10px 12px; border-radius: 14px;
    background: var(--bg2); border: 1px solid var(--line);
}
/* Ответ заведения читается как «нам ответили», а не как ещё одна реплика гостя. */
.rv-comment.is-staff {
    background: rgba(242, 140, 40, .10);
    border-color: rgba(242, 140, 40, .35);
}
.rv-comment-head {
    display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 4px;
}
.rv-comment-author { font-size: .82rem; font-weight: 800; color: var(--ink); }
.rv-comment.is-staff .rv-comment-author { color: var(--gold); }
.rv-comment-badge {
    font-size: .64rem; font-weight: 800; letter-spacing: .03em; text-transform: uppercase;
    padding: 2px 7px; border-radius: 999px; color: #fff; background: var(--ember);
}
.rv-comment-date { margin-left: auto; font-size: .7rem; color: var(--muted2); }
.rv-comment-text {
    margin: 0; font-size: .88rem; line-height: 1.5; color: var(--ink);
    white-space: pre-wrap; overflow-wrap: anywhere;
}

.rv-comment-form { display: flex; gap: 8px; margin-top: 10px; }
.rv-comment-input {
    flex: 1; min-width: 0; padding: 10px 13px; border-radius: 999px;
    border: 1px solid var(--line2); background: var(--surface); color: var(--ink);
    font-size: .88rem; outline: none;
}
.rv-comment-input:focus { border-color: rgba(242, 140, 40, .65); }
.rv-comment-send {
    flex: 0 0 auto; width: 40px; height: 40px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    border: 1px solid rgba(242, 140, 40, .5); color: #fff; cursor: pointer;
    background: linear-gradient(180deg, var(--ember), var(--ember2));
    transition: transform .16s ease;
}
.rv-comment-send svg { width: 17px; height: 17px; }
.rv-comment-send:active { transform: scale(.94); }
.rv-comment-send:disabled { opacity: .5; cursor: not-allowed; }

/* ── Модальные окна отзывов ── */
.rv-modal-open { overflow: hidden; }
.rv-modal {
    position: fixed; inset: 0; z-index: 26000;
    display: flex; align-items: center; justify-content: center;
    padding: 18px; background: rgba(7, 7, 7, .65);
    -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px);
}
.rv-modal[hidden] { display: none; }
.rv-modal-card {
    position: relative; width: 100%; max-width: 440px;
    max-height: calc(100dvh - 36px); overflow-y: auto;
    padding: 22px; border-radius: 22px;
    background: var(--surface); border: 1px solid var(--line);
    box-shadow: 0 30px 70px rgba(0, 0, 0, .28);
    animation: rvPop .22s cubic-bezier(.22, 1, .36, 1);
}
@keyframes rvPop { from { opacity: 0; transform: translateY(14px) scale(.97); } }
.rv-modal-title {
    margin: 0 0 8px; text-align: center; font-size: 1.18rem; font-weight: 800; color: var(--ink);
}
.rv-modal-close {
    position: absolute; top: 8px; right: 10px; width: 32px; height: 32px;
    border: none; background: none; font-size: 1.7rem; line-height: 1;
    color: var(--muted2); cursor: pointer;
}
.rv-modal-actions { display: flex; gap: 10px; margin-top: 18px; }
.rv-btn-ghost, .rv-btn-primary {
    flex: 1; padding: 12px 14px; border-radius: 14px; font-weight: 800; font-size: .92rem;
    cursor: pointer; text-align: center; text-decoration: none; display: inline-flex;
    align-items: center; justify-content: center;
}
.rv-btn-ghost { border: 1px solid var(--line2); background: var(--surface2); color: var(--ink); }
.rv-btn-primary {
    border: 1px solid rgba(242, 140, 40, .5); color: #fff;
    background: linear-gradient(180deg, var(--ember), var(--ember2));
}
.rv-btn-primary:disabled { opacity: .5; cursor: not-allowed; }

.rv-need-emoji { font-size: 2.6rem; text-align: center; line-height: 1; margin-bottom: 8px; }
.rv-need-text { margin: 6px 0 0; text-align: center; font-size: .9rem; color: var(--muted); }
.rv-need-text strong { color: var(--gold); }

/* ── Форма отзыва ── */
.rv-field-label { display: block; margin: 10px 0 6px; font-size: .78rem; font-weight: 800;
    letter-spacing: .04em; text-transform: uppercase; color: var(--muted2); }
.rv-input, .rv-textarea {
    width: 100%; box-sizing: border-box; padding: 11px 13px; border-radius: 14px;
    border: 1px solid var(--line2); background: var(--bg2); color: var(--ink);
    font-size: .94rem; outline: none;
}
.rv-input:focus, .rv-textarea:focus { border-color: rgba(242, 140, 40, .65); }
.rv-textarea { margin-top: 12px; min-height: 96px; resize: vertical; line-height: 1.5; }

.rv-stars-label { margin: 14px 0 4px; font-size: .78rem; font-weight: 800;
    letter-spacing: .04em; text-transform: uppercase; color: var(--muted2); text-align: center; }
.rv-stars { display: flex; justify-content: center; gap: 6px; }
.rv-star {
    border: none; background: none; cursor: pointer; padding: 2px;
    font-size: 2.1rem; line-height: 1; color: rgba(246, 239, 232, .18);
    transition: transform .14s ease, color .14s ease;
}
.rv-star.is-on { color: var(--gold); }
.rv-star:active { transform: scale(.9); }

.rv-photos { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.rv-photo-item { position: relative; width: 72px; height: 72px; }
.rv-photo-item img {
    width: 100%; height: 100%; object-fit: cover; border-radius: 12px; border: 1px solid var(--line);
}
.rv-photo-remove {
    position: absolute; top: -6px; right: -6px; width: 22px; height: 22px; border-radius: 50%;
    border: 1px solid var(--line); background: var(--surface); color: var(--ink);
    font-size: 1rem; line-height: 1; cursor: pointer;
}
.rv-add-photo {
    display: inline-flex; align-items: center; gap: 8px; margin-top: 12px;
    padding: 10px 14px; border-radius: 14px; border: 1px dashed var(--line2);
    background: var(--surface2); color: var(--muted); font-size: .86rem; font-weight: 700; cursor: pointer;
}
.rv-add-photo svg { width: 18px; height: 18px; }
.rv-add-photo:disabled { opacity: .45; cursor: not-allowed; }

.rv-error { margin: 12px 0 0; font-size: .84rem; color: #fca5a5; text-align: center; }
.rv-error[hidden] { display: none; }
.rv-submit { width: 100%; margin-top: 16px; padding: 14px; }
.rv-compose-note { margin: 10px 0 0; font-size: .76rem; text-align: center; color: var(--muted2); }

/* ── Экран «отзыв опубликован» ── */
.rv-success-card { max-width: 380px; text-align: center; }
.rv-success-text { margin: 8px 0 0; font-size: .92rem; color: var(--muted); }
.rv-check { width: 82px; height: 82px; margin: 4px auto 14px; }
.rv-check svg { width: 100%; height: 100%; }
.rv-check-circle {
    stroke: var(--ember); stroke-width: 3; stroke-dasharray: 160; stroke-dashoffset: 160;
    animation: rvDraw .5s cubic-bezier(.65, 0, .45, 1) forwards;
}
.rv-check-mark {
    stroke: var(--ember); stroke-width: 4; stroke-linecap: round; stroke-linejoin: round;
    stroke-dasharray: 48; stroke-dashoffset: 48;
    animation: rvDraw .32s cubic-bezier(.65, 0, .45, 1) .45s forwards;
}
@keyframes rvDraw { to { stroke-dashoffset: 0; } }
@media (prefers-reduced-motion: reduce) {
    .rv-check-circle, .rv-check-mark { animation: none; stroke-dashoffset: 0; }
    .rv-modal-card { animation: none; }
}

/* ── Просмотр фотографии ── */
.rv-lightbox { background: rgba(0, 0, 0, .88); cursor: zoom-out; }
.rv-lightbox img {
    max-width: 100%; max-height: 92dvh; object-fit: contain; border-radius: 12px;
}

/* Окно нового отзыва: номер и состав оцениваемого заказа (как в приложении). */
.rv-compose-order {
    background: var(--bg2); border: 1px solid var(--line); border-radius: 14px;
    padding: 10px; display: flex; flex-direction: column; gap: 8px; margin: 0 0 12px;
}
.rv-compose-order[hidden] { display: none; }
.rv-compose-order-title { font-size: 13px; font-weight: 800; color: var(--ink); }
.rv-compose-order-row { display: flex; align-items: center; gap: 10px; }
.rv-compose-order-img {
    width: 38px; height: 38px; border-radius: 10px; object-fit: cover; flex: 0 0 auto;
    background: var(--surface2);
}
.rv-compose-order-name { flex: 1; min-width: 0; font-size: 13px; color: var(--ink); }
.rv-compose-order-qty { font-size: 12px; font-weight: 700; color: var(--muted2); white-space: nowrap; }
.rv-thread[hidden] { display: none; }

.rv-stars-points { text-align: center; min-height: 1.2em; margin-top: 4px; font-size: .84rem; font-weight: 800; color: var(--gold); }
.rv-flag { flex: 0 0 auto; width: 30px; height: 30px; border: 0; background: none; color: var(--muted2); font-size: 1rem; cursor: pointer; border-radius: 10px; }
.rv-flag:hover { color: #fca5a5; }
.rv-hidden-note { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 0 0 12px; padding: 10px 14px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); font-size: .84rem; color: var(--muted); }
.rv-hidden-note[hidden] { display: none; }
.rv-hidden-note button { color: var(--gold); font-weight: 800; background: none; border: 0; cursor: pointer; }
.rv-report-reasons { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.rv-report-reason { padding: 12px 14px; border-radius: 14px; border: 1px solid var(--line2); background: var(--surface2); color: var(--ink); font-weight: 700; text-align: left; cursor: pointer; }
.rv-block-author { width: 100%; margin-top: 14px; }
