#customize-controls ul[id^="sub-accordion-panel-hfg"] {
  > li:not(.panel-meta) {
    margin: 12px;
    border: 0 !important;

    h3.accordion-section-title {
      font-size: 1em;
      color: #23282d;
      box-shadow: 0 1px 1px rgba(0, 0, 0, .04);
      border: 1px solid #e5e5e5 !important;
      transition: none;

      &:after {
        content: "\f139";
        color: #23282d;
      }

      &:focus, &:hover {
        box-shadow: 0 1px 2px rgba(0, 0, 0, .1);
        background: #fff;
        border: 1px solid #999 !important;
      }
    }
  }

  > li.panel-meta {
    margin: 0;
  }
}

ul[id^="sub-accordion-panel-hfg"] > li.accordion-section:not(.panel-meta) {
  display: none !important;
}

.hfg--device-panel.hfg--panel-mobile .hfg--cp-sidebar .hfg--cb-row .hfg--row-inner .hfg--cb-items.hfg--sidebar-items {
  height: calc(100% - 30px);
}

.hfg--cp-sidebar .hfg--cb-row .hfg--row-inner .row--grid {
  height: 30px;
  bottom: -5px;
  top: initial;
  position: relative;
  width: 100%;
  align-items: center;
  justify-content: center;

  div {
    width: 100%;
    flex-basis: 100%;
    max-width: 100%;
  }
}

.hfg--cp-sidebar .hfg--cb-row .hfg--row-inner:hover {
  .add-button--grid {
    opacity: .5;
    background: #00a0d2;

    &:hover {
      opacity: 1;
    }
  }
}

.row--grid > div {
  display: flex;
  align-items: center;
  justify-content: center;

  &:hover .add-button--grid {
    opacity: .5;
    background: #00a0d2;

    &:hover {
      opacity: 1;
    }
  }
}

.add-button--grid {
  transition: .3s ease;
  opacity: 0;
  cursor: pointer;
  z-index: 1000;
  position: relative;
  background: #ccc;
  line-height: 21px;
  color: #fff;
  border: 1px solid transparent;
  border-radius: 50%;
  height: 26px;
  width: 26px;
  text-align: center;
  padding: 0;
  font-weight: 600;
  font-size: 22px;

  &.hfg-highlight {
    opacity: 0.4;
  }

  &:focus {
    outline: none;
    border: 1px solid #0360d2;
  }
}

body.hfg--widgets-open .wp-full-overlay:after {
  content: "";
  display: block;
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(0, 0, 0, 0.5);
  width: 100%;
  z-index: 1;
  position: absolute;
}

