@import '../../../../styles/variables.scss';
@import '~@gravity-ui/uikit/styles/mixins';

$class: 'dl-collections-navigation-layout';

.#{$class} {
    position: relative;
    height: 100%;

    &__page-wrapper {
        position: absolute;
        inset: calc($actionPanelHeight) 0 0 0;
        display: grid;
        grid-template-rows: auto minmax(auto, $footerHeight);
        overflow-y: auto;
        scrollbar-gutter: stable;
        padding-top: 28px;
    }

    &__page {
        display: flex;
        flex: 1;
        flex-direction: column;
        width: 100%;
        max-width: 936px;
        padding: 0 20px;
        justify-self: center;
    }

    &__header {
        display: flex;
    }

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

    &__header-title {
        @include text-header-2;

        display: flex;
        margin: 0;
        margin-right: 8px;
    }

    &__header-title-actions-block {
        display: flex;
        margin-right: 8px;
        white-space: nowrap;
        align-self: flex-start;
    }

    &__header-right-block {
        display: flex;
        white-space: nowrap;
    }

    &__header-description {
        margin-top: 20px;
    }

    &__header-decription-skeleton {
        width: 100%;
        height: 28px;
    }

    &__content {
        display: flex;
        flex: 1;
        margin-top: 28px;
    }

    &_mobile {
        // there may be a return button with l size in header on mobile
        // fixed height removes header height jumps
        $buttonLHeight: 36px;

        .#{$class}__page-wrapper {
            top: 0;
            padding-top: 20px;
        }

        .#{$class}__page {
            padding: 0 16px;
            max-width: 100vw;
        }

        .#{$class}__header {
            margin-bottom: 10px;
            height: $buttonLHeight;
        }

        .#{$class}__header-title-wrapper {
            max-width: 100%;
        }

        .#{$class}__header-title {
            @include overflow-ellipsis;
            @include text-header-1;
            max-width: 100%;
            display: block;
        }

        .#{$class}__content {
            margin-top: 8px;
        }
    }

    &__action-bar-group-left {
        flex-grow: 1;
    }

    &__action-bar-group-item {
        width: 100%;
    }
}
