/* ==========================================================================
   Assistente Prodotti - Circular FAB, External Badge, Teaser & Compact Panel
   ========================================================================== */

#mer-product-assistant {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 99990;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: #0f172a;
    -webkit-font-smoothing: antialiased;
}

#mer-product-assistant [hidden],
#mer-product-assistant[hidden] {
    display: none !important;
}

#mer-product-assistant button {
    font-family: inherit;
}

/* Screen reader only utility */
#mer-product-assistant .screen-reader-text {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

/* ==========================================================================
   Teaser Box ("Quadratino Piccolo" di Invito)
   ========================================================================== */

#mer-ai-teaser {
    position: absolute;
    bottom: 72px;
    right: 0;
    width: 300px;
    max-width: calc(100vw - 32px);
    background: #ffffff;
    border: 1px solid rgba(226, 232, 240, 0.95);
    border-radius: 18px;
    padding: 16px 18px 18px;
    box-shadow: 0 18px 45px -8px rgba(15, 23, 42, 0.22), 0 4px 12px -2px rgba(15, 23, 42, 0.08);
    animation: merAiTeaserPop 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    transform-origin: bottom right;
    box-sizing: border-box;
}

@keyframes merAiTeaserPop {
    0% {
        opacity: 0;
        transform: translateY(14px) scale(0.94);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Speech bubble arrow pointing to the circular FAB */
#mer-ai-teaser::after {
    content: "";
    position: absolute;
    bottom: -7px;
    right: 24px;
    width: 13px;
    height: 13px;
    background: #ffffff;
    border-right: 1px solid rgba(226, 232, 240, 0.95);
    border-bottom: 1px solid rgba(226, 232, 240, 0.95);
    transform: rotate(45deg);
}

#mer-ai-teaser .mer-ai-teaser-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 24px;
    height: 24px;
    border-radius: 6px;
    background: transparent;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: background 0.15s ease, color 0.15s ease;
}

#mer-ai-teaser .mer-ai-teaser-close:hover {
    background: #f1f5f9;
    color: #334155;
}

#mer-ai-teaser .mer-ai-teaser-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-right: 24px;
}

#mer-ai-teaser .mer-ai-teaser-avatar {
    width: 32px;
    height: 32px;
    border-radius: 9px;
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    color: #2563eb;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 2px 6px rgba(37, 99, 235, 0.15);
}

#mer-ai-teaser .mer-ai-teaser-brand strong {
    font-size: 13.5px;
    font-weight: 700;
    color: #0f172a;
    display: block;
    line-height: 1.2;
}

#mer-ai-teaser .mer-ai-teaser-brand small {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: #64748b;
    font-size: 11px;
    font-weight: 500;
}

#mer-ai-teaser .mer-ai-teaser-text {
    font-size: 13px;
    color: #334155;
    line-height: 1.45;
    margin: 10px 0 6px;
}

#mer-ai-teaser .mer-ai-teaser-prompt {
    font-size: 13px;
    font-weight: 650;
    color: #1e40af;
    margin: 0 0 14px;
}

#mer-ai-teaser .mer-ai-teaser-buttons {
    display: flex;
    align-items: center;
    gap: 8px;
}

#mer-ai-teaser .mer-ai-teaser-start {
    background: linear-gradient(135deg, #1d4ed8 0%, #2563eb 100%);
    color: #ffffff;
    font-size: 12.5px;
    font-weight: 650;
    padding: 8px 16px;
    border-radius: 9px;
    border: none;
    cursor: pointer;
    box-shadow: 0 3px 10px rgba(37, 99, 235, 0.3);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

#mer-ai-teaser .mer-ai-teaser-start:hover {
    transform: translateY(-1px);
    box-shadow: 0 5px 14px rgba(37, 99, 235, 0.4);
}

#mer-ai-teaser .mer-ai-teaser-dismiss {
    background: transparent;
    color: #64748b;
    font-size: 12px;
    font-weight: 600;
    padding: 8px 12px;
    border-radius: 9px;
    border: none;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}

