/**
Global styles for buttons.
**/

button:focus {
  outline: none;
}

.continue-btn {
  width: fit-content;
  text-transform: uppercase;
  height: 42rem;
  font-family: 'Plexes';
  font-size: 16rem;
  font-weight: 900;
  letter-spacing: -0.02em;
  padding: 0 18rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: transparent;
  position: relative;
  border: none;
  outline: none;
  cursor: pointer;

  &::after {
    content: '';
    width: 100%;
    height: 100%;
    position: absolute;
    bottom: 0;
    left: 0;
    z-index: 0;
    border-radius: 30rem;
    box-sizing: border-box;
    pointer-events: none;
    transition: transform 1s var(--curve), opacity 1s var(--curve);
  }

  &::after {
    background: var(--white);
  }

  & > span,
  svg {
    z-index: 1;
    color: var(--black);
    transition: opacity 1s var(--curve);
  }
  .flip {
    line-height: 0.8;
    top: 0.05em;
    position: relative;
    .flip-text {
      display: inline-block;
    }
    .flip-text:last-child {
      left: 0;
    }
  }
  svg {
    width: auto;
    height: 0.7em;
    margin-left: 12rem;
    fill: currentColor;
    position: relative;
    top: -0.05em;
  }

  &:hover {
    & > span, svg {
      opacity: 1;
    }
    &::after {
      transform: scale(0.95);
      opacity: 0.5;
    }
    .flip-text {
      &:nth-child(1) {
        span {
          transform: translateY(-110%) !important;
          
        }
      }
      &:nth-child(2) {
        span {
          transform: translateY(0%) !important;
        }
      }
    }
  }
  &:not(:hover) {
    .flip-text {
      &:nth-child(1), &:nth-child(2) {
        span {
          transition-duration: 0s;
          transition-delay: 0s;
        }
      }
    }
  }
  &.dark {
    &::after {
      background: #333333;
    }
    & > span, svg {
      color: var(--white);
    }
  }
  &.border {
    &::after {
      background: transparent;
      border: 1px solid currentColor;
    }
  }
}

.button-underline {
  display: inline-flex;
  align-items: center;
  font-weight: 500;
  text-transform: uppercase;
  position: relative;
  font-size: 16rem;
  cursor: pointer;
  &::before, &::after {
    content: '';
    width: 100%;
    height: 1rem;
    position: absolute;
    bottom: 0px;
    left: 0;
    background: currentColor;
    transform-origin: 0% 50%;
    transition: transform 1s cubic-bezier(0, 0.51, 0, 1);
  }
  &::before {
    transform: scaleX(0);
  }
  &::after {
    transform-origin: 100% 50%;
    transition-delay: 0.2s;
  }

  svg {
    width: auto;
    height: 1em;
    margin-left: 10rem;
    position: relative;
    top: -0.1em;
    fill: currentColor;
  }

  &:hover {
    &::before {
      transform: scaleX(1);
      transition-delay: 0.2s;
    }
    &::after {
      transform: scaleX(0);
      transition-delay: 0s;
    }
  }
  @media (max-width: 580px)  {
    font-size: 14px;
  }
}
.button-prev, .button-next {
  width: 48rem;
  height: 48rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
  cursor: pointer;
  &::before {
    content: '';
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 0;
    border-radius: 50%;
    background: #333333;
    transition: transform 1s var(--curve), background 1s var(--curve);
  }
  svg {
    width: 30%;
    height: auto;
    fill: currentColor;
    z-index: 1;
    use {
      transition: transform 1s var(--in-out);
    }
  }
}
html:not([data-touch="true"]) {
  .button-prev, .button-next {
    &:hover {
      &::before {
        transform: scale(1.1);
        background: #222222;
      }
    }
  }
}
.button-prev {
  svg {
    use {
      &:nth-child(1) {
        transition-delay: 0.12s;
      }
      &:nth-child(2) {
        transform: translateX(110%);
        transition-delay: 0s;
      }
    }
  }
  &:hover {
    svg {
      use {
        &:nth-child(1) {
          transform: translateX(-110%);
          transition-delay: 0s;
        }
        &:nth-child(2) {
          transform: translateX(0%);
          transition-delay: 0.12s;
        }
      }
    }
  }
}
.button-next {
  svg {
    use {
      &:nth-child(1) {
        transition-delay: 0.12s;
      }
      &:nth-child(2) {
        transform: translateX(-110%);
        transition-delay: 0s;
      }
    }
  }
  &:hover {
    svg {
      use {
        &:nth-child(1) {
          transform: translateX(110%);
          transition-delay: 0s;
        }
        &:nth-child(2) {
          transform: translateX(0%);
          transition-delay: 0.12s;
        }
      }
    }
  }
}
html[data-os="windows"] {
  .continue-btn {
    .flip {
      top: -0.05em;
    }
  }
}