@import 'typography';
@import 'CTAs';
@import 'elements';
@import 'overrides';
@import 'print';
@import 'scroll-disable';
@import 'app';
@import 'rewards-counter';
@import 'vat-toggle';
@import 'loading-button';

// common
body {
  > img {
    display: none;
  }

  &.page-responsiveHomePage {
    .hybris-class {
      overflow: hidden;
    }
  }
}

.icon {
  display: inline-block;
  height: 24px;
  line-height: 24px;
  width: 24px;
  text-align: center;
}

.component {
  padding-top: 30px;
  padding-bottom: 40px;

  &_filled {
    background: $gray-light;

    .card__inner {
      border: 0;
    }
  }

  &__actions {
    margin-bottom: -10px;
    text-align: center;
  }
}

// hr
hr {
  border-bottom: 1px solid $gray;
  border-top: 0;
  margin: 0;
}

//text is visible only for screenreader
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

main {
  padding-top: 40px;
  padding-bottom: 40px;

  &.banner-inside {
    padding-top: 0;
  }
}

.left-aside {
  @include make-col-ready;
  @include make-col(12);

  .page-header {
    &::before {
      display: block;
    }
  }
}

.right-aside {
  @include make-col-ready;
  @include make-col(12);

  .full-width-content & {
    display: none;
  }
}

.content {
  @include make-col-ready;
  @include make-col(12);

  .full-width-content & {
    @include make-col(12);
  }
}

.page-header {
  &_border-all {
    border-bottom: 1px solid $gray;
    padding-bottom: 30px;
  }

  .layout_left-aside &,
  .layout_right-aside & {
    @include make-col-ready;
    @include make-col(12);
  }

  .layout_right-aside & {
    padding-bottom: 30px;

    &::before {
      content: '';
      background: $gray;
      position: absolute;
      height: 1px;
      bottom: 0;
      left: 15px;
      right: 15px;
    }
  }

  &__title {
    margin-bottom: 0;
  }

  &__intro {
    @include primary-text;
    @include intro;
    margin-bottom: 0;
  }

  &__back-link {
    @include link-primary;
    @include heading-5;
    display: inline-block;
    margin-bottom: 30px;
  }
}

.description-list {
  @include clearfix;
  padding: 5px 0 0;
  margin: 0;

  dt {
    clear: left;
    margin-right: 5px;
    font-weight: bold;
  }

  dt,
  dd {
    float: left;
  }
}

.disc-list {
  margin: 0 0 0 10px;
  padding: 5px 0 0;
  font-size: 6px;

  &__item {
    padding: 0 10px 0 5px;
    list-style-type: disc;
    line-height: 1.625rem;
    vertical-align: text-top;
  }

  &__text {
    display: inline-block;
    vertical-align: top;
    font-size: 0.875rem;
  }
}

.tel-uri {
  color: inherit;
  text-decoration: none;
  cursor: default;
  white-space: nowrap;

  &:hover {
    color: inherit;
    text-decoration: none;
  }
}

.touch-device {
  .tel-uri {
    @include link-secondary;
    text-decoration: underline;
  }
}

.product-code {
  display: inline-block;
  padding: 2px 10px;
  background-color: $gray-bg;
  font-size: 0.875rem;
  line-height: 1.375rem;
  border-left: 2px solid $gray;

  &__empty {
    padding: 2px 10px;
  }
}

.review-stars {
  background: url('../img/stars.svg') top left no-repeat; //todo: fix with proper image
  width: 78px;
  height: 14px;
  display: inline-block;
  vertical-align: middle;
  margin-bottom: 2px;
  margin-right: 7px;

  &-average {
    color: $warm-grey;
  }
}

.map-container {
  margin: 0 0 40px;

  img {
    @include img-fluid;
  }
}

.icon-info-component {
  color: $warm-grey;
  font-size: 1rem;

  [data-prefix='far'] {
    display: none;
  }

  [data-prefix='fas'] {
    display: inline-block;
  }

  &:hover [data-prefix='far'] {
    display: inline-block;
    color: $blue-dark;
  }

  &:hover [data-prefix='fas'] {
    display: none;
  }
}

// sass-lint:disable no-important
.js-selectable {
  cursor: pointer;

  &_selected {
    border-color: $blue !important;
    cursor: default;
  }
}

.content__list {
  padding-left: 1rem;

  li {
    margin-bottom: 10px;
  }
}

.invalid-card {
  background-color: $gray-bg;
  color: $pewter;

  dt {
    color: $pewter !important;
  }

  .card-content {
    &__outer-wrap {
      background-color: $gray-bg !important;
      color: $pewter;
    }

    &__inner-wrap {
      padding: 15px;
    }
  }

  .checkout-payment-details__action {
    .btn-edit-card {
      display: none !important;
    }
  }
}

.inactive-el {
  color: $warm-grey !important;
}

