/* ============================================================
   Blue Ark Plugin — Burbujas flotantes
   Blue Ark Solutions | bluearksolutions.com
   Estilo: Flat + colores configurables via CSS variables
   ============================================================ */

/* Variables inyectadas desde PHP (class-quote-bubbles.php):
   --ba-bbl-quote-bg      fondo burbuja cotización
   --ba-bbl-quote-icon    color ícono cotización
   --ba-bbl-wa-bg         fondo burbuja WhatsApp
   --ba-bbl-wa-icon       color ícono WhatsApp
   --ba-bbl-phone-bg      fondo burbuja llamada
   --ba-bbl-phone-icon    color ícono llamada
*/

.ba-bubbles {
    position: fixed !important;
    bottom: 28px !important;
    z-index: 99999 !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    gap: 12px !important;
    margin: 0 !important;
    padding: 0 !important;
    pointer-events: none;
}
.ba-bubbles--right {
    right: 28px !important;
    left: auto !important;
    align-items: flex-end !important;
}
.ba-bubbles--left {
    left: 28px !important;
    right: auto !important;
    align-items: flex-start !important;
}

/* ── Wrap ── */
.ba-bbl-wrap {
    position: relative;
    display: flex;
    align-items: center;
    pointer-events: all;
}
.ba-bubbles--right .ba-bbl-wrap { justify-content: flex-end; }
.ba-bubbles--left  .ba-bbl-wrap { justify-content: flex-start; }

/* ── Tooltip ── */
.ba-bbl-tooltip {
    position: absolute;
    top: 50%;
    transform: translateY(-50%) translateX(-6px);
    right: calc(100% + 14px);
    left: auto;
    background: rgba(8, 18, 32, 0.88);
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
    padding: 7px 14px;
    border-radius: 20px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
    letter-spacing: 0.3px;
    z-index: 10;
}
.ba-bbl-tooltip::after {
    content: '';
    position: absolute;
    right: -7px;
    top: 50%;
    transform: translateY(-50%);
    border: 7px solid transparent;
    border-right: none;
    border-left-color: rgba(8, 18, 32, 0.88);
}
.ba-bbl-tooltip--right {
    left: calc(100% + 14px);
    right: auto;
    transform: translateY(-50%) translateX(6px);
}
.ba-bbl-tooltip--right::after {
    left: -7px;
    right: auto;
    border-left: none;
    border-right-color: rgba(8, 18, 32, 0.88);
}
.ba-bbl-wrap:hover .ba-bbl-tooltip {
    opacity: 1;
    transform: translateY(-50%) translateX(0);
}

/* ── Base bubble — FLAT ── */
.ba-bbl {
    position: relative;
    width: 54px !important;
    height: 54px !important;
    min-width: 54px !important;
    max-width: 54px !important;
    min-height: 54px !important;
    max-height: 54px !important;
    border-radius: 50% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    text-decoration: none !important;
    border: none !important;
    cursor: pointer;
    box-sizing: border-box !important;
    overflow: visible !important;
    box-shadow: 0 2px 8px rgba(0,0,0,0.18) !important;
    transition: transform 0.2s ease, box-shadow 0.2s ease !important;
}
.ba-bbl:hover {
    transform: scale(1.08) translateY(-2px) !important;
    box-shadow: 0 6px 18px rgba(0,0,0,0.22) !important;
    text-decoration: none !important;
}
.ba-bbl:active {
    transform: scale(0.95) !important;
    transition-duration: 0.1s !important;
}

/* ── Icon ── */
.ba-bbl-icon {
    width: 26px !important;
    height: 26px !important;
    min-width: 26px !important;
    max-width: 26px !important;
    display: block !important;
    position: relative;
    z-index: 3;
    pointer-events: none;
    flex-shrink: 0;
}

/* ── Glow pulse (badge) ── */
.ba-bbl-glow {
    display: none !important;
}

/* ============================================================
   COTIZACIÓN
   ============================================================ */
