@use '../../variables' as *;

$b: '.dialog';

#{$b} {
    background-color: $dialog-backdrop-color;
    height: calc(100% - var(--tab-bar-height));
    left: 0;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 990;

    @media (--tablet-landscape-up) {
        align-items: center;
        display: flex;
        flex-direction: column;
        height: 100%;
        justify-content: center;
        padding: 4px * 10 0;
    }

    &_overflow {
        @media (--tablet-landscape-up) {
            justify-content: flex-start;
        }
    }

    &_s {
    }

    &_m {
    }

    &_l {
    }

    &__wrapper {
        background-color: $dialog-bg;
        color: $dialog-color;
        min-height: 100%;
        padding: 4px * 8 4px * 4;
        width: 100%;

        @media (--tablet-landscape-up) {
            border-radius: $dialog-radius;
            box-shadow: $dialog-shadow;
            min-height: auto;
            padding: 4px * 10;
            position: relative;
        }

        #{$b}_overflow & {
            flex-shrink: 0;
            min-height: auto;
        }

        #{$b}_s & {
            max-width: $dialog-s-max-width;
        }

        #{$b}_m & {
            max-width: $dialog-m-max-width;
        }

        #{$b}_l & {
            max-width: $dialog-l-max-width;
        }
    }

    &__close {
        align-items: center;
        background-color: $dialog-bg;
        border-radius: $dialog-close-radius;
        color: $dialog-close-color;
        cursor: pointer;
        display: flex;
        height: 4px * 10;
        justify-content: center;
        position: fixed;
        right: 4px * 2;
        top: 4px * 2;
        transition-duration: var(--duration-micro-s);
        transition-property: color;
        transition-timing-function: var(--easing-standard);
        width: 4px * 10;
        z-index: 1;

        @media (--tablet-landscape-up) {
            position: absolute;
        }

        &:hover,
        &:focus-visible {
            color: $dialog-close-active-color;
        }
    }

    &__close-icon {
        fill: currentcolor;
        height: 4px * 5;
        width: 4px * 5;
    }

    &__container {
    }

    &__header {
        align-items: center;
        display: flex;
    }

    &__header-image {
        border: $dialog-header-image-border-width solid $dialog-header-image-border-color;
        border-radius: $dialog-radius;
        flex-shrink: 0;
        height: 4px * 20;
        margin-right: 4px * 6;
        object-fit: contain;
        width: 4px * 20;

        @media (--tablet-portrait-down) {
            display: none;
        }

        @media (--desktop-up) {
            height: 4px * 22;
            width: 4px * 22;
        }
    }

    &__header-wrapper {
    }

    &__title {
        width: calc(100% - 40px);

        @include font($dialog-title-mobile-font);

        @media (--tablet-landscape-up) {
            width: auto;

            @include font($dialog-title-desktop-font);
        }
    }

    &__descr {
        margin-top: 4px * 6;
        max-width: 672px;
    }

    &__form {
        margin-top: 4px * 6;
    }

    &__product-table {
        margin-top: 4px * 6;
    }

    &__action-list {
        align-items: center;
        display: flex;
        flex-direction: column;
        margin-top: 4px * 6;

        @media (--tablet-landscape-up) {
            flex-direction: row;
        }

        &_right {
            @media (--tablet-landscape-up) {
                justify-content: flex-end;
            }
        }
    }

    &__action-item {
        max-width: 4px * 62;
        white-space: normal;

        &:not(:first-child) {
            margin-top: 4px * 6;

            @media (--tablet-landscape-up) {
                margin-left: 4px * 6;
                margin-top: 0;
            }
        }

        &.button {
            @media (--tablet-portrait-down) {
                width: 100%;
            }
        }
    }
}
