/* ========================================
 * FULL Floating - Frontend CSS v2.0.4
 * Polished edition: design tokens, multi-layer shadows,
 * gradients, Inter typography, refined hover states
 * ======================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

/* ========================================
 * Design tokens
 * ======================================== */
.ff-container, .ff-static {
    --ff-primary: #25D366;
    --ff-text: #FFFFFF;

    --ff-shadow-sm: 0 1px 2px rgba(15, 23, 42, .06),
                    0 1px 3px rgba(15, 23, 42, .08);
    --ff-shadow-md: 0 1px 2px rgba(15, 23, 42, .06),
                    0 4px 12px rgba(15, 23, 42, .08),
                    0 8px 24px rgba(15, 23, 42, .06);
    --ff-shadow-lg: 0 1px 2px rgba(15, 23, 42, .06),
                    0 8px 24px rgba(15, 23, 42, .12),
                    0 16px 48px rgba(15, 23, 42, .08);
    --ff-shadow-xl: 0 2px 4px rgba(15, 23, 42, .08),
                    0 12px 32px rgba(15, 23, 42, .14),
                    0 24px 64px rgba(15, 23, 42, .12);

    --ff-ease: cubic-bezier(.4, 0, .2, 1);
    --ff-ease-out: cubic-bezier(.16, 1, .3, 1);

    --ff-font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, system-ui, sans-serif;
}

/* ========================================
 * Container e posicionamento base
 * ======================================== */
.ff-container { pointer-events: none; }
.ff-container > * { pointer-events: auto; }

.ff-pos-bottom-right { position: fixed; bottom: 24px; right: 24px; z-index: 99998; }
.ff-pos-bottom-left  { position: fixed; bottom: 24px; left: 24px;  z-index: 99998; }
.ff-pos-top-right    { position: fixed; top: 24px;    right: 24px; z-index: 99998; }
.ff-pos-top-left     { position: fixed; top: 24px;    left: 24px;  z-index: 99998; }
.ff-pos-top-bar      { position: fixed; top: 0;       left: 0;     z-index: 99999; width: 100%; }
.ff-pos-bottom       { position: fixed; bottom: 0;    left: 0;     z-index: 99998; width: 100%; }

.ff-static, .ff-static.ff-pos-bottom-right, .ff-static.ff-pos-bottom-left,
.ff-static.ff-pos-top-right, .ff-static.ff-pos-top-left,
.ff-static.ff-pos-top-bar, .ff-static.ff-pos-bottom {
    position: relative !important;
    top: auto !important; right: auto !important;
    bottom: auto !important; left: auto !important;
    transform: none !important;
    display: inline-block !important;
    margin: 0 !important;
    width: auto !important;
}

.ff-icon-check {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 14px; height: 14px;
    vertical-align: -2px;
    margin-right: 4px;
}
.ff-icon-check svg {
    width: 14px !important; height: 14px !important;
    max-width: 14px !important; max-height: 14px !important;
}

/* Proteção universal: SVGs dentro do plugin nunca devem ser sobrescritos pelo tema */
.ff-container svg, .ff-static svg {
    max-width: 100%;
    max-height: 100%;
}

.ff-container button:focus-visible,
.ff-container a:focus-visible,
.ff-container [role="button"]:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, .35),
                0 1px 2px rgba(15, 23, 42, .06),
                0 8px 24px rgba(15, 23, 42, .12);
}

/* ========================================
 * TIPO: WhatsApp (6 templates)
 * ======================================== */
.ff-wa { font-family: var(--ff-font); }

