#wcbw-widget {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 999999;
    font-family: inherit;
}

.wcbw-bubble {
    width: 62px;
    height: 62px;
    border: none;
    border-radius: 50%;
    background: #2271b1;
    color: #fff;
    box-shadow: 0 10px 25px rgba(0,0,0,.18);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform .2s ease, box-shadow .2s ease;
}

.wcbw-bubble:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 28px rgba(0,0,0,.22);
}

.wcbw-bubble-icon {
    font-size: 26px;
    line-height: 1;
}

.wcbw-panel {
    position: absolute;
    right: 0;
    bottom: 76px;
    width: min(360px, calc(100vw - 40px));
    height: 520px;
    max-height: calc(100vh - 120px);
    background: #fff;
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 18px 50px rgba(0,0,0,.22);
    border: 1px solid rgba(0,0,0,.06);
    display: flex;
    flex-direction: column;
}

.wcbw-panel {
    opacity: 0;
    transform: translateY(20px) scale(0.95);
    transition: all 0.25s ease;
    pointer-events: none;
}

.wcbw-panel.is-open {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}


.wcbw-header {
    background: #2271b1;
    color: #fff;
    padding: 14px 16px;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.wcbw-header strong {
    display: block;
    font-size: 15px;
}

.wcbw-header span {
    display: block;
    font-size: 12px;
    opacity: .9;
    margin-top: 2px;
}

.wcbw-close {
    background: transparent;
    border: none;
    color: #fff;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    padding: 0;
}

.wcbw-body {
    padding: 14px;
    overflow-y: auto;
    flex: 1;
    background: #f6f7f7;
}

.wcbw-message {
    max-width: 88%;
    margin-bottom: 10px;
    padding: 12px 14px;
    border-radius: 14px;
    font-size: 14px;
    line-height: 1.4;
}

.wcbw-bot {
    background: #fff;
    color: #1d2327;
    border: 1px solid #e5e7eb;
}

.wcbw-user {
    margin-left: auto;
    background: #dbeafe;
    color: #1e3a8a;
}

.wcbw-options {
    display: grid;
    gap: 10px;
    margin-top: 12px;
}

.wcbw-option,
.wcbw-send {
    width: 100%;
    border: none;
    border-radius: 12px;
    padding: 12px 14px;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    pointer-events: auto;
    transition: background-color 0.2s ease;
}

.wcbw-option {
    background: #fff;
    border: 1px solid #dbe1e8;
    color: #1d2327;
}

.wcbw-option:hover {
    background: #f8f9fa;
    border-color: #2271b1;
}

.wcbw-option:active {
    transform: scale(0.98);
}

.wcbw-option:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.wcbw-option-primary,
.wcbw-send {
    background: #2271b1;
    color: #fff;
}

.wcbw-option-secondary {
    background: #f3f5f6;
    color: #d94f35;
    border-color: #d94f35;
}

.wcbw-option-secondary:hover {
    background: #ebe8e5;
    border-color: #d94f35;
}

.wcbw-form {
    display: grid;
    gap: 10px;
    margin-top: 10px;
}

.wcbw-form input,
.wcbw-form textarea {
    width: 100%;
    border: 1px solid #d1d5db;
    border-radius: 12px;
    padding: 11px 12px;
    font-size: 14px;
    background: #fff;
    box-sizing: border-box;
}

.wcbw-form textarea {
    resize: vertical;
    min-height: 110px;
}

/* Support Form Styles */
.wcbw-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.wcbw-form input,
.wcbw-form textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-family: inherit;
    font-size: 14px;
    resize: vertical;
    box-sizing: border-box;
}

.wcbw-form input:focus,
.wcbw-form textarea:focus {
    outline: none;
    border-color: #2271b1;
    box-shadow: 0 0 0 3px rgba(34, 113, 177, 0.1);
}

.wcbw-form button {
    width: 100%;
    padding: 10px;
    background: #2271b1;
    color: white;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.wcbw-form button:hover {
    background: #1a5a96;
}

.wcbw-form button:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* Human Agent Chat Styles */
.wcbw-human-chat {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 12px;
}

.wcbw-chat-messages {
    max-height: 300px;
    overflow-y: auto;
    margin-bottom: 10px;
    padding: 10px;
    background: #f9f9f9;
    border-radius: 5px;
    border: 1px solid #ddd;
    font-size: 13px;
    line-height: 1.4;
}

.wcbw-chat-input {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-family: inherit;
    font-size: 13px;
    resize: none;
    box-sizing: border-box;
}

.wcbw-chat-input:focus {
    outline: none;
    border-color: #2271b1;
    box-shadow: 0 0 0 3px rgba(34, 113, 177, 0.1);
}

.wcbw-send-chat-msg {
    padding: 8px 15px;
    background: #2196F3;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
    font-size: 13px;
    transition: background-color 0.2s ease;
}

.wcbw-send-chat-msg:hover {
    background: #0b7dda;
}

.wcbw-send-chat-msg:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* Secondary Button Styling */
.wcbw-option-secondary {
    background: #f3f3f3 !important;
    color: #666 !important;
}

.wcbw-option-secondary:hover {
    background: #e8e8e8 !important;
}

/* Products List Styles */
.wcbw-products-list {
    margin-top: 12px;
    max-height: 300px;
    overflow-y: auto;
    padding: 8px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.wcbw-product-category {
    margin: 0 0 8px 0;
    font-size: 16px;
    font-weight: 600;
    color: #2271b1;
    border-bottom: 1px solid #dee2e6;
    padding-bottom: 4px;
}

.wcbw-product-items {
    list-style: none;
    padding: 0;
    margin: 0 0 16px 0;
}

.wcbw-product-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    margin-bottom: 6px;
    background: #fff;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    font-size: 14px;
    line-height: 1.4;
    transition: box-shadow 0.2s ease;
}

.wcbw-product-item:hover {
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.wcbw-product-item strong {
    color: #1d2327;
    margin-right: 8px;
}

.wcbw-product-link {
    color: #2271b1;
    text-decoration: none;
    font-weight: 500;
    font-size: 12px;
    padding: 4px 8px;
    background: #e3f2fd;
    border-radius: 4px;
    transition: background-color 0.2s ease;
}

.wcbw-product-link:hover {
    background: #bbdefb;
    text-decoration: underline;
}

@media (max-width: 480px) {
    #wcbw-widget {
        right: 12px;
        bottom: 12px;
    }

    .wcbw-panel {
        width: calc(100vw - 24px);
        height: 70vh;
        bottom: 72px;
    }

    .wcbw-products-list {
        max-height: 200px;
    }

    .wcbw-product-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }
}
