/* Epil: рейтинги студии на картах (виджет epil_external_ratings). Цвета — из глобальных цветов Listivo. */
.epil-ratings {
    --epil-text: var(--e-global-color-lcolor1, #374b5c);
    --epil-muted: var(--e-global-color-lcolor2, #73818c);
    --epil-border: var(--e-global-color-lcolor3, #d5e3ee);
    --epil-bg: var(--e-global-color-lcolor4, #f2f4f8);
    --epil-accent: var(--e-global-color-lprimary1, #e898f7);
    --epil-star: #ffb800;
    --epil-star-empty: #dfe5ec;

    margin: 20px 0 0;
    padding: 20px;
    background: #fff;
    border: 1px solid var(--epil-border);
    border-radius: 10px;
    color: var(--epil-text);
    font-size: 14px;
    line-height: 1.4;
}

.epil-ratings__title {
    margin: 0 0 12px;
    font-size: 16px;
    font-weight: 700;
}

.epil-ratings__list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.epil-ratings__row + .epil-ratings__row {
    border-top: 1px solid var(--epil-bg);
}

.epil-ratings__link {
    display: grid;
    grid-template-columns: 24px minmax(0, 1fr) auto;
    grid-template-areas:
        "icon name score"
        "icon count count";
    column-gap: 10px;
    row-gap: 2px;
    align-items: center;
    padding: 10px 6px;
    margin: 0 -6px;
    border-radius: 8px;
    color: inherit;
    text-decoration: none;
    transition: background-color .15s ease;
}

a.epil-ratings__link:hover,
a.epil-ratings__link:focus-visible {
    background: var(--epil-bg);
    color: inherit;
    outline: none;
}

a.epil-ratings__link:focus-visible {
    box-shadow: 0 0 0 2px var(--epil-accent);
}

.epil-ratings__icon {
    grid-area: icon;
    display: flex;
    width: 24px;
    height: 24px;
}

.epil-ratings__icon svg {
    width: 100%;
    height: 100%;
}

.epil-ratings__name {
    grid-area: name;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.epil-ratings__score {
    grid-area: score;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.epil-ratings__value {
    min-width: 2.2em;
    font-weight: 700;
    text-align: right;
}

.epil-ratings__count {
    grid-area: count;
    color: var(--epil-muted);
    font-size: 12px;
}

/* Звёзды: серая звезда + поверх золотая, обрезанная по ширине (дробная заливка) */
.epil-ratings__stars {
    display: inline-flex;
    gap: 2px;
}

.epil-ratings__star {
    position: relative;
    display: inline-block;
    width: 16px;
    height: 16px;
}

.epil-ratings__star svg {
    display: block;
    width: 16px;
    height: 16px;
    fill: var(--epil-star-empty);
}

.epil-ratings__star-fill {
    position: absolute;
    inset: 0 auto 0 0;
    overflow: hidden;
}

.epil-ratings__star-fill svg {
    fill: var(--epil-star);
}

.epil-ratings__stars--lg .epil-ratings__star,
.epil-ratings__stars--lg .epil-ratings__star svg {
    width: 24px;
    height: 24px;
}

.epil-ratings__total {
    margin-top: 12px;
    padding: 16px;
    border-radius: 8px;
    background: var(--epil-bg);
    text-align: center;
}

.epil-ratings__total-label {
    margin-bottom: 6px;
    color: var(--epil-muted);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.epil-ratings__total-score {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.epil-ratings__total-value {
    font-size: 30px;
    font-weight: 800;
    line-height: 1;
}

.epil-ratings__total-note {
    margin-top: 6px;
    color: var(--epil-muted);
    font-size: 12px;
}

@media (max-width: 400px) {
    .epil-ratings {
        padding: 16px;
    }

    .epil-ratings__link {
        grid-template-areas:
            "icon name name"
            "icon score count";
    }

    .epil-ratings__count {
        justify-self: end;
    }
}
