/* Prestigeo widget */
:root {
    --prestigeo-bg: var(--bg-page, #ffffff);
    --prestigeo-text: var(--text-primary, #1d1f24);
    --prestigeo-muted: var(--text-muted, #6c7280);
    --prestigeo-border: var(--border-subtle, rgba(0, 0, 0, 0.08));
    --prestigeo-accent: var(--web-primary, #d19a3a);
    --prestigeo-card: var(--bg-surface, #f6f7fb);
    --prestigeo-shadow: 0 12px 40px rgba(16, 24, 40, 0.18);
}

.prestigeo-bot[data-pl-theme="dark"] {
    --prestigeo-bg: var(--bg-page, #121417);
    --prestigeo-text: var(--text-primary, #f4f6f8);
    --prestigeo-muted: var(--text-muted, #a0a6b4);
    --prestigeo-border: var(--border-subtle, rgba(255, 255, 255, 0.12));
    --prestigeo-card: var(--bg-surface, #1c1f25);
    --prestigeo-shadow: 0 18px 50px rgba(0, 0, 0, 0.4);
}

.prestigeo-bot {
    position: fixed;
    z-index: 9999;
    font-family: inherit;
    color: var(--prestigeo-text);
}

.prestigeo-bot.prestigeo-bot--dock {
    position: relative;
    inset: auto;
    align-self: center;
}

.prestigeo-bot[data-dir="rtl"] {
    direction: rtl;
}

.prestigeo-bot__fab {
    height: 46px;
    padding: 0 16px;
    border-radius: 999px;
    border: 1px solid var(--prestigeo-border);
    background: var(--prestigeo-accent);
    color: #fff;
    box-shadow: var(--prestigeo-shadow);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    position: relative;
}

.prestigeo-bot__fab-icon {
    font-size: 18px;
}

.prestigeo-bot__fab-text {
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.2px;
    white-space: nowrap;
}

.prestigeo-bot[data-dir="rtl"] .prestigeo-bot__fab {
    flex-direction: row-reverse;
}

.prestigeo-bot__badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    background: #ff4d4f;
    color: #fff;
    font-size: 11px;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
}

.prestigeo-bot[data-dir="rtl"] .prestigeo-bot__badge {
    right: auto;
    left: -4px;
}

.prestigeo-bot__panel {
    position: absolute;
    bottom: 62px;
    width: 320px;
    border-radius: 16px;
    background: var(--prestigeo-bg);
    box-shadow: var(--prestigeo-shadow);
    border: 1px solid var(--prestigeo-border);
    display: none;
    flex-direction: column;
    overflow: hidden;
}

.prestigeo-bot__panel.open {
    display: flex;
}

.prestigeo-bot__header {
    padding: 14px 16px;
    border-bottom: 1px solid var(--prestigeo-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.prestigeo-bot__title {
    font-weight: 600;
}

.prestigeo-bot__close {
    border: none;
    background: transparent;
    color: var(--prestigeo-muted);
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
}

.prestigeo-bot__body {
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: 340px;
    overflow-y: auto;
}

.prestigeo-bot__quick {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.prestigeo-bot__chip {
    border: 1px solid var(--prestigeo-border);
    background: transparent;
    border-radius: 999px;
    padding: 6px 10px;
    font-size: 12px;
    cursor: pointer;
    color: var(--prestigeo-text);
}

.prestigeo-bot__messages {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.prestigeo-bot__bubble {
    max-width: 85%;
    padding: 10px 12px;
    border-radius: 12px;
    font-size: 13px;
    line-height: 1.4;
}

.prestigeo-bot__bubble.user {
    align-self: flex-end;
    background: var(--prestigeo-accent);
    color: #fff;
}

.prestigeo-bot__bubble.bot {
    align-self: flex-start;
    background: var(--prestigeo-card);
    color: var(--prestigeo-text);
}

.prestigeo-bot__products {
    display: grid;
    gap: 8px;
}

.prestigeo-bot__product {
    border: 1px solid var(--prestigeo-border);
    border-radius: 12px;
    padding: 8px;
    display: flex;
    gap: 8px;
    background: var(--prestigeo-card);
}

.prestigeo-bot__product img {
    width: 52px;
    height: 52px;
    border-radius: 8px;
    object-fit: cover;
    background: #e6e7eb;
}

.prestigeo-bot__product-title {
    font-size: 13px;
    font-weight: 600;
}

.prestigeo-bot__product-meta {
    font-size: 12px;
    color: var(--prestigeo-muted);
}

.prestigeo-bot__link {
    color: var(--prestigeo-accent);
    font-size: 12px;
    text-decoration: none;
}

.prestigeo-bot__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.prestigeo-bot__action {
    font-size: 12px;
    border: 1px solid var(--prestigeo-border);
    border-radius: 999px;
    padding: 4px 10px;
    color: var(--prestigeo-accent);
    text-decoration: none;
}

.prestigeo-bot__retry {
    margin-top: 8px;
    border: 1px solid var(--prestigeo-border);
    background: transparent;
    color: var(--prestigeo-text);
    font-size: 12px;
    border-radius: 999px;
    padding: 4px 10px;
    cursor: pointer;
}

.prestigeo-bot__footer {
    border-top: 1px solid var(--prestigeo-border);
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.prestigeo-bot__input-row {
    display: flex;
    gap: 8px;
}

.prestigeo-bot__input {
    flex: 1;
    border: 1px solid var(--prestigeo-border);
    border-radius: 10px;
    padding: 8px 10px;
    background: transparent;
    color: var(--prestigeo-text);
}

.prestigeo-bot__send {
    border: none;
    background: var(--prestigeo-accent);
    color: #fff;
    border-radius: 10px;
    padding: 8px 12px;
    cursor: pointer;
}

.prestigeo-bot__suggestions {
    display: none;
    flex-direction: column;
    gap: 6px;
}

.prestigeo-bot__suggestions.show {
    display: flex;
}

.prestigeo-bot__suggestion {
    font-size: 12px;
    color: var(--prestigeo-muted);
    cursor: pointer;
}

.prestigeo-bot__cta {
    display: none;
    text-align: center;
    padding: 8px 10px;
    border-radius: 10px;
    background: var(--prestigeo-accent);
    color: #fff;
    text-decoration: none;
    font-size: 13px;
}

.prestigeo-bot__cta.show {
    display: block;
}

.prestigeo-bot__loading {
    font-size: 12px;
    color: var(--prestigeo-muted);
}

@media (max-width: 640px) {
    .prestigeo-bot__panel {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        width: 100%;
        border-radius: 16px 16px 0 0;
        max-height: 85vh;
    }

    .prestigeo-bot__body {
        max-height: 45vh;
    }

    .prestigeo-bot__footer {
        padding-bottom: calc(10px + env(safe-area-inset-bottom));
    }
}
