/* Sticky Button */
.wc-chat-button {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--wc-chat-primary, #000000);
    color: white;
    border: none;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
    cursor: pointer;
    z-index: 9998;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease, background 0.2s ease;
}

.wc-chat-button:hover {
    transform: scale(1.05);
    filter: brightness(1.2);
}

/* Tooltip */
.wc-chat-tooltip {
    position: fixed;
    bottom: 35px;
    right: 95px;
    background: #ffffff;
    padding: 12px 25px 12px 15px;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
    font-size: 0.9rem;
    color: #333;
    z-index: 9998;
    max-width: 250px;
    animation: fadeIn 0.5s ease;
    border: 1px solid #eee;
    font-family: var(--wc-chat-font-family, inherit);
}

.wc-chat-tooltip::after {
    content: '';
    position: absolute;
    top: 50%;
    right: -8px;
    transform: translateY(-50%);
    border-width: 8px 0 8px 8px;
    border-style: solid;
    border-color: transparent transparent transparent #ffffff;
}

#wc-chat-tooltip-close {
    position: absolute;
    top: 5px;
    right: 5px;
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    color: #999;
    line-height: 1;
    padding: 0;
}

#wc-chat-tooltip-close:hover {
    color: #333;
}

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

/* Chat Window */
.wc-chat-window {
    position: fixed;
    top: 10vh;
    left: 5vw;
    width: 90vw;
    height: 80vh;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    overflow: hidden;
    background: #f5f5f5;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease;
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    font-family: var(--wc-chat-font-family, inherit);
}

.wc-chat-window.wc-chat-hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(20px);
}

.wc-chat-header {
    background: #ffffff;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.wc-chat-header h3 {
    margin: 0;
    font-size: 1.5rem;
    color: #333;
}

#wc-chat-close {
    background: none;
    border: none;
    font-size: 2rem;
    cursor: pointer;
    color: #666;
    line-height: 1;
}

.wc-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    background: #f9f9f9;
}

.wc-chat-message {
    max-width: 80%;
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 1rem;
    line-height: 1.4;
    word-wrap: break-word;
}

.bot-message {
    align-self: flex-start;
    background: #ffffff;
    color: #333;
    border: 1px solid #e0e0e0;
    border-bottom-left-radius: 2px;
}

.user-message {
    align-self: flex-end;
    background: var(--wc-chat-primary, #000000);
    color: #ffffff;
    border-bottom-right-radius: 2px;
}

.wc-chat-input-area {
    background: #ffffff;
    padding: 20px;
    display: flex;
    gap: 10px;
    box-shadow: 0 -2px 5px rgba(0,0,0,0.05);
}

#wc-chat-input {
    flex: 1;
    padding: 15px;
    border: 1px solid #ddd;
    border-radius: 25px;
    font-size: 1rem;
    outline: none;
}

#wc-chat-input:focus {
    border-color: var(--wc-chat-primary, #000000);
}

#wc-chat-submit {
    background: var(--wc-chat-primary, #000000);
    color: white;
    border: none;
    padding: 0 25px;
    border-radius: 25px;
    font-size: 1rem;
    cursor: pointer;
    font-weight: bold;
    transition: filter 0.2s;
}

#wc-chat-submit:hover {
    filter: brightness(1.2);
}

/* Loading dots */
.wc-chat-loading {
    display: flex;
    gap: 4px;
    padding: 8px;
}
.wc-chat-loading span {
    width: 8px;
    height: 8px;
    background: #999;
    border-radius: 50%;
    animation: bounce 1.4s infinite ease-in-out both;
}
.wc-chat-loading span:nth-child(1) { animation-delay: -0.32s; }
.wc-chat-loading span:nth-child(2) { animation-delay: -0.16s; }
@keyframes bounce {
    0%, 80%, 100% { transform: scale(0); }
    40% { transform: scale(1); }
}

/* Products List in Chat */
.wc-chat-products-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 15px;
    margin-top: 15px;
}

.wc-chat-product-item {
    background: #fff;
    border: 1px solid #eee;
    border-radius: 8px;
    overflow: hidden;
    text-align: center;
    transition: transform 0.2s;
}

.wc-chat-product-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.wc-chat-product-item a {
    text-decoration: none;
    color: inherit;
    display: block;
    padding: 10px;
}

.wc-chat-product-item img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
    margin-bottom: 10px;
}

.wc-chat-product-item h4 {
    margin: 0 0 5px 0;
    font-size: 0.9rem;
    color: #333;
}

.wc-chat-product-item .price {
    color: var(--wc-chat-primary, #000000);
    font-weight: bold;
    font-size: 0.9rem;
}
