/* Top Bar */
.top-bar {
  position: relative;
  font-size: 14px;
  z-index: 120;
  background-color: $primary;

  .row {
    align-items: center;
  }

  &.top-bar-color-light {
    color: rgba($white, 0.6);

    a:not(.button) {
      color: rgba($white, 0.6);

      &:hover {
        color: $white;
      }
    }
  }

  @include media-breakpoint-down(md) {
    text-align: center;
    padding-top: 10px;
    padding-bottom: 10px;
  }

}

.top-bar-col {
  @include make-col-ready();

  @include media-breakpoint-up(lg) {
    @include make-col(6);
  }
}

.top-bar-right {
  text-align: right;

  @include media-breakpoint-down(md) {
    display: none;
  }
}

/* Top Bar Links */
.top-bar-links {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-direction: row;

  a {
    outline: 0 !important;
  }
}

.top-bar-contact-info {
  list-style: none;
  padding: 0;
  margin: 0;

  li {
    display: inline-flex;
    vertical-align: middle;
    margin-right: 30px;
    &:last-child {
      margin-right: 0;
    }
  }

  i {
    margin-right: 6px;
    font-size: 18px;
    vertical-align: middle;
    float: left;
  }

  @include media-breakpoint-down(md) {
    text-align: center;
  }
}

/* Top Bar Secondary Menu */
.top-bar-secondary-menu {

  .top-menu {
    display: flex;
    flex-direction: row;
    list-style: none;
    padding: 0 0.75rem 0 0;
    margin: 0;

    > li {
      a {
        padding: 0 0.75rem;
      }
    }

    ul {
      display: none;
    }
  }
}

/* Mini Cart */
.top-bar-cart {
  position: relative;

  .dropdown-cart {
    position: absolute;
    right: 0;
    top: 100%;
    width: 350px;
    @include box-shadow($box-shadow-sm);
    background-color: $white;
    border-radius: $border-radius;
    z-index: 130;
    font-size: 15px;
    color: gray('600');
    opacity: 0;
    visibility: hidden;
    transform: translate(0, 10px);
    @include transition(all 0.25s ease);

    &.visible {
      opacity: 1;
      visibility: visible;
      transform: translate(0, 0);
    }

    .woocommerce-mini-cart__empty-message {
      text-align: center;
      margin: 20px 30px;
    }

    .cart-item-content {
      line-height: 1.5;

      .product-title {
        display: block;
        color: #464749;
        margin-bottom: 4px;

        &:hover {
          color: color('blue');
        }
      }
    }


    .woocommerce-mini-cart__total {
      border-top: 1px solid $border-color;
      text-align: center;
      font-size: 16px;
      margin-bottom: 0;
      padding: 15px 20px;
      display: flex;
      justify-content: space-between;
    }

    .woocommerce-mini-cart__buttons {
      padding: 0 20px;
      a {
        width: 100%;
        margin: 0 0 10px 0;

        &:first-child {
          @extend .btn-filled;
          @extend .btn-light;
        }

        &:last-child {
          margin-bottom: 0;
        }
      }
    }
  }
}

.mini-cart-opener {
  position: relative;
  width: 56px;
  height: 56px;
  text-align: center;
  display: block;
  background-color: rgba($black, 0.08);

  .top-bar-color-light &  {
    background-color: rgba($black, 0.22);

    svg {
      fill: $white
    }
  }

  svg {
    width: 32px;

    .top-part {
      transform: translateY(4px);
      transition: all 200ms ease-in;
    }
  }

  .bag-icon {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .studiare-cart-number {
    position: absolute;
    font-size: 10px;
    top: 10px;
    right: 10px;
    width: 16px;
    line-height: 16px;
    height: 16px;
    border-radius: 50%;
    background-color: color('blue');
    color: $white;
  }

  &:hover {
    svg .top-part {
      transform: translateY(0px);
    }
  }
}


/* Search Header */
.search-form-opener {
  width: 56px;
  height: 56px;
  display: block;
  background-color: rgba($black, 0.05);

  .top-bar-color-light & {
    background-color: rgba($black, 0.12);

    svg {
      fill: $white
    }
  }

  svg {
    width: 28px;
  }

  .close-icon,
  .search-icon {
    width: 100%;
    height: 100%;
    align-items: center;
    justify-content: center;
  }

  .close-icon {
    display: none;

    .search-active & {
      display: flex;
    }
  }

  .search-icon {
    display: flex;

    .search-active & {
      display: none;
    }
  }
}

.site-search-wrapper {
  display: flex;
  align-items: center;
  position: absolute;
  width: 100%;
  top: 50%;
  left: 0;
  transform: translateY(-40%);
  visibility: hidden;
  opacity: 0;
  z-index: -2;
  transition: all 0.3s ease-in-out;

  .search-form {
    position: relative;
    display: block;
    width: 100%;
  }

  .search-input {
    width: 100%;
    padding: 20px 15px;
    font-size: 26px;
    border: 0;
    background-color: transparent;
    outline: none;
    box-shadow: none !important;
    font-weight: 300;
  }

  .submit {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    width: 60px;
    height: 60px;
    border-radius: $border-radius;
    border: 0;
    outline: none;
    cursor: pointer;
    background-color: gray('100');
    display: flex;
    align-items: center;
    justify-content: center;

    svg {
      width: 42px;
      height: 42px;
      fill: gray('500');
    }

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

}

.search-active {

  .site-header {

    .site-header-inner {
      opacity: 0;
      transform: translateY(-10%);
    }

    .site-search-wrapper {
      visibility: visible;
      opacity: 1;
      transform: translateY(-50%);
      transition-delay: 0.2s;
      z-index: 30;
    }
  }

  .search-capture-click {
    opacity: 1;
    pointer-events: auto;
    visibility: visible;
  }

}

.search-capture-click {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 40;
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
  background-color: rgba(gray('600'), 0.1);
  transition: all 0.3s ease-in-out;
}