/* ==========================================================================
   Kooshanic Product Lightbox (Modal Only)
   ========================================================================== */

.ksn-lb {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 999999;
}

.ksn-lb.is-open {
    display: flex;
    align-items: center;
    justify-content: center;
}

.ksn-lb-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.ksn-lb-wrap {
    position: relative;
    z-index: 2;
    max-width: 90vw;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.ksn-lb-stage {
    display: flex;
    align-items: center;
    justify-content: center;
    max-width: 820px;
    max-height: 72vh;
}

.ksn-lb-stage img {
    max-width: 100%;
    max-height: 72vh;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.45);
    background: #fff;
    user-select: none;
}

/* دکمه‌های ناوبری و بستن */
.ksn-lb-btn {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    border: none;
    font-size: 24px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
    user-select: none;
    outline: none;
}

.ksn-lb-btn:hover {
    background: rgba(255, 255, 255, 0.35);
}

.ksn-lb-close {
    position: absolute;
    top: -50px;
    left: 0;
    font-size: 24px;
    line-height: 1;
    z-index: 10;
}

.ksn-lb-prev,
.ksn-lb-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
}

.ksn-lb-prev { right: -60px; }
.ksn-lb-next { left: -60px; }

.ksn-lb.is-single .ksn-lb-prev,
.ksn-lb.is-single .ksn-lb-next {
    display: none !important;
}

/* نوار تامبنیل داخل مدال لایت‌باکس */
.ksn-lb-thumbs {
    display: flex;
    flex-direction: row;
    gap: 8px;
    margin-top: 14px;
    max-width: 100%;
    overflow-x: auto;
    padding: 4px;
    scrollbar-width: thin;
}

.ksn-lb-thumb {
    width: 54px;
    height: 54px;
    border-radius: 6px;
    cursor: pointer;
    opacity: 0.5;
    border: 2px solid transparent;
    transition: opacity 0.2s, border-color 0.2s;
    background: #fff;
    object-fit: cover;
    flex-shrink: 0;
}

.ksn-lb-thumb.is-active,
.ksn-lb-thumb:hover {
    opacity: 1;
    border-color: #a81010;
}

@media (max-width: 768px) {
    .ksn-lb-prev { right: 8px; }
    .ksn-lb-next { left: 8px; }
    .ksn-lb-close { top: 12px; left: 12px; }
}