#mer-ai-teaser .mer-ai-teaser-dismiss:hover {
    background: #f1f5f9;
    color: #0f172a;
}

/* ==========================================================================
   FAB Wrapper, External Badge & Circular FAB Button
   ========================================================================== */

#mer-product-assistant .mer-ai-fab-wrap {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
}

/* External Label with Blue Border ("Configura con l'AI") */
#mer-product-assistant .mer-ai-fab-label {
    display: inline-flex;
    align-items: center;
    padding: 8px 16px;
    background: #ffffff;
    border: 1.5px solid #2563eb;
    border-radius: 9999px;
    color: #1d4ed8;
    font-size: 13.5px;
    font-weight: 650;
    letter-spacing: 0.15px;
    white-space: nowrap;
    user-select: none;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.12), 0 1px 3px rgba(15, 23, 42, 0.05);
    transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.25s ease, background 0.2s ease, border-color 0.2s ease;
}

#mer-product-assistant .mer-ai-fab-label:hover {
    background: #eff6ff;
    border-color: #1d4ed8;
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(37, 99, 235, 0.25);
}

#mer-product-assistant .mer-ai-fab-label:active {
    transform: translateY(0);
}

#mer-product-assistant .mer-ai-fab-label:focus-visible {
    outline: 3px solid #93c5fd;
    outline-offset: 3px;
}

/* Hide label when chat panel is open */
#mer-product-assistant .mer-ai-fab-wrap:has(.mer-ai-launcher[aria-expanded="true"]) .mer-ai-fab-label,
#mer-product-assistant:has(#mer-ai-panel:not([hidden])) .mer-ai-fab-label {
    display: none !important;
}

/* Pure Circular Floating Action Button */
#mer-product-assistant .mer-ai-launcher {
    position: relative;
    width: 58px;
    height: 58px;
    border-radius: 50% !important;
    padding: 0 !important;
    margin: 0;
    border: none;
    cursor: pointer;
    display: flex !important;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1d4ed8 0%, #2563eb 50%, #3b82f6 100%) !important;
    color: #ffffff !important;
    box-shadow: 0 10px 25px -4px rgba(37, 99, 235, 0.5), 0 4px 10px -2px rgba(15, 23, 42, 0.15), inset 0 1px 1px rgba(255, 255, 255, 0.35);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s ease, background 0.3s ease;
    animation: merAiFabPulse 3.5s infinite;
    flex-shrink: 0;
}

@keyframes merAiFabPulse {
    0% {
        box-shadow: 0 10px 25px -4px rgba(37, 99, 235, 0.5), 0 0 0 0 rgba(37, 99, 235, 0.4);
    }
    70% {
        box-shadow: 0 10px 25px -4px rgba(37, 99, 235, 0.5), 0 0 0 12px rgba(37, 99, 235, 0);
    }
    100% {
        box-shadow: 0 10px 25px -4px rgba(37, 99, 235, 0.5), 0 0 0 0 rgba(37, 99, 235, 0);
    }
}

#mer-product-assistant .mer-ai-launcher:hover {
    transform: translateY(-3px) scale(1.06);
    box-shadow: 0 14px 32px -4px rgba(37, 99, 235, 0.6), 0 6px 14px -2px rgba(15, 23, 42, 0.2), inset 0 1px 1px rgba(255, 255, 255, 0.4);
    animation: none;
}

#mer-product-assistant .mer-ai-launcher:active {
    transform: translateY(0) scale(0.96);
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.4);
}

#mer-product-assistant .mer-ai-launcher:focus-visible {
    outline: 3px solid #93c5fd;
    outline-offset: 4px;
}

/* Green Status Dot */
#mer-product-assistant .mer-ai-fab-dot {
    position: absolute;
    top: 3px;
    right: 3px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #10b981;
    border: 2.5px solid #ffffff;
    box-shadow: 0 0 6px rgba(16, 185, 129, 0.8);
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

