/* =============================================
   WhatsApp Links – Frontend Widget
   ============================================= */

/* ── Botón flotante ── */
#wal-widget {
    position: fixed;
    bottom: 24px;
    z-index: 999999;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}
#wal-widget.wal-left  { left: 24px; }
#wal-widget.wal-right { right: 74px; }

#wal-toggle {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: none;
    padding: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 14px rgba(0,0,0,.25);
    transition: transform .25s ease, box-shadow .25s ease;
    position: relative;
    z-index: 2;
    box-sizing: border-box;
}
#wal-toggle svg {
    width: 100%;
    height: 100%;
    display: block;
}
#wal-toggle:hover {
    transform: scale(1.08);
    box-shadow: 0 6px 20px rgba(0,0,0,.3);
}

/* ── Panel ── */
#wal-panel {
    position: absolute;
    bottom: 76px;
    width: 360px;
    max-height: 520px;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0,0,0,.18);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: opacity .3s ease, transform .3s ease;
    opacity: 1;
    transform: translateY(0);
}

#wal-widget.wal-left  #wal-panel { left: 0; }
#wal-widget.wal-right #wal-panel { right: 0; }

#wal-panel.wal-hidden {
    opacity: 0;
    transform: translateY(20px);
    pointer-events: none;
    visibility: hidden;
}

/* ── Cabecera ── */
.wal-header {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 22px 20px;
    color: #fff;
    border-radius: 16px 16px 0 0;
}
.wal-header-icon {
    flex-shrink: 0;
}
.wal-header-text {
    display: flex;
    flex-direction: column;
}
.wal-header-text strong {
    font-size: 18px;
    line-height: 1.3;
}
.wal-header-text span {
    font-size: 13px;
    opacity: .9;
    margin-top: 4px;
    line-height: 1.4;
}

/* ── Tiempo de respuesta ── */
.wal-response-time {
    padding: 12px 20px;
    font-size: 13px;
    color: #888;
    border-bottom: 1px solid #f0f0f0;
}

/* ── Contactos ── */
.wal-contacts {
    flex: 1;
    overflow-y: auto;
    padding: 8px 14px 14px;
}

.wal-contact {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 12px;
    margin-bottom: 6px;
    border-radius: 12px;
    background: #f9f9f9;
    text-decoration: none;
    color: inherit;
    border-left: 3px solid #25D366;
    transition: background .2s ease, box-shadow .2s ease;
}
.wal-contact:hover {
    background: #f0f0f0;
    box-shadow: 0 2px 8px rgba(0,0,0,.08);
}

.wal-contact-avatar {
    flex-shrink: 0;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    overflow: hidden;
    background: #e0e0e0;
    display: flex;
    align-items: center;
    justify-content: center;
}
.wal-contact-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.wal-contact-avatar img[src$=".svg"] {
    width: 65%;
    height: 65%;
    object-fit: contain;
    padding: 0;
}

.wal-contact-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}
.wal-contact-name {
    font-weight: 600;
    font-size: 15px;
    color: #333;
}
.wal-contact-area {
    font-size: 13px;
    color: #777;
    margin-top: 1px;
}
.wal-contact-msg {
    font-size: 12px;
    color: #e09b00;
    font-style: italic;
    margin-top: 3px;
}

.wal-contact-wa {
    flex-shrink: 0;
    opacity: .7;
    transition: opacity .2s;
}
.wal-contact:hover .wal-contact-wa {
    opacity: 1;
}

.wal-empty {
    text-align: center;
    padding: 30px 10px;
    color: #999;
    font-size: 14px;
}

/* ── Responsive ── */
@media (max-width: 420px) {
    #wal-panel {
        width: calc(100vw - 32px);
        left: 50% !important;
        right: auto !important;
        transform: translateX(-50%);
        bottom: 76px;
    }
    #wal-panel.wal-hidden {
        transform: translateX(-50%) translateY(20px);
    }
    #wal-widget.wal-left,
    #wal-widget.wal-right {
        left: 16px;
        right: auto;
    }
}
