/*
 * Розміри діалогів.
 */

.checkout-page dialog.checkout-dialog {
    position: fixed;
    inset: auto;
    top: 50%;
    left: 50%;
    translate: -50% -50%;

    width: 480px;
    height: fit-content;
    min-width: 0;
    min-height: 0;

    max-width: calc(100vw - 32px);
    max-height: var(
            --checkout-dialog-limit,
            calc(100dvh - 32px)
    );

    margin: 0;
    overflow: hidden;
    box-sizing: border-box;
}

.checkout-page #checkout-customer-dialog {
    width: 420px;
}

.checkout-page dialog.checkout-dialog > form {
    display: flex;
    flex-direction: column;
    flex: none;

    width: 100%;
    height: auto;
    min-width: 0;
    min-height: 0;

    max-height: max(
            0px,
            calc(
                    var(--checkout-dialog-limit, 100dvh - 32px)
                    - var(--checkout-dialog-edges, 54px)
            )
    );

    margin: 0;
    padding: 0;
}

.checkout-page .checkout-dialog__body {
    flex: 0 1 auto;
    min-width: 0;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.checkout-page .checkout-dialog .checkout-card__header,
.checkout-page .checkout-dialog__actions,
.checkout-page .checkout-dialog-status,
.checkout-page .checkout-dialog > form > .checkout-error,
.checkout-page .checkout-dialog > form > [data-refresh] {
    flex: 0 0 auto;
}

/*
 * Прелоадер.
 */

.checkout-page .checkout-busy .catalog-async__loader {
    position: static;
    top: auto;
}

.checkout-page .checkout-dialog-status.catalog-async__loader {
    position: static;
    top: auto;

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

    width: 100%;
    max-width: 100%;
    min-height: 56px;

    margin: 16px 0 0;
    padding: 12px 16px;

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

    color: #0093ee;
    background: #fff;

    box-shadow: 0 8px 24px rgb(0 147 238 / 8%);
}

.checkout-page .checkout-dialog-status svg.catalog-async__spinner {
    flex: 0 0 24px;
    width: 24px;
    height: 24px;
}

.checkout-page .checkout-picker-status[data-kind="loading"]
svg.catalog-async__spinner {
    display: block;
    flex: 0 0 20px;
    width: 20px;
    height: 20px;
}

.checkout-page .checkout-picker-status:not([data-kind="loading"])
svg.catalog-async__spinner {
    display: none;
}

.checkout-page .checkout-busy svg.catalog-async__spinner {
    flex: 0 0 32px;
    width: 32px;
    height: 32px;
}

/*
 * Порожній кошик.
 */

.checkout-page .checkout-empty {
    --checkout-empty-padding: 32px;

    position: relative;

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

    width: 100%;
    min-width: 0;

    margin: 0;
    padding: var(--checkout-empty-padding);

    border: 0;
    border-radius: 24px;

    background: #e8f6ff;
    text-align: center;
}

.checkout-page .checkout-empty::before {
    content: "";
    display: block;
    width: 64px;
    height: 64px;
    margin-bottom: 4px;
    border-radius: 50%;
    background: #fff;
}

.checkout-page .checkout-empty::after {
    content: "";

    position: absolute;
    top: calc(var(--checkout-empty-padding) + 16px);
    left: 50%;

    width: 32px;
    height: 32px;
    margin-left: -16px;

    background: #0093ee;

    -webkit-mask:
            url("/images/icons/feather/shopping-cart-7bd65ab9b926192508611d034842f111.svg")
            center / contain no-repeat;

    mask:
            url("/images/icons/feather/shopping-cart-7bd65ab9b926192508611d034842f111.svg")
            center / contain no-repeat;

    pointer-events: none;
}

.checkout-page .checkout-empty h2 {
    max-width: 100%;
    margin: 0;

    color: #000;
    font-size: 20px;
    font-weight: 700;
    line-height: 28px;

    overflow-wrap: anywhere;
}

.checkout-page .checkout-empty p {
    max-width: 420px;
    margin: 0;

    color: #666;
    font-size: 14px;
    line-height: 22px;

    overflow-wrap: anywhere;
}

.checkout-page .checkout-empty > .checkout-button {
    margin-top: 8px;
}

/*
 * Деталі підтвердженого замовлення.
 *
 * Не успадковуємо 18px від зовнішнього блоку
 * повідомлення про успішне оформлення.
 */

.checkout-page .checkout-receipt {
    color: #424242;
    font-family: "Inter", Arial, sans-serif;
    font-size: 14px;
    font-weight: 400;
    line-height: 20px;
}

.checkout-page .checkout-receipt__card p {
    font-size: 14px;
    font-weight: 400;
    line-height: 20px;
}

.checkout-page .checkout-receipt__items li {
    align-items: center;
}

.checkout-page .checkout-receipt__items strong {
    font-size: 14px;
    font-weight: 500;
    line-height: 20px;
}

.checkout-page .checkout-receipt__items li > span {
    font-size: 14px;
    font-weight: 400;
    line-height: 20px;
}

.checkout-page .checkout-receipt__installation > span {
    color: #757575;
    font-size: 13px;
    line-height: 20px;
}

.checkout-page .checkout-receipt__service-icon {
    align-items: center;
}

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

.checkout-page .checkout-button,
.checkout-page .checkout-icon-button {
    transition:
            color var(--sv-interaction-duration, 180ms) ease-out,
            background-color var(--sv-interaction-duration, 180ms) ease-out,
            border-color var(--sv-interaction-duration, 180ms) ease-out;
}

.checkout-page .checkout-icon-button {
    border-radius: 50%;
}

/*
 * Додавання встановлення.
 */

.checkout-page .checkout-offer
> .checkout-button[data-installation="true"] {
    flex: 0 0 auto;
    border-color: rgb(238 106 0 / 20%);
    color: #0093ee;
    background: transparent;
}

@media (hover: hover) {
    .checkout-page .checkout-button:not([data-close]):not(
        [data-installation="true"]
    ):not(:disabled):not([aria-disabled="true"]):hover {
        border-color: var(--sv-interaction-hover, #ee6a00);
        color: #fff;
        background: var(--sv-interaction-hover, #ee6a00);
    }

    .checkout-page .checkout-offer
    > .checkout-button[data-installation="true"]:not(:disabled):not(
        [aria-disabled="true"]
    ):hover {
        border-color: var(--sv-interaction-hover, #ee6a00);
        color: var(--sv-interaction-hover, #ee6a00);
        background: transparent;
    }

    .checkout-page .checkout-button[data-close]:not(:disabled):not(
        [aria-disabled="true"]
    ):hover {
        border-color: var(--sv-interaction-hover, #ee6a00);
        color: var(--sv-interaction-hover, #ee6a00);
        background: #e8f6ff;
    }

    .checkout-page .checkout-icon-button:not(:disabled):not(
        [aria-disabled="true"]
    ):hover {
        color: #fff;
        background: var(--sv-interaction-hover, #ee6a00);
    }
}

/*
 * Приховані стани.
 */

.checkout-page [hidden],
.checkout-page dialog.checkout-dialog:not([open]) {
    display: none !important;
}

@media (max-width: 767px) {
    .checkout-page .checkout-empty {
        --checkout-empty-padding: 24px;
        gap: 12px;
    }

    .checkout-page .checkout-empty h2 {
        font-size: 18px;
        line-height: 26px;
    }

    .checkout-page .checkout-empty p {
        max-width: 320px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .checkout-page .checkout-button,
    .checkout-page .checkout-icon-button {
        transition: none;
    }
}