/* SVG Icons Transition */
#mer-product-assistant .mer-ai-icon-open,
#mer-product-assistant .mer-ai-icon-close {
    position: absolute;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    transition: transform 0.28s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.2s ease;
}

#mer-product-assistant .mer-ai-icon-open {
    opacity: 1;
    transform: scale(1) rotate(0deg);
}

#mer-product-assistant .mer-ai-icon-close {
    opacity: 0;
    transform: scale(0.5) rotate(-90deg);
}

/* Expanded State of FAB (Close Button) */
#mer-product-assistant .mer-ai-launcher[aria-expanded="true"] {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%) !important;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.35) !important;
    animation: none;
}

#mer-product-assistant .mer-ai-launcher[aria-expanded="true"] .mer-ai-icon-open {
    opacity: 0;
    transform: scale(0.5) rotate(90deg);
}

#mer-product-assistant .mer-ai-launcher[aria-expanded="true"] .mer-ai-icon-close {
    opacity: 1;
    transform: scale(1) rotate(0deg);
}

#mer-product-assistant .mer-ai-launcher[aria-expanded="true"] .mer-ai-fab-dot {
    opacity: 0;
    transform: scale(0);
}

/* ==========================================================================
   Assistant Chat Panel (Compact & Clean)
   ========================================================================== */

#mer-ai-panel {
    position: absolute;
    bottom: 72px;
    right: 0;
    width: 390px;
    max-width: calc(100vw - 28px);
    height: calc(100vh - 145px);
    height: calc(100dvh - 145px);
    max-height: calc(100dvh - 145px);
    display: flex;
    flex-direction: column;
    background: #ffffff;
    border: 1px solid rgba(226, 232, 240, 0.95);
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 20px 50px -10px rgba(15, 23, 42, 0.22), 0 0 0 1px rgba(0, 0, 0, 0.04);
    animation: merAiPanelSlide 0.28s cubic-bezier(0.16, 1, 0.3, 1);
    transform-origin: bottom right;
}

@keyframes merAiPanelSlide {
    0% {
        opacity: 0;
        transform: translateY(14px) scale(0.96);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Panel Header */
#mer-ai-panel header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: #ffffff;
    border-bottom: 1px solid #f1f5f9;
    flex-shrink: 0;
}

#mer-ai-panel .mer-ai-header-brand {
    display: flex;
    align-items: center;
    gap: 10px;
}

#mer-ai-panel .mer-ai-avatar {
    width: 34px;
    height: 34px;
    border-radius: 9px;
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    color: #2563eb;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 2px 6px rgba(37, 99, 235, 0.12);
}

#mer-ai-panel header strong {
    font-size: 14.5px;
    font-weight: 700;
    color: #0f172a;
    display: block;
    line-height: 1.2;
}

#mer-ai-panel header small {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: #64748b;
    font-size: 11px;
    margin-top: 1px;
}

#mer-ai-panel .mer-ai-status-pulse,
#mer-ai-teaser .mer-ai-status-pulse {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #10b981;
    display: inline-block;
    box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.2);
}

#mer-product-assistant .mer-ai-close {
    width: 30px;
    height: 30px;
    border-radius: 7px;
    background: #f1f5f9;
    color: #64748b;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: background 0.18s ease, color 0.18s ease;
}

#mer-product-assistant .mer-ai-close:hover {
    background: #e2e8f0;
    color: #0f172a;
}

/* ==========================================================================
   Catalog & Journey Area ("Quale prodotto vuoi configurare?")
   ========================================================================== */

#mer-product-assistant .mer-ai-journey {
    padding: 12px 14px 10px;
    overflow-y: auto;
    flex: 0 1 auto;
    min-height: 0;
    max-height: 220px;
    border-bottom: 1px solid #f1f5f9;
    background: #ffffff;
}

#mer-product-assistant .mer-ai-journey strong {
    display: block;
    font-size: 13px;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 8px;
}

