/* ============================================================
   PopupAdv — Feuille de style
   ============================================================ */

/* Overlay / fond semi-transparent */
.popupadv-overlay {
    position: fixed;
    inset: 0;
    top: 0; right: 0; bottom: 0; left: 0; /* fallback si inset non supporté */
    z-index: 99999;
    background: rgba(0, 0, 0, 0.55);
    /* PAS de display ici — géré uniquement par le JS */
    align-items: center;
    justify-content: center;
    padding: 16px;
    box-sizing: border-box;
}

/* Classe active ajoutée par JS */
.popupadv-overlay.is-visible {
    display: flex;
    animation: popupadv-fadein 0.35s ease forwards;
}

/* Classe de fermeture ajoutée par JS */
.popupadv-overlay.is-closing {
    display: flex;
    animation: popupadv-fadeout 0.25s ease forwards;
}

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

@keyframes popupadv-fadeout {
    from { opacity: 1; }
    to   { opacity: 0; }
}

/* Boîte principale */
.popupadv-box {
    position: relative;
    width: 100%;
    max-width: 520px;
    border-radius: 12px;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.35);
    overflow: hidden;
    animation: popupadv-slidein 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
    box-sizing: border-box;
}

@keyframes popupadv-slidein {
    from { transform: translateY(40px) scale(0.95); opacity: 0; }
    to   { transform: translateY(0)    scale(1);    opacity: 1; }
}

/* Zone image */
.popupadv-img-wrap {
    width: 100%;
    line-height: 0;   /* supprime l'espace sous l'image inline */
}

.popupadv-img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
    max-height: 480px;
}

/* Barre des boutons */
.popupadv-actions {
    display: flex;
    gap: 10px;
    padding: 16px 20px;
    justify-content: flex-end;
    flex-wrap: wrap;
}

/* Boutons — couleur principale du thème PrestaShop */
.popupadv-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 22px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.3px;
    color: #fff;
    background-color: var(--theme-color-default, #2563eb);
    cursor: pointer;
    transition: filter 0.2s ease, transform 0.15s ease;
    white-space: nowrap;
    flex: 1 1 auto;
    min-width: 120px;
}

.popupadv-btn:hover {
    filter: brightness(1.12);
    transform: translateY(-1px);
}

.popupadv-btn:active {
    filter: brightness(0.92);
    transform: translateY(0);
}

/* Bouton "Ne plus afficher" légèrement transparent */
.popupadv-btn-never {
    opacity: 0.85;
}

/* ── Subscribe ──────────────────────────────── */
.popupadv-subscribe {
    padding: 18px 20px 0;
    text-align: center;
}

.popupadv-subscribe-title {
    font-size: 15px;
    font-weight: 700;
    margin: 0 0 10px;
}

.popupadv-subscribe-row {
    display: flex;
    gap: 8px;
    align-items: center;
}

.popupadv-subscribe-input {
    flex: 1;
    padding: 10px 14px;
    border: 1.5px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
    min-width: 0;
    box-sizing: border-box;
}

.popupadv-subscribe-input:focus {
    border-color: var(--theme-color-default, #2563eb);
}

.popupadv-subscribe-btn {
    padding: 10px 18px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    background-color: var(--theme-color-default, #2563eb);
    cursor: pointer;
    white-space: nowrap;
    transition: filter 0.2s, transform 0.15s;
}

.popupadv-subscribe-btn:hover {
    filter: brightness(1.12);
    transform: translateY(-1px);
}

.popupadv-subscribe-msg {
    font-size: 13px;
    margin-top: 8px;
    min-height: 18px;
}

.popupadv-subscribe-msg.success { color: #16a34a; }
.popupadv-subscribe-msg.error   { color: #dc2626; }

/* ── Responsive ─────────────────────────────── */
@media (max-width: 480px) {
    .popupadv-box {
        border-radius: 8px;
    }
    .popupadv-actions {
        flex-direction: column;
        padding: 12px 16px;
    }
    .popupadv-btn {
        width: 100%;
    }
    .popupadv-subscribe-row {
        flex-direction: column;
    }
    .popupadv-subscribe-btn {
        width: 100%;
    }
}
