/*noinspection ALL*/
dialog {
    padding: var(--bs-border-radius-lg);
    border-radius: var(--bs-border-radius-lg);
    border: thin solid var(--bs-border-color);
    box-shadow: var(--bs-box-shadow);
    transition: 300ms;
    width: clamp(300px, 65%, 100%);

    &::backdrop {
        background-color: #00000059;
        backdrop-filter: blur(3px);
    }

    @starting-style {
        padding: 0;
    }
}

.cart-steps-container {
    max-width: 720px;
    margin-inline: auto;
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-pack: space-evenly;
    -ms-flex-pack: space-evenly;
    justify-content: space-evenly;
    -webkit-box-align: center;
    -ms-flex-align: center;
    align-items: center;

    .step {
        -webkit-box-flex: 0;
        -ms-flex: 0 0 auto;
        flex: 0 0 auto;
        width: clamp(3rem, 6rem, calc(100% / 3));
        padding: 1rem;

        img {
            width: 100%;
            height: 100%;
            -o-object-fit: contain;
            object-fit: contain;
            -o-object-position: center;
            object-position: center;
            -webkit-transition: 1s;
            transition: 1s;

            &.active {
                display: none;
            }

            @starting-style {
                opacity: 0;
            }
        }

        &:has(~ .active), &.active {
            img {
                display: none;

                &.active {
                    display: inline-block;
                }
            }
        }
    }

    .separator {
        -webkit-box-flex: 1;
        -ms-flex: 1;
        flex: 1;
        -ms-flex-item-align: center;
        -ms-grid-row-align: center;
        align-self: center;
        border-top: thin dashed var(--bs-body-color);
        position: relative;

        &::before {
            content: '';
            position: absolute;
            inset-inline-start: 0;
            top: -.25rem;
            width: 0;
            height: .5rem;
            background-color: var(--main-color);
            opacity: 0;
            -webkit-transition: 500ms;
            transition: 500ms;
            border-radius: .25rem;
        }

        &:has(~ .active) {
            &::before {
                width: 100%;
                opacity: 1;
            }
        }
    }
}

.cart-items-container {
    display: grid;
    grid-template-columns: 1fr 4fr max-content;
}

.cart-item {
    display: grid;
    grid-column: span 3;
    grid-template-columns: subgrid;
    grid-gap: var(--bs-gutter-x);
    transition: 300ms ease-in-out;

    .image {
        aspect-ratio: 1/1;
    }

    .info {
        .counter-container {
            max-width: 170px;
            font-size: .8em;

        }
    }

    .off-price {
        font-size: .8em;
    }

    .to-pay {
        font-size: 1.1em;
    }

    .actions {
        width: 15cap;

        input[type=number] {
            width: auto;
            -webkit-appearance: textfield;
            -moz-appearance: textfield;
            appearance: textfield;
        }

        * {
            color: inherit;
            font-weight: bolder;
        }

        *:focus-visible {
            outline: none;
        }
    }

    &:not(:last-child) {
        border-bottom: thin solid var(--bs-border-color);
    }
}

.radio-cards {
    .item {
        background-color: var(--bs-white);
        transition: 300ms ease-in-out;
        padding: 1em;
        cursor: pointer;
        position: relative;
        border-radius: var(--bs-border-radius-lg);
        border: thin solid var(--bs-border-color);

        input {
            display: none
        }

        .title {
            font-weight: bolder;
            font-size: 1.1em;
        }

        .description {
            font-size: .9em;
            opacity: .7;
        }

        &::after {
            content: '';
            position: absolute;
            top: 1em;
            inset-inline-end: 1em;
            width: 1.2rem;
            aspect-ratio: 1/1;
            overflow: hidden;
            display: block;
            background: var(--bs-light);
            border: thin solid var(--bs-border-color);
            border-radius: 50%;
            transition: inherit;
            font-family: "Font Awesome 6 Free";
            font-size: 11.5px;
            font-weight: 900;
            text-align: center;
            justify-content: center;
        }

        &:has(:checked) {
            box-shadow: var(--bs-box-shadow-sm);
            border-color: var(--bs-primary);

            &::after {
                content: "";
                background-color: var(--bs-primary);
                color: var(--bs-white);
                border-color: var(--bs-primary);
            }
        }
    }
}

.cart-bill {
    .item {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: .5rem 1.2rem;
        margin-inline: -1rem;

        &:last-child {
            text-align: end;
        }
    }
}
