/*
 * Pixelimperium Floating Buttons — Frontend Styles
 * Made by Nacanet — https://nacanet.com
 *
 * Critical rules use !important to prevent Uncode / WPBakery theme styles
 * from overriding the fixed positioning.
 */

/* ═══════════════════════════════════════════════════════════════════════════
   FLOATING WRAPPER — fixed on scroll, always visible, all screen sizes
   ═══════════════════════════════════════════════════════════════════════════ */

.pfb-wrap {
    /* Force fixed positioning even if a parent has transform/will-change */
    position: fixed !important;
    z-index: 999999 !important;

    /* Always a horizontal row — never changes */
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: center !important;

    /* Desktop: bottom-right corner, natural button width */
    bottom: 20px !important;
    right: 20px !important;
    left: auto !important;
    width: auto !important;
    gap: 10px;
    pointer-events: none;

    /* Reset anything the theme might inject */
    padding: 0 !important;
    margin: 0 !important;
    background: none !important;
    border: none !important;
    box-shadow: none !important;
}

/* ═══════════════════════════════════════════════════════════════════════════
   MOBILE & TABLET ≤ 1024px
   Full-width bar pinned to the very bottom of the viewport.
   Buttons share the bar width equally so they always fit on one line.
   ═══════════════════════════════════════════════════════════════════════════ */

@media screen and (max-width: 1024px) {

    .pfb-wrap {
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        width: 100% !important;
        gap: 0 !important;
        padding: 6px 8px 6px !important;   /* safe-area-inset handled below */
        padding-bottom: calc(6px + env(safe-area-inset-bottom)) !important;
        align-items: stretch !important;
        background: var(--pfb-mobile-bg, transparent) !important;
        backdrop-filter: var(--pfb-mobile-blur, none) !important;
        -webkit-backdrop-filter: var(--pfb-mobile-blur, none) !important;
        border-top: var(--pfb-mobile-border, none) !important;
        box-shadow: var(--pfb-mobile-shadow, none) !important;
    }

    /* Each button takes exactly half (or 1/N) of the bar */
    .pfb-wrap .pfb-btn {
        flex: 1 1 0% !important;    /* equal share, can shrink to zero */
        min-width: 0 !important;    /* allow shrinking below content size */
        width: 0 !important;        /* force flex to compute width */
        margin: 0 4px !important;
        padding: 12px 4px !important;
        border-radius: 50px !important;
        font-size: 19px !important;
        justify-content: center !important;
        text-align: center !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        animation-name: pfb-fade-up !important;
    }

    .pfb-wrap .pfb-btn .pfb-btn__text {
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        white-space: nowrap !important;
        min-width: 0 !important;
    }

    .pfb-wrap .pfb-btn .pfb-btn__icon {
        font-size: clamp(0.9em, 2.5vw, 1.1em) !important;
        flex-shrink: 0 !important;
    }

    /* Un solo botón: mismo ancho que cuando hay dos, alineado a la derecha */
    .pfb-wrap .pfb-btn:only-child {
        flex: 0 0 calc(50% - 8px) !important;
        width: calc(50% - 8px) !important;
        margin-left: auto !important;
    }
}

/* Extra-small phones: hide the icon so the label always fits */
@media screen and (max-width: 400px) {
    .pfb-wrap .pfb-btn .pfb-btn__icon {
        display: none !important;
    }
}

/* ═══════════════════════════════════════════════════════════════════════════
   BASE BUTTON — shared styles for all sizes
   ═══════════════════════════════════════════════════════════════════════════ */

.pfb-btn {
    pointer-events: auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 13px 22px;
    border-radius: 50px;
    font-family: inherit;
    font-size: 0.93rem;
    font-weight: 500;
    line-height: 1;
    white-space: nowrap;
    text-decoration: none !important;
    box-shadow: 0 4px 16px rgba(0,0,0,0.22);
    transition: transform 0.18s ease, box-shadow 0.18s ease;
    animation: pfb-slide-in 0.4s cubic-bezier(.22,.68,0,1.2) both;
    cursor: pointer;
}

.pfb-btn:nth-child(1) { animation-delay: 0.08s; }
.pfb-btn:nth-child(2) { animation-delay: 0.18s; }
.pfb-btn:nth-child(3) { animation-delay: 0.28s; }
.pfb-btn:nth-child(4) { animation-delay: 0.38s; }
.pfb-btn:nth-child(5) { animation-delay: 0.48s; }
.pfb-btn:nth-child(6) { animation-delay: 0.58s; }
.pfb-btn:nth-child(7) { animation-delay: 0.68s; }
.pfb-btn:nth-child(8) { animation-delay: 0.78s; }

.pfb-btn:hover,
.pfb-btn:focus-visible {
    background-color: #000 !important;
    border-color: #000 !important;
    color: #fff !important;
    transform: translateY(-2px) scale(1.04);
    box-shadow: 0 8px 26px rgba(0,0,0,0.28);
    text-decoration: none !important;
}

.pfb-btn:active {
    transform: scale(0.97);
}

.pfb-btn__icon {
    font-size: 1.05em;
    flex-shrink: 0;
    line-height: 1;
}

.pfb-btn__text {
    flex-shrink: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ── Entrance animations ────────────────────────────────────────────────────── */

@keyframes pfb-slide-in {
    from { opacity: 0; transform: translateX(48px); }
    to   { opacity: 1; transform: translateX(0); }
}

@keyframes pfb-fade-up {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ═══════════════════════════════════════════════════════════════════════════
   INLINE / SHORTCODE variant — [pfb_btn] and [pfb_buttons]
   Flows inside page content, not fixed.
   ═══════════════════════════════════════════════════════════════════════════ */

.pfb-wrap--inline {
    position: static !important;
    bottom: auto !important;
    right: auto !important;
    left: auto !important;
    width: auto !important;
    flex-wrap: wrap !important;
    background: none !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    border-top: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    gap: 10px !important;
    pointer-events: auto;
}

.pfb-wrap--inline .pfb-btn,
.pfb-btn--inline {
    flex: 0 0 auto !important;
    width: auto !important;
    position: static !important;
    animation: none !important;
    font-size: 0.93rem !important;
    padding: 13px 22px !important;
}
