/* WhatsApp Floating Widget - Frontend */

.wfw-widget {
    position: fixed;
    bottom: 24px;
    z-index: 99999;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

.wfw-widget.wfw-right {
    right: 24px;
}

.wfw-widget.wfw-left {
    left: 24px;
}

/* Bouton flottant */
.wfw-toggle {
    width: var(--wfw-size, 60px);
    height: var(--wfw-size, 60px);
    border-radius: 50%;
    border: none;
    background-color: var(--wfw-color, #25D366);
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    padding: 0;
    outline: none;
}

.wfw-toggle:hover {
    transform: scale(1.08);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3);
}

.wfw-toggle:focus-visible {
    outline: 2px solid #128C7E;
    outline-offset: 3px;
}

.wfw-icon {
    width: 55%;
    height: 55%;
    display: block;
}

/* Panneau */
.wfw-panel {
    position: absolute;
    bottom: calc(var(--wfw-size, 60px) + 14px);
    width: 300px;
    max-width: calc(100vw - 40px);
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.18);
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px) scale(0.95);
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
}

.wfw-widget.wfw-right .wfw-panel {
    right: 0;
}

.wfw-widget.wfw-left .wfw-panel {
    left: 0;
}

.wfw-panel.is-open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.wfw-panel[hidden] {
    display: block !important; /* on gère via is-open */
}

.wfw-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    background: var(--wfw-color, #25D366);
    color: #fff;
    font-weight: 600;
    font-size: 15px;
}

.wfw-close {
    background: transparent;
    border: none;
    color: #fff;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    padding: 0 4px;
    opacity: 0.9;
    transition: opacity 0.15s;
}

.wfw-close:hover {
    opacity: 1;
}

.wfw-panel-body {
    max-height: 320px;
    overflow-y: auto;
    padding: 8px 0;
}

.wfw-contact-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    text-decoration: none;
    color: #222;
    transition: background 0.15s;
}

.wfw-contact-item:hover {
    background: #f0faf4;
}

.wfw-contact-icon {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #e8f8ee;
    color: #25D366;
    display: flex;
    align-items: center;
    justify-content: center;
}

.wfw-contact-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.wfw-contact-name {
    font-weight: 600;
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.wfw-contact-phone {
    font-size: 12px;
    color: #666;
    margin-top: 2px;
}

/* Mobile */
@media (max-width: 480px) {
    .wfw-widget.wfw-hide-mobile {
        display: none !important;
    }

    .wfw-widget {
        bottom: 16px;
    }

    .wfw-widget.wfw-right {
        right: 16px;
    }

    .wfw-widget.wfw-left {
        left: 16px;
    }

    .wfw-panel {
        width: 280px;
    }
}
