/* ==========================================================================
   Floating Contact Widget - Estilos del frontend
   Botones tipo pill con icono circular + texto CTA
   ========================================================================== */

.fcw-widget {
    position: fixed;
    z-index: 99998;
    bottom: 20px;
    pointer-events: none;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, sans-serif;
    --fcw-wa-bg: #25d366;
    --fcw-wa-color: #ffffff;
    --fcw-email-bg: #ff7a00;
    --fcw-email-color: #ffffff;
}

.fcw-widget__inner {
    pointer-events: auto;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    animation: fcw-fade-in 0.4s ease-out;
}

/* Posiciones */
.fcw-widget.fcw-pos-bottom-right {
    right: 20px;
}

.fcw-widget.fcw-pos-bottom-left {
    left: 20px;
}

.fcw-widget.fcw-pos-bottom-center {
    left: 50%;
    transform: translateX(-50%);
}

/* Animación de entrada */
@keyframes fcw-fade-in {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Botón pill: icono circular + texto */
.fcw-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 6px 22px 6px 6px;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 700;
    font-size: 15px;
    line-height: 1;
    transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.18);
    white-space: nowrap;
    border: none;
    cursor: pointer;
}

.fcw-btn:hover,
.fcw-btn:focus {
    transform: translateY(-3px);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.25);
    text-decoration: none;
    opacity: 0.97;
}

/* Si el botón solo tiene icono (sin texto), se vuelve circular */
.fcw-btn:not(:has(.fcw-btn__text)) {
    padding: 0;
    width: 56px;
    height: 56px;
    justify-content: center;
}

/* Fallback para navegadores sin :has() */
.fcw-btn--icon-only {
    padding: 0;
    width: 56px;
    height: 56px;
    justify-content: center;
}

.fcw-btn__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.18);
    flex-shrink: 0;
}

.fcw-btn__icon svg {
    width: 24px;
    height: 24px;
}

.fcw-btn__text {
    display: inline-block;
    padding-right: 4px;
}

/* WhatsApp */
.fcw-btn--whatsapp {
    background: var(--fcw-wa-bg);
    color: var(--fcw-wa-color);
    box-shadow: 0 6px 18px rgba(37, 211, 102, 0.4);
    position: relative;
}

.fcw-btn--whatsapp:hover,
.fcw-btn--whatsapp:focus {
    color: var(--fcw-wa-color);
    box-shadow: 0 10px 24px rgba(37, 211, 102, 0.5);
}

/* Animación de pulso en el icono de WhatsApp */
.fcw-btn--whatsapp .fcw-btn__icon::before {
    content: "";
    position: absolute;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--fcw-wa-bg);
    opacity: 0.5;
    z-index: -1;
    animation: fcw-pulse 2s ease-out infinite;
}

@keyframes fcw-pulse {
    0% {
        transform: scale(1);
        opacity: 0.5;
    }
    100% {
        transform: scale(1.7);
        opacity: 0;
    }
}

/* Correo */
.fcw-btn--email {
    background: var(--fcw-email-bg);
    color: var(--fcw-email-color);
    box-shadow: 0 6px 18px rgba(255, 122, 0, 0.4);
}

.fcw-btn--email:hover,
.fcw-btn--email:focus {
    color: var(--fcw-email-color);
    box-shadow: 0 10px 24px rgba(255, 122, 0, 0.5);
}

/* ==========================================================================
   Responsivo
   ========================================================================== */

/* Tablet */
@media (max-width: 768px) {
    .fcw-widget {
        bottom: 16px;
    }

    .fcw-widget.fcw-pos-bottom-right {
        right: 12px;
    }

    .fcw-widget.fcw-pos-bottom-left {
        left: 12px;
    }

    .fcw-widget__inner {
        gap: 8px;
    }
}

/* Móvil */
@media (max-width: 540px) {
    .fcw-widget.fcw-pos-bottom-right,
    .fcw-widget.fcw-pos-bottom-left {
        right: 12px;
        left: 12px;
    }

    .fcw-widget.fcw-pos-bottom-right .fcw-widget__inner,
    .fcw-widget.fcw-pos-bottom-left .fcw-widget__inner {
        display: flex;
        justify-content: center;
        flex-wrap: wrap;
    }

    .fcw-widget.fcw-pos-bottom-center {
        left: 12px;
        right: 12px;
        transform: none;
        text-align: center;
    }

    .fcw-widget.fcw-pos-bottom-center .fcw-widget__inner {
        display: inline-flex;
        flex-wrap: wrap;
        justify-content: center;
    }

    .fcw-btn {
        padding: 5px 18px 5px 5px;
        font-size: 14px;
        gap: 8px;
    }

    .fcw-btn__icon {
        width: 38px;
        height: 38px;
    }

    .fcw-btn__icon svg {
        width: 20px;
        height: 20px;
    }

    .fcw-btn--whatsapp .fcw-btn__icon::before {
        width: 38px;
        height: 38px;
    }
}

/* Móvil pequeño */
@media (max-width: 380px) {
    .fcw-btn {
        font-size: 13px;
        padding: 4px 14px 4px 4px;
        gap: 6px;
    }

    .fcw-btn__icon {
        width: 34px;
        height: 34px;
    }

    .fcw-btn__icon svg {
        width: 18px;
        height: 18px;
    }

    .fcw-btn--whatsapp .fcw-btn__icon::before {
        width: 34px;
        height: 34px;
    }
}

/* Reducir movimiento (accesibilidad) */
@media (prefers-reduced-motion: reduce) {
    .fcw-widget__inner,
    .fcw-btn {
        animation: none;
        transition: none;
    }

    .fcw-btn--whatsapp .fcw-btn__icon::before {
        animation: none;
        display: none;
    }
}
