/* --- CLASSIC LIGHTBOX STYLES --- */

body.lightbox-active {
    overflow: hidden;
}

/* OVERLAY */
#lightbox-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.95); /* Deep Black */
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    animation: fadeIn 0.3s forwards;
}

@keyframes fadeIn {
    to { opacity: 1; }
}

/* CONTENT */
#lightbox-content {
    position: relative;
    width: 90vw;
    height: 90vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* IMAGE */
.lightbox-image {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    box-shadow: 0 0 20px rgba(0,0,0,0.5);
    user-select: none;
}

/* NAV ARROWS */
.lb-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    background: transparent;
    border: none;
    cursor: pointer;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.7;
    transition: opacity 0.2s;
}
.lb-nav:hover { opacity: 1; }

.lb-prev { left: -60px; }
.lb-next { right: -60px; }

.lb-nav::before {
    content: '';
    display: block;
    width: 20px;
    height: 20px;
    border-top: 2px solid white;
    border-right: 2px solid white;
}
.lb-prev::before { transform: rotate(-135deg); }
.lb-next::before { transform: rotate(45deg); }

/* --- UNIFORM "X" CLOSE BUTTON --- */
/* Matching .fs-close style from Header Controls */
#close-product-lightbox {
    position: absolute;
    top: 10px;
    right: 40px;
    width: 30px;
    height: 30px;
    background: transparent;
    border: none;
    cursor: pointer;
    z-index: 1000;
    padding: 0;
    /* Reset any inherited text styles */
    font-size: 0; 
}

#close-product-lightbox:hover {
    transform: scale(1.1); /* Slight zoom effect like header */
}

#close-product-lightbox span {
    display: block;
    width: 100%;
    height: 1px; /* Matches the thin line style */
    background-color: #ffffff; /* White to contrast with black background */
    position: absolute;
    top: 50%;
    left: 0;
    transition: transform 0.3s ease;
}

#close-product-lightbox span:nth-child(1) {
    transform: rotate(45deg);
}

#close-product-lightbox span:nth-child(2) {
    transform: rotate(-45deg);
}

/* MOBILE */
@media (max-width: 768px) {
    .lb-nav {
        width: 40px;
        height: 40px;
        background: rgba(255,255,255,0.1);
        border-radius: 50%;
    }
    .lb-prev { left: 10px; }
    .lb-next { right: 10px; }
    
    #close-product-lightbox {
        top: 20px;
        right: 20px;
    }
}