/*
 * Backpack - Skyscanner's Design System
 *
 * Copyright 2016 Skyscanner Ltd
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

@import '~bpk-mixins/index.scss';

$bpk-spacing-v2: true;

.bpk-horizontal-nav {
  &__item {
    display: inline-block;
    display: flex;

    &--space-around {
      margin-right: auto;
      margin-left: auto;
    }
  }

  &__link {
    display: inline-block;
    display: flex;
    padding: (bpk-spacing-base() - (2 * $bpk-one-pixel-rem)) bpk-spacing-lg();
    border: 0;
    border-radius: 0;
    background: none;
    text-decoration: none;
    cursor: pointer;
    fill: currentcolor;

    &--default {
      @include bpk-themeable-property(
        color,
        --bpk-horizontal-nav-link-color,
        $bpk-horizontal-nav-link-color
      );

      @include bpk-hover {
        @include bpk-border-bottom-xl($bpk-surface-highlight-day);
        @include bpk-themeable-property(
          color,
          --bpk-horizontal-nav-link-hover-color,
          $bpk-horizontal-nav-link-hover-color
        );
      }

      &:active {
        @include bpk-border-bottom-xl($bpk-line-day);
        @include bpk-themeable-property(
          color,
          --bpk-horizontal-nav-link-active-color,
          $bpk-horizontal-nav-link-active-color
        );
      }

      &-disabled {
        color: $bpk-text-disabled-day;
        cursor: not-allowed;

        &:active {
          color: $bpk-text-disabled-day;
          box-shadow: unset;
        }
      }

      &-selected {
        @include bpk-border-bottom-xl($bpk-horizontal-nav-bar-selected-color);
        @include bpk-border-bottom-xl(
          var(
            --bpk-horizontal-nav-bar-selected-color,
            $bpk-horizontal-nav-bar-selected-color
          )
        );
        @include bpk-themeable-property(
          color,
          --bpk-horizontal-nav-link-selected-color,
          $bpk-horizontal-nav-link-selected-color
        );

        @include bpk-hover {
          @include bpk-border-bottom-xl($bpk-horizontal-nav-bar-selected-color);
          @include bpk-border-bottom-xl(
            var(
              --bpk-horizontal-nav-bar-selected-color,
              $bpk-horizontal-nav-bar-selected-color
            )
          );
        }

        &:active {
          @include bpk-border-bottom-xl($bpk-horizontal-nav-bar-selected-color);
          @include bpk-border-bottom-xl(
            var(
              --bpk-horizontal-nav-bar-selected-color,
              $bpk-horizontal-nav-bar-selected-color
            )
          );
        }
      }
    }

    &--light {
      color: $bpk-text-on-dark-day;

      @include bpk-hover {
        @include bpk-border-bottom-xl($bpk-text-on-dark-day);
      }

      &:active {
        @include bpk-border-bottom-xl($bpk-text-on-dark-day);
      }

      &-disabled {
        color: $bpk-text-disabled-day;
        cursor: not-allowed;

        &:active {
          color: $bpk-text-disabled-day;
          box-shadow: unset;
        }
      }

      &-selected {
        color: $bpk-text-on-dark-day;

        @include bpk-border-bottom-xl($bpk-text-on-dark-day);

        @include bpk-hover {
          @include bpk-border-bottom-xl($bpk-text-on-dark-day);
        }

        &:active {
          @include bpk-border-bottom-xl($bpk-text-on-dark-day);
        }
      }
    }
  }
}