#mer-product-assistant .mer-ai-catalog {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 7px;
}

#mer-product-assistant .mer-ai-product {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 9px;
    background: #f8fafc;
    color: #0f172a;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    text-align: left;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
}

#mer-product-assistant .mer-ai-product:hover {
    background: #eff6ff;
    border-color: #2563eb;
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(37, 99, 235, 0.12);
}

#mer-product-assistant .mer-ai-product img {
    width: 32px;
    height: 32px;
    object-fit: contain;
    background: #ffffff;
    border-radius: 5px;
    border: 1px solid #e2e8f0;
    flex-shrink: 0;
}

/* ==========================================================================
   Chat Messages Area
   ========================================================================== */

#mer-product-assistant .mer-ai-messages {
    overflow-y: auto;
    overscroll-behavior: contain;
    min-height: 0;
    flex: 1 1 auto;
    padding: 12px 14px;
    background: #f8fafc;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

#mer-product-assistant .mer-ai-messages::-webkit-scrollbar {
    width: 5px;
}
#mer-product-assistant .mer-ai-messages::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

#mer-product-assistant .mer-ai-message {
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    padding: 10px 13px;
    border-radius: 13px 13px 13px 2px;
    border: 1px solid #e2e8f0;
    background: #ffffff;
    color: #1e293b;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    font-size: 13px;
    line-height: 1.45;
}

#mer-product-assistant .mer-ai-user {
    align-self: flex-end;
    background: #2563eb;
    color: #ffffff;
    border: none;
    border-radius: 13px 13px 2px 13px;
    margin-left: 32px;
    box-shadow: 0 3px 10px rgba(37, 99, 235, 0.22);
}

/* Proposals / Recommendations */
#mer-product-assistant .mer-ai-proposal {
    padding: 12px;
    border: 1px solid #bfdbfe;
    background: #eff6ff;
    border-radius: 12px;
    box-shadow: 0 2px 6px rgba(37, 99, 235, 0.06);
}

#mer-product-assistant .mer-ai-proposal strong {
    color: #1e40af;
    font-size: 12.5px;
    font-weight: 700;
}

#mer-product-assistant .mer-ai-proposal ul {
    padding-left: 18px;
    margin: 6px 0 10px;
    font-size: 12.5px;
    color: #1e3a8a;
}

#mer-product-assistant .mer-ai-proposal button {
    all: unset !important;
    box-sizing: border-box !important;
    display: block !important;
    width: 100% !important;
    text-align: center !important;
    text-transform: none !important;
    letter-spacing: normal !important;
    font-family: inherit !important;
    padding: 8px 12px !important;
    border-radius: 8px !important;
    background: linear-gradient(135deg, #1d4ed8 0%, #2563eb 100%) !important;
    color: #ffffff !important;
    font-size: 12.5px !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    box-shadow: 0 3px 10px rgba(37, 99, 235, 0.25) !important;
    transition: transform 0.15s ease, box-shadow 0.15s ease !important;
}

#mer-product-assistant .mer-ai-proposal button:hover:not(:disabled) {
    transform: translateY(-1px) !important;
    box-shadow: 0 5px 14px rgba(37, 99, 235, 0.35) !important;
}

#mer-product-assistant .mer-ai-proposal button:disabled {
    opacity: 0.55 !important;
    cursor: default !important;
    transform: none !important;
}

/* ==========================================================================
   WhatsApp Contact Action Card
   ========================================================================== */

#mer-product-assistant .mer-ai-whatsapp-card {
    margin: 8px 0 4px;
    padding: 12px 14px;
    background: linear-gradient(135deg, #f0fdf4 0%, #ecfdf5 100%);
    border: 1.5px solid #22c55e;
    border-radius: 14px;
    box-shadow: 0 4px 14px -2px rgba(34, 197, 94, 0.18), 0 1px 3px rgba(0, 0, 0, 0.04);
    display: flex;
    flex-direction: column;
    gap: 8px;
    box-sizing: border-box;
}

