@import '../../../styles/definitions/typography';
@import '../../../styles/definitions/variables';
@import '../../../styles/definitions/colors';
@import '../../../styles/definitions/breakpoints';
@import '../../../styles/mixins';
@import '../../../styles/fills';

$max-editions-height: 607px;

.volumePricingModal {
    &_wrapper {
        max-width: 100vw;
        top: 0px;
        position: sticky;
        width: 100%;
        z-index: 2;
        padding: 14px 0px 28px 0px;
        border: 1px solid #EAEAEA;
        background-color: #FFFFFF;
        box-shadow: 0 6px 8px 0 rgba(0,0,0,0.5);

        @include media-md-up {
            // capitalized Max due to a sass-loader issue in storybook
            top: Max(calc(50vh - 350px), 1px); // half the view height minus half the height of the modal
            position: absolute;
            left: 50%;
            transform: translate((-50%));
            width: 874px;
            border-radius: 4px;
            padding: 14px 30px 28px 28px;
        }

        @include media-md-down {
            height: 100vh;
            overflow: scroll;
            -ms-overflow-style: none;  /* IE and Edge */
            scrollbar-width: none;  /* Firefox */
        }
    }

    /* Hide scrollbar for Chrome, Safari and Opera */
    &_wrapper::-webkit-scrollbar {
        @include media-md-down {
            display: none;
        }
    }
    
    &_scrim {
        background-color: var(--scrim-background-color, #{$header-scrim-bg-color});
        left: 0;
        right: 0;
        top: 0;
        box-sizing: border-box;
        height: calc(var(--scrim-height-cancom, 100%));
        width: 100%;
        position: absolute;
        z-index: 10;

        @include media-md-up {
            left: 50%;
            transform: translate(-50%);
        }
    }

    &_header {
        display: flex;
        justify-content: space-between;

        @include media-md-down {
            padding: 0 19px 0 28px;
        }
    }

    &_title {
        @include title-1;
        height: auto;
        padding-right: 10px;
    }

    &_closeWrapper {
        display: flex;
        cursor: pointer;
    }

    &_closeText {
        @include title-5;
        padding-top: 3px;
        padding-right: 19px;
        color: $deep-gray;
    }

    &_closeIcon {
        width: 26px;
        margin-right: -6px;
        path {
            @include fill-deepGray;
        }
    }

    &_editionsWrapper {
        overflow-y: auto;

        @include media-md-up {
            max-height: $max-editions-height;
            margin-right: -15px;
        }
    }
}

.volumePricingModalBodyScrollDisable {
    overflow: hidden;
}
