@import '~styles/mixins';

.body-overlay {
  position: fixed;
  top: 0;
  left: 0;
  height: 100%;
  width: 100%;
  background-color: rgba(0, 0, 0, 0.4);
  opacity: 0;
  transition: all 0.3s ease-in-out 0.5s;
  z-index: -1;

  &.is-visible {
    opacity: 1;
    z-index: 6;
  }
}

.cookie-consent-banner {
  display: flex;
  flex-direction: column;
  background-color: #000;
  min-height: 80px;
  position: fixed;
  bottom: 0;
  width: 100%;
  padding: 30px;
  opacity: 0;
  transform: translate3d(0, 100%, 0);
  transition: all 0.8s ease-in-out;
  z-index: 5;

  .policy-info {
    margin-bottom: 20px;
  }

  .title {
    color: #fff;
    margin-bottom: 20px;
  }

  .description {
    color: #fff;
  }

  button {
    display: inline-block;
    outline: none;
    background-color: transparent;
    border: 0;
    padding: 10px 20px;
    border: 2px solid #fff;
    color: #fff;
    transition: all 0.5s ease-in-out;
    cursor: pointer;

    &:hover {
      color: #000;
      background-color: #fff;
    }
  }

  button + button {
    margin-left: 20px;
  }

  a {
    color: #fff;
    text-decoration: none;
    border-bottom: 1px solid #fff;
  }

  a:hover {
    border-bottom-style: solid;
  }

  &.is-active {
    opacity: 1;
    transition-delay: 2s;
    transform: translate3d(0, 0, 0);
  }
}

.cookie-preference-dialog {
  position: fixed;
  top: 0;
  right: 0;
  height: 100%;
  background-color: #fff;
  padding: 30px;
  width: 90%;
  transform: translate3d(100%, 0, 0);
  transition: all 0.5s ease-in-out;
  z-index: 7;

  &.is-visible {
    transform: translate3d(0, 0, 0);
  }

  @media screen and (min-width: 777px) {
    width: 50%;
  }

  @media screen and (min-width: 1200px) {
    width: 40%;
  }

  .button-actions {
    position: absolute;
    bottom: 20px;
  }
}

.cookie-options-wrapper {
  margin-top: 20px;
  margin-bottom: 20px;
  .title {
    margin-bottom: 20px;
  }

  .cookie-option {
    display: flex;
    align-items: center;
  }

  .checkbox-control {
    height: 25px;
  }

  .description {
    margin-left: 40px;
    p {
      color: #000;
    }
  }

  .checkbox-container {
    display: block;
    position: relative;
    user-select: none;

    input {
      opacity: 0;
      cursor: pointer;
      height: 0;
      width: 0;
    }

    p {
      font-size: 16px;
    }

    .checkmark {
      position: absolute;
      top: 0;
      left: 0;
      height: 25px;
      width: 25px;
      background-color: transparent;
      border: 2px solid #000;
      cursor: pointer;
      transition: all 0.3s ease-in-out;
    }
  }

  .checkbox-container:hover input ~ .checkmark {
    background-color: transparent;
  }

  .checkbox-container input:checked ~ .checkmark {
    background-color: #000;
  }

  .checkmark:after {
    content: '';
    position: absolute;
    display: none;
  }

  .checkbox-container input:checked ~ .checkmark:after {
    display: block;
  }

  .checkbox-container .checkmark:after {
    left: 7px;
    top: 3px;
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 3px 3px 0;
    -webkit-transform: rotate(45deg);
    -ms-transform: rotate(45deg);
    transform: rotate(45deg);
  }
}
