/* Отзывы: блок на детальной странице, форма и лента фотографий гостей.
   Префикс rv- намеренно короткий и свой — блок вставляется в чужие шаблоны
   туров и отелей, и пересечься с их классами нельзя. */

.rv-block,
.rv-wall,
.rv-modal {
    --rv-accent: #00b6aa;
    --rv-accent-dark: #009c92;
    --rv-star: #ffb020;
    --rv-ink: #0f172a;
    --rv-muted: #64748b;
    --rv-line: #e2e8f0;
    --rv-soft: #f8fafc;
    --rv-danger: #dc2626;
    --rv-radius: 16px;
}

/* Атрибут hidden проигрывает display в стилях — прибиваем явно. */
.rv-block [hidden],
.rv-modal[hidden],
.rv-wall [hidden] {
    display: none !important;
}

/* ===== Звёзды ===== */

.rv-stars {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    line-height: 1;
    vertical-align: middle;
}

.rv-star {
    width: 18px;
    height: 18px;
    flex: 0 0 auto;
}

.rv-stars--sm .rv-star {
    width: 15px;
    height: 15px;
}

.rv-stars--lg .rv-star {
    width: 24px;
    height: 24px;
}

.rv-star__bg {
    fill: #dfe5ec;
}

.rv-star__fg {
    fill: var(--rv-star);
}

.rv-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: var(--rv-ink);
}

.rv-badge__value {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 42px;
    height: 26px;
    padding: 0 8px;
    border-radius: 8px;
    background: var(--rv-accent);
    color: #ffffff;
    font-weight: 700;
}

.rv-badge__count {
    color: var(--rv-muted);
    font-size: 13px;
}

.rv-icon {
    width: 20px;
    height: 20px;
    flex: 0 0 auto;
}

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

.rv-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 48px;
    padding: 0 24px;
    border: 1px solid transparent;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
    transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}

.rv-btn--primary {
    background: var(--rv-accent);
    color: #ffffff;
}

.rv-btn--primary:hover {
    background: var(--rv-accent-dark);
    color: #ffffff;
}

.rv-btn--ghost {
    border-color: var(--rv-line);
    background: #ffffff;
    color: var(--rv-ink);
}

.rv-btn--ghost:hover {
    border-color: var(--rv-accent);
    color: var(--rv-accent-dark);
}

.rv-btn--ghost b {
    padding: 2px 8px;
    border-radius: 6px;
    background: var(--rv-soft);
    color: var(--rv-muted);
    font-size: 13px;
}

.rv-btn[disabled] {
    opacity: .6;
    cursor: default;
}

/* ===== Блок отзывов ===== */

/* Блок — это <section>, а у шаблона сайта секции получают padding 60px 0:
   вокруг отзывов появлялась полоса пустоты в полэкрана. */
.rv-block {
    margin: 40px 0;
    padding: 0;
    color: var(--rv-ink);
    scroll-margin-top: 90px;
}

.rv-block__head {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 24px;
}

.rv-block .rv-block__title {
    margin: 0 0 8px;
    font-size: clamp(22px, 2.4vw, 28px);
    font-weight: 700;
    line-height: 1.2;
}

.rv-block .rv-block__subtitle {
    max-width: 620px;
    margin: 0;
    color: var(--rv-muted);
    font-size: 15px;
    line-height: 1.6;
}

/* Сводка */

.rv-summary {
    display: grid;
    grid-template-columns: minmax(0, 220px) minmax(0, 1fr);
    gap: 28px;
    align-items: center;
    margin-bottom: 28px;
    padding: 24px;
    border: 1px solid var(--rv-line);
    border-radius: var(--rv-radius);
    background: var(--rv-soft);
}

.rv-summary__score {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    text-align: center;
}

.rv-summary__value {
    font-size: 46px;
    font-weight: 700;
    line-height: 1;
}

.rv-summary__verdict {
    font-size: 15px;
    font-weight: 600;
    color: var(--rv-accent-dark);
}

.rv-summary__count {
    color: var(--rv-muted);
    font-size: 13px;
}

