ul,
li {
  list-style: none;
  padding: 0;
  margin: 0;
}

@include b(calendar) {
  width: 100%;
  min-height: var(--calendar-height);
  background: var(--calendar-background);
  transition: all 0.5s;
  transform: translateX(0);

  @include e(week) {
    top: 0;
    left: 0;
    z-index: 3001;
    display: flex;
    width: 100%;
    height: 40px;
    line-height: 40px;
    background: var(--calendar-week-bar-background);
    color: var(--calendar-week-bar-color);
    font-size: var(--calendar-week-bar-fontsize);
  }

  @include e(week-item) {
    flex: 1;
    text-align: center;
  }

  @include e(month-head) {
    font-size: var(--calendar-day-title-fontsize);
    font-weight: 500;
    color: var(--calendar-day-color);
    margin: 20px 0 0 30px;
  }

  @include e(dates) {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
  }

  @include e(warp) {
    position: absolute;
    z-index: 2;
    width: 100%;
    height: 100%;
    left: 0;
    top: 0;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    font-size: var(--calendar-day-fontsize);
    font-weight: 400;
    color: var(--calendar-day-range-color);
  }

  @include e(dates-item) {
    position: relative;
    width: 14.28571%;
    padding-bottom: 14.28571%;

    &.active {
      @include e(warp) {
        color: var(--calendar-day-selected-color);
      }

      @include e(date-num) {
        width: 30px;
        height: 30px;
        line-height: 30px;
        border-radius: 50%;
        text-align: center;
      }

      &::before {
        content: '';
        z-index: 1;
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate3d(-50%, -50%, 0);
        width: 30px;
        height: 30px;
        border-radius: 50%;
        background: var(--calendar-day-selected-background);
        box-shadow: var(--calendar-day-today-shadow);
      }
    }

    &.disabled {
      @include e(warp) {
        color: var(--color-text-disabled);
      }
    }

    &.inrange {
      &::after {
        content: ' ';
        position: absolute;
        top: 50%;
        transform: translateY(-50%);
        z-index: 0;
        width: 100%;
        height: 30px;
        background: var(--calendar-day-range-background);
      }
    }

    &.inrange:last-child::after,
    &:nth-child(7n).inrange::after,
    &.active.inrange::after {
      border-radius: 0 15px 15px 0;
      width: calc(50% + 16px);
      right: calc(50% - 15px);
    }

    &:nth-child(7n + 1).inrange::after,
    &:not(.inrange) + .inrange::after {
      border-radius: 15px 0 0 15px;
      width: calc(50% + 16px);
      left: calc(50% - 15px);
    }

    &:not(.inrange) + .inrange:nth-child(7n)::after,
    &:not(.inrange) + .active.inrange:last-child::after {
      border-radius: 15px;
      width: 30px;
      left: calc(50% - 15px);
    }
  }
}
