ema-modal {
  input[type="checkbox"] {
    display:none;
  }
  input[type="checkbox"]:checked ~ .modal,
  input[type="checkbox"]:checked ~ .modal-background {
    display: block;
    opacity: 1;
  }

  .modal-wrapper {
    z-index: 9996;
    display: block;
  }

  .modal-background {
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    opacity: 0;
    position: fixed;
    top: 0;
    left: 0;
    display: none;
    z-index: 9998;
    transition: opacity 200ms;
  }
  .modal {
    border-radius: var(--ema-border-radius, $border-radius);
    background: var(--ema-background, $background);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    margin: auto;
    min-height: 180px;
    min-width: 180px;
    opacity: 0;
    display: none;
    box-sizing: border-box;
    z-index: 9999;
    transition: opacity 200ms;
  }
  .modal-header {
    background-color: var(--ema-background-primary, $background-primary);
    border-bottom: $border-default;
    box-sizing: border-box;
    padding: $padding;
    //height: 50px;
    .modal-title {
      margin: 0;
      box-sizing: border-box;
      font-weight: bold;
    }
    label {
      position: absolute;
      box-sizing: border-box;
      top: $padding;
      right: $padding;
      line-height: 50px;
      padding: 0 $padding 0 $padding;
      margin-top: -$padding;
      margin-right: -$padding * 0.8;
      cursor: pointer;
      z-index: 1;
    }
    label:hover img {
      opacity: 0.6;
    }
    &.modal-header-centered {
      text-align: center;
      .modal-title {
        text-align: center;
        padding-top: $padding*2;
        margin: 0 auto;
      }
      label {
        right: 50%;
        margin-left: -8px;
      }
    }
    &.modal-header-no-title {
      border-bottom: none;
      label {
        top: $padding*0.75;
      }
    }
  }
  .modal-content-render {
    padding: $padding;
    &.modal-content-centered {
      text-align: center;
      position: absolute;
      left: 50%;
      top: 50%;
      -webkit-transform: translate(-50%, -50%);
      transform: translate(-50%, -50%);
    }
  }

}