/* ==========================================================================
   WESTORX Newsletter — footer signup + exit-intent popup
   ========================================================================== */

/* ── FOOTER SIGNUP ──────────────────────────────────────────────────────── */
.wstx-newsletter-footer {
    background: #0f0f0f;
    color: var(--color-white);
    padding: 48px 24px;
    margin-bottom: 0;
    border-bottom: 1px solid #1f1f1f;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 48px;
    align-items: center;
    max-width: var(--max-width);
    margin-left: auto;
    margin-right: auto;
}

.wstx-newsletter-text {
    text-align: left;
}

.wstx-newsletter-eyebrow {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.25em;
    text-transform: uppercase;
    color: var(--color-accent);
    margin: 0 0 8px 0;
}

.wstx-newsletter-title {
    font-family: var(--font-secondary);
    font-size: clamp(1.6rem, 2.6vw, 2.2rem);
    font-weight: 500;
    margin: 0 0 6px 0;
    line-height: 1.15;
    letter-spacing: 0.01em;
    color: var(--color-white);
}

.wstx-newsletter-sub {
    font-size: 0.9rem;
    color: #999;
    line-height: 1.6;
    margin: 0;
    max-width: 360px;
}

/* Form */
.wstx-newsletter-form {
    width: 100%;
    max-width: 480px;
    margin: 0;
}

.wstx-newsletter-input-wrap {
    display: flex;
    align-items: stretch;
    background: var(--color-white);
    transition: opacity .25s ease;
}

.wstx-newsletter-form.is-loading .wstx-newsletter-input-wrap {
    opacity: 0.55;
    pointer-events: none;
}

.wstx-newsletter-input-wrap input {
    flex: 1;
    border: none;
    padding: 16px 18px;
    font-family: var(--font-primary);
    font-size: 0.92rem;
    color: var(--color-black);
    background: transparent;
    -webkit-appearance: none;
    border-radius: 0;
    min-width: 0;
}
.wstx-newsletter-input-wrap input:focus {
    outline: none;
}
.wstx-newsletter-input-wrap input::placeholder {
    color: var(--color-gray-3);
}

.wstx-newsletter-input-wrap button {
    background: var(--color-black);
    color: var(--color-white);
    border: none;
    padding: 0 24px;
    font-family: var(--font-primary);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: background .25s ease;
    flex-shrink: 0;
}
.wstx-newsletter-input-wrap button:hover {
    background: var(--color-accent);
}

.wstx-newsletter-disclaimer {
    font-size: 0.7rem;
    color: #777;
    margin: 12px 0 0 0;
    line-height: 1.5;
}
.wstx-newsletter-disclaimer a {
    color: #aaa;
    border-bottom: 1px solid #444;
    text-decoration: none;
}
.wstx-newsletter-disclaimer a:hover { color: var(--color-accent); border-color: var(--color-accent); }

/* Success state — replaces the input with a checkmark message */
.wstx-newsletter-form.is-success .wstx-newsletter-input-wrap {
    background: rgba(255,255,255,0.06);
    border: 1px solid var(--color-accent);
}
.wstx-newsletter-success-msg {
    display: none;
    padding: 16px 18px;
    color: var(--color-accent);
    font-size: 0.9rem;
    font-weight: 600;
    align-items: center;
    gap: 10px;
}
.wstx-newsletter-form.is-success .wstx-newsletter-input-wrap > * { display: none; }
.wstx-newsletter-form.is-success .wstx-newsletter-success-msg { display: flex; }
.wstx-newsletter-success-msg svg { flex-shrink: 0; }

.wstx-newsletter-error-msg {
    display: none;
    color: #ff6b6b;
    font-size: 0.85rem;
    margin: 10px 0 0 0;
}
.wstx-newsletter-form.is-error .wstx-newsletter-error-msg { display: block; }

/* ── EXIT-INTENT POPUP ──────────────────────────────────────────────────── */
.wstx-exit-popup {
    position: fixed;
    inset: 0;
    z-index: 10050;
    visibility: hidden;
    opacity: 0;
    transition: opacity .35s ease, visibility .35s ease;
}
.wstx-exit-popup.open {
    visibility: visible;
    opacity: 1;
}

.wstx-exit-popup-overlay {
    position: absolute;
    inset: 0;
    background: rgba(10, 10, 10, 0.75);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.wstx-exit-popup-inner {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -45%) scale(0.96);
    width: 92%;
    max-width: 520px;
    background: var(--color-white);
    padding: 56px 44px 40px;
    text-align: center;
    transition: transform .4s cubic-bezier(.2,.7,.3,1);
    box-shadow: 0 40px 80px rgba(0, 0, 0, 0.35);
}
.wstx-exit-popup.open .wstx-exit-popup-inner {
    transform: translate(-50%, -50%) scale(1);
}

.wstx-exit-popup-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 36px;
    height: 36px;
    background: transparent;
    border: 1px solid var(--color-gray-2);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--color-black);
    transition: background .25s ease, color .25s ease, border-color .25s ease;
    border-radius: 50%;
}
.wstx-exit-popup-close:hover {
    background: var(--color-black);
    color: var(--color-white);
    border-color: var(--color-black);
}

.wstx-exit-popup-eyebrow {
    font-size: 0.66rem;
    font-weight: 700;
    letter-spacing: 0.28em;
    text-transform: uppercase;
    color: var(--color-accent);
    margin: 0 0 10px 0;
}

.wstx-exit-popup-title {
    font-family: var(--font-secondary);
    font-size: clamp(2rem, 4vw, 2.8rem);
    font-weight: 500;
    color: var(--color-black);
    margin: 0 0 16px 0;
    line-height: 1.1;
    letter-spacing: 0.01em;
}

.wstx-exit-popup-sub {
    font-size: 0.95rem;
    color: var(--color-gray-3);
    margin: 0 auto 24px;
    max-width: 360px;
    line-height: 1.6;
}

.wstx-exit-popup-form .wstx-newsletter-input-wrap {
    background: var(--color-gray-1);
    border: 1px solid var(--color-gray-2);
    margin-bottom: 14px;
}
.wstx-exit-popup-form .wstx-newsletter-input-wrap input {
    background: transparent;
}

.wstx-exit-popup-decline {
    background: transparent;
    border: none;
    cursor: pointer;
    font-family: var(--font-primary);
    font-size: 0.75rem;
    color: var(--color-gray-3);
    text-decoration: underline;
    text-underline-offset: 4px;
    padding: 8px 0;
    transition: color .25s ease;
}
.wstx-exit-popup-decline:hover {
    color: var(--color-black);
}

/* Lock body scroll when open */
body.wstx-exit-open {
    overflow: hidden;
}

/* ── MOBILE ─────────────────────────────────────────────────────────────── */
@media (max-width: 767px) {
    .wstx-newsletter-footer {
        grid-template-columns: 1fr;
        gap: 24px;
        padding: 36px 20px;
        text-align: center;
    }
    .wstx-newsletter-text {
        text-align: center;
    }
    .wstx-newsletter-sub {
        margin-left: auto;
        margin-right: auto;
    }
    .wstx-newsletter-input-wrap button span {
        display: none;
    }
    .wstx-newsletter-input-wrap button {
        padding: 0 18px;
    }

    .wstx-exit-popup-inner {
        padding: 50px 24px 28px;
        max-width: 94%;
    }
    .wstx-exit-popup-title {
        font-size: 1.7rem;
    }
}
