/* =========================================================
   ZIAJA PRODUCT REVIEWS
========================================================= */

.ziaja-product-reviews {
    --zrv-green: #1A5B1E;
    --zrv-green-dark: #144A18;
    --zrv-title: #182730;
    --zrv-text: #202622;
    --zrv-muted: #718096;
    --zrv-star: #F39800;
    --zrv-line: #E3E7E4;
    --zrv-reply-line: #D7DEE5;
    --zrv-track: #D9DEE2;
    --zrv-white: #FFFFFF;

    width: 100%;
    padding: 0 16px 24px;
    border-radius: 14px;
    background: #fff;
    color: var(--zrv-title);
}

.ziaja-product-reviews *,
.ziaja-product-reviews *::before,
.ziaja-product-reviews *::after {
    box-sizing: border-box;
}

/* =========================================================
   HEADING
========================================================= */

.zrv-heading {
    padding: 14px 0 15px;
    border-bottom: 1px solid var(--zrv-line);
}

.zrv-heading__title {
    display: flex;
    align-items: baseline;
    gap: 4px;
    color: #111;
}

.zrv-heading__title strong {
    font-size: 17px;
    line-height: 1.35;
    font-weight: 700;
}

.zrv-heading__title span {
    color: #738078;
    font-size: 13px;
}

/* =========================================================
   SUMMARY
========================================================= */

.zrv-summary {
    display: grid;
    grid-template-columns: 160px minmax(280px, 360px);
    gap: 18px;
    align-items: center;
    padding: 18px 0 16px;
    border-bottom: 1px solid var(--zrv-line);
}

.zrv-summary__label {
    margin-bottom: 7px;
    color: #404942;
    font-size: 13px;
    font-weight: 600;
}

.zrv-summary__average {
    display: flex;
    align-items: center;
    gap: 7px;
    margin-bottom: 10px;
}

.zrv-summary__average span {
    color: #101B34;
    font-size: 34px;
    line-height: 1;
    font-weight: 700;
}

.zrv-summary__average svg {
    width: 24px;
    height: 24px;
    fill: var(--zrv-star);
}

/* =========================================================
   BUTTONS
========================================================= */

.zrv-open-modal {
    border: 0 !important;
    box-shadow: none !important;
    cursor: pointer;
}

.zrv-summary__button,
.zrv-empty__button {
    min-height: 42px;
    margin: 0 !important;
    padding: 9px 23px !important;
    background: var(--zrv-green) !important;
    color: #fff !important;
    font-size: 14px !important;
    font-weight: 500 !important;
}

.zrv-summary__button:hover,
.zrv-empty__button:hover {
    background: var(--zrv-green-dark) !important;
}

/* =========================================================
   DISTRIBUTION
========================================================= */

.zrv-summary__distribution {
    display: grid;
    gap: 5px;
}

.zrv-distribution-row {
    display: grid;
    grid-template-columns: 95px minmax(140px, 230px) 28px;
    gap: 8px;
    align-items: center;
}

.zrv-stars {
    display: inline-flex;
    align-items: center;
    gap: 1px;
}

.zrv-stars svg {
    width: 18px;
    height: 18px;
    fill: #788693;
    stroke: none;
}

.zrv-stars svg.is-active {
    fill: var(--zrv-star);
}

.zrv-distribution-bar {
    height: 8px;
    border-radius: 999px;
    background: var(--zrv-track);
    overflow: hidden;
}

.zrv-distribution-bar span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: var(--zrv-star);
}

.zrv-distribution-count {
    color: #10203A;
    font-size: 12px;
}

/* =========================================================
   FILTERS
========================================================= */

.zrv-filters {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    padding: 15px 0;
}

.zrv-filters__label {
    margin-right: 4px;
    color: #4D554F;
    font-size: 13px;
}

.zrv-filter {
    min-height: 32px;
    margin: 0 !important;
    padding: 5px 14px !important;
    border: 1px solid #DCE1DE !important;
    border-radius: 999px !important;
    background: #fff !important;
    color: #4D5863 !important;
    font-size: 12px !important;
    font-weight: 400 !important;
    box-shadow: none !important;
    cursor: pointer;
}

.zrv-filter:hover,
.zrv-filter.is-active {
    border-color: var(--zrv-green) !important;
    background: rgba(26, 91, 30, .035) !important;
    color: var(--zrv-green) !important;
}

/* =========================================================
   REVIEW LIST
========================================================= */

.zrv-list {
    display: grid;
    width: 100%;
}

