/* Background overlay */
.auto-popup-overlay {
    display: none;
    position: fixed;
    z-index: 999999;
    inset: 0;
    background: rgba(0,0,0,0.75);
    backdrop-filter: blur(3px);
    justify-content: center;
    align-items: center;
    
}

/* Popup box */
.auto-popup-box {
    position: relative;
    max-width: 90%;
    max-height: 90vh;
    width: auto;
    height: auto;
    animation: zoomIn .3s ease;
}

/* Popup slider container */
.popup-slider-container {
    position: relative;
    width: 100%;
    min-height: 200px;
    overflow: hidden;
    border-radius: 14px;
    background: transparent;
    isolation: isolate; /* Membuat stacking context baru */
    display: flex;
    align-items: center;
    justify-content: center;
    transition: width 0.3s ease, height 0.3s ease;
    cursor: grab;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

.popup-slider-container:active {
    cursor: grabbing;
}

/* Popup slider wrapper */
.popup-slider-wrapper {
    display: flex;
    transition: transform 0.4s ease-in-out;
    will-change: transform;
}

/* Popup slide */
.popup-slide {
    min-width: 100%;
    width: 100%;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
    overflow: hidden;
    position: relative;
}

.popup-slide a {
    display: block;
    width: 100%;
    height: 100%;
    border-radius: 14px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Popup image */
.auto-popup-img {
    width: 100%;
    max-width: 100%;
    height: auto;
    max-height: 90vh;
    /* min-height: 200px; */
    object-fit: contain;
    border-radius: 14px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.25);
    display: block;
}

/* Close button */
.popup-close-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: white;
    border: none;
    font-size: 24px;
    font-weight: bold;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 3px 10px rgba(0,0,0,0.2);
    line-height: 36px;
    padding: 0;
    color: #333;
    z-index: 10;
    transition: background 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.popup-close-btn:hover {
    background: #f1f1f1;
}

/* Navigation buttons - disembunyikan, gunakan swipe saja */
.popup-nav-btn {
    display: none !important;
}

/* Hide navigation if only one slide */
.popup-slider-container:has(.popup-slide:only-child) .popup-nav-btn,
.popup-slider-container:has(.popup-slide:only-child) .popup-bubbles {
    display: none;
}

.popup-nav-btn:hover {
    background: white;
    transform: translateY(-50%) scale(1.1);
}

.popup-prev-btn {
    left: 10px;
}

.popup-next-btn {
    right: 10px;
}

/* Bubble indicators */
.popup-bubbles {
    position: absolute;
    bottom: 15px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    z-index: 10;
    padding: 8px 12px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 20px;
    backdrop-filter: blur(5px);
}

.popup-bubble {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.popup-bubble:hover {
    background: rgba(255, 255, 255, 0.8);
    transform: scale(1.2);
}

.popup-bubble.active {
    background: white;
    width: 24px;
    border-radius: 5px;
    transform: scale(1);
}

/* Animasi */
@keyframes zoomIn {
    from { transform: scale(0.7); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

/* Responsive */
@media (max-width: 768px) {
    .popup-close-btn {
        top: 8px;
        right: 8px;
        width: 32px;
        height: 32px;
        font-size: 20px;
        line-height: 32px;
    }
    
    .popup-bubbles {
        bottom: 10px;
        gap: 6px;
        padding: 6px 10px;
    }
    
    .popup-bubble {
        width: 8px;
        height: 8px;
    }
    
    .popup-bubble.active {
        width: 20px;
    }
}

/* Desktop - fixed width 430px */
@media (min-width: 769px) {
    .auto-popup-box {
        width: 430px;
        max-width: 430px;
    }
    
    .popup-slider-container {
        width: 430px;
    }
}