.rv-summary__bars {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.rv-summary__bar {
    display: grid;
    grid-template-columns: 14px minmax(0, 1fr) 32px;
    gap: 10px;
    align-items: center;
    font-size: 13px;
    color: var(--rv-muted);
}

.rv-summary__bar-track {
    height: 8px;
    border-radius: 9999px;
    background: #e6ebf1;
    overflow: hidden;
}

.rv-summary__bar-fill {
    display: block;
    height: 100%;
    border-radius: 9999px;
    background: var(--rv-star);
}

.rv-summary__bar-count {
    text-align: right;
}

/* Список */

.rv-block__list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.rv-item {
    padding: 22px 24px;
    border: 1px solid var(--rv-line);
    border-radius: var(--rv-radius);
    background: #ffffff;
}

/* Свой отзыв выделяем рамкой — человек должен сразу увидеть его среди прочих. */
.rv-item--own {
    border-color: rgba(0, 182, 170, .45);
    box-shadow: 0 0 0 3px rgba(0, 182, 170, .08);
}

.rv-item__head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
}

.rv-item__avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    flex: 0 0 auto;
    border-radius: 50%;
    overflow: hidden;
}

/* Фотография автора: кроп по центру, иначе портрет в круглой маске уезжает. */
.rv-item__avatar--photo {
    object-fit: cover;
}

/* Фото нет — картинка из отпускного набора. Фон и цвет ставит
   App\Reviews\View\ReviewsAvatarView: они свои у каждой картинки. */
.rv-item__avatar--icon {
    background: linear-gradient(135deg, #00b6aa, #4351dd);
    color: #ffffff;
}

.rv-item__avatar-icon {
    width: 24px;
    height: 24px;
}

.rv-item__ident {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-right: auto;
    min-width: 0;
}

.rv-item__author {
    font-size: 15px;
    font-weight: 600;
}

.rv-item__meta {
    color: var(--rv-muted);
    font-size: 13px;
}

.rv-item__own-badge {
    padding: 4px 10px;
    border-radius: 9999px;
    background: rgba(0, 182, 170, .12);
    color: var(--rv-accent-dark);
    font-size: 12px;
    font-weight: 700;
}

.rv-item__text {
    font-size: 15px;
    line-height: 1.65;
    overflow-wrap: anywhere;
}

.rv-item__aspects {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-top: 14px;
}

.rv-item__aspect {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 12px 14px;
    border-radius: 12px;
    background: var(--rv-soft);
    font-size: 14px;
    line-height: 1.5;
    overflow-wrap: anywhere;
}

.rv-item__aspect-title {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 700;
}

.rv-item__aspect--pros .rv-item__aspect-title {
    color: #0f9d58;
}

.rv-item__aspect--cons .rv-item__aspect-title {
    color: var(--rv-danger);
}

.rv-item__aspect .rv-icon {
    width: 15px;
    height: 15px;
}

.rv-item__photos {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 14px;
}

.rv-item__photo {
    display: block;
    width: 92px;
    height: 92px;
    border-radius: 12px;
    overflow: hidden;
}

.rv-item__photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .2s ease;
}

.rv-item__photo:hover img {
    transform: scale(1.06);
}

.rv-item__foot {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px solid var(--rv-line);
}

.rv-item__helpful {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 0;
    border: none;
    background: none;
    color: var(--rv-muted);
    font-size: 14px;
    cursor: pointer;
    transition: color .15s ease;
}

.rv-item__helpful:hover,
.rv-item__helpful.is-active {
    color: var(--rv-accent-dark);
}

.rv-item__helpful .rv-icon {
    width: 18px;
    height: 18px;
}

.rv-item__helpful b {
    padding: 1px 7px;
    border-radius: 6px;
    background: var(--rv-soft);
    font-size: 12px;
}

.rv-block__more {
    display: flex;
    justify-content: center;
    margin-top: 20px;
}

.rv-block__status {
    margin-top: 16px;
    padding: 14px 16px;
    border-radius: 12px;
    background: rgba(0, 182, 170, .1);
    color: var(--rv-accent-dark);
    font-size: 14px;
    line-height: 1.5;
}

/* ===== Лента фотографий гостей ===== */

.rv-wall {
    margin: 18px 0 26px;
    padding: 18px 20px;
    border: 1px solid var(--rv-line);
    border-radius: var(--rv-radius);
    background: #ffffff;
}

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

.rv-wall__title {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 16px;
    font-weight: 700;
    color: var(--rv-ink);
}

.rv-wall__link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--rv-accent-dark);
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
}

.rv-wall__link .rv-icon {
    width: 16px;
    height: 16px;
}

/* Горизонтальная лента со скроллом: снимков может быть двенадцать, а
   ширины на них нет — вертикальную сетку тут разворачивать незачем. */
.rv-wall__strip {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 4px;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
}

.rv-wall__strip::-webkit-scrollbar {
    height: 6px;
}

