/**
 * Floating WhatsApp + Chatbot — only styles not in theme/bootstrap.
 * Reuses: --main-color, Font Awesome icons, .sr-only, .progress-wrap base.
 */

.rstc-float {
    position: fixed;
    right: 20px;
    bottom: 24px;
    z-index: 99990;
    display: flex;
    flex-direction: column-reverse;
    align-items: flex-end;
    gap: 12px;
    pointer-events: none;
}

.rstc-float__stack {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 12px;
    pointer-events: auto;
}

.rstc-float__btn {
    position: relative;
    width: 54px;
    height: 54px;
    border: 0;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    cursor: pointer;
    text-decoration: none;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.18);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    font-size: 26px;
    line-height: 1;
}

.rstc-float__btn:hover,
.rstc-float__btn:focus {
    color: #fff;
    text-decoration: none;
    transform: translateY(-2px);
    outline: none;
}

.rstc-float__btn--wa {
    background: #25d366;
}

.rstc-float__btn--chat {
    background: var(--main-color, #709d2b);
}

.rstc-float__btn--chat.is-open {
    background: var(--border-color-green, #5f8a22);
}

.rstc-float__tip {
    position: absolute;
    right: calc(100% + 10px);
    top: 50%;
    transform: translateY(-50%);
    white-space: nowrap;
    background: #222;
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    padding: 6px 10px;
    border-radius: 4px;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.rstc-float__btn:hover .rstc-float__tip,
.rstc-float__btn:focus .rstc-float__tip {
    opacity: 1;
    visibility: visible;
}

/* Chat panel */
.rstc-float__panel {
    width: min(340px, calc(100vw - 32px));
    max-height: min(480px, calc(100vh - 140px));
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.22);
    border: 1px solid rgba(0, 0, 0, 0.08);
    pointer-events: auto;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
}

.rstc-float__panel.is-open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.rstc-float__panel-head {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    background: var(--main-color, #709d2b);
    color: #fff;
}

.rstc-float__avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 18px;
}

.rstc-float__panel-title {
    flex: 1;
    min-width: 0;
}

.rstc-float__panel-title strong {
    display: block;
    font-size: 15px;
    font-weight: 700;
    line-height: 1.25;
}

.rstc-float__panel-title span {
    display: block;
    font-size: 12px;
    opacity: 0.9;
    margin-top: 2px;
}

.rstc-float__close {
    width: 32px;
    height: 32px;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.18);
    color: #fff;
    cursor: pointer;
    flex-shrink: 0;
    font-size: 16px;
    line-height: 32px;
    text-align: center;
    padding: 0;
}

.rstc-float__close:hover,
.rstc-float__close:focus {
    background: rgba(255, 255, 255, 0.3);
    outline: none;
}

.rstc-float__body {
    padding: 14px;
    overflow-y: auto;
    flex: 1;
    background: #f7f7f7;
}

.rstc-float__bubble {
    background: #fff;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 8px;
    padding: 12px 14px;
    font-size: 13px;
    line-height: 1.5;
    color: #222;
    margin-bottom: 12px;
}

.rstc-float__bubble p {
    margin: 0 0 6px;
}

.rstc-float__bubble p:last-child {
    margin-bottom: 0;
}

.rstc-float__quick {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.rstc-float__chip {
    display: block;
    width: 100%;
    text-align: left;
    border: 1px solid var(--border-color-green, #709d2b);
    background: #fff;
    color: var(--main-color, #709d2b);
    font-size: 13px;
    font-weight: 600;
    padding: 10px 12px;
    border-radius: 4px;
    cursor: pointer;
}

.rstc-float__chip:hover,
.rstc-float__chip:focus {
    background: rgba(112, 157, 43, 0.1);
    outline: none;
}

.rstc-float__form {
    display: flex;
    gap: 8px;
    padding: 10px;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
    background: #fff;
}

.rstc-float__form .form-control {
    height: 40px;
    font-size: 13px;
}

.rstc-float__send {
    width: 40px;
    height: 40px;
    border: 0;
    border-radius: 4px;
    background: var(--main-color, #709d2b);
    color: #fff;
    cursor: pointer;
    flex-shrink: 0;
    font-size: 16px;
    line-height: 40px;
    text-align: center;
    padding: 0;
}

.rstc-float__send:hover,
.rstc-float__send:focus {
    background: var(--border-color-green, #5f8a22);
    outline: none;
    color: #fff;
}

/* Offset theme back-to-top so it doesn't overlap FABs */
.progress-wrap {
    right: 88px !important;
}

@media (max-width: 767.98px) {
    .rstc-float {
        right: 14px;
        bottom: 16px;
        gap: 10px;
    }

    .rstc-float__stack {
        gap: 10px;
    }

    .rstc-float__btn {
        width: 50px;
        height: 50px;
        font-size: 24px;
    }

    .rstc-float__tip {
        display: none;
    }

    .rstc-float__panel {
        width: min(320px, calc(100vw - 28px));
        max-height: min(420px, calc(100vh - 120px));
    }

    .progress-wrap {
        right: 78px !important;
    }
}
