/**
* Copyright (c) 2022 - present TinyVue Authors.
* Copyright (c) 2022 - present Huawei Cloud Computing Technologies Co., Ltd.
*
* Use of this source code is governed by an MIT-style license.
*
* THE OPEN SOURCE SOFTWARE IN THIS PRODUCT IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL,
* BUT WITHOUT ANY WARRANTY, WITHOUT EVEN THE IMPLIED WARRANTY OF MERCHANTABILITY OR FITNESS FOR
* A PARTICULAR PURPOSE. SEE THE APPLICABLE LICENSES FOR MORE DETAILS.
*
*/

@import '../custom.less';
@import '../mixins/hairline.less';
@import './vars.less';

@dropdown-item-prefix-cls: ~'@{css-prefix}mobile-dropdown-item';

.@{dropdown-item-prefix-cls} {
  position: fixed;
  right: 0;
  left: 0;
  z-index: 10;
  overflow: hidden;

  &--up {
    top: 0;
  }

  &--down {
    bottom: 0;
  }

  &__content {
    position: absolute;
  }

  &__cell {
    position: relative;
    display: flex;
    box-sizing: border-box;
    width: 100%;
    overflow: hidden;
    font-size: 14px;
    background-color: #fff;
  }

  &__option {
    height: 48px;
    line-height: 48px;
    padding: 0 16px;
    text-align: left;
    outline: 0;
    cursor: pointer;

    &:after {
      content: ' ';
      display: block;
      height: 1px;
      width: 100%;
      margin-left: 16px;
      border-top: 1px solid #ddd;
      color: #ddd;
      transform: scaleY(0.5);
      transform-origin: 0 0;
      position: absolute;
      top: auto;
      right: auto;
      bottom: 0;
      left: 0;
    }

    &-title {
      position: relative;
      overflow: hidden;
      color: #333;
      flex: 1;
    }

    &-value {
      padding-left: 8px;
      font-size: 16px;
    }

    &.is-active &-title {
      color: #f36f64;
    }
  }

  &__filter {
    max-height: 408px;
    overflow: hidden;

    &-wrap {
      width: 100%;
      height: calc(100% - 76px);
      padding: 16px 12px 0 16px;
      overflow: hidden;
      overflow-y: auto;
    }

    &-item {
      flex-flow: column;

      &:not(:first-child) {
        margin-top: 22px;
      }
    }

    &-title {
      display: block;
      color: #666;
    }

    & &-li {
      display: inline-flex;
      align-items: center;
      box-sizing: border-box;
      height: 32px;
      padding: 0 16px;
      border-radius: 2px;
      margin: 8px 8px 8px 0;
      color: #333;
      background: #f5f5f5;

      &.checked {
        padding: 0 15px;
        background: #fff;
      }
    }

    &-operate {
      display: flex;
      flex-grow: column;
      padding: 16px;
      .hairline('top', #ddd);

      button {
        width: 50%;
        flex: 1;

        &:first-child {
          margin-right: 16px;
        }
      }
    }
  }
}
