@-webkit-keyframes photor__preloader {
    0% {
        -webkit-transform: rotate(0deg);
        transform: rotate(0deg);
    }
    100% {
        -webkit-transform: rotate(360deg);
        transform: rotate(360deg);
    }
}
@keyframes photor__preloader {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

.photor {
    position: relative;
    width: 100%;
    height: 100%;
    margin: auto;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -ms-touch-action: pan-y;
    touch-action: pan-y;
    -webkit-font-smoothing: antialiased;
    overflow: hidden;

    &__viewport {
        position: absolute;
        top: 0;
        right: -1px;
        bottom: 60px;
        left: -1px;
        overflow: hidden;

        &Layer {
            position: relative;
            width: 100%;
            height: 100%;
            -webkit-transform: translate3d(0, 0, 0);
            transform: translate3d(0, 0, 0);
            -webkit-transition-property: left, -webkit-transform;
            transition-property: left, transform;
            transition-timing-function: cubic-bezier(0.1,0,.25,1);
            transition-duration: .24s;
            z-index: 0;

            &Slide {
                width: 100%;
                height: 100%;
                position: absolute;
                top: 0;
                text-align: center;
                white-space: nowrap;

                &:before {
                    content: '';
                    display: inline-block;
                    vertical-align: middle;
                    height: 100%;
                    width: 0;
                    font-size: 0;
                    }
                &:after {
                    position: absolute;
                    top: 50%;
                    left: 50%;
                    width: 14px;
                    height: 14px;
                    margin: -9px 0 0 -9px;
                    visibility: hidden;
                    content: '';
                    border-radius: 50%;
                    border: 2px solid #fff;
                    border-right: 2px solid transparent;
                    -webkit-animation: photor__preloader .8s linear infinite;
                    animation: photor__preloader .8s linear infinite;
                    opacity: 0;
                    transition: all .3s ease;
                    }

                &Img {
                    position: absolute;
                    top: 0;
                    right: 1px;
                    bottom: 0;
                    left: 1px;
                    background-repeat: no-repeat;
                    background-position: center center;
                    opacity: 1;
                    transition: opacity .2s ease;
                    visibility: visible;
                    display: inline-block;
                    vertical-align: middle;

                    &._alt:before {
                        display: block;
                        content: attr(data-alt);
                        background: rgba(0,0,0,.5);
                        color: #fff;
                        text-align: center;
                        position: absolute;
                        right: 0;
                        bottom: 0;
                        left: 0;
                        padding: 4px 0;
                        font: 14px/20px Arial;
                        }
                    }

                /* Изображение не загружено */
                &._loading {
                    /* Прелоадер */
                    &:after {
                        visibility: visible;
                        opacity: 1;
                        }
                    & .photor__viewportLayerSlideImg {
                        opacity: 0;
                        }
                    }

                /* Спрятанное изображение */
                &._hidden {
                    display: none;
                    }

                /* Алгоритм размещения фотографии по умолчанию */
                &._auto {
                    .photor__viewportLayerSlideImg {
                        -webkit-background-size: contain;
                        background-size: contain;

                        @media (max-width: 400px) {
                            -webkit-background-size: cover;
                            background-size: cover;
                            }
                        }
                    }

                /* Алгоритм размещения фотографии по центру (для маленьких изображений) */
                &._center {
                    background-size: auto;
                    }

                &._html:before,
                &._html:after {
                    display: none;
                    }
                }
            }

        &Control {
            position: absolute;
            top: 0;
            right: 0;
            bottom: 0;
            left: 0;
            z-index: 1;
            cursor: move;
            cursor: -webkit-grab;
            cursor: -moz-grab;

            // Arrows
            &Prev,
            &Next {
                position: absolute;
                top: 0;
                bottom: 0;
                cursor: pointer;
                -webkit-tap-highlight-color: rgba(0, 0, 0, 0);

                /* Запрещенная фотография */
                &._disabled {
                    cursor: default;
                    }
                }
            &Prev {
                right: 70%;
                left: 0;
                }
            &Next {
                right: 0;
                left: 30%;
                }

            }
        }

    &__thumbs {
        position: absolute;
        height: 56px;
        right: 0;
        bottom: 0;
        left: 0;
        padding: 2px 0;
        text-align: center;
        white-space: nowrap;
        overflow: hidden;
        font-size: 0;

        &Wrap {
            position: relative;
            display: inline-block;
            text-align: left;
            height: 100%;
            -webkit-transform: translate3d(0,0,0);
            transform: translate3d(0,0,0);
            -webkit-transition-property: left, -webkit-transform;
            transition-property: left, transform;
            transition-timing-function: cubic-bezier(0.1,0,.25,1);
            transition-duration: .24s;
            margin: 0 -1px;

            ._noeffects & {
                transition-duration: 0s;
                }

            &Item {
                display: inline-block;
                vertical-align: top;
                height: 100%;
                margin: 0 1px;
                -webkit-tap-highlight-color: rgba(0,0,0,0);
                outline: none;
                cursor: pointer;

                &Img {
                    width: auto;
                    height: 100%;
                    vertical-align: top;
                    border: 0;
                    -webkit-transform: translate3d(0,0,0);
                    transform: translate3d(0,0,0);
                    }

                .photor._dots & {
                    width: 4px;
                    height: 4px;
                    padding: 5px;
                    margin: 0;

                    &:before {
                        display: block;
                        width: 4px;
                        height: 4px;
                        border: 1px solid gray;
                        border-radius: 3px;
                        content: '';
                        }

                    &._current:before {
                        background: gray;
                        }
                    }
                }


            // Current thumbs frame
            &Frame {
                top: 0;
                height: 100%;
                position: absolute;
                transition-property: all;
                transition-duration: 5s;
                transition-timing-function: cubic-bezier(0.1, 0, .25, 1);
                -moz-box-sizing: border-box;
                box-sizing: border-box;
                border: 2px solid #00afea;
                background: rgba(171, 171, 171, .15);

                // Для мобилок и планшетов не анимируем изменение ширины
                @media (max-device-width: 1280px) {
                    -webkit-transition-property: top, left, -webkit-transform;
                    transition-property: top, left, transform;
                    }
                }
            }
        }
    }

/* Во время перетаскивания */
.photor._dragging {
    .photor__viewportControl {
        cursor: move;
        cursor: -webkit-grabbing;
        cursor: -moz-grabbing;
        cursor: grabbing;

        &Prev,
        &Next {
            cursor: move;
            cursor: -webkit-grabbing;
            cursor: -moz-grabbing;
            cursor: grabbing;
            }
        }
    }

/* Internet Explorer 8 */
.photor._ie8 {
    .photor__viewportLayerSlide {
        &._auto {
            &._portrait .photor__viewportLayerSlideImg {
                height: 100%;
                width: auto;
                }
            &._landscape .photor__viewportLayerSlideImg {
                height: auto;
                width: 100%;
                }
            }
        &._center {
            .photor__viewportLayerSlideImg {
                height: auto;
                width: auto;
                }
            }
        }

    .photor__viewportControl {
        background: url('about:blank');
        }
    }