.rv-wall__strip::-webkit-scrollbar-thumb {
    border-radius: 9999px;
    background: #cbd5e1;
}

.rv-wall__item {
    position: relative;
    display: block;
    width: 116px;
    height: 116px;
    flex: 0 0 auto;
    border-radius: 12px;
    overflow: hidden;
    scroll-snap-align: start;
}

.rv-wall__item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .2s ease;
}

.rv-wall__item:hover img {
    transform: scale(1.06);
}

.rv-wall__rest {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(15, 23, 42, .55);
    color: #ffffff;
    font-size: 19px;
    font-weight: 700;
}

/* ===== Модальное окно с формой ===== */

.rv-modal {
    position: fixed;
    z-index: 10000;
    inset: 0;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 24px 16px;
    overflow-y: auto;
}

.rv-modal__overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, .55);
    backdrop-filter: blur(2px);
}

.rv-modal__window {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 640px;
    margin: auto;
    padding: 32px;
    border-radius: 20px;
    background: #ffffff;
    box-shadow: 0 24px 70px rgba(15, 23, 42, .25);
}

.rv-modal__close {
    position: absolute;
    top: 16px;
    right: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border: none;
    border-radius: 50%;
    background: var(--rv-soft);
    color: var(--rv-muted);
    cursor: pointer;
}

.rv-modal__close:hover {
    color: var(--rv-ink);
}

/* Форма */

.rv-form .rv-form__title {
    margin: 0 0 22px;
    font-size: 24px;
    font-weight: 700;
}

.rv-form__field {
    margin-bottom: 18px;
}

.rv-form__row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0 16px;
}

.rv-form__label {
    display: block;
    margin-bottom: 7px;
    font-size: 14px;
    font-weight: 600;
}

.rv-form__req {
    color: var(--rv-accent-dark);
}

.rv-form .rv-form__input {
    width: 100%;
    height: 48px;
    padding: 0 16px;
    border: 1px solid var(--rv-line);
    border-radius: 12px;
    background: #ffffff;
    color: var(--rv-ink);
    font-size: 16px;
    font-family: inherit;
    outline: none;
    transition: border-color .15s ease, box-shadow .15s ease;
}

.rv-form .rv-form__textarea {
    height: auto;
    min-height: 130px;
    padding: 14px 16px;
    line-height: 1.55;
    resize: vertical;
}

.rv-form .rv-form__input:focus {
    border-color: var(--rv-accent);
    box-shadow: 0 0 0 4px rgba(0, 182, 170, .13);
}

.rv-form__field.is-invalid .rv-form__input {
    border-color: var(--rv-danger);
}

.rv-form__counter {
    margin-top: 6px;
    color: var(--rv-muted);
    font-size: 12px;
    text-align: right;
}

.rv-form__hint {
    margin-top: 6px;
    color: var(--rv-muted);
    font-size: 13px;
    line-height: 1.5;
}

.rv-form__error {
    margin-top: 6px;
    color: var(--rv-danger);
    font-size: 13px;
    line-height: 1.45;
}

.rv-form__error--global {
    margin: 0 0 16px;
    padding: 12px 14px;
    border-radius: 12px;
    background: rgba(220, 38, 38, .08);
}

.rv-form__submit {
    width: 100%;
    height: 52px;
    margin-top: 4px;
}

.rv-form .rv-form__policy {
    margin: 12px 0 0;
    color: var(--rv-muted);
    font-size: 12px;
    line-height: 1.5;
    text-align: center;
}

.rv-form__policy a {
    color: var(--rv-accent-dark);
}

/* Оценка звёздами */

.rv-rate {
    display: flex;
    align-items: center;
    gap: 4px;
}

.rv-rate__star {
    padding: 2px;
    border: none;
    background: none;
    color: #dfe5ec;
    cursor: pointer;
    transition: transform .12s ease, color .12s ease;
}

.rv-rate__star .rv-icon {
    width: 34px;
    height: 34px;
    fill: currentColor;
    stroke: none;
}

.rv-rate__star:hover {
    transform: scale(1.12);
}

.rv-rate__star.is-filled {
    color: var(--rv-star);
}

.rv-rate__hint {
    margin-left: 10px;
    color: var(--rv-muted);
    font-size: 14px;
}

/* Загрузка фотографий */

.rv-drop {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 22px 18px;
    border: 1px dashed var(--rv-line);
    border-radius: 14px;
    background: var(--rv-soft);
    color: var(--rv-muted);
    text-align: center;
    cursor: pointer;
    transition: border-color .15s ease, background-color .15s ease;
}

