.lightgallery {
    display: none;
    width: 100%;
    height: 660px;
    position: relative;
}
@media (min-width: 769px) {
    .lightgallery {
        width: 860px;
    }
}

.lightgallery .preview {
    margin: 20px -10px 20px -10px;
    height: 50px;
    overflow: hidden;
    position: relative;
}

.lightgallery .preview .slick-list {
    margin: 0 40px;
    overflow: hidden;
}

.lightgallery .preview a {
    height: 50px;
    width: 70px;
    display: inline-block;
    background-repeat: no-repeat;
    background-size: cover;
    margin: 0 10px;
    outline: none;
    vertical-align: top;    /* чтобы inline-block не «плясал» по базовой линии */
}

.lightgallery .preview .slick-list .slick-slide {
    border: 2px solid #fff;
}

.lightgallery .preview .slick-list .slick-slide.xr-active {
    border-color: #a90707;
}

.lightgallery .big_preview {
    height: calc(100% - 123px);
}

.lightgallery .big_preview a {
    display: inline-block;
    height: 100%;
    width: 100%;
    background-repeat: no-repeat;
    background-size: cover;
}

.lightgallery .big_preview a img {
    display: none;
}

.lightgallery .big_preview a:not(:first-child) {
    display: none;
}

.lightgallery .title {
    font-size: 14px;
    font-family: Gilroy;
    font-weight: 400;
    padding-bottom: 5px;
    border-bottom: rgba(0, 0, 0, .5) 1px solid;
    height: 23px;
    overflow: hidden;
}

.lightgallery .slick-arrow {
    position: absolute;
    z-index: 1;
    display: block;
    width: 30px;
    height: 30px;
    border: none;
    background: none;
    overflow: hidden;
    border: 0;
    cursor: pointer;
    background: rgba(0, 0, 0, .5);
    border-radius: 50%;
    margin-top: 5px;
}

.lightgallery .slick-arrow svg {
    width: 20px;
    height: 20px;
    margin-top: 3px;
}

.lightgallery .slick-arrow.slick-prev {
    left: 5px;
}

.lightgallery .slick-arrow.slick-next {
    top: 0;
    right: 5px;
}

/*.lightgallery .expand_button {*/
/*    background: rgba(0, 0, 0, .5);*/
/*    border: 0;*/
/*    position: absolute;*/
/*    top: 5px;*/
/*    right: 5px;*/
/*    cursor: pointer;*/
/*    padding: 10px;*/
/*    border-radius: 50%;*/
/*}*/

.lightgallery .expand_button {
    background: rgba(0, 0, 0, .6);
    border: 0;
    position: absolute;
    /* Сдвигаем вниз от стандартной кнопки close lightGallery */
    top: 5px;
    right: max(10px, env(safe-area-inset-right));
    cursor: pointer;
    padding: 10px;
    border-radius: 50%;
    width: 44px;
    height: 44px;
    z-index: 11; /* выше close-кнопки lightGallery */
    display: flex;
    align-items: center;
    justify-content: center;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
    touch-action: manipulation;
    transition: background .2s ease, transform .15s ease;
}

.lightgallery .expand_button svg {
    width: 20px;
    height: 20px;
    display: block;
    pointer-events: none;
}

.lightgallery .expand_button:hover {
    background: rgba(0, 0, 0, .8);
}

.lightgallery .prev_button,
.lightgallery .next_button {
    border: 0;
    position: absolute;
    top: 250px;
    transform: translateY(-50%);
    cursor: pointer;
    padding: 10px;
    background: rgba(0, 0, 0, .6);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
    touch-action: manipulation;
    transition: background .2s ease, transform .15s ease;
}

.lightgallery .prev_button { left: max(5px, env(safe-area-inset-left)); }
.lightgallery .next_button { right: max(5px, env(safe-area-inset-right)); }

.lightgallery .prev_button svg,
.lightgallery .next_button svg {
    width: 30px;
    height: 30px;
    display: block;
    pointer-events: none;
}

.lightgallery .prev_button:hover,
.lightgallery .next_button:hover { background: rgba(0, 0, 0, .8); }

@media (max-width: 767px) {
    .lightgallery {
        width: 100%;
        height: 500px;
        position: relative;
    }
    .lightgallery .preview a {
        height: 42px;
        width: 60px;
        margin: 0 5px;
    }
    .lightgallery .prev_button,
    .lightgallery .next_button {
        top: 30%;
        width: 44px; /* минимум по Apple HIG */
        height: 44px;
        padding: 8px;
        background: rgba(0, 0, 0, .7); /* плотнее — лучше читается на солнце */
    }
    .lightgallery .prev_button svg,
    .lightgallery .next_button svg { width: 24px; height: 24px; }
    .lightgallery .prev_button { left: max(8px, env(safe-area-inset-left)); }
    .lightgallery .next_button { right: max(8px, env(safe-area-inset-right)); }
    /* На тач-устройствах hover не работает — используем :active */
    .lightgallery .prev_button:active,
    .lightgallery .next_button:active {
        transform: translateY(-50%) scale(.92);
        background: rgba(0, 0, 0, .9);
    }
    .lightgallery .expand_button {
        width: 44px; /* минимум по Apple HIG */
        height: 44px;
        padding: 10px;
        /*top: max(60px, calc(env(safe-area-inset-top, 0px) + 50px));*/
        right: max(8px, env(safe-area-inset-right));
        background: rgba(0, 0, 0, .7); /* плотнее — лучше читается на солнце */
    }
    .lightgallery .expand_button svg { width: 20px; height: 20px; }
    .lightgallery .expand_button:active {
        transform: scale(.92);
        background: rgba(0, 0, 0, .9);
    }
}

