// 
// Main Navigation
// -----------------------------------

// Toggle button
.navbar-toggler {
  background: var(--color-primary);
  border-radius: $border-radius;
  border: 0;
  color: $white;
  display: block;
  padding: 0;
  height: 35px;
  margin-left: $spacer;
  transition: all 0.35s;
  width: 35px;

  i {
    font-size: 14px;
  }

  &:focus {
    box-shadow: none;
  }

  &:hover {
    background: var(--color-primary);
    cursor: pointer;
    color: $white;
    opacity: 0.8;
  }  
}

.t4-navbar {
  position: relative;
  padding: 0;
  @include clearfix();

  .navbar {
    float: left;

    &.navbar-expand {
      @each $breakpoint in map-keys($grid-breakpoints) {
        $next: breakpoint-next($breakpoint, $grid-breakpoints);
        $infix: breakpoint-infix($next, $grid-breakpoints);

        &#{$infix} {
          @include media-breakpoint-down($breakpoint) {
            float: none;
            display: block;
            @include clearfix();
          }        
        }
      }    
    }
  }

  // Dropdown
  .dropdown-item {
    &.dropdown-toggle {
      position: relative;

      &::after {
        position: absolute;
        right: $spacer;
        top: 50%;
        margin-top: -2px;
      }
    }
  }

  .nav-item {
    position: relative;
  }
}
 
@include media-breakpoint-up(md) {
  #t4-navbar-collapse {
    display: block !important;
  }

  .navbar-expand-lg #t4-navbar-collapse {
    display: flex !important;
  }
}

// Show toggler button
.navbar-expand {
  @each $breakpoint in map-keys($grid-breakpoints) {
    $next: breakpoint-next($breakpoint, $grid-breakpoints);
    $infix: breakpoint-infix($next, $grid-breakpoints);

    @include media-breakpoint-up($breakpoint) {
      .navbar-toggler {
        display: none;
      }
    }
  }
}


//
// The Nav
.t4-main-nav {
  // T4: Need to make the Nav horizontal on lg media.
  // Because Joomla! add .flex-column to the default menu module
  @include media-breakpoint-up(lg) {
    .navbar-nav {
      flex-direction: row !important;
    }
  }
}


//
// Breadcrumbs
// -----------------------------------
.breadcrumb {
  background-color: transparent;
  border-radius: 0;
  margin-bottom: 0;
  padding-left: 0;
  padding-right: 0;

  li.breadcrumb-item {
    &:first-child {
      color: $gray-500;
    }
  }

  .breadcrumb-item + .breadcrumb-item {
    padding-left: 0;

    &:before {
      display: none;
    }
  }

  .divider {
    display: inline-block;
    padding-right: calc($spacer / 2);
    text-align: center;

    &:before {
      color: $gray-400;
      content: "/";
      display: inline-block;
    }

    img {
      display: none;
    }
  }

  .icon {
    margin-right: calc($spacer / 2);
  }
}


//
// Pagination
// -----------------------------------
ul.pagination {
  gap: 6px;
  flex-wrap: wrap;
  
  .page-link {
    background: $white;
    border-radius: $border-radius-sm !important;
    border: 1px solid $border-color;
    color: var(--headings-color);
    text-align: center;
    line-height: $spacer-sm * 5;
    padding: 0 12px;
    min-height: $spacer-sm * 5;
    min-width: $spacer-sm * 5;
    margin-left: 0;

    @include media-breakpoint-down(sm){
      min-width: 36px;
      min-height: 36px;
      line-height: 36px;
    }

    &:hover,&:focus,&:active {
      background: var(--color-primary);
      border: none;
      color: $white;
    }
  }


  li {
    margin: 0;

    &.disabled {
      opacity: 0.4;
    }

    &.active {
      > a,
      > span {
        border: none;
        background: var(--color-primary);
        color: $white;

        &:hover,&:focus,&:active {
          background: var(--color-primary);
        }
      }
    }
  } 
}

nav[role="navigation"] {
  float: left;
}

.counter {
  background: $white;
  border-radius: $border-radius-sm;
  border: 1px solid $border-color;
  color: var(--headings-color);
  padding: $spacer-sm $spacer-lg !important;
  height: $spacer-sm * 5;
  line-height: 1.3;

  @include media-breakpoint-down(sm){
    height: 36px;
    line-height: 1.2;
    padding: $spacer-sm $spacer-lg !important;
  }
}


// Navigation bar
//-----------------------------------
.pagenav {
  border-top: 1px solid $border-color;
  border-bottom: 1px solid $border-color;
  display: flex;
  justify-content: space-between;
  list-style: none;
  padding: $spacer-xxl 0;
  margin: $spacer-xxl 0 0;
  position: relative;

  @include media-breakpoint-up(lg){
    gap: 3rem;
  }

  @include media-breakpoint-down(lg){
    padding: $spacer-lg 0 ;
    margin-top: $spacer-lg;
  }

  &::before {
    content: '';
    display: inline-block;
    background-image: url('../images/pt.png');
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
    width: 40px;
    height: 40px;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
  }

  li {
    display: inline-block;

    @include media-breakpoint-up(lg){
      width: 50%;
    }

    .nav-text {
      font-weight: 500;
      font-size: 20px;
    }

    .nav-info {
      margin-top: $spacer;

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

      p {
        font-size: 18px;
        font-weight: 400;
        margin-bottom: 0;
      }
    }

    span:before {
      color: $gray-700;
      font-size: $font-size-base;
    }

    a {
      background-color: $white;
      color: $body-color;

      &:hover, &:focus, &:active {
        text-decoration: none;
        color: var(--color-primary);

        span:before {
          color: var(--color-primary);
        }
      }
    }

    &.next {
      text-align: right;
      margin-left: auto;
    }
  }
}

// Tabs 
// ----------------------------------
.nav-tabs {
  & + .tab-content {
    padding: $spacer 0;
  }

  .nav-link.active {
    border-bottom-color: $white;
  }
}