:root {
    --asa-primary: #2563eb;
    --asa-primary-dark: #1d4ed8;
    --asa-bg: #ffffff;
    --asa-text: #1f2937;
    --asa-muted: #6b7280;
    --asa-border: #e5e7eb;
    --asa-user-bg: #dbeafe;
    --asa-bot-bg: #f3f4f6;
    --asa-shadow: 0 10px 40px rgba(0,0,0,0.15);
    --asa-radius: 16px;
}
.asa-chat-root {
    position: fixed;
    bottom: 24px;
    z-index: 99999;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Vazirmatn", "IRANSans", sans-serif;
    direction: rtl;
    text-align: right;
}
.asa-chat-root.asa-pos-left {
    left: 24px;
    right: auto;
}
.asa-chat-root.asa-pos-right {
    right: 24px;
    left: auto;
}
.asa-chat-toggle {
    width: 62px;
    height: 62px;
    border-radius: 50%;
    border: 3px solid #f59e0b;
    background: #111;
    color: #fff;
    cursor: pointer;
    box-shadow: var(--asa-shadow);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform .2s;
    padding: 0;
    overflow: hidden;
}
.asa-chat-toggle:hover { transform: scale(1.06); }
.asa-chat-toggle img.asa-icon-open {
    width: 40px;
    height: 40px;
    object-fit: contain;
    display: block;
    border-radius: 8px;
}
.asa-chat-toggle .asa-icon-close { display: none; }
.asa-chat-window {
    position: absolute;
    bottom: 76px;
    width: 370px;
    max-width: calc(100vw - 32px);
    height: 520px;
    max-height: calc(100vh - 120px);
    background: var(--asa-bg);
    border-radius: var(--asa-radius);
    box-shadow: var(--asa-shadow);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid var(--asa-border);
}
.asa-pos-left .asa-chat-window {
    left: 0;
}
.asa-pos-right .asa-chat-window {
    right: 0;
}
.asa-chat-header {
    background: var(--asa-primary);
    color: #fff;
    padding: 14px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}
.asa-chat-header-info {
    display: flex;
    align-items: center;
    gap: 10px;
}
.asa-bot-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    overflow: hidden;
    background: #111;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.asa-bot-avatar img {
    width: 36px;
    height: 36px;
    object-fit: contain;
    display: block;
}
.asa-bot-name {
    display: block;
    font-size: 15px;
    font-weight: 600;
}
.asa-bot-status {
    display: block;
    font-size: 12px;
    opacity: 0.85;
}
.asa-chat-close {
    background: transparent;
    border: none;
    color: #fff;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    padding: 0 4px;
    opacity: 0.9;
}
.asa-chat-close:hover {
    opacity: 1;
}
.asa-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    background: #f9fafb;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.asa-message {
    max-width: 85%;
    padding: 10px 14px;
    border-radius: 14px;
    font-size: 14px;
    line-height: 1.6;
    word-wrap: break-word;
    white-space: pre-wrap;
}
.asa-message.asa-user {
    align-self: flex-start;
    background: var(--asa-user-bg);
    color: var(--asa-text);
    border-bottom-right-radius: 4px;
}
.asa-message.asa-bot {
    align-self: flex-end;
    background: var(--asa-bot-bg);
    color: var(--asa-text);
    border-bottom-left-radius: 4px;
}
.asa-message a {
    color: #2563eb !important;
    text-decoration: underline;
    font-weight: 600;
}
.asa-message a:hover {
    color: #1d4ed8 !important;
}
.asa-message.asa-typing {
    align-self: flex-end;
    background: var(--asa-bot-bg);
    color: var(--asa-muted);
    font-style: italic;
}
.asa-user-form {
    padding: 20px 16px;
    background: #fff;
    border-top: 1px solid var(--asa-border);
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex-shrink: 0;
}
.asa-form-desc {
    margin: 0 0 4px;
    font-size: 13.5px;
    color: var(--asa-muted);
    line-height: 1.5;
}
.asa-input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--asa-border);
    border-radius: 10px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
    box-sizing: border-box;
}
.asa-input:focus {
    border-color: var(--asa-primary);
}
.asa-btn-primary {
    background: var(--asa-primary);
    color: #fff;
    border: none;
    border-radius: 10px;
    padding: 12px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}
.asa-btn-primary:hover {
    background: var(--asa-primary-dark);
}
.asa-chat-input-area {
    padding: 12px 14px;
    background: #fff;
    border-top: 1px solid var(--asa-border);
    flex-shrink: 0;
}
.asa-input-wrapper {
    display: flex;
    align-items: flex-end;
    gap: 8px;
}
.asa-message-input {
    flex: 1;
    border: 1px solid var(--asa-border);
    border-radius: 12px;
    padding: 10px 14px;
    font-size: 14px;
    resize: none;
    max-height: 100px;
    outline: none;
    font-family: inherit;
    line-height: 1.4;
    transition: border-color 0.2s;
}
.asa-message-input:focus {
    border-color: var(--asa-primary);
}
.asa-send-btn {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: none;
    background: var(--asa-primary);
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background 0.2s, transform 0.15s;
}
.asa-send-btn:hover {
    background: var(--asa-primary-dark);
}
.asa-send-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}
.asa-support-link {
    text-align: center;
    margin-top: 10px;
}
.asa-support-link .asa-support-btn {
    display: block;
    width: 100%;
    box-sizing: border-box;
    background: #f59e0b;
    color: #111 !important;
    font-size: 13px;
    font-weight: 700;
    text-decoration: none !important;
    padding: 10px 12px;
    border-radius: 10px;
    border: none;
    transition: filter .15s;
}
.asa-support-link .asa-support-btn:hover {
    filter: brightness(1.05);
    color: #000 !important;
}
@media (max-width: 480px) {
    .asa-chat-root {
        bottom: 16px;
    }
    .asa-pos-left {
        left: 12px;
    }
    .asa-pos-right {
        right: 12px;
    }
    .asa-chat-window {
        width: calc(100vw - 24px);
        height: calc(100vh - 100px);
        bottom: 70px;
    }
    .asa-chat-toggle {
        width: 54px;
        height: 54px;
    }
}



