@import './var.scss';

:root {
    --actionsheet-height: #{$actionsheet-height};
    --actionsheet-header-height: #{$actionsheet-header-height};
    --actionsheet-header-span-height: #{$actionsheet-header-span-height};
    --actionsheet-header-span-font-size: #{$actionsheet-header-span-font-size};
    --actionsheet-active-color: #{$actionsheet-active-color};
    --actionsheet-column-font-size: #{$actionsheet-column-font-size};
    --actionsheet-column-height: #{$actionsheet-column-height};
}

.jing-actionsheet {
    display: flex;
    flex-direction: column;
    overflow: hidden;

    &__wrapper {
        height: var(--actionsheet-height);
        overflow: hidden;
    }

    &__header {
        display: flex;
        min-height: var(--actionsheet-header-span-height);
        padding: 0 var(--horizontal-gap) 0 calc(var(--horizontal-gap) * 2);
        top: var(--actionsheet-header-height);
        &-item {
            min-width: var(--actionsheet-header-height);
            margin-right: var(--horizontal-gap);
            height: var(--actionsheet-header-height);
            line-height: var(--actionsheet-header-height);
            text-align: center;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
            color: var(--color-black-2);
            span {
                position: relative;
                display: inline-block;
                height: var(--actionsheet-header-span-height);
                line-height: var(--actionsheet-header-span-height);
                font-size: var(--actionsheet-header-span-font-size);
            }
            &.on {
                color: var(--actionsheet-active-color);
                span {
                    &:after {
                        content: '';
                        display: block;
                        width: 100%;
                        height: 3px;
                        position: absolute;
                        bottom: 0;
                        left: 0;
                        background: var(--actionsheet-active-color);
                        z-index: 2;
                        border-radius: var(--border-radius-lg);
                    }
                }
            }
        }
    }

    &__column {
        width: 100%;
        font-size: 14px;
        -webkit-overflow-scrolling: touch;
        overflow-y: scroll;
        padding: 5px 0;
        height: var(--actionsheet-column-height);
        top: 88px;
        text-align: left;
        &-item {
            position: relative;
            padding: var(--horizontal-gap) 0 var(--horizontal-gap)
                calc(var(--horizontal-gap) * 2);
            border-bottom: 1px solid var(--border-color);
            &.on {
                color: var(--actionsheet-active-color);
                .checkout {
                    display: flex;
                    justify-content: center;
                    align-items: center;
                    width: 20px;
                    height: 20px;
                    position: absolute;
                    right: 1rem;
                    top: 50%;
                    margin-top: -10px;
                }
            }
            &:last-child {
                margin-bottom: 30px;
            }
        }
    }
}
