/*
 * assets/modal.css
 * Simple Options — Modale annonce front-end
 * ─────────────────────────────────────────
 * Pas de font imposée : hérite du thème.
 * Transition : cubic-bezier(0,1,0,1) → 1,0,0,1
 */

/* ── Base ── */
.so-modal {
    position: fixed;
    bottom: 24px;
    left: 24px;
    z-index: 99999;

    width: 320px;
    max-width: calc(100vw - 32px);

    background: #fff;
    border-radius: 8px;
    box-shadow:
        0 4px 6px -1px rgba(0, 0, 0, .08),
        0 10px 30px -4px rgba(0, 0, 0, .14);
    overflow: hidden;

    /* État initial masqué */
    opacity: 0;
    transform: translateY(12px);
    pointer-events: none;

    transition:
        opacity   .35s cubic-bezier(1, 0, 0, 1),
        transform .35s cubic-bezier(1, 0, 0, 1);
}

/* ── Visible ── */
.so-modal.is-visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

/* ── Image ── */
.so-modal__image {
    display: block;
    width: 100%;
    height: 160px;
    object-fit: cover;
    border-radius: 0;
}

/* ── Corps ── */
.so-modal__body {
    padding: 18px 20px 20px;
}

.so-modal__title {
    margin: 0 0 8px;
    font-size: 15px;
    font-weight: 700;
    line-height: 1.3;
    color: inherit;
    padding-right: 24px; /* espace bouton fermer */
}

.so-modal__message {
    margin: 0;
    font-size: 13px;
    line-height: 1.6;
    color: inherit;
    opacity: .8;
}

.so-modal__message a {
    color: inherit;
    text-decoration: underline;
}

/* ── Bouton fermer ── */
.so-modal__close {
    position: absolute;
    top: 12px;
    right: 12px;

    display: flex;
    align-items: center;
    justify-content: center;

    width: 28px;
    height: 28px;
    padding: 0;
    margin: 0;

    background: rgba(0, 0, 0, .06);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    color: inherit;

    transition: background .2s cubic-bezier(1, 0, 0, 1);
    line-height: 1;
}

.so-modal__close:hover {
    background: rgba(0, 0, 0, .13);
}

.so-modal__close svg {
    display: block;
    pointer-events: none;
}

/* ── Sans image : le bouton fermer reste visible ── */
.so-modal:not(:has(.so-modal__image)) .so-modal__close {
    top: 14px;
    right: 14px;
}

/* ── Mobile ── */
@media (max-width: 480px) {
    .so-modal {
        bottom: 16px;
        left: 16px;
        right: 16px;
        width: auto;
        max-width: none;
    }

    .so-modal__image {
        height: 140px;
    }

    .so-modal__body {
        padding: 14px 16px 18px;
    }

    .so-modal__title {
        font-size: 14px;
    }

    .so-modal__message {
        font-size: 13px;
    }
}
