/* ══════════════════════════════════════════════════════════════
   STACCIOLLA — Conversion Layer
   Welcome popup · Exit-intent popup · Back to top
   Loaded globally. All values use --fe-* tokens.
   ══════════════════════════════════════════════════════════════ */


/* ─────────────────────────────────────────────────────────────
   Popup base — shared by both popup variants
   ───────────────────────────────────────────────────────────── */

.fe-popup {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 10000;
    align-items: center;
    justify-content: center;
}

.fe-popup.is-open {
    display: flex;
}

.fe-popup__overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    cursor: pointer;
}

/* ── Popup box ─────────────────────────────────────────────── */

.fe-popup__box {
    position: relative;
    z-index: 1;
    background: var(--fe-white);
    display: grid;
    grid-template-columns: 1fr 280px;
    max-width: 720px;
    width: 90%;
    max-height: 90vh;
    overflow: hidden;
    border-radius: 0;
}

.fe-popup__box--dark {
    background: var(--fe-black);
    grid-template-columns: 1fr;
    max-width: 480px;
}

/* ── Content column ────────────────────────────────────────── */

.fe-popup__content {
    padding: 3rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    justify-content: center;
    min-width: 0; /* prevent grid blowout */
}

/* ── Visual column (product image) ────────────────────────── */

.fe-popup__visual {
    overflow: hidden;
}

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

/* ── Close button ──────────────────────────────────────────── */

.fe-popup__close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    font-size: 22px;
    color: var(--fe-warm-gray, #888);
    cursor: pointer;
    z-index: 2;
    line-height: 1;
    padding: 0.25rem 0.5rem;
    transition: color 0.2s ease;
}

.fe-popup__close:hover {
    color: var(--fe-black);
}

/* ── Typography ────────────────────────────────────────────── */

.fe-popup__eyebrow {
    font-family: var(--fe-font-body), sans-serif;
    font-size: 9px;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    color: var(--fe-gold);
    margin: 0;
    font-weight: 500;
}

.fe-popup__title {
    font-family: var(--fe-font-display, var(--fe-font-serif)), serif;
    font-size: clamp(22px, 3vw, 30px);
    font-weight: 300;
    color: var(--fe-black);
    margin: 0;
    line-height: 1.2;
}

.fe-popup__desc {
    font-family: var(--fe-font-body), sans-serif;
    font-size: 13px;
    color: var(--fe-warm-gray, #888);
    line-height: 1.65;
    margin: 0;
}

/* ── Form ──────────────────────────────────────────────────── */

.fe-popup__form {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.fe-popup__input {
    background: var(--fe-cream, #f5f0e8);
    border: 1px solid var(--fe-border);
    padding: 0.875rem 1rem;
    font-family: var(--fe-font-body), sans-serif;
    font-size: 14px;
    outline: none;
    border-radius: 0;
    color: var(--fe-black);
    width: 100%;
    box-sizing: border-box;
}

.fe-popup__input:focus {
    border-color: var(--fe-black);
}

.fe-popup__input--dark {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
    color: var(--fe-white);
}

.fe-popup__input--dark::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

.fe-popup__input--dark:focus {
    border-color: rgba(255, 255, 255, 0.6);
}

/* ── Buttons ───────────────────────────────────────────────── */

.fe-popup__btn {
    background: var(--fe-black);
    color: var(--fe-white);
    border: 1px solid var(--fe-black);
    padding: 0.875rem;
    font-family: var(--fe-font-body), sans-serif;
    font-size: 10px;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
    border-radius: 0;
    width: 100%;
}

.fe-popup__btn:hover {
    background: transparent;
    color: var(--fe-black);
}

.fe-popup__btn--gold {
    background: var(--fe-gold);
    color: var(--fe-white);
    border-color: var(--fe-gold);
}

.fe-popup__btn--gold:hover {
    background: transparent;
    color: var(--fe-gold);
}

.fe-popup__btn:disabled {
    opacity: 0.6;
    cursor: default;
}

/* ── Success message ───────────────────────────────────────── */

.fe-popup__success {
    font-family: var(--fe-font-display, var(--fe-font-serif)), serif;
    font-size: 15px;
    font-style: italic;
    color: var(--fe-black);
    margin: 0;
    line-height: 1.5;
}

.fe-popup__success--dark {
    color: var(--fe-white);
}

/* ── Legal footnote ────────────────────────────────────────── */

.fe-popup__legal {
    font-family: var(--fe-font-body), sans-serif;
    font-size: 10px;
    color: var(--fe-warm-gray, #888);
    margin: 0;
    line-height: 1.5;
}

/* ── Responsive ────────────────────────────────────────────── */

@media (max-width: 600px) {
    .fe-popup__box {
        grid-template-columns: 1fr;
        max-height: 85vh;
        overflow-y: auto;
    }

    .fe-popup__visual {
        display: none;
    }

    .fe-popup__content {
        padding: 2rem;
    }
}


/* ─────────────────────────────────────────────────────────────
   Back to top button
   ───────────────────────────────────────────────────────────── */

.fe-back-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 44px;
    height: 44px;
    background: var(--fe-black);
    color: var(--fe-white);
    border: none;
    border-radius: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease, background 0.2s ease;
    z-index: 900;
    padding: 0;
    flex-shrink: 0;
}

.fe-back-top.is-visible {
    opacity: 1;
    visibility: visible;
}

.fe-back-top:hover {
    background: var(--fe-gold);
}

.fe-back-top svg {
    display: block;
    flex-shrink: 0;
}
