.catalog-search {
    direction: rtl;
}

.catalog-search__control {
    display: flex;
    min-height: 48px;
    align-items: center;
    gap: 8px;
    border: 1px solid transparent;
    border-radius: 8px;
    background: #f5f5f5;
    padding: 0 12px;
    transition: border-color 160ms ease, background-color 160ms ease;
}

.catalog-search:focus-within .catalog-search__control {
    border-color: #d8d8d8;
    background: #fff;
}

.catalog-search__input {
    min-width: 0;
    flex: 1;
    border: 0;
    outline: 0;
    background: transparent;
    color: #202020;
    font-size: 14px;
    letter-spacing: 0;
}

.catalog-search__input::-webkit-search-cancel-button {
    cursor: pointer;
}

.catalog-search__button {
    display: inline-flex;
    width: 36px;
    height: 36px;
    flex: 0 0 36px;
    align-items: center;
    justify-content: center;
    border: 0;
    background: transparent;
    color: #4b4b4b;
    cursor: pointer;
}

.catalog-search__results {
    position: absolute;
    inset-inline: 0;
    top: calc(100% + 6px);
    z-index: 70;
    max-height: min(68vh, 560px);
    overflow-y: auto;
    overscroll-behavior: contain;
    border: 1px solid #e2e2e2;
    border-radius: 0 0 8px 8px;
    background: #fff;
    box-shadow: 0 16px 34px rgba(0, 0, 0, 0.12);
}

.catalog-search__state {
    display: flex;
    min-height: 112px;
    align-items: center;
    justify-content: center;
    padding: 24px;
    color: #6b6b6b;
    font-size: 14px;
    text-align: center;
}

.catalog-search__spinner {
    width: 20px;
    height: 20px;
    margin-left: 10px;
    border: 2px solid #dedede;
    border-top-color: #252525;
    border-radius: 50%;
    animation: catalog-search-spin 700ms linear infinite;
}

@keyframes catalog-search-spin {
    to { transform: rotate(360deg); }
}

.catalog-search__section + .catalog-search__section {
    border-top: 1px solid #ededed;
}

.catalog-search__section-title {
    margin: 0;
    padding: 12px 16px 8px;
    color: #777;
    font-size: 12px;
    font-weight: 600;
}

.catalog-search__quick-links {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 0 16px 14px;
}

.catalog-search__quick-link {
    display: inline-flex;
    max-width: 100%;
    align-items: center;
    gap: 6px;
    border: 1px solid #e4e4e4;
    border-radius: 6px;
    background: #fff;
    padding: 7px 10px;
    color: #303030;
    font-size: 13px;
    text-decoration: none;
}

.catalog-search__quick-link:hover,
.catalog-search__quick-link.is-active {
    border-color: #bdbdbd;
    background: #f7f7f7;
}

.catalog-search__quick-link-subtitle {
    color: #8a8a8a;
    font-size: 11px;
}

.catalog-search__products {
    padding-bottom: 6px;
}

.catalog-search__product {
    display: grid;
    grid-template-columns: 56px minmax(0, 1fr) auto;
    min-height: 82px;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    color: #202020;
    text-decoration: none;
}

.catalog-search__product + .catalog-search__product {
    border-top: 1px solid #f0f0f0;
}

.catalog-search__product:hover,
.catalog-search__product.is-active {
    background: #f7f7f7;
}

.catalog-search__image-wrap {
    display: flex;
    width: 56px;
    height: 56px;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border: 1px solid #ededed;
    border-radius: 6px;
    background: #fff;
}

.catalog-search__image {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.catalog-search__image-placeholder {
    color: #aaa;
    font-size: 11px;
}

.catalog-search__product-body {
    min-width: 0;
}

.catalog-search__product-title {
    display: -webkit-box;
    overflow: hidden;
    color: #202020;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.75;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.catalog-search__meta {
    margin-top: 4px;
    overflow: hidden;
    color: #858585;
    font-size: 11px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.catalog-search__badges {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 7px;
}

.catalog-search__badge {
    border-radius: 4px;
    background: #f0f0f0;
    padding: 3px 6px;
    color: #606060;
    font-size: 10px;
}

.catalog-search__badge--available {
    background: #eaf7f0;
    color: #18794e;
}

.catalog-search__badge--unavailable {
    background: #fff0f0;
    color: #b42318;
}

.catalog-search__price {
    min-width: 96px;
    color: #313131;
    font-size: 12px;
    text-align: left;
    white-space: nowrap;
}

@media (max-width: 767px) {
    .catalog-search__results {
        max-height: min(62vh, 500px);
    }

    .catalog-search__product {
        grid-template-columns: 52px minmax(0, 1fr);
        padding-inline: 12px;
    }

    .catalog-search__image-wrap {
        width: 52px;
        height: 52px;
    }

    .catalog-search__price {
        grid-column: 2;
        min-width: 0;
        margin-top: -4px;
        text-align: right;
    }
}
