#cc-chat-widget {
    position: fixed;
    bottom: 20px;
    z-index: 999999;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
}
#cc-chat-widget.cc-position-right { right: 20px; }
#cc-chat-widget.cc-position-left { left: 20px; }

#cc-chat-toggle {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: none;
    color: #fff;
    font-size: 26px;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(0,0,0,.25);
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform .15s ease;
}
#cc-chat-toggle:hover { transform: scale(1.06); }

.cc-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    background: #ff3b30;
    color: #fff;
    border-radius: 50%;
    width: 16px;
    height: 16px;
    font-size: 12px;
    line-height: 16px;
}

#cc-chat-window {
    position: absolute;
    bottom: 75px;
    width: 340px;
    max-width: 90vw;
    height: 460px;
    max-height: 70vh;
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 10px 40px rgba(0,0,0,.3);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.cc-position-right #cc-chat-window { right: 0; }
.cc-position-left #cc-chat-window { left: 0; }

.cc-chat-header {
    color: #fff;
    padding: 14px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
    font-size: 15px;
}
#cc-chat-close {
    background: none;
    border: none;
    color: #fff;
    font-size: 22px;
    cursor: pointer;
    line-height: 1;
}

.cc-chat-prechat {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.cc-chat-prechat p { margin: 0 0 4px; color: #333; font-size: 14px; }
.cc-chat-prechat input {
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
}
.cc-chat-prechat button, .cc-chat-input button {
    border: none;
    color: #fff;
    padding: 10px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
}

.cc-chat-body {
    display: flex;
    flex-direction: column;
    flex: 1;
    overflow: hidden;
}

.cc-messages {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: #f7f7f8;
}

.cc-msg { display: flex; }
.cc-msg-visitor { justify-content: flex-end; }
.cc-msg-admin { justify-content: flex-start; }

.cc-msg-bubble {
    max-width: 75%;
    padding: 8px 12px;
    border-radius: 14px;
    font-size: 14px;
    line-height: 1.4;
    word-wrap: break-word;
}
.cc-msg-visitor .cc-msg-bubble { background: #DCF8C6; border-bottom-right-radius: 4px; }
.cc-msg-admin .cc-msg-bubble { background: #fff; border: 1px solid #eee; border-bottom-left-radius: 4px; }

.cc-chat-input {
    display: flex;
    gap: 8px;
    padding: 10px;
    border-top: 1px solid #eee;
}
.cc-chat-input textarea {
    flex: 1;
    resize: none;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 8px;
    height: 38px;
    font-size: 14px;
    font-family: inherit;
}

@media (max-width: 480px) {
    #cc-chat-window {
        width: 92vw;
        right: 4vw !important;
        left: 4vw !important;
    }
}

/* Botón de chat para usar dentro de productos, páginas o entradas (shortcode o clase cc-open-chat-btn) */
.cc-inline-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: none;
    color: #fff;
    padding: 10px 18px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0,0,0,.15);
    transition: transform .15s ease, opacity .15s ease;
}
.cc-inline-btn:hover { transform: translateY(-1px); opacity: .92; }