.zrv-review {
    --zrv-avatar-size: 48px;
    --zrv-review-gap: 14px;

    position: relative;
    display: grid;
    grid-template-columns: var(--zrv-avatar-size) minmax(0, 1fr);
    gap: var(--zrv-review-gap);
    width: 100%;
    padding: 18px 0;
}

.zrv-review__avatar {
    position: relative;
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: center;
    width: var(--zrv-avatar-size);
    height: var(--zrv-avatar-size);
    border-radius: 50%;
    background: #D7DDE2;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
}

.zrv-review__main {
    position: relative;
    z-index: 2;
    min-width: 0;
}

.zrv-review__author {
    margin-bottom: 8px;
    color: #556073;
    font-size: 14px;
    font-weight: 700;
}

.zrv-review__rating-line {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-bottom: 6px;
}

.zrv-review__rating-number {
    color: #566174;
    font-size: 13px;
}

.zrv-review__single-star {
    width: 16px;
    height: 16px;
    fill: var(--zrv-star);
}

.zrv-review__text {
    color: var(--zrv-text);
    font-size: 13px;
    line-height: 1.6;
}

.zrv-review__text p {
    margin: 0 0 5px;
}

.zrv-review__text p:last-child {
    margin-bottom: 0;
}

/* =========================================================
   REVIEW META + REPLY BUTTON
========================================================= */

.zrv-review__meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 6px;
    color: var(--zrv-muted);
    font-size: 11px;
    line-height: 1.4;
}

.zrv-review__dot {
    color: #A3ACB5;
}

.zrv-review__reply-button {
    display: inline-flex !important;
    align-items: center;
    width: auto !important;
    min-width: 0 !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    color: var(--zrv-green) !important;
    font-size: 11px !important;
    line-height: 1.4 !important;
    font-weight: 500 !important;
    text-transform: none !important;
    box-shadow: none !important;
    cursor: pointer;
}

.zrv-review__reply-button:hover {
    color: var(--zrv-green-dark) !important;
    text-decoration: underline;
}

/* =========================================================
   PROFESSIONAL CONNECTOR LINE
========================================================= */

.zrv-review.has-replies::before {
    content: "";
    position: absolute;
    top: calc(18px + var(--zrv-avatar-size));
    left: calc(var(--zrv-avatar-size) / 2);
    bottom: 24px;
    width: 1px;
    background: var(--zrv-reply-line);
    transform: translateX(-50%);
    pointer-events: none;
    z-index: 1;
}

.zrv-review__replies {
    position: relative;
    z-index: 3;
    margin-top: 14px;
    margin-left: -38px;
    padding-left: 40px;
    display: grid;
    gap: 14px;
}

.zrv-reply {
    position: relative;
    z-index: 4;
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr);
    gap: 13px;
    align-items: start;
    margin: 0;
}

.zrv-reply::before {
    content: "";
    position: absolute;
    left: -40px;
    top: 5px;
    width: 29px;
    height: 18px;
    border-left: 1px solid var(--zrv-reply-line);
    border-bottom: 1px solid var(--zrv-reply-line);
    border-bottom-left-radius: 14px;
    pointer-events: none;
    z-index: 2;
}
.zrv-distribution-stars {
    line-height: 1;
}
.zrv-review__replies > .zrv-reply:last-child::after {
    content: "";
    position: absolute;
    left: -42px;
    top: 14px;
    bottom: -20px;
    width: 3px;
    background: var(--zrv-white);
    border-radius: 99px;
    pointer-events: none;
    z-index: 3;
}

.zrv-reply__avatar {
    position: relative;
    z-index: 6;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--zrv-green);
    color: #fff;
    overflow: hidden;
    font-size: 11px;
    font-weight: 600;
}

.zrv-reply__avatar-img {
    display: block !important;
    width: 100% !important;
    height: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 0 !important;
    border-radius: 50%;
    object-fit: cover;
}

.zrv-reply__content {
    min-width: 0;
}

.zrv-reply__head {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 7px;
    margin-bottom: 6px;
}

.zrv-reply__head strong {
    color: #596274;
    font-size: 13px;
    font-weight: 700;
}

.zrv-reply__badge {
    display: inline-flex;
    align-items: center;
    min-height: 20px;
    padding: 2px 6px;
    border-radius: 3px;
    background: #E7F0FF;
    color: #2563D8;
    font-size: 10px;
    font-weight: 500;
}

.zrv-reply__text {
    color: #242A26;
    font-size: 13px;
    line-height: 1.6;
}