#mer-product-assistant .mer-ai-whatsapp-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #15803d;
    font-size: 13px;
    font-weight: 700;
}

#mer-product-assistant .mer-ai-whatsapp-badge svg {
    color: #22c55e;
    flex-shrink: 0;
}

#mer-product-assistant .mer-ai-whatsapp-text {
    font-size: 12.5px;
    color: #334155;
    line-height: 1.4;
}

#mer-product-assistant .mer-ai-whatsapp-btn {
    all: unset !important;
    box-sizing: border-box !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 8px !important;
    padding: 9px 13px !important;
    border-radius: 10px !important;
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%) !important;
    color: #ffffff !important;
    font-size: 12.5px !important;
    font-weight: 700 !important;
    font-family: inherit !important;
    cursor: pointer !important;
    text-align: left !important;
    box-shadow: 0 3px 10px rgba(22, 163, 74, 0.28) !important;
    transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease !important;
    text-decoration: none !important;
}

#mer-product-assistant .mer-ai-whatsapp-btn:hover {
    background: linear-gradient(135deg, #16a34a 0%, #15803d 100%) !important;
    transform: translateY(-1.5px) !important;
    box-shadow: 0 6px 16px rgba(22, 163, 74, 0.38) !important;
    color: #ffffff !important;
}

#mer-product-assistant .mer-ai-whatsapp-btn:active {
    transform: translateY(0) !important;
}

#mer-product-assistant .mer-ai-whatsapp-arrow {
    font-size: 14px;
    transition: transform 0.18s ease;
}

#mer-product-assistant .mer-ai-whatsapp-btn:hover .mer-ai-whatsapp-arrow {
    transform: translateX(3px);
}

/* Other Product Cross-Suggestions in Chat */
#mer-product-assistant .mer-ai-product-suggestions {
    padding: 11px 12px;
    border: 1px solid #bfdbfe;
    background: #eff6ff;
    border-radius: 12px;
    box-shadow: 0 2px 6px rgba(37, 99, 235, 0.06);
}

#mer-product-assistant .mer-ai-suggestions-title {
    display: block;
    color: #1e40af;
    font-size: 12.5px;
    font-weight: 700;
    margin-bottom: 8px;
}

#mer-product-assistant .mer-ai-suggestions-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

#mer-product-assistant .mer-ai-suggestion-btn {
    all: unset !important;
    box-sizing: border-box !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 10px !important;
    width: 100% !important;
    padding: 8px 11px !important;
    border-radius: 9px !important;
    border: 1.5px solid #2563eb !important;
    background: #ffffff !important;
    color: #1e3a8a !important;
    font-size: 12.5px !important;
    font-weight: 600 !important;
    font-family: inherit !important;
    text-transform: none !important;
    letter-spacing: normal !important;
    cursor: pointer !important;
    text-align: left !important;
    transition: all 0.18s ease !important;
}

#mer-product-assistant .mer-ai-suggestion-btn:hover {
    background: #2563eb !important;
    color: #ffffff !important;
    border-color: #1d4ed8 !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.22) !important;
}

#mer-product-assistant .mer-ai-suggestion-info {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

#mer-product-assistant .mer-ai-suggestion-info img {
    width: 26px;
    height: 26px;
    object-fit: contain;
    border-radius: 5px;
    border: 1px solid #cbd5e1;
    background: #ffffff;
    flex-shrink: 0;
}

#mer-product-assistant .mer-ai-suggestion-name {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

#mer-product-assistant .mer-ai-suggestion-action {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11.5px;
    font-weight: 700;
    color: inherit;
    flex-shrink: 0;
}

/* Loading & Status Text */
#mer-product-assistant .mer-ai-status {
    padding: 0 14px;
    font-size: 11.5px;
    color: #475569;
    flex-shrink: 0;
}

