/* =========================================================
   LOQ WHATSAPP PRO — Base Widget Structure
   ========================================================= */

:root {
    --lwa-green: #25d366;
    --lwa-ios-bg: rgba(255, 255, 255, 0.8);
    --lwa-ios-glass: saturate(180%) blur(20px);
    --lwa-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
    --lwa-dark: #0f172a;
}

.loq-wa-pro-widget {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 100000;
    font-family: 'Inter', -apple-system, sans-serif;
    -webkit-font-smoothing: antialiased;
}

/* Main Trigger Button */
.loq-wa-pro-btn {
    all: unset;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    z-index: 20;

    /* Defaults that skins should override if needed */
    background: var(--lwa-green);
    color: #fff;
    box-shadow: 0 15px 45px rgba(0, 0, 0, 0.22), 0 8px 16px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(0, 0, 0, 0.1);
}
.loq-wa-pro-btn.has-avatar {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.12), 0 4px 12px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.4);
}

.loq-wa-pro-btn:hover {
    transform: scale(1.1) translateY(-5px);
}

.loq-wa-pro-custom-icon,
.loq-wa-pro-bubble-avatar {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    box-sizing: border-box;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.loq-wa-pro-notif {
    position: absolute;
    top: -2px;
    right: -2px;
    background: #ff3b30;
    color: #fff;
    font-size: 11px;
    font-weight: 800;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #fff;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
}
.loq-wa-pro-status-dot {
    position: absolute;
    bottom: 2px;
    right: 2px;
    width: 12px;
    height: 12px;
    background: #34c759;
    border: 1.5px solid #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    border-radius: 50%;
    z-index: 22;
}

/* ---------------------------------------------------------
   CTA BUBBLE (The floating message)
   --------------------------------------------------------- */
/* ---------------------------------------------------------
   CTA BUBBLE (Elite Pill Design)
   --------------------------------------------------------- */
.loq-wa-pro-cta-bubble {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 320px; /* Fixed width to ensure button alignment */
    height: 64px; /* Same as button */
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.12);
    border-radius: 40px;
    padding: 0 45px 0 85px; /* Aumentamos el padding izquierdo para separar del botón */
    display: flex;
    align-items: center;
    z-index: 15;
    box-sizing: border-box;
    cursor: pointer;
    color: #0f172a; /* Fallback dark color */

    /* Animation base */
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateX(30px);
    transition: all 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.loq-wa-pro-cta-bubble.is-visible {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateX(0);
}

/* Horizontal Shift: The button moves to the left side of the pill */
.loq-wa-pro-widget.has-cta .loq-wa-pro-btn {
    transform: translateX(-256px); /* 320 - 64 = 256 */
    z-index: 30;
}

.loq-wa-pro-cta-content {
    width: 100%;
}

.loq-wa-pro-cta-content p {
    margin: 0;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.3;
    color: inherit; /* Use container color */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    white-space: normal;
}

.loq-wa-pro-cta-close {
    position: absolute;
    top: 50%;
    right: 15px;
    transform: translateY(-50%);
    background: transparent;
    border: 0;
    color: inherit;
    font-size: 18px;
    cursor: pointer;
    opacity: 0.3;
    line-height: 1;
    padding: 4px;
}

.loq-wa-pro-cta-close:hover {
    opacity: 1;
}

/* Cleanup redundant elements */
.loq-wa-pro-cta-avatar, 
.loq-wa-pro-cta-status,
.loq-wa-pro-cta-bubble::after { 
    display: none !important; 
}
/* Cache Buster: 20260425-elite */

/* ---------------------------------------------------------
   CHAT SHEET (The Agent window)
   --------------------------------------------------------- */
.loq-wa-pro-sheet {
    position: absolute;
    bottom: 85px;
    right: 0;
    width: 340px;
    overflow: hidden;
    pointer-events: none;
    opacity: 0;
    transform: translateY(30px) scale(0.9);
    transform-origin: bottom right;
    transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 10;
}

.loq-wa-pro-widget.is-open .loq-wa-pro-sheet {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0) scale(1);
}

/* Header & Agent Info */
.loq-wa-pro-header {
    padding: 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.loq-wa-pro-agent {
    display: flex;
    align-items: center;
    gap: 14px;
}

.loq-wa-pro-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    overflow: hidden;
    position: relative;
}

.loq-wa-pro-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.loq-wa-pro-avatar-init {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #eee;
    color: #666;
    font-weight: 800;
    font-size: 12px;
}

.loq-wa-pro-online-indicator {
    position: absolute;
    bottom: 2px;
    right: 2px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: 2px solid transparent;
    /* Skin handles border color */
    background: #34c759;
}

.loq-wa-pro-info {
    display: flex;
    flex-direction: column;
}

.loq-wa-pro-name {
    font-weight: 800;
    font-size: 16px;
}

.loq-wa-pro-role {
    font-size: 12px;
    opacity: 0.7;
}

.loq-wa-pro-close {
    all: unset;
    cursor: pointer;
    font-size: 28px;
    opacity: 0.5;
}

/* Chat Body */
.loq-wa-pro-body {
    padding: 24px;
    max-height: 230px;
    overflow-y: auto;
    scroll-behavior: smooth;
}

/* Custom Scrollbar */
.loq-wa-pro-body::-webkit-scrollbar {
    width: 4px;
}

.loq-wa-pro-body::-webkit-scrollbar-track {
    background: transparent;
}

.loq-wa-pro-body::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 10px;
}

/* Messages */
.loq-wa-pro-message {
    padding: 14px 18px;
    max-width: 90%;
    margin-bottom: 20px;
    animation: lwa-fade-in 0.4s ease-out;
}

@keyframes lwa-fade-in {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.loq-wa-pro-message p {
    margin: 0;
    font-size: 13px;
    line-height: 1.5;
}

.loq-wa-pro-time {
    display: block;
    margin-top: 8px;
    font-size: 10px;
    opacity: 0.6;
    text-align: right;
}

/* Footer & Button */
.loq-wa-pro-footer {
    padding: 20px 24px 24px;
}

.loq-wa-pro-start-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    text-decoration: none;
    font-weight: 800;
    font-size: 16px;
    padding: 16px;
    border-radius: 18px;
    transition: all 0.3s;
}

.loq-wa-pro-disclaimer {
    margin: 10px 0 0;
    font-size: 10px;
    opacity: 0.5;
    text-align: center;
}

@media (max-width: 480px) {
    .loq-wa-pro-cta-bubble {
        width: calc(100vw - 60px); /* Más margen en los bordes */
        max-width: none;
        padding-left: 80px; /* Más espacio entre el icono y el texto en mobile */
        right: -5px; 
    }
    .loq-wa-pro-widget.has-cta .loq-wa-pro-btn {
        transform: translateX(calc(-100vw + 130px)); /* Deja unos 20-30px de margen a la izquierda */
    }
    .loq-wa-pro-cta-content p {
        font-size: 12px;
        line-height: 1.2;
        white-space: normal;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        line-clamp: 2;
        -webkit-box-orient: vertical;
    }
    .loq-wa-pro-sheet {
        position: fixed;
        bottom: 95px;
        left: 20px;
        right: 20px;
        width: auto;
    }
}