.red-border {
  border: 1px solid $red;
}

.loader {
  border: 2px solid transparent;
  border-radius: 50%;
  border-top: 3px solid $blue-dark;
  width: 60px;
  height: 60px;
  animation: spin 0.75s linear infinite;
  position: absolute;
  left: calc(50% - 30px);
  top: calc(50% - 30px);
  z-index: 1;

  &-wrapper {
    height: calc(100vh - 258px);
    position: relative;
  }
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(360deg);
  }
}

@include media-breakpoint-down(md) {
  .left-aside {
    // TODO: fix bottom margin in scope of left nav refactoring
    .layout_left-aside & {
      margin-bottom: 75px;
      order: -1;
    }
  }

  .page-header {
    &__intro {
      margin-top: 10px;
    }
  }

  .card-content {
    &__inner-wrap {
      display: block;
      width: 100%;
    }
  }

  .loader {
    &-wrapper {
      height: calc(100vh - 112px);
    }
  }
}

@include media-breakpoint-down(sm) {
  // prevent content twitching on scroll appear/disappear after main menu open/close
  body {
    overflow-y: scroll;
  }

  main {
    padding-top: 30px;
  }

  .right-aside {
    margin-top: 40px;
  }

  .page-header {
    margin-bottom: 30px;

    &--small-indent {
      margin-bottom: 10px;
    }
  }

  .product-code {
    @include additional-text;

    &__empty {
      display: none;
    }
  }

  .js-down-sm-hidden {
    display: none;
  }

  .pageLabel--buying-guides-flooring-luxury-vinyl-flooring .footer-btn {
    max-width: calc(100% - 30px);
    white-space: break-spaces;
  }
}

@include media-breakpoint-down(xs) {
  a,
  p {
    word-wrap: break-word;
  }

  .map-container {
    margin-left: -15px;
    margin-right: -15px;
  }
}

@include media-breakpoint-only(md) {
  .right-aside {
    @include make-col(4);
  }

  .content {
    .layout_right-aside & {
      @include make-col(8);
    }
  }
}

@include media-breakpoint-up(md) {
  .page-header {
    margin-bottom: 40px;

    &--small-indent {
      margin-bottom: 20px;
    }

    &__back-link {
      position: absolute;
      top: 0;
      left: 15px;
    }
  }

  .right-aside-sticky.stuck {
    position: fixed;
    top: 10px;
    z-index: 5;
    height: 100%;
    width: 210px;
    overflow: auto;
  }

  .card-content {
    &__outer-wrap,
    &__inner-wrap {
      display: flex;
      flex-basis: 100%;
    }
  }
}

@include media-breakpoint-up(lg) {
  .left-aside,
  .right-aside {
    @include make-col(3);
  }

  .content {
    @include make-col(9);
  }

  .page-header {
    .layout_left-aside & {
      padding-bottom: 30px;

      &::before {
        content: '';
        background: $gray;
        position: absolute;
        height: 1px;
        bottom: 0;
        left: 15px;
        right: 15px;
      }
    }

    &__intro {
      margin-top: 20px;
    }
  }

  .page-responsiveContactusPage {
    .content {
      .accordion:first-child {
        padding-top: 0;
      }
    }
  }
}

@include media-breakpoint-up(xl) {
  .right-aside-sticky.stuck {
    width: 255px;
  }
}

// Fix for https://wickesit.atlassian.net/browse/ES-329
div .design-appointment {
  display: block;
}

.klarna-logo-img {
  height: 30px;
  width: 48px;
}

.clearpay-logo-img img {
  width: 64px;
  height: auto;
}

.skeleton {
  margin: 0;
  width: 172px;
}

.skeleton.is-loading {
  p {
    background: linear-gradient(110deg, #ececec 8%, #f5f5f5 18%, #ececec 33%);
    background-size: 200% 100%;
    animation: 1s shine linear infinite;
    margin: 0;

    &:first-child {
      height: 22px;
      width: 138px;
    }

    &:last-child {
      margin-top: 5px;
      height: 17px;
    }
  }
}

@keyframes shine {
  to {
    background-position-x: -200%;
  }
}

.skeleton {
  margin: 0;
  width: 172px;
}

.skeleton.is-loading {
  p {
    background: linear-gradient(110deg, #ececec 8%, #f5f5f5 18%, #ececec 33%);
    background-size: 200% 100%;
    animation: 1s shine linear infinite;
    margin: 0;

    &:first-child {
      height: 22px;
      width: 138px;
    }

    &:last-child {
      margin-top: 5px;
      height: 17px;
    }
  }
}

@keyframes shine {
  to {
    background-position-x: -200%;
  }
}

.overflow-hidden {
  overflow: hidden;
}

.icon-wrap {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;

  &--large {
    width: 48px;
    height: 48px;
  }
}