#mer-product-assistant .mer-ai-status:not(:empty) {
    padding-top: 6px;
    padding-bottom: 6px;
    background: #f1f5f9;
    border-top: 1px solid #e2e8f0;
}

/* Form Input Area (Compact) */
#mer-product-assistant .mer-ai-form {
    display: flex;
    flex-direction: column;
    padding: 8px 12px 6px;
    flex-shrink: 0;
    margin: 0;
    background: #ffffff;
    border-top: 1px solid #f1f5f9;
}

#mer-product-assistant .mer-ai-input-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #f8fafc;
    border: 1px solid #cbd5e1;
    border-radius: 12px;
    padding: 5px 8px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

#mer-product-assistant .mer-ai-input-wrap:focus-within {
    border-color: #3b82f6;
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

#mer-product-assistant textarea {
    flex: 1;
    min-height: 34px;
    height: 34px;
    max-height: 80px;
    resize: none;
    border: none !important;
    outline: none !important;
    padding: 6px 4px;
    font-family: inherit;
    font-size: 13px;
    line-height: 1.35;
    background: transparent !important;
    color: #0f172a;
    box-sizing: border-box;
}

#mer-product-assistant .mer-ai-send-btn {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: none;
    background: #2563eb;
    color: #ffffff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    padding: 0;
    box-shadow: 0 2px 6px rgba(37, 99, 235, 0.25);
    transition: background 0.15s ease, transform 0.15s ease;
}

#mer-product-assistant .mer-ai-send-btn:hover:not(:disabled) {
    background: #1d4ed8;
    transform: scale(1.05);
}

#mer-product-assistant .mer-ai-send-btn:disabled {
    opacity: 0.45;
    cursor: default;
    background: #94a3b8;
    box-shadow: none;
}

#mer-product-assistant .mer-ai-notice {
    margin: 0;
    padding: 4px 14px 8px;
    color: #94a3b8;
    font-size: 9.5px;
    line-height: 1.3;
    flex-shrink: 0;
    text-align: center;
}

/* ==========================================================================
   Page Field Highlighting (Guided Assistant Mode)
   Subtle exterior blue contour to indicate the active section clearly
   ========================================================================== */

.mer-field-highlighted {
    position: relative !important;
    outline: 2.5px solid #2563eb !important;
    outline-offset: 4px !important;
    border-color: #2563eb !important;
    border-radius: 8px !important;
    box-shadow: 0 0 0 5px rgba(37, 99, 235, 0.16) !important;
    transition: outline 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease !important;
    scroll-margin-top: 110px;
    scroll-margin-bottom: 110px;
}

.mer-field-highlighted::before {
    display: none !important;
    content: none !important;
}

/* ==========================================================================
   Typewriter Blinking Cursor
   ========================================================================== */

#mer-product-assistant .mer-ai-cursor {
    display: inline-block !important;
    width: 2px !important;
    height: 1.15em !important;
    vertical-align: -0.18em !important;
    background-color: #2563eb !important;
    margin-left: 2px !important;
    border-radius: 1px !important;
    animation: merAiCursorBlink 0.8s infinite !important;
}

@keyframes merAiCursorBlink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

/* ==========================================================================
   Initial Choice Cards (Product Landing) - Professional Modern UI
   ========================================================================== */

#mer-product-assistant .mer-ai-initial-choice {
    display: flex !important;
    flex-direction: column !important;
    gap: 9px !important;
    margin: 8px 0 4px !important;
    animation: merAiFadeIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

@keyframes merAiFadeIn {
    0% { opacity: 0; transform: translateY(6px); }
    100% { opacity: 1; transform: translateY(0); }
}

#mer-product-assistant button.mer-ai-choice-btn {
    all: unset !important;
    box-sizing: border-box !important;
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 12px !important;
    width: 100% !important;
    padding: 12px 14px !important;
    background: #ffffff !important;
    border: 1.5px solid #e2e8f0 !important;
    border-radius: 12px !important;
    cursor: pointer !important;
    text-align: left !important;
    text-transform: none !important;
    letter-spacing: normal !important;
    font-family: inherit !important;
    font-size: 13px !important;
    line-height: 1.4 !important;
    color: #0f172a !important;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04) !important;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1) !important;
    position: relative !important;
}

