/* Базовое перекрытие скролла страницы */
body.lb-disable-scrolling {
    overflow: hidden;
}

/* Главный контейнер-центровщик */
.el-lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 999999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 30px;
    box-sizing: border-box;
}

.el-lightbox.el-active {
    display: flex;
}

/* Задний темный фон */
.el-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.65);
    z-index: 1;
}

/* Белая карточка (Fancybox-эффект) */
#easyLightbox .el-outer {
    position: relative;
    background-color: #fff;
    border-radius: 12px;
    padding: 24px;
    box-sizing: border-box;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 90vw;
    max-height: 92vh;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);

    /* Плавность изменения геометрии карточки */
    transition: width 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: width;
}

/* Контейнер контента */
#easyLightbox .el-content {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    box-sizing: border-box;
    overflow: hidden;

    /* Плавное изменение размеров контента при перелистывании */
    transition: width 0.35s cubic-bezier(0.4, 0, 0.2, 1), height 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: width, height;
}

/* Сама картинка */
#easyLightbox .el-image {
    display: block;
    width: 100% !important;
    height: 100% !important;
    max-width: 100% !important;
    max-height: 100% !important;
    object-fit: contain;
    border-radius: 6px;
    opacity: 0;
    margin: 0 auto;

    /* Плавная синхронная смена прозрачности и габаритов */
    transition: opacity 0.25s ease-in-out, width 0.35s cubic-bezier(0.4, 0, 0.2, 1), height 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: opacity, width, height;
}

#easyLightbox .el-image.el-loaded {
    opacity: 1;
}

/* Описание под картинкой */
#easyLightbox .el-meta {
    text-align: center;
    padding-top: 16px;
    width: 100%;
    box-sizing: border-box;
}

#easyLightbox .el-caption {
    font-size: 15px;
    line-height: 1.4;
    color: #222;
    font-weight: 400;
    white-space: normal;
    word-wrap: break-word;
}

#easyLightbox .el-counter {
    font-size: 12px;
    color: #888;
    margin-top: 4px;
}

/* Кнопка Закрыть */
#easyLightbox .el-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 32px;
    height: 32px;
    background: transparent;
    border: none;
    color: #999;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 50;
    transition: color 0.2s, transform 0.2s;
}

#easyLightbox .el-close svg {
    width: 20px;
    height: 20px;
}

#easyLightbox .el-close:hover {
    color: #333;
    transform: scale(1.05);
}

/* Стрелки навигации на границах блока */
#easyLightbox .el-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    background-color: #ffffff;
    border: none;
    border-radius: 50%;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 15;
    transition: transform 0.2s ease, background-color 0.2s;
}

#easyLightbox .el-prev { left: -56px; }
#easyLightbox .el-next { right: -56px; }

#easyLightbox .el-nav:hover {
    transform: translateY(-50%) scale(1.08);
    background-color: #f8f9fa;
}

#easyLightbox .el-nav::before {
    content: "";
    display: block;
    width: 8px;
    height: 8px;
    border-top: 2px solid #4F7177;
    border-left: 2px solid #4F7177;
}
#easyLightbox .el-prev::before { transform: rotate(-45deg); margin-left: 3px; }
#easyLightbox .el-next::before { transform: rotate(135deg); margin-right: 3px; }

/* Прелоадер */
#easyLightbox .el-loader {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(255, 255, 255, 0.85);
    border-radius: 6px;
    z-index: 5;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease-in-out;
}

#easyLightbox .el-loader.el-loading-active {
    opacity: 1;
    pointer-events: auto;
}

#easyLightbox .el-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #4F7177;
    border-radius: 50%;
    animation: el-spin 0.8s linear infinite;
}

@keyframes el-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@media (max-width: 768px) {
    #easyLightbox .el-prev { left: 5px; }
    #easyLightbox .el-next { right: 5px; }
}
