/**
 * VIO Popup Button — Styles
 * @package VIO Elementor Addons
 */

/* ══════════════════════════════════════
   دکمه
══════════════════════════════════════ */

.vio-popup-btn-wrap {
    display: block;
}

.vio-popup-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 28px;
    background: #7B5EA7;
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.4;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    text-decoration: none;
    transition: background .2s ease, transform .15s ease, box-shadow .2s ease;
    white-space: nowrap;
}

.vio-popup-btn:hover {
    background: #6a4f94;
    transform: translateY(-1px);
}

.vio-popup-btn:active {
    transform: translateY(0);
}

.vio-btn-icon i,
.vio-btn-icon svg {
    font-size: 1em;
    vertical-align: middle;
}

/* ══════════════════════════════════════
   Overlay
══════════════════════════════════════ */

.vio-popup-overlay {
    position: fixed;
    inset: 0;
    z-index: 999999;
    background: rgba(0, 0, 0, 0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    box-sizing: border-box;
    /* انیمیشن overlay */
    animation: vioOverlayIn .25s ease forwards;
}

.vio-popup-overlay[hidden] {
    display: none !important;
}

@keyframes vioOverlayIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* ══════════════════════════════════════
   جعبه پاپ‌آپ
══════════════════════════════════════ */

.vio-popup-box {
    position: relative;
    background: #fff;
    border-radius: 12px;
    width: 680px;
    max-width: 95vw;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.25);
    box-sizing: border-box;
    /* اسکرول‌بار ظریف */
    scrollbar-width: thin;
    scrollbar-color: #ddd transparent;
}

.vio-popup-box::-webkit-scrollbar       { width: 5px; }
.vio-popup-box::-webkit-scrollbar-track { background: transparent; }
.vio-popup-box::-webkit-scrollbar-thumb { background: #ddd; border-radius: 10px; }

/* ══════════════════════════════════════
   دکمه بستن
══════════════════════════════════════ */

.vio-popup-close {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 10;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid #e5e7eb;
    border-radius: 50%;
    cursor: pointer;
    color: #6B7280;
    padding: 0;
    line-height: 1;
    transition: background .15s, color .15s, transform .15s;
    backdrop-filter: blur(4px);
}

.vio-popup-close:hover {
    background: #f3f4f6;
    color: #111827;
    transform: rotate(90deg);
}

/* ══════════════════════════════════════
   محتوا
══════════════════════════════════════ */

.vio-popup-content {
    width: 100%;
}

/* اطمینان از اینکه المنتور داخل پاپ‌آپ درست رندر می‌شه */
.vio-popup-content .elementor {
    width: 100%;
}

.vio-popup-content .elementor-section-wrap,
.vio-popup-content .e-con-inner {
    width: 100%;
}

/* ══════════════════════════════════════
   انیمیشن‌ها
══════════════════════════════════════ */

/* fade */
.vio-popup-overlay[data-animation="fade"] .vio-popup-box.vio-anim-in {
    animation: vioFadeIn .25s ease forwards;
}
.vio-popup-overlay[data-animation="fade"] .vio-popup-box.vio-anim-out {
    animation: vioFadeOut .25s ease forwards;
}

/* fade-zoom (پیش‌فرض) */
.vio-popup-overlay[data-animation="fade-zoom"] .vio-popup-box.vio-anim-in,
.vio-popup-box.vio-anim-in {
    animation: vioFadeZoomIn .28s cubic-bezier(.34,1.56,.64,1) forwards;
}
.vio-popup-overlay[data-animation="fade-zoom"] .vio-popup-box.vio-anim-out,
.vio-popup-box.vio-anim-out {
    animation: vioFadeZoomOut .22s ease forwards;
}

/* slide-up */
.vio-popup-overlay[data-animation="slide-up"] .vio-popup-box.vio-anim-in {
    animation: vioSlideUpIn .3s cubic-bezier(.22,1,.36,1) forwards;
}
.vio-popup-overlay[data-animation="slide-up"] .vio-popup-box.vio-anim-out {
    animation: vioSlideUpOut .25s ease forwards;
}

/* slide-down */
.vio-popup-overlay[data-animation="slide-down"] .vio-popup-box.vio-anim-in {
    animation: vioSlideDownIn .3s cubic-bezier(.22,1,.36,1) forwards;
}
.vio-popup-overlay[data-animation="slide-down"] .vio-popup-box.vio-anim-out {
    animation: vioSlideDownOut .25s ease forwards;
}

/* keyframes */
@keyframes vioFadeIn       { from { opacity:0 }              to { opacity:1 } }
@keyframes vioFadeOut      { from { opacity:1 }              to { opacity:0 } }
@keyframes vioFadeZoomIn   { from { opacity:0; transform:scale(.88) }   to { opacity:1; transform:scale(1) } }
@keyframes vioFadeZoomOut  { from { opacity:1; transform:scale(1) }     to { opacity:0; transform:scale(.88) } }
@keyframes vioSlideUpIn    { from { opacity:0; transform:translateY(40px) }  to { opacity:1; transform:translateY(0) } }
@keyframes vioSlideUpOut   { from { opacity:1; transform:translateY(0) }     to { opacity:0; transform:translateY(40px) } }
@keyframes vioSlideDownIn  { from { opacity:0; transform:translateY(-40px) } to { opacity:1; transform:translateY(0) } }
@keyframes vioSlideDownOut { from { opacity:1; transform:translateY(0) }     to { opacity:0; transform:translateY(-40px) } }

/* ══════════════════════════════════════
   قفل اسکرول صفحه هنگام باز بودن پاپ‌آپ
══════════════════════════════════════ */

body.vio-popup-open {
    overflow: hidden;
}

/* ══════════════════════════════════════
   موبایل
══════════════════════════════════════ */

@media (max-width: 600px) {
    .vio-popup-overlay {
        align-items: flex-end;
        padding: 0;
    }
    .vio-popup-box {
        width: 100% !important;
        max-width: 100% !important;
        max-height: 90vh;
        border-radius: 16px 16px 0 0;
    }
    .vio-popup-overlay[data-animation] .vio-popup-box.vio-anim-in {
        animation: vioSlideUpIn .3s cubic-bezier(.22,1,.36,1) forwards;
    }
    .vio-popup-overlay[data-animation] .vio-popup-box.vio-anim-out {
        animation: vioSlideUpOut .25s ease forwards;
    }
}