@import '../../_global/styles/mixins';
@import '../../_global/styles/vars';

.ihk-switch {
  position: absolute;
  left: 42px;
  top: 100%;
  width: 400px;
  font-size: 18px;
  transform: translate3d(0, 20px, 0);
  @include hide;

  &::after {
    content: "";
    position: absolute;
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 0 16px 16px 16px;
    border-color: transparent transparent var(--theme-color-primary) transparent;
    bottom: 100%;
    left: 30px;
  }

  @media(max-width: 1199px) {
    left: 30px;

    &::after {
      border-width: 0 12px 12px 12px;
      left: 24px;
    }
  }

  @media(max-width: 767px) {
    left: 20px;
    max-width: calc(100% - 40px);
    font-size: 16px;

    &::after {
      border-width: 0 10px 10px 10px;
      left: 20px;
    }
  }

  &[data-show-step] {
    @include show;
    transform: translate3d(0, 0, 0);

    &.hide {
      @include hide;
    }
  }

  .step {
    position: absolute;
    background-color: var(--theme-color-primary);
    color: white;
    padding: 50px 30px 30px;
    outline: 1px solid rgba(white, 0.1);
    display: none;
    width: 100%;

    @media(max-width: 767px) {
      padding: 44px 20px 22px;
    }
  }

  &[data-show-step="geolocation"] [data-step="geolocation"],
  &[data-show-step="form"] [data-step="form"],
  &[data-show-step="switch"] [data-step="switch"],
  &[data-show-step="success"] [data-step="success"] {
    display: block;
  }

  [data-step="success"] {
    text-align: center;

    .large {
      display: block;
      font-size: 1.3em;
    }

    &::after {
      content: "";
      display: block;
      height: 40px;
      background-image: url('../../assets/img/loader-switch.gif');
      background-size: 40px;
      background-position: center;
      margin: 22px 0 8px;
      background-repeat: no-repeat;
    }
  }

  .light-hidden {
    display: none;
  }

  a {
    color: white;

    &:hover {
      color: var(--theme-color-secondary);
    }
  }

  .small, .hidden {
    font-size: 16px;

    @media(max-width: 767px) {
      font-size: 13px;
    }
  }

  .buttons {
    margin-top: 28px;
    margin-left: -2px;
    margin-right: -8px;

    @media(max-width: 767px) {
      margin-top: 20px;
    }
  }

  .btn + .btn {
    margin-left: 16px;

    @media(max-width: 767px) {
      margin-left: 10px;
    }
  }

  .closer {
    position: absolute;
    top: 0;
    right: 0;
    width: 50px;
    height: 50px;
    border: 0;
    background-color: transparent;
    cursor: pointer;

    &::before, &::after {
      content: "";
      position: absolute;
      left: 50%;
      top: 50%;
      width: 24px;
      height: 2px;
      transform: translate(-50%, -50%) rotate(45deg);
      background-color: white;
      transition: 0.2s ease;

      @media(max-width: 767px) {
        width: 20px;
      }
    }

    &::after {
      transform: translate(-50%, -50%) rotate(-45deg);
    }

    @media(min-width: 768px) {
      &:hover {
        &::before, &::after {
          width: 28px;
        }
      }
    }

    @media(max-width: 767px) {
      width: 44px;
      height: 44px;
    }
  }

  strong {
    font-weight: 600;
  }

  .ihk-finder {
    margin-top: 16px;
    margin-bottom: 6px;

    @media(max-width: 767px) {
      margin-top: 12px;
    }
  }
}
