/**
 * Фото в отзывах: сетка превью, загрузчик (Drag&Drop) и полноэкранный
 * просмотрщик на Fotorama. Палитра сайта: #e86139 / #f9f3e8 / #312817.
 */

/* ------------------------------------------------------------------ */
/*  Заголовок блока отзывов                                            */
/* ------------------------------------------------------------------ */
#seo-reviews > .seo-reviews__title {
    margin: 0 0 22px;
    color: #3b7c1f;
    font-size: clamp(20px, 5.2vw, 32px);
    font-weight: 400;
    line-height: 1.18;
    letter-spacing: .07em;
    text-transform: uppercase;
    text-wrap: balance;
}

#seo-reviews > .seo-reviews__title::after {
    content: "";
    display: block;
    width: 54px;
    height: 2px;
    margin-top: 12px;
    background: #e86139;
}

/* ------------------------------------------------------------------ */
/*  Фото в опубликованном отзыве                                       */
/* ------------------------------------------------------------------ */
.review-photos {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: 8px;
    margin-top: 16px;
}

.review-photos__item {
    position: relative;
    display: block;
    flex: 1 1 140px;
    max-width: 220px;
    min-width: 140px;
    height: 140px;
    padding: 0;
    border: 0;
    border-radius: 8px;
    overflow: hidden;
    background: #f0eade;
    cursor: zoom-in;
    line-height: 0;
    transition: transform .2s ease, box-shadow .2s ease;
}

.review-photos__item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform .35s ease;
}

.review-photos__item:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(49, 40, 23, .22);
}

.review-photos__item:hover img {
    transform: scale(1.06);
}

.review-photos__item:focus-visible {
    outline: 2px solid #e86139;
    outline-offset: 2px;
}

@media (max-width: 766px) {
    .review-photos__item {
        width: 74px;
        height: 74px;
    }
}

/* ------------------------------------------------------------------ */
/*  Загрузчик в форме отзыва                                           */
/* ------------------------------------------------------------------ */
.review-upload {
    margin: 18px 0 6px;
    padding: 16px;
    border: 1px solid #efe2cf;
    border-radius: 8px;
    background: #fff;
}

.review-upload__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.review-upload__title {
    color: #312817;
    font-size: 15px;
    font-weight: 600;
}

.review-upload__title .fa {
    color: #e86139;
    margin-right: 4px;
}

.review-upload__counter {
    color: #8a7a63;
    font-size: 13px;
    white-space: nowrap;
}

.review-upload__grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 12px;
}

.review-upload__grid:empty {
    margin-top: 0;
}

.review-upload__item {
    position: relative;
    width: 92px;
    height: 92px;
    border-radius: 8px;
    overflow: hidden;
    background: #f0eade;
    line-height: 0;
}

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

.review-upload__spinner {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(249, 243, 232, .72);
    color: #e86139;
    font-size: 20px;
    line-height: 1;
}

.review-upload__remove {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 24px;
    height: 24px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: rgba(49, 40, 23, .82);
    color: #fff;
    font-size: 16px;
    line-height: 24px;
    text-align: center;
    cursor: pointer;
    transition: background .2s ease;
}

.review-upload__remove:hover,
.review-upload__remove:focus {
    background: #e86139;
    outline: none;
}

.review-upload__dropzone {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 88px;
    margin-top: 12px;
    padding: 14px;
    border: 2px dashed #d8c6ad;
    border-radius: 8px;
    background: #fdfaf4;
    color: #7b6a52;
    font-size: 13px;
    text-align: center;
    cursor: pointer;
    transition: border-color .2s ease, background .2s ease;
}

.review-upload__dropzone:hover,
.review-upload__dropzone.dz-drag-hover {
    border-color: #e86139;
    background: #fff7ee;
}

.review-upload__plus {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: #e86139;
    color: #fff;
    font-size: 13px;
    line-height: 1;
}

.review-upload__hint {
    margin: 10px 0 0;
    color: #8a7a63;
    font-size: 12px;
    line-height: 1.5;
}

.review-upload__error {
    margin: 10px 0 0;
    padding: 8px 12px;
    border-radius: 6px;
    background: #fdecea;
    color: #b3261e;
    font-size: 13px;
}

.review-upload__status {
    margin: 10px 0 0;
    color: #e86139;
    font-size: 13px;
    font-weight: 600;
}

.review-upload__item.is-processing img {
    opacity: .4;
}

.review-upload.is-busy .review-upload__dropzone {
    pointer-events: none;
    opacity: .6;
}

.review-upload.is-full .review-upload__dropzone {
    display: none;
}

/* ------------------------------------------------------------------ */
/*  Полноэкранный просмотрщик (Fotorama)                               */
/* ------------------------------------------------------------------ */
/*
 * Не фиксируем body через position: fixed: это обнуляет scrollTop и
 * заставляет ScrollToFixed пересчитать правый .sticky из статичного
 * состояния. У статичного и fixed/absolute состояний разная высота,
 * поэтому после закрытия просмотрщика блок уезжал ниже .limit_box.
 * Блокируем прокрутку, не меняя геометрию документа; позицию скролла
 * сохраняет/восстанавливает review-photos.js.
 */
html.review-viewer-open,
body.review-viewer-open {
    overflow: hidden;
}

/*
 * Jivo-чат рисуется с z-index 2147483646 и иначе остаётся поверх
 * полноэкранного просмотрщика (перекрывает миниатюры и ломает вид модалки).
 * Прячем только на время просмотра; состояние чата не трогаем.
 */
body.review-viewer-open #jivo-iframe-container {
    visibility: hidden !important;
}

.review-viewer {
    overscroll-behavior: contain;
}

.review-viewer {
    position: fixed;
    inset: 0;
    /*
     * 100001 — выше .top_header (99999) и .to_top (100000). Сам оверлей
     * переносится из .container в body в review-photos.js: внутри контейнера
     * (position: relative; z-index: 1) любой z-index остаётся под шапкой.
     */
    z-index: 100001;
    display: none;
}

.review-viewer.is-open {
    display: block;
}

.review-viewer__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(18, 14, 10, .94);
}

.review-viewer__dialog {
    position: relative;
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
    padding: 18px 18px 8px;
}

.review-viewer__close {
    position: absolute;
    top: 14px;
    right: 18px;
    z-index: 30;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-width: 44px;
    height: 44px;
    padding: 0 14px;
    border: 1px solid rgba(255, 255, 255, .28);
    border-radius: 22px;
    background: rgba(255, 255, 255, .12);
    color: #fff;
    font-family: "Poppins", sans-serif;
    font-size: 13px;
    font-weight: 500;
    line-height: 1;
    white-space: nowrap;
    cursor: pointer;
    transition: background .2s ease, border-color .2s ease;
}

.review-viewer__close .fa {
    font-size: 16px;
}

.review-viewer__close:hover,
.review-viewer__close:focus {
    background: #e86139;
    border-color: #e86139;
    outline: none;
}

.review-viewer__stage {
    flex: 1 1 auto;
    width: 100%;
    min-height: 0;
    height: calc(100vh - 90px);
}

.review-viewer__stage .fotorama {
    background: transparent;
}

.review-viewer .fotorama__nav-wrap--horizontal {
    margin-top: 6px;
}

.review-viewer .fotorama__arr {
    opacity: .85;
}

.review-viewer .fotorama__thumb-border {
    border-color: #e86139;
}

@media (max-width: 766px) {
    .review-viewer__dialog {
        padding: 10px 8px 4px;
    }

    .review-viewer__close {
        top: 8px;
        right: 10px;
    }

    .review-viewer__stage {
        height: calc(100vh - 70px);
    }
}
