/* ==========================================================
   STABLE GALLERY POPUP
   ========================================================== */
.ls-gallery-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2147483647;
    visibility: hidden;
    opacity: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.3s ease;
}

.ls-gallery-popup.is-open {
    visibility: visible;
    opacity: 1;
}

.ls-popup-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(10px);
}

.ls-popup-content {
    position: relative;
    width: 95vw;
    height: 90vh;
    background: #000;
    border-radius: 15px;
    display: flex;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 50px 100px #000;
}

.ls-popup-inner {
    display: flex;
    width: 100%;
    height: 100%;
}

.ls-popup-sidebar {
    width: 140px;
    background: #050505;
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    padding: 20px;
    overflow-y: auto;
    flex-shrink: 0;
}

.ls-thumb-item {
    width: 100%;
    aspect-ratio: 1/1;
    margin-bottom: 15px;
    cursor: pointer;
    opacity: 0.3;
    transition: 0.3s;
    border: 2px solid transparent;
}

.ls-thumb-item.active {
    opacity: 1;
    border-color: var(--ls-accent);
}

.ls-thumb-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.ls-popup-main-wrap {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 0;
}

.ls-popup-image-container {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 30px;
    min-width: 0;
    min-height: 0;
}

.ls-popup-image-container img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
}

.ls-popup-info-footer {
    padding: 25px 40px;
    text-align: center;
}

.ls-popup-info-footer h3 {
    margin: 0;
    font-size: 1.6rem;
    font-family: var(--ls-font-heading);
    color: var(--ls-text-primary);
}

.ls-popup-info-footer p {
    margin: 6px 0 0 0;
    font-size: 0.9rem;
    color: var(--ls-text-secondary);
    text-transform: uppercase;
    letter-spacing: 2px;
}

.ls-popup-close {
    position: absolute;
    top: 15px;
    right: 15px;
    z-index: 100;
    color: #fff;
    font-size: 35px;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.1);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
}

/* Global Hooks for Popup */
body.is-open {
    overflow: hidden;
}

body.is-open .ls-site-header {
    visibility: hidden !important;
    opacity: 0 !important;
}

body.is-open img:not(#ls-gallery-popup img) {
    transform: none !important;
    transition: none !important;
}

@media (max-width: 768px) {
    .ls-popup-inner {
        flex-direction: column-reverse;
    }

    .ls-popup-sidebar {
        width: 100%;
        height: 100px;
        overflow-x: auto;
        padding: 10px;
        border-top: 1px solid rgba(255, 255, 255, 0.1);
        border-right: none;
    }

    .ls-popup-thumbs {
        display: flex;
        gap: 10px;
    }

    .ls-thumb-item {
        width: 70px;
        margin: 0;
        flex-shrink: 0;
    }
}