/**
 * Search Modal Styles (based on example)
 */

/* Фиксирование скролла при открытом модальном окне */
.has-modal {
    overflow: hidden;
    min-height: 100.3%;
    overscroll-behavior-y: none;
}

.has-modal body {
    overscroll-behavior-y: none;
}

/* Основной контейнер поискового модального окна */
.header-search-wrapper {
    width: 100%;
    height: 100%;
    position: fixed;
    top: 0;
    left: 0;
    background-color: #121212;
    z-index: 9999;
    overflow-y: scroll;
    scroll-behavior: smooth;
    transform: translateX(100%);
    transition: transform .23s ease-out, right .23s ease-out, z-index .23s ease-in;
}

.header-search-wrapper.active {
    transform: translateX(0);
}

.admin-bar .header-search-wrapper {
    top: 32px;
}

/* Кнопка закрытия */
.search-close-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    background: rgba(0, 0, 0, 0.3);
    border: none;
    border-radius: 50%;
    color: #FDF2E4;
    font-size: 18px;
    cursor: pointer;
    z-index: 10001;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s;
}

.search-close-btn:hover {
    background: rgba(0, 0, 0, 0.5);
}

/* Поисковая панель */
.search-bar {
    position: relative;
    z-index: 1499;
    margin: 20px auto 40px;
}

/* Контейнер для инпута */
.search-bar__inputs {
    padding: 0px 21px;
    position: relative;
    width: 538px;
    box-sizing: border-box;
    margin: 80px auto 0;
}

/* Форма поиска */
.search-bar__form {
    display: grid;
    backface-visibility: hidden;
    transform-style: preserve-3d;
    position: relative;
    width: auto;
    margin: 0;
}

/* Иконка поиска перед инпутом */
.search-bar__form:before {
    display: block;
    content: '';
    width: 56px;
    height: 56px;
    position: absolute;
    left: 0;
    background: url("data:image/svg+xml,%3Csvg width='24' height='24' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M21 21L16.514 16.506L21 21ZM19 10.5C19 15.194 15.194 19 10.5 19C5.806 19 2 15.194 2 10.5C2 5.806 5.806 2 10.5 2C15.194 2 19 5.806 19 10.5Z' stroke='%23FDF2E4' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center center no-repeat;
    z-index: 1;
}

/* Поле ввода */
.search-bar__form .search-bar__input {
    height: 56px;
    padding: 0 18px 0 56px;
    line-height: 55px;
    background-color: #313131;
    border-radius: 10px;
    border: none;
    color: #FDF2E4;
    font-size: 20px;
    outline: none !important;
    margin-right: -1px;
    position: relative;
    width: auto;
    font-family: inherit;
}

.search-bar__input::placeholder {
    color: #8A8681;
}

.search-bar__input:focus {
    background-color: #3A3A3A;
}

/* Кнопка очистки/загрузки */
.search-bar__submit {
    width: 60px;
    height: 56px;
    overflow: hidden;
    white-space: nowrap;
    text-indent: 60px;
    border: none;
    background: none;
    position: absolute;
    right: 0;
    cursor: pointer;
}

.search-bar__submit--clear {
    background-image: url("data:image/svg+xml,%3Csvg width='24' height='24' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M18 6L6 18M6 6L18 18' stroke='%23FDF2E4' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
}

.search-bar__submit--loading {
    background-image: none;
}

.search-bar__submit--loading:after {
    content: " ";
    display: block;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 3px solid #fff;
    border-color: #fff transparent #fff transparent;
    animation: lds-dual-ring 1.2s linear infinite;
    position: absolute;
    top: 50%;
    left: 50%;
    margin: -14px 0 0 -14px;
    box-sizing: border-box;
}

/* Результаты поиска */
.search-bar__results {
    background-color: #414141;
    z-index: 1501;
}

.search-bar__items {
    height: 100%;
}

.search-bar__results--active {
    transform: translateX(0);
}

.search-bar__results .spinner {
    display: none;
}

/* Элемент результата */
.search-bar__result-wrapper {
    border-top: 1px solid #4B4B4B;
    border-bottom: 1px solid #313131;
    cursor: pointer;
}

.search-bar__result-wrapper:hover,
.search-bar__result-wrapper:hover .search-bar__result {
    transition: background-color .3s;
    background-color: #4B4B4B;
}

.search-bar__result {
    height: 80px;
    display: flex;
    align-items: center;
    gap: 13px;
    color: #fff;
    background-color: #414141;
    padding: 8px 20px;
    box-sizing: border-box;
    -webkit-tap-highlight-color: rgba(44,44,44,0.5);
    width: 535px;
    margin: 0 auto;
}

.search-bar__result.girls-result {
    height: 120px;
    padding: 14px 20px;
}

.search-bar__result-wrapper:last-child {
    border-bottom: none;
}

/* Изображение в результате */
.search-bar__result--image {
    width: 60px;
    height: 60px;
    border-radius: 10px;
    overflow: hidden;
    pointer-events: none;
    flex-shrink: 0;
}

.search-bar__result.girls-result .search-bar__result--image {
    width: 90px;
    height: 90px;
}

.search-bar__result--image img {
    object-fit: cover;
    object-position: center top;
    width: 100%;
    height: 100%;
}

/* Текст в результате */
.search-bar__result--name {
    text-align: left;
    line-height: 24px;
    flex: 1;
}

.search-bar__result--title {
    font-size: 21px;
    color: #FDF2E4;
    font-weight: 500;
    margin-bottom: 4px;
}

.search-bar__result--subtitle {
    color: #8A8681;
    font-size: 16px;
}

/* Сообщение "Нет результатов" */
.search-bar__noresults {
    padding: 25px 20px;
    color: #fff;
    text-align: center;
    line-height: 22px;
    margin-bottom: -26px;
}

.search-bar__noresults:before {
    display: inline-block;
    width: 22px;
    height: 22px;
    content: '';
    background: url("data:image/svg+xml,%3Csvg width='22' height='22' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M12 9V13M12 17H12.01M21 12C21 16.971 16.971 21 12 21C7.029 21 3 16.971 3 12C3 7.029 7.029 3 12 3C16.971 3 21 7.029 21 12Z' stroke='%23FDF2E4' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") 0 50% no-repeat;
    vertical-align: bottom;
    margin-right: 7px;
}

/* Сообщение внизу */
.search-bottom-message {
    padding: 40px 20px 20px;
    color: #fff;
    opacity: 0.5;
    text-align: center;
    line-height: 22px;
    width: 450px;
    margin: 0 auto;
}

/* Анимация загрузки */
@keyframes lds-dual-ring {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* Адаптивность */
@media (max-width: 768px) {
    .search-bar__inputs {
        width: calc(100% - 42px);
        padding: 0 21px;
    }
    
    .search-bar__result {
        width: calc(100% - 40px);
        padding: 8px 20px;
    }
    
    .search-bar__result.girls-result {
        width: calc(100% - 40px);
    }
    
    .search-bottom-message {
        width: calc(100% - 40px);
    }
}

@media (max-width: 480px) {
    .search-bar__inputs {
        margin-top: 60px;
    }
    
    .search-close-btn {
        top: 15px;
        right: 15px;
        width: 35px;
        height: 35px;
        font-size: 16px;
    }
    
    .search-bar__form .search-bar__input {
        font-size: 18px;
        height: 50px;
        line-height: 48px;
        padding: 0 16px 0 50px;
    }
    
    .search-bar__form:before {
        width: 50px;
        height: 50px;
    }
    
    .search-bar__submit {
        width: 50px;
        height: 50px;
    }
}


