:root {
    --srw-accent: #111827;
}

/* Темы сайта нередко переопределяют родовой класс .button с высокой специфичностью (см.
   dev-team-log.md), из-за чего голого атрибута [hidden] недостаточно — элемент остаётся физически
   видимым, хотя семантически скрыт. Явный !important здесь оправдан: это не борьба с чужим !important,
   а гарантия того, что стандартное поведение атрибута [hidden] не потеряется под специфичностью темы.
   Селектор ".srw-xxx [hidden]" покрывает любые текущие и будущие переключения hidden внутри виджетов
   плагина одним правилом, без перечисления каждого класса по отдельности. */
.srw-slider[hidden],
.srw-all [hidden],
.srw-floating [hidden],
.srw-catcher [hidden] {
    display: none !important;
}

.srw-card {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 16px;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    background: #fff;
    height: 100%;
    box-sizing: border-box;
}

.srw-card__header {
    display: flex;
    align-items: center;
    gap: 10px;
}

.srw-card__avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.srw-card__avatar--placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #eef2ff;
    color: #4338ca;
    font-weight: 600;
}

.srw-card__meta {
    display: flex;
    flex-direction: column;
}

.srw-card__author {
    font-weight: 600;
}

.srw-card__stars {
    color: #f59e0b;
    letter-spacing: 1px;
}

.srw-card__text {
    margin: 0;
    color: #374151;
    line-height: 1.5;
}

.srw-card__footer {
    margin-top: auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 12px;
    color: #6b7280;
}

.srw-card__badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 999px;
    background: #f3f4f6;
}

.srw-card__badge a {
    text-decoration: none;
}

.srw-empty {
    color: #6b7280;
}

/* ---- Слайдер ---- */
.srw-slider {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
}

.srw-slider__track {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    padding: 4px;
    flex: 1;
}

.srw-slider__slide {
    /* Отзывчиво к ширине трека (flex-basis в % считается от контейнера, не от viewport) — на широких
       экранах не даёт «обрезанной» дробной карточке торчать у края, на узких не сжимается ниже 220px. */
    flex: 0 0 clamp(220px, 30%, 320px);
    scroll-snap-align: start;
}

.srw-slider__nav {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid #e5e7eb;
    background: #fff;
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
}

/* ---- Страница «Все отзывы» ---- */
.srw-all__filters {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
}

.srw-all__filter-group {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.srw-filter-chip {
    padding: 6px 12px;
    border-radius: 999px;
    border: 1px solid #e5e7eb;
    background: #fff;
    cursor: pointer;
}

/* Селекторы ниже намеренно с родительским префиксом (.srw-all .srw-filter-chip, а не просто
   .srw-filter-chip) — при равной специфичности с однокласовым селектором темы (например .button)
   выигрывает порядок подключения таблиц стилей, который плагин не контролирует (см. фикс [hidden]
   выше — та же причина). Дополнительный уровень вложенности поднимает специфичность и не зависит
   от порядка загрузки. */
.srw-all .srw-filter-chip.is-active {
    background: var(--srw-accent);
    border-color: var(--srw-accent);
    color: #fff;
}

.srw-all .srw-all__more {
    background: var(--srw-accent);
    border-color: var(--srw-accent);
    color: #fff;
}

.srw-all__source-filter {
    padding: 6px 10px;
}

.srw-all__grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 16px;
}

.srw-all__empty-notice {
    margin-top: 16px;
}

/* ---- Плавающий виджет ---- */
.srw-floating {
    position: fixed;
    z-index: 9999;
}

.srw-floating--bottom-right { right: 20px; bottom: 20px; }
.srw-floating--bottom-left  { left: 20px; bottom: 20px; }
.srw-floating--top-right    { right: 20px; top: 20px; }
.srw-floating--top-left     { left: 20px; top: 20px; }

.srw-floating .srw-floating__bubble {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    border-radius: 999px;
    border: none;
    background: var(--srw-accent);
    color: #fff;
    cursor: pointer;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

.srw-floating__panel {
    position: absolute;
    bottom: 60px;
    right: 0;
    width: min(360px, 90vw);
    max-height: 70vh;
    overflow-y: auto;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.2);
}

.srw-floating--top-right .srw-floating__panel,
.srw-floating--top-left .srw-floating__panel {
    bottom: auto;
    top: 60px;
}

.srw-floating--bottom-left .srw-floating__panel,
.srw-floating--top-left .srw-floating__panel {
    right: auto;
    left: 0;
}

.srw-floating__panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 1px solid #e5e7eb;
    font-weight: 600;
}

.srw-floating__close {
    border: none;
    background: none;
    font-size: 20px;
    cursor: pointer;
    line-height: 1;
}

.srw-floating__list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 12px;
}

/* ---- Перехватчик негатива ---- */
.srw-catcher {
    max-width: 420px;
    padding: 20px;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    background: #fff;
}

.srw-catcher__question {
    margin: 0 0 10px;
    font-weight: 600;
}

.srw-catcher__stars {
    display: flex;
    gap: 4px;
    margin-bottom: 12px;
}

.srw-catcher__star {
    font-size: 28px;
    line-height: 1;
    color: #d1d5db;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
}

/* Намеренно НЕ на var(--srw-accent) — это глиф оценки, тот же янтарный, что и у звёзд в карточках
   отзывов (.srw-card__stars), а не «кнопка» в смысле настройки цвета акцента. Если привязать к
   акценту, дефолтный вид (без настройки) реально меняется — этого просить не могли, звёзды должны
   визуально совпадать со звёздами карточек независимо от выбранного цвета кнопок. */
.srw-catcher .srw-catcher__star.is-active {
    color: #f59e0b;
}

.srw-catcher__links-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.srw-catcher .srw-catcher__link,
.srw-catcher .srw-catcher__form button[type="submit"] {
    background: var(--srw-accent);
    border-color: var(--srw-accent);
    color: #fff;
}

.srw-catcher .srw-catcher__form button[type="submit"]:disabled {
    background: #d1d5db;
    border-color: #d1d5db;
    color: #6b7280;
}

.srw-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin: 0 0 12px;
}

.srw-field input[type="text"],
.srw-field textarea {
    padding: 8px 10px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font: inherit;
}

.srw-field--honeypot {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.srw-field--consent {
    flex-direction: row;
    align-items: flex-start;
    gap: 8px;
}

.srw-catcher__form-notice {
    font-size: 13px;
}

.srw-catcher__form-notice--error {
    color: #b91c1c;
}

.srw-watermark {
    margin: 4px 0 0;
    text-align: right;
    font-size: 11px;
    line-height: 1.2;
}

.srw-watermark a {
    color: inherit;
    opacity: .55;
    text-decoration: none;
}

.srw-watermark a:hover {
    opacity: .85;
    text-decoration: underline;
}
