/* ================================================================
   WhatsApp Widget
   ================================================================ */

.mp-wa {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 99990;
    font-family: var(--mp-font-sans, -apple-system, BlinkMacSystemFont, 'Helvetica Neue', sans-serif);
}

.mp-wa__toggle {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: #25D366;
    color: #fff;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 18px rgba(37, 211, 102, 0.4),
                0 2px 6px rgba(0, 0, 0, 0.12);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    position: relative;
    z-index: 2;
    padding: 0;
}
.mp-wa__toggle:hover {
    transform: scale(1.06);
    box-shadow: 0 8px 22px rgba(37, 211, 102, 0.5),
                0 3px 8px rgba(0, 0, 0, 0.15);
}

/* Iconos: estado por defecto = solo se muestra el de apertura */
.mp-wa .mp-wa__icon-open  { display: block; width: 34px; height: 34px; }
.mp-wa .mp-wa__icon-close { display: none;  width: 26px; height: 26px; }

/* Estado abierto: se invierten */
.mp-wa.is-open .mp-wa__icon-open  { display: none; }
.mp-wa.is-open .mp-wa__icon-close { display: block; }

.mp-wa__panel {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 340px;
    max-width: calc(100vw - 40px);
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.18);
    overflow: hidden;
    opacity: 0;
    transform: translateY(20px) scale(0.96);
    transform-origin: bottom right;
    pointer-events: none;
    transition: opacity 0.26s ease, transform 0.26s cubic-bezier(0.4, 0, 0.2, 1);
}
.mp-wa.is-open .mp-wa__panel {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

.mp-wa__header {
    background: #075E54;
    color: #fff;
    padding: 16px 18px;
    display: flex;
    align-items: center;
    gap: 12px;
}
.mp-wa__avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255,255,255,0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.mp-wa__header-text {
    display: flex;
    flex-direction: column;
    line-height: 1.3;
}
.mp-wa__header-text strong {
    font-size: 0.95rem;
    font-weight: 500;
    letter-spacing: 0.02em;
}
.mp-wa__header-text span {
    font-size: 0.72rem;
    opacity: 0.8;
    margin-top: 2px;
}

.mp-wa__body {
    padding: 18px;
    background: #ECE5DD;
    background-image:
        linear-gradient(135deg, rgba(255,255,255,0.08) 25%, transparent 25%),
        linear-gradient(225deg, rgba(255,255,255,0.08) 25%, transparent 25%);
    background-size: 20px 20px;
}
.mp-wa__bubble {
    background: #fff;
    padding: 12px 14px;
    border-radius: 0 12px 12px 12px;
    font-size: 0.88rem;
    line-height: 1.45;
    color: #222;
    box-shadow: 0 1px 1px rgba(0,0,0,0.05);
    margin-bottom: 14px;
    max-width: 90%;
}
.mp-wa__input {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid #d8d8d8;
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.9rem;
    line-height: 1.5;
    background: #fff;
    color: #000;
    resize: none;
    outline: none;
    margin-bottom: 12px;
    transition: border-color 0.2s ease;
}
.mp-wa__input:focus { border-color: #25D366; }
.mp-wa__input::placeholder { color: #999; }
.mp-wa__send {
    width: 100%;
    padding: 12px 14px;
    background: #25D366;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.88rem;
    font-weight: 500;
    letter-spacing: 0.02em;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: background 0.2s ease;
}
.mp-wa__send:hover { background: #1faf54; }
.mp-wa__footer {
    background: #fff;
    padding: 8px 0;
    text-align: center;
    font-size: 0.7rem;
    color: #999;
    border-top: 1px solid #f0f0f0;
}

@media (max-width: 480px) {
    .mp-wa { bottom: 16px; right: 16px; }
    .mp-wa__toggle { width: 60px; height: 60px; }
    .mp-wa .mp-wa__icon-open { width: 30px; height: 30px; }
    .mp-wa__panel { width: calc(100vw - 32px); right: 0; }
}
