.product-lists-status {
    position: absolute;

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

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

    border: 0;
}

/* Повідомлення обраного та порівняння. */

.product-lists-error {
    --notice-accent: #ee6a00;
    --notice-soft: #fff3e8;

    position: fixed;
    z-index: 2000;
    left: 50%;
    bottom: max(24px, env(safe-area-inset-bottom));

    display: grid;
    grid-template-columns: 40px minmax(0, 1fr) 32px;
    align-items: start;
    gap: 12px;

    box-sizing: border-box;

    width: min(560px, calc(100% - 48px));
    margin: 0;
    padding: 16px;

    border: 1px solid #e8f6ff;
    border-left: 4px solid var(--notice-accent);
    border-radius: 20px;

    color: #424242;
    background: #ffffff;

    box-shadow:
            0 12px 40px rgb(0 147 238 / 14%),
            0 2px 8px rgb(0 0 0 / 4%);

    font-family: "Inter", Arial, sans-serif;
    font-size: 14px;
    font-weight: 400;
    line-height: 20px;

    opacity: 0;
    transform: translate(-50%, 12px);

    pointer-events: none;

    transition:
            opacity 220ms ease,
            transform 220ms ease;
}

.product-lists-error.is-visible {
    opacity: 1;
    transform: translate(-50%, 0);

    pointer-events: auto;

    animation:
            product-lists-notice-enter
            260ms
            cubic-bezier(0.2, 0.7, 0.3, 1);
}

.product-lists-error[hidden],
.product-lists-error [hidden] {
    display: none !important;
}

.product-lists-notice__icon {
    display: flex;
    grid-column: 1;
    grid-row: 1;
    align-items: center;
    justify-content: center;

    width: 40px;
    height: 40px;

    border-radius: 14px;

    color: var(--notice-accent);
    background: var(--notice-soft);
}

.product-lists-notice__icon svg {
    display: block;
    flex: 0 0 auto;

    width: 24px;
    height: 24px;
}

.product-lists-notice__message {
    grid-column: 2;
    grid-row: 1;
    align-self: center;

    min-width: 0;
    margin: 0;

    overflow-wrap: anywhere;
}

.product-lists-notice__close {
    display: inline-flex;
    grid-column: 3;
    grid-row: 1;
    align-items: center;
    justify-content: center;

    width: 32px;
    height: 32px;
    margin: 0;
    padding: 6px;

    border: 0;
    border-radius: 50%;

    color: #9e9e9e;
    background: transparent;

    cursor: pointer;

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

.product-lists-notice__close svg {
    display: block;

    width: 20px;
    height: 20px;
}

.product-lists-notice__close:hover {
    color: #ee6a00;
    background: #fff3e8;
}

.product-lists-notice__retry {
    display: inline-flex;
    grid-column: 2;
    grid-row: 2;
    justify-self: start;
    align-items: center;
    justify-content: center;

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

    border: 0;
    border-radius: 20px;

    color: #ffffff;
    background: #0093ee;

    font: inherit;
    font-weight: 500;

    cursor: pointer;

    transition: background-color 180ms ease;
}

.product-lists-notice__retry:hover {
    background: #ee6a00;
}

.product-lists-notice__retry:disabled {
    opacity: 0.6;
    cursor: progress;
}

.product-lists-notice__close:focus-visible,
.product-lists-notice__retry:focus-visible {
    outline: 2px solid #0093ee;
    outline-offset: 3px;
}

/*
 * Окрема анімація забезпечує плавну появу,
 * навіть якщо браузер об’єднав зняття hidden
 * та додавання класу is-visible.
 *
 * Не використовуємо animation-fill-mode: forwards,
 * щоб анімація не заважала плавному зникненню.
 */

@keyframes product-lists-notice-enter {
    from {
        opacity: 0;
        transform: translate(-50%, 12px);
    }

    to {
        opacity: 1;
        transform: translate(-50%, 0);
    }
}

/* Прелоадер списків. */

.saved-products-page {
    position: relative;
}

.saved-products-page > .product-lists-veil {
    z-index: 40;

    padding: 24px;

    pointer-events: auto;
}

.product-lists-veil .catalog-async__loader {
    max-width: min(320px, 100%);
}

/* Порожні списки. Тексти надходять із бази. */

.saved-products-page .saved-products-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 24px;

    box-sizing: border-box;

    width: 100%;
    min-height: 280px;
    margin: 0;
    padding: 40px 24px;

    border: 3px solid #f5f5f5;
    border-radius: 24px;

    color: #424242;
    background:
            linear-gradient(
                    180deg,
                    #f4fbff 0%,
                    #ffffff 100%
            );

    font-family: "Inter", Arial, sans-serif;
    font-size: 18px;
    font-weight: 400;
    line-height: 28px;
    text-align: center;

    overflow-wrap: anywhere;
}

.saved-products-empty__icon {
    display: flex;
    flex: 0 0 80px;
    align-items: center;
    justify-content: center;

    width: 80px;
    height: 80px;

    border-radius: 50%;

    color: var(--sv-interaction-primary, #0093ee);
    background: #e8f6ff;
}

.saved-products-empty__icon svg {
    display: block;
    flex: 0 0 auto;

    width: 36px;
    height: 36px;
}

.saved-products-empty__message {
    display: block;

    max-width: 36ch;
    margin: 0;

    text-wrap: balance;
}

@media (max-width: 575px) {
    .product-lists-error {
        bottom: max(
                16px,
                calc(env(safe-area-inset-bottom) + 8px)
        );

        grid-template-columns: 36px minmax(0, 1fr) 28px;
        gap: 10px;

        width: calc(100% - 32px);
        padding: 14px 12px;

        border-radius: 16px;
    }

    .product-lists-notice__icon {
        width: 36px;
        height: 36px;

        border-radius: 12px;
    }

    .product-lists-notice__icon svg {
        width: 22px;
        height: 22px;
    }

    .product-lists-notice__close {
        width: 28px;
        height: 28px;
        padding: 4px;
    }

    .saved-products-page > .product-lists-veil {
        padding: 16px;
    }

    .saved-products-page .saved-products-empty {
        gap: 20px;

        min-height: 240px;
        padding: 32px 20px;

        border-radius: 20px;

        font-size: 16px;
        line-height: 24px;
    }

    .saved-products-empty__icon {
        flex-basis: 72px;

        width: 72px;
        height: 72px;
    }

    .saved-products-empty__icon svg {
        width: 32px;
        height: 32px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .product-lists-error,
    .product-lists-notice__close,
    .product-lists-notice__retry {
        animation: none;
        transition: none;
    }
}