@import 'moda-themes/themes';
@import '03-helpers/01-helpers-hide.scss';

.leftnav-section {
  font-family: font-family('sans');
  position: relative;
  width: 100%;
  user-select: none;
  font-size: 13px;

  ul {
    padding: 0px;
  }

  @include range-desktop {
    border-bottom: 1px solid color('cashmere');
  }

  &.disabled {
    &:before {
      content: '';
      display: block;
      position: absolute;
      left: -12px;
      right: -12px;
      top: 0;
      bottom: 0;
      background-color: rgba(white, 0.7);
    }
  }

  &.compact {
    .collapsible-container {
      margin: 0 -24px 0 -12px;
    }

    .leftnav-search-box {
      margin-right: 24px;
    }
  }

  .leftnav-section-results {
    margin: 0 -12px 12px -12px;

    &.compact {
      margin-right: -24px;
      max-height: 250px;
      -webkit-padding-end: 12px;
      overflow-y: scroll;
      overflow-y: overlay;

      &::-webkit-scrollbar {
        width: 12px;
      }

      &::-webkit-scrollbar-track {
        background: color('white');
      }

      &::-webkit-scrollbar-thumb {
        background: color('noise');
      }

      &::-webkit-scrollbar-thumb:hover {
        background: color('cashmere');
      }
    }
  }

  .leftnav-section-header {
    font-family: font-family('sans');
    font-weight: bold;
    color: color('black');
    margin: 12px 0;
  }

  .collapsible-header {
    margin: 12px 0;

    .leftnav-section-header {
      margin: 0;
    }
  }

  .collapsible-container {
    margin: 0 -12px;

    .leftnav-section-results {
      margin: 0 0 12px;
    }
  }

  .leftnav-section-clear {
    color: color('cement');
    margin: 16px 12px;
    text-decoration: underline;
    cursor: pointer;
  }

  .leftnav-search-box {
    margin: 0 12px 12px;
    border: 1px solid color('cashmere');

    input {
      border: none;
      font-family: inherit;
      height: 36px;
      padding: 0px 12px;

      &:focus {
        outline: none;
      }
    }

    i {
      color: color('black');
      margin-left: 12px;
    }
  }

  .leftnav-item-header {
    margin: 4px 12px;
  }

  .leftnav-item {
    display: flex;
    align-items: center;
    height: 100%;
    line-height: 20px;
    margin: 4px 0;
    padding: 0 12px;
    cursor: pointer;

    @include range-mobile {
      font-size: 14px;
      padding: 24px;
      border-bottom: 1px solid color('noise');
    }

    @include range-desktop {
      &.selected {
        background-color: color('noise');
      }

      &:hover {
        background-color: color('noise');
      }
    }

    input[type='checkbox'] {
      display: none;
    }

    input[type='checkbox'] + label {
      align-self: flex-start;
      width: 12px;
      height: 12px;
      margin: 4px 6px 0 0;
      background: color('white') left top no-repeat;
      border: 1px solid color('black');
      cursor: pointer;

      @include range-mobile {
        height: 18px;
        width: 18px;
        margin-right: 20px;
      }
    }

    input[type='checkbox']:checked + label {
      background: color('black') -19px top no-repeat;
    }

    .leftnav-item-label {
      color: color('cement');
      vertical-align: middle;
    }

    .leftnav-item-count {
      color: color('nokia');
      float: right;
      vertical-align: middle;
      margin-left: auto;
    }
  }
}
