/* ============================================================
   Botón flotante de WhatsApp — SÓLO en Repuestos
   Markup: protected/views/site/_whatsapp-float.php
   Lógica: js/lib/whatsapp-float.js
   ============================================================ */

.wa-float {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 1030;                 /* sobre el contenido, debajo de modales (1040/1050) */
    display: flex;
    align-items: flex-end;         /* el botón queda abajo; la bubble se sube con margin */
    gap: 14px;
}

/* --- Botón (ícono) --- */
.wa-float__btn {
    display: block;
    width: 64px;
    height: 64px;
    line-height: 0;
    border-radius: 50%;
    box-shadow: 0 6px 18px rgba(0, 0, 0, .25);
    transition: transform .2s ease, box-shadow .2s ease;
}
.wa-float__btn:hover,
.wa-float__btn:focus-visible {
    transform: scale(1.06);
    box-shadow: 0 8px 22px rgba(0, 0, 0, .3);
}
.wa-float__btn svg {
    display: block;
    width: 100%;
    height: 100%;
}

/* --- Tooltip / chatbox --- */
.wa-float__tooltip {
    position: relative;
    margin-bottom: 0;              /* alineado a la base con el botón */
    max-width: 330px;              /* más ancha -> entra en 2 renglones */
    background: #002C5F;
    color: #fff;
    padding: 14px 34px 14px 20px;  /* extra a la derecha para la X */
    border-radius: 12px;
    font-size: 16px;
    line-height: 1.3;
    box-shadow: 0 4px 16px rgba(0, 0, 0, .2);

    /* estado oculto por defecto */
    opacity: 0;
    transform: translateX(12px);
    pointer-events: none;
    transition: opacity .4s ease, transform .4s ease;
}
/* cola en la esquina inferior derecha, apuntando abajo-derecha (hacia el botón) */
.wa-float__tooltip::after {
    content: "";
    position: absolute;
    right: -6px;
    bottom: 8px;
    width: 16px;
    height: 16px;
    background: #002C5F;
    border-radius: 0 0 4px 0;
    transform: rotate(45deg);
}

/* estado visible (lo togglea el JS) */
.wa-float.is-open .wa-float__tooltip {
    opacity: 1;
    transform: translateX(0);
    pointer-events: auto;
}

/* --- Botón de cerrar (X) --- */
.wa-float__close {
    position: absolute;
    top: 3px;
    right: 8px;
    background: none;
    border: 0;
    color: #fff;
    opacity: .7;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    padding: 2px 4px;
}
.wa-float__close:hover,
.wa-float__close:focus-visible {
    opacity: 1;
}

/* --- Responsive --- */
@media (max-width: 576px) {
    .wa-float {
        right: 16px;
        bottom: 16px;
    }
    .wa-float__btn {
        width: 56px;
        height: 56px;
    }
    .wa-float__tooltip {
        max-width: 220px;
        font-size: 14px;
        padding: 10px 30px 10px 14px;
    }
}

/* respeta usuarios con reduced-motion */
@media (prefers-reduced-motion: reduce) {
    .wa-float__tooltip,
    .wa-float__btn {
        transition: none;
    }
}
