/* نظرات و امتیاز خریداران — مشترک صفحه اصلی و صفحه محصول */

/* ستاره‌های نمایشی (پر شدن از راست؛ عرض بخش پر = امتیاز / ۵) */
.sama-stars {
    position: relative;
    display: inline-block;
    font-size: 1.6rem;
    line-height: 1;
    letter-spacing: 2px;
    color: #e2e5ea;
    white-space: nowrap;
    font-family: Arial, sans-serif;
}
.sama-stars::before { content: "★★★★★"; }
.sama-stars__fill {
    position: absolute;
    top: 0;
    right: 0;
    overflow: hidden;
    color: #f9a825;
}
.sama-stars__fill::before { content: "★★★★★"; }

.sama-verified {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 1.1rem;
    font-weight: 600;
    color: #12a05c;
}
.sama-verified svg { width: 13px; height: 13px; flex: 0 0 auto; }

.sama-review-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 1.5rem;
    color: #fff;
    background: linear-gradient(135deg, #336699, #5b8fc7);
}

/* ---------- صفحه اصلی: نظرات فروشگاه ---------- */
.sama-reviews { margin-bottom: 3rem; }
.sama-reviews__panel {
    background: linear-gradient(180deg, #f4f8fc 0%, #ffffff 100%);
    border: 1px solid #e6eef6;
    border-radius: 22px;
    padding: 2.2rem 2rem 1.6rem;
}
.sama-reviews__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.6rem;
    margin-bottom: 1.8rem;
    flex-wrap: wrap;
}
.sama-reviews__title {
    margin: 0;
    font-size: 2rem;
    font-weight: 800;
    color: #1d2433;
}
.sama-reviews__subtitle {
    margin: .3rem 0 0;
    font-size: 1.3rem;
    color: #7b8494;
}
.sama-reviews__score {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: #fff;
    border: 1px solid #e6eef6;
    border-radius: 16px;
    padding: .8rem 1.4rem;
    box-shadow: 0 6px 18px rgba(51, 102, 153, .08);
}
.sama-reviews__score strong {
    font-size: 3rem;
    font-weight: 900;
    line-height: 1;
    color: #1d2433;
}
.sama-reviews__score small {
    display: block;
    margin-top: .3rem;
    font-size: 1.15rem;
    color: #7b8494;
}
.sama-reviews .swiper-slide { height: auto; }