#mer-product-assistant button.mer-ai-choice-btn:hover {
    border-color: #2563eb !important;
    background: #f8fafc !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 6px 16px -2px rgba(37, 99, 235, 0.12), 0 2px 4px rgba(15, 23, 42, 0.04) !important;
}

#mer-product-assistant button.mer-ai-choice-btn:active {
    transform: translateY(0) !important;
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.06) !important;
}

#mer-product-assistant button.mer-ai-choice-btn:focus-visible {
    outline: 2.5px solid #93c5fd !important;
    outline-offset: 2px !important;
}

/* Guided Choice Card Variant */
#mer-product-assistant button.mer-ai-choice-guided {
    border-color: #bfdbfe !important;
    background: linear-gradient(180deg, #f0f7ff 0%, #ffffff 100%) !important;
}

#mer-product-assistant button.mer-ai-choice-guided:hover {
    border-color: #2563eb !important;
    background: linear-gradient(180deg, #e0effe 0%, #f8fafc 100%) !important;
    box-shadow: 0 6px 18px -2px rgba(37, 99, 235, 0.18), 0 2px 4px rgba(15, 23, 42, 0.04) !important;
}

#mer-product-assistant .mer-ai-choice-icon {
    width: 36px !important;
    height: 36px !important;
    border-radius: 10px !important;
    background: #eff6ff !important;
    color: #2563eb !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex-shrink: 0 !important;
    transition: transform 0.2s ease, background 0.2s ease, color 0.2s ease !important;
}

#mer-product-assistant button.mer-ai-choice-btn:hover .mer-ai-choice-icon {
    transform: scale(1.06) !important;
    background: #dbeafe !important;
    color: #1d4ed8 !important;
}

#mer-product-assistant .mer-ai-choice-icon svg {
    display: block !important;
    width: 18px !important;
    height: 18px !important;
}

#mer-product-assistant .mer-ai-choice-content {
    display: flex !important;
    flex-direction: column !important;
    gap: 2px !important;
    flex: 1 1 auto !important;
    min-width: 0 !important;
}

#mer-product-assistant .mer-ai-choice-content strong {
    font-size: 13px !important;
    font-weight: 650 !important;
    color: #0f172a !important;
    line-height: 1.3 !important;
    text-transform: none !important;
    letter-spacing: normal !important;
    display: block !important;
}

#mer-product-assistant .mer-ai-choice-content small {
    font-size: 11.5px !important;
    font-weight: 400 !important;
    color: #64748b !important;
    line-height: 1.35 !important;
    text-transform: none !important;
    letter-spacing: normal !important;
    display: block !important;
}

#mer-product-assistant .mer-ai-choice-arrow {
    color: #94a3b8 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex-shrink: 0 !important;
    transition: transform 0.2s ease, color 0.2s ease !important;
}

#mer-product-assistant button.mer-ai-choice-btn:hover .mer-ai-choice-arrow {
    color: #2563eb !important;
    transform: translateX(3px) !important;
}

/* ==========================================================================
   Step Navigation Actions
   ========================================================================== */

#mer-product-assistant .mer-ai-step-actions {
    display: flex !important;
    flex-direction: column !important;
    gap: 8px !important;
    margin-top: 8px !important;
    animation: merAiFadeIn 0.25s ease !important;
}

#mer-product-assistant .mer-ai-step-chips {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 6px !important;
    width: 100% !important;
}

#mer-product-assistant button.mer-ai-step-chip {
    all: unset !important;
    box-sizing: border-box !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px !important;
    padding: 7px 12px !important;
    background: #ffffff !important;
    border: 1.5px solid #cbd5e1 !important;
    border-radius: 8px !important;
    font-size: 12px !important;
    font-weight: 500 !important;
    color: #1e293b !important;
    cursor: pointer !important;
    line-height: 1.3 !important;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04) !important;
    transition: all 0.18s ease !important;
}