.rv-drop:hover,
.rv-drop.is-dragover {
    border-color: var(--rv-accent);
    background: rgba(0, 182, 170, .06);
}

.rv-drop input[type="file"] {
    position: absolute;
    width: 0;
    height: 0;
    opacity: 0;
}

.rv-drop .rv-icon {
    width: 28px;
    height: 28px;
    color: var(--rv-accent-dark);
}

.rv-drop__title {
    color: var(--rv-ink);
    font-size: 14px;
    font-weight: 600;
}

.rv-drop__hint {
    font-size: 12px;
}

.rv-drop__preview {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.rv-drop__preview:empty {
    margin-top: 0;
}

.rv-thumb {
    position: relative;
    width: 78px;
    height: 78px;
    border-radius: 10px;
    overflow: hidden;
}

.rv-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.rv-thumb__remove {
    position: absolute;
    top: 4px;
    right: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border: none;
    border-radius: 50%;
    background: rgba(15, 23, 42, .65);
    color: #ffffff;
    font-size: 15px;
    line-height: 1;
    cursor: pointer;
}

/* Просмотр фотографии на весь экран */

.rv-lightbox {
    position: fixed;
    z-index: 10001;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px 16px;
    background: rgba(15, 23, 42, .9);
}

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

.rv-lightbox__close,
.rv-lightbox__nav {
    position: absolute;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, .14);
    color: #ffffff;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
}

.rv-lightbox__close {
    top: 20px;
    right: 20px;
}

.rv-lightbox__nav--prev {
    left: 20px;
}

.rv-lightbox__nav--next {
    right: 20px;
}

.rv-lightbox__counter {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255, 255, 255, .8);
    font-size: 13px;
}

/* ===== Мобильные ===== */

@media (max-width: 767px) {
    .rv-block__head {
        flex-direction: column;
        align-items: stretch;
    }

    .rv-block__head .rv-btn {
        width: 100%;
    }

    .rv-summary {
        grid-template-columns: minmax(0, 1fr);
        gap: 18px;
        padding: 20px 16px;
    }

    .rv-item {
        padding: 18px 16px;
    }

    .rv-item__aspects {
        grid-template-columns: minmax(0, 1fr);
    }

    .rv-item__photo {
        width: 76px;
        height: 76px;
    }

    .rv-form__row {
        grid-template-columns: minmax(0, 1fr);
    }

    .rv-modal {
        padding: 0;
    }

    /* На телефоне форма занимает весь экран: модалка в 640px посреди
       маленького экрана превращается в неудобный колодец. */
    .rv-modal__window {
        min-height: 100%;
        max-width: none;
        margin: 0;
        padding: 24px 16px 32px;
        border-radius: 0;
    }

    .rv-rate__star .rv-icon {
        width: 38px;
        height: 38px;
    }

    .rv-wall {
        padding: 16px;
    }

    .rv-wall__item {
        width: 104px;
        height: 104px;
    }
}


/* --- Фотография автора в форме --------------------------------------- */

.rv-form__field--avatar {
    flex: 1 1 100%;
}

.rv-avatar-pick {
    display: flex;
    align-items: center;
    gap: 14px;
    cursor: pointer;
}

.rv-avatar-pick input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.rv-avatar-pick__frame {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    flex: 0 0 auto;
    border: 1px dashed #c7cede;
    border-radius: 50%;
    background: #f4f6fb;
    color: #7b8598;
    overflow: hidden;
    transition: border-color .15s ease, color .15s ease;
}

.rv-avatar-pick:hover .rv-avatar-pick__frame,
.rv-avatar-pick input:focus-visible + .rv-avatar-pick__frame {
    border-color: #4351dd;
    color: #4351dd;
}

.rv-avatar-pick__frame svg {
    width: 24px;
    height: 24px;
}

/* Выбранный снимок заполняет кружок целиком — рамка и отступы не нужны. */
.rv-avatar-pick__frame.is-filled {
    border-style: solid;
    border-color: transparent;
}

.rv-avatar-pick__frame img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.rv-avatar-pick__hint {
    font-size: 13px;
    line-height: 1.35;
    color: #7b8598;
}

.rv-avatar-pick__drop {
    margin-top: 8px;
    padding: 0;
    border: 0;
    background: none;
    color: #4351dd;
    font-size: 13px;
    cursor: pointer;
}

.rv-avatar-pick__drop:hover {
    text-decoration: underline;
}