@media (max-width: 478px) {
    .lightgallery {
        height: 300px;
    }
    .lightgallery .preview a {
        height: 38px;
        width: 55px;
        margin: 0 5px;
    }
    .lightgallery .prev_button,
    .lightgallery .next_button {
        top: 30%;
        width: 38px;
        height: 38px;
        padding: 7px;
    }
    .lightgallery .prev_button svg,
    .lightgallery .next_button svg {
        width: 20px;
        height: 20px;
    }
    .lightgallery .expand_button {
        width: 38px;
        height: 38px;
        padding: 8px;
        /*top: max(56px, calc(env(safe-area-inset-top, 0px) + 46px));*/
    }
    .lightgallery .expand_button svg {
        width: 18px;
        height: 18px;
    }
}

@media (max-height: 500px) and (orientation: landscape) {
    .lightgallery .prev_button,
    .lightgallery .next_button {
        width: 36px;
        height: 36px;
    }
    .lightgallery .prev_button svg,
    .lightgallery .next_button svg {
        width: 20px;
        height: 20px;
    }
    .lightgallery .expand_button {
        width: 36px;
        height: 36px;
        padding: 7px;
        /*top: 8px;*/
        right: 50px; /* рядом с close-кнопкой, но не под ней */
    }
    .lightgallery .expand_button svg {
        width: 18px;
        height: 18px;
    }
}

.lightgallery .share_button {
    background: rgba(0, 0, 0, .5);
    border: 0;
    position: absolute;
    top: 5px;
    right: 55px;
    cursor: pointer;
    padding: 10px;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    opacity: 1;
    left: auto;
    outline: none;
}

.lightgallery .share_button .lg-dropdown {
    -webkit-transition-delay: 0s;
    transition-delay: 0s;
    transform: translate3d(0, 0, 0);
    opacity: 1;
    visibility: visible;
}

.lightgallery .share_button .lg-dropdown li {
    padding: 0 !important;
}

.lightgallery .share_button .lg-dropdown li a {
    color: #333 !important;
    display: block;
    white-space: pre;
    padding: 4px 12px;
    font-family: "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif;
    font-size: 12px;
}

.lightgallery .share_button .lg-dropdown li:before {
    display: none !important;
}

.lightgallery .share_button #lg-share-facebook .lg-icon {
    color: #3b5998;
}

.lightgallery .share_button .lg-dropdown .lg-icon {
    color: #333;
    display: inline-block;
    float: none;
    font-size: 20px;
    height: auto;
    line-height: 1;
    margin-right: 8px;
    padding: 0;
    vertical-align: middle;
    width: auto;
}

.lightgallery .share_button .lg-icon {
    color: #999;
    cursor: pointer;
    float: right;
    font-size: 24px;
    height: 47px;
    line-height: 27px;
    padding: 10px 0;
    text-align: center;
    width: 50px;
    text-decoration: none !important;
    outline: 0;
    -webkit-transition: color .2s linear;
    -o-transition: color .2s linear;
    transition: color .2s linear;
}

.lightgallery .share_button * {
    box-sizing: border-box;
}

.lightgallery .share_button .lg-icon {
    font-family: lg;
    speak: none;
    font-style: normal;
    font-weight: 400;
    font-variant: normal;
    text-transform: none;
    line-height: 1;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.lightgallery .share_button #lg-share-facebook .lg-icon:after {
    content: "\e901";
}

.lightgallery .share_button *::before, .lightgallery .share_button *::after {
    box-sizing: border-box;
}

.lightgallery .share_button .lg-dropdown .lg-dropdown-text {
    display: inline-block;
    line-height: 1;
    margin-top: -3px;
    vertical-align: middle;
}

.lightgallery .share_button #lg-share-twitter .lg-icon {
    color: #00aced;
}

.lightgallery .share_button #lg-share-twitter .lg-icon:after {
    content: "\e904";
}

.lightgallery .share_button #lg-share-googleplus .lg-icon {
    color: #dd4b39;
}

.lightgallery .share_button #lg-share-googleplus .lg-icon:after {
    content: "\e902";
}

.lightgallery .share_button #lg-share-pinterest .lg-icon {
    color: #cb2027;
}

.lightgallery .share_button #lg-share-pinterest .lg-icon:after {
    content: "\e903";
}

.lightgallery .share_button .lg-dropdown {
    background-color: #fff;
    border-radius: 2px;
    font-size: 14px;
    list-style-type: none;
    margin: 0;
    padding: 10px 0;
    position: absolute;
    right: 0;
    text-align: left;
    top: 50px;
    transform: translate3d(0, 5px, 0);
    -webkit-transition: -webkit-transform .18s linear 0s, visibility 0s linear .5s, opacity .18s linear 0s;
    -moz-transition: -moz-transform .18s linear 0s, visibility 0s linear .5s, opacity .18s linear 0s;
    -o-transition: -o-transform .18s linear 0s, visibility 0s linear .5s, opacity .18s linear 0s;
    transition: transform .18s linear 0s, visibility 0s linear .5s, opacity .18s linear 0s;
}

.lightgallery .share_button .lg-dropdown:after {
    content: "";
    display: block;
    height: 0;
    width: 0;
    position: absolute;
    border: 8px solid transparent;
    border-bottom-color: #FFF;
    right: 16px;
    top: -16px;
}

.lg-container:not(.lg-show) {
    display: none;
}