/* ===== Floating Action Button (FAB) ===== */
.fab {
    position: fixed;
    right: 16px;
    bottom: 16px;
    z-index: 1200;
    /* por encima del nav móvil */
    display: grid;
    place-items: center;
}

.fab__main {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: 1px solid var(--ring);
    background: #25D366;
    /* WhatsApp */
    color: #fff;
    display: grid;
    place-items: center;
    font-size: 22px;
    cursor: pointer;
    box-shadow: 0 10px 24px rgba(0, 0, 0, .16);
    transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
}

.fab__main:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 28px rgba(0, 0, 0, .2);
}

.fab__main:active {
    transform: translateY(0);
}

/* Menú */
.fab__menu {
    position: absolute;
    bottom: 70px;
    /* se coloca arriba del botón principal */
    right: 0;
    display: grid;
    gap: 10px;
    /* Estado cerrado (invisible y no clickeable) */
    transform: translateY(8px) scale(.98);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: transform .18s ease, opacity .18s ease, visibility 0s linear .18s;
}

/* Ítems del menú */
.fab__item {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    color: #fff;
    text-decoration: none;
    box-shadow: 0 8px 20px rgba(0, 0, 0, .16);
    border: 1px solid var(--ring);
    transition: transform .18s ease, box-shadow .18s ease;
}

.fab__item:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 24px rgba(0, 0, 0, .2);
}

.fab__item i {
    font-size: 18px;
}

/* Colores por red */
.fab__whatsapp {
    background: #25D366;
}

.fab__instagram {
    background: #E1306C;
}

.fab__facebook {
    background: #1877F2;
}

.fab__mail {
    background: #111;
}

/* Estado abierto */
.fab.is-open .fab__menu {
    transform: translateY(0) scale(1);
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transition: transform .18s ease, opacity .18s ease, visibility 0s;
}

/* Animación escalonada (stagger) */
.fab.is-open .fab__item {
    animation: fab-pop .22s ease both;
}

.fab.is-open .fab__item:nth-child(1) {
    animation-delay: .00s;
}

.fab.is-open .fab__item:nth-child(2) {
    animation-delay: .04s;
}

.fab.is-open .fab__item:nth-child(3) {
    animation-delay: .08s;
}

.fab.is-open .fab__item:nth-child(4) {
    animation-delay: .12s;
}

@keyframes fab-pop {
    from {
        transform: translateY(8px) scale(.96);
        opacity: .0;
    }

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

/* Respeto por reduce motion */
@media (prefers-reduced-motion: reduce) {

    .fab__menu,
    .fab__item {
        transition: none !important;
        animation: none !important;
    }
}

/* Separación en pantallas pequeñas para no tapar CTA fijos */
@media (max-width: 480px) {
    .fab {
        right: 12px;
        bottom: 12px;
    }
}