/* =============================================================
   Plugin WhatsApp Web — Estilos
   Autor: SetWeb
   ============================================================= */

/* --- Contenedor del icono --- */
.pww-wrapper {
    display: flex;
    margin: 8px 0;
}

.pww-align-left   { justify-content: flex-start; }
.pww-align-center { justify-content: center; }
.pww-align-right  { justify-content: flex-end; }

/* --- Botón (reset de estilos nativos) --- */
.pww-btn {
    background: none;
    border: none;
    padding: 0;
    margin: 0;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease, filter 0.2s ease;
    border-radius: 50%;
    outline-offset: 3px;
}

.pww-btn:hover,
.pww-btn:focus-visible {
    transform: scale(1.12);
    filter: drop-shadow(0 4px 10px rgba(37, 211, 102, 0.55));
}

.pww-btn:active {
    transform: scale(0.96);
}

.pww-btn:disabled,
.pww-btn.pww-btn-disabled {
    cursor: not-allowed;
    opacity: 0.55;
    transform: none;
    filter: none;
}

.pww-status-msg {
    margin: 10px 0 0;
    font-size: 0.92rem;
    line-height: 1.4;
    color: #9f2f2f;
    max-width: 320px;
}

/* --- Icono responsive --- */
.pww-icon {
    display: block;
    /* max-width garantiza que el icono nunca desborde su contenedor */
    max-width: 100%;
    height: auto;
    /* Suaviza la escala en pantallas pequeñas */
    object-fit: contain;
}

/* Responsive: en móviles muy pequeños el icono se reduce
   automáticamente al 80% del viewport si supera ese ancho */
@media (max-width: 480px) {
    .pww-icon {
        max-width: min(var(--pww-icon-width, 64px), 20vw);
    }
}

/* =============================================================
   MODAL DE ERROR
   ============================================================= */

.pww-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    /* La animación de entrada */
    animation: pwwFadeIn 0.25s ease forwards;
    padding: 16px;
    box-sizing: border-box;
}

/* Ocultar con [hidden] pero mantener la animación al mostrar */
.pww-modal-overlay[hidden] {
    display: none;
}

@keyframes pwwFadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.pww-modal {
    background: #ffffff;
    border-radius: 12px;
    padding: 32px 28px 24px;
    max-width: 420px;
    width: 100%;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.22);
    text-align: center;
    animation: pwwSlideUp 0.28s ease forwards;
    box-sizing: border-box;
}

@keyframes pwwSlideUp {
    from { transform: translateY(30px); opacity: 0; }
    to   { transform: translateY(0);    opacity: 1; }
}

.pww-modal-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0 0 14px;
    line-height: 1.3;
}

.pww-modal-msg {
    font-size: 0.97rem;
    color: #444444;
    line-height: 1.6;
    margin: 0 0 24px;
}

.pww-modal-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}

.pww-modal-close {
    display: inline-block;
    background: #f4f4f4;
    color: #222222;
    border: 1px solid #d7d7d7;
    border-radius: 8px;
    padding: 10px 28px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.15s ease, border-color 0.2s ease;
    letter-spacing: 0.02em;
}

.pww-modal-close:hover,
.pww-modal-close:focus-visible {
    background: #ececec;
    border-color: #bfbfbf;
    transform: translateY(-1px);
}

.pww-modal-close:active {
    transform: translateY(0);
}

.pww-modal-web {
    display: inline-block;
    background: #25d366;
    color: #ffffff;
    border: 1px solid #25d366;
    border-radius: 8px;
    padding: 10px 28px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.15s ease, border-color 0.2s ease;
    letter-spacing: 0.02em;
}

.pww-modal-web:hover,
.pww-modal-web:focus-visible {
    background: #1da851;
    border-color: #1da851;
    transform: translateY(-1px);
}

.pww-modal-web:active {
    transform: translateY(0);
}

/* Responsive modal en pantallas muy pequeñas */
@media (max-width: 480px) {
    .pww-modal {
        padding: 24px 18px 20px;
    }

    .pww-modal-title {
        font-size: 1.1rem;
    }

    .pww-modal-msg {
        font-size: 0.9rem;
    }

    .pww-modal-actions {
        flex-direction: column;
    }

    .pww-modal-close,
    .pww-modal-web {
        width: 100%;
        padding: 12px;
    }
}
