/* ویجت چت لیدی دنارس — FAB کوچک، پنل فقط با کلیک */

.lady-product-chat-panel[hidden],
.lady-product-chat-backdrop[hidden],
.lady-product-chat-msg--typing[hidden] {
    display: none !important;
}

.lady-product-chat {
    position: fixed;
    z-index: 900;
    right: 1rem;
    bottom: calc(1rem + env(safe-area-inset-bottom, 0px));
    pointer-events: none;
}

.lady-product-chat > * {
    pointer-events: auto;
}

.lady-product-chat-fab {
    display: grid;
    place-items: center;
    width: 3.35rem;
    height: 3.35rem;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: linear-gradient(145deg, var(--pink-400), var(--pink-500));
    color: #fff;
    cursor: pointer;
    box-shadow: 0 8px 24px rgba(212, 93, 148, 0.38);
    transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}

.lady-product-chat-fab:hover {
    transform: translateY(-2px) scale(1.04);
    box-shadow: 0 12px 28px rgba(212, 93, 148, 0.45);
}

.lady-product-chat.is-open .lady-product-chat-fab {
    opacity: 0;
    pointer-events: none;
    transform: scale(0.85);
}

.lady-product-chat-fab-icon {
    font-size: 1.35rem;
    line-height: 1;
}

.lady-product-chat-backdrop {
    position: fixed;
    inset: 0;
    z-index: 901;
    background: rgba(30, 15, 25, 0.28);
    backdrop-filter: blur(2px);
}

.lady-product-chat-panel {
    position: fixed;
    z-index: 902;
    right: 1rem;
    bottom: calc(1rem + env(safe-area-inset-bottom, 0px));
    width: min(21rem, calc(100vw - 2rem));
    height: min(26rem, calc(100vh - 5rem));
    max-height: 26rem;
    display: flex;
    flex-direction: column;
    border-radius: 18px;
    background: #fff;
    border: 1px solid rgba(244, 168, 200, 0.35);
    box-shadow: 0 16px 40px rgba(60, 30, 45, 0.2);
    overflow: hidden;
    animation: lady-chat-panel-in 0.22s ease;
}

