.lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox.hidden {
    display: none;
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 20px;
    font-size: 36px;
    color: white;
    background: none;
    border: none;
    cursor: pointer;
    z-index: 1010;
    padding: 10px; /* Увеличенная область нажатия */
}

.lightbox-content {
    position: relative;
    max-width: 90%;
    max-height: 90%;
}

#lightbox-img {
    max-width: 100%;
    max-height: 80vh;
    object-fit: contain;
    border-radius: 8px;
}

.lightbox-controls {
    position: absolute;
    bottom: 20px;
    width: 100%;
    display: flex;
    justify-content: space-between;
    padding: 0 40px;
}

.lightbox-prev,
.lightbox-next {
    font-size: 28px;
    color: white;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    backdrop-filter: blur(5px);
}

.lightbox-counter {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    color: white;
    font-size: 14px;
    background: rgba(0, 0, 0, 0.6);
    padding: 4px 12px;
    border-radius: 20px;
}

/* Адаптация для портретной ориентации */
@media (orientation: portrait) {
    .lightbox-controls {
        bottom: 5%;
    }

    .lightbox-counter {
        font-size: 12px;
        padding: 3px 10px;
    }
}

/* Адаптация для ландшафтной ориентации */
@media (orientation: landscape) {
    .lightbox-counter {
        bottom: 20px;
    }
}