/* block */
.ctx-search__block {
    position: relative;

    display: none;

    font-size: 16px;
    display: block;
}

/* input */
.ctx-search__input-box {
    position: relative;
}

.ctx-search__input {
    width: 100%;

    font-size: 1em;
}

.ctx-search__interactive:after {
    position: absolute;
    top: .4em;
    right: .7em;

    width: 20px;
    height: 20px;

    content: '';
    pointer-events: none;

    background-image: url(../images/search.svg);
    background-repeat: no-repeat;
    background-position: center;
    background-size: 20px;
}

.loading .ctx-search__interactive:after {
    transform-origin: center center;
    animation-name: ctxSearchRotateIcon;
    animation-duration: 1s;
    animation-timing-function: linear;
    animation-iteration-count: infinite;

    background-image: url(../images/rolling.svg);
}

.ctx-search__non-interactive {
    padding-right: 4.5em;
}

.ctx-search__input-btn {
    position: absolute;
    top: 0;
    right: 0;

    margin: .3em;
    padding: .2em .5em;

    color: rgb(95, 175, 210);
    border: 0;
    border-radius: .7em;
    background: rgba(95, 175, 210, .2);

    line-height: 1;
}

/* popup */
.focused:not(.empty-query) .ctx-search__popup__box,
.ctx-search__popup__box:hover {
    display: block;
}

.ctx-search__popup__box {
    display: none;

    width: 100%;
    margin-top: .5em;

    border-radius: .3em;
    background: #fff;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, .1);
}

/* group */
.ctx-search__popup__group-box {
    padding: .4em 0;
}

.ctx-search__popup__group-box > .ctx-search__popup__item {
    color: #35b6de;

    font-weight: bold;
}

/* item */
.ctx-search__popup__item {
    display: block;
    overflow: hidden;

    max-width: 100%;
    padding: .5em .7em;

    white-space: nowrap;
    text-overflow: ellipsis;

    color: #333;
}

.ctx-search__popup__item-more {
    display: inline-block;

    margin: 0 .5em;
    padding: .1em .3em;

    border-radius: .4em;
    background: rgba(0,0,0,.05);

    font-weight: normal;
}

.ctx-search__popup__item:focus,
.ctx-search__popup__item:hover {
    color: #fff;
    background-color: #35b6de;
}

.ctx-search__popup__items > .ctx-search__popup__item {
    padding: .5em .8em;
}

.ctx-search__popup__all-link__query {
    color: #35b6de;

    font-weight: bold;
}

.ctx-search__popup__item:focus .ctx-search__popup__all-link__query,
.ctx-search__popup__item:hover .ctx-search__popup__all-link__query {
    color: #fff;
}

/* empty */
.ctx-search__popup__empty {
    display: none;

    padding: .7em;
}

.no-results .ctx-search__popup__empty {
    display: block;
}

.ctx-search__popup__empty-title {
    margin-bottom: .5em;

    font-weight: bold;
}

/* page */
.ctx-search__page__title {
    margin-bottom: .1em;

    text-transform: uppercase;

    color: #36b7df;

    font-size: 1.5em;
}

.ctx-search__page__sub-title {
    margin-top: 0;
    margin-bottom: 1.5em;

    font-size: 1.2em;
    font-weight: bold;
}

/* suggest */
.ctx-search__suggest {
    margin: .5em 0;
}

.ctx-search__suggest-item {
    display: block;

    padding: .5em;

    text-decoration: none;

    color: #333;
}

.ctx-search__suggest-item.active,
.ctx-search__suggest-item:hover,
.ctx-search__suggest-item:focus {
    color: #d14c47;
}

.ctx-search__suggest-item-text {
    box-shadow: 0 1px 0 0 rgba(0, 0, 0, .1);
}

.ctx-search__suggest-item-total {
    margin: 0 .2em;

    opacity: .7;
}

@media (min-width: 720px) {
    .ctx-search__block {
        position: relative;

        margin: 1em 0 2em;

        font-size: 24px; /* 16*1.5 */
    }

    .ctx-search__input {
        font-size: 1em;
    }

    .ctx-search__interactive:after {
        width: 26px;
        height: 26px;

        background-size: 26px;
    }

    .ctx-search__page__title {
        font-size: 2em;
    }

    .ctx-search__page__sub-title {
        font-size: 1.5em;
    }
}

@media (min-width: 1020px) {
    .ctx-search__block {
        display: block;

        margin: 0 0 1em 0;

        font-size: 16px;
    }

    .ctx-search__interactive:after {
        width: 20px;
        height: 20px;

        background-size: 20px;
    }

    .ctx-search__popup__box {
        position: absolute;
        z-index: 9999;
        top: 100%;
        right: 0;
        animation-name: ctxSearchPopupFadeInUp;
        animation-duration: .3s;

        box-shadow: 0 0 0 1px rgba(0, 0, 0, .1),
                    0 1em 5em rgba(0, 0, 0, .25);

        animation-fill-mode: both;
    }
}

@keyframes ctxSearchRotateIcon {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

@keyframes ctxSearchPopupFadeInUp {
    from {
        transform: translate3d(0, 10%, 0);

        opacity: 0;
    }

    to {
        transform: none;

        opacity: 1;
    }
}
