/* --- CONTAINER PRINCIPALE --- */
.custom-popup {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    padding: 16px;
    opacity: 0;
    visibility: hidden;
    transition: opacity .3s ease, visibility .3s ease;
}

/* --- OVERLAY --- */
.custom-popup__overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 0;
    backdrop-filter: blur(2px);
}

/* --- CONTENUTO (IL BOX BIANCO) --- */
.custom-popup__content {
    position: relative;
    z-index: 1;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    width: 100%;
    overflow-y: auto;
    transform: translateY(100px);
    transition-delay: 300ms;
    transition: transform 0.3s ease-in, opacity 0.3s ease-in;
}

/* --- STATO ATTIVO (ENTRATA) --- */
.custom-popup.is-visible {
    opacity: 1;
    visibility: visible;
}

.custom-popup.is-visible .custom-popup__content {
    transform: translateY(0);
}

/* --- CLOSE BUTTON --- */
.custom-popup__close {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    cursor: pointer;
    color: #333;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 50%;
    transition: background 0.2s;
    z-index: 10;
}

.custom-popup__close:hover {
    background-color: rgba(0, 0, 0, 0.05);
    color: #000;
}

.custom-popup__close i {
    font-style: normal;
}

/* --- POSIZIONAMENTI FLEXBOX --- */
.custom-popup[data-position="top-left"] { justify-content: flex-start; align-items: flex-start; }
.custom-popup[data-position="top-center"] { justify-content: center; align-items: flex-start; }
.custom-popup[data-position="top-right"] { justify-content: flex-end; align-items: flex-start; }

.custom-popup[data-position="center-left"] { justify-content: flex-start; align-items: center; }
.custom-popup[data-position="center"] { justify-content: center; align-items: center; }
.custom-popup[data-position="center-right"] { justify-content: flex-end; align-items: center; }

.custom-popup[data-position="bottom-left"] { justify-content: flex-start; align-items: flex-end; }
.custom-popup[data-position="bottom-center"] { justify-content: center; align-items: flex-end; }
.custom-popup[data-position="bottom-right"] { justify-content: flex-end; align-items: flex-end; }