:root {
    --awc-primary-color: #0073aa;
    --awc-bg-color: #ffffff;
    --awc-text-color: #333333;
    --awc-user-msg-bg: #0073aa;
    --awc-user-text-color: #ffffff;
    --awc-bot-msg-bg: #e5e5ea;
    --awc-bot-text-color: #333333;
    --awc-width: 450px;
    --awc-height: 600px;
    --awc-bubble-size: 60px;
}

/* Floating Chat Bubble */
.awc-chat-bubble {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: var(--awc-bubble-size);
    height: var(--awc-bubble-size);
    background-color: var(--awc-primary-color);
    border-radius: 50%;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25), 0 2px 8px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: transform 0.2s;
}

.awc-chat-bubble:hover {
    transform: scale(1.05);
}

.awc-chat-bubble i {
    color: white;
    font-size: 24px;
}

/* Chat Window */
.awc-chat-window {
    position: fixed;
    bottom: 90px;
    right: 20px;
    right: 20px;
    width: var(--awc-width);
    height: var(--awc-height);
    max-width: 90vw;
    max-height: 80vh;
    background-color: var(--awc-bg-color);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    z-index: 9999;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
    transform: translateY(20px);
    transition: opacity 0.3s, transform 0.3s, width 0.3s, height 0.3s;
}

/* Large Mode Class (Fuller screen on request) */
/* Large Mode Class (Even fuller screen) */
.awc-chat-window.large-mode {
    width: 600px;
    height: 80vh;
    max-width: 95vw;
    bottom: 90px;
    right: 20px;
}

.awc-chat-window.open {
    opacity: 1;
    pointer-events: all;
    transform: translateY(0);
}

/* Header */
.awc-chat-header {
    background-color: var(--awc-primary-color);
    color: white;
    padding: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #eee;
}

.awc-chat-header h3 {
    margin: 0;
    font-size: 16px;
    color: white;
}

.awc-header-controls {
    display: flex;
    gap: 10px;
}

.awc-header-btn {
    background: none;
    border: none;
    color: white;
    font-size: 16px;
    cursor: pointer;
    padding: 0 5px;
    opacity: 0.8;
    transition: opacity 0.2s;
}

.awc-header-btn:hover {
    opacity: 1;
}

/* Messages Area */
.awc-messages-container {
    flex: 1;
    padding: 15px;
    overflow-y: auto;
    background-color: #f9f9f9;
    /* Maybe make this a variable too? */
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.awc-message {
    max-width: 80%;
    padding: 10px 15px;
    border-radius: 15px;
    font-size: 14px;
    line-height: 1.4;
    word-wrap: break-word;
}

.awc-message.user {
    align-self: flex-end;
    background-color: var(--awc-user-msg-bg);
    color: var(--awc-user-text-color);
    border-bottom-right-radius: 2px;
}

.awc-message.bot {
    align-self: flex-start;
    background-color: var(--awc-bot-msg-bg);
    color: var(--awc-bot-text-color);
    border-bottom-left-radius: 2px;
}

/* Debug Message Style */
.awc-message.debug-msg {
    background-color: #fff3cd;
    color: #856404;
    border: 1px solid #ffeeba;
    font-family: monospace;
    width: 90%;
    align-self: center;
}

/* Options / Action Links */
.awc-options-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-left: 10px;
    margin-bottom: 10px;
}

.awc-option-btn {
    padding: 8px 12px;
    background-color: var(--awc-bg-color);
    border: 1px solid var(--awc-primary-color);
    color: var(--awc-primary-color);
    border-radius: 20px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
}

.awc-option-btn:hover {
    background-color: var(--awc-primary-color);
    color: white;
}

.awc-action-links {
    display: flex;
    gap: 10px;
    margin-top: 8px;
    justify-content: flex-start;
    flex-wrap: wrap;
}

.awc-btn-link {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 4px;
    text-decoration: none !important;
    font-size: 12px;
    font-weight: bold;
    text-align: center;
}

.awc-btn-link.primary {
    background-color: #28a745;
    color: white !important;
    border: 1px solid #28a745;
}