.zrv-reply__text p {
    margin: 0 0 5px;
}

.zrv-reply__text p:last-child {
    margin-bottom: 0;
}

.zrv-reply__meta {
    margin-top: 5px;
    color: var(--zrv-muted);
    font-size: 11px;
}

/* =========================================================
   LOAD MORE
========================================================= */

.zrv-load-more-wrap {
    display: flex;
    justify-content: center;
    padding-top: 16px;
}

.zrv-load-more {
    min-height: 38px;
    margin: 0 !important;
    padding: 7px 19px !important;
    border: 1px solid var(--zrv-green) !important;
    border-radius: 999px !important;
    background: #fff !important;
    color: var(--zrv-green) !important;
    font-size: 12px !important;
    font-weight: 500 !important;
    box-shadow: none !important;
    cursor: pointer;
}

.zrv-load-more:hover {
    background: var(--zrv-green) !important;
    color: #fff !important;
}

.zrv-load-more[hidden] {
    display: none !important;
}

/* =========================================================
   EMPTY
========================================================= */

.zrv-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 170px;
    padding: 24px;
    text-align: center;
}

.zrv-empty__stars {
    position: relative;
    margin-bottom: 4px;
}

.zrv-empty__star {
    position: absolute;
    fill: none;
    stroke: #111;
    stroke-width: 1.55;
    stroke-linejoin: round;
}

.zrv-empty__star--1 {
    top: 18px;
    left: 26px;
}

.zrv-empty__star--2 {
    top: 0;
    right: 12px;
}

.zrv-empty__star--3 {
    right: 0;
    bottom: 4px;
}

.zrv-empty p {
    margin: 0 0 12px;
    color: #182730;
    font-size: 14px;
    line-height: 1.5;
}

/* =========================================================
   MODAL
========================================================= */

html.zrv-modal-open,
body.zrv-modal-open {
    overflow: hidden;
}

.zrv-modal {
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 18px;
    opacity: 0;
    visibility: hidden;
    transition: opacity .25s ease, visibility .25s ease;
}

.zrv-modal.is-open {
    opacity: 1;
    visibility: visible;
}

.zrv-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(35, 45, 59, .56);
}

.zrv-modal__dialog {
    position: relative;
    z-index: 2;
    width: min(600px, 100%);
    max-height: calc(100vh - 36px);
    border-radius: 14px;
    background: #fff;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(24, 39, 48, .18);
    transform: translateY(10px) scale(.985);
    transition: transform .28s ease;
}

.zrv-modal.is-open .zrv-modal__dialog {
    transform: translateY(0) scale(1);
}

.zrv-modal__header {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 60px;
    padding: 12px 58px;
    border-bottom: 1px solid #E6E9E7;
}

.zrv-modal__header h3 {
    margin: 0 !important;
    padding: 0 !important;
    color: #182730;
    font-size: 21px !important;
    line-height: 1.35 !important;
    font-weight: 600 !important;
    text-align: center;
}

.zrv-modal__close {
    position: absolute;
    top: 50%;
    right: 14px;
    display: grid !important;
    place-items: center;
    width: 38px;
    height: 38px;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    color: #182730 !important;
    box-shadow: none !important;
    cursor: pointer;
    transform: translateY(-50%);
}

.zrv-modal__close svg {
    display: block;
    width: 24px;
    height: 24px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
}

/* =========================================================
   FORM
========================================================= */

.zrv-form {
    max-height: calc(100vh - 96px);
    padding: 16px;
    overflow-y: auto;
    overscroll-behavior: contain;
}

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

.zrv-form input,
.zrv-form textarea {
    display: block;
    width: 100%;
    margin: 0 0 14px !important;
    border: 1px solid #CDD5D0 !important;
    border-radius: 8px !important;
    outline: 0 !important;
    background: #fff !important;
    color: #182730 !important;
    font-size: 14px !important;
    font-weight: 400 !important;
    box-shadow: none !important;
    transition: border-color .2s ease, box-shadow .2s ease;
}

.zrv-form input {
    height: 50px;
    padding: 0 14px !important;
}

.zrv-form textarea {
    min-height: 118px;
    padding: 12px 14px !important;
    resize: vertical;
}

.zrv-form input:focus,
.zrv-form textarea:focus {
    border-color: var(--zrv-green) !important;
    box-shadow: 0 0 0 2px rgba(26, 91, 30, .08) !important;
}

.zrv-form__message {
    margin-bottom: 12px;
    padding: 10px 12px;
    border-radius: 6px;
    font-size: 12px;
    line-height: 1.45;
}

