/* ─── Overlay ─────────────────────────────────────────────────────────────── */

.np-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 999999;
    align-items: center;
    justify-content: center;
    padding: 16px;
    box-sizing: border-box;
}

.np-overlay.np-active {
    display: flex;
}

/* ─── Popup ───────────────────────────────────────────────────────────────── */

.np-popup {
    background: #fff;
    max-width: 720px;
    width: 100%;
    max-height: 90vh;
    display: flex;
    border-radius: 4px;
    overflow: hidden;
    position: relative;
    animation: np-appear 0.3s ease;
}

@keyframes np-appear {
    from { opacity: 0; transform: scale(0.95); }
    to   { opacity: 1; transform: scale(1); }
}

/* ─── Imagen lateral ──────────────────────────────────────────────────────── */

.np-popup-image {
    width: 44%;
    flex-shrink: 0;
    background-size: cover;
    background-position: center;
}

/* ─── Contenido ──────────────────────────────────────────────────────────── */

.np-popup-content {
    flex: 1;
    padding: 44px 36px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
    overflow-y: auto;
}

/* ─── Botón cerrar ────────────────────────────────────────────────────────── */

.np-close {
    position: absolute;
    top: 14px;
    right: 14px;
    background: none;
    border: none;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    color: #555;
    padding: 4px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.15s;
}

.np-close:hover {
    background: #f0f0f0;
    color: #000;
}

/* ─── Texto ───────────────────────────────────────────────────────────────── */

.np-title {
    font-size: 26px;
    font-weight: 700;
    line-height: 1.2;
    margin: 0 0 14px;
    color: #111;
}

.np-subtitle {
    font-size: 14px;
    line-height: 1.6;
    color: #555;
    margin: 0 0 28px;
}

/* ─── Formulario CF7 dentro del popup ────────────────────────────────────── */

.np-form .wpcf7 {
    margin: 0;
}

.np-form .wpcf7-form p {
    margin: 0 0 12px;
}

.np-form .wpcf7-form input[type="email"],
.np-form .wpcf7-form input[type="text"] {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
    box-sizing: border-box;
    outline: none;
    transition: border-color 0.2s;
}

.np-form .wpcf7-form input[type="email"]:focus,
.np-form .wpcf7-form input[type="text"]:focus {
    border-color: #111;
}

.np-form .wpcf7-form input[type="submit"] {
    width: 100%;
    padding: 13px;
    background: #111;
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    letter-spacing: 0.02em;
}

.np-form .wpcf7-form input[type="submit"]:hover {
    background: #333;
}

/* Acceptance (consentimiento) de CF7 dentro del popup */
.np-form .wpcf7-form .wpcf7-acceptance {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    margin: 0 0 14px;
}

.np-form .wpcf7-form .wpcf7-acceptance input[type="checkbox"] {
    flex-shrink: 0;
    width: 15px;
    height: 15px;
    margin-top: 2px;
    accent-color: #111;
    cursor: pointer;
}

.np-form .wpcf7-form .wpcf7-acceptance .wpcf7-list-item-label,
.np-form .wpcf7-form .wpcf7-acceptance label {
    font-size: 12px;
    color: #555;
    line-height: 1.5;
    cursor: pointer;
}

.np-form .wpcf7-form .wpcf7-acceptance .wpcf7-list-item-label a,
.np-form .wpcf7-form .wpcf7-acceptance label a {
    color: #111;
    text-decoration: underline;
}

.np-form .wpcf7-response-output {
    margin: 10px 0 0;
    padding: 8px 12px;
    font-size: 13px;
    border-radius: 4px;
}

/* Ocultar spinner de CF7 (se maneja el overlay completo) */
.np-form .wpcf7-spinner {
    display: none !important;
}

/* ─── Banner superior ─────────────────────────────────────────────────────────── */

.np-banner {
    position: fixed;
    top: 95px;
    left: 0;
    width: 100%;
    z-index: 6;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px 48px;
    box-sizing: border-box;
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 0.03em;
    cursor: pointer;
    transition: transform 0.3s ease, opacity 0.3s ease;
    text-align: center;
    line-height: 1.4;
}

.np-banner.np-banner-hidden {
    transform: translateY(-100%);
    opacity: 0;
    pointer-events: none;
}

.np-banner.np-banner-closed {
    display: none !important;
}

/* ─── Compensación barra admin WordPress ─────────────────────────────────── */

.admin-bar .np-banner {
    top: 128px;
}

@media screen and (max-width: 782px) {
    .admin-bar .np-banner {
        top: 80px;
    }
    .np-banner {
        top: 80px;
    }
}

.np-banner-text {
    flex: 1;
    pointer-events: none;
}

.np-banner-close {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    color: inherit;
    opacity: 0.75;
    padding: 4px 6px;
    transition: opacity 0.15s;
}

.np-banner-close:hover {
    opacity: 1;
}
/* ─── Ticker banner (solo móvil) ──────────────────────────────────────────── */

/* Ticker seamless: anima el wrapper (que mide 2× el texto) al -50% de su ancho.
   Cuando llega al -50% vuelve al 0% sin salto visible porque la segunda copia
   ocupa exactamente el mismo espacio que la primera. */
@keyframes np-ticker {
    from { transform: translateX(0); }
    to   { transform: translateX(-50%); }
}

/* ─── Responsive ──────────────────────────────────────────────────────────── */

@media (max-width: 580px) {
    .np-popup {
        flex-direction: column;
        max-height: 95vh;
    }

    .np-popup-image {
        width: 100%;
        height: 180px;
    }

    .np-popup-content {
        padding: 28px 22px;
    }

    .np-title {
        font-size: 20px;
    }

    /* Banner ticker en móvil */
    .np-banner {
        overflow: hidden;
        padding: 10px 14px;
        justify-content: flex-start;
    }

    .np-banner-close {
        display: none; /* solo se quita al suscribirse */
    }

    /* Wrapper que contiene dos copias del texto lado a lado */
    .np-banner-ticker {
        display: flex;
        width: max-content;
        animation: np-ticker 16s linear infinite;
    }

    /* Cada copia del texto con un hueco a la derecha (separa las dos copias) */
    .np-banner-ticker .np-banner-text {
        white-space: nowrap;
        flex: none;
        padding-right: 80px; /* hueco entre repetición y repetición */
    }
}