#mer-product-assistant button.mer-ai-step-chip:hover {
    border-color: #2563eb !important;
    background: #eff6ff !important;
    color: #1d4ed8 !important;
    transform: translateY(-1px) !important;
}

#mer-product-assistant button.mer-ai-step-chip.is-selected {
    border-color: #2563eb !important;
    background: #2563eb !important;
    color: #ffffff !important;
    font-weight: 600 !important;
    box-shadow: 0 2px 6px rgba(37, 99, 235, 0.25) !important;
}

#mer-product-assistant .mer-ai-step-chip .mer-ai-chip-check {
    font-weight: 700 !important;
    font-size: 11px !important;
}

#mer-product-assistant .mer-ai-step-bar {
    display: flex !important;
    align-items: center !important;
    justify-content: flex-end !important;
    gap: 8px !important;
    flex-wrap: wrap !important;
    width: 100% !important;
}

#mer-product-assistant button.mer-ai-step-skip,
#mer-product-assistant button.mer-ai-step-exit {
    all: unset !important;
    box-sizing: border-box !important;
    background: #ffffff !important;
    border: 1px solid #cbd5e1 !important;
    color: #475569 !important;
    font-size: 11.5px !important;
    font-weight: 600 !important;
    text-transform: none !important;
    letter-spacing: normal !important;
    padding: 5px 11px !important;
    border-radius: 7px !important;
    cursor: pointer !important;
    transition: all 0.15s ease !important;
}

#mer-product-assistant button.mer-ai-step-skip:hover {
    border-color: #2563eb !important;
    color: #2563eb !important;
    background: #eff6ff !important;
}

#mer-product-assistant button.mer-ai-step-exit:hover {
    border-color: #ef4444 !important;
    color: #dc2626 !important;
    background: #fef2f2 !important;
}

/* ==========================================================================
   Quick Trigger Button (Switch from Info to Guided Mode)
   ========================================================================== */

#mer-product-assistant .mer-ai-quick-trigger {
    margin: 6px 0 2px !important;
    animation: merAiFadeIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

#mer-product-assistant button.mer-ai-trigger-btn {
    all: unset !important;
    box-sizing: border-box !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    width: 100% !important;
    padding: 9px 12px !important;
    background: #eff6ff !important;
    border: 1px dashed #93c5fd !important;
    border-radius: 9px !important;
    cursor: pointer !important;
    font-size: 12px !important;
    color: #1e40af !important;
    text-transform: none !important;
    letter-spacing: normal !important;
    transition: all 0.18s ease !important;
}

#mer-product-assistant button.mer-ai-trigger-btn:hover {
    background: #dbeafe !important;
    border-color: #2563eb !important;
    border-style: solid !important;
    color: #1d4ed8 !important;
}

/* Mobile Responsive */
@media (max-width: 480px) {
    #mer-product-assistant {
        right: 14px;
        bottom: 14px;
    }

    #mer-product-assistant .mer-ai-launcher {
        width: 52px;
        height: 52px;
    }

    #mer-product-assistant .mer-ai-fab-label {
        padding: 7px 12px;
        font-size: 12px;
    }

    #mer-ai-teaser {
        bottom: 64px;
        right: 0;
        width: calc(100vw - 28px);
    }

    #mer-ai-panel {
        bottom: 64px;
        right: 0;
        width: calc(100vw - 28px);
        max-width: 100vw;
        height: calc(100vh - 120px);
        height: calc(100dvh - 120px);
        max-height: calc(100dvh - 120px);
    }

    #mer-product-assistant .mer-ai-messages {
        flex: 1 1 auto;
        min-height: 0;
    }

    #mer-product-assistant .mer-ai-catalog {
        grid-template-columns: 1fr;
    }
}
