/**
 * Floating Chat Buttons - WhatsApp + Chat iFood (MIAW)
 * Blog Parceiros iFood
 *
 * @package Blog_Parceiros
 * @since 2.1.9
 */

/* ==========================================================================
   Container Principal
   ========================================================================== */

.ifp-floating-chat {
    position: fixed;
    bottom: 51px !important;
    left: 20px !important; /* WhatsApp fica à esquerda, Salesforce fica à direita */
    z-index: 99;
    display: flex;
    flex-direction: column;
    gap: 12px;
    pointer-events: none;
}

.ifp-floating-chat > * {
    pointer-events: auto;
}

/* ==========================================================================
   Botão Base
   ========================================================================== */

.ifp-floating-chat__btn {
    width: 60px;
    height: 60px;
    border-radius: 50% !important;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border: none;
    outline: none;
    -webkit-tap-highlight-color: transparent;
}

.ifp-floating-chat__btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

.ifp-floating-chat__btn:focus {
    outline: 2px solid #fff;
    outline-offset: 2px;
}

.ifp-floating-chat__btn:active {
    transform: scale(0.95);
}

/* ==========================================================================
   Botão WhatsApp
   ========================================================================== */

.ifp-floating-chat__btn--whatsapp {
    background-color: #25D366;
}

.ifp-floating-chat__btn--whatsapp:hover {
    background-color: #22c55e;
}

/* ==========================================================================
   Ícones SVG
   ========================================================================== */

.ifp-floating-chat__icon {
    width: 32px;
    height: 32px;
    fill: #ffffff;
    flex-shrink: 0;
}

/* ==========================================================================
   Wrapper para posicionamento do tooltip
   ========================================================================== */

.ifp-floating-chat__wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

/* ==========================================================================
   Notification Dot (bolinha vermelha)
   ========================================================================== */

.ifp-floating-chat__notification-dot {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 14px;
    height: 14px;
    background-color: #EA1D2C;
    border-radius: 50%;
    border: 2px solid #25D366;
    pointer-events: none;
}

/* ==========================================================================
   Tooltip - Estilo card com mensagem
   ========================================================================== */

.ifp-floating-chat__tooltip {
    position: absolute;
    left: calc(100% + 12px);
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px 16px;
    background-color: #f5f5f5;
    color: #333;
    border-radius: 24px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease;
    pointer-events: none;
    white-space: nowrap;
    z-index: 1;
}

.ifp-floating-chat__tooltip-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    line-height: 1.3;
}

.ifp-floating-chat__tooltip-text strong {
    font-size: 14px;
    font-weight: 700;
    color: #1a1a1a;
    letter-spacing: 0.02em;
}

.ifp-floating-chat__tooltip-text span {
    font-size: 14px;
    font-weight: 500;
    color: #1a1a1a;
    letter-spacing: 0.02em;
}

.ifp-floating-chat__tooltip-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    background: transparent;
    border: none;
    cursor: pointer;
    color: #999;
    padding: 0;
    flex-shrink: 0;
    transition: color 0.2s ease;
}

.ifp-floating-chat__tooltip-close:hover {
    color: #666;
}

/* Mostrar tooltip no hover */
.ifp-floating-chat__wrapper:hover .ifp-floating-chat__tooltip,
.ifp-floating-chat__tooltip--visible {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

/* Esconder tooltip quando fechado pelo usuario */
.ifp-floating-chat__tooltip--dismissed {
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
}

/* ==========================================================================
   Responsivo
   ========================================================================== */

@media (max-width: 768px) {
    .ifp-floating-chat {
        bottom: 51px !important;
        left: 16px !important;
        gap: 10px !important;
    }

    .ifp-floating-chat__btn {
        width: 52px;
        height: 52px;
    }

    .ifp-floating-chat__icon {
        width: 28px;
        height: 28px;
    }

    /* Esconder tooltip em tablet */
    .ifp-floating-chat__tooltip {
        display: none;
    }

    .ifp-floating-chat__notification-dot {
        width: 12px;
        height: 12px;
    }
}

@media (max-width: 480px) {
    .ifp-floating-chat {
        bottom: 51px;
        left: 12px;
    }

    .ifp-floating-chat__btn {
        width: 48px;
        height: 48px;
    }

    .ifp-floating-chat__icon {
        width: 26px;
        height: 26px;
    }
}

/* ==========================================================================
   Animação de entrada
   ========================================================================== */

@keyframes ifp-floating-chat-fade-in {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.ifp-floating-chat {
    animation: ifp-floating-chat-fade-in 0.3s ease forwards;
}

/* ==========================================================================
   Estado: Oculto (para páginas excluídas)
   ========================================================================== */

.ifp-floating-chat--hidden {
    display: none !important;
}

/* ==========================================================================
   Acessibilidade - Reduzir movimento
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
    .ifp-floating-chat,
    .ifp-floating-chat__btn {
        animation: none;
        transition: none;
    }

    .ifp-floating-chat__btn:hover {
        transform: none;
    }
}

/* ==========================================================================
   Salesforce Embedded Service - Live Agent
   ========================================================================== */

.embeddedServiceHelpButton .helpButton .uiButton {
    background-color: #995299;
    border-radius: 23px !important; /* Bordas arredondadas como no mobile */
}

.embeddedServiceHelpButton .helpButton .uiButton:focus {
    outline: 1px solid #995299;
}

/* Posicionamento do botão Salesforce - CRÍTICO: width/height auto para não bloquear cliques */
.embeddedServiceHelpButton {
    position: fixed !important;
    bottom: 51px !important;
    right: 20px !important;
    left: auto !important;
    top: auto !important;
    width: auto !important;
    height: auto !important;
    z-index: 99 !important;
    pointer-events: none !important; /* Container não bloqueia cliques */
}

/* Apenas o botão interno deve receber cliques */
.embeddedServiceHelpButton .helpButton {
    bottom: 51px !important;
    right: 12px !important;
    pointer-events: auto !important;
}

/* Responsivo - Salesforce */
@media (max-width: 768px) {
    .embeddedServiceHelpButton {
        bottom: 51px !important;
        right: 16px !important;
    }
}

@media (max-width: 480px) {
    .embeddedServiceHelpButton {
        bottom: 51px !important;
        right: 12px !important;
    }
}

/* Mobile - Salesforce usa seletor mais específico (embeddedServiceBottomTabBar) */
.embeddedServiceHelpButton.embeddedServiceBottomTabBar {
    bottom: 51px !important;
    right: 20px !important;
    left: auto !important;
    top: auto !important;
    width: auto !important;
    height: auto !important;
    z-index: 99 !important;
    pointer-events: none !important;
}

.embeddedServiceHelpButton.embeddedServiceBottomTabBar .helpButton {
    bottom: 51px !important;
    right: 12px !important;
    pointer-events: auto !important;
}

@media (max-width: 768px) {
    .embeddedServiceHelpButton.embeddedServiceBottomTabBar {
        right: 16px !important;
    }
}

@media (max-width: 480px) {
    .embeddedServiceHelpButton.embeddedServiceBottomTabBar {
        right: 12px !important;
    }
}

/**
@font-face {
    font-family: 'Salesforce Sans';
    src: url('https://c1.sfdcstatic.com/etc/clientlibs/sfdc-aem-master/clientlibs_base/fonts/SalesforceSans-Regular.woff') format('woff'),
         url('https://c1.sfdcstatic.com/etc/clientlibs/sfdc-aem-master/clientlibs_base/fonts/SalesforceSans-Regular.ttf') format('truetype');
    font-display: swap;
}**/
