/* Datepicker */
.flatpickr-calendar {
  margin-top: 9px;
  box-shadow: 0 3px 13px rgba(0,0,0,.08);

  &.open {
    // will-change: left;
    // transition: left 0.2s ease;
  }

  &:after {
    margin: 0 -9px;
    border-width: 9px;
  }

  &:before {
    border-width: 10px;
    margin: 0 -10px;
  }

  &.arrowTop:after { border-bottom-color: $datepicker-main-background; }
  &.arrowBottom:after { border-top-color: #fff; }
}

/* Tippy */
.tippy-tooltip .tippy-content {
  font-size: 13px !important;
}
.tippy-tooltip.abrs-tippy-theme,
.tippy-tooltip.booking-popup-theme {
  color: #444;
  background-color: #fff;
  font-size: 13px;
  width: 180px;
  border-radius: 1px;
  padding: 0;
  box-shadow: 1px 2px 7px rgba(0, 0, 0, .07);
}
.tippy-tooltip.booking-popup-theme {
  width: 380px;
}
.tippy-popper[x-placement^=top] .tippy-tooltip.abrs-tippy-theme .tippy-arrow,
.tippy-popper[x-placement^=top] .tippy-tooltip.booking-popup-theme .tippy-arrow {
  border-top-color: #fff;
  transform: scale(1.3);
}
.tippy-popper[x-placement^=bottom] .tippy-tooltip.abrs-tippy-theme .tippy-arrow,
.tippy-popper[x-placement^=bottom] .tippy-tooltip.booking-popup-theme .tippy-arrow {
  border-bottom-color: #fff;
  transform: scale(1.3);
}

/* Selectize */
.selectize-input {
  margin: 1px;
  padding: 4px 8px;
  border-radius: 0;
  box-shadow: inset 0 1px 2px rgba( 0, 0, 0, 0.05 );
  max-width: 100%;

  &.focus {
    border-color: #5b9dd9;
    box-shadow: 0 0 2px rgba( 30, 140, 190, 0.8 );
  }

  &.dropdown-active {
    border-radius: 0;
  }

  .selectize-control.single &:after {
    right: 8px;
  }
}

/* Swal2 Toast */
.swal2-container {
  z-index: 99999;
}

.swal2-popup.swal2-toast {
  border-radius: 50px;

  .swal2-actions > .button {
    @extend .abrs-button;
  }

  .swal2-actions > .button + .button {
    margin-left: 7px;
  }

  &.swal2-show {
    animation: showSweetToast .25s;
  }

  &.swal2-hide {
    animation: hideSweetToast .15s forwards;
  }
}

/* CMB2 */
.cmb2-wrap.awebooking-wrap {
  font-size: 13px;

  select {
    margin: 1px;
  }

  textarea {
    width: 100%;
    height: 150px;
  }

  textarea,
  input[type="text"],
  input[type="email"],
  input[type="search"],
  input[type="number"],
  input[type="password"] {
    padding: 3px 5px;

    @include in-small() {
      font-size: 16px;
      padding: 6px 10px;
    }
  }

  input:not([type=hidden]) + input,
  input:not([type=hidden]) + select,
  input:not([type=hidden] ) + .button,
  input:not([type=hidden] ) + .button-secondary {
    margin-left: 5px;
  }

  // CSS description.
  p.cmb2-metabox-description,
  span.cmb2-metabox-description {
    color: inherit;
    font-style: inherit;
  }

  .cmb-type-multicheck .cmb-td > p:first-child {
    margin-top: 0;
  }

  // Group fields.
  .cmb-type-group {
    > .cmb-th {
      width: 200px;
    }

    > .cmb-th + .cmb-td {
      float: none;
      width: auto;
    }
  }

  // File remove button.
  .cmb2-media-status {
    display: flex;
    flex-wrap: wrap;

    .img-status {
      display: block;
      margin-top: 10px;
      margin-right: 10px;
    }

    .img-status img {
      margin: 0;
      padding: 0;
      border: none;
      border-radius: 0;
    }

    .img-status.ui-sortable-placeholder {
      border: dashed 2px #eee;
      visibility: visible !important;
      box-sizing: border-box;
    }
  }

  .img-status .cmb2-remove-file-button,
  .embed-status .cmb2-remove-file-button {
    color: #fff;
    background: #f54646;
    font-size: 0;
    text-indent: -2000px;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(#000, 0.2);
    transition: transform 0.15s cubic-bezier(0.680, -0.550, 0.265, 1.550);

    top: -7px;
    left: -7px;
    width: 20px;
    height: 20px;
    display: none;

    &:before {
      top: 0;
      left: 0;
      position: absolute;
      font-size: 20px;
      line-height: 20px;
      @include pseudoicon("\f335");
    }

    &:active {
      transform: scale(2);
    }
  }
  .img-status:hover .cmb2-remove-file-button,
  .embed-status:hover .cmb2-remove-file-button {
    display: block;
  }

  // Fix post search.
  .cmb2-post-search-button {
    background-color: #eee;
    padding: 3px;
    margin: 0 0 0 5px !important;
    vertical-align: middle;
    border-radius: 15px;
    width: 24px;
    height: 24px;
    line-height: 24px;
    cursor: pointer
  }

  .wp-picker-container.wp-picker-active {
    float: left;
  }

  .cmb-inline li {
   padding-right: 1em;
  }

  .wp-editor-wrap {
    overflow: hidden;
  }

  .cmb-type-textarea-code .CodeMirror-wrap {
    border: solid 1px #eee;
  }

  .cmb-th > label > .dashicons {
    color: #1f8fe8;
    font-size: 16px;
    vertical-align: middle;
  }
}

// Inline form.
.cmb2-inline-metabox {
  .cmb-th,
  .cmb-td,
  .cmb-th + .cmb-td {
    padding: 0;
    width: auto;
    float: none !important;
  }

  .cmb-th {
    color: inherit;
    vertical-align: middle;
  }

  .cmb-th > label {
    padding-top: 0;
    padding-bottom: 7px;
    display: inline-block;
  }

  .cmb2-tooltip {
    vertical-align: top;
    display: inline-block;

    .dashicons {
      font-size: 14px;
      width: auto;
      height: auto;
    }
  }
}

// Widget area.
.widget-content .cmb2-inline-metabox {
  > .cmb-row {
    margin-top: 1em;
    margin-bottom: 1em;
  }

  .cmb-th > label {
    font-weight: 400;
    padding-bottom: 3px;
  }
}

.sup-placeholder {
  color: #999;
  font-size: 11px;
  position: relative;
  top: -5px;
}
