/* =====================================================================
   Cuotas Sin Intereses — FAB Frontend
   Autor: Erick Pérez — bitsaturno.com
   ===================================================================== */

:root {
    --csi-fab-bg:          #111111;
    --csi-fab-color:       #ffffff;
    --csi-fab-badge-bg:    #e74c3c;
    --csi-fab-badge-color: #ffffff;
    --csi-fab-delay:       800ms;
}

/* ── Base ─────────────────────────────────────────────────────────── */
.csi-fab {
    position: fixed;
    z-index: 99998;
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--csi-fab-bg);
    color: var(--csi-fab-color);
    border-radius: 999px;
    padding: 10px 14px 10px 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.28), 0 1px 4px rgba(0,0,0,0.15);
    text-decoration: none !important;
    max-width: 280px;
    opacity: 0;
    pointer-events: none;
    transition: transform 0.2s cubic-bezier(0.34,1.56,0.64,1), box-shadow 0.2s ease;
}

a.csi-fab { color: var(--csi-fab-color) !important; }

/* Activado tras delay */
.csi-fab.csi-fab--visible {
    opacity: 1;
    pointer-events: auto;
}

.csi-fab:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 8px 30px rgba(0,0,0,0.3), 0 2px 8px rgba(0,0,0,0.15);
}
.csi-fab:active { transform: scale(0.97); }

/* ── Animaciones de entrada ───────────────────────────────────────── */
.csi-fab--anim-slide-up    { transform: translateY(30px); }
.csi-fab--anim-slide-down  { transform: translateY(-30px); }
.csi-fab--anim-slide-left  { transform: translateX(40px); }
.csi-fab--anim-slide-right { transform: translateX(-40px); }
.csi-fab--anim-bounce      { transform: scale(0.4); }
.csi-fab--anim-fade        { transform: none; }
.csi-fab--anim-none        { transform: none; }

.csi-fab.csi-fab--visible {
    transform: translate(0,0) scale(1) !important;
    transition:
        opacity 0.45s ease var(--csi-fab-delay),
        transform 0.5s cubic-bezier(0.34,1.56,0.64,1) var(--csi-fab-delay);
}

.csi-fab--anim-none.csi-fab--visible {
    transition: none;
    opacity: 1;
}

/* ── Badge ────────────────────────────────────────────────────────── */
.csi-fab__badge {
    position: absolute;
    top: -8px;
    right: 10px;
    background: var(--csi-fab-badge-bg);
    color: var(--csi-fab-badge-color);
    font-size: 0.62rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    padding: 2px 8px;
    border-radius: 999px;
    white-space: nowrap;
    line-height: 1.6;
    text-transform: uppercase;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

/* ── Icono ────────────────────────────────────────────────────────── */
.csi-fab__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: rgba(255,255,255,0.13);
    border-radius: 50%;
    flex-shrink: 0;
    font-size: 1rem;
    transition: background 0.2s;
}
.csi-fab:hover .csi-fab__icon { background: rgba(255,255,255,0.22); }

/* ── Body ─────────────────────────────────────────────────────────── */
.csi-fab__body {
    display: flex;
    flex-direction: column;
    gap: 1px;
    min-width: 0;
}

.csi-fab__title {
    font-size: 0.82rem;
    font-weight: 700;
    line-height: 1.25;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--csi-fab-color);
}

.csi-fab__desc {
    font-size: 0.7rem;
    opacity: 0.8;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--csi-fab-color);
}

/* ── Botón cerrar ─────────────────────────────────────────────────── */
.csi-fab__close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    background: rgba(255,255,255,0.15);
    border: none;
    border-radius: 50%;
    color: var(--csi-fab-color);
    font-size: 0.65rem;
    cursor: pointer;
    flex-shrink: 0;
    margin-left: 2px;
    padding: 0;
    line-height: 1;
    transition: background 0.15s;
}
.csi-fab__close:hover { background: rgba(255,255,255,0.3); }

/* ── Posiciones ───────────────────────────────────────────────────── */
.csi-fab--bottom-right { bottom: 24px; right:  24px; top: auto; left: auto; }
.csi-fab--bottom-left  { bottom: 24px; left:   24px; top: auto; right: auto; }
.csi-fab--top-right    { top:    24px; right:  24px; bottom: auto; left: auto; }
.csi-fab--top-left     { top:    24px; left:   24px; bottom: auto; right: auto; }

/* ── Hide mobile ──────────────────────────────────────────────────── */
@media (max-width: 767px) {
    .csi-fab--hide-mobile { display: none !important; }
}

/* ── Responsive (cuando SÍ se muestra en móvil) ───────────────────── */
@media (max-width: 480px) {
    .csi-fab { max-width: 220px; padding: 8px 10px 8px 10px; gap: 8px; }
    .csi-fab__icon { width: 30px; height: 30px; font-size: 0.88rem; }
    .csi-fab__desc { display: none; }
}

@media print { .csi-fab { display: none !important; } }

/* ── JS trigger para animación ────────────────────────────────────── */
.csi-fab { animation: none !important; }