.sama-review-card {
    height: 100%;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    background: #fff;
    border: 1px solid #edf0f4;
    border-radius: 18px;
    padding: 1.6rem;
    box-shadow: 0 4px 14px rgba(29, 36, 51, .05);
    transition: transform .2s ease, box-shadow .2s ease;
}
@media (hover: hover) {
    .sama-review-card:hover {
        transform: translateY(-3px);
        box-shadow: 0 12px 26px rgba(51, 102, 153, .12);
    }
}
.sama-review-card__top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .8rem;
}
.sama-review-card__date { font-size: 1.1rem; color: #9aa1ad; }
.sama-review-card__text {
    position: relative;
    margin: 0;
    flex: 1 1 auto;
    font-size: 1.35rem;
    line-height: 2;
    color: #3a4252;
    display: -webkit-box;
    -webkit-line-clamp: 5;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.sama-review-card__who {
    display: flex;
    align-items: center;
    gap: .8rem;
}
.sama-review-card__name {
    display: block;
    font-size: 1.3rem;
    font-weight: 700;
    color: #1d2433;
}
.sama-review-card__product {
    display: flex;
    align-items: center;
    gap: .8rem;
    padding-top: 1rem;
    border-top: 1px dashed #e6e9ee;
    color: #5b6473;
    font-size: 1.2rem;
}
.sama-review-card__product img {
    width: 36px;
    height: 46px;
    object-fit: cover;
    border-radius: 8px;
    flex: 0 0 auto;
}
.sama-review-card__product span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.sama-review-card__product:hover { color: #336699; }

@media (max-width: 767px) {
    .sama-reviews__panel { padding: 1.6rem 1.2rem 1.2rem; border-radius: 18px; }
    .sama-reviews__title { font-size: 1.7rem; }
    .sama-reviews__score { padding: .6rem 1rem; }
    .sama-reviews__score strong { font-size: 2.4rem; }
}

/* ---------- صفحه محصول ---------- */
.sama-pr {
    margin: 3rem 0 4rem;
    scroll-margin-top: 90px;
}
.sama-pr__head {
    display: flex;
    align-items: baseline;
    gap: 1rem;
    border-bottom: 1px solid #eee;
    padding-bottom: 1rem;
    margin-bottom: 2rem;
}
.sama-pr__head .title { margin: 0; font-size: 1.9rem; font-weight: 800; }
.sama-pr__head span { color: #8a919d; font-size: 1.3rem; }
.sama-pr__grid {
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr);
    gap: 3rem;
    align-items: start;
}
.sama-pr__side {
    position: sticky;
    top: 90px;
    background: #f7f9fc;
    border: 1px solid #e9eef5;
    border-radius: 18px;
    padding: 2rem 1.8rem;
}
.sama-pr__avg { display: flex; align-items: baseline; gap: .5rem; }
.sama-pr__avg strong { font-size: 4rem; font-weight: 900; line-height: 1; color: #1d2433; }
.sama-pr__avg span { color: #8a919d; font-size: 1.3rem; }
.sama-pr__side .sama-stars { margin-top: .8rem; font-size: 2rem; }
.sama-pr__count { margin-top: .6rem; color: #8a919d; font-size: 1.2rem; }
.sama-pr__dist { list-style: none; padding: 0; margin: 1.6rem 0 0; }
.sama-pr__dist li {
    display: grid;
    grid-template-columns: 34px 1fr 28px;
    align-items: center;
    gap: .8rem;
    font-size: 1.2rem;
    color: #5b6473;
    margin-bottom: .6rem;
}
.sama-pr__bar { height: 6px; border-radius: 6px; background: #e4e8ee; overflow: hidden; }
.sama-pr__bar span { display: block; height: 100%; border-radius: 6px; background: #f9a825; }
.sama-pr__empty { color: #6b7280; font-size: 1.3rem; margin: 0; }
.sama-pr__cta {
    margin-top: 1.8rem;
    padding-top: 1.6rem;
    border-top: 1px solid #e4e8ee;
    font-size: 1.25rem;
    line-height: 1.9;
    color: #4b5563;
}
.sama-pr__cta p { margin: 0 0 1rem; }
.sama-pr__cta .btn { width: 100%; }
.sama-pr__note {
    display: block;
    border-radius: 12px;
    padding: 1rem 1.2rem;
    background: #eef6ff;
    color: #24507d;
}
.sama-pr__note--ok { background: #eafaf1; color: #137a45; }

.sama-pr__form {
    background: #fff;
    border: 1px solid #e3e8ef;
    border-radius: 18px;
    padding: 2rem;
    margin-bottom: 2.4rem;
    box-shadow: 0 8px 24px rgba(29, 36, 51, .06);
}
.sama-pr__form[hidden] { display: none; }
.sama-pr__form h5 { font-size: 1.6rem; font-weight: 800; margin: 0 0 1.6rem; }
.sama-pr__field { margin-bottom: 1.6rem; }
.sama-pr__field > label,
.sama-pr__label { display: block; font-weight: 700; font-size: 1.3rem; margin-bottom: .6rem; color: #1d2433; }
.sama-pr__field input[type="text"],
.sama-pr__field textarea {
    width: 100%;
    border: 1px solid #dfe4ea;
    border-radius: 12px;
    padding: 1rem 1.2rem;
    font-size: 1.35rem;
    background: #fbfcfd;
    transition: border-color .2s ease, box-shadow .2s ease;
}
.sama-pr__field input[type="text"]:focus,
.sama-pr__field textarea:focus {
    outline: none;
    border-color: #336699;
    box-shadow: 0 0 0 3px rgba(51, 102, 153, .12);
    background: #fff;
}
.sama-pr__field textarea { min-height: 120px; resize: vertical; line-height: 1.9; }
.sama-pr__help { display: flex; justify-content: space-between; gap: 1rem; margin-top: .4rem; font-size: 1.15rem; color: #8a919d; }

/* انتخاب ستاره: ترتیب DOM ۵..۱ و row-reverse تا در راست‌چین ستاره ۱ سمت راست باشد */
.sama-rate-row { display: flex; align-items: center; gap: 1.2rem; flex-wrap: wrap; }
.sama-rate {
    display: inline-flex;
    flex-direction: row-reverse;
    justify-content: flex-end;
    gap: 4px;
}
.sama-rate input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.sama-rate label {
    font-family: Arial, sans-serif;
    font-size: 3.2rem;
    line-height: 1;
    color: #dfe3e9;
    cursor: pointer;
    transition: color .15s ease, transform .15s ease;
}
.sama-rate label:hover,
.sama-rate label:hover ~ label,
.sama-rate input:checked ~ label { color: #f9a825; }
.sama-rate label:hover { transform: scale(1.15); }
.sama-rate input:focus-visible + label { outline: 2px solid #336699; outline-offset: 2px; border-radius: 4px; }
.sama-rate-hint { font-size: 1.3rem; font-weight: 700; color: #b07a00; min-width: 60px; }

.sama-pr__list { display: flex; flex-direction: column; gap: 0; }
.sama-pr__item { padding: 1.8rem 0; border-bottom: 1px solid #f0f2f5; }
.sama-pr__item:first-child { padding-top: 0; }
.sama-pr__item-head { display: flex; align-items: center; gap: 1rem; margin-bottom: .8rem; }
.sama-pr__item-head b { font-size: 1.35rem; color: #1d2433; }
.sama-pr__item-meta { display: flex; align-items: center; gap: .8rem; flex-wrap: wrap; font-size: 1.15rem; color: #9aa1ad; }
.sama-pr__item p { margin: .8rem 0 0; font-size: 1.4rem; line-height: 2; color: #3a4252; white-space: pre-line; }
.sama-pr__nolist {
    text-align: center;
    padding: 3rem 1rem;
    border: 1px dashed #dfe4ea;
    border-radius: 18px;
    color: #6b7280;
    font-size: 1.35rem;
}
.sama-pr__nolist b { display: block; font-size: 1.6rem; color: #1d2433; margin-bottom: .4rem; }

@media (max-width: 991px) {
    .sama-pr__grid { grid-template-columns: 1fr; gap: 2rem; }
    .sama-pr__side { position: static; }
}