.ff-wa-chat-button {
    width: 60px; height: 60px;
    border-radius: 50%;
    background: var(--ff-primary, #25D366);
    background-image: linear-gradient(135deg,
        color-mix(in srgb, var(--ff-primary, #25D366) 100%, white 8%),
        var(--ff-primary, #25D366));
    color: var(--ff-text, #FFFFFF);
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; border: none;
    box-shadow: var(--ff-shadow-lg),
                inset 0 1px 0 rgba(255, 255, 255, .2);
    transition: transform .25s var(--ff-ease-out),
                box-shadow .25s var(--ff-ease-out);
    text-decoration: none; position: relative;
}
.ff-wa-chat-button:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: var(--ff-shadow-xl),
                inset 0 1px 0 rgba(255, 255, 255, .25);
}
.ff-wa-chat-button:active {
    transform: translateY(0) scale(.98);
    transition-duration: .1s;
}
.ff-wa-chat-button svg {
    width: 30px !important; height: 30px !important;
    max-width: 30px !important; max-height: 30px !important;
    fill: currentColor !important;
}

/* Bubble */
.ff-wa-bubble { display: flex; flex-direction: column; align-items: flex-end; gap: 10px; }
.ff-wa-bubble.ff-pos-bottom-left { align-items: flex-start; }
.ff-wa-message-bubble {
    background: #fff; color: #1f2937;
    padding: 12px 38px 12px 16px;
    border-radius: 14px;
    box-shadow: var(--ff-shadow-md);
    font-size: 14px; line-height: 1.45;
    font-weight: 500;
    position: relative; cursor: pointer;
    border: 1px solid rgba(15, 23, 42, .04);
    transition: transform .2s var(--ff-ease-out), box-shadow .2s var(--ff-ease-out);
}
.ff-wa-message-bubble:hover {
    transform: translateY(-1px);
    box-shadow: var(--ff-shadow-lg);
}
.ff-wa-message-bubble-close {
    position: absolute; top: 4px; right: 6px;
    background: none; border: none; cursor: pointer;
    color: #94a3b8; font-size: 16px; line-height: 1;
    padding: 4px 6px; border-radius: 6px;
    transition: background .15s var(--ff-ease), color .15s var(--ff-ease);
}
.ff-wa-message-bubble-close:hover { background: #f1f5f9; color: #475569; }

/* Multi Chat */
.ff-wa-multi { display: flex; flex-direction: column; align-items: flex-end; gap: 12px; }
.ff-wa-multi.ff-pos-bottom-left { align-items: flex-start; }
.ff-wa-panel {
    width: 320px;
    background: rgba(255, 255, 255, .96);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-radius: 16px;
    box-shadow: var(--ff-shadow-xl);
    overflow: hidden;
    border: 1px solid rgba(15, 23, 42, .06);
    display: none;
    animation: ff-panel-in .3s var(--ff-ease-out);
}
.ff-wa-panel.ff-open { display: block; }

@keyframes ff-panel-in {
    from { opacity: 0; transform: translateY(8px) scale(.98); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

.ff-wa-top-bar {
    background: var(--ff-primary, #25D366);
    background-image: linear-gradient(135deg,
        color-mix(in srgb, var(--ff-primary, #25D366) 100%, white 5%),
        var(--ff-primary, #25D366));
    color: var(--ff-text, #FFFFFF);
    padding: 16px 18px;
    font-weight: 600; font-size: 15px;
    letter-spacing: -.01em;
    box-shadow: 0 1px 0 rgba(0, 0, 0, .04);
}

.ff-wa-contact-section {
    max-height: 320px;
    overflow-y: auto;
    background: #fff;
}
.ff-wa-contact-section::-webkit-scrollbar { width: 6px; }
.ff-wa-contact-section::-webkit-scrollbar-track { background: transparent; }
.ff-wa-contact-section::-webkit-scrollbar-thumb {
    background: rgba(15, 23, 42, .15);
    border-radius: 3px;
}
.ff-wa-contact-section::-webkit-scrollbar-thumb:hover { background: rgba(15, 23, 42, .25); }

.ff-wa-contact {
    display: flex; align-items: center; gap: 12px;
    padding: 12px 18px;
    color: #1f2937; text-decoration: none;
    border-bottom: 1px solid #f1f5f9;
    transition: background .15s var(--ff-ease);
    cursor: pointer;
}
.ff-wa-contact:last-child { border-bottom: none; }
.ff-wa-contact:hover { background: #f8fafc; }

.ff-wa-contact-avatar {
    width: 40px; height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--ff-primary, #25D366), color-mix(in srgb, var(--ff-primary, #25D366) 80%, black 20%));
    color: var(--ff-text, #FFFFFF);
    display: flex; align-items: center; justify-content: center;
    font-weight: 600; font-size: 16px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, .12);
    flex-shrink: 0;
}
.ff-wa-contact-name {
    font-weight: 600; font-size: 14px;
    letter-spacing: -.005em; line-height: 1.2;
}
.ff-wa-contact-role {
    font-size: 12px; color: #64748b;
    margin-top: 2px; line-height: 1.2;
}

/* Sticky Chat Bar */
.ff-wa-sticky-bar {
    background: var(--ff-primary, #25D366);
    background-image: linear-gradient(135deg,
        color-mix(in srgb, var(--ff-primary, #25D366) 100%, white 6%),
        var(--ff-primary, #25D366));
    color: var(--ff-text, #FFFFFF);
    text-align: center;
    padding: 14px 16px;
    text-decoration: none;
    font-weight: 600; font-size: 15px;
    letter-spacing: -.01em;
    box-shadow: 0 -4px 12px rgba(15, 23, 42, .1),
                0 -1px 0 rgba(15, 23, 42, .04);
    display: flex; align-items: center; justify-content: center; gap: 10px;
    transition: filter .2s var(--ff-ease);
}
.ff-wa-sticky-bar:hover { filter: brightness(1.05); }
.ff-wa-sticky-bar svg {
    width: 20px !important; height: 20px !important;
    max-width: 20px !important; max-height: 20px !important;
    fill: currentColor !important;
}

/* Click to Call */
.ff-wa-call-button {
    background: var(--ff-primary, #25D366);
    background-image: linear-gradient(135deg,
        color-mix(in srgb, var(--ff-primary, #25D366) 100%, white 8%),
        var(--ff-primary, #25D366));
    color: var(--ff-text, #FFFFFF);
    padding: 14px 22px;
    border-radius: 999px;
    text-decoration: none;
    display: inline-flex; align-items: center; gap: 12px;
    font-weight: 600;
    box-shadow: var(--ff-shadow-lg),
                inset 0 1px 0 rgba(255, 255, 255, .2);
    transition: transform .25s var(--ff-ease-out),
                box-shadow .25s var(--ff-ease-out);
    letter-spacing: -.005em;
}
.ff-wa-call-button:hover {
    transform: translateY(-2px);
    box-shadow: var(--ff-shadow-xl),
                inset 0 1px 0 rgba(255, 255, 255, .25);
}
.ff-wa-call-button:active { transform: translateY(0); }
.ff-wa-call-icon {
    width: 36px; height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .2);
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.ff-wa-call-icon svg {
    width: 18px !important; height: 18px !important;
    max-width: 18px !important; max-height: 18px !important;
    fill: currentColor !important;
}
.ff-wa-call-info { line-height: 1.15; }
.ff-wa-call-number { font-size: 16px; font-weight: 700; letter-spacing: -.01em; }
.ff-wa-call-label { font-size: 11px; opacity: .9; font-weight: 500; }

/* Product Showcase */
.ff-wa-product {
    background: #fff;
    border-radius: 16px;
    box-shadow: var(--ff-shadow-xl);
    width: 280px;
    overflow: hidden;
    border: 1px solid rgba(15, 23, 42, .06);
    transition: transform .25s var(--ff-ease-out),
                box-shadow .25s var(--ff-ease-out);
}
.ff-wa-product:hover {
    transform: translateY(-2px);
    box-shadow: var(--ff-shadow-xl),
                0 24px 64px rgba(15, 23, 42, .15);
}
.ff-wa-product-image {
    width: 100%; height: 140px;
    background: #f8fafc;
    display: flex; align-items: center; justify-content: center;
    color: #cbd5e1;
}
.ff-wa-product-image img { width: 100%; height: 100%; object-fit: cover; }
.ff-wa-product-image svg {
    width: 48px !important; height: 48px !important;
    max-width: 48px !important; max-height: 48px !important;
}
.ff-wa-product-body { padding: 16px; }
.ff-wa-product-name {
    font-weight: 600; font-size: 15px;
    color: #1f2937; margin-bottom: 4px;
    letter-spacing: -.01em; line-height: 1.3;
}
.ff-wa-product-price {
    color: var(--ff-primary, #25D366);
    font-weight: 700; font-size: 18px;
    margin-bottom: 12px;
    letter-spacing: -.01em;
}
.ff-wa-product-cta {
    display: block; width: 100%;
    background: var(--ff-primary, #25D366);
    background-image: linear-gradient(135deg,
        color-mix(in srgb, var(--ff-primary, #25D366) 100%, white 6%),
        var(--ff-primary, #25D366));
    color: var(--ff-text, #FFFFFF);
    text-align: center;
    padding: 11px 14px;
    border-radius: 10px;
    text-decoration: none;
    font-weight: 600; font-size: 14px;
    letter-spacing: -.005em;
    box-shadow: 0 1px 2px rgba(15, 23, 42, .08),
                inset 0 1px 0 rgba(255, 255, 255, .2);
    transition: transform .15s var(--ff-ease), filter .15s var(--ff-ease);
}
.ff-wa-product-cta:hover { filter: brightness(1.05); transform: translateY(-1px); }
.ff-wa-product-cta:active { transform: translateY(0); }

/* ========================================
 * TIPO: Social Proof (6 templates)
 * ======================================== */
.ff-sp { font-family: var(--ff-font); }
.ff-sp [hidden] { display: none !important; }

/* Classic */
.ff-sp-classic .ff-sp-card {
    background: #1f2937;
    background-image: linear-gradient(135deg, #1f2937, #111827);
    color: #fff;
    border-radius: 14px;
    padding: 12px 16px;
    display: flex; align-items: center; gap: 12px;
    box-shadow: var(--ff-shadow-lg);
    min-width: 280px; max-width: 360px;
    border: 1px solid rgba(255, 255, 255, .06);
    animation: ff-sp-slide-in .4s var(--ff-ease-out);
}
@keyframes ff-sp-slide-in {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}

.ff-sp-avatar {
    width: 40px; height: 40px;
    border-radius: 50%;
    flex-shrink: 0;
    box-shadow: 0 2px 6px rgba(0, 0, 0, .2);
}
.ff-sp-avatar-initial {
    background: linear-gradient(135deg, #10b981, #059669);
    color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-weight: 600; font-size: 15px;
}
.ff-sp-info { flex: 1; min-width: 0; line-height: 1.3; }
.ff-sp-title { font-weight: 600; font-size: 14px; letter-spacing: -.005em; }
.ff-sp-sub { font-size: 12px; opacity: .85; margin-top: 2px; }
.ff-sp-meta { font-size: 11px; opacity: .65; margin-top: 4px; font-weight: 500; }

/* Compact */
.ff-sp-compact .ff-sp-compact-bar {
    background: #fff;
    color: #1f2937;
    border-radius: 999px;
    padding: 9px 16px;
    font-size: 13px; font-weight: 500;
    box-shadow: var(--ff-shadow-md);
    display: inline-flex; align-items: center; gap: 6px;
    border: 1px solid rgba(15, 23, 42, .06);
    letter-spacing: -.005em;
    animation: ff-sp-slide-in .4s var(--ff-ease-out);
}
.ff-sp-compact .ff-icon-check { color: #10b981; }
.ff-sp-muted { color: #94a3b8; font-weight: 500; }

/* Toast */
.ff-sp-toast .ff-sp-toast-body {
    background: #fff;
    color: #1f2937;
    border-radius: 12px;
    padding: 14px 16px;
    display: flex; align-items: center; gap: 14px;
    box-shadow: var(--ff-shadow-lg);
    min-width: 280px; max-width: 360px;
    border: 1px solid rgba(15, 23, 42, .06);
    animation: ff-sp-slide-in .4s var(--ff-ease-out);
}
.ff-sp-toast-icon {
    width: 40px; height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #10b981, #059669);
    color: #fff;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 2px 6px rgba(16, 185, 129, .3);
}
.ff-sp-toast-icon svg {
    width: 20px !important; height: 20px !important;
    max-width: 20px !important; max-height: 20px !important;
}
.ff-sp-toast-content { flex: 1; min-width: 0; line-height: 1.3; }
.ff-sp-toast-title { font-weight: 600; font-size: 14px; letter-spacing: -.005em; }
.ff-sp-toast-sub { font-size: 12px; color: #64748b; margin-top: 2px; }
.ff-sp-toast-meta { font-size: 11px; color: #94a3b8; margin-top: 4px; font-weight: 500; }

/* Pill */
.ff-sp-pill .ff-sp-pill-bar {
    background: #1f2937;
    background-image: linear-gradient(135deg, #1f2937, #111827);
    color: #fff;
    border-radius: 999px;
    padding: 10px 18px;
    font-size: 13px; font-weight: 500;
    box-shadow: var(--ff-shadow-lg);
    display: inline-flex; align-items: center; gap: 8px;
    border: 1px solid rgba(255, 255, 255, .08);
    letter-spacing: -.005em;
}
.ff-sp-pill-icon { color: #fbbf24; font-size: 14px; }

/* Bar Top */
.ff-sp-bar-top .ff-sp-bar-top-content {
    background: #facc15;
    background-image: linear-gradient(90deg, #fbbf24, #facc15, #fbbf24);
    color: #422006;
    text-align: center;
    padding: 11px 16px;
    font-size: 14px; font-weight: 600;
    letter-spacing: -.005em;
    box-shadow: 0 2px 8px rgba(15, 23, 42, .12);
}
.ff-sp-bar-top .ff-icon-check { color: #422006; }
body.ff-has-bar-top { padding-top: 44px; }

/* Side Drawer */
.ff-sp-drawer { position: relative; }
.ff-sp-drawer-toggle {
    width: 56px; height: 56px;
    border-radius: 50%;
    background: var(--ff-primary, #10b981);
    background-image: linear-gradient(135deg,
        color-mix(in srgb, var(--ff-primary, #10b981) 100%, white 8%),
        var(--ff-primary, #10b981));
    color: var(--ff-text, #FFFFFF);
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; border: none;
    box-shadow: var(--ff-shadow-lg),
                inset 0 1px 0 rgba(255, 255, 255, .2);
    position: relative;
    animation: ff-pulse 2.4s var(--ff-ease) infinite;
    transition: transform .25s var(--ff-ease-out);
}
.ff-sp-drawer-toggle:hover { transform: translateY(-2px) scale(1.05); }
.ff-sp-drawer-toggle svg {
    width: 24px !important; height: 24px !important;
    max-width: 24px !important; max-height: 24px !important;
    fill: currentColor !important;
}
.ff-sp-drawer-badge {
    position: absolute; top: -4px; right: -4px;
    background: #ef4444;
    background-image: linear-gradient(135deg, #f87171, #ef4444);
    color: #fff;
    border-radius: 999px;
    padding: 3px 7px;
    font-size: 11px; font-weight: 700;
    box-shadow: 0 2px 6px rgba(239, 68, 68, .4),
                0 0 0 2px #fff;
}

@keyframes ff-pulse {
    0%, 100% { box-shadow: var(--ff-shadow-lg), inset 0 1px 0 rgba(255, 255, 255, .2),
                           0 0 0 0 rgba(16, 185, 129, .4); }
    50%      { box-shadow: var(--ff-shadow-lg), inset 0 1px 0 rgba(255, 255, 255, .2),
                           0 0 0 12px rgba(16, 185, 129, 0); }
}

.ff-sp-drawer-panel {
    position: absolute;
    bottom: 70px;
    right: 0;
    width: 320px;
    background: rgba(255, 255, 255, .96);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-radius: 16px;
    box-shadow: var(--ff-shadow-xl);
    overflow: hidden;
    display: none;
    border: 1px solid rgba(15, 23, 42, .06);
    animation: ff-panel-in .3s var(--ff-ease-out);
}
.ff-pos-bottom-left .ff-sp-drawer-panel { right: auto; left: 0; }
.ff-sp-drawer.ff-open .ff-sp-drawer-panel { display: block; }

.ff-sp-drawer-header {
    background: linear-gradient(135deg, #1f2937, #111827);
    color: #fff;
    padding: 16px 18px;
    font-weight: 600; font-size: 15px;
    letter-spacing: -.01em;
}
.ff-sp-drawer-list {
    max-height: 340px;
    overflow-y: auto;
}
.ff-sp-drawer-list::-webkit-scrollbar { width: 6px; }
.ff-sp-drawer-list::-webkit-scrollbar-track { background: transparent; }
.ff-sp-drawer-list::-webkit-scrollbar-thumb {
    background: rgba(15, 23, 42, .15);
    border-radius: 3px;
}
.ff-sp-drawer-list::-webkit-scrollbar-thumb:hover { background: rgba(15, 23, 42, .25); }

.ff-sp-drawer-item {
    display: flex; align-items: center; gap: 12px;
    padding: 12px 18px;
    border-bottom: 1px solid #f1f5f9;
    transition: background .15s var(--ff-ease);
}
.ff-sp-drawer-item:last-child { border-bottom: none; }
.ff-sp-drawer-item:hover { background: #f8fafc; }

.ff-sp-drawer-avatar {
    width: 36px; height: 36px;
    border-radius: 50%;
    flex-shrink: 0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .1);
}
.ff-sp-drawer-avatar-initial {
    background: linear-gradient(135deg, #10b981, #059669);
    color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-weight: 600; font-size: 14px;
}
.ff-sp-drawer-item-info { flex: 1; min-width: 0; line-height: 1.3; }
.ff-sp-drawer-item-title { font-weight: 600; font-size: 13px; color: #1f2937; letter-spacing: -.005em; }
.ff-sp-drawer-item-sub { font-size: 12px; color: #64748b; margin-top: 1px; }
.ff-sp-drawer-item-meta { font-size: 11px; color: #94a3b8; margin-top: 3px; font-weight: 500; }

/* ========================================
 * Responsive
 * ======================================== */
@media (max-width: 480px) {
    .ff-pos-bottom-right, .ff-pos-bottom-left { bottom: 16px; }
    .ff-pos-bottom-right { right: 16px; }
    .ff-pos-bottom-left { left: 16px; }
    .ff-wa-panel, .ff-wa-product, .ff-sp-drawer-panel { width: calc(100vw - 32px); max-width: 320px; }
    .ff-sp-classic .ff-sp-card,
    .ff-sp-toast .ff-sp-toast-body { min-width: auto; max-width: calc(100vw - 32px); }
}

@media (prefers-reduced-motion: reduce) {
    .ff-wa-chat-button, .ff-wa-call-button, .ff-wa-product, .ff-wa-message-bubble,
    .ff-sp-drawer-toggle, .ff-sp-classic .ff-sp-card, .ff-sp-toast .ff-sp-toast-body,
    .ff-sp-compact .ff-sp-compact-bar {
        animation: none !important;
        transition: none !important;
    }
}
