#sorena-assistant-root {
    position: fixed;
    bottom: 24px;
    left: 24px;
    z-index: 99999;
    font-family: Tahoma, 'Segoe UI', Arial, sans-serif;
}

#sorena-assistant-root.sorena-pos-right {
    left: auto;
    right: 24px;
}

#sorena-assistant-root.sorena-pos-left {
    left: 24px;
    right: auto;
}

[dir="rtl"] #sorena-assistant-root.sorena-pos-left {
    left: auto;
    right: 24px;
}

[dir="rtl"] #sorena-assistant-root.sorena-pos-right {
    right: auto;
    left: 24px;
}

#sorena-assistant-toggle {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, #1a4d8c, #2563a8);
    color: #fff;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(26, 77, 140, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s;
}

#sorena-assistant-toggle:hover {
    transform: scale(1.08);
}

#sorena-assistant-panel {
    position: absolute;
    bottom: 68px;
    left: 0;
    width: 360px;
    max-width: calc(100vw - 32px);
    height: 520px;
    max-height: calc(100vh - 120px);
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.18);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: opacity 0.2s, transform 0.2s;
}

[dir="rtl"] #sorena-assistant-panel {
    left: auto;
    right: 0;
}

#sorena-assistant-panel.sorena-assistant-hidden {
    opacity: 0;
    pointer-events: none;
    transform: translateY(12px);
}

.sorena-assistant-header {
    background: linear-gradient(135deg, #1a4d8c, #2563a8);
    color: #fff;
    padding: 14px 16px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.sorena-assistant-header strong {
    display: block;
    font-size: 15px;
}

.sorena-assistant-header small {
    opacity: 0.85;
    font-size: 12px;
}

#sorena-assistant-close {
    background: none;
    border: none;
    color: #fff;
    font-size: 22px;
    cursor: pointer;
    line-height: 1;
    padding: 0 4px;
}

#sorena-assistant-messages {
    flex: 1;
    overflow-y: auto;
    padding: 14px;
    background: #f5f7fa;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.sorena-msg {
    max-width: 88%;
    padding: 10px 14px;
    border-radius: 14px;
    font-size: 13.5px;
    line-height: 1.6;
    white-space: pre-wrap;
    word-break: break-word;
}

.sorena-msg.bot {
    align-self: flex-start;
    background: #fff;
    border: 1px solid #e0e6ef;
    border-bottom-left-radius: 4px;
}

[dir="rtl"] .sorena-msg.bot {
    border-bottom-left-radius: 14px;
    border-bottom-right-radius: 4px;
}

.sorena-msg.user {
    align-self: flex-end;
    background: #1a4d8c;
    color: #fff;
    border-bottom-right-radius: 4px;
}

[dir="rtl"] .sorena-msg.user {
    border-bottom-right-radius: 14px;
    border-bottom-left-radius: 4px;
}

.sorena-msg.typing {
    color: #5a6578;
    font-style: italic;
}

.sorena-product-cards {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 8px;
}

.sorena-product-card {
    display: flex;
    gap: 10px;
    background: #e8f1fa;
    border-radius: 10px;
    padding: 8px;
    text-decoration: none;
    color: #1c2330;
    transition: background 0.15s;
}

.sorena-product-card:hover {
    background: #d0e3f5;
}

.sorena-product-card img {
    width: 48px;
    height: 48px;
    object-fit: cover;
    border-radius: 6px;
    flex-shrink: 0;
}

.sorena-product-card span {
    font-size: 12.5px;
    font-weight: 600;
    line-height: 1.4;
}

.sorena-assistant-quick {
    padding: 8px 12px;
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    border-top: 1px solid #e8ecf2;
}

.sorena-quick-btn {
    background: #e8f1fa;
    border: 1px solid #c5d4e8;
    border-radius: 20px;
    padding: 4px 12px;
    font-size: 12px;
    cursor: pointer;
    color: #1a4d8c;
}

.sorena-quick-btn:hover {
    background: #d0e3f5;
}

.sorena-assistant-input {
    display: flex;
    gap: 8px;
    padding: 10px 12px;
    border-top: 1px solid #e8ecf2;
    background: #fff;
}

#sorena-assistant-text {
    flex: 1;
    border: 1px solid #c5d4e8;
    border-radius: 10px;
    padding: 8px 10px;
    font-size: 13px;
    resize: none;
    font-family: inherit;
}

#sorena-assistant-send {
    background: #1a4d8c;
    color: #fff;
    border: none;
    border-radius: 10px;
    padding: 8px 14px;
    cursor: pointer;
    font-size: 13px;
    white-space: nowrap;
}

#sorena-assistant-send:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

@media (max-width: 480px) {
    #sorena-assistant-panel {
        width: calc(100vw - 16px);
        left: -8px;
    }
    .sorena-pos-right #sorena-assistant-panel {
        right: -8px;
        left: auto;
    }
}

/* Wizard */
.sorena-wizard {
    padding: 14px;
    flex: 1;
    overflow-y: auto;
    background: #f5f7fa;
}

.sorena-wizard h4 {
    margin: 0 0 8px;
    color: #1a4d8c;
    font-size: 14px;
}

.sorena-wz-q {
    font-weight: 600;
    margin: 0 0 12px;
    font-size: 13.5px;
}

.sorena-wz-opts {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sorena-wz-opt {
    background: #fff;
    border: 1px solid #c5d4e8;
    border-radius: 10px;
    padding: 10px 14px;
    text-align: right;
    cursor: pointer;
    font-size: 13px;
    color: #1a4d8c;
    transition: background 0.15s;
}

.sorena-wz-opt:hover {
    background: #e8f1fa;
}

.sorena-wz-loading {
    text-align: center;
    color: #5a6578;
    padding: 20px;
}
