.before-after-gallery {
    display: grid;
    gap: 20px;
    grid-template-columns: repeat(1, 1fr);
    align-items: start;
    width: 100%;
    margin-bottom: 50px;
    position: relative;
    z-index: 1;
}

.before-after-gallery img.ycript-thumb {
    width: 100%;
    height: auto;
    object-fit: cover;
    box-shadow: 0 2px 10px rgba(0,0,0,0.03);
    cursor: pointer;
    display: block;
    margin: 0 !important;
    transition: transform 0.3s ease, box-shadow 0.3s ease, filter 0.3s ease;
    z-index: 10;
}

.before-after-gallery img.ycript-thumb:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 10px 20px rgba(0,0,0,0.08);
    filter: brightness(0.97);
    z-index: 20;
}

#ycript-lightbox-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(20, 20, 20, 0.95);
    z-index: 2147483647;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    backdrop-filter: blur(5px);
}

#ycript-lightbox-content {
    position: relative;
    max-width: 95vw;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 2147483648;
}

#ycript-lightbox-image {
    width: 100%;
    max-width: 980px;
    height: auto;
    max-height: 80vh;
    object-fit: contain;
    box-shadow: 0 0 30px rgba(0,0,0,0.5);
    border: 1px solid #333;
    background: #000;
}

#ycript-lightbox-title {
    color: #b7a89a;
    margin-top: 15px;
    font-size: 15px;
    text-align: center;
    font-weight: 400;
    letter-spacing: 0.5px;
    font-family: sans-serif;
}

#ycript-lightbox-close {
    position: fixed;
    top: 20px;
    right: 30px;
    color: #fff;
    font-size: 70px;
    font-weight: 100;
    line-height: 0.8;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 2147483651;
    text-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

#ycript-lightbox-close:hover {
    color: #b7a89a;
    transform: rotate(90deg) scale(1.1);
}

.ycript-controls {
    position: fixed;
    top: 50%;
    left: 0;
    width: 100%;
    height: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transform: translateY(-50%);
    pointer-events: none;
    padding: 0 2vw;
    box-sizing: border-box;
    z-index: 2147483650;
}

#ycript-prev,
#ycript-next {
    pointer-events: auto;
    background: transparent;
    border: none;
    color: rgba(255,255,255,0.6);
    font-size: 60px;
    line-height: 1;
    cursor: pointer;
    user-select: none;
    transition: all 0.2s ease;
    padding: 20px;
    margin: 0;
    text-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

#ycript-prev:hover,
#ycript-next:hover {
    color: #b7a89a;
    transform: scale(1.1);
}

@media (max-width: 1024px) {
    .before-after-gallery {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .before-after-gallery {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    #ycript-lightbox-content {
        width: 95%;
        max-height: 85vh;
        gap: 15px;
    }

    .ycript-controls {
        position: relative !important;
        top: auto;
        left: auto;
        transform: none;
        width: 100%;
        height: auto;
        justify-content: center;
        gap: 20px;
        padding: 0;
        pointer-events: auto;
        order: 2;
    }

    #ycript-prev,
    #ycript-next {
        font-size: 24px;
        width: 50px;
        height: 50px;
        background: rgba(255, 255, 255, 0.1);
        border-radius: 50%;
        padding: 0;
        display: flex;
        align-items: center;
        justify-content: center;
        border: 1px solid rgba(255, 255, 255, 0.2);
        transition: transform 0.1s ease, background 0.2s ease;
    }

    #ycript-prev:active,
    #ycript-next:active {
        background: #b7a89a;
        color: #fff;
        border-color: #b7a89a;
        transform: scale(0.9);
    }

    #ycript-lightbox-close {
        top: 15px;
        right: 15px;
        font-size: 40px;
        background: rgba(0,0,0,0.5);
        width: 40px;
        height: 40px;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        line-height: 0;
        padding-bottom: 4px;
    }
}

@media (max-width: 479px) {
    #ycript-prev,
    #ycript-next {
        width: 40px;
        height: 40px;
        font-size: 20px;
    }
}