/* ==========================================================
   DELIOX SHARED POPUP MODAL — v2.2.0
   Used by both Deliox Slider and Deliox Post Grid widgets.
========================================================== */

.dlx-popup-trigger { cursor: pointer; }

.dlx-modal {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
    opacity: 0;
    transition: opacity .3s ease;
}
.dlx-modal.dlx-modal-open { opacity: 1; }

.dlx-modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.dlx-modal-content {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 640px;
    max-height: 90vh;
    overflow-y: auto;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 24px 80px rgba(0,0,0,0.3), 0 0 0 1px rgba(0,0,0,0.05);
}

/* ── Open animations ─────────────────────────────────── */
.dlx-modal.anim-scale .dlx-modal-content {
    transform: scale(0.92) translateY(20px);
    transition: transform .35s cubic-bezier(0.34,1.56,0.64,1);
}
.dlx-modal.anim-scale.dlx-modal-open .dlx-modal-content { transform: scale(1) translateY(0); }

.dlx-modal.anim-fade .dlx-modal-content {
    transform: none;
    transition: opacity .3s ease;
    opacity: 0;
}
.dlx-modal.anim-fade.dlx-modal-open .dlx-modal-content { opacity: 1; }

.dlx-modal.anim-slide .dlx-modal-content {
    transform: translateY(60px);
    transition: transform .35s cubic-bezier(0.16,1,0.3,1);
}
.dlx-modal.anim-slide.dlx-modal-open .dlx-modal-content { transform: translateY(0); }

.dlx-modal.anim-zoom .dlx-modal-content {
    transform: scale(0.7);
    transition: transform .3s cubic-bezier(0.34,1.56,0.64,1);
}
.dlx-modal.anim-zoom.dlx-modal-open .dlx-modal-content { transform: scale(1); }

.dlx-modal.anim-flip .dlx-modal-content {
    transform: perspective(800px) rotateX(-15deg) scale(0.9);
    transform-origin: center top;
    transition: transform .4s cubic-bezier(0.34,1.56,0.64,1);
}
.dlx-modal.anim-flip.dlx-modal-open .dlx-modal-content { transform: perspective(800px) rotateX(0) scale(1); }

/* ── Close button styles ─────────────────────────────── */
.dlx-modal-close {
    position: absolute;
    top: 12px; right: 14px;
    width: 34px; height: 34px;
    display: flex; align-items: center; justify-content: center;
    background: rgba(0,0,0,0.06);
    border: 0 solid transparent;
    border-radius: 50%;
    color: #333; cursor: pointer;
    z-index: 10;
    padding: 0;
    transition: background .2s, color .2s, border-color .2s, transform .15s;
    outline: none !important;
}
.dlx-modal-close svg {
    width: 16px; height: 16px;
    display: block;
    transition: transform .2s ease;
}
.dlx-modal-close:hover { background: rgba(0,0,0,0.12); transform: scale(1.08); }
.dlx-modal-close:active { transform: scale(0.92); }
.dlx-modal-close:focus-visible { outline: 2px solid currentColor !important; outline-offset: 2px; }

/* Close: minimal — no background */
.dlx-modal.close-minimal .dlx-modal-close {
    background: transparent !important;
}
.dlx-modal.close-minimal .dlx-modal-close:hover { transform: scale(1.15); }
.dlx-modal.close-minimal .dlx-modal-close:hover svg { transform: rotate(90deg); }

/* Close: outside — sits above the card, top-right */
.dlx-modal.close-outside .dlx-modal-close {
    top: -16px; right: -16px;
    background: #fff;
    box-shadow: 0 4px 14px rgba(0,0,0,0.25);
}
.dlx-modal.close-outside .dlx-modal-close:hover { background: #fff; transform: scale(1.1); }
.dlx-modal.close-outside .dlx-modal-close:hover svg { transform: rotate(90deg); }

/* Close: square */
.dlx-modal.close-square .dlx-modal-close { border-radius: 6px; }

/* Close: glass — modern frosted pill */
.dlx-modal.close-glass .dlx-modal-close {
    background: rgba(255,255,255,0.55);
    backdrop-filter: blur(10px) saturate(1.4);
    -webkit-backdrop-filter: blur(10px) saturate(1.4);
    border: 1px solid rgba(255,255,255,0.65);
    box-shadow: 0 2px 12px rgba(0,0,0,0.14), inset 0 1px 0 rgba(255,255,255,0.5);
    color: #1a1a1a;
}
.dlx-modal.close-glass .dlx-modal-close:hover {
    background: rgba(255,255,255,0.8);
    transform: scale(1.08);
}
.dlx-modal.close-glass .dlx-modal-close:hover svg { transform: rotate(90deg); }

.dlx-modal-body { padding: 0; }
.dlx-modal-body > .elementor { padding: 0; }

/* Loading spinner */
.dlx-modal-loading {
    display: flex; align-items: center; justify-content: center;
    padding: 60px 20px;
}
.dlx-spinner {
    width: 32px; height: 32px;
    border: 3px solid rgba(0,0,0,0.1);
    border-top-color: #333;
    border-radius: 50%;
    animation: dlxSpin .6s linear infinite;
}
@keyframes dlxSpin { to { transform: rotate(360deg); } }

/* Scrollbar */
.dlx-modal-content::-webkit-scrollbar { width: 6px; }
.dlx-modal-content::-webkit-scrollbar-track { background: transparent; }
.dlx-modal-content::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.15); border-radius: 3px; }

/* Responsive */
@media (max-width: 640px) {
    .dlx-modal { padding: 12px; }
    .dlx-modal-content { max-height: 95vh; border-radius: 10px; }
    .dlx-modal.close-outside .dlx-modal-close { top: 6px; right: 6px; box-shadow: none; }
    .dlx-modal-close { width: 40px; height: 40px; }
}

@media (prefers-reduced-motion: reduce) {
    .dlx-modal,
    .dlx-modal-content,
    .dlx-modal-close {
        transition-duration: .01ms !important;
        animation-duration: .01ms !important;
    }
}