.awc-btn-link.secondary {
    background-color: var(--awc-bg-color);
    color: var(--awc-primary-color) !important;
    border: 1px solid var(--awc-primary-color);
}

.awc-btn-link.primary:hover {
    background-color: #218838;
}

.awc-btn-link.secondary:hover {
    background-color: #f0f0f0;
}


/* Input Area */
.awc-input-area {
    padding: 10px;
    background-color: var(--awc-bg-color);
    border-top: 1px solid #eee;
    display: flex;
    gap: 10px;
}

.awc-input-area input {
    flex: 1;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 20px;
    outline: none;
}

.awc-input-area button {
    background-color: var(--awc-primary-color);
    color: white;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
}

.awc-input-area button:hover {
    opacity: 0.9;
}

/* Typing Indicator */
.awc-typing {
    align-self: flex-start;
    background-color: var(--awc-bot-msg-bg);
    padding: 10px 15px;
    border-radius: 15px;
    border-bottom-left-radius: 2px;
    display: none;
}

.awc-typing.active {
    display: block;
}

.awc-dots span {
    display: inline-block;
    width: 6px;
    height: 6px;
    background-color: #999;
    border-radius: 50%;
    margin-right: 3px;
    animation: typing 1s infinite;
}

.awc-dots span:nth-child(2) {
    animation-delay: 0.2s;
}

.awc-dots span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typing {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-3px);
    }
}

/* Product Cards */
.awc-cards-container {
    display: flex;
    gap: 10px;
    padding: 10px 0;
    overflow-x: auto;
    width: 100%;
    scrollbar-width: thin;
}

.awc-product-card {
    flex: 0 0 140px;
    background: #fff;
    border: 1px solid #eee;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
}

.awc-product-card img {
    width: 100%;
    height: 100px;
    object-fit: cover;
}

.awc-card-body {
    padding: 8px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.awc-card-title {
    font-size: 11px;
    font-weight: 600;
    margin-bottom: 4px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.2;
    color: #333;
}

.awc-card-price {
    font-size: 12px;
    color: #28a745;
    font-weight: bold;
    margin-bottom: 6px;
}

.awc-card-actions {
    margin-top: auto;
    display: flex;
    gap: 4px;
}

.awc-card-btn {
    flex: 1;
    border: none;
    padding: 4px;
    font-size: 10px;
    border-radius: 4px;
    cursor: pointer;
    text-align: center;
    text-decoration: none;
    background: #f0f0f0;
    color: #333;
}

.awc-card-btn.primary {
    background: var(--awc-primary-color);
    color: white;
}

/* Welcome Nudge (Proactive Message) */
.awc-welcome-nudge {
    position: fixed;
    bottom: 90px;
    right: 20px;
    background: white;
    padding: 12px 16px;
    border-radius: 20px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25), 0 2px 8px rgba(0, 0, 0, 0.1);
    font-size: 14px;
    color: #333;
    max-width: 250px;
    z-index: 9998;
    cursor: pointer;
    opacity: 0;
    transform: translateY(10px) scale(0.9);
    pointer-events: none;
    transition: opacity 0.3s, transform 0.3s;
}

.awc-welcome-nudge.show {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: all;
    animation: nudgeBounce 0.5s ease;
}

.awc-welcome-nudge:hover {
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

.awc-nudge-close {
    position: absolute;
    top: 4px;
    right: 8px;
    font-size: 18px;
    font-weight: bold;
    color: #999;
    cursor: pointer;
    line-height: 1;
    padding: 2px 6px;
    border-radius: 50%;
    transition: background 0.2s;
}

.awc-nudge-close:hover {
    background: #f0f0f0;
    color: #333;
}

/* Triangle pointer to bubble */
.awc-welcome-nudge::after {
    content: '';
    position: absolute;
    bottom: -8px;
    right: 25px;
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-top: 8px solid white;
}

@keyframes nudgeBounce {

    0%,
    100% {
        transform: translateY(0) scale(1);
    }

    50% {
        transform: translateY(-5px) scale(1.02);
    }
}