@keyframes lady-chat-panel-in {
    from { opacity: 0; transform: translateY(12px) scale(0.97); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.lady-product-chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.65rem 0.75rem;
    background: linear-gradient(135deg, #fff8fc, #fffdf8);
    border-bottom: 1px solid rgba(244, 168, 200, 0.2);
    flex-shrink: 0;
}

.lady-product-chat-header-main {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    min-width: 0;
}

.lady-product-chat-header-text {
    min-width: 0;
}

.lady-product-chat-avatar {
    width: 36px;
    height: 36px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    font-size: 1.05rem;
    background: linear-gradient(135deg, var(--pink-300), var(--gold-300));
    flex-shrink: 0;
}

.lady-product-chat-title {
    margin: 0;
    font-size: 0.88rem;
    font-weight: 800;
}

.lady-product-chat-subtitle {
    margin: 0.08rem 0 0;
    font-size: 0.68rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.lady-product-chat-close {
    width: 30px;
    height: 30px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(244, 168, 200, 0.3);
    color: var(--pink-500);
    font-size: 1.2rem;
    line-height: 1;
    cursor: pointer;
    flex-shrink: 0;
}

.lady-product-chat-body {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.lady-product-chat-messages {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    padding: 0.65rem 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    -webkit-overflow-scrolling: touch;
}

.lady-product-chat-msg {
    display: flex;
    max-width: 92%;
}

.lady-product-chat-msg--user {
    align-self: flex-end;
    justify-content: flex-end;
}

.lady-product-chat-msg--lady {
    align-self: flex-start;
}

.lady-product-chat-bubble {
    padding: 0.5rem 0.72rem;
    border-radius: 14px;
    line-height: 1.65;
    font-size: 0.82rem;
    word-break: break-word;
}

.lady-product-chat-bubble.chat-bubble--rich strong {
    font-weight: 800;
    color: inherit;
}

.lady-product-chat-bubble.chat-bubble--rich em {
    font-style: normal;
    color: var(--pink-500);
    font-weight: 600;
}

.lady-product-chat-msg--user .lady-product-chat-bubble {
    background: linear-gradient(135deg, var(--pink-400), var(--pink-500));
    color: #fff;
    border-bottom-left-radius: 4px;
}

.lady-product-chat-msg--lady .lady-product-chat-bubble {
    background: #faf7f4;
    color: var(--text-primary);
    border: 1px solid rgba(244, 168, 200, 0.22);
    border-bottom-right-radius: 4px;
}

.lady-product-chat-bubble--typing {
    display: inline-flex;
    align-items: center;
    gap: 0.28rem;
    padding: 0.55rem 0.7rem;
    min-width: 3rem;
}

.lady-product-chat-dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--pink-400);
    animation: lady-chat-dot 1.1s infinite ease-in-out;
}

.lady-product-chat-dot:nth-child(2) { animation-delay: 0.12s; }
.lady-product-chat-dot:nth-child(3) { animation-delay: 0.24s; }

@keyframes lady-chat-dot {
    0%, 80%, 100% { opacity: 0.35; transform: translateY(0); }
    40% { opacity: 1; transform: translateY(-2px); }
}

.lady-product-chat-suggestions {
    display: flex;
    gap: 0.3rem;
    padding: 0 0.75rem 0.55rem;
    overflow-x: auto;
    flex-shrink: 0;
    scrollbar-width: none;
}

.lady-product-chat-suggestions::-webkit-scrollbar {
    display: none;
}

.lady-product-chat-suggestions.is-hidden {
    display: none;
}

.lady-product-chat-suggestion {
    flex-shrink: 0;
    padding: 0.24rem 0.55rem;
    border-radius: 999px;
    border: 1px solid rgba(244, 168, 200, 0.35);
    background: #fff;
    color: var(--pink-500);
    font-family: inherit;
    font-size: 0.68rem;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
}

.lady-product-chat-composer {
    display: flex;
    align-items: flex-end;
    gap: 0.4rem;
    padding: 0.55rem 0.65rem;
    border-top: 1px solid rgba(244, 168, 200, 0.18);
    background: #fff;
    flex-shrink: 0;
}

.lady-product-chat-input {
    flex: 1;
    min-width: 0;
    min-height: 2.1rem;
    max-height: 5rem;
    resize: none;
    overflow-y: auto;
    border: 1px solid rgba(244, 168, 200, 0.35);
    border-radius: 12px;
    padding: 0.48rem 0.65rem;
    font-family: inherit;
    font-size: 0.84rem;
    line-height: 1.45;
    outline: none;
}

.lady-product-chat-input:focus {
    border-color: var(--pink-400);
}

.lady-product-chat-send {
    width: 2.1rem;
    height: 2.1rem;
    border: none;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--pink-400), var(--pink-500));
    color: #fff;
    font-size: 0.9rem;
    cursor: pointer;
    flex-shrink: 0;
}

.lady-product-chat-send:disabled {
    opacity: 0.5;
}

.lady-product-chat-login {
    padding: 1.1rem 0.9rem 1.3rem;
    text-align: center;
}

.lady-product-chat-login p {
    margin: 0 0 0.85rem;
    font-size: 0.82rem;
    line-height: 1.7;
    color: var(--text-secondary);
}

.btn-lady-chat {
    background: linear-gradient(135deg, rgba(244, 168, 200, 0.18), rgba(212, 175, 55, 0.14));
    border: 1px solid rgba(244, 168, 200, 0.4);
    color: var(--pink-500);
}

@media (max-width: 640px) {
    .lady-product-chat-panel {
        right: 0;
        left: 0;
        bottom: 0;
        width: 100%;
        height: min(72vh, 28rem);
        max-height: 72vh;
        border-radius: 18px 18px 0 0;
    }

    .lady-product-chat-fab {
        right: 0.85rem;
        bottom: 0.85rem;
    }
}

/* فرمت مشترک پیام چت */
.chat-bubble--rich strong {
    font-weight: 800;
}

.chat-bubble--rich em {
    font-style: normal;
    color: var(--pink-500);
    font-weight: 600;
}

.chat-bubble--rich {
    line-height: 1.75;
}
