/* Виджет чат-ассистента подбора лекарств (см. layouts/partials/assistant-chat.blade.php) */
/* Старая кнопка .fix-feedback-btn скрыта (см. ниже), виджет стоит в самом углу. */
.rl-assistant {
    position: fixed;
    right: 20px;
    bottom: 20px;
    /* Выше cookie-плашки (.popup) и нижнего меню (.footer__navigation z-index 1000). */
    z-index: 100000;
    font-family: inherit;
}

.rl-assistant__toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 18px;
    border: 0;
    border-radius: 999px;
    background: #3f8b8b;
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 6px 20px rgba(63, 139, 139, 0.35);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.rl-assistant__toggle:hover {
    background: #357a7a;
    transform: translateY(-1px);
    box-shadow: 0 8px 24px rgba(63, 139, 139, 0.45);
}

.rl-assistant__toggle-icon {
    font-size: 18px;
    line-height: 1;
}

.rl-assistant--open .rl-assistant__toggle {
    display: none;
}

.rl-assistant__panel {
    width: 480px;
    max-width: calc(100vw - 24px);
    height: 680px;
    max-height: calc(100vh - 40px);
    display: flex;
    flex-direction: column;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.22);
    overflow: hidden;
}

.rl-assistant__panel[hidden] {
    display: none;
}

.rl-assistant__header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 14px;
    background: #3f8b8b;
    color: #fff;
}

.rl-assistant__title {
    flex: 1;
    font-weight: 600;
    font-size: 15px;
}

.rl-assistant__reset,
.rl-assistant__close {
    border: 0;
    background: rgba(255, 255, 255, 0.18);
    color: #fff;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
}

.rl-assistant__reset:hover,
.rl-assistant__close:hover {
    background: rgba(255, 255, 255, 0.32);
}

.rl-assistant__chat {
    /* Высота задаётся из JS по размеру панели: у deep-chat своя фиксированная высота по умолчанию (350px). */
    flex: 0 0 auto;
    width: 100%;
    min-height: 0;
    border: 0 !important;
    border-radius: 0 !important;
    font-size: 14px;
}

.rl-assistant__disclaimer {
    padding: 8px 14px;
    font-size: 11px;
    line-height: 1.3;
    color: #6b7280;
    background: #f5f7fa;
    border-top: 1px solid #e5e7eb;
}

@media (max-width: 600px) {
    /* Над нижним меню сайта (.footer__navigation, ~64px). */
    .rl-assistant {
        right: 12px;
        bottom: 76px;
    }

    /* На телефоне открытый чат занимает весь экран: панель сама становится fixed, без скруглений и отступов. */
    .rl-assistant__panel {
        position: fixed;
        inset: 0;
        width: auto;
        max-width: none;
        height: auto;
        max-height: none;
        border-radius: 0;
    }

    .rl-assistant__header {
        padding-top: max(12px, env(safe-area-inset-top));
    }

    .rl-assistant__disclaimer {
        padding-bottom: max(8px, env(safe-area-inset-bottom));
    }

    .rl-assistant__toggle-text {
        display: none;
    }

    .rl-assistant__toggle {
        padding: 14px;
    }
}

/* Пока включён ассистент, старую плавающую кнопку обратной связи (.fix-feedback-btn) не показываем:
   контакты операторов бот даёт сам, две кнопки в одном углу мешают друг другу. */
.fix-feedback-btn {
    display: none !important;
}