/* Shortcut buttons */
.asa-shortcuts{padding:8px 10px 4px;background:#fff;border-top:1px solid var(--asa-border);display:flex;flex-wrap:wrap;gap:6px}
.asa-shortcuts-title{width:100%;font-size:12px;color:var(--asa-muted);margin:0 0 4px;line-height:1.4}
.asa-chip{border:1px solid transparent;color:#1f2937;border-radius:999px;padding:7px 12px;font-size:12px;cursor:pointer;line-height:1.3;transition:filter .15s,transform .12s;font-weight:600}
.asa-chip:hover{filter:brightness(0.97);transform:translateY(-1px)}
.asa-chip-more{background:#f59e0b!important;border-color:#f59e0b!important;color:#111!important;font-weight:700}
.asa-chip-pkg-wall{background:#dbeafe;border-color:#93c5fd}
.asa-chip-rad-panel{background:#ffedd5;border-color:#fdba74}
.asa-chip-heater-gas{background:#fee2e2;border-color:#fca5a5}
.asa-chip-heater-elec{background:#fef3c7;border-color:#fcd34d}
.asa-chip-cooler-gas{background:#e0e7ff;border-color:#a5b4fc}
.asa-chip-cooler-water{background:#ccfbf1;border-color:#5eead4}
.asa-chip-fridge{background:#f3e8ff;border-color:#d8b4fe}
.asa-chip-purifier{background:#e0f2fe;border-color:#7dd3fc}
.asa-chip-pump{background:#ecfccb;border-color:#bef264}
.asa-chip-jet{background:#ffe4e6;border-color:#fda4af}
.asa-chip-pkg-floor{background:#e2e8f0;border-color:#cbd5e1}
.asa-chip-rad-alu{background:#fafaf9;border-color:#d6d3d1}
.asa-chip-default{background:#f3f4f6;border-color:#e5e7eb}

/* Persistent action buttons during chat */
.asa-more-products-wrap{padding:8px 12px 10px;background:#fff;border-top:1px solid var(--asa-border);display:flex;flex-direction:column;gap:8px}
.asa-more-same-brand-btn{display:block;width:100%;box-sizing:border-box;background:#e0f2fe;color:#0c4a6e;font-size:13px;font-weight:700;border:1px solid #7dd3fc;border-radius:10px;padding:10px 12px;cursor:pointer;transition:filter .15s}
.asa-more-same-brand-btn:hover{filter:brightness(0.97)}
.asa-more-products-btn{display:block;width:100%;box-sizing:border-box;background:#f59e0b;color:#111;font-size:13px;font-weight:700;border:none;border-radius:10px;padding:10px 12px;cursor:pointer;transition:filter .15s}
.asa-more-products-btn:hover{filter:brightness(1.05)}

/* Support on first screen */
.asa-user-form .asa-support-link{margin-top:12px}

.asa-inline-more-brand-wrap{padding:4px 0 8px}
.asa-inline-more-brand{display:inline-block;background:#e0f2fe;color:#0c4a6e;border:1px solid #7dd3fc;border-radius:999px;padding:8px 14px;font-size:12px;font-weight:700;cursor:pointer}
.asa-inline-more-brand:hover{filter:brightness(0.97)}

/* v20 menu */
.asa-menu-actions{padding:8px 12px 10px;background:#fff;border-top:1px solid var(--asa-border);display:flex;flex-direction:column;gap:8px}
.asa-back-main{display:block;width:100%;box-sizing:border-box;background:#f3f4f6;color:#111;font-size:13px;font-weight:700;border:1px solid #d1d5db;border-radius:10px;padding:10px 12px;cursor:pointer}
.asa-back-main:hover{background:#e5e7eb}
.asa-more-cats,.asa-more-items{display:block;width:100%;box-sizing:border-box;background:#f59e0b;color:#111;font-size:13px;font-weight:700;border:none;border-radius:10px;padding:10px 12px;cursor:pointer}
.asa-more-cats:hover,.asa-more-items:hover{filter:brightness(1.05)}
.asa-c-pkg-wall{background:#dbeafe;border-color:#93c5fd!important}
.asa-c-pkg-floor{background:#e2e8f0;border-color:#cbd5e1!important}
.asa-c-rad-panel{background:#ffedd5;border-color:#fdba74!important}
.asa-c-rad-alu{background:#fafaf9;border-color:#d6d3d1!important}
.asa-c-heater-gas{background:#fee2e2;border-color:#fca5a5!important}
.asa-c-heater-elec{background:#fef3c7;border-color:#fcd34d!important}
.asa-c-jet{background:#ffe4e6;border-color:#fda4af!important}
.asa-c-cooler-gas{background:#e0e7ff;border-color:#a5b4fc!important}
.asa-c-cooler-poly{background:#ccfbf1;border-color:#5eead4!important}
.asa-c-fridge{background:#f3e8ff;border-color:#d8b4fe!important}
.asa-c-purifier{background:#e0f2fe;border-color:#7dd3fc!important}
.asa-c-pump{background:#ecfccb;border-color:#bef264!important}
.asa-c-default{background:#f3f4f6;border-color:#e5e7eb!important}
