.modal-search {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    display: none;
}

.modal-search--open {
    display: block;
}

.modal-search__overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(2px);
}

.modal-search__window {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    max-width: 900px;
    max-height: calc(100vh - 80px);
    overflow-y: auto;
    background-color: #1A2F3D;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow:
        0 20px 60px rgba(0, 0, 0, 0.5),
        0 0 0 1px rgba(255, 255, 255, 0.05);
    padding: 32px;
    box-sizing: border-box;
}

.modal-search__form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.modal-search__field {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.modal-search__label {
    font-family: var(--font-body);
    font-weight: var(--font-weight-thin);
    font-size: var(--fs-s);
    color: rgba(255, 255, 255, 0.5);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.modal-search__input,
.modal-search__select {
    background-color: #11212D;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    padding: 10px 14px;
    font-family: var(--font-body);
    font-weight: var(--font-weight-thin);
    font-size: var(--fs-m);
    color: #ffffff;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
}

.modal-search__input:focus,
.modal-search__select:focus {
    border-color: rgba(232, 80, 2, 0.5);
    box-shadow: 0 0 0 3px rgba(232, 80, 2, 0.1);
}

.modal-search__input::placeholder {
    color: rgba(255, 255, 255, 0.25);
}

.modal-search__select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='rgba(255, 255, 255, 0.5)' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 40px;
    cursor: pointer;
}

.modal-search__select option {
    background-color: #11212D;
    color: #ffffff;
}

.modal-search__actions {
    display: flex;
    justify-content: center;
    padding-top: 8px;
}

.modal-search__btn {
    background: none;
    border: none;
    color: #ffffff;
    font-family: var(--font-body);
    font-weight: var(--font-weight-thin);
    font-size: var(--fs-l);
    cursor: pointer;
    white-space: nowrap;
    padding: 8px 0;
    line-height: 1;
    transition: color 0.2s;
    min-height: 44px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.modal-search__btn::before,
.modal-search__btn::after {
    content: '|';
    display: inline-block;
    color: transparent;
    font-family: var(--font-body);
    font-size: inherit;
    font-weight: var(--font-weight-thin);
    transition: color 0.2s;
    vertical-align: middle;
}

.modal-search__btn:hover {
    color: #E85002;
}

.modal-search__btn:hover::before,
.modal-search__btn:hover::after {
    color: #E85002;
}

/* === Теги === */
.modal-search__tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    width: 100%;
}

.modal-search__tag {
    font-family: var(--font-body);
    font-weight: var(--font-weight-thin);
    font-size: var(--fs-s);
    color: #ffffff;
    cursor: pointer;
    padding: 4px 0;
    transition: color 0.2s;
    user-select: none;
}

.modal-search__tag:hover {
    color: #E85002;
}

.modal-search__tag--selected {
    color: #E85002;
}

/* Планшет */
@media (max-width: 768px) {
    .modal-search__window {
        max-width: calc(100% - 48px);
        padding: 24px;
    }
}

/* Телефон */
@media (max-width: 480px) {
    .modal-search__window {
        max-width: calc(100% - 16px);
        padding: 20px;
        border-radius: 10px;
    }

    .modal-search__form {
        gap: 12px;
    }
}

/* === Автодополнение === */
.modal-search__autocomplete {
    position: relative;
}

.modal-search__dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background-color: #11212D;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    max-height: 200px;
    overflow-y: auto;
    z-index: 10;
    margin-top: 4px;
}

.modal-search__dropdown--open {
    display: block;
}

.modal-search__dropdown-item {
    padding: 10px 14px;
    cursor: pointer;
    font-family: var(--font-body);
    font-size: var(--fs-s);
    color: rgba(255, 255, 255, 0.7);
    transition: background-color 0.2s, color 0.2s;
}

.modal-search__dropdown-item:hover {
    background-color: #1A2F3D;
    color: #E85002;
}

.modal-search__dropdown-empty {
    padding: 10px 14px;
    font-family: var(--font-body);
    font-size: var(--fs-s);
    color: rgba(255, 255, 255, 0.3);
}

/* === Чипсы (выбранные теги/бренды) === */
.modal-search__chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}

.modal-search__chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background-color: rgba(232, 80, 2, 0.15);
    color: #E85002;
    padding: 4px 10px;
    border-radius: 16px;
    font-family: var(--font-body);
    font-size: var(--fs-s);
}

.modal-search__chip-remove {
    cursor: pointer;
    font-size: var(--fs-s);
    line-height: 1;
    margin-left: 2px;
    color: #E85002;
}

.modal-search__chip-remove:hover {
    color: #FF6A1A;
}

/* === Популярные теги/бренды === */
.modal-search__popular {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin-top: 4px;
}

.modal-search__popular-label {
    font-family: var(--font-body);
    font-size: var(--fs-xs);
    color: rgba(255, 255, 255, 0.3);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-right: 2px;
}

.modal-search__popular-chip {
    font-family: var(--font-body);
    font-size: var(--fs-xs);
    color: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    padding: 2px 8px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.2s;
}

.modal-search__popular-chip:hover {
    color: #E85002;
    border-color: #E85002;
    background-color: rgba(232, 80, 2, 0.1);
}

.modal-search__multiselect {
    position: relative;
}

.modal-search__multiselect-btn {
    width: 100%;
    text-align: left;
    cursor: pointer;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-family: var(--font-body);
    font-weight: var(--font-weight-thin);
    font-size: var(--fs-m);
}

.modal-search__multiselect-btn::after {
    content: '▾';
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(255, 255, 255, 0.5);
    pointer-events: none;
}

@media (min-width: 2000px) {
    .modal-search__window {
        max-width: 1000px;
        padding: 48px;
    }
}