.zrv-form__message.is-error {
    background: #FFF2F2;
    color: #A52323;
}

.zrv-form__message.is-success {
    background: #F0F8EF;
    color: var(--zrv-green);
}

.zrv-submit {
    display: flex !important;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 48px;
    margin: 0 !important;
    padding: 10px 16px !important;
    border: 1px solid var(--zrv-green) !important;
    border-radius: 999px !important;
    background: var(--zrv-green) !important;
    color: #fff !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    box-shadow: none !important;
    cursor: pointer;
}

.zrv-submit:hover {
    background: var(--zrv-green-dark) !important;
}

.zrv-submit:disabled {
    opacity: .65;
    pointer-events: none;
}

/* =========================================================
   PRODUCT IN REVIEW MODAL
========================================================= */

.zrv-product {
    display: grid;
    grid-template-columns: 62px minmax(0, 1fr);
    gap: 14px;
    align-items: center;
    margin-bottom: 14px;
}

.zrv-product__image {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 62px;
    height: 62px;
    border: 1px solid #E1E5E2;
    border-radius: 8px;
    background: #FCF7F1;
    overflow: hidden;
}

.zrv-product__image img {
    display: block;
    width: 100% !important;
    height: 100% !important;
    max-width: none !important;
    object-fit: contain;
}

.zrv-product__name {
    min-width: 0;
    color: #182730;
    font-size: 15px;
    line-height: 1.45;
    font-weight: 500;
}

/* =========================================================
   RATING PICKER
========================================================= */

.zrv-rating-picker {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 15px;
}

.zrv-rating-picker__stars {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

.zrv-rating-star {
    display: grid !important;
    place-items: center;
    width: 32px;
    height: 32px;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    cursor: pointer;
}

.zrv-rating-star svg {
    display: block;
    width: 30px;
    height: 30px;
    fill: #E1E5E2;
    stroke: none;
}

.zrv-rating-star.is-active svg {
    fill: var(--zrv-star);
}

.zrv-rating-picker__label {
    min-height: 20px;
    margin-top: 5px;
    color: var(--zrv-star);
    font-size: 14px;
    font-weight: 500;
}

/* =========================================================
   MOBILE
========================================================= */

@media (max-width: 767px) {

    .ziaja-product-reviews {
        padding: 0 12px 20px;
        border-radius: 10px;
    }

    .zrv-summary {
        grid-template-columns: 1fr;
        gap: 18px;
    }

    .zrv-summary__distribution {
        width: 100%;
        max-width: 370px;
    }

    .zrv-distribution-row {
        grid-template-columns: 95px minmax(100px, 1fr) 24px;
    }

    .zrv-review {
        --zrv-avatar-size: 40px;
        --zrv-review-gap: 10px;
        padding: 16px 0;
    }

    .zrv-review__avatar {
        width: 40px;
        height: 40px;
        font-size: 12px;
    }

    .zrv-review.has-replies::before {
        top: calc(16px + var(--zrv-avatar-size));
        bottom: 22px;
    }

    .zrv-review__replies {
        margin-top: 12px;
        margin-left: -30px;
        padding-left: 32px;
        gap: 12px;
    }

    .zrv-reply {
        grid-template-columns: 38px minmax(0, 1fr);
        gap: 9px;
    }

    .zrv-reply::before {
        left: -33px;
        width: 25px;
        height: 16px;
        border-bottom-left-radius: 12px;
    }

    .zrv-review__replies > .zrv-reply:last-child::after {
        left: -34px;
        top: 16px;
        bottom: -16px;
    }

    .zrv-reply__avatar {
        width: 38px;
        height: 38px;
    }

    .zrv-form__row {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .zrv-modal {
        padding: 10px;
    }

    .zrv-modal__dialog {
        max-height: calc(100vh - 20px);
        border-radius: 10px;
    }

    .zrv-modal__header {
        min-height: 54px;
    }

    .zrv-modal__header h3 {
        font-size: 18px !important;
    }

    .zrv-form {
        max-height: calc(100vh - 74px);
        padding: 12px;
    }

    .zrv-product {
        grid-template-columns: 52px minmax(0, 1fr);
    }

    .zrv-product__image {
        width: 52px;
        height: 52px;
    }

    .zrv-product__name {
        font-size: 13px;
    }

    .zrv-rating-star {
        width: 29px;
        height: 29px;
    }

    .zrv-rating-star svg {
        width: 27px;
        height: 27px;
    }

    .zrv-form input {
        height: 46px;
    }
}
