:root {
    --sc-green: #1DBF73;
    --sc-green-dark: #159c5e;
    --sc-green-light: #e6f9f0;
    --sc-chat-bg: #ece5dd;
}

.chat-widget-buttons {
    position: fixed;
    bottom: 24px;
    right: 24px;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 12px;
    z-index: 9998;
}

.chat-bubble {
    position: relative;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(29,191,115,.45);
    color: #fff;
    text-decoration: none;
    background: var(--sc-green);
    overflow: hidden;
    transition: transform .25s ease, box-shadow .25s ease;
    animation: scPop .5s ease;
}
.chat-bubble:hover {
    transform: scale(1.08);
    box-shadow: 0 6px 20px rgba(29,191,115,.55);
}
.chat-bubble:active { transform: scale(.95); }

.chat-bubble::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: var(--sc-green);
    animation: scPulseRing 2.4s ease-out infinite;
    z-index: -1;
}

.chat-icon-svg { width: 30px; height: 30px; position: relative; z-index: 1; }

.chat-bubble-photo {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: none;
    position: relative;
    z-index: 1;
}
.chat-bubble.has-photo .chat-icon-svg { display: none; }
.chat-bubble.has-photo .chat-bubble-photo { display: block; }

@keyframes scPulseRing {
    0%   { transform: scale(1);   opacity: .55; }
    70%  { transform: scale(1.55); opacity: 0; }
    100% { transform: scale(1.55); opacity: 0; }
}

@keyframes scPop {
    0%   { transform: scale(0); opacity: 0; }
    70%  { transform: scale(1.1); opacity: 1; }
    100% { transform: scale(1); }
}

.chat-tooltip {
    position: fixed;
    bottom: 100px;
    right: 24px;
    background: #fff;
    color: #1a3d2e;
    padding: 10px 16px;
    border-radius: 12px;
    box-shadow: 0 4px 14px rgba(0,0,0,.18);
    font-size: 13px;
    font-weight: 500;
    z-index: 9998;
    opacity: 1;
    transform: translateY(0);
    transition: opacity .3s ease, transform .3s ease;
    pointer-events: none;
    animation: scFloatIn .4s ease .3s both;
}

.chat-tooltip::after {
    content: "";
    position: absolute;
    bottom: -6px;
    right: 26px;
    width: 12px;
    height: 12px;
    background: #fff;
    transform: rotate(45deg);
    box-shadow: 2px 2px 4px rgba(0,0,0,.06);
}

@keyframes scFloatIn {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

.chat-window {
    position: fixed;
    bottom: 100px;
    right: 24px;
    width: 350px;
    max-width: 92vw;
    height: 500px;
    max-height: 75vh;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 8px 30px rgba(0,0,0,.3);
    flex-direction: column;
    overflow: hidden;
    z-index: 9999;
    display: none;
    opacity: 0;
    transform: translateY(16px) scale(.96);
    transform-origin: bottom right;
}

.chat-window.chat-open {
    display: flex;
    animation: scWindowIn .3s cubic-bezier(.34,1.56,.64,1) forwards;
}

@keyframes scWindowIn {
    from { opacity: 0; transform: translateY(16px) scale(.96); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

.chat-header {
    background: linear-gradient(135deg, var(--sc-green), var(--sc-green-dark));
    color: #fff;
    padding: 14px 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
}

.chat-header-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: rgba(255,255,255,.25);
    object-fit: cover;
    flex-shrink: 0;
    display: none;
}
.chat-header-avatar.visible { display: block; }

.chat-header-title { flex: 1; }

.close-chat {
    cursor: pointer;
    font-size: 20px;
    line-height: 1;
    transition: transform .2s ease;
}
.close-chat:hover { transform: rotate(90deg); }

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    background: var(--sc-chat-bg);
}

.chat-input-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px;
    border-top: 1px solid #eee;
}

.chat-input-bar input[type="text"] {
    flex: 1;
    border: 1px solid #ddd;
    border-radius: 20px;
    padding: 8px 14px;
    transition: border-color .2s ease;
}
.chat-input-bar input[type="text"]:focus {
    outline: none;
    border-color: var(--sc-green);
}

.chat-input-bar button {
    background: var(--sc-green);
    color: #fff;
    border: none;
    border-radius: 20px;
    padding: 8px 16px;
    cursor: pointer;
    transition: background .2s ease, transform .15s ease;
}
.chat-input-bar button:hover { background: var(--sc-green-dark); }
.chat-input-bar button:active { transform: scale(.95); }

.clip-icon {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
    transition: transform .2s ease, background .2s ease, color .2s ease;
}
.clip-icon:hover { transform: scale(1.1); background: var(--sc-green-light); }

.clip-icon.has-file {
    background: var(--sc-green-light);
    color: var(--sc-green-dark);
    animation: scPop .3s ease;
}
.clip-icon.has-file::after {
    content: "\2713";
    position: absolute;
    bottom: -2px;
    right: -2px;
    width: 15px;
    height: 15px;
    border-radius: 50%;
    background: var(--sc-green);
    color: #fff;
    font-size: 10px;
    line-height: 15px;
    text-align: center;
    box-shadow: 0 0 0 2px #fff;
}

.bot-msg-group {
    margin-bottom: 14px;
    animation: scMsgIn .3s ease both;
}
.bot-row { display: flex; align-items: flex-start; gap: 8px; }
.bot-avatar {
    width: 28px; height: 28px; border-radius: 50%;
    background: var(--sc-green); flex-shrink: 0;
    background-size: cover;
    background-position: center;
}
.msg-bot {
    background: #fff;
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 14px;
    line-height: 1.4;
    box-shadow: 0 1px 4px rgba(0,0,0,.08);
    max-width: 85%;
}
.msg-user {
    background: var(--sc-green);
    color: #fff;
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 14px;
    margin: 8px 0 8px auto;
    max-width: 85%;
    width: fit-content;
    animation: scMsgInRight .3s ease both;
}

@keyframes scMsgIn {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes scMsgInRight {
    from { opacity: 0; transform: translateX(10px); }
    to   { opacity: 1; transform: translateX(0); }
}

.options-wrapper {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 8px 0 0 36px;
}
.chat-option {
    background: #fff;
    border: 1px solid var(--sc-green);
    color: var(--sc-green-dark);
    padding: 6px 12px;
    border-radius: 16px;
    font-size: 13px;
    cursor: pointer;
    transition: background .2s ease, color .2s ease, transform .15s ease;
    animation: scMsgIn .3s ease both;
}
.chat-option:hover { background: var(--sc-green); color: #fff; transform: translateY(-2px); }
.chat-option:active { transform: translateY(0) scale(.96); }
.chat-option.back-btn { border-color: #999; color: #666; }
.chat-option.back-btn:hover { background: #999; color: #fff; }
.chat-option.cancel-btn { border-color: #d9534f; color: #d9534f; }
.chat-option.cancel-btn:hover { background: #d9534f; color: #fff; }

.chat-option.whatsapp-option {
    background: #25D366;
    border-color: #25D366;
    color: #fff;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: 600;
}
.chat-option.whatsapp-option:hover { background: #1ebc59; }
.chat-option.whatsapp-option .wa-icon { font-size: 15px; }

.confirm-box { display: block; }
.confirm-header { display: block; margin-bottom: 8px; }
.confirm-row { display: flex; gap: 8px; margin: 4px 0; }
.confirm-icon { flex-shrink: 0; }
