/* شاپو — پنل فروشنده LiveMaster */

.lm-shopo-hidden { display: none !important; }

#shopo-livemaster-root {
    --lm-shopo-top: calc(62px + env(safe-area-inset-top, 0px));
    --lm-nav-h: calc(72px + env(safe-area-inset-bottom, 0px));
}

#shopo-livemaster-root .chat-widget-btn {
    position: fixed;
    top: var(--lm-shopo-top);
    left: 12px;
    width: 48px;
    height: 48px;
    padding: 0;
    background: var(--surface);
    border: 1px solid rgba(79, 142, 247, 0.45);
    border-radius: 14px;
    cursor: pointer;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.35);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 440;
    transition: transform 0.2s ease, border-color 0.2s, background 0.2s;
    color: var(--brand);
}

#shopo-livemaster-root .chat-widget-btn:hover,
#shopo-livemaster-root .chat-widget-btn[aria-expanded="true"] {
    transform: scale(1.05);
    border-color: var(--brand);
    background: rgba(79, 142, 247, 0.12);
}

#shopo-livemaster-root .chat-widget-btn svg {
    width: 24px;
    height: 24px;
    display: block;
}

#shopo-livemaster-root .chat-panel {
    display: none;
    position: fixed;
    top: calc(var(--lm-shopo-top) + 56px);
    left: 12px;
    width: min(360px, calc(100vw - 24px));
    max-height: min(460px, calc(100vh - var(--lm-shopo-top) - var(--lm-nav-h) - 70px));
    background: var(--surface);
    border: 1px solid rgba(79, 142, 247, 0.3);
    border-radius: 18px;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.5);
    z-index: 445;
    flex-direction: column;
    overflow: hidden;
}

#shopo-livemaster-root .chat-panel.open {
    display: flex;
    animation: lm-chat-in 0.3s cubic-bezier(0.34, 1.2, 0.64, 1);
}

@keyframes lm-chat-in {
    from { opacity: 0; transform: translateY(-8px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

#shopo-livemaster-root .chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-height: 100px;
}

#shopo-livemaster-root .chat-msg {
    max-width: 90%;
    padding: 10px 12px;
    border-radius: 14px;
    font-size: 0.82rem;
    line-height: 1.6;
}

#shopo-livemaster-root .chat-msg.bot {
    align-self: flex-start;
    background: rgba(123, 94, 248, 0.12);
    border: 1px solid rgba(123, 94, 248, 0.22);
    color: var(--txt1);
}

#shopo-livemaster-root .chat-msg.user {
    align-self: flex-end;
    background: linear-gradient(135deg, var(--brand), #6366f1);
    color: #fff;
}

#shopo-livemaster-root .chat-input-area {
    display: flex;
    gap: 8px;
    padding: 10px 12px;
    border-top: 1px solid var(--border);
    background: var(--surface2);
}

#shopo-livemaster-root .chat-input {
    flex: 1;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 9px 12px;
    color: var(--txt1);
    font-family: inherit;
    font-size: 0.82rem;
}

#shopo-livemaster-root .chat-send-btn {
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--brand), #6366f1);
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* حباب راهنما */
#shopo-livemaster-root .sl-nudge {
    position: fixed;
    top: calc(var(--lm-shopo-top) + 60px);
    left: 12px;
    max-width: min(320px, calc(100vw - 24px));
    background: var(--surface);
    border: 1px solid rgba(123, 94, 248, 0.35);
    border-radius: 16px;
    padding: 14px;
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.45);
    z-index: 438;
    opacity: 0;
    transform: translateY(-6px);
    pointer-events: none;
    transition: opacity 0.22s ease, transform 0.22s ease;
}

#shopo-livemaster-root .sl-nudge.visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

#shopo-livemaster-root .sl-nudge.hiding {
    opacity: 0;
    transform: translateY(-4px);
}

#shopo-livemaster-root .sl-nudge.pinned {
    border-color: rgba(79, 142, 247, 0.5);
}

#shopo-livemaster-root .sl-nudge-close {
    position: absolute;
    top: 8px;
    left: 8px;
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 8px;
    background: var(--surface2);
    color: var(--txt2);
    cursor: pointer;
    font-size: 1.1rem;
    line-height: 1;
}

#shopo-livemaster-root .sl-nudge-head {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
    padding-right: 24px;
}

#shopo-livemaster-root .sl-nudge-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
}

#shopo-livemaster-root .sl-nudge-title {
    font-size: 0.85rem;
    font-weight: 800;
    color: var(--txt1);
}

#shopo-livemaster-root .sl-nudge-body {
    font-size: 0.78rem;
    color: var(--txt2);
    line-height: 1.55;
    margin-bottom: 10px;
}

#shopo-livemaster-root .sl-nudge-cta {
    width: 100%;
    padding: 10px;
    border: none;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--brand), #6366f1);
    color: #fff;
    font-weight: 700;
    font-size: 0.78rem;
    cursor: pointer;
}

#shopo-livemaster-root .sl-nudge-pin-hint {
    display: none;
    margin-top: 8px;
    font-size: 0.68rem;
    color: var(--txt3);
    text-align: center;
}

@media (max-width: 768px) {
    #shopo-livemaster-root .chat-widget-btn {
        top: auto;
        bottom: calc(var(--lm-nav-h) + 12px);
        left: auto;
        right: 10px;
        width: 44px;
        height: 44px;
        border-radius: 50%;
    }

    #shopo-livemaster-root .chat-panel {
        top: auto;
        bottom: calc(var(--lm-nav-h) + 52px);
        left: 8px;
        right: 8px;
        width: auto;
        max-height: min(420px, 55vh);
    }

    #shopo-livemaster-root .sl-nudge {
        bottom: calc(var(--lm-nav-h) + 56px);
        left: 8px;
        right: 8px;
        top: auto;
        max-width: none;
    }

    #shopo-livemaster-root .sl-nudge.modal-nudge {
        bottom: calc(var(--lm-nav-h) + 8px);
        top: auto;
        transform: none;
        max-height: 42vh;
        overflow-y: auto;
    }
}