.ba-bbl--quote {
    background: var(--ba-bbl-quote-bg, #03325E) !important;
    color: var(--ba-bbl-quote-icon, #ffffff) !important;
}
.ba-bbl--quote .ba-bbl-icon {
    stroke: var(--ba-bbl-quote-icon, #ffffff);
}

/* Quote badge */
.ba-bbl-badge {
    position: absolute !important;
    top: -3px !important;
    right: -3px !important;
    width: 22px !important;
    height: 22px !important;
    background: #e74c3c !important;
    color: #fff !important;
    border-radius: 50% !important;
    font-size: 11px !important;
    font-weight: 700 !important;
    line-height: 22px !important;
    text-align: center !important;
    border: 2px solid #fff !important;
    display: none;
    z-index: 10 !important;
    box-sizing: border-box !important;
}
.ba-bbl-badge--on { display: block !important; }
.ba-bbl-badge-ring {
    position: absolute;
    inset: -5px;
    border-radius: 50%;
    background: #e74c3c;
    opacity: 0.5;
    z-index: -1;
    animation: ba-badge-ring 2s ease-in-out infinite;
}
@keyframes ba-badge-ring {
    0%   { transform: scale(1);   opacity: 0.5; }
    50%  { transform: scale(2.0); opacity: 0;   }
    100% { transform: scale(1);   opacity: 0.5; }
}
.ba-bbl-badge--bump {
    animation: ba-badge-bump 0.35s cubic-bezier(.34,1.56,.64,1);
}
@keyframes ba-badge-bump {
    0%   { transform: scale(1);   }
    50%  { transform: scale(1.7); }
    100% { transform: scale(1);   }
}

/* ============================================================
   WHATSAPP
   ============================================================ */
.ba-bbl--wa {
    background: var(--ba-bbl-wa-bg, #25d366) !important;
    color: var(--ba-bbl-wa-icon, #ffffff) !important;
}
.ba-bbl--wa .ba-bbl-icon {
    fill: var(--ba-bbl-wa-icon, #ffffff);
    width: 30px !important;
    height: 30px !important;
    max-width: 30px !important;
}

/* ============================================================
   LLAMADA
   ============================================================ */
.ba-bbl--phone {
    background: var(--ba-bbl-phone-bg, #1891AE) !important;
    color: var(--ba-bbl-phone-icon, #ffffff) !important;
    animation: ba-phone-ring 5s ease-in-out infinite;
}
.ba-bbl--phone:hover {
    animation: none !important;
}
.ba-bbl--phone .ba-bbl-icon {
    stroke: var(--ba-bbl-phone-icon, #ffffff);
}
@keyframes ba-phone-ring {
    0%,80%,100% { transform: rotate(0deg); }
    82%          { transform: rotate(14deg); }
    84%          { transform: rotate(-12deg); }
    86%          { transform: rotate(9deg); }
    88%          { transform: rotate(-6deg); }
    90%          { transform: rotate(0deg); }
}

/* ============================================================
   FIX: Botones +/− de cantidad
   ============================================================ */
.ba-qty-control {
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 6px !important;
    flex-wrap: nowrap !important;
}
.ba-qty-btn {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 32px !important;
    height: 32px !important;
    min-width: 32px !important;
    min-height: 32px !important;
    line-height: 1 !important;
    font-size: 18px !important;
    font-weight: 400 !important;
    padding: 0 !important;
    margin: 0 !important;
    border: 1px solid #c8d8e4 !important;
    border-radius: 50% !important;
    background: #f0f6fa !important;
    color: var(--ba-color-primary, #03325E) !important;
    cursor: pointer !important;
    transition: background 0.15s, border-color 0.15s, color 0.15s !important;
    vertical-align: middle !important;
    flex-shrink: 0 !important;
    box-shadow: none !important;
    text-align: center !important;
}
.ba-qty-btn:hover {
    background: var(--ba-color-hover, #1891AE) !important;
    border-color: var(--ba-color-hover, #1891AE) !important;
    color: #fff !important;
}
.ba-qty-input {
    display: inline-block !important;
    width: 48px !important;
    height: 32px !important;
    text-align: center !important;
    border: 1px solid #c8d8e4 !important;
    border-radius: 8px !important;
    padding: 0 6px !important;
    font-size: 14px !important;
    line-height: 32px !important;
    color: #333 !important;
    background: #fff !important;
    vertical-align: middle !important;
    box-sizing: border-box !important;
    margin: 0 !important;
    -moz-appearance: textfield !important;
}
.ba-qty-input::-webkit-inner-spin-button,
.ba-qty-input::-webkit-outer-spin-button {
    -webkit-appearance: none !important;
    margin: 0 !important;
}
.ba-qty-input:focus {
    border-color: var(--ba-color-hover, #1891AE) !important;
    outline: none !important;
    box-shadow: 0 0 0 3px rgba(24,145,174,0.15) !important;
}

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 480px) {
    .ba-bubbles {
        bottom: 18px !important;
        gap: 10px !important;
    }
    .ba-bubbles--right { right: 16px !important; }
    .ba-bubbles--left  { left: 16px !important;  }
    .ba-bbl {
        width: 46px !important;
        height: 46px !important;
        min-width: 46px !important;
        max-width: 46px !important;
        min-height: 46px !important;
        max-height: 46px !important;
    }
    .ba-bbl-icon {
        width: 22px !important;
        height: 22px !important;
        max-width: 22px !important;
    }
    .ba-bbl--wa .ba-bbl-icon {
        width: 26px !important;
        height: 26px !important;
        max-width: 26px !important;
    }
    .ba-bbl-tooltip { display: none !important; }
}

@media (max-width: 768px) {
    .ba-bbl-wrap { display: flex !important; }
    .ba-bubbles {
        bottom: 88px !important;
        gap: 0 !important;
    }
    .ba-bubbles--right { right: 14px !important; }
    .ba-bubbles--left  { left: 14px !important; }
    .ba-bbl {
        width: 44px !important;
        height: 44px !important;
        min-width: 44px !important;
        max-width: 44px !important;
        min-height: 44px !important;
        max-height: 44px !important;
    }
    .ba-bbl-icon {
        width: 22px !important;
        height: 22px !important;
        max-width: 22px !important;
    }
    .ba-bbl-wrap {
        flex-direction: column !important;
        align-items: center !important;
        gap: 4px;
    }
    .ba-bbl-wrap[data-bubble="quote"]::after {
        content: 'Cotización';
        font-size: 9px;
        font-weight: 700;
        color: var(--ba-bbl-quote-bg, #03325E);
        letter-spacing: 0.3px;
        text-align: center;
        background: rgba(255,255,255,0.92);
        border-radius: 20px;
        padding: 2px 7px;
        box-shadow: 0 1px 4px rgba(0,0,0,0.12);
        white-space: nowrap;
    }
    .ba-bbl-tooltip { display: none !important; }
}