.hfg--widgets-panel {
  visibility: hidden;
  width: 400px;
  margin: 0;
  z-index: 100000;
  background: #fff;
  position: absolute;
  border: 1px solid #e1e4e7;
  box-shadow: 0 3px 30px rgba(25, 30, 35, .1);

  .duplicate {
    display: none !important;
  }

  &:after, &:before {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    width: 0;
    height: 0;
    margin: 0 auto;
    border-left: 10px solid transparent;
    border-right: 10px solid transparent;
  }

  &.preview-right:after, &.preview-right:before {
    margin: 0 auto 0 60px;
  }

  &.preview-left:after, &.preview-left:before {
    margin: 0 60px 0 auto;
  }

  &:after {
    border-top: 7px solid #fff;

  }

  &:before {
    border-top: 7px solid #e1e4e7;
    bottom: -8px;
  }


  &.widgets-panel--visible {
    left: 0;
    visibility: visible;
  }

  .hfg-widgets-panel-inner {
    overflow-y: auto;
    max-height: 375px;
    height: 375px;
    background-color: #fff;
  }

  .hfg-widgets-panel-header {
    border-bottom: 1px solid #e1e4e7;
    padding-right: 15px;
    box-sizing: border-box;
    z-index: 1000;
    background: #ffffff;
    top: 0;
    width: 400px;
    display: flex;
    align-items: center;

    .hfg-component-search {
      position: relative;
      width: 100%;
      display: flex;
      align-items: center;

      input {
        width: 100%;
        height: 35px;
        border-color: #8d96a0;
        font-size: 13px;
        margin: 16px;
        padding: 11px 16px 11px 30px;
        position: relative;
        border-radius: 4px;
      }

      i {
        position: absolute;
        left: 22px;
        z-index: 100;
        color: #8d8d8d;
      }
    }

    button {
      margin-left: auto;
      display: flex;
      align-items: center;
      text-decoration: none;
      color: #333;

      &:hover {
        background: 0;
      }
    }
  }

  .hfg--widgets {
    display: none;
    flex-direction: row;
    flex-wrap: wrap;

    &.widgets--visible {
      display: flex;
    }

    .grid-stack-item {
      display: flex;
      width: 33.3%;
      align-items: flex-start;
      justify-content: center;
      height: auto;
      box-sizing: border-box;
      transition: .15s color ease-in-out, .15s background-color ease-in-out, .15s border-color ease-in-out;
      background: #fff;
      text-align: center;
      padding: 7px;

      &:hover {
        .grid-stack-item-content {
          background: #f3f3f5;
          border-bottom-color: #ccc;
        }
      }

      .grid-stack-item-content {
        border-radius: 4px;
        color: #545d66;
        width: 100%;
        display: flex;
        flex-direction: column;
        line-height: 1.4em;
        font-size: 13px;
        background-color: transparent;

        .hfg--cb-item-name {
          color: #32373c;
          padding: 4px 2px 8px;
        }

        .icon {
          padding: 12px 20px;

          i {
            font-size: 24px;
          }
        }
      }

      .hfg-cb-icon, .item-tooltip {
        display: none;
      }
    }
  }
}

.hfg--sidebar-visible {
  display: none;
}

.hfg--widgets-panel {
  .hfg--sidebar-visible {
    display: block;

    &.description {
      color: #72777c;
      font-weight: 300;
      font-size: 12px;
      padding-top: 5px;
    }
  }

  .grid-stack-item-content {
    display: flex;
    flex-direction: column;
    align-items: center;
  }
}

.hfg--sidebar-items .grid-stack-item {
  pointer-events: initial;
}

.hfg-highlight {
  animation: hfg-highlight 1s infinite;
}

@keyframes hfg-highlight {
  50% {
    border-color: #03a9f4;
  }
}

.hfg--component-preview {
  position: absolute;
  top: 0;
  bottom: 0;
  z-index: -100;
  left: 0;
  width: 255px;
  padding: 20px;
  background: #fff;
  border: 1px solid #e1e4e7;
  display: flex;
  flex-direction: column;
  margin: -1px 0;

  img {
    margin-top: auto;
  }

  .hfg--widgets-panel.preview-left &.visible {
    transform: translateX(-100%);
  }

  .hfg--widgets-panel.preview-right &.visible {
    left: 100%;
  }

  .hfg--widgets-panel:not(.preview-right):not(.preview-left) &.visible {
    left: 100%;
  }

  .header {
    border-bottom: 1px solid #e1e4e7;
    padding-bottom: 20px;
    padding-left: 40px;
  }

  .title-wrap {
    font-weight: 600;

    .icon {
      position: absolute;
      left: 20px;
    }
  }

  .description {
    margin-top: 10px;
    line-height: 1.6;
  }
}

.hfg--cp-sidebar {
  position: relative;

  .toggle {
    position: absolute;
    top: -24px;
    right: -1px;
    padding: 2px 10px;
    font-weight: 600;
    text-decoration: none;

		@include rtl() {
			right: unset;
			left: -1px;
		}

    span.hide {
      display: none;
    }

    &.active {
      span.hide {
        display: block;
      }

      span.show {
        display: none;
      }
    }
  }
}

@for $i from 1 through 30 {
  .hfg--widgets .grid-stack-item.order-#{$i} {
    order: #{$i};
  }
}