/* ─── شاپو — کارت آمادگی لایو ─── */
#shopo-readiness-root {
    margin: 0 0 20px;
}

.sl-coach {
    position: relative;
    border-radius: 20px;
    border: 1px solid rgba(123, 94, 248, 0.35);
    background: linear-gradient(135deg, rgba(17, 24, 39, 0.95) 0%, rgba(30, 27, 75, 0.88) 100%);
    padding: 16px;
    overflow: hidden;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.sl-coach-glow {
    position: absolute;
    top: -40%;
    right: -20%;
    width: 220px;
    height: 220px;
    background: radial-gradient(circle, rgba(123, 94, 248, 0.25) 0%, transparent 70%);
    pointer-events: none;
}

.sl-coach-head {
    display: flex;
    align-items: center;
    gap: 12px;
    position: relative;
    z-index: 1;
}

.sl-coach-progress-ring {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: conic-gradient(var(--brand) calc(var(--pct) * 1%), rgba(255,255,255,0.08) 0);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.sl-coach-progress-ring span {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--surface2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 800;
    color: var(--brand);
}

.sl-coach-head-text { flex: 1; min-width: 0; }

.sl-coach-title {
    font-size: 0.95rem;
    font-weight: 800;
    color: var(--txt1);
}

.sl-coach-sub {
    font-size: 0.75rem;
    color: var(--txt2);
    margin-top: 2px;
}

.sl-coach-toggle {
    width: 32px;
    height: 32px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--surface2);
    color: var(--txt2);
    cursor: pointer;
    font-size: 1.1rem;
    line-height: 1;
}

.sl-coach-focus {
    margin-top: 14px;
    padding: 14px;
    border-radius: 14px;
    background: rgba(79, 142, 247, 0.1);
    border: 1px solid rgba(79, 142, 247, 0.25);
    position: relative;
    z-index: 1;
}

.sl-coach-focus-label {
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    color: var(--brand);
    margin-bottom: 6px;
}

.sl-coach-focus-title {
    font-size: 0.9rem;
    font-weight: 800;
    color: var(--txt1);
    margin-bottom: 6px;
}

.sl-coach-focus-hint {
    font-size: 0.78rem;
    color: var(--txt2);
    line-height: 1.55;
    margin-bottom: 12px;
}

.sl-coach-focus-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.sl-coach-cta {
    flex: 1;
    min-width: 140px;
    padding: 10px 14px;
    border: none;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--brand), #6366f1);
    color: #fff;
    font-weight: 700;
    font-size: 0.8rem;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(79, 142, 247, 0.35);
}

.sl-coach-ghost {
    padding: 10px 14px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--txt2);
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
}

.sl-coach-steps {
    margin-top: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    position: relative;
    z-index: 1;
}

.sl-coach--collapsed .sl-coach-focus,
.sl-coach--collapsed .sl-coach-steps {
    display: none;
}

.sl-coach-step {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid transparent;
}

.sl-coach-step.active {
    border-color: rgba(79, 142, 247, 0.45);
    background: rgba(79, 142, 247, 0.08);
}

.sl-coach-step.done { opacity: 0.65; }

.sl-coach-step-icon {
    font-size: 1.1rem;
    line-height: 1;
    flex-shrink: 0;
}

.sl-coach-step-body { flex: 1; min-width: 0; }

.sl-coach-step-title {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--txt1);
}

.sl-coach-step-hint {
    font-size: 0.72rem;
    color: var(--txt2);
    margin-top: 3px;
    line-height: 1.45;
}

.sl-coach-step-btn {
    margin-top: 8px;
    padding: 6px 10px;
    border-radius: 8px;
    border: 1px solid rgba(79, 142, 247, 0.4);
    background: rgba(79, 142, 247, 0.12);
    color: var(--brand);
    font-size: 0.72rem;
    font-weight: 700;
    cursor: pointer;
}

.sl-coach-step-ok {
    display: inline-block;
    margin-top: 6px;
    color: var(--green);
    font-weight: 800;
}

.sl-coach-step-num {
    font-size: 0.65rem;
    color: var(--txt3);
    font-weight: 700;
    opacity: 0.7;
}

.sl-coach--ready {
    border-color: rgba(34, 211, 165, 0.35);
    background: linear-gradient(135deg, rgba(6, 78, 59, 0.35) 0%, rgba(17, 24, 39, 0.9) 100%);
}

.sl-coach-badge {
    font-size: 1.6rem;
    line-height: 1;
}

@media (max-width: 768px) {
    .sl-coach-focus-actions { flex-direction: column; }
    .sl-coach-cta, .sl-coach-ghost { width: 100%; }
}

.sl-coach-live-tabs {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    margin-top: 12px;
    padding-bottom: 4px;
    position: relative;
    z-index: 1;
}

.sl-coach-live-tab {
    flex: 0 0 auto;
    min-width: 140px;
    max-width: 200px;
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.04);
    color: var(--txt2);
    cursor: pointer;
    text-align: right;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.sl-coach-live-tab.active {
    border-color: rgba(79, 142, 247, 0.55);
    background: rgba(79, 142, 247, 0.12);
    color: var(--txt1);
}

.sl-coach-live-tab-title {
    font-size: 0.75rem;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sl-coach-live-tab-meta {
    font-size: 0.65rem;
    opacity: 0.85;
}

.sl-coach-live-tab-pct {
    font-size: 0.68rem;
    font-weight: 800;
    color: var(--brand);
}
