.date-selection {
  &-hidden {
    display: none;
  }

  &__info-block {
    &-error {
      display: flex;
      align-items: center;
      color: $red;

      .icon {
        margin-right: 15px;
        font-size: 1rem;
      }
    }
  }

  &__annotation {
    font-size: 0.75rem;
  }

  .delivery-date::after {
    border: 0;
  }

  .calendar {
    background: $white;
    border: 0;

    &__head {
      margin-bottom: 20px;

      &-wisdom {
        display: flex;
        justify-content: space-between;
        align-items: center;
      }
    }

    &__switch {
      font-size: 1rem;
      color: $blue;
      cursor: pointer;
      text-transform: capitalize;

      &-earlier {
        .calendar__switch-icon {
          margin-right: 5px;
        }
      }

      &-latest {
        .calendar__switch-icon {
          margin-left: 5px;
        }
      }
    }

    &__month {
      font-size: 1rem;
      line-height: 1.125rem;
      font-weight: 500;
      color: $blue-ocean;
      text-align: left;
      margin: 0;
    }

    &__row {
      &_names {
        background: $white;
        color: $blue-ocean-dark;
        font-size: 0.875rem;
        font-weight: 500;
        margin: 0;
      }

      &_days {
        font-size: 0.8125rem;
        line-height: 0.8125rem;
        font-weight: 500;
      }

      &_extended {
        padding-top: 25px;
      }
    }

    &__cell {
      &_cnt {
        font-size: 0.875rem;
        border-radius: 50%;
        height: 34px;
        line-height: 34px;
        z-index: 1;
        position: relative;

        &:hover {
          border-color: transparent;

          &:after {
            content: '';
            position: relative;
            display: block;
            border-radius: 50%;
            width: 34px;
            height: 34px;
            left: calc(50% - 34px / 2);
            top: -34px;
          }
        }
      }

      &_selected,
      &:active {
        position: relative;
        background: transparent;
        color: $white;
        z-index: 1;

        &:after {
          content: '';
          position: relative;
          display: block;
          background: $blue;
          border-radius: 50%;
          width: 34px;
          height: 34px;
          top: -34px;
          left: calc(50% - 34px / 2);
          z-index: -1;
        }
      }
    }

    &__message {
      display: flex;
      justify-content: center;
      flex-direction: column;
      padding: 20px 20px 40px;
      font-weight: 500;
      font-size: 1rem;
    }

    &_rapid {
      display: inline;
      align-items: center;
      position: relative;

      &::after {
        content: '';
        position: relative;
        display: block;
        background: $ma-white;
        border-radius: 50%;
        width: 34px;
        height: 34px;
        top: -34px;
        left: calc(50% - 34px / 2);
        z-index: $circle-z-index;
      }

      .label-rapid {
        @include font-size(10);
        @include line-height(10);
        border-radius: 30px;
        border: 1px solid $white;
        background: $pacific-depths;
        position: absolute;
        bottom: -8px;
        left: 50%;
        font-weight: 700;
        transform: translate(-50%, 0);
        padding: 2px 4px;
        color: $white;
        z-index: $label-z-index;
        pointer-events: none;
      }

      &.calendar__cell_selected {
        &::after {
          background: $blue;
        }
      }
    }
  }

  &.date-selection_selected {
    border: 0;

    .delivery-types {
      padding: 0 0 10px;
      margin: 0;
      background: initial;

      &__inner {
        .btn + .btn {
          margin-top: 15px;
        }
      }
    }
  }
}

.delivery-btn {
  background-color: $blue;
  color: $white;
  pointer-events: none;

  &:not(:disabled):not(.disabled) {
    cursor: default;
  }

  &__content {
    display: flex;
    flex-direction: column;

    .title {
      font-size: 1rem;
      font-weight: 700;
      line-height: 20px;
      margin-bottom: 0;
    }

    .subtitle {
      margin-top: 2px;
      font-size: 0.875rem;
      font-weight: 400;
      line-height: 22px;
      text-wrap: auto;
    }

    & + .delivery-btn__image {
      margin-left: 5px;
    }
  }

  &__image {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 41px;
    height: 41px;
    flex-shrink: 0;

    .svg-inline--fa.fa-shipping-fast {
      font-size: 1.7rem;
      height: auto;
    }
  }
}

.delivery-container {
  .btn.btn_full {
    display: flex;
    padding: 16px 20px;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 0;
  }
}

@include media-breakpoint-up(sm) {
  .date-selection {
    .calendar {
      &__head {
        padding: 0 15px;
      }
    }
  }
}

@include media-breakpoint-up(md) {
  .date-selection {
    .delivery-date,
    .delivery-time {
      height: auto;
    }

    .calendar {
      &__message {
        padding: 50px 40px 70px;
      }

      &__head {
        padding: 0 20px;
      }

      &__cell {
        &_cnt {
          &:hover {
            &:after {
              border: 1px solid $blue;
            }
          }
        }
      }
    }
  }
}

@include media-breakpoint-up(lg) {
  .date-selection.date-selection_selected {
    .delivery-types {
      padding: 0;
    }
  }
}

@include media-breakpoint-only(lg) {
  .delivery-container {
    .btn.btn_full {
      padding: 10px;
    }
  }
}

@media screen and (max-width: 320px) {
  .date-selection {
    &__info-block {
      &-error {
        align-items: flex-start;
      }
    }
  }
}
