@import "./variables";

.f-drawer-main {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: $zIndex * 100;
  overflow: hidden;
  outline: 0;
  opacity: 0;
  transition: opacity 0.15s linear;
  &:before {
    content: "";
    width: 100%;
    height: 100vh;
    // padding-right: 17px;
    position: fixed;
    top: 0;
    left: 0;
    background: rgba(black, 0.5);
  }
  .f-drawer {
    position: relative;
    width: auto;
    margin: 1.75rem auto;
    pointer-events: none;
    z-index: $zIndex * 1000000;
    display: flex;
    transform: translate(-100%, 0);
    transition: all 0.3s ease-out;
    .close-drawer {
      img {
        width: 15px;
      }
    }
    &.f-drawer-small {
      max-width: 375px;
    }
    &.f-drawer-medium {
      max-width: 500px;
    }
    &.f-drawer-large {
      max-width: 700px;
    }
    .f-drawer-content {
      position: relative;
      display: flex;
      flex-direction: column;
      width: 100%;
      pointer-events: auto;
      background-clip: padding-box;
      outline: 0;
      background: #212b36;
      border-radius: $borderRadiusBase * 4;
      transition: $transition;

      .f-drawer-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 1rem $spacer;
        h3 {
          font-size: 1.5rem;
          margin: 0.5rem 0;
        }
        &:not(.close-drawer) {
          width: 100%;
          text-align: center;
        }
      }
      .f-drawer-body {
        padding: 2rem $spacer;
      }
    }
  }
  &.show {
    opacity: 1;
    overflow-x: hidden;
    overflow-y: auto;
    .f-drawer {
      top: 0;
      transform: translate(0, 0);
      &.f-drawer-center {
        align-items: center;
        min-height: calc(100% - (1.75rem * 2));
      }
    }
  }
  @media screen and (max-width: 680px) {
    .f-drawer {
      margin: 0 !important;
      height: 100vh !important;
      max-width: 100% !important;
      align-items: flex-end !important;
      .f-drawer-content {
        height: 80vh;
        max-height: 80vh !important;
        width: 100%;
        overflow-y: auto;
        .f-drawer-body {
          overflow-y: auto;
        }
      }
    }
    &.show {
      .f-drawer {
        bottom: 0 !important;
        .f-drawer-content {
        }
      }
    }
  }
}
