/* ============================================================
   WP Popup Shortcode – Estilos
   ============================================================ */

/* ── Overlay ── */
.wppopup-overlay {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(3px);

    /* Estado oculto */
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s ease;
}

.wppopup-overlay[hidden] {
    display: flex;   /* Sobreescribimos el display:none nativo para animar */
}

.wppopup-overlay.is-open {
    opacity: 1;
    visibility: visible;
}

/* ── Diálogo ── */
.wppopup-dialog {
    position: relative;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.22);

    transform: translateY(18px) scale(0.97);
    transition: transform 0.28s cubic-bezier(0.34, 1.36, 0.64, 1);
}

.wppopup-overlay.is-open .wppopup-dialog {
    transform: translateY(0) scale(1);
}

/* ── Imagen ── */
.wppopup-image {
    width: 100%;
    max-height: 280px;
    overflow: hidden;
    border-radius: 12px 12px 0 0;
}

.wppopup-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* ── Cuerpo ── */
.wppopup-body {
    padding: 1.75rem 2rem 2rem;
}

.wppopup-title {
    margin: 0 0 0.75rem;
    font-size: 1.35rem;
    font-weight: 700;
    line-height: 1.3;
    color: #111827;
}

.wppopup-content {
    font-size: 1rem;
    line-height: 1.7;
    color: #374151;
}

.wppopup-content p:last-child {
    margin-bottom: 0;
}

/* ── Botón de cierre ── */
.wppopup-close {
    position: absolute;
    top: 0.75rem;
    right: 0.85rem;
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.07);
    color: #374151;
    font-size: 1.3rem;
    line-height: 1;
    cursor: pointer;
    transition: background 0.18s ease;
    z-index: 1;
}

.wppopup-close:hover,
.wppopup-close:focus-visible {
    background: rgba(0, 0, 0, 0.15);
    outline: 2px solid #6366f1;
    outline-offset: 2px;
}

/* ── Botón disparador (generado por shortcode) ── */
.wppopup-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.65em 1.4em;
    background: #6366f1;
    color: #ffffff;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.15s ease;
    text-decoration: none;
}

.wppopup-btn:hover,
.wppopup-btn:focus-visible {
    background: #4f46e5;
    transform: translateY(-1px);
    outline: 2px solid #6366f1;
    outline-offset: 3px;
}

/* ── Error de configuración ── */
.wppopup-error {
    color: #dc2626;
    font-size: 0.875rem;
    border: 1px solid #fca5a5;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    background: #fef2f2;
}

/* ── Responsivo ── */
@media (max-width: 480px) {
    .wppopup-body {
        padding: 1.25rem 1.25rem 1.5rem;
    }
    .wppopup-title {
        font-size: 1.15rem;
    }
}

/* ── Respeta preferencias de movimiento reducido ── */
@media (prefers-reduced-motion: reduce) {
    .wppopup-overlay,
    .wppopup-dialog {
        transition: none;
    }
}
