.catalog-results {
    position: relative;
}

.catalog-async__items {
    position: relative;
    isolation: isolate;

    min-width: 0;
}

.catalog-async__content {
    min-width: 0;
}

/* Підкладка над поточними товарами. */

.catalog-async__veil {
    position: absolute;
    z-index: 20;
    inset: 0;

    display: flex;
    flex-direction: column;
    align-items: center;

    box-sizing: border-box;

    padding: 24px;

    background: rgb(255 255 255 / 76%);

    pointer-events: none;

    animation: catalog-loader-appear 160ms ease-out;
}

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

/*
 * На довгому списку індикатор залишається
 * в межах видимої частини області товарів.
 */

.catalog-async__loader {
    position: sticky;
    top: max(24px, calc(50vh - 48px));
    top: max(24px, calc(50dvh - 48px));

    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;

    box-sizing: border-box;

    width: max-content;
    max-width: 100%;
    padding: 20px 24px;

    border: 1px solid #e8f6ff;
    border-radius: 24px;

    color: #0093ee;
    background: #ffffff;

    box-shadow: 0 8px 32px rgb(0 147 238 / 10%);

    font-family: inherit;
    font-size: 14px;
    font-weight: 400;
    line-height: 20px;
    text-align: center;
}

.catalog-async__loader > span {
    min-width: 0;
    overflow-wrap: anywhere;
}

/* Спінер із розривом у стилі SpinnerGap. */

.catalog-async__spinner {
    display: block;
    flex: 0 0 auto;

    width: 32px;
    height: 32px;

    color: #0093ee;

    transform-origin: center;

    animation: catalog-loader-spin 800ms linear infinite;
}

/* Компактний стан завантаження в мобільній панелі. */

.catalog-panel__header {
    gap: 12px;
}

.catalog-panel__close {
    flex: 0 0 32px;
}

.catalog-async__panel-status {
    display: flex;
    flex: 1 1 auto;
    align-items: center;
    gap: 8px;

    min-width: 0;
    margin-right: auto;

    color: #0093ee;

    font-family: inherit;
    font-size: 14px;
    font-weight: 400;
    line-height: 20px;
}

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

.catalog-async__panel-status .catalog-async__spinner {
    width: 20px;
    height: 20px;
}

.catalog-async__panel-status > span {
    min-width: 0;
    overflow-wrap: anywhere;
}

/* Повідомлення для скринридерів. */

.catalog-async__status {
    position: absolute;

    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;

    overflow: hidden;

    clip-path: inset(50%);
    white-space: nowrap;

    border: 0;
}

/* Помилка оновлення та повторна спроба. */

.catalog-async__error {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;

    margin-bottom: 16px;
    padding: 16px;

    border: 1px solid #e8f6ff;
    border-radius: 16px;

    color: #424242;
    background: #e8f6ff;

    font-size: 14px;
    line-height: 20px;
}

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

.catalog-async__error p {
    flex: 1 1 220px;

    min-width: 0;
    margin: 0;
}

.catalog-async__retry {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    min-height: 40px;
    margin: 0;
    padding: 8px 16px;

    border: 0;
    border-radius: 20px;

    color: #ffffff;
    background: #0093ee;

    font: inherit;

    cursor: pointer;

    transition: background-color 180ms ease-out;
}

.catalog-async__retry:hover {
    background: #ee6a00;
}

.catalog-async__retry:focus-visible {
    outline: 2px solid #0093ee;
    outline-offset: 3px;
}

.catalog-panel .catalog-async__error {
    position: sticky;
    z-index: 30;
    top: 0;
}

@keyframes catalog-loader-spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

@keyframes catalog-loader-appear {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@media (prefers-reduced-motion: reduce) {
    .catalog-async__veil,
    .catalog-async__spinner {
        animation: none;
    }

    .catalog-async__retry {
        transition: none;
    }
}