.whf-chat-widget {
    --whf-primary-color: #2563eb;
    position: fixed;
    z-index: 99999;
    font-family: Tahoma, Arial, sans-serif;
    direction: rtl;
}

.whf-position-right { bottom: 20px; right: 20px; }
.whf-position-left { bottom: 20px; left: 20px; }

.whf-chat-toggle {
    width: 60px;
    height: 60px;
    background-color: var(--whf-primary-color);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    transition: transform 0.3s ease;
    border: none;
    outline: none;
    font-size: 24px;
}

.whf-chat-toggle:hover {
    transform: scale(1.05);
}

.whf-chat-window {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 400px;
    height: 600px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.2);
    display: flex;
    flex-direction: column;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.3s ease;
}

.whf-position-left .whf-chat-window {
    right: auto;
    left: 0;
}

.whf-chat-window.whf-open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.whf-chat-header {
    background: linear-gradient(135deg, var(--whf-primary-color), #1e40af);
    color: white;
    padding: 20px;
    border-radius: 16px 16px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.whf-chat-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

.whf-close-btn {
    background: none;
    border: none;
    color: white;
    font-size: 28px;
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.2s;
    line-height: 1;
}

.whf-close-btn:hover {
    background: rgba(255,255,255,0.2);
}

.whf-chat-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    background-color: #f8fafc;
}

.whf-message {
    max-width: 85%;
    padding: 12px 16px;
    border-radius: 16px;
    margin-bottom: 12px;
    font-size: 14px;
    line-height: 1.6;
    word-wrap: break-word;
    animation: messageSlide 0.3s ease;
}

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

.whf-bot-message {
    background-color: white;
    color: #1e293b;
    border-bottom-right-radius: 4px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.whf-user-message {
    background-color: var(--whf-primary-color);
    color: white;
    margin-right: auto;
    border-bottom-left-radius: 4px;
}

.whf-typing {
    font-style: italic;
    color: #64748b;
    background: white !important;
}

.whf-chat-input-area {
    padding: 16px;
    border-top: 1px solid #e2e8f0;
    display: flex;
    gap: 10px;
    background: white;
    border-radius: 0 0 16px 16px;
}

.whf-input {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    outline: none;
    font-family: inherit;
    font-size: 14px;
    transition: border-color 0.2s;
}

.whf-input:focus {
    border-color: var(--whf-primary-color);
}

.whf-send-btn {
    background-color: var(--whf-primary-color);
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 12px;
    cursor: pointer;
    font-family: inherit;
    font-weight: 600;
    transition: opacity 0.2s;
}

.whf-send-btn:hover {
    opacity: 0.9;
}

.whf-product-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    margin: 12px 0;
    border: 1px solid #e2e8f0;
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    flex-direction: column;
}

.whf-product-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.15);
}

.whf-product-image {
    width: 100%;
    height: 220px;
    background: #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    order: 1;
}

.whf-product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.whf-product-image span {
    color: #94a3b8;
    font-size: 12px;
}

.whf-product-info {
    padding: 16px;
    order: 2;
}

.whf-product-name {
    margin: 0 0 8px 0;
    font-size: 15px;
    font-weight: 600;
    color: #1e293b;
    line-height: 1.4;
}

.whf-product-price {
    font-size: 16px;
    font-weight: 700;
    color: var(--whf-primary-color);
    margin-bottom: 12px;
}

.whf-product-btn {
    display: inline-block;
    width: 100%;
    text-align: center;
    background: linear-gradient(135deg, var(--whf-primary-color), #1e40af);
    color: white;
    padding: 10px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    transition: opacity 0.2s;
}

.whf-product-btn:hover {
    opacity: 0.9;
    text-decoration: none;
    color: white;
}

.whf-link {
    color: var(--whf-primary-color);
    text-decoration: none;
    font-weight: 600;
}

.whf-link:hover {
    text-decoration: underline;
}

@media (max-width: 480px) {
    .whf-chat-window {
        width: calc(100vw - 40px);
        height: 500px;
        right: 20px;
        left: 20px;
    }
    
    .whf-position-left .whf-chat-window {
        right: 20px;
        left: 20px;
    }
}