.catalog-search {
    position: relative;
    z-index: 20;
    width: 100%;
    margin: 1.75rem auto 0;
}

.catalog-search__control {
    position: relative;
    min-width: 0;
    flex: 1 1 auto;
}

.catalog-search__row {
    display: flex;
    flex-wrap: nowrap;
    gap: 0.65rem;
    align-items: stretch;
}

.catalog-search__icon {
    position: absolute;
    top: 50%;
    left: 1rem;
    display: grid;
    width: 2rem;
    height: 2rem;
    place-items: center;
    color: #1686c7;
    pointer-events: none;
    transform: translateY(-50%);
}

.catalog-search__input {
    width: 100%;
    min-height: 3.4rem;
    padding: 0.75rem 1rem 0.75rem 3.35rem;
    border: 1px solid rgba(8, 127, 209, 0.22);
    border-radius: 14px;
    outline: none;
    background: #fff;
    box-shadow: inset 0 1px 2px rgba(20, 68, 108, 0.04);
    color: #173d5d;
    font-size: 1rem;
    transition: border-color 160ms ease, box-shadow 160ms ease;
}

.catalog-search input.catalog-search__input {
    box-sizing: border-box;
    -webkit-appearance: none;
    appearance: none;
}

.catalog-search__input::placeholder {
    color: #788b9d;
}

.catalog-search__input:focus {
    border-color: rgba(8, 127, 209, 0.62);
    box-shadow: 0 0 0 4px rgba(8, 127, 209, 0.11);
}

.catalog-search__locator {
    display: inline-flex;
    min-height: 3.4rem;
    flex: 0 0 auto;
    gap: 0.5rem;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1rem;
    border: 1px solid rgba(8, 127, 209, 0.24);
    border-radius: 14px;
    background: linear-gradient(135deg, rgba(229, 246, 255, 0.98), rgba(238, 250, 255, 0.98));
    box-shadow: 0 8px 20px rgba(20, 68, 108, 0.08);
    color: #0874c9;
    font-size: 0.9rem;
    font-weight: 800;
    line-height: 1.1;
    text-decoration: none;
    white-space: nowrap;
    transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease, background 160ms ease;
}

.catalog-search__locator:hover,
.catalog-search__locator:focus-visible {
    border-color: rgba(8, 127, 209, 0.48);
    outline: none;
    background: linear-gradient(135deg, rgba(218, 241, 255, 1), rgba(232, 248, 255, 1));
    box-shadow: 0 0 0 4px rgba(8, 127, 209, 0.1), 0 10px 24px rgba(20, 68, 108, 0.12);
}

.catalog-search__locator:hover {
    transform: translateY(-1px);
}

.catalog-search__locator i {
    font-size: 0.95rem;
}

.catalog-search__status {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.catalog-search__results {
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
    left: 0;
    overflow: hidden;
    border: 1px solid rgba(8, 127, 209, 0.2);
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 18px 45px rgba(15, 51, 78, 0.2);
}

.catalog-search__results[hidden] {
    display: none;
}

.catalog-search__results ul {
    max-height: min(28rem, 65vh);
    margin: 0;
    padding: 0.4rem;
    overflow-y: auto;
    list-style: none;
    overscroll-behavior: contain;
}

.catalog-search__results li {
    margin: 0;
}

.catalog-search-result {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 0.75rem;
    align-items: center;
    min-height: 3.7rem;
    padding: 0.65rem 0.75rem;
    border-radius: 10px;
    background: transparent;
    color: #173d5d;
    text-decoration: none;
}

.catalog-search-result__icon {
    display: grid;
    width: 2.25rem;
    height: 2.25rem;
    place-items: center;
    border-radius: 10px;
    background: rgba(8, 127, 209, 0.1);
    color: #087fd1;
    font-size: 0.85rem;
}

.catalog-search-result__content {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 0.12rem;
}

.catalog-search-result__content strong {
    overflow: hidden;
    color: #173d5d;
    font-size: 0.91rem;
    line-height: 1.3;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.catalog-search-result__content small {
    overflow: hidden;
    color: #6a7f92;
    font-size: 0.75rem;
    line-height: 1.3;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.catalog-search-result__kind {
    padding: 0.2rem 0.45rem;
    border-radius: 999px;
    background: rgba(8, 127, 209, 0.08);
    color: #46708f;
    font-size: 0.66rem;
    font-weight: 750;
    white-space: nowrap;
}

.catalog-search-result:hover,
.catalog-search-result:focus-visible,
.catalog-search-result[aria-selected="true"] {
    outline: none;
    background: rgba(220, 241, 255, 0.75);
}

.catalog-search__empty {
    margin: 0;
    padding: 1.25rem;
    color: #65798c;
    text-align: center;
}

body.dark .catalog-search {
    background: transparent;
}

body.dark .catalog-search__input {
    border-color: rgba(139, 211, 255, 0.22);
    background: rgba(19, 38, 53, 0.96);
    color: #f2f8ff;
}

body.dark .catalog-search__input::placeholder {
    color: #9fb4c5;
}

body.dark .catalog-search__locator {
    border-color: rgba(139, 211, 255, 0.22);
    background: linear-gradient(135deg, rgba(31, 65, 88, 0.98), rgba(27, 57, 77, 0.98));
    color: #8bd3ff;
    box-shadow: 0 8px 20px rgba(3, 12, 20, 0.28);
}

body.dark .catalog-search__locator:hover,
body.dark .catalog-search__locator:focus-visible {
    border-color: rgba(139, 211, 255, 0.48);
    background: linear-gradient(135deg, rgba(39, 80, 106, 0.98), rgba(32, 70, 94, 0.98));
}

body.dark .catalog-search__status,
body.dark .catalog-search__empty {
    color: #bad0df;
}

body.dark .catalog-search__results {
    border-color: rgba(139, 211, 255, 0.22);
    background: #1e3343;
    box-shadow: 0 20px 48px rgba(3, 12, 20, 0.52);
}

body.dark .catalog-search-result {
    color: #d9f1ff;
}

body.dark .catalog-search-result__icon {
    background: rgba(71, 181, 241, 0.16);
    color: #8bd3ff;
}

body.dark .catalog-search-result__content strong {
    color: #f4faff;
}

body.dark .catalog-search-result__content small {
    color: #bad0df;
}

body.dark .catalog-search-result__kind {
    background: rgba(139, 211, 255, 0.12);
    color: #ccecff;
}

body.dark .catalog-search-result:hover,
body.dark .catalog-search-result:focus-visible,
body.dark .catalog-search-result[aria-selected="true"] {
    background: rgba(63, 105, 134, 0.72);
}

@media (max-width: 600px) {
    .catalog-search {
        margin-top: 1.35rem;
    }

    .catalog-search__row {
        gap: 0.45rem;
    }

    .catalog-search__input {
        font-size: 16px;
    }

    .catalog-search__locator {
        width: 3.4rem;
        min-width: 3.4rem;
        padding: 0;
        font-size: 1rem;
    }

    .catalog-search__locator span {
        display: none;
    }

    .catalog-search-result__kind {
        display: none;
    }

    .catalog-search-result {
        grid-template-columns: auto minmax(0, 1fr);
    }
}
