.cart-button {
  position: relative;
  
  pointer-events: all;
  cursor: pointer;

  justify-self: end;

  @media (max-width: 767px) {
    position: fixed;
    top: 22px;
    right: 20px;
  }

  &__label-wrap {
    position: relative;
  }

  &__line {
    position: absolute;
    bottom: 0;
    left: 0;
  
    width: 100%;
    height: 1px;
  
    background-color: var(--color-text);
  }
  
  &__number-wrap {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
  
    display: grid;
    grid-template-areas: 'element';
    align-items: center;
    justify-content: center;  
  }

  &__number-bg {
    grid-area: element;
    width: 25px;
    height: 25px;
    border-radius: 50%;
  
    background-color: var(--color-accent);
  }
  
  &__number {
    font-size: 12px;
    grid-area: element;
    text-align: center;
  }
}

.cart {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;

  z-index: 1001;

  &__bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255,255, 255, 0.8);
  }

  &__inner {
    position: absolute;
    top: 20px;
    right: 20px;

    width: 600px;
    height: calc(100vh - 40px);

    padding: 120px 20px 20px;

    display: flex;
    flex-direction: column;
    justify-content: space-between;

    @media (max-width: 767px) {
      width: calc(100% - 40px);

      padding: 100px 20px 20px;
    }
  }

  &__inner-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--color-bg);
    z-index: 0;
  }

  &__inner-close {
    font-size: 16px;

    position: absolute;
    top: 20px;
    right: 20px;

    text-decoration: underline;

    cursor: pointer;
    z-index: 2;
  }
}

.cart-items {
  position: relative;

  display: flex;
  flex-direction: column;
  gap: 60px;

  height: 65vh;
  overflow-y: auto;
  overflow-x: hidden;

  padding-bottom: 60px;

  z-index: 1;

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

.cart-items, .cart-total {
  position: relative;
  z-index: 1;
}

.cart-grid {
  display: grid;
  grid-template-columns: 100px auto;
  gap: 60px;

  @media (max-width: 767px) {
    grid-template-columns: 60px auto;
    gap: 30px;
  }
}

.cart-item {
  position: relative;
  align-items: flex-end;

  &__img {
    width: 100px;
    height: 100px;
    object-fit: cover;

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

  &__details {
    width: 100%;
    font-size: 14px;

    display: flex;
    flex-direction: column;
    gap: 20px;

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

  &__details-title {
    font-weight: 500;
  }

  &__details-actions {
    display: flex;
    align-items: center;
    gap: 20px;
  }

  &__remove-btn {
    position: absolute;
    top: 0;
    right: 0;

    font-weight: 500;
    color: rgba(0, 0, 0, 0.2);
    text-decoration: underline;
  }

  &__details-wrap {
    width: 100%;
    display: flex;
    justify-content: space-between;
  }
}

.cart-total {
  width: 100%;

  &__inner {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: repeat(2, 1fr);
    gap: 30px;

    grid-column: 2/ 2;

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

  &__label {
    font-weight: 500;
  }

  &__amount {
    text-align: right;
  }

  &__taxes {
    font-size: 12px;

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