/* =========================================================
   POPUP PROMOZIONALE FANTOZZI
   Da appendere in fondo a: theme/css/template.css
   (oppure creare theme/css/popup.css e caricarlo in meta.php)
   ========================================================= */

/* --- Overlay --- */
.fpopup-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.65);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    opacity: 0;
    animation: fpopup-fadein 0.35s ease forwards;
    animation-delay: 1.5s; /* appare dopo 1,5s dal caricamento pagina */
}

@keyframes fpopup-fadein {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* --- Box centrale --- */
.fpopup-box {
    position: relative;
    background: #fff;
    border-radius: 16px;
    overflow: hidden;
    width: 100%;
    max-width: 480px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
    transform: translateY(30px);
    animation: fpopup-slidein 0.35s ease forwards;
    animation-delay: 1.5s;
}

@keyframes fpopup-slidein {
    from { transform: translateY(30px); }
    to   { transform: translateY(0);    }
}

/* --- Tasto chiudi moderno --- */
.fpopup-close {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(4px);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    padding: 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.18);
    transition: background 0.2s, transform 0.2s;
}

.fpopup-close:hover {
    background: #fff;
    transform: scale(1.1);
}

.fpopup-close svg {
    width: 18px;
    height: 18px;
    color: #333;
}

/* --- Immagine --- */
.fpopup-img-wrap {
    width: 100%;
    line-height: 0;
}

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

/* --- Area bottoni --- */
.fpopup-actions {
    display: flex;
    gap: 10px;
    padding: 16px 20px 20px;
    background: #fff;
}

/* --- Bottoni (stesso stile del sito: border-radius 40px, uppercase, bold) --- */
.fpopup-btn {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 13px 18px;
    border-radius: 40px;
    font-weight: 700;
    font-size: 0.88rem;
    text-transform: uppercase;
    text-decoration: none;
    line-height: 1;
    cursor: pointer;
    transition: background 0.25s, transform 0.15s;
    border: 2px solid transparent;
    letter-spacing: 0.03em;
}

.fpopup-btn svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

/* WhatsApp */
.fpopup-btn--whatsapp {
    background: #25D366;
    color: #fff;
    border-color: #25D366;
}
.fpopup-btn--whatsapp:hover {
    background: #1ebe5b;
    border-color: #1ebe5b;
    transform: translateY(-1px);
    color: #fff;
}

/* Chiama */
.fpopup-btn--phone {
    background: #009DE0;      /* --main-color del sito */
    color: #fff;
    border-color: #009DE0;
}
.fpopup-btn--phone:hover {
    background: #0087c0;
    border-color: #0087c0;
    transform: translateY(-1px);
    color: #fff;
}

/* --- Nasconde overlay quando ha classe 'hidden' --- */
.fpopup-overlay.fpopup-hidden {
    display: none !important;
}

/* --- Mobile --- */
@media (max-width: 520px) {
    .fpopup-box {
        max-width: 100%;
        border-radius: 12px;
    }

    .fpopup-actions {
        flex-direction: column;
        padding: 12px 14px 16px;
    }

    .fpopup-btn {
        font-size: 0.95rem;
        padding: 14px 16px;
    }
}
